proteus  1.8.1
C/C++/Fortran libraries
csmoothers.c
Go to the documentation of this file.
1 /* Generated by Cython 0.29.30 */
2 
3 #ifndef PY_SSIZE_T_CLEAN
4 #define PY_SSIZE_T_CLEAN
5 #endif /* PY_SSIZE_T_CLEAN */
6 #include "Python.h"
7 #ifndef Py_PYTHON_H
8  #error Python headers needed to compile C extensions, please install development version of Python.
9 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
10  #error Cython requires Python 2.6+ or Python 3.3+.
11 #else
12 #define CYTHON_ABI "0_29_30"
13 #define CYTHON_HEX_VERSION 0x001D1EF0
14 #define CYTHON_FUTURE_DIVISION 0
15 #include <stddef.h>
16 #ifndef offsetof
17  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
18 #endif
19 #if !defined(WIN32) && !defined(MS_WINDOWS)
20  #ifndef __stdcall
21  #define __stdcall
22  #endif
23  #ifndef __cdecl
24  #define __cdecl
25  #endif
26  #ifndef __fastcall
27  #define __fastcall
28  #endif
29 #endif
30 #ifndef DL_IMPORT
31  #define DL_IMPORT(t) t
32 #endif
33 #ifndef DL_EXPORT
34  #define DL_EXPORT(t) t
35 #endif
36 #define __PYX_COMMA ,
37 #ifndef HAVE_LONG_LONG
38  #if PY_VERSION_HEX >= 0x02070000
39  #define HAVE_LONG_LONG
40  #endif
41 #endif
42 #ifndef PY_LONG_LONG
43  #define PY_LONG_LONG LONG_LONG
44 #endif
45 #ifndef Py_HUGE_VAL
46  #define Py_HUGE_VAL HUGE_VAL
47 #endif
48 #ifdef PYPY_VERSION
49  #define CYTHON_COMPILING_IN_PYPY 1
50  #define CYTHON_COMPILING_IN_PYSTON 0
51  #define CYTHON_COMPILING_IN_CPYTHON 0
52  #undef CYTHON_USE_TYPE_SLOTS
53  #define CYTHON_USE_TYPE_SLOTS 0
54  #undef CYTHON_USE_PYTYPE_LOOKUP
55  #define CYTHON_USE_PYTYPE_LOOKUP 0
56  #if PY_VERSION_HEX < 0x03050000
57  #undef CYTHON_USE_ASYNC_SLOTS
58  #define CYTHON_USE_ASYNC_SLOTS 0
59  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
60  #define CYTHON_USE_ASYNC_SLOTS 1
61  #endif
62  #undef CYTHON_USE_PYLIST_INTERNALS
63  #define CYTHON_USE_PYLIST_INTERNALS 0
64  #undef CYTHON_USE_UNICODE_INTERNALS
65  #define CYTHON_USE_UNICODE_INTERNALS 0
66  #undef CYTHON_USE_UNICODE_WRITER
67  #define CYTHON_USE_UNICODE_WRITER 0
68  #undef CYTHON_USE_PYLONG_INTERNALS
69  #define CYTHON_USE_PYLONG_INTERNALS 0
70  #undef CYTHON_AVOID_BORROWED_REFS
71  #define CYTHON_AVOID_BORROWED_REFS 1
72  #undef CYTHON_ASSUME_SAFE_MACROS
73  #define CYTHON_ASSUME_SAFE_MACROS 0
74  #undef CYTHON_UNPACK_METHODS
75  #define CYTHON_UNPACK_METHODS 0
76  #undef CYTHON_FAST_THREAD_STATE
77  #define CYTHON_FAST_THREAD_STATE 0
78  #undef CYTHON_FAST_PYCALL
79  #define CYTHON_FAST_PYCALL 0
80  #undef CYTHON_PEP489_MULTI_PHASE_INIT
81  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
82  #undef CYTHON_USE_TP_FINALIZE
83  #define CYTHON_USE_TP_FINALIZE 0
84  #undef CYTHON_USE_DICT_VERSIONS
85  #define CYTHON_USE_DICT_VERSIONS 0
86  #undef CYTHON_USE_EXC_INFO_STACK
87  #define CYTHON_USE_EXC_INFO_STACK 0
88  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
89  #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)
90  #endif
91 #elif defined(PYSTON_VERSION)
92  #define CYTHON_COMPILING_IN_PYPY 0
93  #define CYTHON_COMPILING_IN_PYSTON 1
94  #define CYTHON_COMPILING_IN_CPYTHON 0
95  #ifndef CYTHON_USE_TYPE_SLOTS
96  #define CYTHON_USE_TYPE_SLOTS 1
97  #endif
98  #undef CYTHON_USE_PYTYPE_LOOKUP
99  #define CYTHON_USE_PYTYPE_LOOKUP 0
100  #undef CYTHON_USE_ASYNC_SLOTS
101  #define CYTHON_USE_ASYNC_SLOTS 0
102  #undef CYTHON_USE_PYLIST_INTERNALS
103  #define CYTHON_USE_PYLIST_INTERNALS 0
104  #ifndef CYTHON_USE_UNICODE_INTERNALS
105  #define CYTHON_USE_UNICODE_INTERNALS 1
106  #endif
107  #undef CYTHON_USE_UNICODE_WRITER
108  #define CYTHON_USE_UNICODE_WRITER 0
109  #undef CYTHON_USE_PYLONG_INTERNALS
110  #define CYTHON_USE_PYLONG_INTERNALS 0
111  #ifndef CYTHON_AVOID_BORROWED_REFS
112  #define CYTHON_AVOID_BORROWED_REFS 0
113  #endif
114  #ifndef CYTHON_ASSUME_SAFE_MACROS
115  #define CYTHON_ASSUME_SAFE_MACROS 1
116  #endif
117  #ifndef CYTHON_UNPACK_METHODS
118  #define CYTHON_UNPACK_METHODS 1
119  #endif
120  #undef CYTHON_FAST_THREAD_STATE
121  #define CYTHON_FAST_THREAD_STATE 0
122  #undef CYTHON_FAST_PYCALL
123  #define CYTHON_FAST_PYCALL 0
124  #undef CYTHON_PEP489_MULTI_PHASE_INIT
125  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
126  #undef CYTHON_USE_TP_FINALIZE
127  #define CYTHON_USE_TP_FINALIZE 0
128  #undef CYTHON_USE_DICT_VERSIONS
129  #define CYTHON_USE_DICT_VERSIONS 0
130  #undef CYTHON_USE_EXC_INFO_STACK
131  #define CYTHON_USE_EXC_INFO_STACK 0
132  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
133  #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
134  #endif
135 #else
136  #define CYTHON_COMPILING_IN_PYPY 0
137  #define CYTHON_COMPILING_IN_PYSTON 0
138  #define CYTHON_COMPILING_IN_CPYTHON 1
139  #ifndef CYTHON_USE_TYPE_SLOTS
140  #define CYTHON_USE_TYPE_SLOTS 1
141  #endif
142  #if PY_VERSION_HEX < 0x02070000
143  #undef CYTHON_USE_PYTYPE_LOOKUP
144  #define CYTHON_USE_PYTYPE_LOOKUP 0
145  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
146  #define CYTHON_USE_PYTYPE_LOOKUP 1
147  #endif
148  #if PY_MAJOR_VERSION < 3
149  #undef CYTHON_USE_ASYNC_SLOTS
150  #define CYTHON_USE_ASYNC_SLOTS 0
151  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
152  #define CYTHON_USE_ASYNC_SLOTS 1
153  #endif
154  #if PY_VERSION_HEX < 0x02070000
155  #undef CYTHON_USE_PYLONG_INTERNALS
156  #define CYTHON_USE_PYLONG_INTERNALS 0
157  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
158  #define CYTHON_USE_PYLONG_INTERNALS 1
159  #endif
160  #ifndef CYTHON_USE_PYLIST_INTERNALS
161  #define CYTHON_USE_PYLIST_INTERNALS 1
162  #endif
163  #ifndef CYTHON_USE_UNICODE_INTERNALS
164  #define CYTHON_USE_UNICODE_INTERNALS 1
165  #endif
166  #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
167  #undef CYTHON_USE_UNICODE_WRITER
168  #define CYTHON_USE_UNICODE_WRITER 0
169  #elif !defined(CYTHON_USE_UNICODE_WRITER)
170  #define CYTHON_USE_UNICODE_WRITER 1
171  #endif
172  #ifndef CYTHON_AVOID_BORROWED_REFS
173  #define CYTHON_AVOID_BORROWED_REFS 0
174  #endif
175  #ifndef CYTHON_ASSUME_SAFE_MACROS
176  #define CYTHON_ASSUME_SAFE_MACROS 1
177  #endif
178  #ifndef CYTHON_UNPACK_METHODS
179  #define CYTHON_UNPACK_METHODS 1
180  #endif
181  #if PY_VERSION_HEX >= 0x030B00A4
182  #undef CYTHON_FAST_THREAD_STATE
183  #define CYTHON_FAST_THREAD_STATE 0
184  #elif !defined(CYTHON_FAST_THREAD_STATE)
185  #define CYTHON_FAST_THREAD_STATE 1
186  #endif
187  #ifndef CYTHON_FAST_PYCALL
188  #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
189  #endif
190  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
191  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
192  #endif
193  #ifndef CYTHON_USE_TP_FINALIZE
194  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
195  #endif
196  #ifndef CYTHON_USE_DICT_VERSIONS
197  #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
198  #endif
199  #if PY_VERSION_HEX >= 0x030B00A4
200  #undef CYTHON_USE_EXC_INFO_STACK
201  #define CYTHON_USE_EXC_INFO_STACK 0
202  #elif !defined(CYTHON_USE_EXC_INFO_STACK)
203  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
204  #endif
205  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
206  #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
207  #endif
208 #endif
209 #if !defined(CYTHON_FAST_PYCCALL)
210 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
211 #endif
212 #if CYTHON_USE_PYLONG_INTERNALS
213  #if PY_MAJOR_VERSION < 3
214  #include "longintrepr.h"
215  #endif
216  #undef SHIFT
217  #undef BASE
218  #undef MASK
219  #ifdef SIZEOF_VOID_P
220  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
221  #endif
222 #endif
223 #ifndef __has_attribute
224  #define __has_attribute(x) 0
225 #endif
226 #ifndef __has_cpp_attribute
227  #define __has_cpp_attribute(x) 0
228 #endif
229 #ifndef CYTHON_RESTRICT
230  #if defined(__GNUC__)
231  #define CYTHON_RESTRICT __restrict__
232  #elif defined(_MSC_VER) && _MSC_VER >= 1400
233  #define CYTHON_RESTRICT __restrict
234  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
235  #define CYTHON_RESTRICT restrict
236  #else
237  #define CYTHON_RESTRICT
238  #endif
239 #endif
240 #ifndef CYTHON_UNUSED
241 # if defined(__GNUC__)
242 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
243 # define CYTHON_UNUSED __attribute__ ((__unused__))
244 # else
245 # define CYTHON_UNUSED
246 # endif
247 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
248 # define CYTHON_UNUSED __attribute__ ((__unused__))
249 # else
250 # define CYTHON_UNUSED
251 # endif
252 #endif
253 #ifndef CYTHON_MAYBE_UNUSED_VAR
254 # if defined(__cplusplus)
255  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
256 # else
257 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
258 # endif
259 #endif
260 #ifndef CYTHON_NCP_UNUSED
261 # if CYTHON_COMPILING_IN_CPYTHON
262 # define CYTHON_NCP_UNUSED
263 # else
264 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
265 # endif
266 #endif
267 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
268 #ifdef _MSC_VER
269  #ifndef _MSC_STDINT_H_
270  #if _MSC_VER < 1300
271  typedef unsigned char uint8_t;
272  typedef unsigned int uint32_t;
273  #else
274  typedef unsigned __int8 uint8_t;
275  typedef unsigned __int32 uint32_t;
276  #endif
277  #endif
278 #else
279  #include <stdint.h>
280 #endif
281 #ifndef CYTHON_FALLTHROUGH
282  #if defined(__cplusplus) && __cplusplus >= 201103L
283  #if __has_cpp_attribute(fallthrough)
284  #define CYTHON_FALLTHROUGH [[fallthrough]]
285  #elif __has_cpp_attribute(clang::fallthrough)
286  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
287  #elif __has_cpp_attribute(gnu::fallthrough)
288  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
289  #endif
290  #endif
291  #ifndef CYTHON_FALLTHROUGH
292  #if __has_attribute(fallthrough)
293  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
294  #else
295  #define CYTHON_FALLTHROUGH
296  #endif
297  #endif
298  #if defined(__clang__ ) && defined(__apple_build_version__)
299  #if __apple_build_version__ < 7000000
300  #undef CYTHON_FALLTHROUGH
301  #define CYTHON_FALLTHROUGH
302  #endif
303  #endif
304 #endif
305 
306 #ifndef CYTHON_INLINE
307  #if defined(__clang__)
308  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
309  #elif defined(__GNUC__)
310  #define CYTHON_INLINE __inline__
311  #elif defined(_MSC_VER)
312  #define CYTHON_INLINE __inline
313  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
314  #define CYTHON_INLINE inline
315  #else
316  #define CYTHON_INLINE
317  #endif
318 #endif
319 
320 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
321  #define Py_OptimizeFlag 0
322 #endif
323 #define __PYX_BUILD_PY_SSIZE_T "n"
324 #define CYTHON_FORMAT_SSIZE_T "z"
325 #if PY_MAJOR_VERSION < 3
326  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
327  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
328  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
329  #define __Pyx_DefaultClassType PyClass_Type
330 #else
331  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
332  #define __Pyx_DefaultClassType PyType_Type
333 #if PY_VERSION_HEX >= 0x030B00A1
334  static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
335  PyObject *code, PyObject *c, PyObject* n, PyObject *v,
336  PyObject *fv, PyObject *cell, PyObject* fn,
337  PyObject *name, int fline, PyObject *lnos) {
338  PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
339  PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
340  const char *fn_cstr=NULL;
341  const char *name_cstr=NULL;
342  PyCodeObject* co=NULL;
343  PyObject *type, *value, *traceback;
344  PyErr_Fetch(&type, &value, &traceback);
345  if (!(kwds=PyDict_New())) goto end;
346  if (!(argcount=PyLong_FromLong(a))) goto end;
347  if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
348  if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
349  if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
350  if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
351  if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
352  if (!(nlocals=PyLong_FromLong(l))) goto end;
353  if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
354  if (!(stacksize=PyLong_FromLong(s))) goto end;
355  if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
356  if (!(flags=PyLong_FromLong(f))) goto end;
357  if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
358  if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
359  if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
360  if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
361  if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
362  if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
363  if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
364  if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
365  if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
366  if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
367  if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
368  if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
369  if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
370  if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
371  Py_XDECREF((PyObject*)co);
372  co = (PyCodeObject*)call_result;
373  call_result = NULL;
374  if (0) {
375  cleanup_code_too:
376  Py_XDECREF((PyObject*)co);
377  co = NULL;
378  }
379  end:
380  Py_XDECREF(kwds);
381  Py_XDECREF(argcount);
382  Py_XDECREF(posonlyargcount);
383  Py_XDECREF(kwonlyargcount);
384  Py_XDECREF(nlocals);
385  Py_XDECREF(stacksize);
386  Py_XDECREF(replace);
387  Py_XDECREF(call_result);
388  Py_XDECREF(empty);
389  if (type) {
390  PyErr_Restore(type, value, traceback);
391  }
392  return co;
393  }
394 #else
395  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
396  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
397 #endif
398  #define __Pyx_DefaultClassType PyType_Type
399 #endif
400 #ifndef Py_TPFLAGS_CHECKTYPES
401  #define Py_TPFLAGS_CHECKTYPES 0
402 #endif
403 #ifndef Py_TPFLAGS_HAVE_INDEX
404  #define Py_TPFLAGS_HAVE_INDEX 0
405 #endif
406 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
407  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
408 #endif
409 #ifndef Py_TPFLAGS_HAVE_FINALIZE
410  #define Py_TPFLAGS_HAVE_FINALIZE 0
411 #endif
412 #ifndef METH_STACKLESS
413  #define METH_STACKLESS 0
414 #endif
415 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
416  #ifndef METH_FASTCALL
417  #define METH_FASTCALL 0x80
418  #endif
419  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
420  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
421  Py_ssize_t nargs, PyObject *kwnames);
422 #else
423  #define __Pyx_PyCFunctionFast _PyCFunctionFast
424  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
425 #endif
426 #if CYTHON_FAST_PYCCALL
427 #define __Pyx_PyFastCFunction_Check(func)\
428  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
429 #else
430 #define __Pyx_PyFastCFunction_Check(func) 0
431 #endif
432 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
433  #define PyObject_Malloc(s) PyMem_Malloc(s)
434  #define PyObject_Free(p) PyMem_Free(p)
435  #define PyObject_Realloc(p) PyMem_Realloc(p)
436 #endif
437 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
438  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
439  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
440  #define PyMem_RawFree(p) PyMem_Free(p)
441 #endif
442 #if CYTHON_COMPILING_IN_PYSTON
443  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
444  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
445 #else
446  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
447  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
448 #endif
449 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
450  #define __Pyx_PyThreadState_Current PyThreadState_GET()
451 #elif PY_VERSION_HEX >= 0x03060000
452  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
453 #elif PY_VERSION_HEX >= 0x03000000
454  #define __Pyx_PyThreadState_Current PyThreadState_GET()
455 #else
456  #define __Pyx_PyThreadState_Current _PyThreadState_Current
457 #endif
458 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
459 #include "pythread.h"
460 #define Py_tss_NEEDS_INIT 0
461 typedef int Py_tss_t;
462 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
463  *key = PyThread_create_key();
464  return 0;
465 }
466 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
467  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
468  *key = Py_tss_NEEDS_INIT;
469  return key;
470 }
471 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
472  PyObject_Free(key);
473 }
474 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
475  return *key != Py_tss_NEEDS_INIT;
476 }
477 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
478  PyThread_delete_key(*key);
479  *key = Py_tss_NEEDS_INIT;
480 }
481 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
482  return PyThread_set_key_value(*key, value);
483 }
484 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
485  return PyThread_get_key_value(*key);
486 }
487 #endif
488 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
489 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
490 #else
491 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
492 #endif
493 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
494  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
495  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
496 #else
497  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
498  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
499 #endif
500 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
501 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
502 #else
503 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
504 #endif
505 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
506  #define CYTHON_PEP393_ENABLED 1
507  #if defined(PyUnicode_IS_READY)
508  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
509  0 : _PyUnicode_Ready((PyObject *)(op)))
510  #else
511  #define __Pyx_PyUnicode_READY(op) (0)
512  #endif
513  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
514  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
515  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
516  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
517  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
518  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
519  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
520  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
521  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
522  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
523  #else
524  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
525  #endif
526  #else
527  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
528  #endif
529 #else
530  #define CYTHON_PEP393_ENABLED 0
531  #define PyUnicode_1BYTE_KIND 1
532  #define PyUnicode_2BYTE_KIND 2
533  #define PyUnicode_4BYTE_KIND 4
534  #define __Pyx_PyUnicode_READY(op) (0)
535  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
536  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
537  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
538  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
539  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
540  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
541  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
542  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
543 #endif
544 #if CYTHON_COMPILING_IN_PYPY
545  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
546  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
547 #else
548  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
549  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
550  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
551 #endif
552 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
553  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
554 #endif
555 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
556  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
557 #endif
558 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
559  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
560 #endif
561 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
562 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
563 #if PY_MAJOR_VERSION >= 3
564  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
565 #else
566  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
567 #endif
568 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
569  #define PyObject_ASCII(o) PyObject_Repr(o)
570 #endif
571 #if PY_MAJOR_VERSION >= 3
572  #define PyBaseString_Type PyUnicode_Type
573  #define PyStringObject PyUnicodeObject
574  #define PyString_Type PyUnicode_Type
575  #define PyString_Check PyUnicode_Check
576  #define PyString_CheckExact PyUnicode_CheckExact
577 #ifndef PyObject_Unicode
578  #define PyObject_Unicode PyObject_Str
579 #endif
580 #endif
581 #if PY_MAJOR_VERSION >= 3
582  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
583  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
584 #else
585  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
586  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
587 #endif
588 #ifndef PySet_CheckExact
589  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
590 #endif
591 #if PY_VERSION_HEX >= 0x030900A4
592  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
593  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
594 #else
595  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
596  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
597 #endif
598 #if CYTHON_ASSUME_SAFE_MACROS
599  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
600 #else
601  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
602 #endif
603 #if PY_MAJOR_VERSION >= 3
604  #define PyIntObject PyLongObject
605  #define PyInt_Type PyLong_Type
606  #define PyInt_Check(op) PyLong_Check(op)
607  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
608  #define PyInt_FromString PyLong_FromString
609  #define PyInt_FromUnicode PyLong_FromUnicode
610  #define PyInt_FromLong PyLong_FromLong
611  #define PyInt_FromSize_t PyLong_FromSize_t
612  #define PyInt_FromSsize_t PyLong_FromSsize_t
613  #define PyInt_AsLong PyLong_AsLong
614  #define PyInt_AS_LONG PyLong_AS_LONG
615  #define PyInt_AsSsize_t PyLong_AsSsize_t
616  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
617  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
618  #define PyNumber_Int PyNumber_Long
619 #endif
620 #if PY_MAJOR_VERSION >= 3
621  #define PyBoolObject PyLongObject
622 #endif
623 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
624  #ifndef PyUnicode_InternFromString
625  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
626  #endif
627 #endif
628 #if PY_VERSION_HEX < 0x030200A4
629  typedef long Py_hash_t;
630  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
631  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
632 #else
633  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
634  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
635 #endif
636 #if PY_MAJOR_VERSION >= 3
637  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
638 #else
639  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
640 #endif
641 #if CYTHON_USE_ASYNC_SLOTS
642  #if PY_VERSION_HEX >= 0x030500B1
643  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
644  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
645  #else
646  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
647  #endif
648 #else
649  #define __Pyx_PyType_AsAsync(obj) NULL
650 #endif
651 #ifndef __Pyx_PyAsyncMethodsStruct
652  typedef struct {
653  unaryfunc am_await;
654  unaryfunc am_aiter;
655  unaryfunc am_anext;
656  } __Pyx_PyAsyncMethodsStruct;
657 #endif
658 
659 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
660  #if !defined(_USE_MATH_DEFINES)
661  #define _USE_MATH_DEFINES
662  #endif
663 #endif
664 #include <math.h>
665 #ifdef NAN
666 #define __PYX_NAN() ((float) NAN)
667 #else
668 static CYTHON_INLINE float __PYX_NAN() {
669  float value;
670  memset(&value, 0xFF, sizeof(value));
671  return value;
672 }
673 #endif
674 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
675 #define __Pyx_truncl trunc
676 #else
677 #define __Pyx_truncl truncl
678 #endif
679 
680 #define __PYX_MARK_ERR_POS(f_index, lineno) \
681  { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
682 #define __PYX_ERR(f_index, lineno, Ln_error) \
683  { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
684 
685 #ifndef __PYX_EXTERN_C
686  #ifdef __cplusplus
687  #define __PYX_EXTERN_C extern "C"
688  #else
689  #define __PYX_EXTERN_C extern
690  #endif
691 #endif
692 
693 #define __PYX_HAVE__csmoothers
694 #define __PYX_HAVE_API__csmoothers
695 /* Early includes */
696 #include <string.h>
697 #include <stdio.h>
698 #include "numpy/arrayobject.h"
699 #include "numpy/ndarrayobject.h"
700 #include "numpy/ndarraytypes.h"
701 #include "numpy/arrayscalars.h"
702 #include "numpy/ufuncobject.h"
703 
704  /* NumPy API declarations from "numpy/__init__.pxd" */
705 
706 #include "proteus_superlu.h"
707 #include "smoothers.h"
708 #include "pythread.h"
709 #include <stdlib.h>
710 #include "pystate.h"
711 #ifdef _OPENMP
712 #include <omp.h>
713 #endif /* _OPENMP */
714 
715 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
716 #define CYTHON_WITHOUT_ASSERTIONS
717 #endif
718 
719 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
720  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
721 
722 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
723 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
724 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
725 #define __PYX_DEFAULT_STRING_ENCODING ""
726 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
727 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
728 #define __Pyx_uchar_cast(c) ((unsigned char)c)
729 #define __Pyx_long_cast(x) ((long)x)
730 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
731  (sizeof(type) < sizeof(Py_ssize_t)) ||\
732  (sizeof(type) > sizeof(Py_ssize_t) &&\
733  likely(v < (type)PY_SSIZE_T_MAX ||\
734  v == (type)PY_SSIZE_T_MAX) &&\
735  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
736  v == (type)PY_SSIZE_T_MIN))) ||\
737  (sizeof(type) == sizeof(Py_ssize_t) &&\
738  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
739  v == (type)PY_SSIZE_T_MAX))) )
740 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
741  return (size_t) i < (size_t) limit;
742 }
743 #if defined (__cplusplus) && __cplusplus >= 201103L
744  #include <cstdlib>
745  #define __Pyx_sst_abs(value) std::abs(value)
746 #elif SIZEOF_INT >= SIZEOF_SIZE_T
747  #define __Pyx_sst_abs(value) abs(value)
748 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
749  #define __Pyx_sst_abs(value) labs(value)
750 #elif defined (_MSC_VER)
751  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
752 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
753  #define __Pyx_sst_abs(value) llabs(value)
754 #elif defined (__GNUC__)
755  #define __Pyx_sst_abs(value) __builtin_llabs(value)
756 #else
757  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
758 #endif
759 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
760 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
761 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
762 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
763 #define __Pyx_PyBytes_FromString PyBytes_FromString
764 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
765 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
766 #if PY_MAJOR_VERSION < 3
767  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
768  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
769 #else
770  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
771  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
772 #endif
773 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
774 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
775 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
776 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
777 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
778 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
779 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
780 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
781 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
782 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
783 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
784 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
785 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
786 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
787 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
788 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
789 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
790  const Py_UNICODE *u_end = u;
791  while (*u_end++) ;
792  return (size_t)(u_end - u - 1);
793 }
794 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
795 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
796 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
797 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
798 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
799 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
800 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
801 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
802 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
803 #define __Pyx_PySequence_Tuple(obj)\
804  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
805 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
806 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
807 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
808 #if CYTHON_ASSUME_SAFE_MACROS
809 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
810 #else
811 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
812 #endif
813 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
814 #if PY_MAJOR_VERSION >= 3
815 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
816 #else
817 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
818 #endif
819 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
820 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
821 static int __Pyx_sys_getdefaultencoding_not_ascii;
822 static int __Pyx_init_sys_getdefaultencoding_params(void) {
823  PyObject* sys;
824  PyObject* default_encoding = NULL;
825  PyObject* ascii_chars_u = NULL;
826  PyObject* ascii_chars_b = NULL;
827  const char* default_encoding_c;
828  sys = PyImport_ImportModule("sys");
829  if (!sys) goto bad;
830  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
831  Py_DECREF(sys);
832  if (!default_encoding) goto bad;
833  default_encoding_c = PyBytes_AsString(default_encoding);
834  if (!default_encoding_c) goto bad;
835  if (strcmp(default_encoding_c, "ascii") == 0) {
836  __Pyx_sys_getdefaultencoding_not_ascii = 0;
837  } else {
838  char ascii_chars[128];
839  int c;
840  for (c = 0; c < 128; c++) {
841  ascii_chars[c] = c;
842  }
843  __Pyx_sys_getdefaultencoding_not_ascii = 1;
844  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
845  if (!ascii_chars_u) goto bad;
846  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
847  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
848  PyErr_Format(
849  PyExc_ValueError,
850  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
851  default_encoding_c);
852  goto bad;
853  }
854  Py_DECREF(ascii_chars_u);
855  Py_DECREF(ascii_chars_b);
856  }
857  Py_DECREF(default_encoding);
858  return 0;
859 bad:
860  Py_XDECREF(default_encoding);
861  Py_XDECREF(ascii_chars_u);
862  Py_XDECREF(ascii_chars_b);
863  return -1;
864 }
865 #endif
866 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
867 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
868 #else
869 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
870 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
871 static char* __PYX_DEFAULT_STRING_ENCODING;
872 static int __Pyx_init_sys_getdefaultencoding_params(void) {
873  PyObject* sys;
874  PyObject* default_encoding = NULL;
875  char* default_encoding_c;
876  sys = PyImport_ImportModule("sys");
877  if (!sys) goto bad;
878  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
879  Py_DECREF(sys);
880  if (!default_encoding) goto bad;
881  default_encoding_c = PyBytes_AsString(default_encoding);
882  if (!default_encoding_c) goto bad;
883  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
884  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
885  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
886  Py_DECREF(default_encoding);
887  return 0;
888 bad:
889  Py_XDECREF(default_encoding);
890  return -1;
891 }
892 #endif
893 #endif
894 
895 
896 /* Test for GCC > 2.95 */
897 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
898  #define likely(x) __builtin_expect(!!(x), 1)
899  #define unlikely(x) __builtin_expect(!!(x), 0)
900 #else /* !__GNUC__ or GCC < 2.95 */
901  #define likely(x) (x)
902  #define unlikely(x) (x)
903 #endif /* __GNUC__ */
904 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
905 
906 static PyObject *__pyx_m = NULL;
907 static PyObject *__pyx_d;
908 static PyObject *__pyx_b;
909 static PyObject *__pyx_cython_runtime = NULL;
910 static PyObject *__pyx_empty_tuple;
911 static PyObject *__pyx_empty_bytes;
912 static PyObject *__pyx_empty_unicode;
913 static int __pyx_lineno;
914 static int __pyx_clineno = 0;
915 static const char * __pyx_cfilenm= __FILE__;
916 static const char *__pyx_filename;
917 
918 /* Header.proto */
919 #if !defined(CYTHON_CCOMPLEX)
920  #if defined(__cplusplus)
921  #define CYTHON_CCOMPLEX 1
922  #elif defined(_Complex_I)
923  #define CYTHON_CCOMPLEX 1
924  #else
925  #define CYTHON_CCOMPLEX 0
926  #endif
927 #endif
928 #if CYTHON_CCOMPLEX
929  #ifdef __cplusplus
930  #include <complex>
931  #else
932  #include <complex.h>
933  #endif
934 #endif
935 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
936  #undef _Complex_I
937  #define _Complex_I 1.0fj
938 #endif
939 
940 
941 static const char *__pyx_f[] = {
942  "proteus/csmoothers.pyx",
943  "stringsource",
944  "__init__.pxd",
945  "type.pxd",
946  "proteus/superluWrappers.pxd",
947 };
948 /* MemviewSliceStruct.proto */
949 struct __pyx_memoryview_obj;
950 typedef struct {
951  struct __pyx_memoryview_obj *memview;
952  char *data;
953  Py_ssize_t shape[8];
954  Py_ssize_t strides[8];
955  Py_ssize_t suboffsets[8];
956 } __Pyx_memviewslice;
957 #define __Pyx_MemoryView_Len(m) (m.shape[0])
958 
959 /* Atomics.proto */
960 #include <pythread.h>
961 #ifndef CYTHON_ATOMICS
962  #define CYTHON_ATOMICS 1
963 #endif
964 #define __pyx_atomic_int_type int
965 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
966  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
967  !defined(__i386__)
968  #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
969  #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
970  #ifdef __PYX_DEBUG_ATOMICS
971  #warning "Using GNU atomics"
972  #endif
973 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
974  #include <Windows.h>
975  #undef __pyx_atomic_int_type
976  #define __pyx_atomic_int_type LONG
977  #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
978  #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
979  #ifdef __PYX_DEBUG_ATOMICS
980  #pragma message ("Using MSVC atomics")
981  #endif
982 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
983  #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
984  #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
985  #ifdef __PYX_DEBUG_ATOMICS
986  #warning "Using Intel atomics"
987  #endif
988 #else
989  #undef CYTHON_ATOMICS
990  #define CYTHON_ATOMICS 0
991  #ifdef __PYX_DEBUG_ATOMICS
992  #warning "Not using atomics"
993  #endif
994 #endif
995 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
996 #if CYTHON_ATOMICS
997  #define __pyx_add_acquisition_count(memview)\
998  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
999  #define __pyx_sub_acquisition_count(memview)\
1000  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1001 #else
1002  #define __pyx_add_acquisition_count(memview)\
1003  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1004  #define __pyx_sub_acquisition_count(memview)\
1005  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1006 #endif
1007 
1008 /* ForceInitThreads.proto */
1009 #ifndef __PYX_FORCE_INIT_THREADS
1010  #define __PYX_FORCE_INIT_THREADS 0
1011 #endif
1012 
1013 /* NoFastGil.proto */
1014 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1015 #define __Pyx_PyGILState_Release PyGILState_Release
1016 #define __Pyx_FastGIL_Remember()
1017 #define __Pyx_FastGIL_Forget()
1018 #define __Pyx_FastGilFuncInit()
1019 
1020 /* BufferFormatStructs.proto */
1021 #define IS_UNSIGNED(type) (((type) -1) > 0)
1022 struct __Pyx_StructField_;
1023 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1024 typedef struct {
1025  const char* name;
1026  struct __Pyx_StructField_* fields;
1027  size_t size;
1028  size_t arraysize[8];
1029  int ndim;
1030  char typegroup;
1031  char is_unsigned;
1032  int flags;
1033 } __Pyx_TypeInfo;
1034 typedef struct __Pyx_StructField_ {
1035  __Pyx_TypeInfo* type;
1036  const char* name;
1037  size_t offset;
1038 } __Pyx_StructField;
1039 typedef struct {
1040  __Pyx_StructField* field;
1041  size_t parent_offset;
1042 } __Pyx_BufFmt_StackElem;
1043 typedef struct {
1044  __Pyx_StructField root;
1045  __Pyx_BufFmt_StackElem* head;
1046  size_t fmt_offset;
1047  size_t new_count, enc_count;
1048  size_t struct_alignment;
1049  int is_complex;
1050  char enc_type;
1051  char new_packmode;
1052  char enc_packmode;
1053  char is_valid_array;
1054 } __Pyx_BufFmt_Context;
1055 
1056 
1057 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":690
1058  * # in Cython to enable them only on the right systems.
1059  *
1060  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1061  * ctypedef npy_int16 int16_t
1062  * ctypedef npy_int32 int32_t
1063  */
1064 typedef npy_int8 __pyx_t_5numpy_int8_t;
1065 
1066 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":691
1067  *
1068  * ctypedef npy_int8 int8_t
1069  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1070  * ctypedef npy_int32 int32_t
1071  * ctypedef npy_int64 int64_t
1072  */
1073 typedef npy_int16 __pyx_t_5numpy_int16_t;
1074 
1075 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":692
1076  * ctypedef npy_int8 int8_t
1077  * ctypedef npy_int16 int16_t
1078  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1079  * ctypedef npy_int64 int64_t
1080  * #ctypedef npy_int96 int96_t
1081  */
1082 typedef npy_int32 __pyx_t_5numpy_int32_t;
1083 
1084 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":693
1085  * ctypedef npy_int16 int16_t
1086  * ctypedef npy_int32 int32_t
1087  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1088  * #ctypedef npy_int96 int96_t
1089  * #ctypedef npy_int128 int128_t
1090  */
1091 typedef npy_int64 __pyx_t_5numpy_int64_t;
1092 
1093 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":697
1094  * #ctypedef npy_int128 int128_t
1095  *
1096  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1097  * ctypedef npy_uint16 uint16_t
1098  * ctypedef npy_uint32 uint32_t
1099  */
1100 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1101 
1102 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":698
1103  *
1104  * ctypedef npy_uint8 uint8_t
1105  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1106  * ctypedef npy_uint32 uint32_t
1107  * ctypedef npy_uint64 uint64_t
1108  */
1109 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1110 
1111 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":699
1112  * ctypedef npy_uint8 uint8_t
1113  * ctypedef npy_uint16 uint16_t
1114  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1115  * ctypedef npy_uint64 uint64_t
1116  * #ctypedef npy_uint96 uint96_t
1117  */
1118 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1119 
1120 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":700
1121  * ctypedef npy_uint16 uint16_t
1122  * ctypedef npy_uint32 uint32_t
1123  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1124  * #ctypedef npy_uint96 uint96_t
1125  * #ctypedef npy_uint128 uint128_t
1126  */
1127 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1128 
1129 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":704
1130  * #ctypedef npy_uint128 uint128_t
1131  *
1132  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1133  * ctypedef npy_float64 float64_t
1134  * #ctypedef npy_float80 float80_t
1135  */
1136 typedef npy_float32 __pyx_t_5numpy_float32_t;
1137 
1138 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":705
1139  *
1140  * ctypedef npy_float32 float32_t
1141  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1142  * #ctypedef npy_float80 float80_t
1143  * #ctypedef npy_float128 float128_t
1144  */
1145 typedef npy_float64 __pyx_t_5numpy_float64_t;
1146 
1147 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":714
1148  * # The int types are mapped a bit surprising --
1149  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1150  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1151  * ctypedef npy_longlong long_t
1152  * ctypedef npy_longlong longlong_t
1153  */
1154 typedef npy_long __pyx_t_5numpy_int_t;
1155 
1156 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":715
1157  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1158  * ctypedef npy_long int_t
1159  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1160  * ctypedef npy_longlong longlong_t
1161  *
1162  */
1163 typedef npy_longlong __pyx_t_5numpy_long_t;
1164 
1165 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":716
1166  * ctypedef npy_long int_t
1167  * ctypedef npy_longlong long_t
1168  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1169  *
1170  * ctypedef npy_ulong uint_t
1171  */
1172 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1173 
1174 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":718
1175  * ctypedef npy_longlong longlong_t
1176  *
1177  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1178  * ctypedef npy_ulonglong ulong_t
1179  * ctypedef npy_ulonglong ulonglong_t
1180  */
1181 typedef npy_ulong __pyx_t_5numpy_uint_t;
1182 
1183 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":719
1184  *
1185  * ctypedef npy_ulong uint_t
1186  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1187  * ctypedef npy_ulonglong ulonglong_t
1188  *
1189  */
1190 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1191 
1192 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":720
1193  * ctypedef npy_ulong uint_t
1194  * ctypedef npy_ulonglong ulong_t
1195  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1196  *
1197  * ctypedef npy_intp intp_t
1198  */
1199 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1200 
1201 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":722
1202  * ctypedef npy_ulonglong ulonglong_t
1203  *
1204  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1205  * ctypedef npy_uintp uintp_t
1206  *
1207  */
1208 typedef npy_intp __pyx_t_5numpy_intp_t;
1209 
1210 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":723
1211  *
1212  * ctypedef npy_intp intp_t
1213  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1214  *
1215  * ctypedef npy_double float_t
1216  */
1217 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1218 
1219 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":725
1220  * ctypedef npy_uintp uintp_t
1221  *
1222  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1223  * ctypedef npy_double double_t
1224  * ctypedef npy_longdouble longdouble_t
1225  */
1226 typedef npy_double __pyx_t_5numpy_float_t;
1227 
1228 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":726
1229  *
1230  * ctypedef npy_double float_t
1231  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1232  * ctypedef npy_longdouble longdouble_t
1233  *
1234  */
1235 typedef npy_double __pyx_t_5numpy_double_t;
1236 
1237 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":727
1238  * ctypedef npy_double float_t
1239  * ctypedef npy_double double_t
1240  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1241  *
1242  * ctypedef npy_cfloat cfloat_t
1243  */
1244 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1245 
1246 /* "csmoothers.pxd":3
1247  * from proteus cimport superluWrappers
1248  *
1249  * ctypedef int PROTEUS_LAPACK_INTEGER # <<<<<<<<<<<<<<
1250  * # ARB - the compiler macro does not seem to be picking this up...
1251  * ctypedef double [:] DDATA
1252  */
1253 typedef int __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER;
1254 /* Declarations.proto */
1255 #if CYTHON_CCOMPLEX
1256  #ifdef __cplusplus
1257  typedef ::std::complex< float > __pyx_t_float_complex;
1258  #else
1259  typedef float _Complex __pyx_t_float_complex;
1260  #endif
1261 #else
1262  typedef struct { float real, imag; } __pyx_t_float_complex;
1263 #endif
1264 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1265 
1266 /* Declarations.proto */
1267 #if CYTHON_CCOMPLEX
1268  #ifdef __cplusplus
1269  typedef ::std::complex< double > __pyx_t_double_complex;
1270  #else
1271  typedef double _Complex __pyx_t_double_complex;
1272  #endif
1273 #else
1274  typedef struct { double real, imag; } __pyx_t_double_complex;
1275 #endif
1276 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1277 
1278 
1279 /*--- Type declarations ---*/
1280 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix;
1281 struct __pyx_obj_10csmoothers_cASMFactor;
1282 struct __pyx_obj_10csmoothers_cBASMFactor;
1283 struct __pyx_array_obj;
1284 struct __pyx_MemviewEnum_obj;
1285 struct __pyx_memoryview_obj;
1286 struct __pyx_memoryviewslice_obj;
1287 
1288 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":729
1289  * ctypedef npy_longdouble longdouble_t
1290  *
1291  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1292  * ctypedef npy_cdouble cdouble_t
1293  * ctypedef npy_clongdouble clongdouble_t
1294  */
1295 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1296 
1297 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":730
1298  *
1299  * ctypedef npy_cfloat cfloat_t
1300  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1301  * ctypedef npy_clongdouble clongdouble_t
1302  *
1303  */
1304 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1305 
1306 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":731
1307  * ctypedef npy_cfloat cfloat_t
1308  * ctypedef npy_cdouble cdouble_t
1309  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1310  *
1311  * ctypedef npy_cdouble complex_t
1312  */
1313 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1314 
1315 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":733
1316  * ctypedef npy_clongdouble clongdouble_t
1317  *
1318  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1319  *
1320  * cdef inline object PyArray_MultiIterNew1(a):
1321  */
1322 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1323 struct __pyx_t_7proteus_15superluWrappers__NRformat;
1324 
1325 /* "superluWrappers.pxd":61
1326  * void csp_preorder "sp_preorder"(_superlu_options_t *, _SuperMatrix *, int *, int *, _SuperMatrix *)
1327  *
1328  * cdef struct _NRformat: # <<<<<<<<<<<<<<
1329  * np.int32_t nnz
1330  * np.float64_t * nzval
1331  */
1332 struct __pyx_t_7proteus_15superluWrappers__NRformat {
1333  __pyx_t_5numpy_int32_t nnz;
1334  __pyx_t_5numpy_float64_t *nzval;
1335  __pyx_t_5numpy_int32_t *colind;
1336  __pyx_t_5numpy_int32_t *rowptr;
1337 };
1338 
1339 /* "csmoothers.pxd":5
1340  * ctypedef int PROTEUS_LAPACK_INTEGER
1341  * # ARB - the compiler macro does not seem to be picking this up...
1342  * ctypedef double [:] DDATA # <<<<<<<<<<<<<<
1343  * ctypedef int [:] IDATA
1344  * ctypedef superluWrappers._SuperMatrix SuperMatrix
1345  */
1346 typedef __Pyx_memviewslice __pyx_t_10csmoothers_DDATA;
1347 
1348 /* "csmoothers.pxd":6
1349  * # ARB - the compiler macro does not seem to be picking this up...
1350  * ctypedef double [:] DDATA
1351  * ctypedef int [:] IDATA # <<<<<<<<<<<<<<
1352  * ctypedef superluWrappers._SuperMatrix SuperMatrix
1353  *
1354  */
1355 typedef __Pyx_memviewslice __pyx_t_10csmoothers_IDATA;
1356 
1357 /* "csmoothers.pxd":7
1358  * ctypedef double [:] DDATA
1359  * ctypedef int [:] IDATA
1360  * ctypedef superluWrappers._SuperMatrix SuperMatrix # <<<<<<<<<<<<<<
1361  *
1362  * cdef extern from "smoothers.h":
1363  */
1364 typedef SuperMatrix __pyx_t_10csmoothers_SuperMatrix;
1365 
1366 /* "superluWrappers.pxd":67
1367  * np.int32_t * rowptr
1368  *
1369  * cdef class cSparseMatrix(object): # <<<<<<<<<<<<<<
1370  * cdef np.int32_t dim[2]
1371  * cdef _NRformat A
1372  */
1373 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix {
1374  PyObject_HEAD
1375  __pyx_t_5numpy_int32_t dim[2];
1376  struct __pyx_t_7proteus_15superluWrappers__NRformat A;
1377 };
1378 
1379 
1380 /* "csmoothers.pxd":25
1381  * void cbasm_NR_solve "basm_NR_solve"(int rowBlocks, int N, superluWrappers._SuperMatrix *A, double w, double** subdomainL, int* subdomain_dim, int** l2g_L, double* R, double** subdomainR, int* node_order, double** subdomain_dX, double* dX, PROTEUS_LAPACK_INTEGER** subdomainPivots, PROTEUS_LAPACK_INTEGER** subdomainColPivots)
1382  *
1383  * cdef class cASMFactor(object): # <<<<<<<<<<<<<<
1384  * cdef int N
1385  * cdef int *subdomain_dim
1386  */
1387 struct __pyx_obj_10csmoothers_cASMFactor {
1388  PyObject_HEAD
1389  int N;
1390  int *subdomain_dim;
1391  int **l2g_L;
1392  double **subdomain_L;
1393  double **subdomain_R;
1394  double **subdomain_dX;
1395  __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_pivots;
1396 };
1397 
1398 
1399 /* "csmoothers.pxd":34
1400  * cdef PROTEUS_LAPACK_INTEGER **subdomain_pivots
1401  *
1402  * cdef class cBASMFactor(object): # <<<<<<<<<<<<<<
1403  * cdef int N
1404  * cdef int bs
1405  */
1406 struct __pyx_obj_10csmoothers_cBASMFactor {
1407  PyObject_HEAD
1408  int N;
1409  int bs;
1410  int *subdomain_dim;
1411  int **l2g_L;
1412  double **subdomain_L;
1413  double **subdomain_R;
1414  double **subdomain_dX;
1415  __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_pivots;
1416  __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_col_pivots;
1417 };
1418 
1419 
1420 /* "View.MemoryView":105
1421  *
1422  * @cname("__pyx_array")
1423  * cdef class array: # <<<<<<<<<<<<<<
1424  *
1425  * cdef:
1426  */
1427 struct __pyx_array_obj {
1428  PyObject_HEAD
1429  struct __pyx_vtabstruct_array *__pyx_vtab;
1430  char *data;
1431  Py_ssize_t len;
1432  char *format;
1433  int ndim;
1434  Py_ssize_t *_shape;
1435  Py_ssize_t *_strides;
1436  Py_ssize_t itemsize;
1437  PyObject *mode;
1438  PyObject *_format;
1439  void (*callback_free_data)(void *);
1440  int free_data;
1441  int dtype_is_object;
1442 };
1443 
1444 
1445 /* "View.MemoryView":279
1446  *
1447  * @cname('__pyx_MemviewEnum')
1448  * cdef class Enum(object): # <<<<<<<<<<<<<<
1449  * cdef object name
1450  * def __init__(self, name):
1451  */
1452 struct __pyx_MemviewEnum_obj {
1453  PyObject_HEAD
1454  PyObject *name;
1455 };
1456 
1457 
1458 /* "View.MemoryView":330
1459  *
1460  * @cname('__pyx_memoryview')
1461  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1462  *
1463  * cdef object obj
1464  */
1465 struct __pyx_memoryview_obj {
1466  PyObject_HEAD
1467  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1468  PyObject *obj;
1469  PyObject *_size;
1470  PyObject *_array_interface;
1471  PyThread_type_lock lock;
1472  __pyx_atomic_int acquisition_count[2];
1473  __pyx_atomic_int *acquisition_count_aligned_p;
1474  Py_buffer view;
1475  int flags;
1476  int dtype_is_object;
1477  __Pyx_TypeInfo *typeinfo;
1478 };
1479 
1480 
1481 /* "View.MemoryView":965
1482  *
1483  * @cname('__pyx_memoryviewslice')
1484  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1485  * "Internal class for passing memoryview slices to Python"
1486  *
1487  */
1488 struct __pyx_memoryviewslice_obj {
1489  struct __pyx_memoryview_obj __pyx_base;
1490  __Pyx_memviewslice from_slice;
1491  PyObject *from_object;
1492  PyObject *(*to_object_func)(char *);
1493  int (*to_dtype_func)(char *, PyObject *);
1494 };
1495 
1496 
1497 
1498 /* "View.MemoryView":105
1499  *
1500  * @cname("__pyx_array")
1501  * cdef class array: # <<<<<<<<<<<<<<
1502  *
1503  * cdef:
1504  */
1505 
1506 struct __pyx_vtabstruct_array {
1507  PyObject *(*get_memview)(struct __pyx_array_obj *);
1508 };
1509 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1510 
1511 
1512 /* "View.MemoryView":330
1513  *
1514  * @cname('__pyx_memoryview')
1515  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1516  *
1517  * cdef object obj
1518  */
1519 
1520 struct __pyx_vtabstruct_memoryview {
1521  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1522  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1523  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1524  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1525  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1526  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1527  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1528 };
1529 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1530 
1531 
1532 /* "View.MemoryView":965
1533  *
1534  * @cname('__pyx_memoryviewslice')
1535  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1536  * "Internal class for passing memoryview slices to Python"
1537  *
1538  */
1539 
1540 struct __pyx_vtabstruct__memoryviewslice {
1541  struct __pyx_vtabstruct_memoryview __pyx_base;
1542 };
1543 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1544 
1545 /* --- Runtime support code (head) --- */
1546 /* Refnanny.proto */
1547 #ifndef CYTHON_REFNANNY
1548  #define CYTHON_REFNANNY 0
1549 #endif
1550 #if CYTHON_REFNANNY
1551  typedef struct {
1552  void (*INCREF)(void*, PyObject*, int);
1553  void (*DECREF)(void*, PyObject*, int);
1554  void (*GOTREF)(void*, PyObject*, int);
1555  void (*GIVEREF)(void*, PyObject*, int);
1556  void* (*SetupContext)(const char*, int, const char*);
1557  void (*FinishContext)(void**);
1558  } __Pyx_RefNannyAPIStruct;
1559  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1560  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1561  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1562 #ifdef WITH_THREAD
1563  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1564  if (acquire_gil) {\
1565  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1566  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1567  PyGILState_Release(__pyx_gilstate_save);\
1568  } else {\
1569  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1570  }
1571 #else
1572  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1573  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1574 #endif
1575  #define __Pyx_RefNannyFinishContext()\
1576  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1577  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1578  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1579  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1580  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1581  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1582  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1583  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1584  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1585 #else
1586  #define __Pyx_RefNannyDeclarations
1587  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1588  #define __Pyx_RefNannyFinishContext()
1589  #define __Pyx_INCREF(r) Py_INCREF(r)
1590  #define __Pyx_DECREF(r) Py_DECREF(r)
1591  #define __Pyx_GOTREF(r)
1592  #define __Pyx_GIVEREF(r)
1593  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1594  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1595  #define __Pyx_XGOTREF(r)
1596  #define __Pyx_XGIVEREF(r)
1597 #endif
1598 #define __Pyx_XDECREF_SET(r, v) do {\
1599  PyObject *tmp = (PyObject *) r;\
1600  r = v; __Pyx_XDECREF(tmp);\
1601  } while (0)
1602 #define __Pyx_DECREF_SET(r, v) do {\
1603  PyObject *tmp = (PyObject *) r;\
1604  r = v; __Pyx_DECREF(tmp);\
1605  } while (0)
1606 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1607 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1608 
1609 /* PyObjectGetAttrStr.proto */
1610 #if CYTHON_USE_TYPE_SLOTS
1611 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1612 #else
1613 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1614 #endif
1615 
1616 /* GetBuiltinName.proto */
1617 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1618 
1619 /* RaiseArgTupleInvalid.proto */
1620 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1621  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1622 
1623 /* RaiseDoubleKeywords.proto */
1624 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1625 
1626 /* ParseKeywords.proto */
1627 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1628  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1629  const char* function_name);
1630 
1631 /* PyObjectSetAttrStr.proto */
1632 #if CYTHON_USE_TYPE_SLOTS
1633 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1634 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1635 #else
1636 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1637 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1638 #endif
1639 
1640 /* PyCFunctionFastCall.proto */
1641 #if CYTHON_FAST_PYCCALL
1642 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1643 #else
1644 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1645 #endif
1646 
1647 /* PyFunctionFastCall.proto */
1648 #if CYTHON_FAST_PYCALL
1649 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1650  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1651 #if 1 || PY_VERSION_HEX < 0x030600B1
1652 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1653 #else
1654 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1655 #endif
1656 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1657  (sizeof(char [1 - 2*!(cond)]) - 1)
1658 #ifndef Py_MEMBER_SIZE
1659 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1660 #endif
1661 #if CYTHON_FAST_PYCALL
1662  static size_t __pyx_pyframe_localsplus_offset = 0;
1663  #include "frameobject.h"
1664 #if PY_VERSION_HEX >= 0x030b00a6
1665  #ifndef Py_BUILD_CORE
1666  #define Py_BUILD_CORE 1
1667  #endif
1668  #include "internal/pycore_frame.h"
1669 #endif
1670  #define __Pxy_PyFrame_Initialize_Offsets()\
1671  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1672  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1673  #define __Pyx_PyFrame_GetLocalsplus(frame)\
1674  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1675 #endif // CYTHON_FAST_PYCALL
1676 #endif
1677 
1678 /* PyObjectCall.proto */
1679 #if CYTHON_COMPILING_IN_CPYTHON
1680 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1681 #else
1682 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1683 #endif
1684 
1685 /* PyObjectCallMethO.proto */
1686 #if CYTHON_COMPILING_IN_CPYTHON
1687 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1688 #endif
1689 
1690 /* PyObjectCallOneArg.proto */
1691 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1692 
1693 /* ArgTypeTest.proto */
1694 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1695  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1696  __Pyx__ArgTypeTest(obj, type, name, exact))
1697 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1698 
1699 /* PyThreadStateGet.proto */
1700 #if CYTHON_FAST_THREAD_STATE
1701 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1702 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1703 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1704 #else
1705 #define __Pyx_PyThreadState_declare
1706 #define __Pyx_PyThreadState_assign
1707 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1708 #endif
1709 
1710 /* PyErrFetchRestore.proto */
1711 #if CYTHON_FAST_THREAD_STATE
1712 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1713 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1714 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1715 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1716 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1717 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1718 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1719 #if CYTHON_COMPILING_IN_CPYTHON
1720 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1721 #else
1722 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1723 #endif
1724 #else
1725 #define __Pyx_PyErr_Clear() PyErr_Clear()
1726 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1727 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1728 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1729 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1730 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1731 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1732 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1733 #endif
1734 
1735 /* RaiseException.proto */
1736 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1737 
1738 /* ExtTypeTest.proto */
1739 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1740 
1741 /* MemviewSliceInit.proto */
1742 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1743 #define __Pyx_MEMVIEW_DIRECT 1
1744 #define __Pyx_MEMVIEW_PTR 2
1745 #define __Pyx_MEMVIEW_FULL 4
1746 #define __Pyx_MEMVIEW_CONTIG 8
1747 #define __Pyx_MEMVIEW_STRIDED 16
1748 #define __Pyx_MEMVIEW_FOLLOW 32
1749 #define __Pyx_IS_C_CONTIG 1
1750 #define __Pyx_IS_F_CONTIG 2
1751 static int __Pyx_init_memviewslice(
1752  struct __pyx_memoryview_obj *memview,
1753  int ndim,
1754  __Pyx_memviewslice *memviewslice,
1755  int memview_is_new_reference);
1756 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
1757  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1758 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
1759  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1760 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1761 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1762 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1763 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1764 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
1765 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
1766 
1767 /* BufferIndexError.proto */
1768 static void __Pyx_RaiseBufferIndexError(int axis);
1769 
1770 /* WriteUnraisableException.proto */
1771 static void __Pyx_WriteUnraisable(const char *name, int clineno,
1772  int lineno, const char *filename,
1773  int full_traceback, int nogil);
1774 
1775 /* GetTopmostException.proto */
1776 #if CYTHON_USE_EXC_INFO_STACK
1777 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1778 #endif
1779 
1780 /* SaveResetException.proto */
1781 #if CYTHON_FAST_THREAD_STATE
1782 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1783 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1784 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1785 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1786 #else
1787 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1788 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1789 #endif
1790 
1791 /* PyErrExceptionMatches.proto */
1792 #if CYTHON_FAST_THREAD_STATE
1793 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1794 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1795 #else
1796 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1797 #endif
1798 
1799 /* GetException.proto */
1800 #if CYTHON_FAST_THREAD_STATE
1801 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1802 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1803 #else
1804 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1805 #endif
1806 
1807 /* PyObjectCall2Args.proto */
1808 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1809 
1810 /* IncludeStringH.proto */
1811 #include <string.h>
1812 
1813 /* BytesEquals.proto */
1814 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1815 
1816 /* UnicodeEquals.proto */
1817 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1818 
1819 /* StrEquals.proto */
1820 #if PY_MAJOR_VERSION >= 3
1821 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1822 #else
1823 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1824 #endif
1825 
1826 /* DivInt[Py_ssize_t].proto */
1827 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1828 
1829 /* UnaryNegOverflows.proto */
1830 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1831  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1832 
1833 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1834 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
1835 /* GetAttr.proto */
1836 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1837 
1838 /* GetItemInt.proto */
1839 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1840  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1841  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1842  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1843  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1844 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1845  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1846  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1847  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1848 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1849  int wraparound, int boundscheck);
1850 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1851  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1852  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1853  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1854 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1855  int wraparound, int boundscheck);
1856 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1857 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1858  int is_list, int wraparound, int boundscheck);
1859 
1860 /* ObjectGetItem.proto */
1861 #if CYTHON_USE_TYPE_SLOTS
1862 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1863 #else
1864 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1865 #endif
1866 
1867 /* decode_c_string_utf16.proto */
1868 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
1869  int byteorder = 0;
1870  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1871 }
1872 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
1873  int byteorder = -1;
1874  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1875 }
1876 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
1877  int byteorder = 1;
1878  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1879 }
1880 
1881 /* decode_c_string.proto */
1882 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1883  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1884  const char* encoding, const char* errors,
1885  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
1886 
1887 /* GetAttr3.proto */
1888 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1889 
1890 /* PyDictVersioning.proto */
1891 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1892 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1893 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1894 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1895  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1896  (cache_var) = (value);
1897 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1898  static PY_UINT64_T __pyx_dict_version = 0;\
1899  static PyObject *__pyx_dict_cached_value = NULL;\
1900  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1901  (VAR) = __pyx_dict_cached_value;\
1902  } else {\
1903  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1904  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1905  }\
1906 }
1907 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1908 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1909 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1910 #else
1911 #define __PYX_GET_DICT_VERSION(dict) (0)
1912 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1913 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1914 #endif
1915 
1916 /* GetModuleGlobalName.proto */
1917 #if CYTHON_USE_DICT_VERSIONS
1918 #define __Pyx_GetModuleGlobalName(var, name) {\
1919  static PY_UINT64_T __pyx_dict_version = 0;\
1920  static PyObject *__pyx_dict_cached_value = NULL;\
1921  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1922  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1923  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1924 }
1925 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1926  PY_UINT64_T __pyx_dict_version;\
1927  PyObject *__pyx_dict_cached_value;\
1928  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1929 }
1930 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1931 #else
1932 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1933 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1934 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1935 #endif
1936 
1937 /* RaiseTooManyValuesToUnpack.proto */
1938 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1939 
1940 /* RaiseNeedMoreValuesToUnpack.proto */
1941 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1942 
1943 /* RaiseNoneIterError.proto */
1944 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1945 
1946 /* SwapException.proto */
1947 #if CYTHON_FAST_THREAD_STATE
1948 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1949 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1950 #else
1951 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1952 #endif
1953 
1954 /* Import.proto */
1955 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1956 
1957 /* FastTypeChecks.proto */
1958 #if CYTHON_COMPILING_IN_CPYTHON
1959 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1960 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1961 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1962 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1963 #else
1964 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1965 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1966 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1967 #endif
1968 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1969 
1970 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1971 /* ListCompAppend.proto */
1972 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1973 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1974  PyListObject* L = (PyListObject*) list;
1975  Py_ssize_t len = Py_SIZE(list);
1976  if (likely(L->allocated > len)) {
1977  Py_INCREF(x);
1978  PyList_SET_ITEM(list, len, x);
1979  __Pyx_SET_SIZE(list, len + 1);
1980  return 0;
1981  }
1982  return PyList_Append(list, x);
1983 }
1984 #else
1985 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1986 #endif
1987 
1988 /* PyIntBinop.proto */
1989 #if !CYTHON_COMPILING_IN_PYPY
1990 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1991 #else
1992 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1993  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1994 #endif
1995 
1996 /* ListExtend.proto */
1997 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
1998 #if CYTHON_COMPILING_IN_CPYTHON
1999  PyObject* none = _PyList_Extend((PyListObject*)L, v);
2000  if (unlikely(!none))
2001  return -1;
2002  Py_DECREF(none);
2003  return 0;
2004 #else
2005  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2006 #endif
2007 }
2008 
2009 /* ListAppend.proto */
2010 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2011 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2012  PyListObject* L = (PyListObject*) list;
2013  Py_ssize_t len = Py_SIZE(list);
2014  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2015  Py_INCREF(x);
2016  PyList_SET_ITEM(list, len, x);
2017  __Pyx_SET_SIZE(list, len + 1);
2018  return 0;
2019  }
2020  return PyList_Append(list, x);
2021 }
2022 #else
2023 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2024 #endif
2025 
2026 /* None.proto */
2027 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2028 
2029 /* DivInt[long].proto */
2030 static CYTHON_INLINE long __Pyx_div_long(long, long);
2031 
2032 /* PySequenceContains.proto */
2033 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
2034  int result = PySequence_Contains(seq, item);
2035  return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2036 }
2037 
2038 /* ImportFrom.proto */
2039 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2040 
2041 /* HasAttr.proto */
2042 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2043 
2044 /* PyObject_GenericGetAttrNoDict.proto */
2045 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2046 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2047 #else
2048 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2049 #endif
2050 
2051 /* PyObject_GenericGetAttr.proto */
2052 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2053 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2054 #else
2055 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2056 #endif
2057 
2058 /* PyObjectGetAttrStrNoError.proto */
2059 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2060 
2061 /* SetupReduce.proto */
2062 static int __Pyx_setup_reduce(PyObject* type_obj);
2063 
2064 /* SetVTable.proto */
2065 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2066 
2067 /* TypeImport.proto */
2068 #ifndef __PYX_HAVE_RT_ImportType_proto
2069 #define __PYX_HAVE_RT_ImportType_proto
2070 enum __Pyx_ImportType_CheckSize {
2071  __Pyx_ImportType_CheckSize_Error = 0,
2072  __Pyx_ImportType_CheckSize_Warn = 1,
2073  __Pyx_ImportType_CheckSize_Ignore = 2
2074 };
2075 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2076 #endif
2077 
2078 /* CalculateMetaclass.proto */
2079 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
2080 
2081 /* FetchCommonType.proto */
2082 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2083 
2084 /* CythonFunctionShared.proto */
2085 #define __Pyx_CyFunction_USED 1
2086 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2087 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2088 #define __Pyx_CYFUNCTION_CCLASS 0x04
2089 #define __Pyx_CyFunction_GetClosure(f)\
2090  (((__pyx_CyFunctionObject *) (f))->func_closure)
2091 #define __Pyx_CyFunction_GetClassObj(f)\
2092  (((__pyx_CyFunctionObject *) (f))->func_classobj)
2093 #define __Pyx_CyFunction_Defaults(type, f)\
2094  ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2095 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2096  ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2097 typedef struct {
2098  PyCFunctionObject func;
2099 #if PY_VERSION_HEX < 0x030500A0
2100  PyObject *func_weakreflist;
2101 #endif
2102  PyObject *func_dict;
2103  PyObject *func_name;
2104  PyObject *func_qualname;
2105  PyObject *func_doc;
2106  PyObject *func_globals;
2107  PyObject *func_code;
2108  PyObject *func_closure;
2109  PyObject *func_classobj;
2110  void *defaults;
2111  int defaults_pyobjects;
2112  size_t defaults_size; // used by FusedFunction for copying defaults
2113  int flags;
2114  PyObject *defaults_tuple;
2115  PyObject *defaults_kwdict;
2116  PyObject *(*defaults_getter)(PyObject *);
2117  PyObject *func_annotations;
2118 } __pyx_CyFunctionObject;
2119 static PyTypeObject *__pyx_CyFunctionType = 0;
2120 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2121 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2122  int flags, PyObject* qualname,
2123  PyObject *self,
2124  PyObject *module, PyObject *globals,
2125  PyObject* code);
2126 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2127  size_t size,
2128  int pyobjects);
2129 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2130  PyObject *tuple);
2131 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2132  PyObject *dict);
2133 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2134  PyObject *dict);
2135 static int __pyx_CyFunction_init(void);
2136 
2137 /* CythonFunction.proto */
2138 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2139  int flags, PyObject* qualname,
2140  PyObject *closure,
2141  PyObject *module, PyObject *globals,
2142  PyObject* code);
2143 
2144 /* SetNameInClass.proto */
2145 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
2146 #define __Pyx_SetNameInClass(ns, name, value)\
2147  (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
2148 #elif CYTHON_COMPILING_IN_CPYTHON
2149 #define __Pyx_SetNameInClass(ns, name, value)\
2150  (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
2151 #else
2152 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
2153 #endif
2154 
2155 /* Py3ClassCreate.proto */
2156 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
2157  PyObject *mkw, PyObject *modname, PyObject *doc);
2158 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
2159  PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
2160 
2161 /* CLineInTraceback.proto */
2162 #ifdef CYTHON_CLINE_IN_TRACEBACK
2163 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2164 #else
2165 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2166 #endif
2167 
2168 /* CodeObjectCache.proto */
2169 typedef struct {
2170  PyCodeObject* code_object;
2171  int code_line;
2172 } __Pyx_CodeObjectCacheEntry;
2173 struct __Pyx_CodeObjectCache {
2174  int count;
2175  int max_count;
2176  __Pyx_CodeObjectCacheEntry* entries;
2177 };
2178 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2179 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2180 static PyCodeObject *__pyx_find_code_object(int code_line);
2181 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2182 
2183 /* AddTraceback.proto */
2184 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2185  int py_line, const char *filename);
2186 
2187 #if PY_MAJOR_VERSION < 3
2188  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2189  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2190 #else
2191  #define __Pyx_GetBuffer PyObject_GetBuffer
2192  #define __Pyx_ReleaseBuffer PyBuffer_Release
2193 #endif
2194 
2195 
2196 /* BufferStructDeclare.proto */
2197 typedef struct {
2198  Py_ssize_t shape, strides, suboffsets;
2199 } __Pyx_Buf_DimInfo;
2200 typedef struct {
2201  size_t refcount;
2202  Py_buffer pybuffer;
2203 } __Pyx_Buffer;
2204 typedef struct {
2205  __Pyx_Buffer *rcbuffer;
2206  char *data;
2207  __Pyx_Buf_DimInfo diminfo[8];
2208 } __Pyx_LocalBuf_ND;
2209 
2210 /* MemviewSliceIsContig.proto */
2211 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2212 
2213 /* OverlappingSlices.proto */
2214 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2215  __Pyx_memviewslice *slice2,
2216  int ndim, size_t itemsize);
2217 
2218 /* Capsule.proto */
2219 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2220 
2221 /* GCCDiagnostics.proto */
2222 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2223 #define __Pyx_HAS_GCC_DIAGNOSTIC
2224 #endif
2225 
2226 /* IsLittleEndian.proto */
2227 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2228 
2229 /* BufferFormatCheck.proto */
2230 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2231 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2232  __Pyx_BufFmt_StackElem* stack,
2233  __Pyx_TypeInfo* type);
2234 
2235 /* TypeInfoCompare.proto */
2236 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2237 
2238 /* MemviewSliceValidateAndInit.proto */
2239 static int __Pyx_ValidateAndInit_memviewslice(
2240  int *axes_specs,
2241  int c_or_f_flag,
2242  int buf_flags,
2243  int ndim,
2244  __Pyx_TypeInfo *dtype,
2245  __Pyx_BufFmt_StackElem stack[],
2246  __Pyx_memviewslice *memviewslice,
2247  PyObject *original_obj);
2248 
2249 /* ObjectToMemviewSlice.proto */
2250 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *, int writable_flag);
2251 
2252 /* ObjectToMemviewSlice.proto */
2253 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *, int writable_flag);
2254 
2255 /* RealImag.proto */
2256 #if CYTHON_CCOMPLEX
2257  #ifdef __cplusplus
2258  #define __Pyx_CREAL(z) ((z).real())
2259  #define __Pyx_CIMAG(z) ((z).imag())
2260  #else
2261  #define __Pyx_CREAL(z) (__real__(z))
2262  #define __Pyx_CIMAG(z) (__imag__(z))
2263  #endif
2264 #else
2265  #define __Pyx_CREAL(z) ((z).real)
2266  #define __Pyx_CIMAG(z) ((z).imag)
2267 #endif
2268 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2269  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2270  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2271  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2272 #else
2273  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2274  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2275 #endif
2276 
2277 /* Arithmetic.proto */
2278 #if CYTHON_CCOMPLEX
2279  #define __Pyx_c_eq_float(a, b) ((a)==(b))
2280  #define __Pyx_c_sum_float(a, b) ((a)+(b))
2281  #define __Pyx_c_diff_float(a, b) ((a)-(b))
2282  #define __Pyx_c_prod_float(a, b) ((a)*(b))
2283  #define __Pyx_c_quot_float(a, b) ((a)/(b))
2284  #define __Pyx_c_neg_float(a) (-(a))
2285  #ifdef __cplusplus
2286  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2287  #define __Pyx_c_conj_float(z) (::std::conj(z))
2288  #if 1
2289  #define __Pyx_c_abs_float(z) (::std::abs(z))
2290  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2291  #endif
2292  #else
2293  #define __Pyx_c_is_zero_float(z) ((z)==0)
2294  #define __Pyx_c_conj_float(z) (conjf(z))
2295  #if 1
2296  #define __Pyx_c_abs_float(z) (cabsf(z))
2297  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2298  #endif
2299  #endif
2300 #else
2301  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2302  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2303  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2304  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2305  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2306  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2307  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2308  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2309  #if 1
2310  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2311  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2312  #endif
2313 #endif
2314 
2315 /* Arithmetic.proto */
2316 #if CYTHON_CCOMPLEX
2317  #define __Pyx_c_eq_double(a, b) ((a)==(b))
2318  #define __Pyx_c_sum_double(a, b) ((a)+(b))
2319  #define __Pyx_c_diff_double(a, b) ((a)-(b))
2320  #define __Pyx_c_prod_double(a, b) ((a)*(b))
2321  #define __Pyx_c_quot_double(a, b) ((a)/(b))
2322  #define __Pyx_c_neg_double(a) (-(a))
2323  #ifdef __cplusplus
2324  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2325  #define __Pyx_c_conj_double(z) (::std::conj(z))
2326  #if 1
2327  #define __Pyx_c_abs_double(z) (::std::abs(z))
2328  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2329  #endif
2330  #else
2331  #define __Pyx_c_is_zero_double(z) ((z)==0)
2332  #define __Pyx_c_conj_double(z) (conj(z))
2333  #if 1
2334  #define __Pyx_c_abs_double(z) (cabs(z))
2335  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2336  #endif
2337  #endif
2338 #else
2339  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2340  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2341  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2342  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2343  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2344  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2345  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2346  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2347  #if 1
2348  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2349  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2350  #endif
2351 #endif
2352 
2353 /* MemviewSliceCopyTemplate.proto */
2354 static __Pyx_memviewslice
2355 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2356  const char *mode, int ndim,
2357  size_t sizeof_dtype, int contig_flag,
2358  int dtype_is_object);
2359 
2360 /* CIntFromPy.proto */
2361 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2362 
2363 /* CIntFromPy.proto */
2364 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2365 
2366 /* CIntToPy.proto */
2367 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2368 
2369 /* CIntToPy.proto */
2370 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2371 
2372 /* CIntFromPy.proto */
2373 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2374 
2375 /* CheckBinaryVersion.proto */
2376 static int __Pyx_check_binary_version(void);
2377 
2378 /* InitStrings.proto */
2379 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2380 
2381 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2382 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2383 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2384 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2385 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*/
2386 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2387 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2388 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2389 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2390 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2391 
2392 /* Module declarations from 'proteus' */
2393 
2394 /* Module declarations from 'cpython.buffer' */
2395 
2396 /* Module declarations from 'libc.string' */
2397 
2398 /* Module declarations from 'libc.stdio' */
2399 
2400 /* Module declarations from '__builtin__' */
2401 
2402 /* Module declarations from 'cpython.type' */
2403 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2404 
2405 /* Module declarations from 'cpython' */
2406 
2407 /* Module declarations from 'cpython.object' */
2408 
2409 /* Module declarations from 'cpython.ref' */
2410 
2411 /* Module declarations from 'cpython.mem' */
2412 
2413 /* Module declarations from 'numpy' */
2414 
2415 /* Module declarations from 'numpy' */
2416 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2417 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2418 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2419 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2420 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2421 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2422 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2423 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2424 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2425 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2426 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2427 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2428 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2429 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2430 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2431 
2432 /* Module declarations from 'proteus.superluWrappers' */
2433 static PyTypeObject *__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix = 0;
2434 
2435 /* Module declarations from 'cython.view' */
2436 
2437 /* Module declarations from 'cython' */
2438 
2439 /* Module declarations from 'csmoothers' */
2440 static PyTypeObject *__pyx_ptype_10csmoothers_cASMFactor = 0;
2441 static PyTypeObject *__pyx_ptype_10csmoothers_cBASMFactor = 0;
2442 static PyTypeObject *__pyx_array_type = 0;
2443 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2444 static PyTypeObject *__pyx_memoryview_type = 0;
2445 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2446 static PyObject *generic = 0;
2447 static PyObject *strided = 0;
2448 static PyObject *indirect = 0;
2449 static PyObject *contiguous = 0;
2450 static PyObject *indirect_contiguous = 0;
2451 static int __pyx_memoryview_thread_locks_used;
2452 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2453 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
2454 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
2455 static void __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
2456 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
2457 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
2458 static PyObject *__pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
2459 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, struct __pyx_obj_10csmoothers_cASMFactor *); /*proto*/
2460 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, struct __pyx_obj_10csmoothers_cASMFactor *, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
2461 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, struct __pyx_obj_10csmoothers_cBASMFactor *); /*proto*/
2462 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, struct __pyx_obj_10csmoothers_cBASMFactor *, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
2463 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2464 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2465 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2466 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2467 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2468 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2469 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2470 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*/
2471 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2472 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2473 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2474 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2475 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2476 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2477 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2478 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2479 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2480 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2481 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2482 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2483 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2484 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2485 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2486 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2487 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2488 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2489 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2490 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2491 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2492 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2493 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2494 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2495 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2496 static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
2497 static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
2498 #define __Pyx_MODULE_NAME "csmoothers"
2499 extern int __pyx_module_is_main_csmoothers;
2500 int __pyx_module_is_main_csmoothers = 0;
2501 
2502 /* Implementation of 'csmoothers' */
2503 static PyObject *__pyx_builtin_object;
2504 static PyObject *__pyx_builtin_TypeError;
2505 static PyObject *__pyx_builtin_ImportError;
2506 static PyObject *__pyx_builtin_ValueError;
2507 static PyObject *__pyx_builtin_MemoryError;
2508 static PyObject *__pyx_builtin_enumerate;
2509 static PyObject *__pyx_builtin_range;
2510 static PyObject *__pyx_builtin_Ellipsis;
2511 static PyObject *__pyx_builtin_id;
2512 static PyObject *__pyx_builtin_IndexError;
2513 static const char __pyx_k_A[] = "A";
2514 static const char __pyx_k_L[] = "L";
2515 static const char __pyx_k_M[] = "M";
2516 static const char __pyx_k_O[] = "O";
2517 static const char __pyx_k_R[] = "R";
2518 static const char __pyx_k_c[] = "c";
2519 static const char __pyx_k_w[] = "w";
2520 static const char __pyx_k_bs[] = "bs";
2521 static const char __pyx_k_dX[] = "dX";
2522 static const char __pyx_k_id[] = "id";
2523 static const char __pyx_k_nc[] = "nc";
2524 static const char __pyx_k_np[] = "np";
2525 static const char __pyx_k_nr[] = "nr";
2526 static const char __pyx_k_doc[] = "__doc__";
2527 static const char __pyx_k_new[] = "__new__";
2528 static const char __pyx_k_obj[] = "obj";
2529 static const char __pyx_k_tol[] = "tol";
2530 static const char __pyx_k_base[] = "base";
2531 static const char __pyx_k_dict[] = "__dict__";
2532 static const char __pyx_k_init[] = "__init__";
2533 static const char __pyx_k_main[] = "__main__";
2534 static const char __pyx_k_mode[] = "mode";
2535 static const char __pyx_k_name[] = "name";
2536 static const char __pyx_k_ndim[] = "ndim";
2537 static const char __pyx_k_pack[] = "pack";
2538 static const char __pyx_k_self[] = "self";
2539 static const char __pyx_k_size[] = "size";
2540 static const char __pyx_k_step[] = "step";
2541 static const char __pyx_k_stop[] = "stop";
2542 static const char __pyx_k_test[] = "__test__";
2543 static const char __pyx_k_ASCII[] = "ASCII";
2544 static const char __pyx_k_class[] = "__class__";
2545 static const char __pyx_k_error[] = "error";
2546 static const char __pyx_k_flags[] = "flags";
2547 static const char __pyx_k_numpy[] = "numpy";
2548 static const char __pyx_k_range[] = "range";
2549 static const char __pyx_k_shape[] = "shape";
2550 static const char __pyx_k_start[] = "start";
2551 static const char __pyx_k_encode[] = "encode";
2552 static const char __pyx_k_format[] = "format";
2553 static const char __pyx_k_import[] = "__import__";
2554 static const char __pyx_k_module[] = "__module__";
2555 static const char __pyx_k_name_2[] = "__name__";
2556 static const char __pyx_k_object[] = "object";
2557 static const char __pyx_k_pickle[] = "pickle";
2558 static const char __pyx_k_reduce[] = "__reduce__";
2559 static const char __pyx_k_struct[] = "struct";
2560 static const char __pyx_k_unpack[] = "unpack";
2561 static const char __pyx_k_update[] = "update";
2562 static const char __pyx_k_fortran[] = "fortran";
2563 static const char __pyx_k_memview[] = "memview";
2564 static const char __pyx_k_prepare[] = "__prepare__";
2565 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2566 static const char __pyx_k_getstate[] = "__getstate__";
2567 static const char __pyx_k_itemsize[] = "itemsize";
2568 static const char __pyx_k_pyx_type[] = "__pyx_type";
2569 static const char __pyx_k_qualname[] = "__qualname__";
2570 static const char __pyx_k_setstate[] = "__setstate__";
2571 static const char __pyx_k_ASMFactor[] = "ASMFactor";
2572 static const char __pyx_k_TypeError[] = "TypeError";
2573 static const char __pyx_k_asmFactor[] = "asmFactor";
2574 static const char __pyx_k_enumerate[] = "enumerate";
2575 static const char __pyx_k_metaclass[] = "__metaclass__";
2576 static const char __pyx_k_pyx_state[] = "__pyx_state";
2577 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2578 static const char __pyx_k_BASMFactor[] = "BASMFactor";
2579 static const char __pyx_k_IndexError[] = "IndexError";
2580 static const char __pyx_k_ValueError[] = "ValueError";
2581 static const char __pyx_k_basmFactor[] = "basmFactor";
2582 static const char __pyx_k_cASMFactor[] = "_cASMFactor";
2583 static const char __pyx_k_csmoothers[] = "csmoothers";
2584 static const char __pyx_k_node_order[] = "node_order";
2585 static const char __pyx_k_pyx_result[] = "__pyx_result";
2586 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2587 static const char __pyx_k_ImportError[] = "ImportError";
2588 static const char __pyx_k_MemoryError[] = "MemoryError";
2589 static const char __pyx_k_PickleError[] = "PickleError";
2590 static const char __pyx_k_cBASMFactor[] = "_cBASMFactor";
2591 static const char __pyx_k_asm_NR_solve[] = "asm_NR_solve";
2592 static const char __pyx_k_cASMFactor_2[] = "cASMFactor";
2593 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2594 static const char __pyx_k_stringsource[] = "stringsource";
2595 static const char __pyx_k_basm_NR_solve[] = "basm_NR_solve";
2596 static const char __pyx_k_cBASMFactor_2[] = "cBASMFactor";
2597 static const char __pyx_k_cSparseMatrix[] = "_cSparseMatrix";
2598 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2599 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2600 static const char __pyx_k_asm_NR_prepare[] = "asm_NR_prepare";
2601 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2602 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2603 static const char __pyx_k_basm_NR_prepare[] = "basm_NR_prepare";
2604 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2605 static const char __pyx_k_jacobi_NR_solve[] = "jacobi_NR_solve";
2606 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2607 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2608 static const char __pyx_k_ASMFactor___init[] = "ASMFactor.__init__";
2609 static const char __pyx_k_BASMFactor___init[] = "BASMFactor.__init__";
2610 static const char __pyx_k_jacobi_NR_prepare[] = "jacobi_NR_prepare";
2611 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2612 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2613 static const char __pyx_k_nl_jacobi_NR_solve[] = "nl_jacobi_NR_solve";
2614 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2615 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2616 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2617 static const char __pyx_k_gauss_seidel_NR_solve[] = "gauss_seidel_NR_solve";
2618 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2619 static const char __pyx_k_gauss_seidel_NR_preare[] = "gauss_seidel_NR_preare";
2620 static const char __pyx_k_proteus_csmoothers_pyx[] = "proteus/csmoothers.pyx";
2621 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2622 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2623 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2624 static const char __pyx_k_nl_gauss_seidel_NR_solve[] = "nl_gauss_seidel_NR_solve";
2625 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2626 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2627 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2628 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2629 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2630 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2631 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2632 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2633 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2634 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2635 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
2636 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2637 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2638 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2639 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2640 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2641 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2642 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2643 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2644 static PyObject *__pyx_n_s_A;
2645 static PyObject *__pyx_n_s_ASCII;
2646 static PyObject *__pyx_n_s_ASMFactor;
2647 static PyObject *__pyx_n_s_ASMFactor___init;
2648 static PyObject *__pyx_n_s_BASMFactor;
2649 static PyObject *__pyx_n_s_BASMFactor___init;
2650 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2651 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2652 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2653 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2654 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2655 static PyObject *__pyx_n_s_Ellipsis;
2656 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2657 static PyObject *__pyx_n_s_ImportError;
2658 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
2659 static PyObject *__pyx_n_s_IndexError;
2660 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2661 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2662 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2663 static PyObject *__pyx_n_s_L;
2664 static PyObject *__pyx_n_s_M;
2665 static PyObject *__pyx_n_s_MemoryError;
2666 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2667 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2668 static PyObject *__pyx_n_b_O;
2669 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2670 static PyObject *__pyx_n_s_PickleError;
2671 static PyObject *__pyx_n_s_R;
2672 static PyObject *__pyx_n_s_TypeError;
2673 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2674 static PyObject *__pyx_n_s_ValueError;
2675 static PyObject *__pyx_n_s_View_MemoryView;
2676 static PyObject *__pyx_n_s_allocate_buffer;
2677 static PyObject *__pyx_n_s_asmFactor;
2678 static PyObject *__pyx_n_s_asm_NR_prepare;
2679 static PyObject *__pyx_n_s_asm_NR_solve;
2680 static PyObject *__pyx_n_s_base;
2681 static PyObject *__pyx_n_s_basmFactor;
2682 static PyObject *__pyx_n_s_basm_NR_prepare;
2683 static PyObject *__pyx_n_s_basm_NR_solve;
2684 static PyObject *__pyx_n_s_bs;
2685 static PyObject *__pyx_n_s_c;
2686 static PyObject *__pyx_n_u_c;
2687 static PyObject *__pyx_n_s_cASMFactor;
2688 static PyObject *__pyx_n_s_cASMFactor_2;
2689 static PyObject *__pyx_n_s_cBASMFactor;
2690 static PyObject *__pyx_n_s_cBASMFactor_2;
2691 static PyObject *__pyx_n_s_cSparseMatrix;
2692 static PyObject *__pyx_n_s_class;
2693 static PyObject *__pyx_n_s_cline_in_traceback;
2694 static PyObject *__pyx_kp_s_contiguous_and_direct;
2695 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2696 static PyObject *__pyx_n_s_csmoothers;
2697 static PyObject *__pyx_n_s_dX;
2698 static PyObject *__pyx_n_s_dict;
2699 static PyObject *__pyx_n_s_doc;
2700 static PyObject *__pyx_n_s_dtype_is_object;
2701 static PyObject *__pyx_n_s_encode;
2702 static PyObject *__pyx_n_s_enumerate;
2703 static PyObject *__pyx_n_s_error;
2704 static PyObject *__pyx_n_s_flags;
2705 static PyObject *__pyx_n_s_format;
2706 static PyObject *__pyx_n_s_fortran;
2707 static PyObject *__pyx_n_u_fortran;
2708 static PyObject *__pyx_n_s_gauss_seidel_NR_preare;
2709 static PyObject *__pyx_n_s_gauss_seidel_NR_solve;
2710 static PyObject *__pyx_n_s_getstate;
2711 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2712 static PyObject *__pyx_n_s_id;
2713 static PyObject *__pyx_n_s_import;
2714 static PyObject *__pyx_n_s_init;
2715 static PyObject *__pyx_n_s_itemsize;
2716 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2717 static PyObject *__pyx_n_s_jacobi_NR_prepare;
2718 static PyObject *__pyx_n_s_jacobi_NR_solve;
2719 static PyObject *__pyx_n_s_main;
2720 static PyObject *__pyx_n_s_memview;
2721 static PyObject *__pyx_n_s_metaclass;
2722 static PyObject *__pyx_n_s_mode;
2723 static PyObject *__pyx_n_s_module;
2724 static PyObject *__pyx_n_s_name;
2725 static PyObject *__pyx_n_s_name_2;
2726 static PyObject *__pyx_n_s_nc;
2727 static PyObject *__pyx_n_s_ndim;
2728 static PyObject *__pyx_n_s_new;
2729 static PyObject *__pyx_n_s_nl_gauss_seidel_NR_solve;
2730 static PyObject *__pyx_n_s_nl_jacobi_NR_solve;
2731 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2732 static PyObject *__pyx_n_s_node_order;
2733 static PyObject *__pyx_n_s_np;
2734 static PyObject *__pyx_n_s_nr;
2735 static PyObject *__pyx_n_s_numpy;
2736 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2737 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2738 static PyObject *__pyx_n_s_obj;
2739 static PyObject *__pyx_n_s_object;
2740 static PyObject *__pyx_n_s_pack;
2741 static PyObject *__pyx_n_s_pickle;
2742 static PyObject *__pyx_n_s_prepare;
2743 static PyObject *__pyx_kp_s_proteus_csmoothers_pyx;
2744 static PyObject *__pyx_n_s_pyx_PickleError;
2745 static PyObject *__pyx_n_s_pyx_checksum;
2746 static PyObject *__pyx_n_s_pyx_getbuffer;
2747 static PyObject *__pyx_n_s_pyx_result;
2748 static PyObject *__pyx_n_s_pyx_state;
2749 static PyObject *__pyx_n_s_pyx_type;
2750 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2751 static PyObject *__pyx_n_s_pyx_vtable;
2752 static PyObject *__pyx_n_s_qualname;
2753 static PyObject *__pyx_n_s_range;
2754 static PyObject *__pyx_n_s_reduce;
2755 static PyObject *__pyx_n_s_reduce_cython;
2756 static PyObject *__pyx_n_s_reduce_ex;
2757 static PyObject *__pyx_n_s_self;
2758 static PyObject *__pyx_n_s_setstate;
2759 static PyObject *__pyx_n_s_setstate_cython;
2760 static PyObject *__pyx_n_s_shape;
2761 static PyObject *__pyx_n_s_size;
2762 static PyObject *__pyx_n_s_start;
2763 static PyObject *__pyx_n_s_step;
2764 static PyObject *__pyx_n_s_stop;
2765 static PyObject *__pyx_kp_s_strided_and_direct;
2766 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2767 static PyObject *__pyx_kp_s_strided_and_indirect;
2768 static PyObject *__pyx_kp_s_stringsource;
2769 static PyObject *__pyx_n_s_struct;
2770 static PyObject *__pyx_n_s_test;
2771 static PyObject *__pyx_n_s_tol;
2772 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2773 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2774 static PyObject *__pyx_n_s_unpack;
2775 static PyObject *__pyx_n_s_update;
2776 static PyObject *__pyx_n_s_w;
2777 static PyObject *__pyx_pf_10csmoothers_9ASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L); /* proto */
2778 static int __pyx_pf_10csmoothers_10cASMFactor___cinit__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L); /* proto */
2779 static void __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self); /* proto */
2780 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self); /* proto */
2781 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2782 static PyObject *__pyx_pf_10csmoothers_10BASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L, PyObject *__pyx_v_bs); /* proto */
2783 static int __pyx_pf_10csmoothers_11cBASMFactor___cinit__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L, int __pyx_v_bs); /* proto */
2784 static void __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self); /* proto */
2785 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self); /* proto */
2786 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2787 static PyObject *__pyx_pf_10csmoothers_jacobi_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M); /* proto */
2788 static PyObject *__pyx_pf_10csmoothers_2jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX); /* proto */
2789 static PyObject *__pyx_pf_10csmoothers_4nl_jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX); /* proto */
2790 static PyObject *__pyx_pf_10csmoothers_6gauss_seidel_NR_preare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M); /* proto */
2791 static PyObject *__pyx_pf_10csmoothers_8gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX); /* proto */
2792 static PyObject *__pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX); /* proto */
2793 static PyObject *__pyx_pf_10csmoothers_12asm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_asmFactor); /* proto */
2794 static PyObject *__pyx_pf_10csmoothers_14asm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_asmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX); /* proto */
2795 static PyObject *__pyx_pf_10csmoothers_16basm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_basmFactor); /* proto */
2796 static PyObject *__pyx_pf_10csmoothers_18basm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_basmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX); /* proto */
2797 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 */
2798 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 */
2799 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2800 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2801 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2802 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2803 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2804 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 */
2805 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2806 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 */
2807 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2808 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2809 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2810 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2811 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 */
2812 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2813 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2814 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 */
2815 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 */
2816 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2817 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2818 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2819 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2820 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2821 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2822 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2823 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2824 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2825 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2826 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2827 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2828 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2829 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2830 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2831 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2832 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2833 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 */
2834 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2835 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2836 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2837 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 */
2838 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 */
2839 static PyObject *__pyx_tp_new_10csmoothers_cASMFactor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2840 static PyObject *__pyx_tp_new_10csmoothers_cBASMFactor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2841 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2842 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2843 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2844 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2845 static PyObject *__pyx_int_0;
2846 static PyObject *__pyx_int_1;
2847 static PyObject *__pyx_int_112105877;
2848 static PyObject *__pyx_int_136983863;
2849 static PyObject *__pyx_int_184977713;
2850 static PyObject *__pyx_int_neg_1;
2851 static PyObject *__pyx_tuple_;
2852 static PyObject *__pyx_tuple__2;
2853 static PyObject *__pyx_tuple__3;
2854 static PyObject *__pyx_tuple__4;
2855 static PyObject *__pyx_tuple__5;
2856 static PyObject *__pyx_tuple__6;
2857 static PyObject *__pyx_tuple__7;
2858 static PyObject *__pyx_tuple__8;
2859 static PyObject *__pyx_tuple__9;
2860 static PyObject *__pyx_slice__21;
2861 static PyObject *__pyx_tuple__10;
2862 static PyObject *__pyx_tuple__11;
2863 static PyObject *__pyx_tuple__12;
2864 static PyObject *__pyx_tuple__13;
2865 static PyObject *__pyx_tuple__14;
2866 static PyObject *__pyx_tuple__15;
2867 static PyObject *__pyx_tuple__16;
2868 static PyObject *__pyx_tuple__17;
2869 static PyObject *__pyx_tuple__18;
2870 static PyObject *__pyx_tuple__19;
2871 static PyObject *__pyx_tuple__20;
2872 static PyObject *__pyx_tuple__22;
2873 static PyObject *__pyx_tuple__23;
2874 static PyObject *__pyx_tuple__24;
2875 static PyObject *__pyx_tuple__25;
2876 static PyObject *__pyx_tuple__26;
2877 static PyObject *__pyx_tuple__27;
2878 static PyObject *__pyx_tuple__29;
2879 static PyObject *__pyx_tuple__30;
2880 static PyObject *__pyx_tuple__32;
2881 static PyObject *__pyx_tuple__34;
2882 static PyObject *__pyx_tuple__36;
2883 static PyObject *__pyx_tuple__38;
2884 static PyObject *__pyx_tuple__40;
2885 static PyObject *__pyx_tuple__42;
2886 static PyObject *__pyx_tuple__44;
2887 static PyObject *__pyx_tuple__46;
2888 static PyObject *__pyx_tuple__48;
2889 static PyObject *__pyx_tuple__50;
2890 static PyObject *__pyx_tuple__52;
2891 static PyObject *__pyx_tuple__53;
2892 static PyObject *__pyx_tuple__54;
2893 static PyObject *__pyx_tuple__55;
2894 static PyObject *__pyx_tuple__56;
2895 static PyObject *__pyx_tuple__57;
2896 static PyObject *__pyx_codeobj__28;
2897 static PyObject *__pyx_codeobj__31;
2898 static PyObject *__pyx_codeobj__33;
2899 static PyObject *__pyx_codeobj__35;
2900 static PyObject *__pyx_codeobj__37;
2901 static PyObject *__pyx_codeobj__39;
2902 static PyObject *__pyx_codeobj__41;
2903 static PyObject *__pyx_codeobj__43;
2904 static PyObject *__pyx_codeobj__45;
2905 static PyObject *__pyx_codeobj__47;
2906 static PyObject *__pyx_codeobj__49;
2907 static PyObject *__pyx_codeobj__51;
2908 static PyObject *__pyx_codeobj__58;
2909 /* Late includes */
2910 
2911 /* "csmoothers.pyx":7
2912  * class ASMFactor(object):
2913  *
2914  * def __init__(self, L): # <<<<<<<<<<<<<<
2915  * self.L = L
2916  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
2917  */
2918 
2919 /* Python wrapper */
2920 static PyObject *__pyx_pw_10csmoothers_9ASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2921 static PyMethodDef __pyx_mdef_10csmoothers_9ASMFactor_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_9ASMFactor_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
2922 static PyObject *__pyx_pw_10csmoothers_9ASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2923  PyObject *__pyx_v_self = 0;
2924  PyObject *__pyx_v_L = 0;
2925  int __pyx_lineno = 0;
2926  const char *__pyx_filename = NULL;
2927  int __pyx_clineno = 0;
2928  PyObject *__pyx_r = 0;
2929  __Pyx_RefNannyDeclarations
2930  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
2931  {
2932  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_L,0};
2933  PyObject* values[2] = {0,0};
2934  if (unlikely(__pyx_kwds)) {
2935  Py_ssize_t kw_args;
2936  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2937  switch (pos_args) {
2938  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2939  CYTHON_FALLTHROUGH;
2940  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2941  CYTHON_FALLTHROUGH;
2942  case 0: break;
2943  default: goto __pyx_L5_argtuple_error;
2944  }
2945  kw_args = PyDict_Size(__pyx_kwds);
2946  switch (pos_args) {
2947  case 0:
2948  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
2949  else goto __pyx_L5_argtuple_error;
2950  CYTHON_FALLTHROUGH;
2951  case 1:
2952  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
2953  else {
2954  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 7, __pyx_L3_error)
2955  }
2956  }
2957  if (unlikely(kw_args > 0)) {
2958  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 7, __pyx_L3_error)
2959  }
2960  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
2961  goto __pyx_L5_argtuple_error;
2962  } else {
2963  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2964  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2965  }
2966  __pyx_v_self = values[0];
2967  __pyx_v_L = values[1];
2968  }
2969  goto __pyx_L4_argument_unpacking_done;
2970  __pyx_L5_argtuple_error:;
2971  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7, __pyx_L3_error)
2972  __pyx_L3_error:;
2973  __Pyx_AddTraceback("csmoothers.ASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2974  __Pyx_RefNannyFinishContext();
2975  return NULL;
2976  __pyx_L4_argument_unpacking_done:;
2977  __pyx_r = __pyx_pf_10csmoothers_9ASMFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_L);
2978 
2979  /* function exit code */
2980  __Pyx_RefNannyFinishContext();
2981  return __pyx_r;
2982 }
2983 
2984 static PyObject *__pyx_pf_10csmoothers_9ASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L) {
2985  PyObject *__pyx_r = NULL;
2986  __Pyx_RefNannyDeclarations
2987  PyObject *__pyx_t_1 = NULL;
2988  PyObject *__pyx_t_2 = NULL;
2989  int __pyx_lineno = 0;
2990  const char *__pyx_filename = NULL;
2991  int __pyx_clineno = 0;
2992  __Pyx_RefNannySetupContext("__init__", 0);
2993 
2994  /* "csmoothers.pyx":8
2995  *
2996  * def __init__(self, L):
2997  * self.L = L # <<<<<<<<<<<<<<
2998  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
2999  *
3000  */
3001  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_L, __pyx_v_L) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
3002 
3003  /* "csmoothers.pyx":9
3004  * def __init__(self, L):
3005  * self.L = L
3006  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix) # <<<<<<<<<<<<<<
3007  *
3008  * cdef class cASMFactor(object):
3009  */
3010  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
3011  __Pyx_GOTREF(__pyx_t_1);
3012  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
3013  __Pyx_GOTREF(__pyx_t_2);
3014  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3015  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_10csmoothers_cASMFactor), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
3016  __Pyx_GOTREF(__pyx_t_1);
3017  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3018  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cASMFactor, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
3019  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3020 
3021  /* "csmoothers.pyx":7
3022  * class ASMFactor(object):
3023  *
3024  * def __init__(self, L): # <<<<<<<<<<<<<<
3025  * self.L = L
3026  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
3027  */
3028 
3029  /* function exit code */
3030  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3031  goto __pyx_L0;
3032  __pyx_L1_error:;
3033  __Pyx_XDECREF(__pyx_t_1);
3034  __Pyx_XDECREF(__pyx_t_2);
3035  __Pyx_AddTraceback("csmoothers.ASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3036  __pyx_r = NULL;
3037  __pyx_L0:;
3038  __Pyx_XGIVEREF(__pyx_r);
3039  __Pyx_RefNannyFinishContext();
3040  return __pyx_r;
3041 }
3042 
3043 /* "csmoothers.pyx":13
3044  * cdef class cASMFactor(object):
3045  *
3046  * def __cinit__(self, # <<<<<<<<<<<<<<
3047  * superluWrappers.cSparseMatrix L):
3048  * cdef int rval = 0
3049  */
3050 
3051 /* Python wrapper */
3052 static int __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3053 static int __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3054  struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L = 0;
3055  int __pyx_lineno = 0;
3056  const char *__pyx_filename = NULL;
3057  int __pyx_clineno = 0;
3058  int __pyx_r;
3059  __Pyx_RefNannyDeclarations
3060  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
3061  {
3062  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_L,0};
3063  PyObject* values[1] = {0};
3064  if (unlikely(__pyx_kwds)) {
3065  Py_ssize_t kw_args;
3066  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3067  switch (pos_args) {
3068  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3069  CYTHON_FALLTHROUGH;
3070  case 0: break;
3071  default: goto __pyx_L5_argtuple_error;
3072  }
3073  kw_args = PyDict_Size(__pyx_kwds);
3074  switch (pos_args) {
3075  case 0:
3076  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
3077  else goto __pyx_L5_argtuple_error;
3078  }
3079  if (unlikely(kw_args > 0)) {
3080  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 13, __pyx_L3_error)
3081  }
3082  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
3083  goto __pyx_L5_argtuple_error;
3084  } else {
3085  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3086  }
3087  __pyx_v_L = ((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)values[0]);
3088  }
3089  goto __pyx_L4_argument_unpacking_done;
3090  __pyx_L5_argtuple_error:;
3091  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 13, __pyx_L3_error)
3092  __pyx_L3_error:;
3093  __Pyx_AddTraceback("csmoothers.cASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3094  __Pyx_RefNannyFinishContext();
3095  return -1;
3096  __pyx_L4_argument_unpacking_done:;
3097  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix, 1, "L", 0))) __PYX_ERR(0, 14, __pyx_L1_error)
3098  __pyx_r = __pyx_pf_10csmoothers_10cASMFactor___cinit__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self), __pyx_v_L);
3099 
3100  /* function exit code */
3101  goto __pyx_L0;
3102  __pyx_L1_error:;
3103  __pyx_r = -1;
3104  __pyx_L0:;
3105  __Pyx_RefNannyFinishContext();
3106  return __pyx_r;
3107 }
3108 
3109 static int __pyx_pf_10csmoothers_10cASMFactor___cinit__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L) {
3110  int __pyx_v_rval;
3111  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
3112  int __pyx_r;
3113  __Pyx_RefNannyDeclarations
3114  PyObject *__pyx_t_1 = NULL;
3115  int __pyx_t_2;
3116  int __pyx_lineno = 0;
3117  const char *__pyx_filename = NULL;
3118  int __pyx_clineno = 0;
3119  __Pyx_RefNannySetupContext("__cinit__", 0);
3120 
3121  /* "csmoothers.pyx":15
3122  * def __cinit__(self,
3123  * superluWrappers.cSparseMatrix L):
3124  * cdef int rval = 0 # <<<<<<<<<<<<<<
3125  * cdef SuperMatrix AS
3126  * AS.Stype = superluWrappers._SLU_NR
3127  */
3128  __pyx_v_rval = 0;
3129 
3130  /* "csmoothers.pyx":17
3131  * cdef int rval = 0
3132  * cdef SuperMatrix AS
3133  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
3134  * AS.Dtype = superluWrappers._SLU_D
3135  * AS.Mtype = superluWrappers._SLU_GE
3136  */
3137  __pyx_v_AS.Stype = SLU_NR;
3138 
3139  /* "csmoothers.pyx":18
3140  * cdef SuperMatrix AS
3141  * AS.Stype = superluWrappers._SLU_NR
3142  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
3143  * AS.Mtype = superluWrappers._SLU_GE
3144  * AS.nrow = L.nr
3145  */
3146  __pyx_v_AS.Dtype = SLU_D;
3147 
3148  /* "csmoothers.pyx":19
3149  * AS.Stype = superluWrappers._SLU_NR
3150  * AS.Dtype = superluWrappers._SLU_D
3151  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
3152  * AS.nrow = L.nr
3153  * AS.ncol = L.nc
3154  */
3155  __pyx_v_AS.Mtype = SLU_GE;
3156 
3157  /* "csmoothers.pyx":20
3158  * AS.Dtype = superluWrappers._SLU_D
3159  * AS.Mtype = superluWrappers._SLU_GE
3160  * AS.nrow = L.nr # <<<<<<<<<<<<<<
3161  * AS.ncol = L.nc
3162  * AS.Store = &L.A
3163  */
3164  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
3165  __Pyx_GOTREF(__pyx_t_1);
3166  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L1_error)
3167  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3168  __pyx_v_AS.nrow = __pyx_t_2;
3169 
3170  /* "csmoothers.pyx":21
3171  * AS.Mtype = superluWrappers._SLU_GE
3172  * AS.nrow = L.nr
3173  * AS.ncol = L.nc # <<<<<<<<<<<<<<
3174  * AS.Store = &L.A
3175  * rval = casm_NR_init(&AS,
3176  */
3177  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
3178  __Pyx_GOTREF(__pyx_t_1);
3179  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 21, __pyx_L1_error)
3180  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3181  __pyx_v_AS.ncol = __pyx_t_2;
3182 
3183  /* "csmoothers.pyx":22
3184  * AS.nrow = L.nr
3185  * AS.ncol = L.nc
3186  * AS.Store = &L.A # <<<<<<<<<<<<<<
3187  * rval = casm_NR_init(&AS,
3188  * &self.subdomain_dim,
3189  */
3190  __pyx_v_AS.Store = (&__pyx_v_L->A);
3191 
3192  /* "csmoothers.pyx":23
3193  * AS.ncol = L.nc
3194  * AS.Store = &L.A
3195  * rval = casm_NR_init(&AS, # <<<<<<<<<<<<<<
3196  * &self.subdomain_dim,
3197  * &self.l2g_L,
3198  */
3199  __pyx_v_rval = asm_NR_init((&__pyx_v_AS), (&__pyx_v_self->subdomain_dim), (&__pyx_v_self->l2g_L), (&__pyx_v_self->subdomain_L), (&__pyx_v_self->subdomain_R), (&__pyx_v_self->subdomain_dX), (&__pyx_v_self->subdomain_pivots));
3200 
3201  /* "csmoothers.pyx":30
3202  * &self.subdomain_dX,
3203  * &self.subdomain_pivots)
3204  * assert rval == 0 # <<<<<<<<<<<<<<
3205  *
3206  * def __dealloc__(self):
3207  */
3208  #ifndef CYTHON_WITHOUT_ASSERTIONS
3209  if (unlikely(!Py_OptimizeFlag)) {
3210  if (unlikely(!((__pyx_v_rval == 0) != 0))) {
3211  PyErr_SetNone(PyExc_AssertionError);
3212  __PYX_ERR(0, 30, __pyx_L1_error)
3213  }
3214  }
3215  #endif
3216 
3217  /* "csmoothers.pyx":13
3218  * cdef class cASMFactor(object):
3219  *
3220  * def __cinit__(self, # <<<<<<<<<<<<<<
3221  * superluWrappers.cSparseMatrix L):
3222  * cdef int rval = 0
3223  */
3224 
3225  /* function exit code */
3226  __pyx_r = 0;
3227  goto __pyx_L0;
3228  __pyx_L1_error:;
3229  __Pyx_XDECREF(__pyx_t_1);
3230  __Pyx_AddTraceback("csmoothers.cASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3231  __pyx_r = -1;
3232  __pyx_L0:;
3233  __Pyx_RefNannyFinishContext();
3234  return __pyx_r;
3235 }
3236 
3237 /* "csmoothers.pyx":32
3238  * assert rval == 0
3239  *
3240  * def __dealloc__(self): # <<<<<<<<<<<<<<
3241  * casm_NR_free(self.N,
3242  * self.subdomain_dim,
3243  */
3244 
3245 /* Python wrapper */
3246 static void __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
3247 static void __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(PyObject *__pyx_v_self) {
3248  __Pyx_RefNannyDeclarations
3249  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
3250  __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self));
3251 
3252  /* function exit code */
3253  __Pyx_RefNannyFinishContext();
3254 }
3255 
3256 static void __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self) {
3257  __Pyx_RefNannyDeclarations
3258  __Pyx_RefNannySetupContext("__dealloc__", 0);
3259 
3260  /* "csmoothers.pyx":33
3261  *
3262  * def __dealloc__(self):
3263  * casm_NR_free(self.N, # <<<<<<<<<<<<<<
3264  * self.subdomain_dim,
3265  * self.l2g_L,
3266  */
3267  asm_NR_free(__pyx_v_self->N, __pyx_v_self->subdomain_dim, __pyx_v_self->l2g_L, __pyx_v_self->subdomain_L, __pyx_v_self->subdomain_R, __pyx_v_self->subdomain_dX, __pyx_v_self->subdomain_pivots);
3268 
3269  /* "csmoothers.pyx":32
3270  * assert rval == 0
3271  *
3272  * def __dealloc__(self): # <<<<<<<<<<<<<<
3273  * casm_NR_free(self.N,
3274  * self.subdomain_dim,
3275  */
3276 
3277  /* function exit code */
3278  __Pyx_RefNannyFinishContext();
3279 }
3280 
3281 /* "(tree fragment)":1
3282  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3283  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3284  * def __setstate_cython__(self, __pyx_state):
3285  */
3286 
3287 /* Python wrapper */
3288 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3289 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3290  PyObject *__pyx_r = 0;
3291  __Pyx_RefNannyDeclarations
3292  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3293  __pyx_r = __pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self));
3294 
3295  /* function exit code */
3296  __Pyx_RefNannyFinishContext();
3297  return __pyx_r;
3298 }
3299 
3300 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self) {
3301  PyObject *__pyx_r = NULL;
3302  __Pyx_RefNannyDeclarations
3303  PyObject *__pyx_t_1 = NULL;
3304  int __pyx_lineno = 0;
3305  const char *__pyx_filename = NULL;
3306  int __pyx_clineno = 0;
3307  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
3308 
3309  /* "(tree fragment)":2
3310  * def __reduce_cython__(self):
3311  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3312  * def __setstate_cython__(self, __pyx_state):
3313  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3314  */
3315  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
3316  __Pyx_GOTREF(__pyx_t_1);
3317  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3318  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3319  __PYX_ERR(1, 2, __pyx_L1_error)
3320 
3321  /* "(tree fragment)":1
3322  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3323  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3324  * def __setstate_cython__(self, __pyx_state):
3325  */
3326 
3327  /* function exit code */
3328  __pyx_L1_error:;
3329  __Pyx_XDECREF(__pyx_t_1);
3330  __Pyx_AddTraceback("csmoothers.cASMFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3331  __pyx_r = NULL;
3332  __Pyx_XGIVEREF(__pyx_r);
3333  __Pyx_RefNannyFinishContext();
3334  return __pyx_r;
3335 }
3336 
3337 /* "(tree fragment)":3
3338  * def __reduce_cython__(self):
3339  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3340  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3341  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3342  */
3343 
3344 /* Python wrapper */
3345 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
3346 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3347  PyObject *__pyx_r = 0;
3348  __Pyx_RefNannyDeclarations
3349  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3350  __pyx_r = __pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3351 
3352  /* function exit code */
3353  __Pyx_RefNannyFinishContext();
3354  return __pyx_r;
3355 }
3356 
3357 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3358  PyObject *__pyx_r = NULL;
3359  __Pyx_RefNannyDeclarations
3360  PyObject *__pyx_t_1 = NULL;
3361  int __pyx_lineno = 0;
3362  const char *__pyx_filename = NULL;
3363  int __pyx_clineno = 0;
3364  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3365 
3366  /* "(tree fragment)":4
3367  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3368  * def __setstate_cython__(self, __pyx_state):
3369  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3370  */
3371  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
3372  __Pyx_GOTREF(__pyx_t_1);
3373  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3374  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3375  __PYX_ERR(1, 4, __pyx_L1_error)
3376 
3377  /* "(tree fragment)":3
3378  * def __reduce_cython__(self):
3379  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3380  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3381  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3382  */
3383 
3384  /* function exit code */
3385  __pyx_L1_error:;
3386  __Pyx_XDECREF(__pyx_t_1);
3387  __Pyx_AddTraceback("csmoothers.cASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3388  __pyx_r = NULL;
3389  __Pyx_XGIVEREF(__pyx_r);
3390  __Pyx_RefNannyFinishContext();
3391  return __pyx_r;
3392 }
3393 
3394 /* "csmoothers.pyx":44
3395  * class BASMFactor(object):
3396  *
3397  * def __init__(self, L, bs): # <<<<<<<<<<<<<<
3398  * self.L = L
3399  * self.bs = bs
3400  */
3401 
3402 /* Python wrapper */
3403 static PyObject *__pyx_pw_10csmoothers_10BASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3404 static PyMethodDef __pyx_mdef_10csmoothers_10BASMFactor_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_10BASMFactor_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
3405 static PyObject *__pyx_pw_10csmoothers_10BASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3406  PyObject *__pyx_v_self = 0;
3407  PyObject *__pyx_v_L = 0;
3408  PyObject *__pyx_v_bs = 0;
3409  int __pyx_lineno = 0;
3410  const char *__pyx_filename = NULL;
3411  int __pyx_clineno = 0;
3412  PyObject *__pyx_r = 0;
3413  __Pyx_RefNannyDeclarations
3414  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
3415  {
3416  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_L,&__pyx_n_s_bs,0};
3417  PyObject* values[3] = {0,0,0};
3418  if (unlikely(__pyx_kwds)) {
3419  Py_ssize_t kw_args;
3420  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3421  switch (pos_args) {
3422  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3423  CYTHON_FALLTHROUGH;
3424  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3425  CYTHON_FALLTHROUGH;
3426  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3427  CYTHON_FALLTHROUGH;
3428  case 0: break;
3429  default: goto __pyx_L5_argtuple_error;
3430  }
3431  kw_args = PyDict_Size(__pyx_kwds);
3432  switch (pos_args) {
3433  case 0:
3434  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3435  else goto __pyx_L5_argtuple_error;
3436  CYTHON_FALLTHROUGH;
3437  case 1:
3438  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
3439  else {
3440  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 44, __pyx_L3_error)
3441  }
3442  CYTHON_FALLTHROUGH;
3443  case 2:
3444  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--;
3445  else {
3446  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 44, __pyx_L3_error)
3447  }
3448  }
3449  if (unlikely(kw_args > 0)) {
3450  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 44, __pyx_L3_error)
3451  }
3452  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3453  goto __pyx_L5_argtuple_error;
3454  } else {
3455  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3456  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3457  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3458  }
3459  __pyx_v_self = values[0];
3460  __pyx_v_L = values[1];
3461  __pyx_v_bs = values[2];
3462  }
3463  goto __pyx_L4_argument_unpacking_done;
3464  __pyx_L5_argtuple_error:;
3465  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 44, __pyx_L3_error)
3466  __pyx_L3_error:;
3467  __Pyx_AddTraceback("csmoothers.BASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3468  __Pyx_RefNannyFinishContext();
3469  return NULL;
3470  __pyx_L4_argument_unpacking_done:;
3471  __pyx_r = __pyx_pf_10csmoothers_10BASMFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_L, __pyx_v_bs);
3472 
3473  /* function exit code */
3474  __Pyx_RefNannyFinishContext();
3475  return __pyx_r;
3476 }
3477 
3478 static PyObject *__pyx_pf_10csmoothers_10BASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L, PyObject *__pyx_v_bs) {
3479  PyObject *__pyx_r = NULL;
3480  __Pyx_RefNannyDeclarations
3481  PyObject *__pyx_t_1 = NULL;
3482  PyObject *__pyx_t_2 = NULL;
3483  PyObject *__pyx_t_3 = NULL;
3484  int __pyx_lineno = 0;
3485  const char *__pyx_filename = NULL;
3486  int __pyx_clineno = 0;
3487  __Pyx_RefNannySetupContext("__init__", 0);
3488 
3489  /* "csmoothers.pyx":45
3490  *
3491  * def __init__(self, L, bs):
3492  * self.L = L # <<<<<<<<<<<<<<
3493  * self.bs = bs
3494  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix,
3495  */
3496  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_L, __pyx_v_L) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
3497 
3498  /* "csmoothers.pyx":46
3499  * def __init__(self, L, bs):
3500  * self.L = L
3501  * self.bs = bs # <<<<<<<<<<<<<<
3502  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix,
3503  * self.bs)
3504  */
3505  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bs, __pyx_v_bs) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
3506 
3507  /* "csmoothers.pyx":47
3508  * self.L = L
3509  * self.bs = bs
3510  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix, # <<<<<<<<<<<<<<
3511  * self.bs)
3512  *
3513  */
3514  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
3515  __Pyx_GOTREF(__pyx_t_1);
3516  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
3517  __Pyx_GOTREF(__pyx_t_2);
3518  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3519 
3520  /* "csmoothers.pyx":48
3521  * self.bs = bs
3522  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix,
3523  * self.bs) # <<<<<<<<<<<<<<
3524  *
3525  * cdef class cBASMFactor(object):
3526  */
3527  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
3528  __Pyx_GOTREF(__pyx_t_1);
3529 
3530  /* "csmoothers.pyx":47
3531  * self.L = L
3532  * self.bs = bs
3533  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix, # <<<<<<<<<<<<<<
3534  * self.bs)
3535  *
3536  */
3537  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L1_error)
3538  __Pyx_GOTREF(__pyx_t_3);
3539  __Pyx_GIVEREF(__pyx_t_2);
3540  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
3541  __Pyx_GIVEREF(__pyx_t_1);
3542  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
3543  __pyx_t_2 = 0;
3544  __pyx_t_1 = 0;
3545  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10csmoothers_cBASMFactor), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
3546  __Pyx_GOTREF(__pyx_t_1);
3547  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3548  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cBASMFactor, __pyx_t_1) < 0) __PYX_ERR(0, 47, __pyx_L1_error)
3549  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3550 
3551  /* "csmoothers.pyx":44
3552  * class BASMFactor(object):
3553  *
3554  * def __init__(self, L, bs): # <<<<<<<<<<<<<<
3555  * self.L = L
3556  * self.bs = bs
3557  */
3558 
3559  /* function exit code */
3560  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3561  goto __pyx_L0;
3562  __pyx_L1_error:;
3563  __Pyx_XDECREF(__pyx_t_1);
3564  __Pyx_XDECREF(__pyx_t_2);
3565  __Pyx_XDECREF(__pyx_t_3);
3566  __Pyx_AddTraceback("csmoothers.BASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3567  __pyx_r = NULL;
3568  __pyx_L0:;
3569  __Pyx_XGIVEREF(__pyx_r);
3570  __Pyx_RefNannyFinishContext();
3571  return __pyx_r;
3572 }
3573 
3574 /* "csmoothers.pyx":52
3575  * cdef class cBASMFactor(object):
3576  *
3577  * def __cinit__(self, # <<<<<<<<<<<<<<
3578  * superluWrappers.cSparseMatrix L,
3579  * int bs):
3580  */
3581 
3582 /* Python wrapper */
3583 static int __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3584 static int __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3585  struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L = 0;
3586  int __pyx_v_bs;
3587  int __pyx_lineno = 0;
3588  const char *__pyx_filename = NULL;
3589  int __pyx_clineno = 0;
3590  int __pyx_r;
3591  __Pyx_RefNannyDeclarations
3592  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
3593  {
3594  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_L,&__pyx_n_s_bs,0};
3595  PyObject* values[2] = {0,0};
3596  if (unlikely(__pyx_kwds)) {
3597  Py_ssize_t kw_args;
3598  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3599  switch (pos_args) {
3600  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3601  CYTHON_FALLTHROUGH;
3602  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3603  CYTHON_FALLTHROUGH;
3604  case 0: break;
3605  default: goto __pyx_L5_argtuple_error;
3606  }
3607  kw_args = PyDict_Size(__pyx_kwds);
3608  switch (pos_args) {
3609  case 0:
3610  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
3611  else goto __pyx_L5_argtuple_error;
3612  CYTHON_FALLTHROUGH;
3613  case 1:
3614  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--;
3615  else {
3616  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(0, 52, __pyx_L3_error)
3617  }
3618  }
3619  if (unlikely(kw_args > 0)) {
3620  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 52, __pyx_L3_error)
3621  }
3622  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
3623  goto __pyx_L5_argtuple_error;
3624  } else {
3625  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3626  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3627  }
3628  __pyx_v_L = ((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)values[0]);
3629  __pyx_v_bs = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_bs == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error)
3630  }
3631  goto __pyx_L4_argument_unpacking_done;
3632  __pyx_L5_argtuple_error:;
3633  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 52, __pyx_L3_error)
3634  __pyx_L3_error:;
3635  __Pyx_AddTraceback("csmoothers.cBASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3636  __Pyx_RefNannyFinishContext();
3637  return -1;
3638  __pyx_L4_argument_unpacking_done:;
3639  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix, 1, "L", 0))) __PYX_ERR(0, 53, __pyx_L1_error)
3640  __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor___cinit__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self), __pyx_v_L, __pyx_v_bs);
3641 
3642  /* function exit code */
3643  goto __pyx_L0;
3644  __pyx_L1_error:;
3645  __pyx_r = -1;
3646  __pyx_L0:;
3647  __Pyx_RefNannyFinishContext();
3648  return __pyx_r;
3649 }
3650 
3651 static int __pyx_pf_10csmoothers_11cBASMFactor___cinit__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L, int __pyx_v_bs) {
3652  int __pyx_v_rval;
3653  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
3654  int __pyx_r;
3655  __Pyx_RefNannyDeclarations
3656  PyObject *__pyx_t_1 = NULL;
3657  int __pyx_t_2;
3658  int __pyx_lineno = 0;
3659  const char *__pyx_filename = NULL;
3660  int __pyx_clineno = 0;
3661  __Pyx_RefNannySetupContext("__cinit__", 0);
3662 
3663  /* "csmoothers.pyx":55
3664  * superluWrappers.cSparseMatrix L,
3665  * int bs):
3666  * cdef int rval = 0 # <<<<<<<<<<<<<<
3667  * cdef SuperMatrix AS
3668  * AS.Stype = superluWrappers._SLU_NR
3669  */
3670  __pyx_v_rval = 0;
3671 
3672  /* "csmoothers.pyx":57
3673  * cdef int rval = 0
3674  * cdef SuperMatrix AS
3675  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
3676  * AS.Dtype = superluWrappers._SLU_D
3677  * AS.Mtype = superluWrappers._SLU_GE
3678  */
3679  __pyx_v_AS.Stype = SLU_NR;
3680 
3681  /* "csmoothers.pyx":58
3682  * cdef SuperMatrix AS
3683  * AS.Stype = superluWrappers._SLU_NR
3684  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
3685  * AS.Mtype = superluWrappers._SLU_GE
3686  * AS.nrow = L.nr
3687  */
3688  __pyx_v_AS.Dtype = SLU_D;
3689 
3690  /* "csmoothers.pyx":59
3691  * AS.Stype = superluWrappers._SLU_NR
3692  * AS.Dtype = superluWrappers._SLU_D
3693  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
3694  * AS.nrow = L.nr
3695  * AS.ncol = L.nc
3696  */
3697  __pyx_v_AS.Mtype = SLU_GE;
3698 
3699  /* "csmoothers.pyx":60
3700  * AS.Dtype = superluWrappers._SLU_D
3701  * AS.Mtype = superluWrappers._SLU_GE
3702  * AS.nrow = L.nr # <<<<<<<<<<<<<<
3703  * AS.ncol = L.nc
3704  * AS.Store = &L.A
3705  */
3706  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
3707  __Pyx_GOTREF(__pyx_t_1);
3708  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L1_error)
3709  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3710  __pyx_v_AS.nrow = __pyx_t_2;
3711 
3712  /* "csmoothers.pyx":61
3713  * AS.Mtype = superluWrappers._SLU_GE
3714  * AS.nrow = L.nr
3715  * AS.ncol = L.nc # <<<<<<<<<<<<<<
3716  * AS.Store = &L.A
3717  * rval = cbasm_NR_init(bs,
3718  */
3719  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
3720  __Pyx_GOTREF(__pyx_t_1);
3721  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error)
3722  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3723  __pyx_v_AS.ncol = __pyx_t_2;
3724 
3725  /* "csmoothers.pyx":62
3726  * AS.nrow = L.nr
3727  * AS.ncol = L.nc
3728  * AS.Store = &L.A # <<<<<<<<<<<<<<
3729  * rval = cbasm_NR_init(bs,
3730  * &AS,
3731  */
3732  __pyx_v_AS.Store = (&__pyx_v_L->A);
3733 
3734  /* "csmoothers.pyx":63
3735  * AS.ncol = L.nc
3736  * AS.Store = &L.A
3737  * rval = cbasm_NR_init(bs, # <<<<<<<<<<<<<<
3738  * &AS,
3739  * &self.subdomain_dim,
3740  */
3741  __pyx_v_rval = basm_NR_init(__pyx_v_bs, (&__pyx_v_AS), (&__pyx_v_self->subdomain_dim), (&__pyx_v_self->l2g_L), (&__pyx_v_self->subdomain_L), (&__pyx_v_self->subdomain_R), (&__pyx_v_self->subdomain_dX), (&__pyx_v_self->subdomain_pivots), (&__pyx_v_self->subdomain_col_pivots));
3742 
3743  /* "csmoothers.pyx":72
3744  * &self.subdomain_pivots,
3745  * &self.subdomain_col_pivots)
3746  * assert rval == 0 # <<<<<<<<<<<<<<
3747  *
3748  * def __dealloc__(self):
3749  */
3750  #ifndef CYTHON_WITHOUT_ASSERTIONS
3751  if (unlikely(!Py_OptimizeFlag)) {
3752  if (unlikely(!((__pyx_v_rval == 0) != 0))) {
3753  PyErr_SetNone(PyExc_AssertionError);
3754  __PYX_ERR(0, 72, __pyx_L1_error)
3755  }
3756  }
3757  #endif
3758 
3759  /* "csmoothers.pyx":52
3760  * cdef class cBASMFactor(object):
3761  *
3762  * def __cinit__(self, # <<<<<<<<<<<<<<
3763  * superluWrappers.cSparseMatrix L,
3764  * int bs):
3765  */
3766 
3767  /* function exit code */
3768  __pyx_r = 0;
3769  goto __pyx_L0;
3770  __pyx_L1_error:;
3771  __Pyx_XDECREF(__pyx_t_1);
3772  __Pyx_AddTraceback("csmoothers.cBASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3773  __pyx_r = -1;
3774  __pyx_L0:;
3775  __Pyx_RefNannyFinishContext();
3776  return __pyx_r;
3777 }
3778 
3779 /* "csmoothers.pyx":74
3780  * assert rval == 0
3781  *
3782  * def __dealloc__(self): # <<<<<<<<<<<<<<
3783  * cbasm_NR_free(self.N,
3784  * self.subdomain_dim,
3785  */
3786 
3787 /* Python wrapper */
3788 static void __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
3789 static void __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(PyObject *__pyx_v_self) {
3790  __Pyx_RefNannyDeclarations
3791  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
3792  __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self));
3793 
3794  /* function exit code */
3795  __Pyx_RefNannyFinishContext();
3796 }
3797 
3798 static void __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self) {
3799  __Pyx_RefNannyDeclarations
3800  __Pyx_RefNannySetupContext("__dealloc__", 0);
3801 
3802  /* "csmoothers.pyx":75
3803  *
3804  * def __dealloc__(self):
3805  * cbasm_NR_free(self.N, # <<<<<<<<<<<<<<
3806  * self.subdomain_dim,
3807  * self.l2g_L,
3808  */
3809  basm_NR_free(__pyx_v_self->N, __pyx_v_self->subdomain_dim, __pyx_v_self->l2g_L, __pyx_v_self->subdomain_L, __pyx_v_self->subdomain_R, __pyx_v_self->subdomain_dX, __pyx_v_self->subdomain_pivots, __pyx_v_self->subdomain_col_pivots);
3810 
3811  /* "csmoothers.pyx":74
3812  * assert rval == 0
3813  *
3814  * def __dealloc__(self): # <<<<<<<<<<<<<<
3815  * cbasm_NR_free(self.N,
3816  * self.subdomain_dim,
3817  */
3818 
3819  /* function exit code */
3820  __Pyx_RefNannyFinishContext();
3821 }
3822 
3823 /* "(tree fragment)":1
3824  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3825  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3826  * def __setstate_cython__(self, __pyx_state):
3827  */
3828 
3829 /* Python wrapper */
3830 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3831 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3832  PyObject *__pyx_r = 0;
3833  __Pyx_RefNannyDeclarations
3834  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3835  __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self));
3836 
3837  /* function exit code */
3838  __Pyx_RefNannyFinishContext();
3839  return __pyx_r;
3840 }
3841 
3842 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self) {
3843  PyObject *__pyx_r = NULL;
3844  __Pyx_RefNannyDeclarations
3845  PyObject *__pyx_t_1 = NULL;
3846  int __pyx_lineno = 0;
3847  const char *__pyx_filename = NULL;
3848  int __pyx_clineno = 0;
3849  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
3850 
3851  /* "(tree fragment)":2
3852  * def __reduce_cython__(self):
3853  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3854  * def __setstate_cython__(self, __pyx_state):
3855  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3856  */
3857  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
3858  __Pyx_GOTREF(__pyx_t_1);
3859  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3860  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3861  __PYX_ERR(1, 2, __pyx_L1_error)
3862 
3863  /* "(tree fragment)":1
3864  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3865  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3866  * def __setstate_cython__(self, __pyx_state):
3867  */
3868 
3869  /* function exit code */
3870  __pyx_L1_error:;
3871  __Pyx_XDECREF(__pyx_t_1);
3872  __Pyx_AddTraceback("csmoothers.cBASMFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3873  __pyx_r = NULL;
3874  __Pyx_XGIVEREF(__pyx_r);
3875  __Pyx_RefNannyFinishContext();
3876  return __pyx_r;
3877 }
3878 
3879 /* "(tree fragment)":3
3880  * def __reduce_cython__(self):
3881  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3882  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3883  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3884  */
3885 
3886 /* Python wrapper */
3887 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
3888 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3889  PyObject *__pyx_r = 0;
3890  __Pyx_RefNannyDeclarations
3891  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3892  __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3893 
3894  /* function exit code */
3895  __Pyx_RefNannyFinishContext();
3896  return __pyx_r;
3897 }
3898 
3899 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3900  PyObject *__pyx_r = NULL;
3901  __Pyx_RefNannyDeclarations
3902  PyObject *__pyx_t_1 = NULL;
3903  int __pyx_lineno = 0;
3904  const char *__pyx_filename = NULL;
3905  int __pyx_clineno = 0;
3906  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3907 
3908  /* "(tree fragment)":4
3909  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3910  * def __setstate_cython__(self, __pyx_state):
3911  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3912  */
3913  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
3914  __Pyx_GOTREF(__pyx_t_1);
3915  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3916  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3917  __PYX_ERR(1, 4, __pyx_L1_error)
3918 
3919  /* "(tree fragment)":3
3920  * def __reduce_cython__(self):
3921  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3922  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3923  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3924  */
3925 
3926  /* function exit code */
3927  __pyx_L1_error:;
3928  __Pyx_XDECREF(__pyx_t_1);
3929  __Pyx_AddTraceback("csmoothers.cBASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3930  __pyx_r = NULL;
3931  __Pyx_XGIVEREF(__pyx_r);
3932  __Pyx_RefNannyFinishContext();
3933  return __pyx_r;
3934 }
3935 
3936 /* "csmoothers.pyx":84
3937  * self.subdomain_col_pivots)
3938  *
3939  * def jacobi_NR_prepare(A, w, tol, M): # <<<<<<<<<<<<<<
3940  * """
3941  *
3942  */
3943 
3944 /* Python wrapper */
3945 static PyObject *__pyx_pw_10csmoothers_1jacobi_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3946 static char __pyx_doc_10csmoothers_jacobi_NR_prepare[] = "\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n w : double\n tol : double\n M : np.array\n ";
3947 static PyMethodDef __pyx_mdef_10csmoothers_1jacobi_NR_prepare = {"jacobi_NR_prepare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_1jacobi_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_jacobi_NR_prepare};
3948 static PyObject *__pyx_pw_10csmoothers_1jacobi_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3949  PyObject *__pyx_v_A = 0;
3950  PyObject *__pyx_v_w = 0;
3951  PyObject *__pyx_v_tol = 0;
3952  PyObject *__pyx_v_M = 0;
3953  int __pyx_lineno = 0;
3954  const char *__pyx_filename = NULL;
3955  int __pyx_clineno = 0;
3956  PyObject *__pyx_r = 0;
3957  __Pyx_RefNannyDeclarations
3958  __Pyx_RefNannySetupContext("jacobi_NR_prepare (wrapper)", 0);
3959  {
3960  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_M,0};
3961  PyObject* values[4] = {0,0,0,0};
3962  if (unlikely(__pyx_kwds)) {
3963  Py_ssize_t kw_args;
3964  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3965  switch (pos_args) {
3966  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3967  CYTHON_FALLTHROUGH;
3968  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3969  CYTHON_FALLTHROUGH;
3970  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3971  CYTHON_FALLTHROUGH;
3972  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3973  CYTHON_FALLTHROUGH;
3974  case 0: break;
3975  default: goto __pyx_L5_argtuple_error;
3976  }
3977  kw_args = PyDict_Size(__pyx_kwds);
3978  switch (pos_args) {
3979  case 0:
3980  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
3981  else goto __pyx_L5_argtuple_error;
3982  CYTHON_FALLTHROUGH;
3983  case 1:
3984  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
3985  else {
3986  __Pyx_RaiseArgtupleInvalid("jacobi_NR_prepare", 1, 4, 4, 1); __PYX_ERR(0, 84, __pyx_L3_error)
3987  }
3988  CYTHON_FALLTHROUGH;
3989  case 2:
3990  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
3991  else {
3992  __Pyx_RaiseArgtupleInvalid("jacobi_NR_prepare", 1, 4, 4, 2); __PYX_ERR(0, 84, __pyx_L3_error)
3993  }
3994  CYTHON_FALLTHROUGH;
3995  case 3:
3996  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
3997  else {
3998  __Pyx_RaiseArgtupleInvalid("jacobi_NR_prepare", 1, 4, 4, 3); __PYX_ERR(0, 84, __pyx_L3_error)
3999  }
4000  }
4001  if (unlikely(kw_args > 0)) {
4002  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "jacobi_NR_prepare") < 0)) __PYX_ERR(0, 84, __pyx_L3_error)
4003  }
4004  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
4005  goto __pyx_L5_argtuple_error;
4006  } else {
4007  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4008  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4009  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4010  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4011  }
4012  __pyx_v_A = values[0];
4013  __pyx_v_w = values[1];
4014  __pyx_v_tol = values[2];
4015  __pyx_v_M = values[3];
4016  }
4017  goto __pyx_L4_argument_unpacking_done;
4018  __pyx_L5_argtuple_error:;
4019  __Pyx_RaiseArgtupleInvalid("jacobi_NR_prepare", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 84, __pyx_L3_error)
4020  __pyx_L3_error:;
4021  __Pyx_AddTraceback("csmoothers.jacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4022  __Pyx_RefNannyFinishContext();
4023  return NULL;
4024  __pyx_L4_argument_unpacking_done:;
4025  __pyx_r = __pyx_pf_10csmoothers_jacobi_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_tol, __pyx_v_M);
4026 
4027  /* function exit code */
4028  __Pyx_RefNannyFinishContext();
4029  return __pyx_r;
4030 }
4031 
4032 static PyObject *__pyx_pf_10csmoothers_jacobi_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M) {
4033  PyObject *__pyx_r = NULL;
4034  __Pyx_RefNannyDeclarations
4035  PyObject *__pyx_t_1 = NULL;
4036  double __pyx_t_2;
4037  double __pyx_t_3;
4038  __pyx_t_10csmoothers_DDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4039  int __pyx_lineno = 0;
4040  const char *__pyx_filename = NULL;
4041  int __pyx_clineno = 0;
4042  __Pyx_RefNannySetupContext("jacobi_NR_prepare", 0);
4043 
4044  /* "csmoothers.pyx":94
4045  * M : np.array
4046  * """
4047  * smootherWrappersjacobi_NR_prepare(A._cSparseMatrix, w, tol, M) # <<<<<<<<<<<<<<
4048  *
4049  * cdef void smootherWrappersjacobi_NR_prepare(superluWrappers.cSparseMatrix sm,
4050  */
4051  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
4052  __Pyx_GOTREF(__pyx_t_1);
4053  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 94, __pyx_L1_error)
4054  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error)
4055  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error)
4056  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 94, __pyx_L1_error)
4057  __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4);
4058  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4059  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4060  __pyx_t_4.memview = NULL;
4061  __pyx_t_4.data = NULL;
4062 
4063  /* "csmoothers.pyx":84
4064  * self.subdomain_col_pivots)
4065  *
4066  * def jacobi_NR_prepare(A, w, tol, M): # <<<<<<<<<<<<<<
4067  * """
4068  *
4069  */
4070 
4071  /* function exit code */
4072  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4073  goto __pyx_L0;
4074  __pyx_L1_error:;
4075  __Pyx_XDECREF(__pyx_t_1);
4076  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4077  __Pyx_AddTraceback("csmoothers.jacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4078  __pyx_r = NULL;
4079  __pyx_L0:;
4080  __Pyx_XGIVEREF(__pyx_r);
4081  __Pyx_RefNannyFinishContext();
4082  return __pyx_r;
4083 }
4084 
4085 /* "csmoothers.pyx":96
4086  * smootherWrappersjacobi_NR_prepare(A._cSparseMatrix, w, tol, M)
4087  *
4088  * cdef void smootherWrappersjacobi_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4089  * double w,
4090  * double tol,
4091  */
4092 
4093 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_M) {
4094  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4095  __Pyx_RefNannyDeclarations
4096  PyObject *__pyx_t_1 = NULL;
4097  int __pyx_t_2;
4098  Py_ssize_t __pyx_t_3;
4099  int __pyx_lineno = 0;
4100  const char *__pyx_filename = NULL;
4101  int __pyx_clineno = 0;
4102  __Pyx_RefNannySetupContext("smootherWrappersjacobi_NR_prepare", 0);
4103 
4104  /* "csmoothers.pyx":101
4105  * DDATA M):
4106  * cdef SuperMatrix AS
4107  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
4108  * AS.Dtype = superluWrappers._SLU_D
4109  * AS.Mtype = superluWrappers._SLU_GE
4110  */
4111  __pyx_v_AS.Stype = SLU_NR;
4112 
4113  /* "csmoothers.pyx":102
4114  * cdef SuperMatrix AS
4115  * AS.Stype = superluWrappers._SLU_NR
4116  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
4117  * AS.Mtype = superluWrappers._SLU_GE
4118  * AS.nrow = sm.nr
4119  */
4120  __pyx_v_AS.Dtype = SLU_D;
4121 
4122  /* "csmoothers.pyx":103
4123  * AS.Stype = superluWrappers._SLU_NR
4124  * AS.Dtype = superluWrappers._SLU_D
4125  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
4126  * AS.nrow = sm.nr
4127  * AS.ncol = sm.nc
4128  */
4129  __pyx_v_AS.Mtype = SLU_GE;
4130 
4131  /* "csmoothers.pyx":104
4132  * AS.Dtype = superluWrappers._SLU_D
4133  * AS.Mtype = superluWrappers._SLU_GE
4134  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
4135  * AS.ncol = sm.nc
4136  * AS.Store = &sm.A
4137  */
4138  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
4139  __Pyx_GOTREF(__pyx_t_1);
4140  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error)
4141  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4142  __pyx_v_AS.nrow = __pyx_t_2;
4143 
4144  /* "csmoothers.pyx":105
4145  * AS.Mtype = superluWrappers._SLU_GE
4146  * AS.nrow = sm.nr
4147  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
4148  * AS.Store = &sm.A
4149  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
4150  */
4151  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
4152  __Pyx_GOTREF(__pyx_t_1);
4153  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error)
4154  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4155  __pyx_v_AS.ncol = __pyx_t_2;
4156 
4157  /* "csmoothers.pyx":106
4158  * AS.nrow = sm.nr
4159  * AS.ncol = sm.nc
4160  * AS.Store = &sm.A # <<<<<<<<<<<<<<
4161  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
4162  *
4163  */
4164  __pyx_v_AS.Store = (&__pyx_v_sm->A);
4165 
4166  /* "csmoothers.pyx":107
4167  * AS.ncol = sm.nc
4168  * AS.Store = &sm.A
4169  * cjacobi_NR_prepare(&AS, w, tol, &M[0]) # <<<<<<<<<<<<<<
4170  *
4171  * def jacobi_NR_solve(A, M, R, node_order, dX):
4172  */
4173  __pyx_t_3 = 0;
4174  __pyx_t_2 = -1;
4175  if (__pyx_t_3 < 0) {
4176  __pyx_t_3 += __pyx_v_M.shape[0];
4177  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4178  } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
4179  if (unlikely(__pyx_t_2 != -1)) {
4180  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4181  __PYX_ERR(0, 107, __pyx_L1_error)
4182  }
4183  jacobi_NR_prepare((&__pyx_v_AS), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))));
4184 
4185  /* "csmoothers.pyx":96
4186  * smootherWrappersjacobi_NR_prepare(A._cSparseMatrix, w, tol, M)
4187  *
4188  * cdef void smootherWrappersjacobi_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4189  * double w,
4190  * double tol,
4191  */
4192 
4193  /* function exit code */
4194  goto __pyx_L0;
4195  __pyx_L1_error:;
4196  __Pyx_XDECREF(__pyx_t_1);
4197  __Pyx_WriteUnraisable("csmoothers.smootherWrappersjacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4198  __pyx_L0:;
4199  __Pyx_RefNannyFinishContext();
4200 }
4201 
4202 /* "csmoothers.pyx":109
4203  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
4204  *
4205  * def jacobi_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
4206  * """
4207  *
4208  */
4209 
4210 /* Python wrapper */
4211 static PyObject *__pyx_pw_10csmoothers_3jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4212 static char __pyx_doc_10csmoothers_2jacobi_NR_solve[] = "\n \n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n M : np.array double\n R : np.array double\n node_order : np.array int\n dX : np.array double\n ";
4213 static PyMethodDef __pyx_mdef_10csmoothers_3jacobi_NR_solve = {"jacobi_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_3jacobi_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_2jacobi_NR_solve};
4214 static PyObject *__pyx_pw_10csmoothers_3jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4215  PyObject *__pyx_v_A = 0;
4216  PyObject *__pyx_v_M = 0;
4217  PyObject *__pyx_v_R = 0;
4218  PyObject *__pyx_v_node_order = 0;
4219  PyObject *__pyx_v_dX = 0;
4220  int __pyx_lineno = 0;
4221  const char *__pyx_filename = NULL;
4222  int __pyx_clineno = 0;
4223  PyObject *__pyx_r = 0;
4224  __Pyx_RefNannyDeclarations
4225  __Pyx_RefNannySetupContext("jacobi_NR_solve (wrapper)", 0);
4226  {
4227  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_M,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_dX,0};
4228  PyObject* values[5] = {0,0,0,0,0};
4229  if (unlikely(__pyx_kwds)) {
4230  Py_ssize_t kw_args;
4231  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4232  switch (pos_args) {
4233  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4234  CYTHON_FALLTHROUGH;
4235  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4236  CYTHON_FALLTHROUGH;
4237  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4238  CYTHON_FALLTHROUGH;
4239  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4240  CYTHON_FALLTHROUGH;
4241  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4242  CYTHON_FALLTHROUGH;
4243  case 0: break;
4244  default: goto __pyx_L5_argtuple_error;
4245  }
4246  kw_args = PyDict_Size(__pyx_kwds);
4247  switch (pos_args) {
4248  case 0:
4249  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4250  else goto __pyx_L5_argtuple_error;
4251  CYTHON_FALLTHROUGH;
4252  case 1:
4253  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
4254  else {
4255  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, 1); __PYX_ERR(0, 109, __pyx_L3_error)
4256  }
4257  CYTHON_FALLTHROUGH;
4258  case 2:
4259  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
4260  else {
4261  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, 2); __PYX_ERR(0, 109, __pyx_L3_error)
4262  }
4263  CYTHON_FALLTHROUGH;
4264  case 3:
4265  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
4266  else {
4267  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, 3); __PYX_ERR(0, 109, __pyx_L3_error)
4268  }
4269  CYTHON_FALLTHROUGH;
4270  case 4:
4271  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
4272  else {
4273  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, 4); __PYX_ERR(0, 109, __pyx_L3_error)
4274  }
4275  }
4276  if (unlikely(kw_args > 0)) {
4277  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "jacobi_NR_solve") < 0)) __PYX_ERR(0, 109, __pyx_L3_error)
4278  }
4279  } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4280  goto __pyx_L5_argtuple_error;
4281  } else {
4282  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4283  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4284  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4285  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4286  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4287  }
4288  __pyx_v_A = values[0];
4289  __pyx_v_M = values[1];
4290  __pyx_v_R = values[2];
4291  __pyx_v_node_order = values[3];
4292  __pyx_v_dX = values[4];
4293  }
4294  goto __pyx_L4_argument_unpacking_done;
4295  __pyx_L5_argtuple_error:;
4296  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 109, __pyx_L3_error)
4297  __pyx_L3_error:;
4298  __Pyx_AddTraceback("csmoothers.jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4299  __Pyx_RefNannyFinishContext();
4300  return NULL;
4301  __pyx_L4_argument_unpacking_done:;
4302  __pyx_r = __pyx_pf_10csmoothers_2jacobi_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_M, __pyx_v_R, __pyx_v_node_order, __pyx_v_dX);
4303 
4304  /* function exit code */
4305  __Pyx_RefNannyFinishContext();
4306  return __pyx_r;
4307 }
4308 
4309 static PyObject *__pyx_pf_10csmoothers_2jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX) {
4310  PyObject *__pyx_r = NULL;
4311  __Pyx_RefNannyDeclarations
4312  PyObject *__pyx_t_1 = NULL;
4313  __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
4314  __pyx_t_10csmoothers_DDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
4315  __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4316  __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4317  int __pyx_lineno = 0;
4318  const char *__pyx_filename = NULL;
4319  int __pyx_clineno = 0;
4320  __Pyx_RefNannySetupContext("jacobi_NR_solve", 0);
4321 
4322  /* "csmoothers.pyx":120
4323  * dX : np.array double
4324  * """
4325  * smootherWrappersjacobi_NR_solve(A._cSparseMatrix, M, R, node_order, dX) # <<<<<<<<<<<<<<
4326  *
4327  * cdef void smootherWrappersjacobi_NR_solve(superluWrappers.cSparseMatrix sm,
4328  */
4329  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
4330  __Pyx_GOTREF(__pyx_t_1);
4331  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 120, __pyx_L1_error)
4332  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4333  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4334  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4335  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4336  __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5);
4337  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4338  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4339  __pyx_t_2.memview = NULL;
4340  __pyx_t_2.data = NULL;
4341  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4342  __pyx_t_3.memview = NULL;
4343  __pyx_t_3.data = NULL;
4344  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4345  __pyx_t_4.memview = NULL;
4346  __pyx_t_4.data = NULL;
4347  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4348  __pyx_t_5.memview = NULL;
4349  __pyx_t_5.data = NULL;
4350 
4351  /* "csmoothers.pyx":109
4352  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
4353  *
4354  * def jacobi_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
4355  * """
4356  *
4357  */
4358 
4359  /* function exit code */
4360  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4361  goto __pyx_L0;
4362  __pyx_L1_error:;
4363  __Pyx_XDECREF(__pyx_t_1);
4364  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4365  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4366  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4367  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4368  __Pyx_AddTraceback("csmoothers.jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4369  __pyx_r = NULL;
4370  __pyx_L0:;
4371  __Pyx_XGIVEREF(__pyx_r);
4372  __Pyx_RefNannyFinishContext();
4373  return __pyx_r;
4374 }
4375 
4376 /* "csmoothers.pyx":122
4377  * smootherWrappersjacobi_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
4378  *
4379  * cdef void smootherWrappersjacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4380  * DDATA M,
4381  * DDATA R,
4382  */
4383 
4384 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_M, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
4385  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4386  __Pyx_RefNannyDeclarations
4387  PyObject *__pyx_t_1 = NULL;
4388  int __pyx_t_2;
4389  Py_ssize_t __pyx_t_3;
4390  Py_ssize_t __pyx_t_4;
4391  Py_ssize_t __pyx_t_5;
4392  Py_ssize_t __pyx_t_6;
4393  int __pyx_lineno = 0;
4394  const char *__pyx_filename = NULL;
4395  int __pyx_clineno = 0;
4396  __Pyx_RefNannySetupContext("smootherWrappersjacobi_NR_solve", 0);
4397 
4398  /* "csmoothers.pyx":128
4399  * DDATA dX):
4400  * cdef SuperMatrix AS
4401  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
4402  * AS.Dtype = superluWrappers._SLU_D
4403  * AS.Mtype = superluWrappers._SLU_GE
4404  */
4405  __pyx_v_AS.Stype = SLU_NR;
4406 
4407  /* "csmoothers.pyx":129
4408  * cdef SuperMatrix AS
4409  * AS.Stype = superluWrappers._SLU_NR
4410  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
4411  * AS.Mtype = superluWrappers._SLU_GE
4412  * AS.nrow = sm.nr
4413  */
4414  __pyx_v_AS.Dtype = SLU_D;
4415 
4416  /* "csmoothers.pyx":130
4417  * AS.Stype = superluWrappers._SLU_NR
4418  * AS.Dtype = superluWrappers._SLU_D
4419  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
4420  * AS.nrow = sm.nr
4421  * AS.ncol = sm.nc
4422  */
4423  __pyx_v_AS.Mtype = SLU_GE;
4424 
4425  /* "csmoothers.pyx":131
4426  * AS.Dtype = superluWrappers._SLU_D
4427  * AS.Mtype = superluWrappers._SLU_GE
4428  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
4429  * AS.ncol = sm.nc
4430  * AS.Store = &sm.A
4431  */
4432  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
4433  __Pyx_GOTREF(__pyx_t_1);
4434  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L1_error)
4435  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4436  __pyx_v_AS.nrow = __pyx_t_2;
4437 
4438  /* "csmoothers.pyx":132
4439  * AS.Mtype = superluWrappers._SLU_GE
4440  * AS.nrow = sm.nr
4441  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
4442  * AS.Store = &sm.A
4443  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
4444  */
4445  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
4446  __Pyx_GOTREF(__pyx_t_1);
4447  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
4448  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4449  __pyx_v_AS.ncol = __pyx_t_2;
4450 
4451  /* "csmoothers.pyx":133
4452  * AS.nrow = sm.nr
4453  * AS.ncol = sm.nc
4454  * AS.Store = &sm.A # <<<<<<<<<<<<<<
4455  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
4456  *
4457  */
4458  __pyx_v_AS.Store = (&__pyx_v_sm->A);
4459 
4460  /* "csmoothers.pyx":134
4461  * AS.ncol = sm.nc
4462  * AS.Store = &sm.A
4463  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0]) # <<<<<<<<<<<<<<
4464  *
4465  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX):
4466  */
4467  __pyx_t_3 = 0;
4468  __pyx_t_2 = -1;
4469  if (__pyx_t_3 < 0) {
4470  __pyx_t_3 += __pyx_v_M.shape[0];
4471  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4472  } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
4473  if (unlikely(__pyx_t_2 != -1)) {
4474  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4475  __PYX_ERR(0, 134, __pyx_L1_error)
4476  }
4477  __pyx_t_4 = 0;
4478  __pyx_t_2 = -1;
4479  if (__pyx_t_4 < 0) {
4480  __pyx_t_4 += __pyx_v_R.shape[0];
4481  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
4482  } else if (unlikely(__pyx_t_4 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
4483  if (unlikely(__pyx_t_2 != -1)) {
4484  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4485  __PYX_ERR(0, 134, __pyx_L1_error)
4486  }
4487  __pyx_t_5 = 0;
4488  __pyx_t_2 = -1;
4489  if (__pyx_t_5 < 0) {
4490  __pyx_t_5 += __pyx_v_node_order.shape[0];
4491  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
4492  } else if (unlikely(__pyx_t_5 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
4493  if (unlikely(__pyx_t_2 != -1)) {
4494  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4495  __PYX_ERR(0, 134, __pyx_L1_error)
4496  }
4497  __pyx_t_6 = 0;
4498  __pyx_t_2 = -1;
4499  if (__pyx_t_6 < 0) {
4500  __pyx_t_6 += __pyx_v_dX.shape[0];
4501  if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
4502  } else if (unlikely(__pyx_t_6 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
4503  if (unlikely(__pyx_t_2 != -1)) {
4504  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4505  __PYX_ERR(0, 134, __pyx_L1_error)
4506  }
4507  jacobi_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_4 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_5 * __pyx_v_node_order.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_6 * __pyx_v_dX.strides[0]) )))));
4508 
4509  /* "csmoothers.pyx":122
4510  * smootherWrappersjacobi_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
4511  *
4512  * cdef void smootherWrappersjacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4513  * DDATA M,
4514  * DDATA R,
4515  */
4516 
4517  /* function exit code */
4518  goto __pyx_L0;
4519  __pyx_L1_error:;
4520  __Pyx_XDECREF(__pyx_t_1);
4521  __Pyx_WriteUnraisable("csmoothers.smootherWrappersjacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4522  __pyx_L0:;
4523  __Pyx_RefNannyFinishContext();
4524 }
4525 
4526 /* "csmoothers.pyx":136
4527  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
4528  *
4529  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
4530  * """
4531  *
4532  */
4533 
4534 /* Python wrapper */
4535 static PyObject *__pyx_pw_10csmoothers_5nl_jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4536 static char __pyx_doc_10csmoothers_4nl_jacobi_NR_solve[] = "\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n R : np.array double\n node_order : np.array int\n w : np.float\n tol : np.float\n dX : np.array double\n ";
4537 static PyMethodDef __pyx_mdef_10csmoothers_5nl_jacobi_NR_solve = {"nl_jacobi_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_5nl_jacobi_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_4nl_jacobi_NR_solve};
4538 static PyObject *__pyx_pw_10csmoothers_5nl_jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4539  PyObject *__pyx_v_A = 0;
4540  PyObject *__pyx_v_R = 0;
4541  PyObject *__pyx_v_node_order = 0;
4542  PyObject *__pyx_v_w = 0;
4543  PyObject *__pyx_v_tol = 0;
4544  PyObject *__pyx_v_dX = 0;
4545  int __pyx_lineno = 0;
4546  const char *__pyx_filename = NULL;
4547  int __pyx_clineno = 0;
4548  PyObject *__pyx_r = 0;
4549  __Pyx_RefNannyDeclarations
4550  __Pyx_RefNannySetupContext("nl_jacobi_NR_solve (wrapper)", 0);
4551  {
4552  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_dX,0};
4553  PyObject* values[6] = {0,0,0,0,0,0};
4554  if (unlikely(__pyx_kwds)) {
4555  Py_ssize_t kw_args;
4556  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4557  switch (pos_args) {
4558  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4559  CYTHON_FALLTHROUGH;
4560  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4561  CYTHON_FALLTHROUGH;
4562  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4563  CYTHON_FALLTHROUGH;
4564  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4565  CYTHON_FALLTHROUGH;
4566  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4567  CYTHON_FALLTHROUGH;
4568  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4569  CYTHON_FALLTHROUGH;
4570  case 0: break;
4571  default: goto __pyx_L5_argtuple_error;
4572  }
4573  kw_args = PyDict_Size(__pyx_kwds);
4574  switch (pos_args) {
4575  case 0:
4576  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4577  else goto __pyx_L5_argtuple_error;
4578  CYTHON_FALLTHROUGH;
4579  case 1:
4580  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
4581  else {
4582  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 136, __pyx_L3_error)
4583  }
4584  CYTHON_FALLTHROUGH;
4585  case 2:
4586  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
4587  else {
4588  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 136, __pyx_L3_error)
4589  }
4590  CYTHON_FALLTHROUGH;
4591  case 3:
4592  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
4593  else {
4594  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 136, __pyx_L3_error)
4595  }
4596  CYTHON_FALLTHROUGH;
4597  case 4:
4598  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
4599  else {
4600  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 136, __pyx_L3_error)
4601  }
4602  CYTHON_FALLTHROUGH;
4603  case 5:
4604  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
4605  else {
4606  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 136, __pyx_L3_error)
4607  }
4608  }
4609  if (unlikely(kw_args > 0)) {
4610  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nl_jacobi_NR_solve") < 0)) __PYX_ERR(0, 136, __pyx_L3_error)
4611  }
4612  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4613  goto __pyx_L5_argtuple_error;
4614  } else {
4615  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4616  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4617  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4618  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4619  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4620  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4621  }
4622  __pyx_v_A = values[0];
4623  __pyx_v_R = values[1];
4624  __pyx_v_node_order = values[2];
4625  __pyx_v_w = values[3];
4626  __pyx_v_tol = values[4];
4627  __pyx_v_dX = values[5];
4628  }
4629  goto __pyx_L4_argument_unpacking_done;
4630  __pyx_L5_argtuple_error:;
4631  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 136, __pyx_L3_error)
4632  __pyx_L3_error:;
4633  __Pyx_AddTraceback("csmoothers.nl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4634  __Pyx_RefNannyFinishContext();
4635  return NULL;
4636  __pyx_L4_argument_unpacking_done:;
4637  __pyx_r = __pyx_pf_10csmoothers_4nl_jacobi_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_R, __pyx_v_node_order, __pyx_v_w, __pyx_v_tol, __pyx_v_dX);
4638 
4639  /* function exit code */
4640  __Pyx_RefNannyFinishContext();
4641  return __pyx_r;
4642 }
4643 
4644 static PyObject *__pyx_pf_10csmoothers_4nl_jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX) {
4645  PyObject *__pyx_r = NULL;
4646  __Pyx_RefNannyDeclarations
4647  PyObject *__pyx_t_1 = NULL;
4648  __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
4649  __pyx_t_10csmoothers_IDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
4650  double __pyx_t_4;
4651  double __pyx_t_5;
4652  __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
4653  int __pyx_lineno = 0;
4654  const char *__pyx_filename = NULL;
4655  int __pyx_clineno = 0;
4656  __Pyx_RefNannySetupContext("nl_jacobi_NR_solve", 0);
4657 
4658  /* "csmoothers.pyx":148
4659  * dX : np.array double
4660  * """
4661  * smootherWrappersnl_jacobi_NR_solve(A._cSparseMatrix, R, node_order, w, tol, dX) # <<<<<<<<<<<<<<
4662  *
4663  * cdef void smootherWrappersnl_jacobi_NR_solve(superluWrappers.cSparseMatrix sm,
4664  */
4665  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
4666  __Pyx_GOTREF(__pyx_t_1);
4667  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 148, __pyx_L1_error)
4668  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4669  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4670  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
4671  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
4672  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4673  __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6);
4674  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4675  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4676  __pyx_t_2.memview = NULL;
4677  __pyx_t_2.data = NULL;
4678  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4679  __pyx_t_3.memview = NULL;
4680  __pyx_t_3.data = NULL;
4681  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4682  __pyx_t_6.memview = NULL;
4683  __pyx_t_6.data = NULL;
4684 
4685  /* "csmoothers.pyx":136
4686  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
4687  *
4688  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
4689  * """
4690  *
4691  */
4692 
4693  /* function exit code */
4694  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4695  goto __pyx_L0;
4696  __pyx_L1_error:;
4697  __Pyx_XDECREF(__pyx_t_1);
4698  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4699  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4700  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4701  __Pyx_AddTraceback("csmoothers.nl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4702  __pyx_r = NULL;
4703  __pyx_L0:;
4704  __Pyx_XGIVEREF(__pyx_r);
4705  __Pyx_RefNannyFinishContext();
4706  return __pyx_r;
4707 }
4708 
4709 /* "csmoothers.pyx":150
4710  * smootherWrappersnl_jacobi_NR_solve(A._cSparseMatrix, R, node_order, w, tol, dX)
4711  *
4712  * cdef void smootherWrappersnl_jacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4713  * DDATA R,
4714  * IDATA node_order,
4715  */
4716 
4717 static void __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
4718  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4719  __Pyx_RefNannyDeclarations
4720  PyObject *__pyx_t_1 = NULL;
4721  int __pyx_t_2;
4722  Py_ssize_t __pyx_t_3;
4723  Py_ssize_t __pyx_t_4;
4724  Py_ssize_t __pyx_t_5;
4725  int __pyx_lineno = 0;
4726  const char *__pyx_filename = NULL;
4727  int __pyx_clineno = 0;
4728  __Pyx_RefNannySetupContext("smootherWrappersnl_jacobi_NR_solve", 0);
4729 
4730  /* "csmoothers.pyx":157
4731  * DDATA dX):
4732  * cdef SuperMatrix AS
4733  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
4734  * AS.Dtype = superluWrappers._SLU_D
4735  * AS.Mtype = superluWrappers._SLU_GE
4736  */
4737  __pyx_v_AS.Stype = SLU_NR;
4738 
4739  /* "csmoothers.pyx":158
4740  * cdef SuperMatrix AS
4741  * AS.Stype = superluWrappers._SLU_NR
4742  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
4743  * AS.Mtype = superluWrappers._SLU_GE
4744  * AS.nrow = sm.nr
4745  */
4746  __pyx_v_AS.Dtype = SLU_D;
4747 
4748  /* "csmoothers.pyx":159
4749  * AS.Stype = superluWrappers._SLU_NR
4750  * AS.Dtype = superluWrappers._SLU_D
4751  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
4752  * AS.nrow = sm.nr
4753  * AS.ncol = sm.nc
4754  */
4755  __pyx_v_AS.Mtype = SLU_GE;
4756 
4757  /* "csmoothers.pyx":160
4758  * AS.Dtype = superluWrappers._SLU_D
4759  * AS.Mtype = superluWrappers._SLU_GE
4760  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
4761  * AS.ncol = sm.nc
4762  * AS.Store = &sm.A
4763  */
4764  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
4765  __Pyx_GOTREF(__pyx_t_1);
4766  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error)
4767  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4768  __pyx_v_AS.nrow = __pyx_t_2;
4769 
4770  /* "csmoothers.pyx":161
4771  * AS.Mtype = superluWrappers._SLU_GE
4772  * AS.nrow = sm.nr
4773  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
4774  * AS.Store = &sm.A
4775  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
4776  */
4777  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
4778  __Pyx_GOTREF(__pyx_t_1);
4779  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
4780  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4781  __pyx_v_AS.ncol = __pyx_t_2;
4782 
4783  /* "csmoothers.pyx":162
4784  * AS.nrow = sm.nr
4785  * AS.ncol = sm.nc
4786  * AS.Store = &sm.A # <<<<<<<<<<<<<<
4787  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
4788  *
4789  */
4790  __pyx_v_AS.Store = (&__pyx_v_sm->A);
4791 
4792  /* "csmoothers.pyx":163
4793  * AS.ncol = sm.nc
4794  * AS.Store = &sm.A
4795  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0]) # <<<<<<<<<<<<<<
4796  *
4797  * def gauss_seidel_NR_preare(A, w, tol, M):
4798  */
4799  __pyx_t_3 = 0;
4800  __pyx_t_2 = -1;
4801  if (__pyx_t_3 < 0) {
4802  __pyx_t_3 += __pyx_v_R.shape[0];
4803  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4804  } else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
4805  if (unlikely(__pyx_t_2 != -1)) {
4806  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4807  __PYX_ERR(0, 163, __pyx_L1_error)
4808  }
4809  __pyx_t_4 = 0;
4810  __pyx_t_2 = -1;
4811  if (__pyx_t_4 < 0) {
4812  __pyx_t_4 += __pyx_v_node_order.shape[0];
4813  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
4814  } else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
4815  if (unlikely(__pyx_t_2 != -1)) {
4816  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4817  __PYX_ERR(0, 163, __pyx_L1_error)
4818  }
4819  __pyx_t_5 = 0;
4820  __pyx_t_2 = -1;
4821  if (__pyx_t_5 < 0) {
4822  __pyx_t_5 += __pyx_v_dX.shape[0];
4823  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
4824  } else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
4825  if (unlikely(__pyx_t_2 != -1)) {
4826  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4827  __PYX_ERR(0, 163, __pyx_L1_error)
4828  }
4829  nl_jacobi_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))));
4830 
4831  /* "csmoothers.pyx":150
4832  * smootherWrappersnl_jacobi_NR_solve(A._cSparseMatrix, R, node_order, w, tol, dX)
4833  *
4834  * cdef void smootherWrappersnl_jacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4835  * DDATA R,
4836  * IDATA node_order,
4837  */
4838 
4839  /* function exit code */
4840  goto __pyx_L0;
4841  __pyx_L1_error:;
4842  __Pyx_XDECREF(__pyx_t_1);
4843  __Pyx_WriteUnraisable("csmoothers.smootherWrappersnl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4844  __pyx_L0:;
4845  __Pyx_RefNannyFinishContext();
4846 }
4847 
4848 /* "csmoothers.pyx":165
4849  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
4850  *
4851  * def gauss_seidel_NR_preare(A, w, tol, M): # <<<<<<<<<<<<<<
4852  * """
4853  *
4854  */
4855 
4856 /* Python wrapper */
4857 static PyObject *__pyx_pw_10csmoothers_7gauss_seidel_NR_preare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4858 static char __pyx_doc_10csmoothers_6gauss_seidel_NR_preare[] = "\n\n Arguments\n ---------\n A :\n w :\n tol :\n M :\n ";
4859 static PyMethodDef __pyx_mdef_10csmoothers_7gauss_seidel_NR_preare = {"gauss_seidel_NR_preare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_7gauss_seidel_NR_preare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_6gauss_seidel_NR_preare};
4860 static PyObject *__pyx_pw_10csmoothers_7gauss_seidel_NR_preare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4861  PyObject *__pyx_v_A = 0;
4862  PyObject *__pyx_v_w = 0;
4863  PyObject *__pyx_v_tol = 0;
4864  PyObject *__pyx_v_M = 0;
4865  int __pyx_lineno = 0;
4866  const char *__pyx_filename = NULL;
4867  int __pyx_clineno = 0;
4868  PyObject *__pyx_r = 0;
4869  __Pyx_RefNannyDeclarations
4870  __Pyx_RefNannySetupContext("gauss_seidel_NR_preare (wrapper)", 0);
4871  {
4872  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_M,0};
4873  PyObject* values[4] = {0,0,0,0};
4874  if (unlikely(__pyx_kwds)) {
4875  Py_ssize_t kw_args;
4876  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4877  switch (pos_args) {
4878  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4879  CYTHON_FALLTHROUGH;
4880  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4881  CYTHON_FALLTHROUGH;
4882  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4883  CYTHON_FALLTHROUGH;
4884  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4885  CYTHON_FALLTHROUGH;
4886  case 0: break;
4887  default: goto __pyx_L5_argtuple_error;
4888  }
4889  kw_args = PyDict_Size(__pyx_kwds);
4890  switch (pos_args) {
4891  case 0:
4892  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4893  else goto __pyx_L5_argtuple_error;
4894  CYTHON_FALLTHROUGH;
4895  case 1:
4896  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
4897  else {
4898  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_preare", 1, 4, 4, 1); __PYX_ERR(0, 165, __pyx_L3_error)
4899  }
4900  CYTHON_FALLTHROUGH;
4901  case 2:
4902  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
4903  else {
4904  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_preare", 1, 4, 4, 2); __PYX_ERR(0, 165, __pyx_L3_error)
4905  }
4906  CYTHON_FALLTHROUGH;
4907  case 3:
4908  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
4909  else {
4910  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_preare", 1, 4, 4, 3); __PYX_ERR(0, 165, __pyx_L3_error)
4911  }
4912  }
4913  if (unlikely(kw_args > 0)) {
4914  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gauss_seidel_NR_preare") < 0)) __PYX_ERR(0, 165, __pyx_L3_error)
4915  }
4916  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
4917  goto __pyx_L5_argtuple_error;
4918  } else {
4919  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4920  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4921  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4922  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4923  }
4924  __pyx_v_A = values[0];
4925  __pyx_v_w = values[1];
4926  __pyx_v_tol = values[2];
4927  __pyx_v_M = values[3];
4928  }
4929  goto __pyx_L4_argument_unpacking_done;
4930  __pyx_L5_argtuple_error:;
4931  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_preare", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 165, __pyx_L3_error)
4932  __pyx_L3_error:;
4933  __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_preare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4934  __Pyx_RefNannyFinishContext();
4935  return NULL;
4936  __pyx_L4_argument_unpacking_done:;
4937  __pyx_r = __pyx_pf_10csmoothers_6gauss_seidel_NR_preare(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_tol, __pyx_v_M);
4938 
4939  /* function exit code */
4940  __Pyx_RefNannyFinishContext();
4941  return __pyx_r;
4942 }
4943 
4944 static PyObject *__pyx_pf_10csmoothers_6gauss_seidel_NR_preare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M) {
4945  PyObject *__pyx_r = NULL;
4946  __Pyx_RefNannyDeclarations
4947  PyObject *__pyx_t_1 = NULL;
4948  double __pyx_t_2;
4949  double __pyx_t_3;
4950  __pyx_t_10csmoothers_DDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4951  int __pyx_lineno = 0;
4952  const char *__pyx_filename = NULL;
4953  int __pyx_clineno = 0;
4954  __Pyx_RefNannySetupContext("gauss_seidel_NR_preare", 0);
4955 
4956  /* "csmoothers.pyx":175
4957  * M :
4958  * """
4959  * smootherWrappersgauss_seidel_NR_prepare(A._cSparseMatrix, w, tol, M) # <<<<<<<<<<<<<<
4960  *
4961  * cdef void smootherWrappersgauss_seidel_NR_prepare(superluWrappers.cSparseMatrix sm,
4962  */
4963  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
4964  __Pyx_GOTREF(__pyx_t_1);
4965  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 175, __pyx_L1_error)
4966  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
4967  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
4968  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 175, __pyx_L1_error)
4969  __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4);
4970  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4971  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4972  __pyx_t_4.memview = NULL;
4973  __pyx_t_4.data = NULL;
4974 
4975  /* "csmoothers.pyx":165
4976  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
4977  *
4978  * def gauss_seidel_NR_preare(A, w, tol, M): # <<<<<<<<<<<<<<
4979  * """
4980  *
4981  */
4982 
4983  /* function exit code */
4984  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4985  goto __pyx_L0;
4986  __pyx_L1_error:;
4987  __Pyx_XDECREF(__pyx_t_1);
4988  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4989  __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_preare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4990  __pyx_r = NULL;
4991  __pyx_L0:;
4992  __Pyx_XGIVEREF(__pyx_r);
4993  __Pyx_RefNannyFinishContext();
4994  return __pyx_r;
4995 }
4996 
4997 /* "csmoothers.pyx":177
4998  * smootherWrappersgauss_seidel_NR_prepare(A._cSparseMatrix, w, tol, M)
4999  *
5000  * cdef void smootherWrappersgauss_seidel_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5001  * double w,
5002  * double tol,
5003  */
5004 
5005 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_M) {
5006  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5007  __Pyx_RefNannyDeclarations
5008  PyObject *__pyx_t_1 = NULL;
5009  int __pyx_t_2;
5010  Py_ssize_t __pyx_t_3;
5011  int __pyx_lineno = 0;
5012  const char *__pyx_filename = NULL;
5013  int __pyx_clineno = 0;
5014  __Pyx_RefNannySetupContext("smootherWrappersgauss_seidel_NR_prepare", 0);
5015 
5016  /* "csmoothers.pyx":182
5017  * DDATA M):
5018  * cdef SuperMatrix AS
5019  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
5020  * AS.Dtype = superluWrappers._SLU_D
5021  * AS.Mtype = superluWrappers._SLU_GE
5022  */
5023  __pyx_v_AS.Stype = SLU_NR;
5024 
5025  /* "csmoothers.pyx":183
5026  * cdef SuperMatrix AS
5027  * AS.Stype = superluWrappers._SLU_NR
5028  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
5029  * AS.Mtype = superluWrappers._SLU_GE
5030  * AS.nrow = sm.nr
5031  */
5032  __pyx_v_AS.Dtype = SLU_D;
5033 
5034  /* "csmoothers.pyx":184
5035  * AS.Stype = superluWrappers._SLU_NR
5036  * AS.Dtype = superluWrappers._SLU_D
5037  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
5038  * AS.nrow = sm.nr
5039  * AS.ncol = sm.nc
5040  */
5041  __pyx_v_AS.Mtype = SLU_GE;
5042 
5043  /* "csmoothers.pyx":185
5044  * AS.Dtype = superluWrappers._SLU_D
5045  * AS.Mtype = superluWrappers._SLU_GE
5046  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
5047  * AS.ncol = sm.nc
5048  * AS.Store = &sm.A
5049  */
5050  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error)
5051  __Pyx_GOTREF(__pyx_t_1);
5052  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
5053  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5054  __pyx_v_AS.nrow = __pyx_t_2;
5055 
5056  /* "csmoothers.pyx":186
5057  * AS.Mtype = superluWrappers._SLU_GE
5058  * AS.nrow = sm.nr
5059  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
5060  * AS.Store = &sm.A
5061  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
5062  */
5063  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error)
5064  __Pyx_GOTREF(__pyx_t_1);
5065  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error)
5066  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5067  __pyx_v_AS.ncol = __pyx_t_2;
5068 
5069  /* "csmoothers.pyx":187
5070  * AS.nrow = sm.nr
5071  * AS.ncol = sm.nc
5072  * AS.Store = &sm.A # <<<<<<<<<<<<<<
5073  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
5074  *
5075  */
5076  __pyx_v_AS.Store = (&__pyx_v_sm->A);
5077 
5078  /* "csmoothers.pyx":188
5079  * AS.ncol = sm.nc
5080  * AS.Store = &sm.A
5081  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0]) # <<<<<<<<<<<<<<
5082  *
5083  * def gauss_seidel_NR_solve(A, M, R, node_order, dX):
5084  */
5085  __pyx_t_3 = 0;
5086  __pyx_t_2 = -1;
5087  if (__pyx_t_3 < 0) {
5088  __pyx_t_3 += __pyx_v_M.shape[0];
5089  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
5090  } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
5091  if (unlikely(__pyx_t_2 != -1)) {
5092  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5093  __PYX_ERR(0, 188, __pyx_L1_error)
5094  }
5095  gauss_seidel_NR_prepare((&__pyx_v_AS), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))));
5096 
5097  /* "csmoothers.pyx":177
5098  * smootherWrappersgauss_seidel_NR_prepare(A._cSparseMatrix, w, tol, M)
5099  *
5100  * cdef void smootherWrappersgauss_seidel_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5101  * double w,
5102  * double tol,
5103  */
5104 
5105  /* function exit code */
5106  goto __pyx_L0;
5107  __pyx_L1_error:;
5108  __Pyx_XDECREF(__pyx_t_1);
5109  __Pyx_WriteUnraisable("csmoothers.smootherWrappersgauss_seidel_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5110  __pyx_L0:;
5111  __Pyx_RefNannyFinishContext();
5112 }
5113 
5114 /* "csmoothers.pyx":190
5115  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
5116  *
5117  * def gauss_seidel_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
5118  * """
5119  *
5120  */
5121 
5122 /* Python wrapper */
5123 static PyObject *__pyx_pw_10csmoothers_9gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5124 static char __pyx_doc_10csmoothers_8gauss_seidel_NR_solve[] = "\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n M : np.array double\n R : np.array double\n node_order : np.array int\n dX : np.array double\n ";
5125 static PyMethodDef __pyx_mdef_10csmoothers_9gauss_seidel_NR_solve = {"gauss_seidel_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_9gauss_seidel_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_8gauss_seidel_NR_solve};
5126 static PyObject *__pyx_pw_10csmoothers_9gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5127  PyObject *__pyx_v_A = 0;
5128  PyObject *__pyx_v_M = 0;
5129  PyObject *__pyx_v_R = 0;
5130  PyObject *__pyx_v_node_order = 0;
5131  PyObject *__pyx_v_dX = 0;
5132  int __pyx_lineno = 0;
5133  const char *__pyx_filename = NULL;
5134  int __pyx_clineno = 0;
5135  PyObject *__pyx_r = 0;
5136  __Pyx_RefNannyDeclarations
5137  __Pyx_RefNannySetupContext("gauss_seidel_NR_solve (wrapper)", 0);
5138  {
5139  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_M,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_dX,0};
5140  PyObject* values[5] = {0,0,0,0,0};
5141  if (unlikely(__pyx_kwds)) {
5142  Py_ssize_t kw_args;
5143  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5144  switch (pos_args) {
5145  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5146  CYTHON_FALLTHROUGH;
5147  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5148  CYTHON_FALLTHROUGH;
5149  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5150  CYTHON_FALLTHROUGH;
5151  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5152  CYTHON_FALLTHROUGH;
5153  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5154  CYTHON_FALLTHROUGH;
5155  case 0: break;
5156  default: goto __pyx_L5_argtuple_error;
5157  }
5158  kw_args = PyDict_Size(__pyx_kwds);
5159  switch (pos_args) {
5160  case 0:
5161  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5162  else goto __pyx_L5_argtuple_error;
5163  CYTHON_FALLTHROUGH;
5164  case 1:
5165  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
5166  else {
5167  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, 1); __PYX_ERR(0, 190, __pyx_L3_error)
5168  }
5169  CYTHON_FALLTHROUGH;
5170  case 2:
5171  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
5172  else {
5173  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, 2); __PYX_ERR(0, 190, __pyx_L3_error)
5174  }
5175  CYTHON_FALLTHROUGH;
5176  case 3:
5177  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
5178  else {
5179  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, 3); __PYX_ERR(0, 190, __pyx_L3_error)
5180  }
5181  CYTHON_FALLTHROUGH;
5182  case 4:
5183  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
5184  else {
5185  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, 4); __PYX_ERR(0, 190, __pyx_L3_error)
5186  }
5187  }
5188  if (unlikely(kw_args > 0)) {
5189  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gauss_seidel_NR_solve") < 0)) __PYX_ERR(0, 190, __pyx_L3_error)
5190  }
5191  } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
5192  goto __pyx_L5_argtuple_error;
5193  } else {
5194  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5195  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5196  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5197  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5198  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5199  }
5200  __pyx_v_A = values[0];
5201  __pyx_v_M = values[1];
5202  __pyx_v_R = values[2];
5203  __pyx_v_node_order = values[3];
5204  __pyx_v_dX = values[4];
5205  }
5206  goto __pyx_L4_argument_unpacking_done;
5207  __pyx_L5_argtuple_error:;
5208  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 190, __pyx_L3_error)
5209  __pyx_L3_error:;
5210  __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5211  __Pyx_RefNannyFinishContext();
5212  return NULL;
5213  __pyx_L4_argument_unpacking_done:;
5214  __pyx_r = __pyx_pf_10csmoothers_8gauss_seidel_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_M, __pyx_v_R, __pyx_v_node_order, __pyx_v_dX);
5215 
5216  /* function exit code */
5217  __Pyx_RefNannyFinishContext();
5218  return __pyx_r;
5219 }
5220 
5221 static PyObject *__pyx_pf_10csmoothers_8gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX) {
5222  PyObject *__pyx_r = NULL;
5223  __Pyx_RefNannyDeclarations
5224  PyObject *__pyx_t_1 = NULL;
5225  __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
5226  __pyx_t_10csmoothers_DDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
5227  __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
5228  __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
5229  int __pyx_lineno = 0;
5230  const char *__pyx_filename = NULL;
5231  int __pyx_clineno = 0;
5232  __Pyx_RefNannySetupContext("gauss_seidel_NR_solve", 0);
5233 
5234  /* "csmoothers.pyx":201
5235  * dX : np.array double
5236  * """
5237  * smootherWrappersgauss_seidel_NR_solve(A._cSparseMatrix, M, R, node_order, dX) # <<<<<<<<<<<<<<
5238  *
5239  * cdef void smootherWrappersgauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm,
5240  */
5241  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
5242  __Pyx_GOTREF(__pyx_t_1);
5243  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 201, __pyx_L1_error)
5244  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5245  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5246  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5247  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5248  __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5);
5249  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5250  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5251  __pyx_t_2.memview = NULL;
5252  __pyx_t_2.data = NULL;
5253  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5254  __pyx_t_3.memview = NULL;
5255  __pyx_t_3.data = NULL;
5256  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
5257  __pyx_t_4.memview = NULL;
5258  __pyx_t_4.data = NULL;
5259  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
5260  __pyx_t_5.memview = NULL;
5261  __pyx_t_5.data = NULL;
5262 
5263  /* "csmoothers.pyx":190
5264  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
5265  *
5266  * def gauss_seidel_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
5267  * """
5268  *
5269  */
5270 
5271  /* function exit code */
5272  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5273  goto __pyx_L0;
5274  __pyx_L1_error:;
5275  __Pyx_XDECREF(__pyx_t_1);
5276  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5277  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5278  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
5279  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
5280  __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5281  __pyx_r = NULL;
5282  __pyx_L0:;
5283  __Pyx_XGIVEREF(__pyx_r);
5284  __Pyx_RefNannyFinishContext();
5285  return __pyx_r;
5286 }
5287 
5288 /* "csmoothers.pyx":203
5289  * smootherWrappersgauss_seidel_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
5290  *
5291  * cdef void smootherWrappersgauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5292  * DDATA M,
5293  * DDATA R,
5294  */
5295 
5296 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_M, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
5297  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5298  __Pyx_RefNannyDeclarations
5299  PyObject *__pyx_t_1 = NULL;
5300  int __pyx_t_2;
5301  Py_ssize_t __pyx_t_3;
5302  Py_ssize_t __pyx_t_4;
5303  Py_ssize_t __pyx_t_5;
5304  Py_ssize_t __pyx_t_6;
5305  int __pyx_lineno = 0;
5306  const char *__pyx_filename = NULL;
5307  int __pyx_clineno = 0;
5308  __Pyx_RefNannySetupContext("smootherWrappersgauss_seidel_NR_solve", 0);
5309 
5310  /* "csmoothers.pyx":209
5311  * DDATA dX):
5312  * cdef SuperMatrix AS
5313  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
5314  * AS.Dtype = superluWrappers._SLU_D
5315  * AS.Mtype = superluWrappers._SLU_GE
5316  */
5317  __pyx_v_AS.Stype = SLU_NR;
5318 
5319  /* "csmoothers.pyx":210
5320  * cdef SuperMatrix AS
5321  * AS.Stype = superluWrappers._SLU_NR
5322  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
5323  * AS.Mtype = superluWrappers._SLU_GE
5324  * AS.nrow = sm.nr
5325  */
5326  __pyx_v_AS.Dtype = SLU_D;
5327 
5328  /* "csmoothers.pyx":211
5329  * AS.Stype = superluWrappers._SLU_NR
5330  * AS.Dtype = superluWrappers._SLU_D
5331  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
5332  * AS.nrow = sm.nr
5333  * AS.ncol = sm.nc
5334  */
5335  __pyx_v_AS.Mtype = SLU_GE;
5336 
5337  /* "csmoothers.pyx":212
5338  * AS.Dtype = superluWrappers._SLU_D
5339  * AS.Mtype = superluWrappers._SLU_GE
5340  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
5341  * AS.ncol = sm.nc
5342  * AS.Store = &sm.A
5343  */
5344  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error)
5345  __Pyx_GOTREF(__pyx_t_1);
5346  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L1_error)
5347  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5348  __pyx_v_AS.nrow = __pyx_t_2;
5349 
5350  /* "csmoothers.pyx":213
5351  * AS.Mtype = superluWrappers._SLU_GE
5352  * AS.nrow = sm.nr
5353  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
5354  * AS.Store = &sm.A
5355  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
5356  */
5357  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
5358  __Pyx_GOTREF(__pyx_t_1);
5359  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 213, __pyx_L1_error)
5360  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5361  __pyx_v_AS.ncol = __pyx_t_2;
5362 
5363  /* "csmoothers.pyx":214
5364  * AS.nrow = sm.nr
5365  * AS.ncol = sm.nc
5366  * AS.Store = &sm.A # <<<<<<<<<<<<<<
5367  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
5368  *
5369  */
5370  __pyx_v_AS.Store = (&__pyx_v_sm->A);
5371 
5372  /* "csmoothers.pyx":215
5373  * AS.ncol = sm.nc
5374  * AS.Store = &sm.A
5375  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0]) # <<<<<<<<<<<<<<
5376  *
5377  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX):
5378  */
5379  __pyx_t_3 = 0;
5380  __pyx_t_2 = -1;
5381  if (__pyx_t_3 < 0) {
5382  __pyx_t_3 += __pyx_v_M.shape[0];
5383  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
5384  } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
5385  if (unlikely(__pyx_t_2 != -1)) {
5386  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5387  __PYX_ERR(0, 215, __pyx_L1_error)
5388  }
5389  __pyx_t_4 = 0;
5390  __pyx_t_2 = -1;
5391  if (__pyx_t_4 < 0) {
5392  __pyx_t_4 += __pyx_v_R.shape[0];
5393  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
5394  } else if (unlikely(__pyx_t_4 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
5395  if (unlikely(__pyx_t_2 != -1)) {
5396  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5397  __PYX_ERR(0, 215, __pyx_L1_error)
5398  }
5399  __pyx_t_5 = 0;
5400  __pyx_t_2 = -1;
5401  if (__pyx_t_5 < 0) {
5402  __pyx_t_5 += __pyx_v_node_order.shape[0];
5403  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
5404  } else if (unlikely(__pyx_t_5 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
5405  if (unlikely(__pyx_t_2 != -1)) {
5406  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5407  __PYX_ERR(0, 215, __pyx_L1_error)
5408  }
5409  __pyx_t_6 = 0;
5410  __pyx_t_2 = -1;
5411  if (__pyx_t_6 < 0) {
5412  __pyx_t_6 += __pyx_v_dX.shape[0];
5413  if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
5414  } else if (unlikely(__pyx_t_6 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
5415  if (unlikely(__pyx_t_2 != -1)) {
5416  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5417  __PYX_ERR(0, 215, __pyx_L1_error)
5418  }
5419  gauss_seidel_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_4 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_5 * __pyx_v_node_order.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_6 * __pyx_v_dX.strides[0]) )))));
5420 
5421  /* "csmoothers.pyx":203
5422  * smootherWrappersgauss_seidel_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
5423  *
5424  * cdef void smootherWrappersgauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5425  * DDATA M,
5426  * DDATA R,
5427  */
5428 
5429  /* function exit code */
5430  goto __pyx_L0;
5431  __pyx_L1_error:;
5432  __Pyx_XDECREF(__pyx_t_1);
5433  __Pyx_WriteUnraisable("csmoothers.smootherWrappersgauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5434  __pyx_L0:;
5435  __Pyx_RefNannyFinishContext();
5436 }
5437 
5438 /* "csmoothers.pyx":217
5439  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
5440  *
5441  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
5442  * """
5443  *
5444  */
5445 
5446 /* Python wrapper */
5447 static PyObject *__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5448 static char __pyx_doc_10csmoothers_10nl_gauss_seidel_NR_solve[] = "\n \n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n R : np.array double\n node_order : np.array int\n w : double\n tol : double\n dX : np.array double\n ";
5449 static PyMethodDef __pyx_mdef_10csmoothers_11nl_gauss_seidel_NR_solve = {"nl_gauss_seidel_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_10nl_gauss_seidel_NR_solve};
5450 static PyObject *__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5451  PyObject *__pyx_v_A = 0;
5452  PyObject *__pyx_v_R = 0;
5453  PyObject *__pyx_v_node_order = 0;
5454  PyObject *__pyx_v_w = 0;
5455  PyObject *__pyx_v_tol = 0;
5456  PyObject *__pyx_v_dX = 0;
5457  int __pyx_lineno = 0;
5458  const char *__pyx_filename = NULL;
5459  int __pyx_clineno = 0;
5460  PyObject *__pyx_r = 0;
5461  __Pyx_RefNannyDeclarations
5462  __Pyx_RefNannySetupContext("nl_gauss_seidel_NR_solve (wrapper)", 0);
5463  {
5464  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_dX,0};
5465  PyObject* values[6] = {0,0,0,0,0,0};
5466  if (unlikely(__pyx_kwds)) {
5467  Py_ssize_t kw_args;
5468  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5469  switch (pos_args) {
5470  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5471  CYTHON_FALLTHROUGH;
5472  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5473  CYTHON_FALLTHROUGH;
5474  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5475  CYTHON_FALLTHROUGH;
5476  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5477  CYTHON_FALLTHROUGH;
5478  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5479  CYTHON_FALLTHROUGH;
5480  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5481  CYTHON_FALLTHROUGH;
5482  case 0: break;
5483  default: goto __pyx_L5_argtuple_error;
5484  }
5485  kw_args = PyDict_Size(__pyx_kwds);
5486  switch (pos_args) {
5487  case 0:
5488  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5489  else goto __pyx_L5_argtuple_error;
5490  CYTHON_FALLTHROUGH;
5491  case 1:
5492  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
5493  else {
5494  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 217, __pyx_L3_error)
5495  }
5496  CYTHON_FALLTHROUGH;
5497  case 2:
5498  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
5499  else {
5500  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 217, __pyx_L3_error)
5501  }
5502  CYTHON_FALLTHROUGH;
5503  case 3:
5504  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
5505  else {
5506  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 217, __pyx_L3_error)
5507  }
5508  CYTHON_FALLTHROUGH;
5509  case 4:
5510  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
5511  else {
5512  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 217, __pyx_L3_error)
5513  }
5514  CYTHON_FALLTHROUGH;
5515  case 5:
5516  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
5517  else {
5518  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 217, __pyx_L3_error)
5519  }
5520  }
5521  if (unlikely(kw_args > 0)) {
5522  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nl_gauss_seidel_NR_solve") < 0)) __PYX_ERR(0, 217, __pyx_L3_error)
5523  }
5524  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
5525  goto __pyx_L5_argtuple_error;
5526  } else {
5527  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5528  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5529  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5530  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5531  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5532  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5533  }
5534  __pyx_v_A = values[0];
5535  __pyx_v_R = values[1];
5536  __pyx_v_node_order = values[2];
5537  __pyx_v_w = values[3];
5538  __pyx_v_tol = values[4];
5539  __pyx_v_dX = values[5];
5540  }
5541  goto __pyx_L4_argument_unpacking_done;
5542  __pyx_L5_argtuple_error:;
5543  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 217, __pyx_L3_error)
5544  __pyx_L3_error:;
5545  __Pyx_AddTraceback("csmoothers.nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5546  __Pyx_RefNannyFinishContext();
5547  return NULL;
5548  __pyx_L4_argument_unpacking_done:;
5549  __pyx_r = __pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_R, __pyx_v_node_order, __pyx_v_w, __pyx_v_tol, __pyx_v_dX);
5550 
5551  /* function exit code */
5552  __Pyx_RefNannyFinishContext();
5553  return __pyx_r;
5554 }
5555 
5556 static PyObject *__pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX) {
5557  PyObject *__pyx_r = NULL;
5558  __Pyx_RefNannyDeclarations
5559  PyObject *__pyx_t_1 = NULL;
5560  __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
5561  __pyx_t_10csmoothers_IDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
5562  double __pyx_t_4;
5563  double __pyx_t_5;
5564  __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5565  PyObject *__pyx_t_7 = NULL;
5566  int __pyx_lineno = 0;
5567  const char *__pyx_filename = NULL;
5568  int __pyx_clineno = 0;
5569  __Pyx_RefNannySetupContext("nl_gauss_seidel_NR_solve", 0);
5570 
5571  /* "csmoothers.pyx":229
5572  * dX : np.array double
5573  * """
5574  * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
5575  * R,
5576  * node_order,
5577  */
5578  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
5579  __Pyx_GOTREF(__pyx_t_1);
5580  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 229, __pyx_L1_error)
5581 
5582  /* "csmoothers.pyx":230
5583  * """
5584  * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix,
5585  * R, # <<<<<<<<<<<<<<
5586  * node_order,
5587  * w,
5588  */
5589  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 230, __pyx_L1_error)
5590 
5591  /* "csmoothers.pyx":231
5592  * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix,
5593  * R,
5594  * node_order, # <<<<<<<<<<<<<<
5595  * w,
5596  * tol,
5597  */
5598  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 231, __pyx_L1_error)
5599 
5600  /* "csmoothers.pyx":232
5601  * R,
5602  * node_order,
5603  * w, # <<<<<<<<<<<<<<
5604  * tol,
5605  * dX)
5606  */
5607  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 232, __pyx_L1_error)
5608 
5609  /* "csmoothers.pyx":233
5610  * node_order,
5611  * w,
5612  * tol, # <<<<<<<<<<<<<<
5613  * dX)
5614  *
5615  */
5616  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L1_error)
5617 
5618  /* "csmoothers.pyx":234
5619  * w,
5620  * tol,
5621  * dX) # <<<<<<<<<<<<<<
5622  *
5623  * cdef smootherWrappers_nl_gauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm,
5624  */
5625  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 234, __pyx_L1_error)
5626 
5627  /* "csmoothers.pyx":229
5628  * dX : np.array double
5629  * """
5630  * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
5631  * R,
5632  * node_order,
5633  */
5634  __pyx_t_7 = __pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 229, __pyx_L1_error)
5635  __Pyx_GOTREF(__pyx_t_7);
5636  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5637  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5638  __pyx_t_2.memview = NULL;
5639  __pyx_t_2.data = NULL;
5640  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5641  __pyx_t_3.memview = NULL;
5642  __pyx_t_3.data = NULL;
5643  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5644  __pyx_t_6.memview = NULL;
5645  __pyx_t_6.data = NULL;
5646  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5647 
5648  /* "csmoothers.pyx":217
5649  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
5650  *
5651  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
5652  * """
5653  *
5654  */
5655 
5656  /* function exit code */
5657  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5658  goto __pyx_L0;
5659  __pyx_L1_error:;
5660  __Pyx_XDECREF(__pyx_t_1);
5661  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5662  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5663  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5664  __Pyx_XDECREF(__pyx_t_7);
5665  __Pyx_AddTraceback("csmoothers.nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5666  __pyx_r = NULL;
5667  __pyx_L0:;
5668  __Pyx_XGIVEREF(__pyx_r);
5669  __Pyx_RefNannyFinishContext();
5670  return __pyx_r;
5671 }
5672 
5673 /* "csmoothers.pyx":236
5674  * dX)
5675  *
5676  * cdef smootherWrappers_nl_gauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5677  * DDATA R,
5678  * IDATA node_order,
5679  */
5680 
5681 static PyObject *__pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
5682  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5683  PyObject *__pyx_r = NULL;
5684  __Pyx_RefNannyDeclarations
5685  PyObject *__pyx_t_1 = NULL;
5686  int __pyx_t_2;
5687  Py_ssize_t __pyx_t_3;
5688  Py_ssize_t __pyx_t_4;
5689  Py_ssize_t __pyx_t_5;
5690  int __pyx_lineno = 0;
5691  const char *__pyx_filename = NULL;
5692  int __pyx_clineno = 0;
5693  __Pyx_RefNannySetupContext("smootherWrappers_nl_gauss_seidel_NR_solve", 0);
5694 
5695  /* "csmoothers.pyx":243
5696  * DDATA dX):
5697  * cdef SuperMatrix AS
5698  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
5699  * AS.Dtype = superluWrappers._SLU_D
5700  * AS.Mtype = superluWrappers._SLU_GE
5701  */
5702  __pyx_v_AS.Stype = SLU_NR;
5703 
5704  /* "csmoothers.pyx":244
5705  * cdef SuperMatrix AS
5706  * AS.Stype = superluWrappers._SLU_NR
5707  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
5708  * AS.Mtype = superluWrappers._SLU_GE
5709  * AS.nrow = sm.nr
5710  */
5711  __pyx_v_AS.Dtype = SLU_D;
5712 
5713  /* "csmoothers.pyx":245
5714  * AS.Stype = superluWrappers._SLU_NR
5715  * AS.Dtype = superluWrappers._SLU_D
5716  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
5717  * AS.nrow = sm.nr
5718  * AS.ncol = sm.nc
5719  */
5720  __pyx_v_AS.Mtype = SLU_GE;
5721 
5722  /* "csmoothers.pyx":246
5723  * AS.Dtype = superluWrappers._SLU_D
5724  * AS.Mtype = superluWrappers._SLU_GE
5725  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
5726  * AS.ncol = sm.nc
5727  * AS.Store = &sm.A
5728  */
5729  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
5730  __Pyx_GOTREF(__pyx_t_1);
5731  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 246, __pyx_L1_error)
5732  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5733  __pyx_v_AS.nrow = __pyx_t_2;
5734 
5735  /* "csmoothers.pyx":247
5736  * AS.Mtype = superluWrappers._SLU_GE
5737  * AS.nrow = sm.nr
5738  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
5739  * AS.Store = &sm.A
5740  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
5741  */
5742  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
5743  __Pyx_GOTREF(__pyx_t_1);
5744  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 247, __pyx_L1_error)
5745  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5746  __pyx_v_AS.ncol = __pyx_t_2;
5747 
5748  /* "csmoothers.pyx":248
5749  * AS.nrow = sm.nr
5750  * AS.ncol = sm.nc
5751  * AS.Store = &sm.A # <<<<<<<<<<<<<<
5752  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
5753  *
5754  */
5755  __pyx_v_AS.Store = (&__pyx_v_sm->A);
5756 
5757  /* "csmoothers.pyx":249
5758  * AS.ncol = sm.nc
5759  * AS.Store = &sm.A
5760  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0]) # <<<<<<<<<<<<<<
5761  *
5762  * def asm_NR_prepare(A, asmFactor):
5763  */
5764  __pyx_t_3 = 0;
5765  __pyx_t_2 = -1;
5766  if (__pyx_t_3 < 0) {
5767  __pyx_t_3 += __pyx_v_R.shape[0];
5768  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
5769  } else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
5770  if (unlikely(__pyx_t_2 != -1)) {
5771  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5772  __PYX_ERR(0, 249, __pyx_L1_error)
5773  }
5774  __pyx_t_4 = 0;
5775  __pyx_t_2 = -1;
5776  if (__pyx_t_4 < 0) {
5777  __pyx_t_4 += __pyx_v_node_order.shape[0];
5778  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
5779  } else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
5780  if (unlikely(__pyx_t_2 != -1)) {
5781  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5782  __PYX_ERR(0, 249, __pyx_L1_error)
5783  }
5784  __pyx_t_5 = 0;
5785  __pyx_t_2 = -1;
5786  if (__pyx_t_5 < 0) {
5787  __pyx_t_5 += __pyx_v_dX.shape[0];
5788  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
5789  } else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
5790  if (unlikely(__pyx_t_2 != -1)) {
5791  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5792  __PYX_ERR(0, 249, __pyx_L1_error)
5793  }
5794  nl_gauss_seidel_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))));
5795 
5796  /* "csmoothers.pyx":236
5797  * dX)
5798  *
5799  * cdef smootherWrappers_nl_gauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5800  * DDATA R,
5801  * IDATA node_order,
5802  */
5803 
5804  /* function exit code */
5805  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5806  goto __pyx_L0;
5807  __pyx_L1_error:;
5808  __Pyx_XDECREF(__pyx_t_1);
5809  __Pyx_AddTraceback("csmoothers.smootherWrappers_nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5810  __pyx_r = 0;
5811  __pyx_L0:;
5812  __Pyx_XGIVEREF(__pyx_r);
5813  __Pyx_RefNannyFinishContext();
5814  return __pyx_r;
5815 }
5816 
5817 /* "csmoothers.pyx":251
5818  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
5819  *
5820  * def asm_NR_prepare(A, asmFactor): # <<<<<<<<<<<<<<
5821  * """
5822  *
5823  */
5824 
5825 /* Python wrapper */
5826 static PyObject *__pyx_pw_10csmoothers_13asm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5827 static char __pyx_doc_10csmoothers_12asm_NR_prepare[] = "\n\n Arguments\n ---------\n A :\n asmFactor :\n ";
5828 static PyMethodDef __pyx_mdef_10csmoothers_13asm_NR_prepare = {"asm_NR_prepare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_13asm_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_12asm_NR_prepare};
5829 static PyObject *__pyx_pw_10csmoothers_13asm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5830  PyObject *__pyx_v_A = 0;
5831  PyObject *__pyx_v_asmFactor = 0;
5832  int __pyx_lineno = 0;
5833  const char *__pyx_filename = NULL;
5834  int __pyx_clineno = 0;
5835  PyObject *__pyx_r = 0;
5836  __Pyx_RefNannyDeclarations
5837  __Pyx_RefNannySetupContext("asm_NR_prepare (wrapper)", 0);
5838  {
5839  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_asmFactor,0};
5840  PyObject* values[2] = {0,0};
5841  if (unlikely(__pyx_kwds)) {
5842  Py_ssize_t kw_args;
5843  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5844  switch (pos_args) {
5845  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5846  CYTHON_FALLTHROUGH;
5847  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5848  CYTHON_FALLTHROUGH;
5849  case 0: break;
5850  default: goto __pyx_L5_argtuple_error;
5851  }
5852  kw_args = PyDict_Size(__pyx_kwds);
5853  switch (pos_args) {
5854  case 0:
5855  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5856  else goto __pyx_L5_argtuple_error;
5857  CYTHON_FALLTHROUGH;
5858  case 1:
5859  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asmFactor)) != 0)) kw_args--;
5860  else {
5861  __Pyx_RaiseArgtupleInvalid("asm_NR_prepare", 1, 2, 2, 1); __PYX_ERR(0, 251, __pyx_L3_error)
5862  }
5863  }
5864  if (unlikely(kw_args > 0)) {
5865  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "asm_NR_prepare") < 0)) __PYX_ERR(0, 251, __pyx_L3_error)
5866  }
5867  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5868  goto __pyx_L5_argtuple_error;
5869  } else {
5870  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5871  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5872  }
5873  __pyx_v_A = values[0];
5874  __pyx_v_asmFactor = values[1];
5875  }
5876  goto __pyx_L4_argument_unpacking_done;
5877  __pyx_L5_argtuple_error:;
5878  __Pyx_RaiseArgtupleInvalid("asm_NR_prepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 251, __pyx_L3_error)
5879  __pyx_L3_error:;
5880  __Pyx_AddTraceback("csmoothers.asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5881  __Pyx_RefNannyFinishContext();
5882  return NULL;
5883  __pyx_L4_argument_unpacking_done:;
5884  __pyx_r = __pyx_pf_10csmoothers_12asm_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_asmFactor);
5885 
5886  /* function exit code */
5887  __Pyx_RefNannyFinishContext();
5888  return __pyx_r;
5889 }
5890 
5891 static PyObject *__pyx_pf_10csmoothers_12asm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_asmFactor) {
5892  PyObject *__pyx_r = NULL;
5893  __Pyx_RefNannyDeclarations
5894  PyObject *__pyx_t_1 = NULL;
5895  PyObject *__pyx_t_2 = NULL;
5896  int __pyx_lineno = 0;
5897  const char *__pyx_filename = NULL;
5898  int __pyx_clineno = 0;
5899  __Pyx_RefNannySetupContext("asm_NR_prepare", 0);
5900 
5901  /* "csmoothers.pyx":259
5902  * asmFactor :
5903  * """
5904  * smootherWrappers_asm_NR_prepare(A._cSparseMatrix, # <<<<<<<<<<<<<<
5905  * asmFactor._cASMFactor)
5906  *
5907  */
5908  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
5909  __Pyx_GOTREF(__pyx_t_1);
5910  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 259, __pyx_L1_error)
5911 
5912  /* "csmoothers.pyx":260
5913  * """
5914  * smootherWrappers_asm_NR_prepare(A._cSparseMatrix,
5915  * asmFactor._cASMFactor) # <<<<<<<<<<<<<<
5916  *
5917  * cdef void smootherWrappers_asm_NR_prepare(superluWrappers.cSparseMatrix sm,
5918  */
5919  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_asmFactor, __pyx_n_s_cASMFactor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
5920  __Pyx_GOTREF(__pyx_t_2);
5921  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10csmoothers_cASMFactor))))) __PYX_ERR(0, 260, __pyx_L1_error)
5922 
5923  /* "csmoothers.pyx":259
5924  * asmFactor :
5925  * """
5926  * smootherWrappers_asm_NR_prepare(A._cSparseMatrix, # <<<<<<<<<<<<<<
5927  * asmFactor._cASMFactor)
5928  *
5929  */
5930  __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_t_2));
5931  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5932  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5933 
5934  /* "csmoothers.pyx":251
5935  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
5936  *
5937  * def asm_NR_prepare(A, asmFactor): # <<<<<<<<<<<<<<
5938  * """
5939  *
5940  */
5941 
5942  /* function exit code */
5943  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5944  goto __pyx_L0;
5945  __pyx_L1_error:;
5946  __Pyx_XDECREF(__pyx_t_1);
5947  __Pyx_XDECREF(__pyx_t_2);
5948  __Pyx_AddTraceback("csmoothers.asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5949  __pyx_r = NULL;
5950  __pyx_L0:;
5951  __Pyx_XGIVEREF(__pyx_r);
5952  __Pyx_RefNannyFinishContext();
5953  return __pyx_r;
5954 }
5955 
5956 /* "csmoothers.pyx":262
5957  * asmFactor._cASMFactor)
5958  *
5959  * cdef void smootherWrappers_asm_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5960  * cASMFactor asmFactor):
5961  * cdef SuperMatrix AS
5962  */
5963 
5964 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_asmFactor) {
5965  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5966  __Pyx_RefNannyDeclarations
5967  PyObject *__pyx_t_1 = NULL;
5968  int __pyx_t_2;
5969  int __pyx_lineno = 0;
5970  const char *__pyx_filename = NULL;
5971  int __pyx_clineno = 0;
5972  __Pyx_RefNannySetupContext("smootherWrappers_asm_NR_prepare", 0);
5973 
5974  /* "csmoothers.pyx":265
5975  * cASMFactor asmFactor):
5976  * cdef SuperMatrix AS
5977  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
5978  * AS.Dtype = superluWrappers._SLU_D
5979  * AS.Mtype = superluWrappers._SLU_GE
5980  */
5981  __pyx_v_AS.Stype = SLU_NR;
5982 
5983  /* "csmoothers.pyx":266
5984  * cdef SuperMatrix AS
5985  * AS.Stype = superluWrappers._SLU_NR
5986  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
5987  * AS.Mtype = superluWrappers._SLU_GE
5988  * AS.nrow = sm.nr
5989  */
5990  __pyx_v_AS.Dtype = SLU_D;
5991 
5992  /* "csmoothers.pyx":267
5993  * AS.Stype = superluWrappers._SLU_NR
5994  * AS.Dtype = superluWrappers._SLU_D
5995  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
5996  * AS.nrow = sm.nr
5997  * AS.ncol = sm.nc
5998  */
5999  __pyx_v_AS.Mtype = SLU_GE;
6000 
6001  /* "csmoothers.pyx":268
6002  * AS.Dtype = superluWrappers._SLU_D
6003  * AS.Mtype = superluWrappers._SLU_GE
6004  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
6005  * AS.ncol = sm.nc
6006  * AS.Store = &sm.A
6007  */
6008  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
6009  __Pyx_GOTREF(__pyx_t_1);
6010  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L1_error)
6011  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6012  __pyx_v_AS.nrow = __pyx_t_2;
6013 
6014  /* "csmoothers.pyx":269
6015  * AS.Mtype = superluWrappers._SLU_GE
6016  * AS.nrow = sm.nr
6017  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
6018  * AS.Store = &sm.A
6019  * casm_NR_prepare(&AS,
6020  */
6021  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
6022  __Pyx_GOTREF(__pyx_t_1);
6023  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
6024  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6025  __pyx_v_AS.ncol = __pyx_t_2;
6026 
6027  /* "csmoothers.pyx":270
6028  * AS.nrow = sm.nr
6029  * AS.ncol = sm.nc
6030  * AS.Store = &sm.A # <<<<<<<<<<<<<<
6031  * casm_NR_prepare(&AS,
6032  * asmFactor.subdomain_dim,
6033  */
6034  __pyx_v_AS.Store = (&__pyx_v_sm->A);
6035 
6036  /* "csmoothers.pyx":271
6037  * AS.ncol = sm.nc
6038  * AS.Store = &sm.A
6039  * casm_NR_prepare(&AS, # <<<<<<<<<<<<<<
6040  * asmFactor.subdomain_dim,
6041  * asmFactor.l2g_L,
6042  */
6043  asm_NR_prepare((&__pyx_v_AS), __pyx_v_asmFactor->subdomain_dim, __pyx_v_asmFactor->l2g_L, __pyx_v_asmFactor->subdomain_L, __pyx_v_asmFactor->subdomain_pivots);
6044 
6045  /* "csmoothers.pyx":262
6046  * asmFactor._cASMFactor)
6047  *
6048  * cdef void smootherWrappers_asm_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6049  * cASMFactor asmFactor):
6050  * cdef SuperMatrix AS
6051  */
6052 
6053  /* function exit code */
6054  goto __pyx_L0;
6055  __pyx_L1_error:;
6056  __Pyx_XDECREF(__pyx_t_1);
6057  __Pyx_WriteUnraisable("csmoothers.smootherWrappers_asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6058  __pyx_L0:;
6059  __Pyx_RefNannyFinishContext();
6060 }
6061 
6062 /* "csmoothers.pyx":277
6063  * asmFactor.subdomain_pivots)
6064  *
6065  * def asm_NR_solve(A, w, asmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
6066  * """
6067  *
6068  */
6069 
6070 /* Python wrapper */
6071 static PyObject *__pyx_pw_10csmoothers_15asm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6072 static char __pyx_doc_10csmoothers_14asm_NR_solve[] = "\n \n Arguments\n ---------\n A : superluWrappers.sparseMatrix\n w : double\n asmFactor : csmoothers.asmFactor\n node_order : np.array int\n R : np.array double\n dX : np.array double\n ";
6073 static PyMethodDef __pyx_mdef_10csmoothers_15asm_NR_solve = {"asm_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_15asm_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_14asm_NR_solve};
6074 static PyObject *__pyx_pw_10csmoothers_15asm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6075  PyObject *__pyx_v_A = 0;
6076  PyObject *__pyx_v_w = 0;
6077  PyObject *__pyx_v_asmFactor = 0;
6078  PyObject *__pyx_v_node_order = 0;
6079  PyObject *__pyx_v_R = 0;
6080  PyObject *__pyx_v_dX = 0;
6081  int __pyx_lineno = 0;
6082  const char *__pyx_filename = NULL;
6083  int __pyx_clineno = 0;
6084  PyObject *__pyx_r = 0;
6085  __Pyx_RefNannyDeclarations
6086  __Pyx_RefNannySetupContext("asm_NR_solve (wrapper)", 0);
6087  {
6088  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_asmFactor,&__pyx_n_s_node_order,&__pyx_n_s_R,&__pyx_n_s_dX,0};
6089  PyObject* values[6] = {0,0,0,0,0,0};
6090  if (unlikely(__pyx_kwds)) {
6091  Py_ssize_t kw_args;
6092  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6093  switch (pos_args) {
6094  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6095  CYTHON_FALLTHROUGH;
6096  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6097  CYTHON_FALLTHROUGH;
6098  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6099  CYTHON_FALLTHROUGH;
6100  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6101  CYTHON_FALLTHROUGH;
6102  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6103  CYTHON_FALLTHROUGH;
6104  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6105  CYTHON_FALLTHROUGH;
6106  case 0: break;
6107  default: goto __pyx_L5_argtuple_error;
6108  }
6109  kw_args = PyDict_Size(__pyx_kwds);
6110  switch (pos_args) {
6111  case 0:
6112  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6113  else goto __pyx_L5_argtuple_error;
6114  CYTHON_FALLTHROUGH;
6115  case 1:
6116  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
6117  else {
6118  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 277, __pyx_L3_error)
6119  }
6120  CYTHON_FALLTHROUGH;
6121  case 2:
6122  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asmFactor)) != 0)) kw_args--;
6123  else {
6124  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 277, __pyx_L3_error)
6125  }
6126  CYTHON_FALLTHROUGH;
6127  case 3:
6128  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
6129  else {
6130  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 277, __pyx_L3_error)
6131  }
6132  CYTHON_FALLTHROUGH;
6133  case 4:
6134  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
6135  else {
6136  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 277, __pyx_L3_error)
6137  }
6138  CYTHON_FALLTHROUGH;
6139  case 5:
6140  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
6141  else {
6142  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 277, __pyx_L3_error)
6143  }
6144  }
6145  if (unlikely(kw_args > 0)) {
6146  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "asm_NR_solve") < 0)) __PYX_ERR(0, 277, __pyx_L3_error)
6147  }
6148  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
6149  goto __pyx_L5_argtuple_error;
6150  } else {
6151  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6152  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6153  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6154  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6155  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6156  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6157  }
6158  __pyx_v_A = values[0];
6159  __pyx_v_w = values[1];
6160  __pyx_v_asmFactor = values[2];
6161  __pyx_v_node_order = values[3];
6162  __pyx_v_R = values[4];
6163  __pyx_v_dX = values[5];
6164  }
6165  goto __pyx_L4_argument_unpacking_done;
6166  __pyx_L5_argtuple_error:;
6167  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 277, __pyx_L3_error)
6168  __pyx_L3_error:;
6169  __Pyx_AddTraceback("csmoothers.asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6170  __Pyx_RefNannyFinishContext();
6171  return NULL;
6172  __pyx_L4_argument_unpacking_done:;
6173  __pyx_r = __pyx_pf_10csmoothers_14asm_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_asmFactor, __pyx_v_node_order, __pyx_v_R, __pyx_v_dX);
6174 
6175  /* function exit code */
6176  __Pyx_RefNannyFinishContext();
6177  return __pyx_r;
6178 }
6179 
6180 static PyObject *__pyx_pf_10csmoothers_14asm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_asmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX) {
6181  PyObject *__pyx_r = NULL;
6182  __Pyx_RefNannyDeclarations
6183  PyObject *__pyx_t_1 = NULL;
6184  double __pyx_t_2;
6185  PyObject *__pyx_t_3 = NULL;
6186  __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
6187  __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
6188  __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6189  int __pyx_lineno = 0;
6190  const char *__pyx_filename = NULL;
6191  int __pyx_clineno = 0;
6192  __Pyx_RefNannySetupContext("asm_NR_solve", 0);
6193 
6194  /* "csmoothers.pyx":289
6195  * dX : np.array double
6196  * """
6197  * smootherWrappers_asm_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
6198  * w,
6199  * asmFactor._cASMFactor,
6200  */
6201  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
6202  __Pyx_GOTREF(__pyx_t_1);
6203  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 289, __pyx_L1_error)
6204 
6205  /* "csmoothers.pyx":290
6206  * """
6207  * smootherWrappers_asm_NR_solve(A._cSparseMatrix,
6208  * w, # <<<<<<<<<<<<<<
6209  * asmFactor._cASMFactor,
6210  * node_order,
6211  */
6212  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L1_error)
6213 
6214  /* "csmoothers.pyx":291
6215  * smootherWrappers_asm_NR_solve(A._cSparseMatrix,
6216  * w,
6217  * asmFactor._cASMFactor, # <<<<<<<<<<<<<<
6218  * node_order,
6219  * R,
6220  */
6221  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_asmFactor, __pyx_n_s_cASMFactor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error)
6222  __Pyx_GOTREF(__pyx_t_3);
6223  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10csmoothers_cASMFactor))))) __PYX_ERR(0, 291, __pyx_L1_error)
6224 
6225  /* "csmoothers.pyx":292
6226  * w,
6227  * asmFactor._cASMFactor,
6228  * node_order, # <<<<<<<<<<<<<<
6229  * R,
6230  * dX)
6231  */
6232  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 292, __pyx_L1_error)
6233 
6234  /* "csmoothers.pyx":293
6235  * asmFactor._cASMFactor,
6236  * node_order,
6237  * R, # <<<<<<<<<<<<<<
6238  * dX)
6239  *
6240  */
6241  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 293, __pyx_L1_error)
6242 
6243  /* "csmoothers.pyx":294
6244  * node_order,
6245  * R,
6246  * dX) # <<<<<<<<<<<<<<
6247  *
6248  * cdef void smootherWrappers_asm_NR_solve(superluWrappers.cSparseMatrix sm,
6249  */
6250  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 294, __pyx_L1_error)
6251 
6252  /* "csmoothers.pyx":289
6253  * dX : np.array double
6254  * """
6255  * smootherWrappers_asm_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
6256  * w,
6257  * asmFactor._cASMFactor,
6258  */
6259  __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, ((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_t_3), __pyx_t_4, __pyx_t_5, __pyx_t_6);
6260  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6261  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6262  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6263  __pyx_t_4.memview = NULL;
6264  __pyx_t_4.data = NULL;
6265  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6266  __pyx_t_5.memview = NULL;
6267  __pyx_t_5.data = NULL;
6268  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6269  __pyx_t_6.memview = NULL;
6270  __pyx_t_6.data = NULL;
6271 
6272  /* "csmoothers.pyx":277
6273  * asmFactor.subdomain_pivots)
6274  *
6275  * def asm_NR_solve(A, w, asmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
6276  * """
6277  *
6278  */
6279 
6280  /* function exit code */
6281  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6282  goto __pyx_L0;
6283  __pyx_L1_error:;
6284  __Pyx_XDECREF(__pyx_t_1);
6285  __Pyx_XDECREF(__pyx_t_3);
6286  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6287  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6288  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6289  __Pyx_AddTraceback("csmoothers.asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6290  __pyx_r = NULL;
6291  __pyx_L0:;
6292  __Pyx_XGIVEREF(__pyx_r);
6293  __Pyx_RefNannyFinishContext();
6294  return __pyx_r;
6295 }
6296 
6297 /* "csmoothers.pyx":296
6298  * dX)
6299  *
6300  * cdef void smootherWrappers_asm_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6301  * double w,
6302  * cASMFactor asmFactor,
6303  */
6304 
6305 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, double __pyx_v_w, struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_asmFactor, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
6306  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
6307  __Pyx_RefNannyDeclarations
6308  PyObject *__pyx_t_1 = NULL;
6309  int __pyx_t_2;
6310  Py_ssize_t __pyx_t_3;
6311  Py_ssize_t __pyx_t_4;
6312  Py_ssize_t __pyx_t_5;
6313  int __pyx_lineno = 0;
6314  const char *__pyx_filename = NULL;
6315  int __pyx_clineno = 0;
6316  __Pyx_RefNannySetupContext("smootherWrappers_asm_NR_solve", 0);
6317 
6318  /* "csmoothers.pyx":303
6319  * DDATA dX):
6320  * cdef SuperMatrix AS
6321  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
6322  * AS.Dtype = superluWrappers._SLU_D
6323  * AS.Mtype = superluWrappers._SLU_GE
6324  */
6325  __pyx_v_AS.Stype = SLU_NR;
6326 
6327  /* "csmoothers.pyx":304
6328  * cdef SuperMatrix AS
6329  * AS.Stype = superluWrappers._SLU_NR
6330  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
6331  * AS.Mtype = superluWrappers._SLU_GE
6332  * AS.nrow = sm.nr
6333  */
6334  __pyx_v_AS.Dtype = SLU_D;
6335 
6336  /* "csmoothers.pyx":305
6337  * AS.Stype = superluWrappers._SLU_NR
6338  * AS.Dtype = superluWrappers._SLU_D
6339  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
6340  * AS.nrow = sm.nr
6341  * AS.ncol = sm.nc
6342  */
6343  __pyx_v_AS.Mtype = SLU_GE;
6344 
6345  /* "csmoothers.pyx":306
6346  * AS.Dtype = superluWrappers._SLU_D
6347  * AS.Mtype = superluWrappers._SLU_GE
6348  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
6349  * AS.ncol = sm.nc
6350  * AS.Store = &sm.A
6351  */
6352  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error)
6353  __Pyx_GOTREF(__pyx_t_1);
6354  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 306, __pyx_L1_error)
6355  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6356  __pyx_v_AS.nrow = __pyx_t_2;
6357 
6358  /* "csmoothers.pyx":307
6359  * AS.Mtype = superluWrappers._SLU_GE
6360  * AS.nrow = sm.nr
6361  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
6362  * AS.Store = &sm.A
6363  * casm_NR_solve(&AS,
6364  */
6365  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
6366  __Pyx_GOTREF(__pyx_t_1);
6367  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L1_error)
6368  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6369  __pyx_v_AS.ncol = __pyx_t_2;
6370 
6371  /* "csmoothers.pyx":308
6372  * AS.nrow = sm.nr
6373  * AS.ncol = sm.nc
6374  * AS.Store = &sm.A # <<<<<<<<<<<<<<
6375  * casm_NR_solve(&AS,
6376  * w,
6377  */
6378  __pyx_v_AS.Store = (&__pyx_v_sm->A);
6379 
6380  /* "csmoothers.pyx":314
6381  * asmFactor.subdomain_dim,
6382  * asmFactor.l2g_L,
6383  * &R[0], # <<<<<<<<<<<<<<
6384  * asmFactor.subdomain_R,
6385  * &node_order[0],
6386  */
6387  __pyx_t_3 = 0;
6388  __pyx_t_2 = -1;
6389  if (__pyx_t_3 < 0) {
6390  __pyx_t_3 += __pyx_v_R.shape[0];
6391  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
6392  } else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
6393  if (unlikely(__pyx_t_2 != -1)) {
6394  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6395  __PYX_ERR(0, 314, __pyx_L1_error)
6396  }
6397 
6398  /* "csmoothers.pyx":316
6399  * &R[0],
6400  * asmFactor.subdomain_R,
6401  * &node_order[0], # <<<<<<<<<<<<<<
6402  * asmFactor.subdomain_dX,
6403  * &dX[0],
6404  */
6405  __pyx_t_4 = 0;
6406  __pyx_t_2 = -1;
6407  if (__pyx_t_4 < 0) {
6408  __pyx_t_4 += __pyx_v_node_order.shape[0];
6409  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
6410  } else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
6411  if (unlikely(__pyx_t_2 != -1)) {
6412  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6413  __PYX_ERR(0, 316, __pyx_L1_error)
6414  }
6415 
6416  /* "csmoothers.pyx":318
6417  * &node_order[0],
6418  * asmFactor.subdomain_dX,
6419  * &dX[0], # <<<<<<<<<<<<<<
6420  * asmFactor.subdomain_pivots)
6421  *
6422  */
6423  __pyx_t_5 = 0;
6424  __pyx_t_2 = -1;
6425  if (__pyx_t_5 < 0) {
6426  __pyx_t_5 += __pyx_v_dX.shape[0];
6427  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
6428  } else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
6429  if (unlikely(__pyx_t_2 != -1)) {
6430  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6431  __PYX_ERR(0, 318, __pyx_L1_error)
6432  }
6433 
6434  /* "csmoothers.pyx":309
6435  * AS.ncol = sm.nc
6436  * AS.Store = &sm.A
6437  * casm_NR_solve(&AS, # <<<<<<<<<<<<<<
6438  * w,
6439  * asmFactor.subdomain_L,
6440  */
6441  asm_NR_solve((&__pyx_v_AS), __pyx_v_w, __pyx_v_asmFactor->subdomain_L, __pyx_v_asmFactor->subdomain_dim, __pyx_v_asmFactor->l2g_L, (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), __pyx_v_asmFactor->subdomain_R, (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_asmFactor->subdomain_dX, (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))), __pyx_v_asmFactor->subdomain_pivots);
6442 
6443  /* "csmoothers.pyx":296
6444  * dX)
6445  *
6446  * cdef void smootherWrappers_asm_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6447  * double w,
6448  * cASMFactor asmFactor,
6449  */
6450 
6451  /* function exit code */
6452  goto __pyx_L0;
6453  __pyx_L1_error:;
6454  __Pyx_XDECREF(__pyx_t_1);
6455  __Pyx_WriteUnraisable("csmoothers.smootherWrappers_asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6456  __pyx_L0:;
6457  __Pyx_RefNannyFinishContext();
6458 }
6459 
6460 /* "csmoothers.pyx":321
6461  * asmFactor.subdomain_pivots)
6462  *
6463  * def basm_NR_prepare(A, basmFactor): # <<<<<<<<<<<<<<
6464  * """
6465  *
6466  */
6467 
6468 /* Python wrapper */
6469 static PyObject *__pyx_pw_10csmoothers_17basm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6470 static char __pyx_doc_10csmoothers_16basm_NR_prepare[] = "\n\n Arguments\n ---------\n A :\n basmFactor :\n ";
6471 static PyMethodDef __pyx_mdef_10csmoothers_17basm_NR_prepare = {"basm_NR_prepare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_17basm_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_16basm_NR_prepare};
6472 static PyObject *__pyx_pw_10csmoothers_17basm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6473  PyObject *__pyx_v_A = 0;
6474  PyObject *__pyx_v_basmFactor = 0;
6475  int __pyx_lineno = 0;
6476  const char *__pyx_filename = NULL;
6477  int __pyx_clineno = 0;
6478  PyObject *__pyx_r = 0;
6479  __Pyx_RefNannyDeclarations
6480  __Pyx_RefNannySetupContext("basm_NR_prepare (wrapper)", 0);
6481  {
6482  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_basmFactor,0};
6483  PyObject* values[2] = {0,0};
6484  if (unlikely(__pyx_kwds)) {
6485  Py_ssize_t kw_args;
6486  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6487  switch (pos_args) {
6488  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6489  CYTHON_FALLTHROUGH;
6490  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6491  CYTHON_FALLTHROUGH;
6492  case 0: break;
6493  default: goto __pyx_L5_argtuple_error;
6494  }
6495  kw_args = PyDict_Size(__pyx_kwds);
6496  switch (pos_args) {
6497  case 0:
6498  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6499  else goto __pyx_L5_argtuple_error;
6500  CYTHON_FALLTHROUGH;
6501  case 1:
6502  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_basmFactor)) != 0)) kw_args--;
6503  else {
6504  __Pyx_RaiseArgtupleInvalid("basm_NR_prepare", 1, 2, 2, 1); __PYX_ERR(0, 321, __pyx_L3_error)
6505  }
6506  }
6507  if (unlikely(kw_args > 0)) {
6508  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "basm_NR_prepare") < 0)) __PYX_ERR(0, 321, __pyx_L3_error)
6509  }
6510  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
6511  goto __pyx_L5_argtuple_error;
6512  } else {
6513  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6514  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6515  }
6516  __pyx_v_A = values[0];
6517  __pyx_v_basmFactor = values[1];
6518  }
6519  goto __pyx_L4_argument_unpacking_done;
6520  __pyx_L5_argtuple_error:;
6521  __Pyx_RaiseArgtupleInvalid("basm_NR_prepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 321, __pyx_L3_error)
6522  __pyx_L3_error:;
6523  __Pyx_AddTraceback("csmoothers.basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
6524  __Pyx_RefNannyFinishContext();
6525  return NULL;
6526  __pyx_L4_argument_unpacking_done:;
6527  __pyx_r = __pyx_pf_10csmoothers_16basm_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_basmFactor);
6528 
6529  /* function exit code */
6530  __Pyx_RefNannyFinishContext();
6531  return __pyx_r;
6532 }
6533 
6534 static PyObject *__pyx_pf_10csmoothers_16basm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_basmFactor) {
6535  PyObject *__pyx_r = NULL;
6536  __Pyx_RefNannyDeclarations
6537  PyObject *__pyx_t_1 = NULL;
6538  PyObject *__pyx_t_2 = NULL;
6539  int __pyx_lineno = 0;
6540  const char *__pyx_filename = NULL;
6541  int __pyx_clineno = 0;
6542  __Pyx_RefNannySetupContext("basm_NR_prepare", 0);
6543 
6544  /* "csmoothers.pyx":329
6545  * basmFactor :
6546  * """
6547  * smootherWrappers_basm_NR_prepare(A._cSparseMatrix, # <<<<<<<<<<<<<<
6548  * basmFactor._cBASMFactor)
6549  *
6550  */
6551  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
6552  __Pyx_GOTREF(__pyx_t_1);
6553  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 329, __pyx_L1_error)
6554 
6555  /* "csmoothers.pyx":330
6556  * """
6557  * smootherWrappers_basm_NR_prepare(A._cSparseMatrix,
6558  * basmFactor._cBASMFactor) # <<<<<<<<<<<<<<
6559  *
6560  * cdef void smootherWrappers_basm_NR_prepare(superluWrappers.cSparseMatrix sm,
6561  */
6562  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_basmFactor, __pyx_n_s_cBASMFactor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error)
6563  __Pyx_GOTREF(__pyx_t_2);
6564  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10csmoothers_cBASMFactor))))) __PYX_ERR(0, 330, __pyx_L1_error)
6565 
6566  /* "csmoothers.pyx":329
6567  * basmFactor :
6568  * """
6569  * smootherWrappers_basm_NR_prepare(A._cSparseMatrix, # <<<<<<<<<<<<<<
6570  * basmFactor._cBASMFactor)
6571  *
6572  */
6573  __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_t_2));
6574  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6575  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6576 
6577  /* "csmoothers.pyx":321
6578  * asmFactor.subdomain_pivots)
6579  *
6580  * def basm_NR_prepare(A, basmFactor): # <<<<<<<<<<<<<<
6581  * """
6582  *
6583  */
6584 
6585  /* function exit code */
6586  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6587  goto __pyx_L0;
6588  __pyx_L1_error:;
6589  __Pyx_XDECREF(__pyx_t_1);
6590  __Pyx_XDECREF(__pyx_t_2);
6591  __Pyx_AddTraceback("csmoothers.basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
6592  __pyx_r = NULL;
6593  __pyx_L0:;
6594  __Pyx_XGIVEREF(__pyx_r);
6595  __Pyx_RefNannyFinishContext();
6596  return __pyx_r;
6597 }
6598 
6599 /* "csmoothers.pyx":332
6600  * basmFactor._cBASMFactor)
6601  *
6602  * cdef void smootherWrappers_basm_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6603  * cBASMFactor basmFactor):
6604  * cdef SuperMatrix AS
6605  */
6606 
6607 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_basmFactor) {
6608  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
6609  __Pyx_RefNannyDeclarations
6610  PyObject *__pyx_t_1 = NULL;
6611  int __pyx_t_2;
6612  int __pyx_lineno = 0;
6613  const char *__pyx_filename = NULL;
6614  int __pyx_clineno = 0;
6615  __Pyx_RefNannySetupContext("smootherWrappers_basm_NR_prepare", 0);
6616 
6617  /* "csmoothers.pyx":335
6618  * cBASMFactor basmFactor):
6619  * cdef SuperMatrix AS
6620  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
6621  * AS.Mtype = superluWrappers._SLU_GE
6622  * AS.nrow = sm.nr
6623  */
6624  __pyx_v_AS.Dtype = SLU_D;
6625 
6626  /* "csmoothers.pyx":336
6627  * cdef SuperMatrix AS
6628  * AS.Dtype = superluWrappers._SLU_D
6629  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
6630  * AS.nrow = sm.nr
6631  * AS.ncol = sm.nc
6632  */
6633  __pyx_v_AS.Mtype = SLU_GE;
6634 
6635  /* "csmoothers.pyx":337
6636  * AS.Dtype = superluWrappers._SLU_D
6637  * AS.Mtype = superluWrappers._SLU_GE
6638  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
6639  * AS.ncol = sm.nc
6640  * AS.Store = &sm.A
6641  */
6642  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
6643  __Pyx_GOTREF(__pyx_t_1);
6644  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error)
6645  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6646  __pyx_v_AS.nrow = __pyx_t_2;
6647 
6648  /* "csmoothers.pyx":338
6649  * AS.Mtype = superluWrappers._SLU_GE
6650  * AS.nrow = sm.nr
6651  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
6652  * AS.Store = &sm.A
6653  * cbasm_NR_prepare(basmFactor.bs,
6654  */
6655  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
6656  __Pyx_GOTREF(__pyx_t_1);
6657  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
6658  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6659  __pyx_v_AS.ncol = __pyx_t_2;
6660 
6661  /* "csmoothers.pyx":339
6662  * AS.nrow = sm.nr
6663  * AS.ncol = sm.nc
6664  * AS.Store = &sm.A # <<<<<<<<<<<<<<
6665  * cbasm_NR_prepare(basmFactor.bs,
6666  * basmFactor.N,
6667  */
6668  __pyx_v_AS.Store = (&__pyx_v_sm->A);
6669 
6670  /* "csmoothers.pyx":340
6671  * AS.ncol = sm.nc
6672  * AS.Store = &sm.A
6673  * cbasm_NR_prepare(basmFactor.bs, # <<<<<<<<<<<<<<
6674  * basmFactor.N,
6675  * &AS,
6676  */
6677  basm_NR_prepare(__pyx_v_basmFactor->bs, __pyx_v_basmFactor->N, (&__pyx_v_AS), __pyx_v_basmFactor->subdomain_dim, __pyx_v_basmFactor->l2g_L, __pyx_v_basmFactor->subdomain_L, __pyx_v_basmFactor->subdomain_pivots, __pyx_v_basmFactor->subdomain_col_pivots);
6678 
6679  /* "csmoothers.pyx":332
6680  * basmFactor._cBASMFactor)
6681  *
6682  * cdef void smootherWrappers_basm_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6683  * cBASMFactor basmFactor):
6684  * cdef SuperMatrix AS
6685  */
6686 
6687  /* function exit code */
6688  goto __pyx_L0;
6689  __pyx_L1_error:;
6690  __Pyx_XDECREF(__pyx_t_1);
6691  __Pyx_WriteUnraisable("csmoothers.smootherWrappers_basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6692  __pyx_L0:;
6693  __Pyx_RefNannyFinishContext();
6694 }
6695 
6696 /* "csmoothers.pyx":350
6697  *
6698  *
6699  * def basm_NR_solve(A, w, basmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
6700  * """
6701  *
6702  */
6703 
6704 /* Python wrapper */
6705 static PyObject *__pyx_pw_10csmoothers_19basm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6706 static char __pyx_doc_10csmoothers_18basm_NR_solve[] = "\n \n Arguments\n ---------\n A :\n w :\n basmFactor :\n node_order :\n R :\n dX :\n ";
6707 static PyMethodDef __pyx_mdef_10csmoothers_19basm_NR_solve = {"basm_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_19basm_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_18basm_NR_solve};
6708 static PyObject *__pyx_pw_10csmoothers_19basm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6709  PyObject *__pyx_v_A = 0;
6710  PyObject *__pyx_v_w = 0;
6711  PyObject *__pyx_v_basmFactor = 0;
6712  PyObject *__pyx_v_node_order = 0;
6713  PyObject *__pyx_v_R = 0;
6714  PyObject *__pyx_v_dX = 0;
6715  int __pyx_lineno = 0;
6716  const char *__pyx_filename = NULL;
6717  int __pyx_clineno = 0;
6718  PyObject *__pyx_r = 0;
6719  __Pyx_RefNannyDeclarations
6720  __Pyx_RefNannySetupContext("basm_NR_solve (wrapper)", 0);
6721  {
6722  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_basmFactor,&__pyx_n_s_node_order,&__pyx_n_s_R,&__pyx_n_s_dX,0};
6723  PyObject* values[6] = {0,0,0,0,0,0};
6724  if (unlikely(__pyx_kwds)) {
6725  Py_ssize_t kw_args;
6726  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6727  switch (pos_args) {
6728  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6729  CYTHON_FALLTHROUGH;
6730  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6731  CYTHON_FALLTHROUGH;
6732  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6733  CYTHON_FALLTHROUGH;
6734  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6735  CYTHON_FALLTHROUGH;
6736  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6737  CYTHON_FALLTHROUGH;
6738  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6739  CYTHON_FALLTHROUGH;
6740  case 0: break;
6741  default: goto __pyx_L5_argtuple_error;
6742  }
6743  kw_args = PyDict_Size(__pyx_kwds);
6744  switch (pos_args) {
6745  case 0:
6746  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6747  else goto __pyx_L5_argtuple_error;
6748  CYTHON_FALLTHROUGH;
6749  case 1:
6750  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
6751  else {
6752  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 350, __pyx_L3_error)
6753  }
6754  CYTHON_FALLTHROUGH;
6755  case 2:
6756  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_basmFactor)) != 0)) kw_args--;
6757  else {
6758  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 350, __pyx_L3_error)
6759  }
6760  CYTHON_FALLTHROUGH;
6761  case 3:
6762  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
6763  else {
6764  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 350, __pyx_L3_error)
6765  }
6766  CYTHON_FALLTHROUGH;
6767  case 4:
6768  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
6769  else {
6770  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 350, __pyx_L3_error)
6771  }
6772  CYTHON_FALLTHROUGH;
6773  case 5:
6774  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
6775  else {
6776  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 350, __pyx_L3_error)
6777  }
6778  }
6779  if (unlikely(kw_args > 0)) {
6780  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "basm_NR_solve") < 0)) __PYX_ERR(0, 350, __pyx_L3_error)
6781  }
6782  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
6783  goto __pyx_L5_argtuple_error;
6784  } else {
6785  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6786  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6787  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6788  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6789  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6790  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6791  }
6792  __pyx_v_A = values[0];
6793  __pyx_v_w = values[1];
6794  __pyx_v_basmFactor = values[2];
6795  __pyx_v_node_order = values[3];
6796  __pyx_v_R = values[4];
6797  __pyx_v_dX = values[5];
6798  }
6799  goto __pyx_L4_argument_unpacking_done;
6800  __pyx_L5_argtuple_error:;
6801  __Pyx_RaiseArgtupleInvalid("basm_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 350, __pyx_L3_error)
6802  __pyx_L3_error:;
6803  __Pyx_AddTraceback("csmoothers.basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6804  __Pyx_RefNannyFinishContext();
6805  return NULL;
6806  __pyx_L4_argument_unpacking_done:;
6807  __pyx_r = __pyx_pf_10csmoothers_18basm_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_basmFactor, __pyx_v_node_order, __pyx_v_R, __pyx_v_dX);
6808 
6809  /* function exit code */
6810  __Pyx_RefNannyFinishContext();
6811  return __pyx_r;
6812 }
6813 
6814 static PyObject *__pyx_pf_10csmoothers_18basm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_basmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX) {
6815  PyObject *__pyx_r = NULL;
6816  __Pyx_RefNannyDeclarations
6817  PyObject *__pyx_t_1 = NULL;
6818  double __pyx_t_2;
6819  PyObject *__pyx_t_3 = NULL;
6820  __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
6821  __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
6822  __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6823  int __pyx_lineno = 0;
6824  const char *__pyx_filename = NULL;
6825  int __pyx_clineno = 0;
6826  __Pyx_RefNannySetupContext("basm_NR_solve", 0);
6827 
6828  /* "csmoothers.pyx":362
6829  * dX :
6830  * """
6831  * smootherWrappers_basm_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
6832  * w,
6833  * basmFactor._cBASMFactor,
6834  */
6835  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
6836  __Pyx_GOTREF(__pyx_t_1);
6837  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 362, __pyx_L1_error)
6838 
6839  /* "csmoothers.pyx":363
6840  * """
6841  * smootherWrappers_basm_NR_solve(A._cSparseMatrix,
6842  * w, # <<<<<<<<<<<<<<
6843  * basmFactor._cBASMFactor,
6844  * node_order,
6845  */
6846  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error)
6847 
6848  /* "csmoothers.pyx":364
6849  * smootherWrappers_basm_NR_solve(A._cSparseMatrix,
6850  * w,
6851  * basmFactor._cBASMFactor, # <<<<<<<<<<<<<<
6852  * node_order,
6853  * R,
6854  */
6855  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_basmFactor, __pyx_n_s_cBASMFactor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L1_error)
6856  __Pyx_GOTREF(__pyx_t_3);
6857  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10csmoothers_cBASMFactor))))) __PYX_ERR(0, 364, __pyx_L1_error)
6858 
6859  /* "csmoothers.pyx":365
6860  * w,
6861  * basmFactor._cBASMFactor,
6862  * node_order, # <<<<<<<<<<<<<<
6863  * R,
6864  * dX)
6865  */
6866  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 365, __pyx_L1_error)
6867 
6868  /* "csmoothers.pyx":366
6869  * basmFactor._cBASMFactor,
6870  * node_order,
6871  * R, # <<<<<<<<<<<<<<
6872  * dX)
6873  *
6874  */
6875  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 366, __pyx_L1_error)
6876 
6877  /* "csmoothers.pyx":367
6878  * node_order,
6879  * R,
6880  * dX) # <<<<<<<<<<<<<<
6881  *
6882  * cdef void smootherWrappers_basm_NR_solve(superluWrappers.cSparseMatrix sm,
6883  */
6884  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 367, __pyx_L1_error)
6885 
6886  /* "csmoothers.pyx":362
6887  * dX :
6888  * """
6889  * smootherWrappers_basm_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
6890  * w,
6891  * basmFactor._cBASMFactor,
6892  */
6893  __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, ((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_t_3), __pyx_t_4, __pyx_t_5, __pyx_t_6);
6894  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6895  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6896  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6897  __pyx_t_4.memview = NULL;
6898  __pyx_t_4.data = NULL;
6899  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6900  __pyx_t_5.memview = NULL;
6901  __pyx_t_5.data = NULL;
6902  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6903  __pyx_t_6.memview = NULL;
6904  __pyx_t_6.data = NULL;
6905 
6906  /* "csmoothers.pyx":350
6907  *
6908  *
6909  * def basm_NR_solve(A, w, basmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
6910  * """
6911  *
6912  */
6913 
6914  /* function exit code */
6915  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6916  goto __pyx_L0;
6917  __pyx_L1_error:;
6918  __Pyx_XDECREF(__pyx_t_1);
6919  __Pyx_XDECREF(__pyx_t_3);
6920  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6921  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6922  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6923  __Pyx_AddTraceback("csmoothers.basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6924  __pyx_r = NULL;
6925  __pyx_L0:;
6926  __Pyx_XGIVEREF(__pyx_r);
6927  __Pyx_RefNannyFinishContext();
6928  return __pyx_r;
6929 }
6930 
6931 /* "csmoothers.pyx":369
6932  * dX)
6933  *
6934  * cdef void smootherWrappers_basm_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6935  * double w,
6936  * cBASMFactor basmFactor,
6937  */
6938 
6939 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, double __pyx_v_w, struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_basmFactor, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
6940  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
6941  __Pyx_RefNannyDeclarations
6942  PyObject *__pyx_t_1 = NULL;
6943  int __pyx_t_2;
6944  Py_ssize_t __pyx_t_3;
6945  Py_ssize_t __pyx_t_4;
6946  Py_ssize_t __pyx_t_5;
6947  int __pyx_lineno = 0;
6948  const char *__pyx_filename = NULL;
6949  int __pyx_clineno = 0;
6950  __Pyx_RefNannySetupContext("smootherWrappers_basm_NR_solve", 0);
6951 
6952  /* "csmoothers.pyx":376
6953  * DDATA dX):
6954  * cdef SuperMatrix AS
6955  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
6956  * AS.Dtype = superluWrappers._SLU_D
6957  * AS.Mtype = superluWrappers._SLU_GE
6958  */
6959  __pyx_v_AS.Stype = SLU_NR;
6960 
6961  /* "csmoothers.pyx":377
6962  * cdef SuperMatrix AS
6963  * AS.Stype = superluWrappers._SLU_NR
6964  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
6965  * AS.Mtype = superluWrappers._SLU_GE
6966  * AS.nrow = sm.nr
6967  */
6968  __pyx_v_AS.Dtype = SLU_D;
6969 
6970  /* "csmoothers.pyx":378
6971  * AS.Stype = superluWrappers._SLU_NR
6972  * AS.Dtype = superluWrappers._SLU_D
6973  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
6974  * AS.nrow = sm.nr
6975  * AS.ncol = sm.nc
6976  */
6977  __pyx_v_AS.Mtype = SLU_GE;
6978 
6979  /* "csmoothers.pyx":379
6980  * AS.Dtype = superluWrappers._SLU_D
6981  * AS.Mtype = superluWrappers._SLU_GE
6982  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
6983  * AS.ncol = sm.nc
6984  * AS.Store = &sm.A
6985  */
6986  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
6987  __Pyx_GOTREF(__pyx_t_1);
6988  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 379, __pyx_L1_error)
6989  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6990  __pyx_v_AS.nrow = __pyx_t_2;
6991 
6992  /* "csmoothers.pyx":380
6993  * AS.Mtype = superluWrappers._SLU_GE
6994  * AS.nrow = sm.nr
6995  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
6996  * AS.Store = &sm.A
6997  * cbasm_NR_solve(basmFactor.bs,
6998  */
6999  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
7000  __Pyx_GOTREF(__pyx_t_1);
7001  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error)
7002  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7003  __pyx_v_AS.ncol = __pyx_t_2;
7004 
7005  /* "csmoothers.pyx":381
7006  * AS.nrow = sm.nr
7007  * AS.ncol = sm.nc
7008  * AS.Store = &sm.A # <<<<<<<<<<<<<<
7009  * cbasm_NR_solve(basmFactor.bs,
7010  * basmFactor.N,
7011  */
7012  __pyx_v_AS.Store = (&__pyx_v_sm->A);
7013 
7014  /* "csmoothers.pyx":389
7015  * basmFactor.subdomain_dim,
7016  * basmFactor.l2g_L,
7017  * &R[0], # <<<<<<<<<<<<<<
7018  * basmFactor.subdomain_R,
7019  * &node_order[0],
7020  */
7021  __pyx_t_3 = 0;
7022  __pyx_t_2 = -1;
7023  if (__pyx_t_3 < 0) {
7024  __pyx_t_3 += __pyx_v_R.shape[0];
7025  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
7026  } else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
7027  if (unlikely(__pyx_t_2 != -1)) {
7028  __Pyx_RaiseBufferIndexError(__pyx_t_2);
7029  __PYX_ERR(0, 389, __pyx_L1_error)
7030  }
7031 
7032  /* "csmoothers.pyx":391
7033  * &R[0],
7034  * basmFactor.subdomain_R,
7035  * &node_order[0], # <<<<<<<<<<<<<<
7036  * basmFactor.subdomain_dX,
7037  * &dX[0],
7038  */
7039  __pyx_t_4 = 0;
7040  __pyx_t_2 = -1;
7041  if (__pyx_t_4 < 0) {
7042  __pyx_t_4 += __pyx_v_node_order.shape[0];
7043  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
7044  } else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
7045  if (unlikely(__pyx_t_2 != -1)) {
7046  __Pyx_RaiseBufferIndexError(__pyx_t_2);
7047  __PYX_ERR(0, 391, __pyx_L1_error)
7048  }
7049 
7050  /* "csmoothers.pyx":393
7051  * &node_order[0],
7052  * basmFactor.subdomain_dX,
7053  * &dX[0], # <<<<<<<<<<<<<<
7054  * basmFactor.subdomain_pivots,
7055  * basmFactor.subdomain_col_pivots)
7056  */
7057  __pyx_t_5 = 0;
7058  __pyx_t_2 = -1;
7059  if (__pyx_t_5 < 0) {
7060  __pyx_t_5 += __pyx_v_dX.shape[0];
7061  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
7062  } else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
7063  if (unlikely(__pyx_t_2 != -1)) {
7064  __Pyx_RaiseBufferIndexError(__pyx_t_2);
7065  __PYX_ERR(0, 393, __pyx_L1_error)
7066  }
7067 
7068  /* "csmoothers.pyx":382
7069  * AS.ncol = sm.nc
7070  * AS.Store = &sm.A
7071  * cbasm_NR_solve(basmFactor.bs, # <<<<<<<<<<<<<<
7072  * basmFactor.N,
7073  * &AS,
7074  */
7075  basm_NR_solve(__pyx_v_basmFactor->bs, __pyx_v_basmFactor->N, (&__pyx_v_AS), __pyx_v_w, __pyx_v_basmFactor->subdomain_L, __pyx_v_basmFactor->subdomain_dim, __pyx_v_basmFactor->l2g_L, (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), __pyx_v_basmFactor->subdomain_R, (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_basmFactor->subdomain_dX, (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))), __pyx_v_basmFactor->subdomain_pivots, __pyx_v_basmFactor->subdomain_col_pivots);
7076 
7077  /* "csmoothers.pyx":369
7078  * dX)
7079  *
7080  * cdef void smootherWrappers_basm_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
7081  * double w,
7082  * cBASMFactor basmFactor,
7083  */
7084 
7085  /* function exit code */
7086  goto __pyx_L0;
7087  __pyx_L1_error:;
7088  __Pyx_XDECREF(__pyx_t_1);
7089  __Pyx_WriteUnraisable("csmoothers.smootherWrappers_basm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
7090  __pyx_L0:;
7091  __Pyx_RefNannyFinishContext();
7092 }
7093 
7094 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":735
7095  * ctypedef npy_cdouble complex_t
7096  *
7097  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
7098  * return PyArray_MultiIterNew(1, <void*>a)
7099  *
7100  */
7101 
7102 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
7103  PyObject *__pyx_r = NULL;
7104  __Pyx_RefNannyDeclarations
7105  PyObject *__pyx_t_1 = NULL;
7106  int __pyx_lineno = 0;
7107  const char *__pyx_filename = NULL;
7108  int __pyx_clineno = 0;
7109  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
7110 
7111  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":736
7112  *
7113  * cdef inline object PyArray_MultiIterNew1(a):
7114  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
7115  *
7116  * cdef inline object PyArray_MultiIterNew2(a, b):
7117  */
7118  __Pyx_XDECREF(__pyx_r);
7119  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 736, __pyx_L1_error)
7120  __Pyx_GOTREF(__pyx_t_1);
7121  __pyx_r = __pyx_t_1;
7122  __pyx_t_1 = 0;
7123  goto __pyx_L0;
7124 
7125  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":735
7126  * ctypedef npy_cdouble complex_t
7127  *
7128  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
7129  * return PyArray_MultiIterNew(1, <void*>a)
7130  *
7131  */
7132 
7133  /* function exit code */
7134  __pyx_L1_error:;
7135  __Pyx_XDECREF(__pyx_t_1);
7136  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
7137  __pyx_r = 0;
7138  __pyx_L0:;
7139  __Pyx_XGIVEREF(__pyx_r);
7140  __Pyx_RefNannyFinishContext();
7141  return __pyx_r;
7142 }
7143 
7144 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":738
7145  * return PyArray_MultiIterNew(1, <void*>a)
7146  *
7147  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
7148  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7149  *
7150  */
7151 
7152 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
7153  PyObject *__pyx_r = NULL;
7154  __Pyx_RefNannyDeclarations
7155  PyObject *__pyx_t_1 = NULL;
7156  int __pyx_lineno = 0;
7157  const char *__pyx_filename = NULL;
7158  int __pyx_clineno = 0;
7159  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
7160 
7161  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":739
7162  *
7163  * cdef inline object PyArray_MultiIterNew2(a, b):
7164  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
7165  *
7166  * cdef inline object PyArray_MultiIterNew3(a, b, c):
7167  */
7168  __Pyx_XDECREF(__pyx_r);
7169  __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)
7170  __Pyx_GOTREF(__pyx_t_1);
7171  __pyx_r = __pyx_t_1;
7172  __pyx_t_1 = 0;
7173  goto __pyx_L0;
7174 
7175  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":738
7176  * return PyArray_MultiIterNew(1, <void*>a)
7177  *
7178  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
7179  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7180  *
7181  */
7182 
7183  /* function exit code */
7184  __pyx_L1_error:;
7185  __Pyx_XDECREF(__pyx_t_1);
7186  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
7187  __pyx_r = 0;
7188  __pyx_L0:;
7189  __Pyx_XGIVEREF(__pyx_r);
7190  __Pyx_RefNannyFinishContext();
7191  return __pyx_r;
7192 }
7193 
7194 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":741
7195  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7196  *
7197  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
7198  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7199  *
7200  */
7201 
7202 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
7203  PyObject *__pyx_r = NULL;
7204  __Pyx_RefNannyDeclarations
7205  PyObject *__pyx_t_1 = NULL;
7206  int __pyx_lineno = 0;
7207  const char *__pyx_filename = NULL;
7208  int __pyx_clineno = 0;
7209  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
7210 
7211  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":742
7212  *
7213  * cdef inline object PyArray_MultiIterNew3(a, b, c):
7214  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
7215  *
7216  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
7217  */
7218  __Pyx_XDECREF(__pyx_r);
7219  __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)
7220  __Pyx_GOTREF(__pyx_t_1);
7221  __pyx_r = __pyx_t_1;
7222  __pyx_t_1 = 0;
7223  goto __pyx_L0;
7224 
7225  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":741
7226  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
7227  *
7228  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
7229  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7230  *
7231  */
7232 
7233  /* function exit code */
7234  __pyx_L1_error:;
7235  __Pyx_XDECREF(__pyx_t_1);
7236  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
7237  __pyx_r = 0;
7238  __pyx_L0:;
7239  __Pyx_XGIVEREF(__pyx_r);
7240  __Pyx_RefNannyFinishContext();
7241  return __pyx_r;
7242 }
7243 
7244 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":744
7245  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7246  *
7247  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
7248  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7249  *
7250  */
7251 
7252 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) {
7253  PyObject *__pyx_r = NULL;
7254  __Pyx_RefNannyDeclarations
7255  PyObject *__pyx_t_1 = NULL;
7256  int __pyx_lineno = 0;
7257  const char *__pyx_filename = NULL;
7258  int __pyx_clineno = 0;
7259  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
7260 
7261  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":745
7262  *
7263  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
7264  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
7265  *
7266  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
7267  */
7268  __Pyx_XDECREF(__pyx_r);
7269  __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)
7270  __Pyx_GOTREF(__pyx_t_1);
7271  __pyx_r = __pyx_t_1;
7272  __pyx_t_1 = 0;
7273  goto __pyx_L0;
7274 
7275  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":744
7276  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
7277  *
7278  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
7279  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7280  *
7281  */
7282 
7283  /* function exit code */
7284  __pyx_L1_error:;
7285  __Pyx_XDECREF(__pyx_t_1);
7286  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
7287  __pyx_r = 0;
7288  __pyx_L0:;
7289  __Pyx_XGIVEREF(__pyx_r);
7290  __Pyx_RefNannyFinishContext();
7291  return __pyx_r;
7292 }
7293 
7294 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":747
7295  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7296  *
7297  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
7298  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7299  *
7300  */
7301 
7302 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) {
7303  PyObject *__pyx_r = NULL;
7304  __Pyx_RefNannyDeclarations
7305  PyObject *__pyx_t_1 = NULL;
7306  int __pyx_lineno = 0;
7307  const char *__pyx_filename = NULL;
7308  int __pyx_clineno = 0;
7309  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
7310 
7311  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":748
7312  *
7313  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
7314  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
7315  *
7316  * cdef inline tuple PyDataType_SHAPE(dtype d):
7317  */
7318  __Pyx_XDECREF(__pyx_r);
7319  __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)
7320  __Pyx_GOTREF(__pyx_t_1);
7321  __pyx_r = __pyx_t_1;
7322  __pyx_t_1 = 0;
7323  goto __pyx_L0;
7324 
7325  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":747
7326  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
7327  *
7328  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
7329  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7330  *
7331  */
7332 
7333  /* function exit code */
7334  __pyx_L1_error:;
7335  __Pyx_XDECREF(__pyx_t_1);
7336  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
7337  __pyx_r = 0;
7338  __pyx_L0:;
7339  __Pyx_XGIVEREF(__pyx_r);
7340  __Pyx_RefNannyFinishContext();
7341  return __pyx_r;
7342 }
7343 
7344 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":750
7345  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7346  *
7347  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
7348  * if PyDataType_HASSUBARRAY(d):
7349  * return <tuple>d.subarray.shape
7350  */
7351 
7352 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
7353  PyObject *__pyx_r = NULL;
7354  __Pyx_RefNannyDeclarations
7355  int __pyx_t_1;
7356  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
7357 
7358  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":751
7359  *
7360  * cdef inline tuple PyDataType_SHAPE(dtype d):
7361  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
7362  * return <tuple>d.subarray.shape
7363  * else:
7364  */
7365  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
7366  if (__pyx_t_1) {
7367 
7368  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":752
7369  * cdef inline tuple PyDataType_SHAPE(dtype d):
7370  * if PyDataType_HASSUBARRAY(d):
7371  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
7372  * else:
7373  * return ()
7374  */
7375  __Pyx_XDECREF(__pyx_r);
7376  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
7377  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
7378  goto __pyx_L0;
7379 
7380  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":751
7381  *
7382  * cdef inline tuple PyDataType_SHAPE(dtype d):
7383  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
7384  * return <tuple>d.subarray.shape
7385  * else:
7386  */
7387  }
7388 
7389  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":754
7390  * return <tuple>d.subarray.shape
7391  * else:
7392  * return () # <<<<<<<<<<<<<<
7393  *
7394  *
7395  */
7396  /*else*/ {
7397  __Pyx_XDECREF(__pyx_r);
7398  __Pyx_INCREF(__pyx_empty_tuple);
7399  __pyx_r = __pyx_empty_tuple;
7400  goto __pyx_L0;
7401  }
7402 
7403  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":750
7404  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
7405  *
7406  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
7407  * if PyDataType_HASSUBARRAY(d):
7408  * return <tuple>d.subarray.shape
7409  */
7410 
7411  /* function exit code */
7412  __pyx_L0:;
7413  __Pyx_XGIVEREF(__pyx_r);
7414  __Pyx_RefNannyFinishContext();
7415  return __pyx_r;
7416 }
7417 
7418 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":929
7419  * int _import_umath() except -1
7420  *
7421  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7422  * Py_INCREF(base) # important to do this before stealing the reference below!
7423  * PyArray_SetBaseObject(arr, base)
7424  */
7425 
7426 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
7427  __Pyx_RefNannyDeclarations
7428  __Pyx_RefNannySetupContext("set_array_base", 0);
7429 
7430  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":930
7431  *
7432  * cdef inline void set_array_base(ndarray arr, object base):
7433  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
7434  * PyArray_SetBaseObject(arr, base)
7435  *
7436  */
7437  Py_INCREF(__pyx_v_base);
7438 
7439  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":931
7440  * cdef inline void set_array_base(ndarray arr, object base):
7441  * Py_INCREF(base) # important to do this before stealing the reference below!
7442  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
7443  *
7444  * cdef inline object get_array_base(ndarray arr):
7445  */
7446  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
7447 
7448  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":929
7449  * int _import_umath() except -1
7450  *
7451  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7452  * Py_INCREF(base) # important to do this before stealing the reference below!
7453  * PyArray_SetBaseObject(arr, base)
7454  */
7455 
7456  /* function exit code */
7457  __Pyx_RefNannyFinishContext();
7458 }
7459 
7460 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":933
7461  * PyArray_SetBaseObject(arr, base)
7462  *
7463  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
7464  * base = PyArray_BASE(arr)
7465  * if base is NULL:
7466  */
7467 
7468 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
7469  PyObject *__pyx_v_base;
7470  PyObject *__pyx_r = NULL;
7471  __Pyx_RefNannyDeclarations
7472  int __pyx_t_1;
7473  __Pyx_RefNannySetupContext("get_array_base", 0);
7474 
7475  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":934
7476  *
7477  * cdef inline object get_array_base(ndarray arr):
7478  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
7479  * if base is NULL:
7480  * return None
7481  */
7482  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
7483 
7484  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":935
7485  * cdef inline object get_array_base(ndarray arr):
7486  * base = PyArray_BASE(arr)
7487  * if base is NULL: # <<<<<<<<<<<<<<
7488  * return None
7489  * return <object>base
7490  */
7491  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
7492  if (__pyx_t_1) {
7493 
7494  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":936
7495  * base = PyArray_BASE(arr)
7496  * if base is NULL:
7497  * return None # <<<<<<<<<<<<<<
7498  * return <object>base
7499  *
7500  */
7501  __Pyx_XDECREF(__pyx_r);
7502  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7503  goto __pyx_L0;
7504 
7505  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":935
7506  * cdef inline object get_array_base(ndarray arr):
7507  * base = PyArray_BASE(arr)
7508  * if base is NULL: # <<<<<<<<<<<<<<
7509  * return None
7510  * return <object>base
7511  */
7512  }
7513 
7514  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":937
7515  * if base is NULL:
7516  * return None
7517  * return <object>base # <<<<<<<<<<<<<<
7518  *
7519  * # Versions of the import_* functions which are more suitable for
7520  */
7521  __Pyx_XDECREF(__pyx_r);
7522  __Pyx_INCREF(((PyObject *)__pyx_v_base));
7523  __pyx_r = ((PyObject *)__pyx_v_base);
7524  goto __pyx_L0;
7525 
7526  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":933
7527  * PyArray_SetBaseObject(arr, base)
7528  *
7529  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
7530  * base = PyArray_BASE(arr)
7531  * if base is NULL:
7532  */
7533 
7534  /* function exit code */
7535  __pyx_L0:;
7536  __Pyx_XGIVEREF(__pyx_r);
7537  __Pyx_RefNannyFinishContext();
7538  return __pyx_r;
7539 }
7540 
7541 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":941
7542  * # Versions of the import_* functions which are more suitable for
7543  * # Cython code.
7544  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
7545  * try:
7546  * __pyx_import_array()
7547  */
7548 
7549 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
7550  int __pyx_r;
7551  __Pyx_RefNannyDeclarations
7552  PyObject *__pyx_t_1 = NULL;
7553  PyObject *__pyx_t_2 = NULL;
7554  PyObject *__pyx_t_3 = NULL;
7555  int __pyx_t_4;
7556  PyObject *__pyx_t_5 = NULL;
7557  PyObject *__pyx_t_6 = NULL;
7558  PyObject *__pyx_t_7 = NULL;
7559  PyObject *__pyx_t_8 = NULL;
7560  int __pyx_lineno = 0;
7561  const char *__pyx_filename = NULL;
7562  int __pyx_clineno = 0;
7563  __Pyx_RefNannySetupContext("import_array", 0);
7564 
7565  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
7566  * # Cython code.
7567  * cdef inline int import_array() except -1:
7568  * try: # <<<<<<<<<<<<<<
7569  * __pyx_import_array()
7570  * except Exception:
7571  */
7572  {
7573  __Pyx_PyThreadState_declare
7574  __Pyx_PyThreadState_assign
7575  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7576  __Pyx_XGOTREF(__pyx_t_1);
7577  __Pyx_XGOTREF(__pyx_t_2);
7578  __Pyx_XGOTREF(__pyx_t_3);
7579  /*try:*/ {
7580 
7581  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":943
7582  * cdef inline int import_array() except -1:
7583  * try:
7584  * __pyx_import_array() # <<<<<<<<<<<<<<
7585  * except Exception:
7586  * raise ImportError("numpy.core.multiarray failed to import")
7587  */
7588  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 943, __pyx_L3_error)
7589 
7590  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
7591  * # Cython code.
7592  * cdef inline int import_array() except -1:
7593  * try: # <<<<<<<<<<<<<<
7594  * __pyx_import_array()
7595  * except Exception:
7596  */
7597  }
7598  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7599  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7600  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7601  goto __pyx_L8_try_end;
7602  __pyx_L3_error:;
7603 
7604  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":944
7605  * try:
7606  * __pyx_import_array()
7607  * except Exception: # <<<<<<<<<<<<<<
7608  * raise ImportError("numpy.core.multiarray failed to import")
7609  *
7610  */
7611  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7612  if (__pyx_t_4) {
7613  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7614  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 944, __pyx_L5_except_error)
7615  __Pyx_GOTREF(__pyx_t_5);
7616  __Pyx_GOTREF(__pyx_t_6);
7617  __Pyx_GOTREF(__pyx_t_7);
7618 
7619  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":945
7620  * __pyx_import_array()
7621  * except Exception:
7622  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
7623  *
7624  * cdef inline int import_umath() except -1:
7625  */
7626  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 945, __pyx_L5_except_error)
7627  __Pyx_GOTREF(__pyx_t_8);
7628  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7629  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7630  __PYX_ERR(2, 945, __pyx_L5_except_error)
7631  }
7632  goto __pyx_L5_except_error;
7633  __pyx_L5_except_error:;
7634 
7635  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
7636  * # Cython code.
7637  * cdef inline int import_array() except -1:
7638  * try: # <<<<<<<<<<<<<<
7639  * __pyx_import_array()
7640  * except Exception:
7641  */
7642  __Pyx_XGIVEREF(__pyx_t_1);
7643  __Pyx_XGIVEREF(__pyx_t_2);
7644  __Pyx_XGIVEREF(__pyx_t_3);
7645  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7646  goto __pyx_L1_error;
7647  __pyx_L8_try_end:;
7648  }
7649 
7650  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":941
7651  * # Versions of the import_* functions which are more suitable for
7652  * # Cython code.
7653  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
7654  * try:
7655  * __pyx_import_array()
7656  */
7657 
7658  /* function exit code */
7659  __pyx_r = 0;
7660  goto __pyx_L0;
7661  __pyx_L1_error:;
7662  __Pyx_XDECREF(__pyx_t_5);
7663  __Pyx_XDECREF(__pyx_t_6);
7664  __Pyx_XDECREF(__pyx_t_7);
7665  __Pyx_XDECREF(__pyx_t_8);
7666  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7667  __pyx_r = -1;
7668  __pyx_L0:;
7669  __Pyx_RefNannyFinishContext();
7670  return __pyx_r;
7671 }
7672 
7673 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":947
7674  * raise ImportError("numpy.core.multiarray failed to import")
7675  *
7676  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
7677  * try:
7678  * _import_umath()
7679  */
7680 
7681 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
7682  int __pyx_r;
7683  __Pyx_RefNannyDeclarations
7684  PyObject *__pyx_t_1 = NULL;
7685  PyObject *__pyx_t_2 = NULL;
7686  PyObject *__pyx_t_3 = NULL;
7687  int __pyx_t_4;
7688  PyObject *__pyx_t_5 = NULL;
7689  PyObject *__pyx_t_6 = NULL;
7690  PyObject *__pyx_t_7 = NULL;
7691  PyObject *__pyx_t_8 = NULL;
7692  int __pyx_lineno = 0;
7693  const char *__pyx_filename = NULL;
7694  int __pyx_clineno = 0;
7695  __Pyx_RefNannySetupContext("import_umath", 0);
7696 
7697  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
7698  *
7699  * cdef inline int import_umath() except -1:
7700  * try: # <<<<<<<<<<<<<<
7701  * _import_umath()
7702  * except Exception:
7703  */
7704  {
7705  __Pyx_PyThreadState_declare
7706  __Pyx_PyThreadState_assign
7707  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7708  __Pyx_XGOTREF(__pyx_t_1);
7709  __Pyx_XGOTREF(__pyx_t_2);
7710  __Pyx_XGOTREF(__pyx_t_3);
7711  /*try:*/ {
7712 
7713  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":949
7714  * cdef inline int import_umath() except -1:
7715  * try:
7716  * _import_umath() # <<<<<<<<<<<<<<
7717  * except Exception:
7718  * raise ImportError("numpy.core.umath failed to import")
7719  */
7720  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 949, __pyx_L3_error)
7721 
7722  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
7723  *
7724  * cdef inline int import_umath() except -1:
7725  * try: # <<<<<<<<<<<<<<
7726  * _import_umath()
7727  * except Exception:
7728  */
7729  }
7730  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7731  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7732  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7733  goto __pyx_L8_try_end;
7734  __pyx_L3_error:;
7735 
7736  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":950
7737  * try:
7738  * _import_umath()
7739  * except Exception: # <<<<<<<<<<<<<<
7740  * raise ImportError("numpy.core.umath failed to import")
7741  *
7742  */
7743  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7744  if (__pyx_t_4) {
7745  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7746  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 950, __pyx_L5_except_error)
7747  __Pyx_GOTREF(__pyx_t_5);
7748  __Pyx_GOTREF(__pyx_t_6);
7749  __Pyx_GOTREF(__pyx_t_7);
7750 
7751  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":951
7752  * _import_umath()
7753  * except Exception:
7754  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
7755  *
7756  * cdef inline int import_ufunc() except -1:
7757  */
7758  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 951, __pyx_L5_except_error)
7759  __Pyx_GOTREF(__pyx_t_8);
7760  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7761  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7762  __PYX_ERR(2, 951, __pyx_L5_except_error)
7763  }
7764  goto __pyx_L5_except_error;
7765  __pyx_L5_except_error:;
7766 
7767  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
7768  *
7769  * cdef inline int import_umath() except -1:
7770  * try: # <<<<<<<<<<<<<<
7771  * _import_umath()
7772  * except Exception:
7773  */
7774  __Pyx_XGIVEREF(__pyx_t_1);
7775  __Pyx_XGIVEREF(__pyx_t_2);
7776  __Pyx_XGIVEREF(__pyx_t_3);
7777  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7778  goto __pyx_L1_error;
7779  __pyx_L8_try_end:;
7780  }
7781 
7782  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":947
7783  * raise ImportError("numpy.core.multiarray failed to import")
7784  *
7785  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
7786  * try:
7787  * _import_umath()
7788  */
7789 
7790  /* function exit code */
7791  __pyx_r = 0;
7792  goto __pyx_L0;
7793  __pyx_L1_error:;
7794  __Pyx_XDECREF(__pyx_t_5);
7795  __Pyx_XDECREF(__pyx_t_6);
7796  __Pyx_XDECREF(__pyx_t_7);
7797  __Pyx_XDECREF(__pyx_t_8);
7798  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7799  __pyx_r = -1;
7800  __pyx_L0:;
7801  __Pyx_RefNannyFinishContext();
7802  return __pyx_r;
7803 }
7804 
7805 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":953
7806  * raise ImportError("numpy.core.umath failed to import")
7807  *
7808  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
7809  * try:
7810  * _import_umath()
7811  */
7812 
7813 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
7814  int __pyx_r;
7815  __Pyx_RefNannyDeclarations
7816  PyObject *__pyx_t_1 = NULL;
7817  PyObject *__pyx_t_2 = NULL;
7818  PyObject *__pyx_t_3 = NULL;
7819  int __pyx_t_4;
7820  PyObject *__pyx_t_5 = NULL;
7821  PyObject *__pyx_t_6 = NULL;
7822  PyObject *__pyx_t_7 = NULL;
7823  PyObject *__pyx_t_8 = NULL;
7824  int __pyx_lineno = 0;
7825  const char *__pyx_filename = NULL;
7826  int __pyx_clineno = 0;
7827  __Pyx_RefNannySetupContext("import_ufunc", 0);
7828 
7829  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
7830  *
7831  * cdef inline int import_ufunc() except -1:
7832  * try: # <<<<<<<<<<<<<<
7833  * _import_umath()
7834  * except Exception:
7835  */
7836  {
7837  __Pyx_PyThreadState_declare
7838  __Pyx_PyThreadState_assign
7839  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7840  __Pyx_XGOTREF(__pyx_t_1);
7841  __Pyx_XGOTREF(__pyx_t_2);
7842  __Pyx_XGOTREF(__pyx_t_3);
7843  /*try:*/ {
7844 
7845  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":955
7846  * cdef inline int import_ufunc() except -1:
7847  * try:
7848  * _import_umath() # <<<<<<<<<<<<<<
7849  * except Exception:
7850  * raise ImportError("numpy.core.umath failed to import")
7851  */
7852  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 955, __pyx_L3_error)
7853 
7854  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
7855  *
7856  * cdef inline int import_ufunc() except -1:
7857  * try: # <<<<<<<<<<<<<<
7858  * _import_umath()
7859  * except Exception:
7860  */
7861  }
7862  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7863  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7864  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7865  goto __pyx_L8_try_end;
7866  __pyx_L3_error:;
7867 
7868  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":956
7869  * try:
7870  * _import_umath()
7871  * except Exception: # <<<<<<<<<<<<<<
7872  * raise ImportError("numpy.core.umath failed to import")
7873  *
7874  */
7875  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7876  if (__pyx_t_4) {
7877  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
7878  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 956, __pyx_L5_except_error)
7879  __Pyx_GOTREF(__pyx_t_5);
7880  __Pyx_GOTREF(__pyx_t_6);
7881  __Pyx_GOTREF(__pyx_t_7);
7882 
7883  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":957
7884  * _import_umath()
7885  * except Exception:
7886  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
7887  *
7888  * cdef extern from *:
7889  */
7890  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 957, __pyx_L5_except_error)
7891  __Pyx_GOTREF(__pyx_t_8);
7892  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7893  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7894  __PYX_ERR(2, 957, __pyx_L5_except_error)
7895  }
7896  goto __pyx_L5_except_error;
7897  __pyx_L5_except_error:;
7898 
7899  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
7900  *
7901  * cdef inline int import_ufunc() except -1:
7902  * try: # <<<<<<<<<<<<<<
7903  * _import_umath()
7904  * except Exception:
7905  */
7906  __Pyx_XGIVEREF(__pyx_t_1);
7907  __Pyx_XGIVEREF(__pyx_t_2);
7908  __Pyx_XGIVEREF(__pyx_t_3);
7909  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7910  goto __pyx_L1_error;
7911  __pyx_L8_try_end:;
7912  }
7913 
7914  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":953
7915  * raise ImportError("numpy.core.umath failed to import")
7916  *
7917  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
7918  * try:
7919  * _import_umath()
7920  */
7921 
7922  /* function exit code */
7923  __pyx_r = 0;
7924  goto __pyx_L0;
7925  __pyx_L1_error:;
7926  __Pyx_XDECREF(__pyx_t_5);
7927  __Pyx_XDECREF(__pyx_t_6);
7928  __Pyx_XDECREF(__pyx_t_7);
7929  __Pyx_XDECREF(__pyx_t_8);
7930  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
7931  __pyx_r = -1;
7932  __pyx_L0:;
7933  __Pyx_RefNannyFinishContext();
7934  return __pyx_r;
7935 }
7936 
7937 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":967
7938  *
7939  *
7940  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
7941  * """
7942  * Cython equivalent of `isinstance(obj, np.timedelta64)`
7943  */
7944 
7945 static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
7946  int __pyx_r;
7947  __Pyx_RefNannyDeclarations
7948  __Pyx_RefNannySetupContext("is_timedelta64_object", 0);
7949 
7950  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":979
7951  * bool
7952  * """
7953  * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
7954  *
7955  *
7956  */
7957  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
7958  goto __pyx_L0;
7959 
7960  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":967
7961  *
7962  *
7963  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
7964  * """
7965  * Cython equivalent of `isinstance(obj, np.timedelta64)`
7966  */
7967 
7968  /* function exit code */
7969  __pyx_L0:;
7970  __Pyx_RefNannyFinishContext();
7971  return __pyx_r;
7972 }
7973 
7974 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":982
7975  *
7976  *
7977  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
7978  * """
7979  * Cython equivalent of `isinstance(obj, np.datetime64)`
7980  */
7981 
7982 static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
7983  int __pyx_r;
7984  __Pyx_RefNannyDeclarations
7985  __Pyx_RefNannySetupContext("is_datetime64_object", 0);
7986 
7987  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":994
7988  * bool
7989  * """
7990  * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
7991  *
7992  *
7993  */
7994  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
7995  goto __pyx_L0;
7996 
7997  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":982
7998  *
7999  *
8000  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
8001  * """
8002  * Cython equivalent of `isinstance(obj, np.datetime64)`
8003  */
8004 
8005  /* function exit code */
8006  __pyx_L0:;
8007  __Pyx_RefNannyFinishContext();
8008  return __pyx_r;
8009 }
8010 
8011 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":997
8012  *
8013  *
8014  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
8015  * """
8016  * returns the int64 value underlying scalar numpy datetime64 object
8017  */
8018 
8019 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
8020  npy_datetime __pyx_r;
8021 
8022  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1004
8023  * also needed. That can be found using `get_datetime64_unit`.
8024  * """
8025  * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
8026  *
8027  *
8028  */
8029  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
8030  goto __pyx_L0;
8031 
8032  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":997
8033  *
8034  *
8035  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
8036  * """
8037  * returns the int64 value underlying scalar numpy datetime64 object
8038  */
8039 
8040  /* function exit code */
8041  __pyx_L0:;
8042  return __pyx_r;
8043 }
8044 
8045 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1007
8046  *
8047  *
8048  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
8049  * """
8050  * returns the int64 value underlying scalar numpy timedelta64 object
8051  */
8052 
8053 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
8054  npy_timedelta __pyx_r;
8055 
8056  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1011
8057  * returns the int64 value underlying scalar numpy timedelta64 object
8058  * """
8059  * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
8060  *
8061  *
8062  */
8063  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
8064  goto __pyx_L0;
8065 
8066  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1007
8067  *
8068  *
8069  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
8070  * """
8071  * returns the int64 value underlying scalar numpy timedelta64 object
8072  */
8073 
8074  /* function exit code */
8075  __pyx_L0:;
8076  return __pyx_r;
8077 }
8078 
8079 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
8080  *
8081  *
8082  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
8083  * """
8084  * returns the unit part of the dtype for a numpy datetime64 object.
8085  */
8086 
8087 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
8088  NPY_DATETIMEUNIT __pyx_r;
8089 
8090  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1018
8091  * returns the unit part of the dtype for a numpy datetime64 object.
8092  * """
8093  * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
8094  */
8095  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
8096  goto __pyx_L0;
8097 
8098  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
8099  *
8100  *
8101  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
8102  * """
8103  * returns the unit part of the dtype for a numpy datetime64 object.
8104  */
8105 
8106  /* function exit code */
8107  __pyx_L0:;
8108  return __pyx_r;
8109 }
8110 
8111 /* "View.MemoryView":122
8112  * cdef bint dtype_is_object
8113  *
8114  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8115  * mode="c", bint allocate_buffer=True):
8116  *
8117  */
8118 
8119 /* Python wrapper */
8120 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8121 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8122  PyObject *__pyx_v_shape = 0;
8123  Py_ssize_t __pyx_v_itemsize;
8124  PyObject *__pyx_v_format = 0;
8125  PyObject *__pyx_v_mode = 0;
8126  int __pyx_v_allocate_buffer;
8127  int __pyx_lineno = 0;
8128  const char *__pyx_filename = NULL;
8129  int __pyx_clineno = 0;
8130  int __pyx_r;
8131  __Pyx_RefNannyDeclarations
8132  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
8133  {
8134  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};
8135  PyObject* values[5] = {0,0,0,0,0};
8136  values[3] = ((PyObject *)__pyx_n_s_c);
8137  if (unlikely(__pyx_kwds)) {
8138  Py_ssize_t kw_args;
8139  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8140  switch (pos_args) {
8141  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8142  CYTHON_FALLTHROUGH;
8143  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8144  CYTHON_FALLTHROUGH;
8145  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8146  CYTHON_FALLTHROUGH;
8147  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8148  CYTHON_FALLTHROUGH;
8149  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8150  CYTHON_FALLTHROUGH;
8151  case 0: break;
8152  default: goto __pyx_L5_argtuple_error;
8153  }
8154  kw_args = PyDict_Size(__pyx_kwds);
8155  switch (pos_args) {
8156  case 0:
8157  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
8158  else goto __pyx_L5_argtuple_error;
8159  CYTHON_FALLTHROUGH;
8160  case 1:
8161  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
8162  else {
8163  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
8164  }
8165  CYTHON_FALLTHROUGH;
8166  case 2:
8167  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
8168  else {
8169  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
8170  }
8171  CYTHON_FALLTHROUGH;
8172  case 3:
8173  if (kw_args > 0) {
8174  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
8175  if (value) { values[3] = value; kw_args--; }
8176  }
8177  CYTHON_FALLTHROUGH;
8178  case 4:
8179  if (kw_args > 0) {
8180  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
8181  if (value) { values[4] = value; kw_args--; }
8182  }
8183  }
8184  if (unlikely(kw_args > 0)) {
8185  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
8186  }
8187  } else {
8188  switch (PyTuple_GET_SIZE(__pyx_args)) {
8189  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8190  CYTHON_FALLTHROUGH;
8191  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8192  CYTHON_FALLTHROUGH;
8193  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8194  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8195  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8196  break;
8197  default: goto __pyx_L5_argtuple_error;
8198  }
8199  }
8200  __pyx_v_shape = ((PyObject*)values[0]);
8201  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
8202  __pyx_v_format = values[2];
8203  __pyx_v_mode = values[3];
8204  if (values[4]) {
8205  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
8206  } else {
8207 
8208  /* "View.MemoryView":123
8209  *
8210  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
8211  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
8212  *
8213  * cdef int idx
8214  */
8215  __pyx_v_allocate_buffer = ((int)1);
8216  }
8217  }
8218  goto __pyx_L4_argument_unpacking_done;
8219  __pyx_L5_argtuple_error:;
8220  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
8221  __pyx_L3_error:;
8222  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8223  __Pyx_RefNannyFinishContext();
8224  return -1;
8225  __pyx_L4_argument_unpacking_done:;
8226  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
8227  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
8228  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 122, __pyx_L1_error)
8229  }
8230  __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);
8231 
8232  /* "View.MemoryView":122
8233  * cdef bint dtype_is_object
8234  *
8235  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8236  * mode="c", bint allocate_buffer=True):
8237  *
8238  */
8239 
8240  /* function exit code */
8241  goto __pyx_L0;
8242  __pyx_L1_error:;
8243  __pyx_r = -1;
8244  __pyx_L0:;
8245  __Pyx_RefNannyFinishContext();
8246  return __pyx_r;
8247 }
8248 
8249 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) {
8250  int __pyx_v_idx;
8251  Py_ssize_t __pyx_v_i;
8252  Py_ssize_t __pyx_v_dim;
8253  PyObject **__pyx_v_p;
8254  char __pyx_v_order;
8255  int __pyx_r;
8256  __Pyx_RefNannyDeclarations
8257  Py_ssize_t __pyx_t_1;
8258  int __pyx_t_2;
8259  PyObject *__pyx_t_3 = NULL;
8260  int __pyx_t_4;
8261  PyObject *__pyx_t_5 = NULL;
8262  PyObject *__pyx_t_6 = NULL;
8263  char *__pyx_t_7;
8264  int __pyx_t_8;
8265  Py_ssize_t __pyx_t_9;
8266  PyObject *__pyx_t_10 = NULL;
8267  Py_ssize_t __pyx_t_11;
8268  int __pyx_lineno = 0;
8269  const char *__pyx_filename = NULL;
8270  int __pyx_clineno = 0;
8271  __Pyx_RefNannySetupContext("__cinit__", 0);
8272  __Pyx_INCREF(__pyx_v_format);
8273 
8274  /* "View.MemoryView":129
8275  * cdef PyObject **p
8276  *
8277  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
8278  * self.itemsize = itemsize
8279  *
8280  */
8281  if (unlikely(__pyx_v_shape == Py_None)) {
8282  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
8283  __PYX_ERR(1, 129, __pyx_L1_error)
8284  }
8285  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
8286  __pyx_v_self->ndim = ((int)__pyx_t_1);
8287 
8288  /* "View.MemoryView":130
8289  *
8290  * self.ndim = <int> len(shape)
8291  * self.itemsize = itemsize # <<<<<<<<<<<<<<
8292  *
8293  * if not self.ndim:
8294  */
8295  __pyx_v_self->itemsize = __pyx_v_itemsize;
8296 
8297  /* "View.MemoryView":132
8298  * self.itemsize = itemsize
8299  *
8300  * if not self.ndim: # <<<<<<<<<<<<<<
8301  * raise ValueError("Empty shape tuple for cython.array")
8302  *
8303  */
8304  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
8305  if (unlikely(__pyx_t_2)) {
8306 
8307  /* "View.MemoryView":133
8308  *
8309  * if not self.ndim:
8310  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
8311  *
8312  * if itemsize <= 0:
8313  */
8314  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
8315  __Pyx_GOTREF(__pyx_t_3);
8316  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8317  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8318  __PYX_ERR(1, 133, __pyx_L1_error)
8319 
8320  /* "View.MemoryView":132
8321  * self.itemsize = itemsize
8322  *
8323  * if not self.ndim: # <<<<<<<<<<<<<<
8324  * raise ValueError("Empty shape tuple for cython.array")
8325  *
8326  */
8327  }
8328 
8329  /* "View.MemoryView":135
8330  * raise ValueError("Empty shape tuple for cython.array")
8331  *
8332  * if itemsize <= 0: # <<<<<<<<<<<<<<
8333  * raise ValueError("itemsize <= 0 for cython.array")
8334  *
8335  */
8336  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
8337  if (unlikely(__pyx_t_2)) {
8338 
8339  /* "View.MemoryView":136
8340  *
8341  * if itemsize <= 0:
8342  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
8343  *
8344  * if not isinstance(format, bytes):
8345  */
8346  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
8347  __Pyx_GOTREF(__pyx_t_3);
8348  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8349  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8350  __PYX_ERR(1, 136, __pyx_L1_error)
8351 
8352  /* "View.MemoryView":135
8353  * raise ValueError("Empty shape tuple for cython.array")
8354  *
8355  * if itemsize <= 0: # <<<<<<<<<<<<<<
8356  * raise ValueError("itemsize <= 0 for cython.array")
8357  *
8358  */
8359  }
8360 
8361  /* "View.MemoryView":138
8362  * raise ValueError("itemsize <= 0 for cython.array")
8363  *
8364  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
8365  * format = format.encode('ASCII')
8366  * self._format = format # keep a reference to the byte string
8367  */
8368  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
8369  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
8370  if (__pyx_t_4) {
8371 
8372  /* "View.MemoryView":139
8373  *
8374  * if not isinstance(format, bytes):
8375  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
8376  * self._format = format # keep a reference to the byte string
8377  * self.format = self._format
8378  */
8379  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
8380  __Pyx_GOTREF(__pyx_t_5);
8381  __pyx_t_6 = NULL;
8382  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
8383  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8384  if (likely(__pyx_t_6)) {
8385  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
8386  __Pyx_INCREF(__pyx_t_6);
8387  __Pyx_INCREF(function);
8388  __Pyx_DECREF_SET(__pyx_t_5, function);
8389  }
8390  }
8391  __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);
8392  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8393  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
8394  __Pyx_GOTREF(__pyx_t_3);
8395  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8396  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
8397  __pyx_t_3 = 0;
8398 
8399  /* "View.MemoryView":138
8400  * raise ValueError("itemsize <= 0 for cython.array")
8401  *
8402  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
8403  * format = format.encode('ASCII')
8404  * self._format = format # keep a reference to the byte string
8405  */
8406  }
8407 
8408  /* "View.MemoryView":140
8409  * if not isinstance(format, bytes):
8410  * format = format.encode('ASCII')
8411  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
8412  * self.format = self._format
8413  *
8414  */
8415  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
8416  __pyx_t_3 = __pyx_v_format;
8417  __Pyx_INCREF(__pyx_t_3);
8418  __Pyx_GIVEREF(__pyx_t_3);
8419  __Pyx_GOTREF(__pyx_v_self->_format);
8420  __Pyx_DECREF(__pyx_v_self->_format);
8421  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
8422  __pyx_t_3 = 0;
8423 
8424  /* "View.MemoryView":141
8425  * format = format.encode('ASCII')
8426  * self._format = format # keep a reference to the byte string
8427  * self.format = self._format # <<<<<<<<<<<<<<
8428  *
8429  *
8430  */
8431  if (unlikely(__pyx_v_self->_format == Py_None)) {
8432  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
8433  __PYX_ERR(1, 141, __pyx_L1_error)
8434  }
8435  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
8436  __pyx_v_self->format = __pyx_t_7;
8437 
8438  /* "View.MemoryView":144
8439  *
8440  *
8441  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
8442  * self._strides = self._shape + self.ndim
8443  *
8444  */
8445  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
8446 
8447  /* "View.MemoryView":145
8448  *
8449  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
8450  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
8451  *
8452  * if not self._shape:
8453  */
8454  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
8455 
8456  /* "View.MemoryView":147
8457  * self._strides = self._shape + self.ndim
8458  *
8459  * if not self._shape: # <<<<<<<<<<<<<<
8460  * raise MemoryError("unable to allocate shape and strides.")
8461  *
8462  */
8463  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
8464  if (unlikely(__pyx_t_4)) {
8465 
8466  /* "View.MemoryView":148
8467  *
8468  * if not self._shape:
8469  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
8470  *
8471  *
8472  */
8473  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
8474  __Pyx_GOTREF(__pyx_t_3);
8475  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8476  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8477  __PYX_ERR(1, 148, __pyx_L1_error)
8478 
8479  /* "View.MemoryView":147
8480  * self._strides = self._shape + self.ndim
8481  *
8482  * if not self._shape: # <<<<<<<<<<<<<<
8483  * raise MemoryError("unable to allocate shape and strides.")
8484  *
8485  */
8486  }
8487 
8488  /* "View.MemoryView":151
8489  *
8490  *
8491  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
8492  * if dim <= 0:
8493  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8494  */
8495  __pyx_t_8 = 0;
8496  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
8497  for (;;) {
8498  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
8499  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8500  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
8501  #else
8502  __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
8503  __Pyx_GOTREF(__pyx_t_5);
8504  #endif
8505  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
8506  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8507  __pyx_v_dim = __pyx_t_9;
8508  __pyx_v_idx = __pyx_t_8;
8509  __pyx_t_8 = (__pyx_t_8 + 1);
8510 
8511  /* "View.MemoryView":152
8512  *
8513  * for idx, dim in enumerate(shape):
8514  * if dim <= 0: # <<<<<<<<<<<<<<
8515  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8516  * self._shape[idx] = dim
8517  */
8518  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
8519  if (unlikely(__pyx_t_4)) {
8520 
8521  /* "View.MemoryView":153
8522  * for idx, dim in enumerate(shape):
8523  * if dim <= 0:
8524  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
8525  * self._shape[idx] = dim
8526  *
8527  */
8528  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
8529  __Pyx_GOTREF(__pyx_t_5);
8530  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
8531  __Pyx_GOTREF(__pyx_t_6);
8532  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
8533  __Pyx_GOTREF(__pyx_t_10);
8534  __Pyx_GIVEREF(__pyx_t_5);
8535  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
8536  __Pyx_GIVEREF(__pyx_t_6);
8537  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
8538  __pyx_t_5 = 0;
8539  __pyx_t_6 = 0;
8540  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
8541  __Pyx_GOTREF(__pyx_t_6);
8542  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8543  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
8544  __Pyx_GOTREF(__pyx_t_10);
8545  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8546  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8547  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8548  __PYX_ERR(1, 153, __pyx_L1_error)
8549 
8550  /* "View.MemoryView":152
8551  *
8552  * for idx, dim in enumerate(shape):
8553  * if dim <= 0: # <<<<<<<<<<<<<<
8554  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8555  * self._shape[idx] = dim
8556  */
8557  }
8558 
8559  /* "View.MemoryView":154
8560  * if dim <= 0:
8561  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8562  * self._shape[idx] = dim # <<<<<<<<<<<<<<
8563  *
8564  * cdef char order
8565  */
8566  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
8567 
8568  /* "View.MemoryView":151
8569  *
8570  *
8571  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
8572  * if dim <= 0:
8573  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8574  */
8575  }
8576  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8577 
8578  /* "View.MemoryView":157
8579  *
8580  * cdef char order
8581  * if mode == 'fortran': # <<<<<<<<<<<<<<
8582  * order = b'F'
8583  * self.mode = u'fortran'
8584  */
8585  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
8586  if (__pyx_t_4) {
8587 
8588  /* "View.MemoryView":158
8589  * cdef char order
8590  * if mode == 'fortran':
8591  * order = b'F' # <<<<<<<<<<<<<<
8592  * self.mode = u'fortran'
8593  * elif mode == 'c':
8594  */
8595  __pyx_v_order = 'F';
8596 
8597  /* "View.MemoryView":159
8598  * if mode == 'fortran':
8599  * order = b'F'
8600  * self.mode = u'fortran' # <<<<<<<<<<<<<<
8601  * elif mode == 'c':
8602  * order = b'C'
8603  */
8604  __Pyx_INCREF(__pyx_n_u_fortran);
8605  __Pyx_GIVEREF(__pyx_n_u_fortran);
8606  __Pyx_GOTREF(__pyx_v_self->mode);
8607  __Pyx_DECREF(__pyx_v_self->mode);
8608  __pyx_v_self->mode = __pyx_n_u_fortran;
8609 
8610  /* "View.MemoryView":157
8611  *
8612  * cdef char order
8613  * if mode == 'fortran': # <<<<<<<<<<<<<<
8614  * order = b'F'
8615  * self.mode = u'fortran'
8616  */
8617  goto __pyx_L10;
8618  }
8619 
8620  /* "View.MemoryView":160
8621  * order = b'F'
8622  * self.mode = u'fortran'
8623  * elif mode == 'c': # <<<<<<<<<<<<<<
8624  * order = b'C'
8625  * self.mode = u'c'
8626  */
8627  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
8628  if (likely(__pyx_t_4)) {
8629 
8630  /* "View.MemoryView":161
8631  * self.mode = u'fortran'
8632  * elif mode == 'c':
8633  * order = b'C' # <<<<<<<<<<<<<<
8634  * self.mode = u'c'
8635  * else:
8636  */
8637  __pyx_v_order = 'C';
8638 
8639  /* "View.MemoryView":162
8640  * elif mode == 'c':
8641  * order = b'C'
8642  * self.mode = u'c' # <<<<<<<<<<<<<<
8643  * else:
8644  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8645  */
8646  __Pyx_INCREF(__pyx_n_u_c);
8647  __Pyx_GIVEREF(__pyx_n_u_c);
8648  __Pyx_GOTREF(__pyx_v_self->mode);
8649  __Pyx_DECREF(__pyx_v_self->mode);
8650  __pyx_v_self->mode = __pyx_n_u_c;
8651 
8652  /* "View.MemoryView":160
8653  * order = b'F'
8654  * self.mode = u'fortran'
8655  * elif mode == 'c': # <<<<<<<<<<<<<<
8656  * order = b'C'
8657  * self.mode = u'c'
8658  */
8659  goto __pyx_L10;
8660  }
8661 
8662  /* "View.MemoryView":164
8663  * self.mode = u'c'
8664  * else:
8665  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
8666  *
8667  * self.len = fill_contig_strides_array(self._shape, self._strides,
8668  */
8669  /*else*/ {
8670  __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
8671  __Pyx_GOTREF(__pyx_t_3);
8672  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
8673  __Pyx_GOTREF(__pyx_t_10);
8674  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8675  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8676  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8677  __PYX_ERR(1, 164, __pyx_L1_error)
8678  }
8679  __pyx_L10:;
8680 
8681  /* "View.MemoryView":166
8682  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8683  *
8684  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
8685  * itemsize, self.ndim, order)
8686  *
8687  */
8688  __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);
8689 
8690  /* "View.MemoryView":169
8691  * itemsize, self.ndim, order)
8692  *
8693  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
8694  * self.dtype_is_object = format == b'O'
8695  * if allocate_buffer:
8696  */
8697  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
8698 
8699  /* "View.MemoryView":170
8700  *
8701  * self.free_data = allocate_buffer
8702  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
8703  * if allocate_buffer:
8704  *
8705  */
8706  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
8707  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
8708  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8709  __pyx_v_self->dtype_is_object = __pyx_t_4;
8710 
8711  /* "View.MemoryView":171
8712  * self.free_data = allocate_buffer
8713  * self.dtype_is_object = format == b'O'
8714  * if allocate_buffer: # <<<<<<<<<<<<<<
8715  *
8716  *
8717  */
8718  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
8719  if (__pyx_t_4) {
8720 
8721  /* "View.MemoryView":174
8722  *
8723  *
8724  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
8725  * if not self.data:
8726  * raise MemoryError("unable to allocate array data.")
8727  */
8728  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
8729 
8730  /* "View.MemoryView":175
8731  *
8732  * self.data = <char *>malloc(self.len)
8733  * if not self.data: # <<<<<<<<<<<<<<
8734  * raise MemoryError("unable to allocate array data.")
8735  *
8736  */
8737  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
8738  if (unlikely(__pyx_t_4)) {
8739 
8740  /* "View.MemoryView":176
8741  * self.data = <char *>malloc(self.len)
8742  * if not self.data:
8743  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
8744  *
8745  * if self.dtype_is_object:
8746  */
8747  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
8748  __Pyx_GOTREF(__pyx_t_10);
8749  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8750  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8751  __PYX_ERR(1, 176, __pyx_L1_error)
8752 
8753  /* "View.MemoryView":175
8754  *
8755  * self.data = <char *>malloc(self.len)
8756  * if not self.data: # <<<<<<<<<<<<<<
8757  * raise MemoryError("unable to allocate array data.")
8758  *
8759  */
8760  }
8761 
8762  /* "View.MemoryView":178
8763  * raise MemoryError("unable to allocate array data.")
8764  *
8765  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8766  * p = <PyObject **> self.data
8767  * for i in range(self.len / itemsize):
8768  */
8769  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
8770  if (__pyx_t_4) {
8771 
8772  /* "View.MemoryView":179
8773  *
8774  * if self.dtype_is_object:
8775  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
8776  * for i in range(self.len / itemsize):
8777  * p[i] = Py_None
8778  */
8779  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
8780 
8781  /* "View.MemoryView":180
8782  * if self.dtype_is_object:
8783  * p = <PyObject **> self.data
8784  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
8785  * p[i] = Py_None
8786  * Py_INCREF(Py_None)
8787  */
8788  if (unlikely(__pyx_v_itemsize == 0)) {
8789  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
8790  __PYX_ERR(1, 180, __pyx_L1_error)
8791  }
8792  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))) {
8793  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
8794  __PYX_ERR(1, 180, __pyx_L1_error)
8795  }
8796  __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
8797  __pyx_t_9 = __pyx_t_1;
8798  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
8799  __pyx_v_i = __pyx_t_11;
8800 
8801  /* "View.MemoryView":181
8802  * p = <PyObject **> self.data
8803  * for i in range(self.len / itemsize):
8804  * p[i] = Py_None # <<<<<<<<<<<<<<
8805  * Py_INCREF(Py_None)
8806  *
8807  */
8808  (__pyx_v_p[__pyx_v_i]) = Py_None;
8809 
8810  /* "View.MemoryView":182
8811  * for i in range(self.len / itemsize):
8812  * p[i] = Py_None
8813  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
8814  *
8815  * @cname('getbuffer')
8816  */
8817  Py_INCREF(Py_None);
8818  }
8819 
8820  /* "View.MemoryView":178
8821  * raise MemoryError("unable to allocate array data.")
8822  *
8823  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8824  * p = <PyObject **> self.data
8825  * for i in range(self.len / itemsize):
8826  */
8827  }
8828 
8829  /* "View.MemoryView":171
8830  * self.free_data = allocate_buffer
8831  * self.dtype_is_object = format == b'O'
8832  * if allocate_buffer: # <<<<<<<<<<<<<<
8833  *
8834  *
8835  */
8836  }
8837 
8838  /* "View.MemoryView":122
8839  * cdef bint dtype_is_object
8840  *
8841  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8842  * mode="c", bint allocate_buffer=True):
8843  *
8844  */
8845 
8846  /* function exit code */
8847  __pyx_r = 0;
8848  goto __pyx_L0;
8849  __pyx_L1_error:;
8850  __Pyx_XDECREF(__pyx_t_3);
8851  __Pyx_XDECREF(__pyx_t_5);
8852  __Pyx_XDECREF(__pyx_t_6);
8853  __Pyx_XDECREF(__pyx_t_10);
8854  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8855  __pyx_r = -1;
8856  __pyx_L0:;
8857  __Pyx_XDECREF(__pyx_v_format);
8858  __Pyx_RefNannyFinishContext();
8859  return __pyx_r;
8860 }
8861 
8862 /* "View.MemoryView":185
8863  *
8864  * @cname('getbuffer')
8865  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
8866  * cdef int bufmode = -1
8867  * if self.mode == u"c":
8868  */
8869 
8870 /* Python wrapper */
8871 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
8872 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
8873  int __pyx_r;
8874  __Pyx_RefNannyDeclarations
8875  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
8876  __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));
8877 
8878  /* function exit code */
8879  __Pyx_RefNannyFinishContext();
8880  return __pyx_r;
8881 }
8882 
8883 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) {
8884  int __pyx_v_bufmode;
8885  int __pyx_r;
8886  __Pyx_RefNannyDeclarations
8887  int __pyx_t_1;
8888  int __pyx_t_2;
8889  PyObject *__pyx_t_3 = NULL;
8890  char *__pyx_t_4;
8891  Py_ssize_t __pyx_t_5;
8892  int __pyx_t_6;
8893  Py_ssize_t *__pyx_t_7;
8894  int __pyx_lineno = 0;
8895  const char *__pyx_filename = NULL;
8896  int __pyx_clineno = 0;
8897  if (__pyx_v_info == NULL) {
8898  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
8899  return -1;
8900  }
8901  __Pyx_RefNannySetupContext("__getbuffer__", 0);
8902  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
8903  __Pyx_GIVEREF(__pyx_v_info->obj);
8904 
8905  /* "View.MemoryView":186
8906  * @cname('getbuffer')
8907  * def __getbuffer__(self, Py_buffer *info, int flags):
8908  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
8909  * if self.mode == u"c":
8910  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8911  */
8912  __pyx_v_bufmode = -1;
8913 
8914  /* "View.MemoryView":187
8915  * def __getbuffer__(self, Py_buffer *info, int flags):
8916  * cdef int bufmode = -1
8917  * if self.mode == u"c": # <<<<<<<<<<<<<<
8918  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8919  * elif self.mode == u"fortran":
8920  */
8921  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
8922  __pyx_t_2 = (__pyx_t_1 != 0);
8923  if (__pyx_t_2) {
8924 
8925  /* "View.MemoryView":188
8926  * cdef int bufmode = -1
8927  * if self.mode == u"c":
8928  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
8929  * elif self.mode == u"fortran":
8930  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8931  */
8932  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8933 
8934  /* "View.MemoryView":187
8935  * def __getbuffer__(self, Py_buffer *info, int flags):
8936  * cdef int bufmode = -1
8937  * if self.mode == u"c": # <<<<<<<<<<<<<<
8938  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8939  * elif self.mode == u"fortran":
8940  */
8941  goto __pyx_L3;
8942  }
8943 
8944  /* "View.MemoryView":189
8945  * if self.mode == u"c":
8946  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8947  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
8948  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8949  * if not (flags & bufmode):
8950  */
8951  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
8952  __pyx_t_1 = (__pyx_t_2 != 0);
8953  if (__pyx_t_1) {
8954 
8955  /* "View.MemoryView":190
8956  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8957  * elif self.mode == u"fortran":
8958  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
8959  * if not (flags & bufmode):
8960  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8961  */
8962  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8963 
8964  /* "View.MemoryView":189
8965  * if self.mode == u"c":
8966  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8967  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
8968  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8969  * if not (flags & bufmode):
8970  */
8971  }
8972  __pyx_L3:;
8973 
8974  /* "View.MemoryView":191
8975  * elif self.mode == u"fortran":
8976  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8977  * if not (flags & bufmode): # <<<<<<<<<<<<<<
8978  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8979  * info.buf = self.data
8980  */
8981  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
8982  if (unlikely(__pyx_t_1)) {
8983 
8984  /* "View.MemoryView":192
8985  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8986  * if not (flags & bufmode):
8987  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
8988  * info.buf = self.data
8989  * info.len = self.len
8990  */
8991  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
8992  __Pyx_GOTREF(__pyx_t_3);
8993  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8994  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8995  __PYX_ERR(1, 192, __pyx_L1_error)
8996 
8997  /* "View.MemoryView":191
8998  * elif self.mode == u"fortran":
8999  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
9000  * if not (flags & bufmode): # <<<<<<<<<<<<<<
9001  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9002  * info.buf = self.data
9003  */
9004  }
9005 
9006  /* "View.MemoryView":193
9007  * if not (flags & bufmode):
9008  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9009  * info.buf = self.data # <<<<<<<<<<<<<<
9010  * info.len = self.len
9011  * info.ndim = self.ndim
9012  */
9013  __pyx_t_4 = __pyx_v_self->data;
9014  __pyx_v_info->buf = __pyx_t_4;
9015 
9016  /* "View.MemoryView":194
9017  * raise ValueError("Can only create a buffer that is contiguous in memory.")
9018  * info.buf = self.data
9019  * info.len = self.len # <<<<<<<<<<<<<<
9020  * info.ndim = self.ndim
9021  * info.shape = self._shape
9022  */
9023  __pyx_t_5 = __pyx_v_self->len;
9024  __pyx_v_info->len = __pyx_t_5;
9025 
9026  /* "View.MemoryView":195
9027  * info.buf = self.data
9028  * info.len = self.len
9029  * info.ndim = self.ndim # <<<<<<<<<<<<<<
9030  * info.shape = self._shape
9031  * info.strides = self._strides
9032  */
9033  __pyx_t_6 = __pyx_v_self->ndim;
9034  __pyx_v_info->ndim = __pyx_t_6;
9035 
9036  /* "View.MemoryView":196
9037  * info.len = self.len
9038  * info.ndim = self.ndim
9039  * info.shape = self._shape # <<<<<<<<<<<<<<
9040  * info.strides = self._strides
9041  * info.suboffsets = NULL
9042  */
9043  __pyx_t_7 = __pyx_v_self->_shape;
9044  __pyx_v_info->shape = __pyx_t_7;
9045 
9046  /* "View.MemoryView":197
9047  * info.ndim = self.ndim
9048  * info.shape = self._shape
9049  * info.strides = self._strides # <<<<<<<<<<<<<<
9050  * info.suboffsets = NULL
9051  * info.itemsize = self.itemsize
9052  */
9053  __pyx_t_7 = __pyx_v_self->_strides;
9054  __pyx_v_info->strides = __pyx_t_7;
9055 
9056  /* "View.MemoryView":198
9057  * info.shape = self._shape
9058  * info.strides = self._strides
9059  * info.suboffsets = NULL # <<<<<<<<<<<<<<
9060  * info.itemsize = self.itemsize
9061  * info.readonly = 0
9062  */
9063  __pyx_v_info->suboffsets = NULL;
9064 
9065  /* "View.MemoryView":199
9066  * info.strides = self._strides
9067  * info.suboffsets = NULL
9068  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
9069  * info.readonly = 0
9070  *
9071  */
9072  __pyx_t_5 = __pyx_v_self->itemsize;
9073  __pyx_v_info->itemsize = __pyx_t_5;
9074 
9075  /* "View.MemoryView":200
9076  * info.suboffsets = NULL
9077  * info.itemsize = self.itemsize
9078  * info.readonly = 0 # <<<<<<<<<<<<<<
9079  *
9080  * if flags & PyBUF_FORMAT:
9081  */
9082  __pyx_v_info->readonly = 0;
9083 
9084  /* "View.MemoryView":202
9085  * info.readonly = 0
9086  *
9087  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9088  * info.format = self.format
9089  * else:
9090  */
9091  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9092  if (__pyx_t_1) {
9093 
9094  /* "View.MemoryView":203
9095  *
9096  * if flags & PyBUF_FORMAT:
9097  * info.format = self.format # <<<<<<<<<<<<<<
9098  * else:
9099  * info.format = NULL
9100  */
9101  __pyx_t_4 = __pyx_v_self->format;
9102  __pyx_v_info->format = __pyx_t_4;
9103 
9104  /* "View.MemoryView":202
9105  * info.readonly = 0
9106  *
9107  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9108  * info.format = self.format
9109  * else:
9110  */
9111  goto __pyx_L5;
9112  }
9113 
9114  /* "View.MemoryView":205
9115  * info.format = self.format
9116  * else:
9117  * info.format = NULL # <<<<<<<<<<<<<<
9118  *
9119  * info.obj = self
9120  */
9121  /*else*/ {
9122  __pyx_v_info->format = NULL;
9123  }
9124  __pyx_L5:;
9125 
9126  /* "View.MemoryView":207
9127  * info.format = NULL
9128  *
9129  * info.obj = self # <<<<<<<<<<<<<<
9130  *
9131  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9132  */
9133  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9134  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9135  __Pyx_GOTREF(__pyx_v_info->obj);
9136  __Pyx_DECREF(__pyx_v_info->obj);
9137  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
9138 
9139  /* "View.MemoryView":185
9140  *
9141  * @cname('getbuffer')
9142  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
9143  * cdef int bufmode = -1
9144  * if self.mode == u"c":
9145  */
9146 
9147  /* function exit code */
9148  __pyx_r = 0;
9149  goto __pyx_L0;
9150  __pyx_L1_error:;
9151  __Pyx_XDECREF(__pyx_t_3);
9152  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9153  __pyx_r = -1;
9154  if (__pyx_v_info->obj != NULL) {
9155  __Pyx_GOTREF(__pyx_v_info->obj);
9156  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9157  }
9158  goto __pyx_L2;
9159  __pyx_L0:;
9160  if (__pyx_v_info->obj == Py_None) {
9161  __Pyx_GOTREF(__pyx_v_info->obj);
9162  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9163  }
9164  __pyx_L2:;
9165  __Pyx_RefNannyFinishContext();
9166  return __pyx_r;
9167 }
9168 
9169 /* "View.MemoryView":211
9170  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9171  *
9172  * def __dealloc__(array self): # <<<<<<<<<<<<<<
9173  * if self.callback_free_data != NULL:
9174  * self.callback_free_data(self.data)
9175  */
9176 
9177 /* Python wrapper */
9178 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
9179 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
9180  __Pyx_RefNannyDeclarations
9181  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
9182  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
9183 
9184  /* function exit code */
9185  __Pyx_RefNannyFinishContext();
9186 }
9187 
9188 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
9189  __Pyx_RefNannyDeclarations
9190  int __pyx_t_1;
9191  __Pyx_RefNannySetupContext("__dealloc__", 0);
9192 
9193  /* "View.MemoryView":212
9194  *
9195  * def __dealloc__(array self):
9196  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
9197  * self.callback_free_data(self.data)
9198  * elif self.free_data:
9199  */
9200  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
9201  if (__pyx_t_1) {
9202 
9203  /* "View.MemoryView":213
9204  * def __dealloc__(array self):
9205  * if self.callback_free_data != NULL:
9206  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
9207  * elif self.free_data:
9208  * if self.dtype_is_object:
9209  */
9210  __pyx_v_self->callback_free_data(__pyx_v_self->data);
9211 
9212  /* "View.MemoryView":212
9213  *
9214  * def __dealloc__(array self):
9215  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
9216  * self.callback_free_data(self.data)
9217  * elif self.free_data:
9218  */
9219  goto __pyx_L3;
9220  }
9221 
9222  /* "View.MemoryView":214
9223  * if self.callback_free_data != NULL:
9224  * self.callback_free_data(self.data)
9225  * elif self.free_data: # <<<<<<<<<<<<<<
9226  * if self.dtype_is_object:
9227  * refcount_objects_in_slice(self.data, self._shape,
9228  */
9229  __pyx_t_1 = (__pyx_v_self->free_data != 0);
9230  if (__pyx_t_1) {
9231 
9232  /* "View.MemoryView":215
9233  * self.callback_free_data(self.data)
9234  * elif self.free_data:
9235  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9236  * refcount_objects_in_slice(self.data, self._shape,
9237  * self._strides, self.ndim, False)
9238  */
9239  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
9240  if (__pyx_t_1) {
9241 
9242  /* "View.MemoryView":216
9243  * elif self.free_data:
9244  * if self.dtype_is_object:
9245  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
9246  * self._strides, self.ndim, False)
9247  * free(self.data)
9248  */
9249  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
9250 
9251  /* "View.MemoryView":215
9252  * self.callback_free_data(self.data)
9253  * elif self.free_data:
9254  * if self.dtype_is_object: # <<<<<<<<<<<<<<
9255  * refcount_objects_in_slice(self.data, self._shape,
9256  * self._strides, self.ndim, False)
9257  */
9258  }
9259 
9260  /* "View.MemoryView":218
9261  * refcount_objects_in_slice(self.data, self._shape,
9262  * self._strides, self.ndim, False)
9263  * free(self.data) # <<<<<<<<<<<<<<
9264  * PyObject_Free(self._shape)
9265  *
9266  */
9267  free(__pyx_v_self->data);
9268 
9269  /* "View.MemoryView":214
9270  * if self.callback_free_data != NULL:
9271  * self.callback_free_data(self.data)
9272  * elif self.free_data: # <<<<<<<<<<<<<<
9273  * if self.dtype_is_object:
9274  * refcount_objects_in_slice(self.data, self._shape,
9275  */
9276  }
9277  __pyx_L3:;
9278 
9279  /* "View.MemoryView":219
9280  * self._strides, self.ndim, False)
9281  * free(self.data)
9282  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
9283  *
9284  * @property
9285  */
9286  PyObject_Free(__pyx_v_self->_shape);
9287 
9288  /* "View.MemoryView":211
9289  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9290  *
9291  * def __dealloc__(array self): # <<<<<<<<<<<<<<
9292  * if self.callback_free_data != NULL:
9293  * self.callback_free_data(self.data)
9294  */
9295 
9296  /* function exit code */
9297  __Pyx_RefNannyFinishContext();
9298 }
9299 
9300 /* "View.MemoryView":222
9301  *
9302  * @property
9303  * def memview(self): # <<<<<<<<<<<<<<
9304  * return self.get_memview()
9305  *
9306  */
9307 
9308 /* Python wrapper */
9309 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
9310 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
9311  PyObject *__pyx_r = 0;
9312  __Pyx_RefNannyDeclarations
9313  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9314  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
9315 
9316  /* function exit code */
9317  __Pyx_RefNannyFinishContext();
9318  return __pyx_r;
9319 }
9320 
9321 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
9322  PyObject *__pyx_r = NULL;
9323  __Pyx_RefNannyDeclarations
9324  PyObject *__pyx_t_1 = NULL;
9325  int __pyx_lineno = 0;
9326  const char *__pyx_filename = NULL;
9327  int __pyx_clineno = 0;
9328  __Pyx_RefNannySetupContext("__get__", 0);
9329 
9330  /* "View.MemoryView":223
9331  * @property
9332  * def memview(self):
9333  * return self.get_memview() # <<<<<<<<<<<<<<
9334  *
9335  * @cname('get_memview')
9336  */
9337  __Pyx_XDECREF(__pyx_r);
9338  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
9339  __Pyx_GOTREF(__pyx_t_1);
9340  __pyx_r = __pyx_t_1;
9341  __pyx_t_1 = 0;
9342  goto __pyx_L0;
9343 
9344  /* "View.MemoryView":222
9345  *
9346  * @property
9347  * def memview(self): # <<<<<<<<<<<<<<
9348  * return self.get_memview()
9349  *
9350  */
9351 
9352  /* function exit code */
9353  __pyx_L1_error:;
9354  __Pyx_XDECREF(__pyx_t_1);
9355  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9356  __pyx_r = NULL;
9357  __pyx_L0:;
9358  __Pyx_XGIVEREF(__pyx_r);
9359  __Pyx_RefNannyFinishContext();
9360  return __pyx_r;
9361 }
9362 
9363 /* "View.MemoryView":226
9364  *
9365  * @cname('get_memview')
9366  * cdef get_memview(self): # <<<<<<<<<<<<<<
9367  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9368  * return memoryview(self, flags, self.dtype_is_object)
9369  */
9370 
9371 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
9372  int __pyx_v_flags;
9373  PyObject *__pyx_r = NULL;
9374  __Pyx_RefNannyDeclarations
9375  PyObject *__pyx_t_1 = NULL;
9376  PyObject *__pyx_t_2 = NULL;
9377  PyObject *__pyx_t_3 = NULL;
9378  int __pyx_lineno = 0;
9379  const char *__pyx_filename = NULL;
9380  int __pyx_clineno = 0;
9381  __Pyx_RefNannySetupContext("get_memview", 0);
9382 
9383  /* "View.MemoryView":227
9384  * @cname('get_memview')
9385  * cdef get_memview(self):
9386  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
9387  * return memoryview(self, flags, self.dtype_is_object)
9388  *
9389  */
9390  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
9391 
9392  /* "View.MemoryView":228
9393  * cdef get_memview(self):
9394  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9395  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
9396  *
9397  * def __len__(self):
9398  */
9399  __Pyx_XDECREF(__pyx_r);
9400  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
9401  __Pyx_GOTREF(__pyx_t_1);
9402  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
9403  __Pyx_GOTREF(__pyx_t_2);
9404  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
9405  __Pyx_GOTREF(__pyx_t_3);
9406  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9407  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9408  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
9409  __Pyx_GIVEREF(__pyx_t_1);
9410  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
9411  __Pyx_GIVEREF(__pyx_t_2);
9412  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
9413  __pyx_t_1 = 0;
9414  __pyx_t_2 = 0;
9415  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
9416  __Pyx_GOTREF(__pyx_t_2);
9417  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9418  __pyx_r = __pyx_t_2;
9419  __pyx_t_2 = 0;
9420  goto __pyx_L0;
9421 
9422  /* "View.MemoryView":226
9423  *
9424  * @cname('get_memview')
9425  * cdef get_memview(self): # <<<<<<<<<<<<<<
9426  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9427  * return memoryview(self, flags, self.dtype_is_object)
9428  */
9429 
9430  /* function exit code */
9431  __pyx_L1_error:;
9432  __Pyx_XDECREF(__pyx_t_1);
9433  __Pyx_XDECREF(__pyx_t_2);
9434  __Pyx_XDECREF(__pyx_t_3);
9435  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
9436  __pyx_r = 0;
9437  __pyx_L0:;
9438  __Pyx_XGIVEREF(__pyx_r);
9439  __Pyx_RefNannyFinishContext();
9440  return __pyx_r;
9441 }
9442 
9443 /* "View.MemoryView":230
9444  * return memoryview(self, flags, self.dtype_is_object)
9445  *
9446  * def __len__(self): # <<<<<<<<<<<<<<
9447  * return self._shape[0]
9448  *
9449  */
9450 
9451 /* Python wrapper */
9452 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
9453 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
9454  Py_ssize_t __pyx_r;
9455  __Pyx_RefNannyDeclarations
9456  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
9457  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
9458 
9459  /* function exit code */
9460  __Pyx_RefNannyFinishContext();
9461  return __pyx_r;
9462 }
9463 
9464 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
9465  Py_ssize_t __pyx_r;
9466  __Pyx_RefNannyDeclarations
9467  __Pyx_RefNannySetupContext("__len__", 0);
9468 
9469  /* "View.MemoryView":231
9470  *
9471  * def __len__(self):
9472  * return self._shape[0] # <<<<<<<<<<<<<<
9473  *
9474  * def __getattr__(self, attr):
9475  */
9476  __pyx_r = (__pyx_v_self->_shape[0]);
9477  goto __pyx_L0;
9478 
9479  /* "View.MemoryView":230
9480  * return memoryview(self, flags, self.dtype_is_object)
9481  *
9482  * def __len__(self): # <<<<<<<<<<<<<<
9483  * return self._shape[0]
9484  *
9485  */
9486 
9487  /* function exit code */
9488  __pyx_L0:;
9489  __Pyx_RefNannyFinishContext();
9490  return __pyx_r;
9491 }
9492 
9493 /* "View.MemoryView":233
9494  * return self._shape[0]
9495  *
9496  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
9497  * return getattr(self.memview, attr)
9498  *
9499  */
9500 
9501 /* Python wrapper */
9502 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
9503 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
9504  PyObject *__pyx_r = 0;
9505  __Pyx_RefNannyDeclarations
9506  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
9507  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
9508 
9509  /* function exit code */
9510  __Pyx_RefNannyFinishContext();
9511  return __pyx_r;
9512 }
9513 
9514 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
9515  PyObject *__pyx_r = NULL;
9516  __Pyx_RefNannyDeclarations
9517  PyObject *__pyx_t_1 = NULL;
9518  PyObject *__pyx_t_2 = NULL;
9519  int __pyx_lineno = 0;
9520  const char *__pyx_filename = NULL;
9521  int __pyx_clineno = 0;
9522  __Pyx_RefNannySetupContext("__getattr__", 0);
9523 
9524  /* "View.MemoryView":234
9525  *
9526  * def __getattr__(self, attr):
9527  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
9528  *
9529  * def __getitem__(self, item):
9530  */
9531  __Pyx_XDECREF(__pyx_r);
9532  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
9533  __Pyx_GOTREF(__pyx_t_1);
9534  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
9535  __Pyx_GOTREF(__pyx_t_2);
9536  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9537  __pyx_r = __pyx_t_2;
9538  __pyx_t_2 = 0;
9539  goto __pyx_L0;
9540 
9541  /* "View.MemoryView":233
9542  * return self._shape[0]
9543  *
9544  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
9545  * return getattr(self.memview, attr)
9546  *
9547  */
9548 
9549  /* function exit code */
9550  __pyx_L1_error:;
9551  __Pyx_XDECREF(__pyx_t_1);
9552  __Pyx_XDECREF(__pyx_t_2);
9553  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9554  __pyx_r = NULL;
9555  __pyx_L0:;
9556  __Pyx_XGIVEREF(__pyx_r);
9557  __Pyx_RefNannyFinishContext();
9558  return __pyx_r;
9559 }
9560 
9561 /* "View.MemoryView":236
9562  * return getattr(self.memview, attr)
9563  *
9564  * def __getitem__(self, item): # <<<<<<<<<<<<<<
9565  * return self.memview[item]
9566  *
9567  */
9568 
9569 /* Python wrapper */
9570 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
9571 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
9572  PyObject *__pyx_r = 0;
9573  __Pyx_RefNannyDeclarations
9574  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
9575  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
9576 
9577  /* function exit code */
9578  __Pyx_RefNannyFinishContext();
9579  return __pyx_r;
9580 }
9581 
9582 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
9583  PyObject *__pyx_r = NULL;
9584  __Pyx_RefNannyDeclarations
9585  PyObject *__pyx_t_1 = NULL;
9586  PyObject *__pyx_t_2 = NULL;
9587  int __pyx_lineno = 0;
9588  const char *__pyx_filename = NULL;
9589  int __pyx_clineno = 0;
9590  __Pyx_RefNannySetupContext("__getitem__", 0);
9591 
9592  /* "View.MemoryView":237
9593  *
9594  * def __getitem__(self, item):
9595  * return self.memview[item] # <<<<<<<<<<<<<<
9596  *
9597  * def __setitem__(self, item, value):
9598  */
9599  __Pyx_XDECREF(__pyx_r);
9600  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
9601  __Pyx_GOTREF(__pyx_t_1);
9602  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
9603  __Pyx_GOTREF(__pyx_t_2);
9604  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9605  __pyx_r = __pyx_t_2;
9606  __pyx_t_2 = 0;
9607  goto __pyx_L0;
9608 
9609  /* "View.MemoryView":236
9610  * return getattr(self.memview, attr)
9611  *
9612  * def __getitem__(self, item): # <<<<<<<<<<<<<<
9613  * return self.memview[item]
9614  *
9615  */
9616 
9617  /* function exit code */
9618  __pyx_L1_error:;
9619  __Pyx_XDECREF(__pyx_t_1);
9620  __Pyx_XDECREF(__pyx_t_2);
9621  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9622  __pyx_r = NULL;
9623  __pyx_L0:;
9624  __Pyx_XGIVEREF(__pyx_r);
9625  __Pyx_RefNannyFinishContext();
9626  return __pyx_r;
9627 }
9628 
9629 /* "View.MemoryView":239
9630  * return self.memview[item]
9631  *
9632  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
9633  * self.memview[item] = value
9634  *
9635  */
9636 
9637 /* Python wrapper */
9638 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
9639 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9640  int __pyx_r;
9641  __Pyx_RefNannyDeclarations
9642  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
9643  __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));
9644 
9645  /* function exit code */
9646  __Pyx_RefNannyFinishContext();
9647  return __pyx_r;
9648 }
9649 
9650 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) {
9651  int __pyx_r;
9652  __Pyx_RefNannyDeclarations
9653  PyObject *__pyx_t_1 = NULL;
9654  int __pyx_lineno = 0;
9655  const char *__pyx_filename = NULL;
9656  int __pyx_clineno = 0;
9657  __Pyx_RefNannySetupContext("__setitem__", 0);
9658 
9659  /* "View.MemoryView":240
9660  *
9661  * def __setitem__(self, item, value):
9662  * self.memview[item] = value # <<<<<<<<<<<<<<
9663  *
9664  *
9665  */
9666  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
9667  __Pyx_GOTREF(__pyx_t_1);
9668  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
9669  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9670 
9671  /* "View.MemoryView":239
9672  * return self.memview[item]
9673  *
9674  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
9675  * self.memview[item] = value
9676  *
9677  */
9678 
9679  /* function exit code */
9680  __pyx_r = 0;
9681  goto __pyx_L0;
9682  __pyx_L1_error:;
9683  __Pyx_XDECREF(__pyx_t_1);
9684  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9685  __pyx_r = -1;
9686  __pyx_L0:;
9687  __Pyx_RefNannyFinishContext();
9688  return __pyx_r;
9689 }
9690 
9691 /* "(tree fragment)":1
9692  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9693  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9694  * def __setstate_cython__(self, __pyx_state):
9695  */
9696 
9697 /* Python wrapper */
9698 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
9699 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9700  PyObject *__pyx_r = 0;
9701  __Pyx_RefNannyDeclarations
9702  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9703  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
9704 
9705  /* function exit code */
9706  __Pyx_RefNannyFinishContext();
9707  return __pyx_r;
9708 }
9709 
9710 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
9711  PyObject *__pyx_r = NULL;
9712  __Pyx_RefNannyDeclarations
9713  PyObject *__pyx_t_1 = NULL;
9714  int __pyx_lineno = 0;
9715  const char *__pyx_filename = NULL;
9716  int __pyx_clineno = 0;
9717  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9718 
9719  /* "(tree fragment)":2
9720  * def __reduce_cython__(self):
9721  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9722  * def __setstate_cython__(self, __pyx_state):
9723  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9724  */
9725  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
9726  __Pyx_GOTREF(__pyx_t_1);
9727  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9728  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9729  __PYX_ERR(1, 2, __pyx_L1_error)
9730 
9731  /* "(tree fragment)":1
9732  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9733  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9734  * def __setstate_cython__(self, __pyx_state):
9735  */
9736 
9737  /* function exit code */
9738  __pyx_L1_error:;
9739  __Pyx_XDECREF(__pyx_t_1);
9740  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9741  __pyx_r = NULL;
9742  __Pyx_XGIVEREF(__pyx_r);
9743  __Pyx_RefNannyFinishContext();
9744  return __pyx_r;
9745 }
9746 
9747 /* "(tree fragment)":3
9748  * def __reduce_cython__(self):
9749  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9750  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9751  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9752  */
9753 
9754 /* Python wrapper */
9755 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
9756 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9757  PyObject *__pyx_r = 0;
9758  __Pyx_RefNannyDeclarations
9759  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
9760  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9761 
9762  /* function exit code */
9763  __Pyx_RefNannyFinishContext();
9764  return __pyx_r;
9765 }
9766 
9767 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) {
9768  PyObject *__pyx_r = NULL;
9769  __Pyx_RefNannyDeclarations
9770  PyObject *__pyx_t_1 = NULL;
9771  int __pyx_lineno = 0;
9772  const char *__pyx_filename = NULL;
9773  int __pyx_clineno = 0;
9774  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
9775 
9776  /* "(tree fragment)":4
9777  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9778  * def __setstate_cython__(self, __pyx_state):
9779  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9780  */
9781  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
9782  __Pyx_GOTREF(__pyx_t_1);
9783  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9784  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9785  __PYX_ERR(1, 4, __pyx_L1_error)
9786 
9787  /* "(tree fragment)":3
9788  * def __reduce_cython__(self):
9789  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9790  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9791  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9792  */
9793 
9794  /* function exit code */
9795  __pyx_L1_error:;
9796  __Pyx_XDECREF(__pyx_t_1);
9797  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9798  __pyx_r = NULL;
9799  __Pyx_XGIVEREF(__pyx_r);
9800  __Pyx_RefNannyFinishContext();
9801  return __pyx_r;
9802 }
9803 
9804 /* "View.MemoryView":244
9805  *
9806  * @cname("__pyx_array_new")
9807  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
9808  * char *mode, char *buf):
9809  * cdef array result
9810  */
9811 
9812 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) {
9813  struct __pyx_array_obj *__pyx_v_result = 0;
9814  struct __pyx_array_obj *__pyx_r = NULL;
9815  __Pyx_RefNannyDeclarations
9816  int __pyx_t_1;
9817  PyObject *__pyx_t_2 = NULL;
9818  PyObject *__pyx_t_3 = NULL;
9819  PyObject *__pyx_t_4 = NULL;
9820  PyObject *__pyx_t_5 = NULL;
9821  int __pyx_lineno = 0;
9822  const char *__pyx_filename = NULL;
9823  int __pyx_clineno = 0;
9824  __Pyx_RefNannySetupContext("array_cwrapper", 0);
9825 
9826  /* "View.MemoryView":248
9827  * cdef array result
9828  *
9829  * if buf == NULL: # <<<<<<<<<<<<<<
9830  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9831  * else:
9832  */
9833  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
9834  if (__pyx_t_1) {
9835 
9836  /* "View.MemoryView":249
9837  *
9838  * if buf == NULL:
9839  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
9840  * else:
9841  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9842  */
9843  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
9844  __Pyx_GOTREF(__pyx_t_2);
9845  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
9846  __Pyx_GOTREF(__pyx_t_3);
9847  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
9848  __Pyx_GOTREF(__pyx_t_4);
9849  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
9850  __Pyx_GOTREF(__pyx_t_5);
9851  __Pyx_INCREF(__pyx_v_shape);
9852  __Pyx_GIVEREF(__pyx_v_shape);
9853  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
9854  __Pyx_GIVEREF(__pyx_t_2);
9855  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
9856  __Pyx_GIVEREF(__pyx_t_3);
9857  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
9858  __Pyx_GIVEREF(__pyx_t_4);
9859  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
9860  __pyx_t_2 = 0;
9861  __pyx_t_3 = 0;
9862  __pyx_t_4 = 0;
9863  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
9864  __Pyx_GOTREF(__pyx_t_4);
9865  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9866  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
9867  __pyx_t_4 = 0;
9868 
9869  /* "View.MemoryView":248
9870  * cdef array result
9871  *
9872  * if buf == NULL: # <<<<<<<<<<<<<<
9873  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9874  * else:
9875  */
9876  goto __pyx_L3;
9877  }
9878 
9879  /* "View.MemoryView":251
9880  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9881  * else:
9882  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
9883  * allocate_buffer=False)
9884  * result.data = buf
9885  */
9886  /*else*/ {
9887  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
9888  __Pyx_GOTREF(__pyx_t_4);
9889  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
9890  __Pyx_GOTREF(__pyx_t_5);
9891  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
9892  __Pyx_GOTREF(__pyx_t_3);
9893  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
9894  __Pyx_GOTREF(__pyx_t_2);
9895  __Pyx_INCREF(__pyx_v_shape);
9896  __Pyx_GIVEREF(__pyx_v_shape);
9897  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
9898  __Pyx_GIVEREF(__pyx_t_4);
9899  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
9900  __Pyx_GIVEREF(__pyx_t_5);
9901  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
9902  __Pyx_GIVEREF(__pyx_t_3);
9903  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
9904  __pyx_t_4 = 0;
9905  __pyx_t_5 = 0;
9906  __pyx_t_3 = 0;
9907 
9908  /* "View.MemoryView":252
9909  * else:
9910  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9911  * allocate_buffer=False) # <<<<<<<<<<<<<<
9912  * result.data = buf
9913  *
9914  */
9915  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
9916  __Pyx_GOTREF(__pyx_t_3);
9917  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
9918 
9919  /* "View.MemoryView":251
9920  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9921  * else:
9922  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
9923  * allocate_buffer=False)
9924  * result.data = buf
9925  */
9926  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
9927  __Pyx_GOTREF(__pyx_t_5);
9928  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9929  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9930  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
9931  __pyx_t_5 = 0;
9932 
9933  /* "View.MemoryView":253
9934  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9935  * allocate_buffer=False)
9936  * result.data = buf # <<<<<<<<<<<<<<
9937  *
9938  * return result
9939  */
9940  __pyx_v_result->data = __pyx_v_buf;
9941  }
9942  __pyx_L3:;
9943 
9944  /* "View.MemoryView":255
9945  * result.data = buf
9946  *
9947  * return result # <<<<<<<<<<<<<<
9948  *
9949  *
9950  */
9951  __Pyx_XDECREF(((PyObject *)__pyx_r));
9952  __Pyx_INCREF(((PyObject *)__pyx_v_result));
9953  __pyx_r = __pyx_v_result;
9954  goto __pyx_L0;
9955 
9956  /* "View.MemoryView":244
9957  *
9958  * @cname("__pyx_array_new")
9959  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
9960  * char *mode, char *buf):
9961  * cdef array result
9962  */
9963 
9964  /* function exit code */
9965  __pyx_L1_error:;
9966  __Pyx_XDECREF(__pyx_t_2);
9967  __Pyx_XDECREF(__pyx_t_3);
9968  __Pyx_XDECREF(__pyx_t_4);
9969  __Pyx_XDECREF(__pyx_t_5);
9970  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
9971  __pyx_r = 0;
9972  __pyx_L0:;
9973  __Pyx_XDECREF((PyObject *)__pyx_v_result);
9974  __Pyx_XGIVEREF((PyObject *)__pyx_r);
9975  __Pyx_RefNannyFinishContext();
9976  return __pyx_r;
9977 }
9978 
9979 /* "View.MemoryView":281
9980  * cdef class Enum(object):
9981  * cdef object name
9982  * def __init__(self, name): # <<<<<<<<<<<<<<
9983  * self.name = name
9984  * def __repr__(self):
9985  */
9986 
9987 /* Python wrapper */
9988 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9989 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9990  PyObject *__pyx_v_name = 0;
9991  int __pyx_lineno = 0;
9992  const char *__pyx_filename = NULL;
9993  int __pyx_clineno = 0;
9994  int __pyx_r;
9995  __Pyx_RefNannyDeclarations
9996  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
9997  {
9998  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
9999  PyObject* values[1] = {0};
10000  if (unlikely(__pyx_kwds)) {
10001  Py_ssize_t kw_args;
10002  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10003  switch (pos_args) {
10004  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10005  CYTHON_FALLTHROUGH;
10006  case 0: break;
10007  default: goto __pyx_L5_argtuple_error;
10008  }
10009  kw_args = PyDict_Size(__pyx_kwds);
10010  switch (pos_args) {
10011  case 0:
10012  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
10013  else goto __pyx_L5_argtuple_error;
10014  }
10015  if (unlikely(kw_args > 0)) {
10016  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
10017  }
10018  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
10019  goto __pyx_L5_argtuple_error;
10020  } else {
10021  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10022  }
10023  __pyx_v_name = values[0];
10024  }
10025  goto __pyx_L4_argument_unpacking_done;
10026  __pyx_L5_argtuple_error:;
10027  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
10028  __pyx_L3_error:;
10029  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10030  __Pyx_RefNannyFinishContext();
10031  return -1;
10032  __pyx_L4_argument_unpacking_done:;
10033  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
10034 
10035  /* function exit code */
10036  __Pyx_RefNannyFinishContext();
10037  return __pyx_r;
10038 }
10039 
10040 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
10041  int __pyx_r;
10042  __Pyx_RefNannyDeclarations
10043  __Pyx_RefNannySetupContext("__init__", 0);
10044 
10045  /* "View.MemoryView":282
10046  * cdef object name
10047  * def __init__(self, name):
10048  * self.name = name # <<<<<<<<<<<<<<
10049  * def __repr__(self):
10050  * return self.name
10051  */
10052  __Pyx_INCREF(__pyx_v_name);
10053  __Pyx_GIVEREF(__pyx_v_name);
10054  __Pyx_GOTREF(__pyx_v_self->name);
10055  __Pyx_DECREF(__pyx_v_self->name);
10056  __pyx_v_self->name = __pyx_v_name;
10057 
10058  /* "View.MemoryView":281
10059  * cdef class Enum(object):
10060  * cdef object name
10061  * def __init__(self, name): # <<<<<<<<<<<<<<
10062  * self.name = name
10063  * def __repr__(self):
10064  */
10065 
10066  /* function exit code */
10067  __pyx_r = 0;
10068  __Pyx_RefNannyFinishContext();
10069  return __pyx_r;
10070 }
10071 
10072 /* "View.MemoryView":283
10073  * def __init__(self, name):
10074  * self.name = name
10075  * def __repr__(self): # <<<<<<<<<<<<<<
10076  * return self.name
10077  *
10078  */
10079 
10080 /* Python wrapper */
10081 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
10082 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
10083  PyObject *__pyx_r = 0;
10084  __Pyx_RefNannyDeclarations
10085  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
10086  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10087 
10088  /* function exit code */
10089  __Pyx_RefNannyFinishContext();
10090  return __pyx_r;
10091 }
10092 
10093 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10094  PyObject *__pyx_r = NULL;
10095  __Pyx_RefNannyDeclarations
10096  __Pyx_RefNannySetupContext("__repr__", 0);
10097 
10098  /* "View.MemoryView":284
10099  * self.name = name
10100  * def __repr__(self):
10101  * return self.name # <<<<<<<<<<<<<<
10102  *
10103  * cdef generic = Enum("<strided and direct or indirect>")
10104  */
10105  __Pyx_XDECREF(__pyx_r);
10106  __Pyx_INCREF(__pyx_v_self->name);
10107  __pyx_r = __pyx_v_self->name;
10108  goto __pyx_L0;
10109 
10110  /* "View.MemoryView":283
10111  * def __init__(self, name):
10112  * self.name = name
10113  * def __repr__(self): # <<<<<<<<<<<<<<
10114  * return self.name
10115  *
10116  */
10117 
10118  /* function exit code */
10119  __pyx_L0:;
10120  __Pyx_XGIVEREF(__pyx_r);
10121  __Pyx_RefNannyFinishContext();
10122  return __pyx_r;
10123 }
10124 
10125 /* "(tree fragment)":1
10126  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10127  * cdef tuple state
10128  * cdef object _dict
10129  */
10130 
10131 /* Python wrapper */
10132 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
10133 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10134  PyObject *__pyx_r = 0;
10135  __Pyx_RefNannyDeclarations
10136  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
10137  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10138 
10139  /* function exit code */
10140  __Pyx_RefNannyFinishContext();
10141  return __pyx_r;
10142 }
10143 
10144 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10145  PyObject *__pyx_v_state = 0;
10146  PyObject *__pyx_v__dict = 0;
10147  int __pyx_v_use_setstate;
10148  PyObject *__pyx_r = NULL;
10149  __Pyx_RefNannyDeclarations
10150  PyObject *__pyx_t_1 = NULL;
10151  int __pyx_t_2;
10152  int __pyx_t_3;
10153  PyObject *__pyx_t_4 = NULL;
10154  PyObject *__pyx_t_5 = NULL;
10155  int __pyx_lineno = 0;
10156  const char *__pyx_filename = NULL;
10157  int __pyx_clineno = 0;
10158  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
10159 
10160  /* "(tree fragment)":5
10161  * cdef object _dict
10162  * cdef bint use_setstate
10163  * state = (self.name,) # <<<<<<<<<<<<<<
10164  * _dict = getattr(self, '__dict__', None)
10165  * if _dict is not None:
10166  */
10167  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
10168  __Pyx_GOTREF(__pyx_t_1);
10169  __Pyx_INCREF(__pyx_v_self->name);
10170  __Pyx_GIVEREF(__pyx_v_self->name);
10171  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
10172  __pyx_v_state = ((PyObject*)__pyx_t_1);
10173  __pyx_t_1 = 0;
10174 
10175  /* "(tree fragment)":6
10176  * cdef bint use_setstate
10177  * state = (self.name,)
10178  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
10179  * if _dict is not None:
10180  * state += (_dict,)
10181  */
10182  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
10183  __Pyx_GOTREF(__pyx_t_1);
10184  __pyx_v__dict = __pyx_t_1;
10185  __pyx_t_1 = 0;
10186 
10187  /* "(tree fragment)":7
10188  * state = (self.name,)
10189  * _dict = getattr(self, '__dict__', None)
10190  * if _dict is not None: # <<<<<<<<<<<<<<
10191  * state += (_dict,)
10192  * use_setstate = True
10193  */
10194  __pyx_t_2 = (__pyx_v__dict != Py_None);
10195  __pyx_t_3 = (__pyx_t_2 != 0);
10196  if (__pyx_t_3) {
10197 
10198  /* "(tree fragment)":8
10199  * _dict = getattr(self, '__dict__', None)
10200  * if _dict is not None:
10201  * state += (_dict,) # <<<<<<<<<<<<<<
10202  * use_setstate = True
10203  * else:
10204  */
10205  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
10206  __Pyx_GOTREF(__pyx_t_1);
10207  __Pyx_INCREF(__pyx_v__dict);
10208  __Pyx_GIVEREF(__pyx_v__dict);
10209  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
10210  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
10211  __Pyx_GOTREF(__pyx_t_4);
10212  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10213  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
10214  __pyx_t_4 = 0;
10215 
10216  /* "(tree fragment)":9
10217  * if _dict is not None:
10218  * state += (_dict,)
10219  * use_setstate = True # <<<<<<<<<<<<<<
10220  * else:
10221  * use_setstate = self.name is not None
10222  */
10223  __pyx_v_use_setstate = 1;
10224 
10225  /* "(tree fragment)":7
10226  * state = (self.name,)
10227  * _dict = getattr(self, '__dict__', None)
10228  * if _dict is not None: # <<<<<<<<<<<<<<
10229  * state += (_dict,)
10230  * use_setstate = True
10231  */
10232  goto __pyx_L3;
10233  }
10234 
10235  /* "(tree fragment)":11
10236  * use_setstate = True
10237  * else:
10238  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
10239  * if use_setstate:
10240  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10241  */
10242  /*else*/ {
10243  __pyx_t_3 = (__pyx_v_self->name != Py_None);
10244  __pyx_v_use_setstate = __pyx_t_3;
10245  }
10246  __pyx_L3:;
10247 
10248  /* "(tree fragment)":12
10249  * else:
10250  * use_setstate = self.name is not None
10251  * if use_setstate: # <<<<<<<<<<<<<<
10252  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10253  * else:
10254  */
10255  __pyx_t_3 = (__pyx_v_use_setstate != 0);
10256  if (__pyx_t_3) {
10257 
10258  /* "(tree fragment)":13
10259  * use_setstate = self.name is not None
10260  * if use_setstate:
10261  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
10262  * else:
10263  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10264  */
10265  __Pyx_XDECREF(__pyx_r);
10266  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
10267  __Pyx_GOTREF(__pyx_t_4);
10268  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
10269  __Pyx_GOTREF(__pyx_t_1);
10270  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10271  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10272  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10273  __Pyx_INCREF(__pyx_int_184977713);
10274  __Pyx_GIVEREF(__pyx_int_184977713);
10275  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10276  __Pyx_INCREF(Py_None);
10277  __Pyx_GIVEREF(Py_None);
10278  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
10279  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
10280  __Pyx_GOTREF(__pyx_t_5);
10281  __Pyx_GIVEREF(__pyx_t_4);
10282  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
10283  __Pyx_GIVEREF(__pyx_t_1);
10284  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
10285  __Pyx_INCREF(__pyx_v_state);
10286  __Pyx_GIVEREF(__pyx_v_state);
10287  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
10288  __pyx_t_4 = 0;
10289  __pyx_t_1 = 0;
10290  __pyx_r = __pyx_t_5;
10291  __pyx_t_5 = 0;
10292  goto __pyx_L0;
10293 
10294  /* "(tree fragment)":12
10295  * else:
10296  * use_setstate = self.name is not None
10297  * if use_setstate: # <<<<<<<<<<<<<<
10298  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10299  * else:
10300  */
10301  }
10302 
10303  /* "(tree fragment)":15
10304  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
10305  * else:
10306  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
10307  * def __setstate_cython__(self, __pyx_state):
10308  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10309  */
10310  /*else*/ {
10311  __Pyx_XDECREF(__pyx_r);
10312  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
10313  __Pyx_GOTREF(__pyx_t_5);
10314  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
10315  __Pyx_GOTREF(__pyx_t_1);
10316  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10317  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10318  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10319  __Pyx_INCREF(__pyx_int_184977713);
10320  __Pyx_GIVEREF(__pyx_int_184977713);
10321  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10322  __Pyx_INCREF(__pyx_v_state);
10323  __Pyx_GIVEREF(__pyx_v_state);
10324  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
10325  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
10326  __Pyx_GOTREF(__pyx_t_4);
10327  __Pyx_GIVEREF(__pyx_t_5);
10328  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10329  __Pyx_GIVEREF(__pyx_t_1);
10330  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
10331  __pyx_t_5 = 0;
10332  __pyx_t_1 = 0;
10333  __pyx_r = __pyx_t_4;
10334  __pyx_t_4 = 0;
10335  goto __pyx_L0;
10336  }
10337 
10338  /* "(tree fragment)":1
10339  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10340  * cdef tuple state
10341  * cdef object _dict
10342  */
10343 
10344  /* function exit code */
10345  __pyx_L1_error:;
10346  __Pyx_XDECREF(__pyx_t_1);
10347  __Pyx_XDECREF(__pyx_t_4);
10348  __Pyx_XDECREF(__pyx_t_5);
10349  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10350  __pyx_r = NULL;
10351  __pyx_L0:;
10352  __Pyx_XDECREF(__pyx_v_state);
10353  __Pyx_XDECREF(__pyx_v__dict);
10354  __Pyx_XGIVEREF(__pyx_r);
10355  __Pyx_RefNannyFinishContext();
10356  return __pyx_r;
10357 }
10358 
10359 /* "(tree fragment)":16
10360  * else:
10361  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10362  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10363  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10364  */
10365 
10366 /* Python wrapper */
10367 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
10368 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10369  PyObject *__pyx_r = 0;
10370  __Pyx_RefNannyDeclarations
10371  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
10372  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10373 
10374  /* function exit code */
10375  __Pyx_RefNannyFinishContext();
10376  return __pyx_r;
10377 }
10378 
10379 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10380  PyObject *__pyx_r = NULL;
10381  __Pyx_RefNannyDeclarations
10382  PyObject *__pyx_t_1 = NULL;
10383  int __pyx_lineno = 0;
10384  const char *__pyx_filename = NULL;
10385  int __pyx_clineno = 0;
10386  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
10387 
10388  /* "(tree fragment)":17
10389  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10390  * def __setstate_cython__(self, __pyx_state):
10391  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
10392  */
10393  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
10394  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
10395  __Pyx_GOTREF(__pyx_t_1);
10396  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10397 
10398  /* "(tree fragment)":16
10399  * else:
10400  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10401  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10402  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10403  */
10404 
10405  /* function exit code */
10406  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10407  goto __pyx_L0;
10408  __pyx_L1_error:;
10409  __Pyx_XDECREF(__pyx_t_1);
10410  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10411  __pyx_r = NULL;
10412  __pyx_L0:;
10413  __Pyx_XGIVEREF(__pyx_r);
10414  __Pyx_RefNannyFinishContext();
10415  return __pyx_r;
10416 }
10417 
10418 /* "View.MemoryView":298
10419  *
10420  * @cname('__pyx_align_pointer')
10421  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
10422  * "Align pointer memory on a given boundary"
10423  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10424  */
10425 
10426 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
10427  Py_intptr_t __pyx_v_aligned_p;
10428  size_t __pyx_v_offset;
10429  void *__pyx_r;
10430  int __pyx_t_1;
10431 
10432  /* "View.MemoryView":300
10433  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
10434  * "Align pointer memory on a given boundary"
10435  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
10436  * cdef size_t offset
10437  *
10438  */
10439  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
10440 
10441  /* "View.MemoryView":304
10442  *
10443  * with cython.cdivision(True):
10444  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
10445  *
10446  * if offset > 0:
10447  */
10448  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
10449 
10450  /* "View.MemoryView":306
10451  * offset = aligned_p % alignment
10452  *
10453  * if offset > 0: # <<<<<<<<<<<<<<
10454  * aligned_p += alignment - offset
10455  *
10456  */
10457  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
10458  if (__pyx_t_1) {
10459 
10460  /* "View.MemoryView":307
10461  *
10462  * if offset > 0:
10463  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
10464  *
10465  * return <void *> aligned_p
10466  */
10467  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
10468 
10469  /* "View.MemoryView":306
10470  * offset = aligned_p % alignment
10471  *
10472  * if offset > 0: # <<<<<<<<<<<<<<
10473  * aligned_p += alignment - offset
10474  *
10475  */
10476  }
10477 
10478  /* "View.MemoryView":309
10479  * aligned_p += alignment - offset
10480  *
10481  * return <void *> aligned_p # <<<<<<<<<<<<<<
10482  *
10483  *
10484  */
10485  __pyx_r = ((void *)__pyx_v_aligned_p);
10486  goto __pyx_L0;
10487 
10488  /* "View.MemoryView":298
10489  *
10490  * @cname('__pyx_align_pointer')
10491  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
10492  * "Align pointer memory on a given boundary"
10493  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10494  */
10495 
10496  /* function exit code */
10497  __pyx_L0:;
10498  return __pyx_r;
10499 }
10500 
10501 /* "View.MemoryView":345
10502  * cdef __Pyx_TypeInfo *typeinfo
10503  *
10504  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
10505  * self.obj = obj
10506  * self.flags = flags
10507  */
10508 
10509 /* Python wrapper */
10510 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10511 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10512  PyObject *__pyx_v_obj = 0;
10513  int __pyx_v_flags;
10514  int __pyx_v_dtype_is_object;
10515  int __pyx_lineno = 0;
10516  const char *__pyx_filename = NULL;
10517  int __pyx_clineno = 0;
10518  int __pyx_r;
10519  __Pyx_RefNannyDeclarations
10520  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
10521  {
10522  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
10523  PyObject* values[3] = {0,0,0};
10524  if (unlikely(__pyx_kwds)) {
10525  Py_ssize_t kw_args;
10526  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10527  switch (pos_args) {
10528  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10529  CYTHON_FALLTHROUGH;
10530  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10531  CYTHON_FALLTHROUGH;
10532  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10533  CYTHON_FALLTHROUGH;
10534  case 0: break;
10535  default: goto __pyx_L5_argtuple_error;
10536  }
10537  kw_args = PyDict_Size(__pyx_kwds);
10538  switch (pos_args) {
10539  case 0:
10540  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
10541  else goto __pyx_L5_argtuple_error;
10542  CYTHON_FALLTHROUGH;
10543  case 1:
10544  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
10545  else {
10546  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
10547  }
10548  CYTHON_FALLTHROUGH;
10549  case 2:
10550  if (kw_args > 0) {
10551  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
10552  if (value) { values[2] = value; kw_args--; }
10553  }
10554  }
10555  if (unlikely(kw_args > 0)) {
10556  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
10557  }
10558  } else {
10559  switch (PyTuple_GET_SIZE(__pyx_args)) {
10560  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10561  CYTHON_FALLTHROUGH;
10562  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10563  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10564  break;
10565  default: goto __pyx_L5_argtuple_error;
10566  }
10567  }
10568  __pyx_v_obj = values[0];
10569  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
10570  if (values[2]) {
10571  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
10572  } else {
10573  __pyx_v_dtype_is_object = ((int)0);
10574  }
10575  }
10576  goto __pyx_L4_argument_unpacking_done;
10577  __pyx_L5_argtuple_error:;
10578  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
10579  __pyx_L3_error:;
10580  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10581  __Pyx_RefNannyFinishContext();
10582  return -1;
10583  __pyx_L4_argument_unpacking_done:;
10584  __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);
10585 
10586  /* function exit code */
10587  __Pyx_RefNannyFinishContext();
10588  return __pyx_r;
10589 }
10590 
10591 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) {
10592  int __pyx_r;
10593  __Pyx_RefNannyDeclarations
10594  int __pyx_t_1;
10595  int __pyx_t_2;
10596  int __pyx_t_3;
10597  int __pyx_t_4;
10598  int __pyx_lineno = 0;
10599  const char *__pyx_filename = NULL;
10600  int __pyx_clineno = 0;
10601  __Pyx_RefNannySetupContext("__cinit__", 0);
10602 
10603  /* "View.MemoryView":346
10604  *
10605  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10606  * self.obj = obj # <<<<<<<<<<<<<<
10607  * self.flags = flags
10608  * if type(self) is memoryview or obj is not None:
10609  */
10610  __Pyx_INCREF(__pyx_v_obj);
10611  __Pyx_GIVEREF(__pyx_v_obj);
10612  __Pyx_GOTREF(__pyx_v_self->obj);
10613  __Pyx_DECREF(__pyx_v_self->obj);
10614  __pyx_v_self->obj = __pyx_v_obj;
10615 
10616  /* "View.MemoryView":347
10617  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10618  * self.obj = obj
10619  * self.flags = flags # <<<<<<<<<<<<<<
10620  * if type(self) is memoryview or obj is not None:
10621  * __Pyx_GetBuffer(obj, &self.view, flags)
10622  */
10623  __pyx_v_self->flags = __pyx_v_flags;
10624 
10625  /* "View.MemoryView":348
10626  * self.obj = obj
10627  * self.flags = flags
10628  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
10629  * __Pyx_GetBuffer(obj, &self.view, flags)
10630  * if <PyObject *> self.view.obj == NULL:
10631  */
10632  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
10633  __pyx_t_3 = (__pyx_t_2 != 0);
10634  if (!__pyx_t_3) {
10635  } else {
10636  __pyx_t_1 = __pyx_t_3;
10637  goto __pyx_L4_bool_binop_done;
10638  }
10639  __pyx_t_3 = (__pyx_v_obj != Py_None);
10640  __pyx_t_2 = (__pyx_t_3 != 0);
10641  __pyx_t_1 = __pyx_t_2;
10642  __pyx_L4_bool_binop_done:;
10643  if (__pyx_t_1) {
10644 
10645  /* "View.MemoryView":349
10646  * self.flags = flags
10647  * if type(self) is memoryview or obj is not None:
10648  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
10649  * if <PyObject *> self.view.obj == NULL:
10650  * (<__pyx_buffer *> &self.view).obj = Py_None
10651  */
10652  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
10653 
10654  /* "View.MemoryView":350
10655  * if type(self) is memoryview or obj is not None:
10656  * __Pyx_GetBuffer(obj, &self.view, flags)
10657  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
10658  * (<__pyx_buffer *> &self.view).obj = Py_None
10659  * Py_INCREF(Py_None)
10660  */
10661  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
10662  if (__pyx_t_1) {
10663 
10664  /* "View.MemoryView":351
10665  * __Pyx_GetBuffer(obj, &self.view, flags)
10666  * if <PyObject *> self.view.obj == NULL:
10667  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
10668  * Py_INCREF(Py_None)
10669  *
10670  */
10671  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
10672 
10673  /* "View.MemoryView":352
10674  * if <PyObject *> self.view.obj == NULL:
10675  * (<__pyx_buffer *> &self.view).obj = Py_None
10676  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
10677  *
10678  * global __pyx_memoryview_thread_locks_used
10679  */
10680  Py_INCREF(Py_None);
10681 
10682  /* "View.MemoryView":350
10683  * if type(self) is memoryview or obj is not None:
10684  * __Pyx_GetBuffer(obj, &self.view, flags)
10685  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
10686  * (<__pyx_buffer *> &self.view).obj = Py_None
10687  * Py_INCREF(Py_None)
10688  */
10689  }
10690 
10691  /* "View.MemoryView":348
10692  * self.obj = obj
10693  * self.flags = flags
10694  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
10695  * __Pyx_GetBuffer(obj, &self.view, flags)
10696  * if <PyObject *> self.view.obj == NULL:
10697  */
10698  }
10699 
10700  /* "View.MemoryView":355
10701  *
10702  * global __pyx_memoryview_thread_locks_used
10703  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
10704  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10705  * __pyx_memoryview_thread_locks_used += 1
10706  */
10707  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
10708  if (__pyx_t_1) {
10709 
10710  /* "View.MemoryView":356
10711  * global __pyx_memoryview_thread_locks_used
10712  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10713  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
10714  * __pyx_memoryview_thread_locks_used += 1
10715  * if self.lock is NULL:
10716  */
10717  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10718 
10719  /* "View.MemoryView":357
10720  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10721  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10722  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
10723  * if self.lock is NULL:
10724  * self.lock = PyThread_allocate_lock()
10725  */
10726  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
10727 
10728  /* "View.MemoryView":355
10729  *
10730  * global __pyx_memoryview_thread_locks_used
10731  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
10732  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10733  * __pyx_memoryview_thread_locks_used += 1
10734  */
10735  }
10736 
10737  /* "View.MemoryView":358
10738  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10739  * __pyx_memoryview_thread_locks_used += 1
10740  * if self.lock is NULL: # <<<<<<<<<<<<<<
10741  * self.lock = PyThread_allocate_lock()
10742  * if self.lock is NULL:
10743  */
10744  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10745  if (__pyx_t_1) {
10746 
10747  /* "View.MemoryView":359
10748  * __pyx_memoryview_thread_locks_used += 1
10749  * if self.lock is NULL:
10750  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
10751  * if self.lock is NULL:
10752  * raise MemoryError
10753  */
10754  __pyx_v_self->lock = PyThread_allocate_lock();
10755 
10756  /* "View.MemoryView":360
10757  * if self.lock is NULL:
10758  * self.lock = PyThread_allocate_lock()
10759  * if self.lock is NULL: # <<<<<<<<<<<<<<
10760  * raise MemoryError
10761  *
10762  */
10763  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10764  if (unlikely(__pyx_t_1)) {
10765 
10766  /* "View.MemoryView":361
10767  * self.lock = PyThread_allocate_lock()
10768  * if self.lock is NULL:
10769  * raise MemoryError # <<<<<<<<<<<<<<
10770  *
10771  * if flags & PyBUF_FORMAT:
10772  */
10773  PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
10774 
10775  /* "View.MemoryView":360
10776  * if self.lock is NULL:
10777  * self.lock = PyThread_allocate_lock()
10778  * if self.lock is NULL: # <<<<<<<<<<<<<<
10779  * raise MemoryError
10780  *
10781  */
10782  }
10783 
10784  /* "View.MemoryView":358
10785  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10786  * __pyx_memoryview_thread_locks_used += 1
10787  * if self.lock is NULL: # <<<<<<<<<<<<<<
10788  * self.lock = PyThread_allocate_lock()
10789  * if self.lock is NULL:
10790  */
10791  }
10792 
10793  /* "View.MemoryView":363
10794  * raise MemoryError
10795  *
10796  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10797  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10798  * else:
10799  */
10800  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10801  if (__pyx_t_1) {
10802 
10803  /* "View.MemoryView":364
10804  *
10805  * if flags & PyBUF_FORMAT:
10806  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
10807  * else:
10808  * self.dtype_is_object = dtype_is_object
10809  */
10810  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
10811  if (__pyx_t_2) {
10812  } else {
10813  __pyx_t_1 = __pyx_t_2;
10814  goto __pyx_L11_bool_binop_done;
10815  }
10816  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
10817  __pyx_t_1 = __pyx_t_2;
10818  __pyx_L11_bool_binop_done:;
10819  __pyx_v_self->dtype_is_object = __pyx_t_1;
10820 
10821  /* "View.MemoryView":363
10822  * raise MemoryError
10823  *
10824  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10825  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10826  * else:
10827  */
10828  goto __pyx_L10;
10829  }
10830 
10831  /* "View.MemoryView":366
10832  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10833  * else:
10834  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
10835  *
10836  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
10837  */
10838  /*else*/ {
10839  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
10840  }
10841  __pyx_L10:;
10842 
10843  /* "View.MemoryView":368
10844  * self.dtype_is_object = dtype_is_object
10845  *
10846  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
10847  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
10848  * self.typeinfo = NULL
10849  */
10850  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
10851 
10852  /* "View.MemoryView":370
10853  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
10854  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
10855  * self.typeinfo = NULL # <<<<<<<<<<<<<<
10856  *
10857  * def __dealloc__(memoryview self):
10858  */
10859  __pyx_v_self->typeinfo = NULL;
10860 
10861  /* "View.MemoryView":345
10862  * cdef __Pyx_TypeInfo *typeinfo
10863  *
10864  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
10865  * self.obj = obj
10866  * self.flags = flags
10867  */
10868 
10869  /* function exit code */
10870  __pyx_r = 0;
10871  goto __pyx_L0;
10872  __pyx_L1_error:;
10873  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10874  __pyx_r = -1;
10875  __pyx_L0:;
10876  __Pyx_RefNannyFinishContext();
10877  return __pyx_r;
10878 }
10879 
10880 /* "View.MemoryView":372
10881  * self.typeinfo = NULL
10882  *
10883  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
10884  * if self.obj is not None:
10885  * __Pyx_ReleaseBuffer(&self.view)
10886  */
10887 
10888 /* Python wrapper */
10889 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
10890 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
10891  __Pyx_RefNannyDeclarations
10892  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
10893  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10894 
10895  /* function exit code */
10896  __Pyx_RefNannyFinishContext();
10897 }
10898 
10899 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
10900  int __pyx_v_i;
10901  __Pyx_RefNannyDeclarations
10902  int __pyx_t_1;
10903  int __pyx_t_2;
10904  int __pyx_t_3;
10905  int __pyx_t_4;
10906  int __pyx_t_5;
10907  PyThread_type_lock __pyx_t_6;
10908  PyThread_type_lock __pyx_t_7;
10909  __Pyx_RefNannySetupContext("__dealloc__", 0);
10910 
10911  /* "View.MemoryView":373
10912  *
10913  * def __dealloc__(memoryview self):
10914  * if self.obj is not None: # <<<<<<<<<<<<<<
10915  * __Pyx_ReleaseBuffer(&self.view)
10916  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10917  */
10918  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
10919  __pyx_t_2 = (__pyx_t_1 != 0);
10920  if (__pyx_t_2) {
10921 
10922  /* "View.MemoryView":374
10923  * def __dealloc__(memoryview self):
10924  * if self.obj is not None:
10925  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
10926  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10927  *
10928  */
10929  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
10930 
10931  /* "View.MemoryView":373
10932  *
10933  * def __dealloc__(memoryview self):
10934  * if self.obj is not None: # <<<<<<<<<<<<<<
10935  * __Pyx_ReleaseBuffer(&self.view)
10936  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10937  */
10938  goto __pyx_L3;
10939  }
10940 
10941  /* "View.MemoryView":375
10942  * if self.obj is not None:
10943  * __Pyx_ReleaseBuffer(&self.view)
10944  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
10945  *
10946  * (<__pyx_buffer *> &self.view).obj = NULL
10947  */
10948  __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
10949  if (__pyx_t_2) {
10950 
10951  /* "View.MemoryView":377
10952  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
10953  *
10954  * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
10955  * Py_DECREF(Py_None)
10956  *
10957  */
10958  ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
10959 
10960  /* "View.MemoryView":378
10961  *
10962  * (<__pyx_buffer *> &self.view).obj = NULL
10963  * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
10964  *
10965  * cdef int i
10966  */
10967  Py_DECREF(Py_None);
10968 
10969  /* "View.MemoryView":375
10970  * if self.obj is not None:
10971  * __Pyx_ReleaseBuffer(&self.view)
10972  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
10973  *
10974  * (<__pyx_buffer *> &self.view).obj = NULL
10975  */
10976  }
10977  __pyx_L3:;
10978 
10979  /* "View.MemoryView":382
10980  * cdef int i
10981  * global __pyx_memoryview_thread_locks_used
10982  * if self.lock != NULL: # <<<<<<<<<<<<<<
10983  * for i in range(__pyx_memoryview_thread_locks_used):
10984  * if __pyx_memoryview_thread_locks[i] is self.lock:
10985  */
10986  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
10987  if (__pyx_t_2) {
10988 
10989  /* "View.MemoryView":383
10990  * global __pyx_memoryview_thread_locks_used
10991  * if self.lock != NULL:
10992  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
10993  * if __pyx_memoryview_thread_locks[i] is self.lock:
10994  * __pyx_memoryview_thread_locks_used -= 1
10995  */
10996  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
10997  __pyx_t_4 = __pyx_t_3;
10998  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
10999  __pyx_v_i = __pyx_t_5;
11000 
11001  /* "View.MemoryView":384
11002  * if self.lock != NULL:
11003  * for i in range(__pyx_memoryview_thread_locks_used):
11004  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
11005  * __pyx_memoryview_thread_locks_used -= 1
11006  * if i != __pyx_memoryview_thread_locks_used:
11007  */
11008  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
11009  if (__pyx_t_2) {
11010 
11011  /* "View.MemoryView":385
11012  * for i in range(__pyx_memoryview_thread_locks_used):
11013  * if __pyx_memoryview_thread_locks[i] is self.lock:
11014  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
11015  * if i != __pyx_memoryview_thread_locks_used:
11016  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11017  */
11018  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
11019 
11020  /* "View.MemoryView":386
11021  * if __pyx_memoryview_thread_locks[i] is self.lock:
11022  * __pyx_memoryview_thread_locks_used -= 1
11023  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
11024  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11025  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11026  */
11027  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
11028  if (__pyx_t_2) {
11029 
11030  /* "View.MemoryView":388
11031  * if i != __pyx_memoryview_thread_locks_used:
11032  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11033  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
11034  * break
11035  * else:
11036  */
11037  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
11038  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
11039 
11040  /* "View.MemoryView":387
11041  * __pyx_memoryview_thread_locks_used -= 1
11042  * if i != __pyx_memoryview_thread_locks_used:
11043  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
11044  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11045  * break
11046  */
11047  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
11048  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
11049 
11050  /* "View.MemoryView":386
11051  * if __pyx_memoryview_thread_locks[i] is self.lock:
11052  * __pyx_memoryview_thread_locks_used -= 1
11053  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
11054  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11055  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11056  */
11057  }
11058 
11059  /* "View.MemoryView":389
11060  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
11061  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
11062  * break # <<<<<<<<<<<<<<
11063  * else:
11064  * PyThread_free_lock(self.lock)
11065  */
11066  goto __pyx_L6_break;
11067 
11068  /* "View.MemoryView":384
11069  * if self.lock != NULL:
11070  * for i in range(__pyx_memoryview_thread_locks_used):
11071  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
11072  * __pyx_memoryview_thread_locks_used -= 1
11073  * if i != __pyx_memoryview_thread_locks_used:
11074  */
11075  }
11076  }
11077  /*else*/ {
11078 
11079  /* "View.MemoryView":391
11080  * break
11081  * else:
11082  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
11083  *
11084  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
11085  */
11086  PyThread_free_lock(__pyx_v_self->lock);
11087  }
11088  __pyx_L6_break:;
11089 
11090  /* "View.MemoryView":382
11091  * cdef int i
11092  * global __pyx_memoryview_thread_locks_used
11093  * if self.lock != NULL: # <<<<<<<<<<<<<<
11094  * for i in range(__pyx_memoryview_thread_locks_used):
11095  * if __pyx_memoryview_thread_locks[i] is self.lock:
11096  */
11097  }
11098 
11099  /* "View.MemoryView":372
11100  * self.typeinfo = NULL
11101  *
11102  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
11103  * if self.obj is not None:
11104  * __Pyx_ReleaseBuffer(&self.view)
11105  */
11106 
11107  /* function exit code */
11108  __Pyx_RefNannyFinishContext();
11109 }
11110 
11111 /* "View.MemoryView":393
11112  * PyThread_free_lock(self.lock)
11113  *
11114  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
11115  * cdef Py_ssize_t dim
11116  * cdef char *itemp = <char *> self.view.buf
11117  */
11118 
11119 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11120  Py_ssize_t __pyx_v_dim;
11121  char *__pyx_v_itemp;
11122  PyObject *__pyx_v_idx = NULL;
11123  char *__pyx_r;
11124  __Pyx_RefNannyDeclarations
11125  Py_ssize_t __pyx_t_1;
11126  PyObject *__pyx_t_2 = NULL;
11127  Py_ssize_t __pyx_t_3;
11128  PyObject *(*__pyx_t_4)(PyObject *);
11129  PyObject *__pyx_t_5 = NULL;
11130  Py_ssize_t __pyx_t_6;
11131  char *__pyx_t_7;
11132  int __pyx_lineno = 0;
11133  const char *__pyx_filename = NULL;
11134  int __pyx_clineno = 0;
11135  __Pyx_RefNannySetupContext("get_item_pointer", 0);
11136 
11137  /* "View.MemoryView":395
11138  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
11139  * cdef Py_ssize_t dim
11140  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
11141  *
11142  * for dim, idx in enumerate(index):
11143  */
11144  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
11145 
11146  /* "View.MemoryView":397
11147  * cdef char *itemp = <char *> self.view.buf
11148  *
11149  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
11150  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11151  *
11152  */
11153  __pyx_t_1 = 0;
11154  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
11155  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
11156  __pyx_t_4 = NULL;
11157  } else {
11158  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
11159  __Pyx_GOTREF(__pyx_t_2);
11160  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
11161  }
11162  for (;;) {
11163  if (likely(!__pyx_t_4)) {
11164  if (likely(PyList_CheckExact(__pyx_t_2))) {
11165  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
11166  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11167  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
11168  #else
11169  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
11170  __Pyx_GOTREF(__pyx_t_5);
11171  #endif
11172  } else {
11173  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
11174  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11175  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
11176  #else
11177  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
11178  __Pyx_GOTREF(__pyx_t_5);
11179  #endif
11180  }
11181  } else {
11182  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
11183  if (unlikely(!__pyx_t_5)) {
11184  PyObject* exc_type = PyErr_Occurred();
11185  if (exc_type) {
11186  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11187  else __PYX_ERR(1, 397, __pyx_L1_error)
11188  }
11189  break;
11190  }
11191  __Pyx_GOTREF(__pyx_t_5);
11192  }
11193  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
11194  __pyx_t_5 = 0;
11195  __pyx_v_dim = __pyx_t_1;
11196  __pyx_t_1 = (__pyx_t_1 + 1);
11197 
11198  /* "View.MemoryView":398
11199  *
11200  * for dim, idx in enumerate(index):
11201  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
11202  *
11203  * return itemp
11204  */
11205  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error)
11206  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 398, __pyx_L1_error)
11207  __pyx_v_itemp = __pyx_t_7;
11208 
11209  /* "View.MemoryView":397
11210  * cdef char *itemp = <char *> self.view.buf
11211  *
11212  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
11213  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11214  *
11215  */
11216  }
11217  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11218 
11219  /* "View.MemoryView":400
11220  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
11221  *
11222  * return itemp # <<<<<<<<<<<<<<
11223  *
11224  *
11225  */
11226  __pyx_r = __pyx_v_itemp;
11227  goto __pyx_L0;
11228 
11229  /* "View.MemoryView":393
11230  * PyThread_free_lock(self.lock)
11231  *
11232  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
11233  * cdef Py_ssize_t dim
11234  * cdef char *itemp = <char *> self.view.buf
11235  */
11236 
11237  /* function exit code */
11238  __pyx_L1_error:;
11239  __Pyx_XDECREF(__pyx_t_2);
11240  __Pyx_XDECREF(__pyx_t_5);
11241  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
11242  __pyx_r = NULL;
11243  __pyx_L0:;
11244  __Pyx_XDECREF(__pyx_v_idx);
11245  __Pyx_RefNannyFinishContext();
11246  return __pyx_r;
11247 }
11248 
11249 /* "View.MemoryView":403
11250  *
11251  *
11252  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
11253  * if index is Ellipsis:
11254  * return self
11255  */
11256 
11257 /* Python wrapper */
11258 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
11259 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
11260  PyObject *__pyx_r = 0;
11261  __Pyx_RefNannyDeclarations
11262  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
11263  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
11264 
11265  /* function exit code */
11266  __Pyx_RefNannyFinishContext();
11267  return __pyx_r;
11268 }
11269 
11270 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11271  PyObject *__pyx_v_have_slices = NULL;
11272  PyObject *__pyx_v_indices = NULL;
11273  char *__pyx_v_itemp;
11274  PyObject *__pyx_r = NULL;
11275  __Pyx_RefNannyDeclarations
11276  int __pyx_t_1;
11277  int __pyx_t_2;
11278  PyObject *__pyx_t_3 = NULL;
11279  PyObject *__pyx_t_4 = NULL;
11280  PyObject *__pyx_t_5 = NULL;
11281  char *__pyx_t_6;
11282  int __pyx_lineno = 0;
11283  const char *__pyx_filename = NULL;
11284  int __pyx_clineno = 0;
11285  __Pyx_RefNannySetupContext("__getitem__", 0);
11286 
11287  /* "View.MemoryView":404
11288  *
11289  * def __getitem__(memoryview self, object index):
11290  * if index is Ellipsis: # <<<<<<<<<<<<<<
11291  * return self
11292  *
11293  */
11294  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
11295  __pyx_t_2 = (__pyx_t_1 != 0);
11296  if (__pyx_t_2) {
11297 
11298  /* "View.MemoryView":405
11299  * def __getitem__(memoryview self, object index):
11300  * if index is Ellipsis:
11301  * return self # <<<<<<<<<<<<<<
11302  *
11303  * have_slices, indices = _unellipsify(index, self.view.ndim)
11304  */
11305  __Pyx_XDECREF(__pyx_r);
11306  __Pyx_INCREF(((PyObject *)__pyx_v_self));
11307  __pyx_r = ((PyObject *)__pyx_v_self);
11308  goto __pyx_L0;
11309 
11310  /* "View.MemoryView":404
11311  *
11312  * def __getitem__(memoryview self, object index):
11313  * if index is Ellipsis: # <<<<<<<<<<<<<<
11314  * return self
11315  *
11316  */
11317  }
11318 
11319  /* "View.MemoryView":407
11320  * return self
11321  *
11322  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
11323  *
11324  * cdef char *itemp
11325  */
11326  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
11327  __Pyx_GOTREF(__pyx_t_3);
11328  if (likely(__pyx_t_3 != Py_None)) {
11329  PyObject* sequence = __pyx_t_3;
11330  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11331  if (unlikely(size != 2)) {
11332  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11333  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11334  __PYX_ERR(1, 407, __pyx_L1_error)
11335  }
11336  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11337  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
11338  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
11339  __Pyx_INCREF(__pyx_t_4);
11340  __Pyx_INCREF(__pyx_t_5);
11341  #else
11342  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error)
11343  __Pyx_GOTREF(__pyx_t_4);
11344  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error)
11345  __Pyx_GOTREF(__pyx_t_5);
11346  #endif
11347  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11348  } else {
11349  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error)
11350  }
11351  __pyx_v_have_slices = __pyx_t_4;
11352  __pyx_t_4 = 0;
11353  __pyx_v_indices = __pyx_t_5;
11354  __pyx_t_5 = 0;
11355 
11356  /* "View.MemoryView":410
11357  *
11358  * cdef char *itemp
11359  * if have_slices: # <<<<<<<<<<<<<<
11360  * return memview_slice(self, indices)
11361  * else:
11362  */
11363  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error)
11364  if (__pyx_t_2) {
11365 
11366  /* "View.MemoryView":411
11367  * cdef char *itemp
11368  * if have_slices:
11369  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
11370  * else:
11371  * itemp = self.get_item_pointer(indices)
11372  */
11373  __Pyx_XDECREF(__pyx_r);
11374  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
11375  __Pyx_GOTREF(__pyx_t_3);
11376  __pyx_r = __pyx_t_3;
11377  __pyx_t_3 = 0;
11378  goto __pyx_L0;
11379 
11380  /* "View.MemoryView":410
11381  *
11382  * cdef char *itemp
11383  * if have_slices: # <<<<<<<<<<<<<<
11384  * return memview_slice(self, indices)
11385  * else:
11386  */
11387  }
11388 
11389  /* "View.MemoryView":413
11390  * return memview_slice(self, indices)
11391  * else:
11392  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
11393  * return self.convert_item_to_object(itemp)
11394  *
11395  */
11396  /*else*/ {
11397  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 413, __pyx_L1_error)
11398  __pyx_v_itemp = __pyx_t_6;
11399 
11400  /* "View.MemoryView":414
11401  * else:
11402  * itemp = self.get_item_pointer(indices)
11403  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
11404  *
11405  * def __setitem__(memoryview self, object index, object value):
11406  */
11407  __Pyx_XDECREF(__pyx_r);
11408  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error)
11409  __Pyx_GOTREF(__pyx_t_3);
11410  __pyx_r = __pyx_t_3;
11411  __pyx_t_3 = 0;
11412  goto __pyx_L0;
11413  }
11414 
11415  /* "View.MemoryView":403
11416  *
11417  *
11418  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
11419  * if index is Ellipsis:
11420  * return self
11421  */
11422 
11423  /* function exit code */
11424  __pyx_L1_error:;
11425  __Pyx_XDECREF(__pyx_t_3);
11426  __Pyx_XDECREF(__pyx_t_4);
11427  __Pyx_XDECREF(__pyx_t_5);
11428  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11429  __pyx_r = NULL;
11430  __pyx_L0:;
11431  __Pyx_XDECREF(__pyx_v_have_slices);
11432  __Pyx_XDECREF(__pyx_v_indices);
11433  __Pyx_XGIVEREF(__pyx_r);
11434  __Pyx_RefNannyFinishContext();
11435  return __pyx_r;
11436 }
11437 
11438 /* "View.MemoryView":416
11439  * return self.convert_item_to_object(itemp)
11440  *
11441  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
11442  * if self.view.readonly:
11443  * raise TypeError("Cannot assign to read-only memoryview")
11444  */
11445 
11446 /* Python wrapper */
11447 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
11448 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11449  int __pyx_r;
11450  __Pyx_RefNannyDeclarations
11451  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
11452  __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));
11453 
11454  /* function exit code */
11455  __Pyx_RefNannyFinishContext();
11456  return __pyx_r;
11457 }
11458 
11459 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) {
11460  PyObject *__pyx_v_have_slices = NULL;
11461  PyObject *__pyx_v_obj = NULL;
11462  int __pyx_r;
11463  __Pyx_RefNannyDeclarations
11464  int __pyx_t_1;
11465  PyObject *__pyx_t_2 = NULL;
11466  PyObject *__pyx_t_3 = NULL;
11467  PyObject *__pyx_t_4 = NULL;
11468  int __pyx_lineno = 0;
11469  const char *__pyx_filename = NULL;
11470  int __pyx_clineno = 0;
11471  __Pyx_RefNannySetupContext("__setitem__", 0);
11472  __Pyx_INCREF(__pyx_v_index);
11473 
11474  /* "View.MemoryView":417
11475  *
11476  * def __setitem__(memoryview self, object index, object value):
11477  * if self.view.readonly: # <<<<<<<<<<<<<<
11478  * raise TypeError("Cannot assign to read-only memoryview")
11479  *
11480  */
11481  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
11482  if (unlikely(__pyx_t_1)) {
11483 
11484  /* "View.MemoryView":418
11485  * def __setitem__(memoryview self, object index, object value):
11486  * if self.view.readonly:
11487  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
11488  *
11489  * have_slices, index = _unellipsify(index, self.view.ndim)
11490  */
11491  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
11492  __Pyx_GOTREF(__pyx_t_2);
11493  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11494  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11495  __PYX_ERR(1, 418, __pyx_L1_error)
11496 
11497  /* "View.MemoryView":417
11498  *
11499  * def __setitem__(memoryview self, object index, object value):
11500  * if self.view.readonly: # <<<<<<<<<<<<<<
11501  * raise TypeError("Cannot assign to read-only memoryview")
11502  *
11503  */
11504  }
11505 
11506  /* "View.MemoryView":420
11507  * raise TypeError("Cannot assign to read-only memoryview")
11508  *
11509  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
11510  *
11511  * if have_slices:
11512  */
11513  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
11514  __Pyx_GOTREF(__pyx_t_2);
11515  if (likely(__pyx_t_2 != Py_None)) {
11516  PyObject* sequence = __pyx_t_2;
11517  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11518  if (unlikely(size != 2)) {
11519  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11520  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11521  __PYX_ERR(1, 420, __pyx_L1_error)
11522  }
11523  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11524  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
11525  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
11526  __Pyx_INCREF(__pyx_t_3);
11527  __Pyx_INCREF(__pyx_t_4);
11528  #else
11529  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error)
11530  __Pyx_GOTREF(__pyx_t_3);
11531  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
11532  __Pyx_GOTREF(__pyx_t_4);
11533  #endif
11534  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11535  } else {
11536  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error)
11537  }
11538  __pyx_v_have_slices = __pyx_t_3;
11539  __pyx_t_3 = 0;
11540  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
11541  __pyx_t_4 = 0;
11542 
11543  /* "View.MemoryView":422
11544  * have_slices, index = _unellipsify(index, self.view.ndim)
11545  *
11546  * if have_slices: # <<<<<<<<<<<<<<
11547  * obj = self.is_slice(value)
11548  * if obj:
11549  */
11550  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error)
11551  if (__pyx_t_1) {
11552 
11553  /* "View.MemoryView":423
11554  *
11555  * if have_slices:
11556  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
11557  * if obj:
11558  * self.setitem_slice_assignment(self[index], obj)
11559  */
11560  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
11561  __Pyx_GOTREF(__pyx_t_2);
11562  __pyx_v_obj = __pyx_t_2;
11563  __pyx_t_2 = 0;
11564 
11565  /* "View.MemoryView":424
11566  * if have_slices:
11567  * obj = self.is_slice(value)
11568  * if obj: # <<<<<<<<<<<<<<
11569  * self.setitem_slice_assignment(self[index], obj)
11570  * else:
11571  */
11572  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
11573  if (__pyx_t_1) {
11574 
11575  /* "View.MemoryView":425
11576  * obj = self.is_slice(value)
11577  * if obj:
11578  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
11579  * else:
11580  * self.setitem_slice_assign_scalar(self[index], value)
11581  */
11582  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
11583  __Pyx_GOTREF(__pyx_t_2);
11584  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 425, __pyx_L1_error)
11585  __Pyx_GOTREF(__pyx_t_4);
11586  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11587  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11588 
11589  /* "View.MemoryView":424
11590  * if have_slices:
11591  * obj = self.is_slice(value)
11592  * if obj: # <<<<<<<<<<<<<<
11593  * self.setitem_slice_assignment(self[index], obj)
11594  * else:
11595  */
11596  goto __pyx_L5;
11597  }
11598 
11599  /* "View.MemoryView":427
11600  * self.setitem_slice_assignment(self[index], obj)
11601  * else:
11602  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
11603  * else:
11604  * self.setitem_indexed(index, value)
11605  */
11606  /*else*/ {
11607  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
11608  __Pyx_GOTREF(__pyx_t_4);
11609  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error)
11610  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
11611  __Pyx_GOTREF(__pyx_t_2);
11612  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11613  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11614  }
11615  __pyx_L5:;
11616 
11617  /* "View.MemoryView":422
11618  * have_slices, index = _unellipsify(index, self.view.ndim)
11619  *
11620  * if have_slices: # <<<<<<<<<<<<<<
11621  * obj = self.is_slice(value)
11622  * if obj:
11623  */
11624  goto __pyx_L4;
11625  }
11626 
11627  /* "View.MemoryView":429
11628  * self.setitem_slice_assign_scalar(self[index], value)
11629  * else:
11630  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
11631  *
11632  * cdef is_slice(self, obj):
11633  */
11634  /*else*/ {
11635  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
11636  __Pyx_GOTREF(__pyx_t_2);
11637  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11638  }
11639  __pyx_L4:;
11640 
11641  /* "View.MemoryView":416
11642  * return self.convert_item_to_object(itemp)
11643  *
11644  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
11645  * if self.view.readonly:
11646  * raise TypeError("Cannot assign to read-only memoryview")
11647  */
11648 
11649  /* function exit code */
11650  __pyx_r = 0;
11651  goto __pyx_L0;
11652  __pyx_L1_error:;
11653  __Pyx_XDECREF(__pyx_t_2);
11654  __Pyx_XDECREF(__pyx_t_3);
11655  __Pyx_XDECREF(__pyx_t_4);
11656  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11657  __pyx_r = -1;
11658  __pyx_L0:;
11659  __Pyx_XDECREF(__pyx_v_have_slices);
11660  __Pyx_XDECREF(__pyx_v_obj);
11661  __Pyx_XDECREF(__pyx_v_index);
11662  __Pyx_RefNannyFinishContext();
11663  return __pyx_r;
11664 }
11665 
11666 /* "View.MemoryView":431
11667  * self.setitem_indexed(index, value)
11668  *
11669  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
11670  * if not isinstance(obj, memoryview):
11671  * try:
11672  */
11673 
11674 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
11675  PyObject *__pyx_r = NULL;
11676  __Pyx_RefNannyDeclarations
11677  int __pyx_t_1;
11678  int __pyx_t_2;
11679  PyObject *__pyx_t_3 = NULL;
11680  PyObject *__pyx_t_4 = NULL;
11681  PyObject *__pyx_t_5 = NULL;
11682  PyObject *__pyx_t_6 = NULL;
11683  PyObject *__pyx_t_7 = NULL;
11684  PyObject *__pyx_t_8 = NULL;
11685  int __pyx_t_9;
11686  int __pyx_lineno = 0;
11687  const char *__pyx_filename = NULL;
11688  int __pyx_clineno = 0;
11689  __Pyx_RefNannySetupContext("is_slice", 0);
11690  __Pyx_INCREF(__pyx_v_obj);
11691 
11692  /* "View.MemoryView":432
11693  *
11694  * cdef is_slice(self, obj):
11695  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
11696  * try:
11697  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11698  */
11699  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
11700  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
11701  if (__pyx_t_2) {
11702 
11703  /* "View.MemoryView":433
11704  * cdef is_slice(self, obj):
11705  * if not isinstance(obj, memoryview):
11706  * try: # <<<<<<<<<<<<<<
11707  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11708  * self.dtype_is_object)
11709  */
11710  {
11711  __Pyx_PyThreadState_declare
11712  __Pyx_PyThreadState_assign
11713  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
11714  __Pyx_XGOTREF(__pyx_t_3);
11715  __Pyx_XGOTREF(__pyx_t_4);
11716  __Pyx_XGOTREF(__pyx_t_5);
11717  /*try:*/ {
11718 
11719  /* "View.MemoryView":434
11720  * if not isinstance(obj, memoryview):
11721  * try:
11722  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
11723  * self.dtype_is_object)
11724  * except TypeError:
11725  */
11726  __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error)
11727  __Pyx_GOTREF(__pyx_t_6);
11728 
11729  /* "View.MemoryView":435
11730  * try:
11731  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11732  * self.dtype_is_object) # <<<<<<<<<<<<<<
11733  * except TypeError:
11734  * return None
11735  */
11736  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error)
11737  __Pyx_GOTREF(__pyx_t_7);
11738 
11739  /* "View.MemoryView":434
11740  * if not isinstance(obj, memoryview):
11741  * try:
11742  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
11743  * self.dtype_is_object)
11744  * except TypeError:
11745  */
11746  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error)
11747  __Pyx_GOTREF(__pyx_t_8);
11748  __Pyx_INCREF(__pyx_v_obj);
11749  __Pyx_GIVEREF(__pyx_v_obj);
11750  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
11751  __Pyx_GIVEREF(__pyx_t_6);
11752  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
11753  __Pyx_GIVEREF(__pyx_t_7);
11754  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
11755  __pyx_t_6 = 0;
11756  __pyx_t_7 = 0;
11757  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error)
11758  __Pyx_GOTREF(__pyx_t_7);
11759  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11760  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
11761  __pyx_t_7 = 0;
11762 
11763  /* "View.MemoryView":433
11764  * cdef is_slice(self, obj):
11765  * if not isinstance(obj, memoryview):
11766  * try: # <<<<<<<<<<<<<<
11767  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11768  * self.dtype_is_object)
11769  */
11770  }
11771  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11772  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11773  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11774  goto __pyx_L9_try_end;
11775  __pyx_L4_error:;
11776  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11777  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11778  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
11779 
11780  /* "View.MemoryView":436
11781  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11782  * self.dtype_is_object)
11783  * except TypeError: # <<<<<<<<<<<<<<
11784  * return None
11785  *
11786  */
11787  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
11788  if (__pyx_t_9) {
11789  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11790  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error)
11791  __Pyx_GOTREF(__pyx_t_7);
11792  __Pyx_GOTREF(__pyx_t_8);
11793  __Pyx_GOTREF(__pyx_t_6);
11794 
11795  /* "View.MemoryView":437
11796  * self.dtype_is_object)
11797  * except TypeError:
11798  * return None # <<<<<<<<<<<<<<
11799  *
11800  * return obj
11801  */
11802  __Pyx_XDECREF(__pyx_r);
11803  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11804  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11805  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11806  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11807  goto __pyx_L7_except_return;
11808  }
11809  goto __pyx_L6_except_error;
11810  __pyx_L6_except_error:;
11811 
11812  /* "View.MemoryView":433
11813  * cdef is_slice(self, obj):
11814  * if not isinstance(obj, memoryview):
11815  * try: # <<<<<<<<<<<<<<
11816  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11817  * self.dtype_is_object)
11818  */
11819  __Pyx_XGIVEREF(__pyx_t_3);
11820  __Pyx_XGIVEREF(__pyx_t_4);
11821  __Pyx_XGIVEREF(__pyx_t_5);
11822  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11823  goto __pyx_L1_error;
11824  __pyx_L7_except_return:;
11825  __Pyx_XGIVEREF(__pyx_t_3);
11826  __Pyx_XGIVEREF(__pyx_t_4);
11827  __Pyx_XGIVEREF(__pyx_t_5);
11828  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11829  goto __pyx_L0;
11830  __pyx_L9_try_end:;
11831  }
11832 
11833  /* "View.MemoryView":432
11834  *
11835  * cdef is_slice(self, obj):
11836  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
11837  * try:
11838  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
11839  */
11840  }
11841 
11842  /* "View.MemoryView":439
11843  * return None
11844  *
11845  * return obj # <<<<<<<<<<<<<<
11846  *
11847  * cdef setitem_slice_assignment(self, dst, src):
11848  */
11849  __Pyx_XDECREF(__pyx_r);
11850  __Pyx_INCREF(__pyx_v_obj);
11851  __pyx_r = __pyx_v_obj;
11852  goto __pyx_L0;
11853 
11854  /* "View.MemoryView":431
11855  * self.setitem_indexed(index, value)
11856  *
11857  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
11858  * if not isinstance(obj, memoryview):
11859  * try:
11860  */
11861 
11862  /* function exit code */
11863  __pyx_L1_error:;
11864  __Pyx_XDECREF(__pyx_t_6);
11865  __Pyx_XDECREF(__pyx_t_7);
11866  __Pyx_XDECREF(__pyx_t_8);
11867  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11868  __pyx_r = 0;
11869  __pyx_L0:;
11870  __Pyx_XDECREF(__pyx_v_obj);
11871  __Pyx_XGIVEREF(__pyx_r);
11872  __Pyx_RefNannyFinishContext();
11873  return __pyx_r;
11874 }
11875 
11876 /* "View.MemoryView":441
11877  * return obj
11878  *
11879  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
11880  * cdef __Pyx_memviewslice dst_slice
11881  * cdef __Pyx_memviewslice src_slice
11882  */
11883 
11884 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
11885  __Pyx_memviewslice __pyx_v_dst_slice;
11886  __Pyx_memviewslice __pyx_v_src_slice;
11887  PyObject *__pyx_r = NULL;
11888  __Pyx_RefNannyDeclarations
11889  __Pyx_memviewslice *__pyx_t_1;
11890  __Pyx_memviewslice *__pyx_t_2;
11891  PyObject *__pyx_t_3 = NULL;
11892  int __pyx_t_4;
11893  int __pyx_t_5;
11894  int __pyx_t_6;
11895  int __pyx_lineno = 0;
11896  const char *__pyx_filename = NULL;
11897  int __pyx_clineno = 0;
11898  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
11899 
11900  /* "View.MemoryView":445
11901  * cdef __Pyx_memviewslice src_slice
11902  *
11903  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
11904  * get_slice_from_memview(dst, &dst_slice)[0],
11905  * src.ndim, dst.ndim, self.dtype_is_object)
11906  */
11907  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error)
11908  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
11909 
11910  /* "View.MemoryView":446
11911  *
11912  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
11913  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
11914  * src.ndim, dst.ndim, self.dtype_is_object)
11915  *
11916  */
11917  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error)
11918  __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 446, __pyx_L1_error)
11919 
11920  /* "View.MemoryView":447
11921  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
11922  * get_slice_from_memview(dst, &dst_slice)[0],
11923  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
11924  *
11925  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
11926  */
11927  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
11928  __Pyx_GOTREF(__pyx_t_3);
11929  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
11930  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11931  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
11932  __Pyx_GOTREF(__pyx_t_3);
11933  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
11934  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11935 
11936  /* "View.MemoryView":445
11937  * cdef __Pyx_memviewslice src_slice
11938  *
11939  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
11940  * get_slice_from_memview(dst, &dst_slice)[0],
11941  * src.ndim, dst.ndim, self.dtype_is_object)
11942  */
11943  __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 445, __pyx_L1_error)
11944 
11945  /* "View.MemoryView":441
11946  * return obj
11947  *
11948  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
11949  * cdef __Pyx_memviewslice dst_slice
11950  * cdef __Pyx_memviewslice src_slice
11951  */
11952 
11953  /* function exit code */
11954  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11955  goto __pyx_L0;
11956  __pyx_L1_error:;
11957  __Pyx_XDECREF(__pyx_t_3);
11958  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
11959  __pyx_r = 0;
11960  __pyx_L0:;
11961  __Pyx_XGIVEREF(__pyx_r);
11962  __Pyx_RefNannyFinishContext();
11963  return __pyx_r;
11964 }
11965 
11966 /* "View.MemoryView":449
11967  * src.ndim, dst.ndim, self.dtype_is_object)
11968  *
11969  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
11970  * cdef int array[128]
11971  * cdef void *tmp = NULL
11972  */
11973 
11974 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) {
11975  int __pyx_v_array[0x80];
11976  void *__pyx_v_tmp;
11977  void *__pyx_v_item;
11978  __Pyx_memviewslice *__pyx_v_dst_slice;
11979  __Pyx_memviewslice __pyx_v_tmp_slice;
11980  PyObject *__pyx_r = NULL;
11981  __Pyx_RefNannyDeclarations
11982  __Pyx_memviewslice *__pyx_t_1;
11983  int __pyx_t_2;
11984  PyObject *__pyx_t_3 = NULL;
11985  int __pyx_t_4;
11986  int __pyx_t_5;
11987  char const *__pyx_t_6;
11988  PyObject *__pyx_t_7 = NULL;
11989  PyObject *__pyx_t_8 = NULL;
11990  PyObject *__pyx_t_9 = NULL;
11991  PyObject *__pyx_t_10 = NULL;
11992  PyObject *__pyx_t_11 = NULL;
11993  PyObject *__pyx_t_12 = NULL;
11994  int __pyx_lineno = 0;
11995  const char *__pyx_filename = NULL;
11996  int __pyx_clineno = 0;
11997  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
11998 
11999  /* "View.MemoryView":451
12000  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
12001  * cdef int array[128]
12002  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
12003  * cdef void *item
12004  *
12005  */
12006  __pyx_v_tmp = NULL;
12007 
12008  /* "View.MemoryView":456
12009  * cdef __Pyx_memviewslice *dst_slice
12010  * cdef __Pyx_memviewslice tmp_slice
12011  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
12012  *
12013  * if <size_t>self.view.itemsize > sizeof(array):
12014  */
12015  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 456, __pyx_L1_error)
12016  __pyx_v_dst_slice = __pyx_t_1;
12017 
12018  /* "View.MemoryView":458
12019  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
12020  *
12021  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
12022  * tmp = PyMem_Malloc(self.view.itemsize)
12023  * if tmp == NULL:
12024  */
12025  __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
12026  if (__pyx_t_2) {
12027 
12028  /* "View.MemoryView":459
12029  *
12030  * if <size_t>self.view.itemsize > sizeof(array):
12031  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
12032  * if tmp == NULL:
12033  * raise MemoryError
12034  */
12035  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
12036 
12037  /* "View.MemoryView":460
12038  * if <size_t>self.view.itemsize > sizeof(array):
12039  * tmp = PyMem_Malloc(self.view.itemsize)
12040  * if tmp == NULL: # <<<<<<<<<<<<<<
12041  * raise MemoryError
12042  * item = tmp
12043  */
12044  __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
12045  if (unlikely(__pyx_t_2)) {
12046 
12047  /* "View.MemoryView":461
12048  * tmp = PyMem_Malloc(self.view.itemsize)
12049  * if tmp == NULL:
12050  * raise MemoryError # <<<<<<<<<<<<<<
12051  * item = tmp
12052  * else:
12053  */
12054  PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error)
12055 
12056  /* "View.MemoryView":460
12057  * if <size_t>self.view.itemsize > sizeof(array):
12058  * tmp = PyMem_Malloc(self.view.itemsize)
12059  * if tmp == NULL: # <<<<<<<<<<<<<<
12060  * raise MemoryError
12061  * item = tmp
12062  */
12063  }
12064 
12065  /* "View.MemoryView":462
12066  * if tmp == NULL:
12067  * raise MemoryError
12068  * item = tmp # <<<<<<<<<<<<<<
12069  * else:
12070  * item = <void *> array
12071  */
12072  __pyx_v_item = __pyx_v_tmp;
12073 
12074  /* "View.MemoryView":458
12075  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
12076  *
12077  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
12078  * tmp = PyMem_Malloc(self.view.itemsize)
12079  * if tmp == NULL:
12080  */
12081  goto __pyx_L3;
12082  }
12083 
12084  /* "View.MemoryView":464
12085  * item = tmp
12086  * else:
12087  * item = <void *> array # <<<<<<<<<<<<<<
12088  *
12089  * try:
12090  */
12091  /*else*/ {
12092  __pyx_v_item = ((void *)__pyx_v_array);
12093  }
12094  __pyx_L3:;
12095 
12096  /* "View.MemoryView":466
12097  * item = <void *> array
12098  *
12099  * try: # <<<<<<<<<<<<<<
12100  * if self.dtype_is_object:
12101  * (<PyObject **> item)[0] = <PyObject *> value
12102  */
12103  /*try:*/ {
12104 
12105  /* "View.MemoryView":467
12106  *
12107  * try:
12108  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12109  * (<PyObject **> item)[0] = <PyObject *> value
12110  * else:
12111  */
12112  __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
12113  if (__pyx_t_2) {
12114 
12115  /* "View.MemoryView":468
12116  * try:
12117  * if self.dtype_is_object:
12118  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
12119  * else:
12120  * self.assign_item_from_object(<char *> item, value)
12121  */
12122  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
12123 
12124  /* "View.MemoryView":467
12125  *
12126  * try:
12127  * if self.dtype_is_object: # <<<<<<<<<<<<<<
12128  * (<PyObject **> item)[0] = <PyObject *> value
12129  * else:
12130  */
12131  goto __pyx_L8;
12132  }
12133 
12134  /* "View.MemoryView":470
12135  * (<PyObject **> item)[0] = <PyObject *> value
12136  * else:
12137  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
12138  *
12139  *
12140  */
12141  /*else*/ {
12142  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L6_error)
12143  __Pyx_GOTREF(__pyx_t_3);
12144  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12145  }
12146  __pyx_L8:;
12147 
12148  /* "View.MemoryView":474
12149  *
12150  *
12151  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
12152  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12153  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12154  */
12155  __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
12156  if (__pyx_t_2) {
12157 
12158  /* "View.MemoryView":475
12159  *
12160  * if self.view.suboffsets != NULL:
12161  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
12162  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12163  * item, self.dtype_is_object)
12164  */
12165  __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error)
12166  __Pyx_GOTREF(__pyx_t_3);
12167  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12168 
12169  /* "View.MemoryView":474
12170  *
12171  *
12172  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
12173  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12174  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
12175  */
12176  }
12177 
12178  /* "View.MemoryView":476
12179  * if self.view.suboffsets != NULL:
12180  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
12181  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
12182  * item, self.dtype_is_object)
12183  * finally:
12184  */
12185  __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);
12186  }
12187 
12188  /* "View.MemoryView":479
12189  * item, self.dtype_is_object)
12190  * finally:
12191  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
12192  *
12193  * cdef setitem_indexed(self, index, value):
12194  */
12195  /*finally:*/ {
12196  /*normal exit:*/{
12197  PyMem_Free(__pyx_v_tmp);
12198  goto __pyx_L7;
12199  }
12200  __pyx_L6_error:;
12201  /*exception exit:*/{
12202  __Pyx_PyThreadState_declare
12203  __Pyx_PyThreadState_assign
12204  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
12205  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12206  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
12207  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);
12208  __Pyx_XGOTREF(__pyx_t_7);
12209  __Pyx_XGOTREF(__pyx_t_8);
12210  __Pyx_XGOTREF(__pyx_t_9);
12211  __Pyx_XGOTREF(__pyx_t_10);
12212  __Pyx_XGOTREF(__pyx_t_11);
12213  __Pyx_XGOTREF(__pyx_t_12);
12214  __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
12215  {
12216  PyMem_Free(__pyx_v_tmp);
12217  }
12218  if (PY_MAJOR_VERSION >= 3) {
12219  __Pyx_XGIVEREF(__pyx_t_10);
12220  __Pyx_XGIVEREF(__pyx_t_11);
12221  __Pyx_XGIVEREF(__pyx_t_12);
12222  __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
12223  }
12224  __Pyx_XGIVEREF(__pyx_t_7);
12225  __Pyx_XGIVEREF(__pyx_t_8);
12226  __Pyx_XGIVEREF(__pyx_t_9);
12227  __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
12228  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
12229  __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
12230  goto __pyx_L1_error;
12231  }
12232  __pyx_L7:;
12233  }
12234 
12235  /* "View.MemoryView":449
12236  * src.ndim, dst.ndim, self.dtype_is_object)
12237  *
12238  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
12239  * cdef int array[128]
12240  * cdef void *tmp = NULL
12241  */
12242 
12243  /* function exit code */
12244  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12245  goto __pyx_L0;
12246  __pyx_L1_error:;
12247  __Pyx_XDECREF(__pyx_t_3);
12248  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
12249  __pyx_r = 0;
12250  __pyx_L0:;
12251  __Pyx_XGIVEREF(__pyx_r);
12252  __Pyx_RefNannyFinishContext();
12253  return __pyx_r;
12254 }
12255 
12256 /* "View.MemoryView":481
12257  * PyMem_Free(tmp)
12258  *
12259  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
12260  * cdef char *itemp = self.get_item_pointer(index)
12261  * self.assign_item_from_object(itemp, value)
12262  */
12263 
12264 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12265  char *__pyx_v_itemp;
12266  PyObject *__pyx_r = NULL;
12267  __Pyx_RefNannyDeclarations
12268  char *__pyx_t_1;
12269  PyObject *__pyx_t_2 = NULL;
12270  int __pyx_lineno = 0;
12271  const char *__pyx_filename = NULL;
12272  int __pyx_clineno = 0;
12273  __Pyx_RefNannySetupContext("setitem_indexed", 0);
12274 
12275  /* "View.MemoryView":482
12276  *
12277  * cdef setitem_indexed(self, index, value):
12278  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
12279  * self.assign_item_from_object(itemp, value)
12280  *
12281  */
12282  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 482, __pyx_L1_error)
12283  __pyx_v_itemp = __pyx_t_1;
12284 
12285  /* "View.MemoryView":483
12286  * cdef setitem_indexed(self, index, value):
12287  * cdef char *itemp = self.get_item_pointer(index)
12288  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
12289  *
12290  * cdef convert_item_to_object(self, char *itemp):
12291  */
12292  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error)
12293  __Pyx_GOTREF(__pyx_t_2);
12294  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12295 
12296  /* "View.MemoryView":481
12297  * PyMem_Free(tmp)
12298  *
12299  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
12300  * cdef char *itemp = self.get_item_pointer(index)
12301  * self.assign_item_from_object(itemp, value)
12302  */
12303 
12304  /* function exit code */
12305  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12306  goto __pyx_L0;
12307  __pyx_L1_error:;
12308  __Pyx_XDECREF(__pyx_t_2);
12309  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
12310  __pyx_r = 0;
12311  __pyx_L0:;
12312  __Pyx_XGIVEREF(__pyx_r);
12313  __Pyx_RefNannyFinishContext();
12314  return __pyx_r;
12315 }
12316 
12317 /* "View.MemoryView":485
12318  * self.assign_item_from_object(itemp, value)
12319  *
12320  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
12321  * """Only used if instantiated manually by the user, or if Cython doesn't
12322  * know how to convert the type"""
12323  */
12324 
12325 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
12326  PyObject *__pyx_v_struct = NULL;
12327  PyObject *__pyx_v_bytesitem = 0;
12328  PyObject *__pyx_v_result = NULL;
12329  PyObject *__pyx_r = NULL;
12330  __Pyx_RefNannyDeclarations
12331  PyObject *__pyx_t_1 = NULL;
12332  PyObject *__pyx_t_2 = NULL;
12333  PyObject *__pyx_t_3 = NULL;
12334  PyObject *__pyx_t_4 = NULL;
12335  PyObject *__pyx_t_5 = NULL;
12336  PyObject *__pyx_t_6 = NULL;
12337  PyObject *__pyx_t_7 = NULL;
12338  int __pyx_t_8;
12339  PyObject *__pyx_t_9 = NULL;
12340  size_t __pyx_t_10;
12341  int __pyx_t_11;
12342  int __pyx_lineno = 0;
12343  const char *__pyx_filename = NULL;
12344  int __pyx_clineno = 0;
12345  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
12346 
12347  /* "View.MemoryView":488
12348  * """Only used if instantiated manually by the user, or if Cython doesn't
12349  * know how to convert the type"""
12350  * import struct # <<<<<<<<<<<<<<
12351  * cdef bytes bytesitem
12352  *
12353  */
12354  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error)
12355  __Pyx_GOTREF(__pyx_t_1);
12356  __pyx_v_struct = __pyx_t_1;
12357  __pyx_t_1 = 0;
12358 
12359  /* "View.MemoryView":491
12360  * cdef bytes bytesitem
12361  *
12362  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
12363  * try:
12364  * result = struct.unpack(self.view.format, bytesitem)
12365  */
12366  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error)
12367  __Pyx_GOTREF(__pyx_t_1);
12368  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
12369  __pyx_t_1 = 0;
12370 
12371  /* "View.MemoryView":492
12372  *
12373  * bytesitem = itemp[:self.view.itemsize]
12374  * try: # <<<<<<<<<<<<<<
12375  * result = struct.unpack(self.view.format, bytesitem)
12376  * except struct.error:
12377  */
12378  {
12379  __Pyx_PyThreadState_declare
12380  __Pyx_PyThreadState_assign
12381  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
12382  __Pyx_XGOTREF(__pyx_t_2);
12383  __Pyx_XGOTREF(__pyx_t_3);
12384  __Pyx_XGOTREF(__pyx_t_4);
12385  /*try:*/ {
12386 
12387  /* "View.MemoryView":493
12388  * bytesitem = itemp[:self.view.itemsize]
12389  * try:
12390  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
12391  * except struct.error:
12392  * raise ValueError("Unable to convert item to object")
12393  */
12394  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error)
12395  __Pyx_GOTREF(__pyx_t_5);
12396  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error)
12397  __Pyx_GOTREF(__pyx_t_6);
12398  __pyx_t_7 = NULL;
12399  __pyx_t_8 = 0;
12400  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
12401  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
12402  if (likely(__pyx_t_7)) {
12403  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
12404  __Pyx_INCREF(__pyx_t_7);
12405  __Pyx_INCREF(function);
12406  __Pyx_DECREF_SET(__pyx_t_5, function);
12407  __pyx_t_8 = 1;
12408  }
12409  }
12410  #if CYTHON_FAST_PYCALL
12411  if (PyFunction_Check(__pyx_t_5)) {
12412  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12413  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12414  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12415  __Pyx_GOTREF(__pyx_t_1);
12416  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12417  } else
12418  #endif
12419  #if CYTHON_FAST_PYCCALL
12420  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
12421  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12422  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12423  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12424  __Pyx_GOTREF(__pyx_t_1);
12425  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12426  } else
12427  #endif
12428  {
12429  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error)
12430  __Pyx_GOTREF(__pyx_t_9);
12431  if (__pyx_t_7) {
12432  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
12433  }
12434  __Pyx_GIVEREF(__pyx_t_6);
12435  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
12436  __Pyx_INCREF(__pyx_v_bytesitem);
12437  __Pyx_GIVEREF(__pyx_v_bytesitem);
12438  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
12439  __pyx_t_6 = 0;
12440  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
12441  __Pyx_GOTREF(__pyx_t_1);
12442  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12443  }
12444  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12445  __pyx_v_result = __pyx_t_1;
12446  __pyx_t_1 = 0;
12447 
12448  /* "View.MemoryView":492
12449  *
12450  * bytesitem = itemp[:self.view.itemsize]
12451  * try: # <<<<<<<<<<<<<<
12452  * result = struct.unpack(self.view.format, bytesitem)
12453  * except struct.error:
12454  */
12455  }
12456 
12457  /* "View.MemoryView":497
12458  * raise ValueError("Unable to convert item to object")
12459  * else:
12460  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12461  * return result[0]
12462  * return result
12463  */
12464  /*else:*/ {
12465  __pyx_t_10 = strlen(__pyx_v_self->view.format);
12466  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
12467  if (__pyx_t_11) {
12468 
12469  /* "View.MemoryView":498
12470  * else:
12471  * if len(self.view.format) == 1:
12472  * return result[0] # <<<<<<<<<<<<<<
12473  * return result
12474  *
12475  */
12476  __Pyx_XDECREF(__pyx_r);
12477  __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(1, 498, __pyx_L5_except_error)
12478  __Pyx_GOTREF(__pyx_t_1);
12479  __pyx_r = __pyx_t_1;
12480  __pyx_t_1 = 0;
12481  goto __pyx_L6_except_return;
12482 
12483  /* "View.MemoryView":497
12484  * raise ValueError("Unable to convert item to object")
12485  * else:
12486  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12487  * return result[0]
12488  * return result
12489  */
12490  }
12491 
12492  /* "View.MemoryView":499
12493  * if len(self.view.format) == 1:
12494  * return result[0]
12495  * return result # <<<<<<<<<<<<<<
12496  *
12497  * cdef assign_item_from_object(self, char *itemp, object value):
12498  */
12499  __Pyx_XDECREF(__pyx_r);
12500  __Pyx_INCREF(__pyx_v_result);
12501  __pyx_r = __pyx_v_result;
12502  goto __pyx_L6_except_return;
12503  }
12504  __pyx_L3_error:;
12505  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12506  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12507  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12508  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12509  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12510 
12511  /* "View.MemoryView":494
12512  * try:
12513  * result = struct.unpack(self.view.format, bytesitem)
12514  * except struct.error: # <<<<<<<<<<<<<<
12515  * raise ValueError("Unable to convert item to object")
12516  * else:
12517  */
12518  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
12519  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error)
12520  __Pyx_GOTREF(__pyx_t_6);
12521  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
12522  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12523  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
12524  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
12525  if (__pyx_t_8) {
12526  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12527  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error)
12528  __Pyx_GOTREF(__pyx_t_9);
12529  __Pyx_GOTREF(__pyx_t_5);
12530  __Pyx_GOTREF(__pyx_t_1);
12531 
12532  /* "View.MemoryView":495
12533  * result = struct.unpack(self.view.format, bytesitem)
12534  * except struct.error:
12535  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
12536  * else:
12537  * if len(self.view.format) == 1:
12538  */
12539  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error)
12540  __Pyx_GOTREF(__pyx_t_6);
12541  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
12542  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12543  __PYX_ERR(1, 495, __pyx_L5_except_error)
12544  }
12545  goto __pyx_L5_except_error;
12546  __pyx_L5_except_error:;
12547 
12548  /* "View.MemoryView":492
12549  *
12550  * bytesitem = itemp[:self.view.itemsize]
12551  * try: # <<<<<<<<<<<<<<
12552  * result = struct.unpack(self.view.format, bytesitem)
12553  * except struct.error:
12554  */
12555  __Pyx_XGIVEREF(__pyx_t_2);
12556  __Pyx_XGIVEREF(__pyx_t_3);
12557  __Pyx_XGIVEREF(__pyx_t_4);
12558  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12559  goto __pyx_L1_error;
12560  __pyx_L6_except_return:;
12561  __Pyx_XGIVEREF(__pyx_t_2);
12562  __Pyx_XGIVEREF(__pyx_t_3);
12563  __Pyx_XGIVEREF(__pyx_t_4);
12564  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12565  goto __pyx_L0;
12566  }
12567 
12568  /* "View.MemoryView":485
12569  * self.assign_item_from_object(itemp, value)
12570  *
12571  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
12572  * """Only used if instantiated manually by the user, or if Cython doesn't
12573  * know how to convert the type"""
12574  */
12575 
12576  /* function exit code */
12577  __pyx_L1_error:;
12578  __Pyx_XDECREF(__pyx_t_1);
12579  __Pyx_XDECREF(__pyx_t_5);
12580  __Pyx_XDECREF(__pyx_t_6);
12581  __Pyx_XDECREF(__pyx_t_7);
12582  __Pyx_XDECREF(__pyx_t_9);
12583  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12584  __pyx_r = 0;
12585  __pyx_L0:;
12586  __Pyx_XDECREF(__pyx_v_struct);
12587  __Pyx_XDECREF(__pyx_v_bytesitem);
12588  __Pyx_XDECREF(__pyx_v_result);
12589  __Pyx_XGIVEREF(__pyx_r);
12590  __Pyx_RefNannyFinishContext();
12591  return __pyx_r;
12592 }
12593 
12594 /* "View.MemoryView":501
12595  * return result
12596  *
12597  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
12598  * """Only used if instantiated manually by the user, or if Cython doesn't
12599  * know how to convert the type"""
12600  */
12601 
12602 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
12603  PyObject *__pyx_v_struct = NULL;
12604  char __pyx_v_c;
12605  PyObject *__pyx_v_bytesvalue = 0;
12606  Py_ssize_t __pyx_v_i;
12607  PyObject *__pyx_r = NULL;
12608  __Pyx_RefNannyDeclarations
12609  PyObject *__pyx_t_1 = NULL;
12610  int __pyx_t_2;
12611  int __pyx_t_3;
12612  PyObject *__pyx_t_4 = NULL;
12613  PyObject *__pyx_t_5 = NULL;
12614  PyObject *__pyx_t_6 = NULL;
12615  int __pyx_t_7;
12616  PyObject *__pyx_t_8 = NULL;
12617  Py_ssize_t __pyx_t_9;
12618  PyObject *__pyx_t_10 = NULL;
12619  char *__pyx_t_11;
12620  char *__pyx_t_12;
12621  char *__pyx_t_13;
12622  char *__pyx_t_14;
12623  int __pyx_lineno = 0;
12624  const char *__pyx_filename = NULL;
12625  int __pyx_clineno = 0;
12626  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
12627 
12628  /* "View.MemoryView":504
12629  * """Only used if instantiated manually by the user, or if Cython doesn't
12630  * know how to convert the type"""
12631  * import struct # <<<<<<<<<<<<<<
12632  * cdef char c
12633  * cdef bytes bytesvalue
12634  */
12635  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error)
12636  __Pyx_GOTREF(__pyx_t_1);
12637  __pyx_v_struct = __pyx_t_1;
12638  __pyx_t_1 = 0;
12639 
12640  /* "View.MemoryView":509
12641  * cdef Py_ssize_t i
12642  *
12643  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
12644  * bytesvalue = struct.pack(self.view.format, *value)
12645  * else:
12646  */
12647  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
12648  __pyx_t_3 = (__pyx_t_2 != 0);
12649  if (__pyx_t_3) {
12650 
12651  /* "View.MemoryView":510
12652  *
12653  * if isinstance(value, tuple):
12654  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
12655  * else:
12656  * bytesvalue = struct.pack(self.view.format, value)
12657  */
12658  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error)
12659  __Pyx_GOTREF(__pyx_t_1);
12660  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12661  __Pyx_GOTREF(__pyx_t_4);
12662  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error)
12663  __Pyx_GOTREF(__pyx_t_5);
12664  __Pyx_GIVEREF(__pyx_t_4);
12665  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
12666  __pyx_t_4 = 0;
12667  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12668  __Pyx_GOTREF(__pyx_t_4);
12669  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error)
12670  __Pyx_GOTREF(__pyx_t_6);
12671  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12672  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12673  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
12674  __Pyx_GOTREF(__pyx_t_4);
12675  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12676  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12677  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 510, __pyx_L1_error)
12678  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12679  __pyx_t_4 = 0;
12680 
12681  /* "View.MemoryView":509
12682  * cdef Py_ssize_t i
12683  *
12684  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
12685  * bytesvalue = struct.pack(self.view.format, *value)
12686  * else:
12687  */
12688  goto __pyx_L3;
12689  }
12690 
12691  /* "View.MemoryView":512
12692  * bytesvalue = struct.pack(self.view.format, *value)
12693  * else:
12694  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
12695  *
12696  * for i, c in enumerate(bytesvalue):
12697  */
12698  /*else*/ {
12699  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
12700  __Pyx_GOTREF(__pyx_t_6);
12701  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
12702  __Pyx_GOTREF(__pyx_t_1);
12703  __pyx_t_5 = NULL;
12704  __pyx_t_7 = 0;
12705  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
12706  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12707  if (likely(__pyx_t_5)) {
12708  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
12709  __Pyx_INCREF(__pyx_t_5);
12710  __Pyx_INCREF(function);
12711  __Pyx_DECREF_SET(__pyx_t_6, function);
12712  __pyx_t_7 = 1;
12713  }
12714  }
12715  #if CYTHON_FAST_PYCALL
12716  if (PyFunction_Check(__pyx_t_6)) {
12717  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12718  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12719  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12720  __Pyx_GOTREF(__pyx_t_4);
12721  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12722  } else
12723  #endif
12724  #if CYTHON_FAST_PYCCALL
12725  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12726  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12727  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12728  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12729  __Pyx_GOTREF(__pyx_t_4);
12730  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12731  } else
12732  #endif
12733  {
12734  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error)
12735  __Pyx_GOTREF(__pyx_t_8);
12736  if (__pyx_t_5) {
12737  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12738  }
12739  __Pyx_GIVEREF(__pyx_t_1);
12740  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
12741  __Pyx_INCREF(__pyx_v_value);
12742  __Pyx_GIVEREF(__pyx_v_value);
12743  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
12744  __pyx_t_1 = 0;
12745  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
12746  __Pyx_GOTREF(__pyx_t_4);
12747  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12748  }
12749  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12750  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
12751  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12752  __pyx_t_4 = 0;
12753  }
12754  __pyx_L3:;
12755 
12756  /* "View.MemoryView":514
12757  * bytesvalue = struct.pack(self.view.format, value)
12758  *
12759  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
12760  * itemp[i] = c
12761  *
12762  */
12763  __pyx_t_9 = 0;
12764  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
12765  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
12766  __PYX_ERR(1, 514, __pyx_L1_error)
12767  }
12768  __Pyx_INCREF(__pyx_v_bytesvalue);
12769  __pyx_t_10 = __pyx_v_bytesvalue;
12770  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
12771  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
12772  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
12773  __pyx_t_11 = __pyx_t_14;
12774  __pyx_v_c = (__pyx_t_11[0]);
12775 
12776  /* "View.MemoryView":515
12777  *
12778  * for i, c in enumerate(bytesvalue):
12779  * itemp[i] = c # <<<<<<<<<<<<<<
12780  *
12781  * @cname('getbuffer')
12782  */
12783  __pyx_v_i = __pyx_t_9;
12784 
12785  /* "View.MemoryView":514
12786  * bytesvalue = struct.pack(self.view.format, value)
12787  *
12788  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
12789  * itemp[i] = c
12790  *
12791  */
12792  __pyx_t_9 = (__pyx_t_9 + 1);
12793 
12794  /* "View.MemoryView":515
12795  *
12796  * for i, c in enumerate(bytesvalue):
12797  * itemp[i] = c # <<<<<<<<<<<<<<
12798  *
12799  * @cname('getbuffer')
12800  */
12801  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
12802  }
12803  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12804 
12805  /* "View.MemoryView":501
12806  * return result
12807  *
12808  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
12809  * """Only used if instantiated manually by the user, or if Cython doesn't
12810  * know how to convert the type"""
12811  */
12812 
12813  /* function exit code */
12814  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12815  goto __pyx_L0;
12816  __pyx_L1_error:;
12817  __Pyx_XDECREF(__pyx_t_1);
12818  __Pyx_XDECREF(__pyx_t_4);
12819  __Pyx_XDECREF(__pyx_t_5);
12820  __Pyx_XDECREF(__pyx_t_6);
12821  __Pyx_XDECREF(__pyx_t_8);
12822  __Pyx_XDECREF(__pyx_t_10);
12823  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12824  __pyx_r = 0;
12825  __pyx_L0:;
12826  __Pyx_XDECREF(__pyx_v_struct);
12827  __Pyx_XDECREF(__pyx_v_bytesvalue);
12828  __Pyx_XGIVEREF(__pyx_r);
12829  __Pyx_RefNannyFinishContext();
12830  return __pyx_r;
12831 }
12832 
12833 /* "View.MemoryView":518
12834  *
12835  * @cname('getbuffer')
12836  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
12837  * if flags & PyBUF_WRITABLE and self.view.readonly:
12838  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12839  */
12840 
12841 /* Python wrapper */
12842 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
12843 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12844  int __pyx_r;
12845  __Pyx_RefNannyDeclarations
12846  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
12847  __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));
12848 
12849  /* function exit code */
12850  __Pyx_RefNannyFinishContext();
12851  return __pyx_r;
12852 }
12853 
12854 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) {
12855  int __pyx_r;
12856  __Pyx_RefNannyDeclarations
12857  int __pyx_t_1;
12858  int __pyx_t_2;
12859  PyObject *__pyx_t_3 = NULL;
12860  Py_ssize_t *__pyx_t_4;
12861  char *__pyx_t_5;
12862  void *__pyx_t_6;
12863  int __pyx_t_7;
12864  Py_ssize_t __pyx_t_8;
12865  int __pyx_lineno = 0;
12866  const char *__pyx_filename = NULL;
12867  int __pyx_clineno = 0;
12868  if (__pyx_v_info == NULL) {
12869  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
12870  return -1;
12871  }
12872  __Pyx_RefNannySetupContext("__getbuffer__", 0);
12873  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
12874  __Pyx_GIVEREF(__pyx_v_info->obj);
12875 
12876  /* "View.MemoryView":519
12877  * @cname('getbuffer')
12878  * def __getbuffer__(self, Py_buffer *info, int flags):
12879  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
12880  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12881  *
12882  */
12883  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
12884  if (__pyx_t_2) {
12885  } else {
12886  __pyx_t_1 = __pyx_t_2;
12887  goto __pyx_L4_bool_binop_done;
12888  }
12889  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
12890  __pyx_t_1 = __pyx_t_2;
12891  __pyx_L4_bool_binop_done:;
12892  if (unlikely(__pyx_t_1)) {
12893 
12894  /* "View.MemoryView":520
12895  * def __getbuffer__(self, Py_buffer *info, int flags):
12896  * if flags & PyBUF_WRITABLE and self.view.readonly:
12897  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
12898  *
12899  * if flags & PyBUF_ND:
12900  */
12901  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error)
12902  __Pyx_GOTREF(__pyx_t_3);
12903  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12904  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12905  __PYX_ERR(1, 520, __pyx_L1_error)
12906 
12907  /* "View.MemoryView":519
12908  * @cname('getbuffer')
12909  * def __getbuffer__(self, Py_buffer *info, int flags):
12910  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
12911  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12912  *
12913  */
12914  }
12915 
12916  /* "View.MemoryView":522
12917  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12918  *
12919  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
12920  * info.shape = self.view.shape
12921  * else:
12922  */
12923  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
12924  if (__pyx_t_1) {
12925 
12926  /* "View.MemoryView":523
12927  *
12928  * if flags & PyBUF_ND:
12929  * info.shape = self.view.shape # <<<<<<<<<<<<<<
12930  * else:
12931  * info.shape = NULL
12932  */
12933  __pyx_t_4 = __pyx_v_self->view.shape;
12934  __pyx_v_info->shape = __pyx_t_4;
12935 
12936  /* "View.MemoryView":522
12937  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12938  *
12939  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
12940  * info.shape = self.view.shape
12941  * else:
12942  */
12943  goto __pyx_L6;
12944  }
12945 
12946  /* "View.MemoryView":525
12947  * info.shape = self.view.shape
12948  * else:
12949  * info.shape = NULL # <<<<<<<<<<<<<<
12950  *
12951  * if flags & PyBUF_STRIDES:
12952  */
12953  /*else*/ {
12954  __pyx_v_info->shape = NULL;
12955  }
12956  __pyx_L6:;
12957 
12958  /* "View.MemoryView":527
12959  * info.shape = NULL
12960  *
12961  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
12962  * info.strides = self.view.strides
12963  * else:
12964  */
12965  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
12966  if (__pyx_t_1) {
12967 
12968  /* "View.MemoryView":528
12969  *
12970  * if flags & PyBUF_STRIDES:
12971  * info.strides = self.view.strides # <<<<<<<<<<<<<<
12972  * else:
12973  * info.strides = NULL
12974  */
12975  __pyx_t_4 = __pyx_v_self->view.strides;
12976  __pyx_v_info->strides = __pyx_t_4;
12977 
12978  /* "View.MemoryView":527
12979  * info.shape = NULL
12980  *
12981  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
12982  * info.strides = self.view.strides
12983  * else:
12984  */
12985  goto __pyx_L7;
12986  }
12987 
12988  /* "View.MemoryView":530
12989  * info.strides = self.view.strides
12990  * else:
12991  * info.strides = NULL # <<<<<<<<<<<<<<
12992  *
12993  * if flags & PyBUF_INDIRECT:
12994  */
12995  /*else*/ {
12996  __pyx_v_info->strides = NULL;
12997  }
12998  __pyx_L7:;
12999 
13000  /* "View.MemoryView":532
13001  * info.strides = NULL
13002  *
13003  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
13004  * info.suboffsets = self.view.suboffsets
13005  * else:
13006  */
13007  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
13008  if (__pyx_t_1) {
13009 
13010  /* "View.MemoryView":533
13011  *
13012  * if flags & PyBUF_INDIRECT:
13013  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
13014  * else:
13015  * info.suboffsets = NULL
13016  */
13017  __pyx_t_4 = __pyx_v_self->view.suboffsets;
13018  __pyx_v_info->suboffsets = __pyx_t_4;
13019 
13020  /* "View.MemoryView":532
13021  * info.strides = NULL
13022  *
13023  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
13024  * info.suboffsets = self.view.suboffsets
13025  * else:
13026  */
13027  goto __pyx_L8;
13028  }
13029 
13030  /* "View.MemoryView":535
13031  * info.suboffsets = self.view.suboffsets
13032  * else:
13033  * info.suboffsets = NULL # <<<<<<<<<<<<<<
13034  *
13035  * if flags & PyBUF_FORMAT:
13036  */
13037  /*else*/ {
13038  __pyx_v_info->suboffsets = NULL;
13039  }
13040  __pyx_L8:;
13041 
13042  /* "View.MemoryView":537
13043  * info.suboffsets = NULL
13044  *
13045  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
13046  * info.format = self.view.format
13047  * else:
13048  */
13049  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
13050  if (__pyx_t_1) {
13051 
13052  /* "View.MemoryView":538
13053  *
13054  * if flags & PyBUF_FORMAT:
13055  * info.format = self.view.format # <<<<<<<<<<<<<<
13056  * else:
13057  * info.format = NULL
13058  */
13059  __pyx_t_5 = __pyx_v_self->view.format;
13060  __pyx_v_info->format = __pyx_t_5;
13061 
13062  /* "View.MemoryView":537
13063  * info.suboffsets = NULL
13064  *
13065  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
13066  * info.format = self.view.format
13067  * else:
13068  */
13069  goto __pyx_L9;
13070  }
13071 
13072  /* "View.MemoryView":540
13073  * info.format = self.view.format
13074  * else:
13075  * info.format = NULL # <<<<<<<<<<<<<<
13076  *
13077  * info.buf = self.view.buf
13078  */
13079  /*else*/ {
13080  __pyx_v_info->format = NULL;
13081  }
13082  __pyx_L9:;
13083 
13084  /* "View.MemoryView":542
13085  * info.format = NULL
13086  *
13087  * info.buf = self.view.buf # <<<<<<<<<<<<<<
13088  * info.ndim = self.view.ndim
13089  * info.itemsize = self.view.itemsize
13090  */
13091  __pyx_t_6 = __pyx_v_self->view.buf;
13092  __pyx_v_info->buf = __pyx_t_6;
13093 
13094  /* "View.MemoryView":543
13095  *
13096  * info.buf = self.view.buf
13097  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
13098  * info.itemsize = self.view.itemsize
13099  * info.len = self.view.len
13100  */
13101  __pyx_t_7 = __pyx_v_self->view.ndim;
13102  __pyx_v_info->ndim = __pyx_t_7;
13103 
13104  /* "View.MemoryView":544
13105  * info.buf = self.view.buf
13106  * info.ndim = self.view.ndim
13107  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
13108  * info.len = self.view.len
13109  * info.readonly = self.view.readonly
13110  */
13111  __pyx_t_8 = __pyx_v_self->view.itemsize;
13112  __pyx_v_info->itemsize = __pyx_t_8;
13113 
13114  /* "View.MemoryView":545
13115  * info.ndim = self.view.ndim
13116  * info.itemsize = self.view.itemsize
13117  * info.len = self.view.len # <<<<<<<<<<<<<<
13118  * info.readonly = self.view.readonly
13119  * info.obj = self
13120  */
13121  __pyx_t_8 = __pyx_v_self->view.len;
13122  __pyx_v_info->len = __pyx_t_8;
13123 
13124  /* "View.MemoryView":546
13125  * info.itemsize = self.view.itemsize
13126  * info.len = self.view.len
13127  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
13128  * info.obj = self
13129  *
13130  */
13131  __pyx_t_1 = __pyx_v_self->view.readonly;
13132  __pyx_v_info->readonly = __pyx_t_1;
13133 
13134  /* "View.MemoryView":547
13135  * info.len = self.view.len
13136  * info.readonly = self.view.readonly
13137  * info.obj = self # <<<<<<<<<<<<<<
13138  *
13139  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
13140  */
13141  __Pyx_INCREF(((PyObject *)__pyx_v_self));
13142  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
13143  __Pyx_GOTREF(__pyx_v_info->obj);
13144  __Pyx_DECREF(__pyx_v_info->obj);
13145  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
13146 
13147  /* "View.MemoryView":518
13148  *
13149  * @cname('getbuffer')
13150  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
13151  * if flags & PyBUF_WRITABLE and self.view.readonly:
13152  * raise ValueError("Cannot create writable memory view from read-only memoryview")
13153  */
13154 
13155  /* function exit code */
13156  __pyx_r = 0;
13157  goto __pyx_L0;
13158  __pyx_L1_error:;
13159  __Pyx_XDECREF(__pyx_t_3);
13160  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13161  __pyx_r = -1;
13162  if (__pyx_v_info->obj != NULL) {
13163  __Pyx_GOTREF(__pyx_v_info->obj);
13164  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13165  }
13166  goto __pyx_L2;
13167  __pyx_L0:;
13168  if (__pyx_v_info->obj == Py_None) {
13169  __Pyx_GOTREF(__pyx_v_info->obj);
13170  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13171  }
13172  __pyx_L2:;
13173  __Pyx_RefNannyFinishContext();
13174  return __pyx_r;
13175 }
13176 
13177 /* "View.MemoryView":553
13178  *
13179  * @property
13180  * def T(self): # <<<<<<<<<<<<<<
13181  * cdef _memoryviewslice result = memoryview_copy(self)
13182  * transpose_memslice(&result.from_slice)
13183  */
13184 
13185 /* Python wrapper */
13186 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
13187 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
13188  PyObject *__pyx_r = 0;
13189  __Pyx_RefNannyDeclarations
13190  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13191  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13192 
13193  /* function exit code */
13194  __Pyx_RefNannyFinishContext();
13195  return __pyx_r;
13196 }
13197 
13198 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13199  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
13200  PyObject *__pyx_r = NULL;
13201  __Pyx_RefNannyDeclarations
13202  PyObject *__pyx_t_1 = NULL;
13203  int __pyx_t_2;
13204  int __pyx_lineno = 0;
13205  const char *__pyx_filename = NULL;
13206  int __pyx_clineno = 0;
13207  __Pyx_RefNannySetupContext("__get__", 0);
13208 
13209  /* "View.MemoryView":554
13210  * @property
13211  * def T(self):
13212  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
13213  * transpose_memslice(&result.from_slice)
13214  * return result
13215  */
13216  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
13217  __Pyx_GOTREF(__pyx_t_1);
13218  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error)
13219  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
13220  __pyx_t_1 = 0;
13221 
13222  /* "View.MemoryView":555
13223  * def T(self):
13224  * cdef _memoryviewslice result = memoryview_copy(self)
13225  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
13226  * return result
13227  *
13228  */
13229  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 555, __pyx_L1_error)
13230 
13231  /* "View.MemoryView":556
13232  * cdef _memoryviewslice result = memoryview_copy(self)
13233  * transpose_memslice(&result.from_slice)
13234  * return result # <<<<<<<<<<<<<<
13235  *
13236  * @property
13237  */
13238  __Pyx_XDECREF(__pyx_r);
13239  __Pyx_INCREF(((PyObject *)__pyx_v_result));
13240  __pyx_r = ((PyObject *)__pyx_v_result);
13241  goto __pyx_L0;
13242 
13243  /* "View.MemoryView":553
13244  *
13245  * @property
13246  * def T(self): # <<<<<<<<<<<<<<
13247  * cdef _memoryviewslice result = memoryview_copy(self)
13248  * transpose_memslice(&result.from_slice)
13249  */
13250 
13251  /* function exit code */
13252  __pyx_L1_error:;
13253  __Pyx_XDECREF(__pyx_t_1);
13254  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13255  __pyx_r = NULL;
13256  __pyx_L0:;
13257  __Pyx_XDECREF((PyObject *)__pyx_v_result);
13258  __Pyx_XGIVEREF(__pyx_r);
13259  __Pyx_RefNannyFinishContext();
13260  return __pyx_r;
13261 }
13262 
13263 /* "View.MemoryView":559
13264  *
13265  * @property
13266  * def base(self): # <<<<<<<<<<<<<<
13267  * return self.obj
13268  *
13269  */
13270 
13271 /* Python wrapper */
13272 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
13273 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
13274  PyObject *__pyx_r = 0;
13275  __Pyx_RefNannyDeclarations
13276  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13277  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13278 
13279  /* function exit code */
13280  __Pyx_RefNannyFinishContext();
13281  return __pyx_r;
13282 }
13283 
13284 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13285  PyObject *__pyx_r = NULL;
13286  __Pyx_RefNannyDeclarations
13287  __Pyx_RefNannySetupContext("__get__", 0);
13288 
13289  /* "View.MemoryView":560
13290  * @property
13291  * def base(self):
13292  * return self.obj # <<<<<<<<<<<<<<
13293  *
13294  * @property
13295  */
13296  __Pyx_XDECREF(__pyx_r);
13297  __Pyx_INCREF(__pyx_v_self->obj);
13298  __pyx_r = __pyx_v_self->obj;
13299  goto __pyx_L0;
13300 
13301  /* "View.MemoryView":559
13302  *
13303  * @property
13304  * def base(self): # <<<<<<<<<<<<<<
13305  * return self.obj
13306  *
13307  */
13308 
13309  /* function exit code */
13310  __pyx_L0:;
13311  __Pyx_XGIVEREF(__pyx_r);
13312  __Pyx_RefNannyFinishContext();
13313  return __pyx_r;
13314 }
13315 
13316 /* "View.MemoryView":563
13317  *
13318  * @property
13319  * def shape(self): # <<<<<<<<<<<<<<
13320  * return tuple([length for length in self.view.shape[:self.view.ndim]])
13321  *
13322  */
13323 
13324 /* Python wrapper */
13325 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
13326 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
13327  PyObject *__pyx_r = 0;
13328  __Pyx_RefNannyDeclarations
13329  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13330  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13331 
13332  /* function exit code */
13333  __Pyx_RefNannyFinishContext();
13334  return __pyx_r;
13335 }
13336 
13337 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13338  Py_ssize_t __pyx_v_length;
13339  PyObject *__pyx_r = NULL;
13340  __Pyx_RefNannyDeclarations
13341  PyObject *__pyx_t_1 = NULL;
13342  Py_ssize_t *__pyx_t_2;
13343  Py_ssize_t *__pyx_t_3;
13344  Py_ssize_t *__pyx_t_4;
13345  PyObject *__pyx_t_5 = NULL;
13346  int __pyx_lineno = 0;
13347  const char *__pyx_filename = NULL;
13348  int __pyx_clineno = 0;
13349  __Pyx_RefNannySetupContext("__get__", 0);
13350 
13351  /* "View.MemoryView":564
13352  * @property
13353  * def shape(self):
13354  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
13355  *
13356  * @property
13357  */
13358  __Pyx_XDECREF(__pyx_r);
13359  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error)
13360  __Pyx_GOTREF(__pyx_t_1);
13361  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13362  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
13363  __pyx_t_2 = __pyx_t_4;
13364  __pyx_v_length = (__pyx_t_2[0]);
13365  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
13366  __Pyx_GOTREF(__pyx_t_5);
13367  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error)
13368  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13369  }
13370  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
13371  __Pyx_GOTREF(__pyx_t_5);
13372  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13373  __pyx_r = __pyx_t_5;
13374  __pyx_t_5 = 0;
13375  goto __pyx_L0;
13376 
13377  /* "View.MemoryView":563
13378  *
13379  * @property
13380  * def shape(self): # <<<<<<<<<<<<<<
13381  * return tuple([length for length in self.view.shape[:self.view.ndim]])
13382  *
13383  */
13384 
13385  /* function exit code */
13386  __pyx_L1_error:;
13387  __Pyx_XDECREF(__pyx_t_1);
13388  __Pyx_XDECREF(__pyx_t_5);
13389  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13390  __pyx_r = NULL;
13391  __pyx_L0:;
13392  __Pyx_XGIVEREF(__pyx_r);
13393  __Pyx_RefNannyFinishContext();
13394  return __pyx_r;
13395 }
13396 
13397 /* "View.MemoryView":567
13398  *
13399  * @property
13400  * def strides(self): # <<<<<<<<<<<<<<
13401  * if self.view.strides == NULL:
13402  *
13403  */
13404 
13405 /* Python wrapper */
13406 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
13407 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
13408  PyObject *__pyx_r = 0;
13409  __Pyx_RefNannyDeclarations
13410  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13411  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13412 
13413  /* function exit code */
13414  __Pyx_RefNannyFinishContext();
13415  return __pyx_r;
13416 }
13417 
13418 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13419  Py_ssize_t __pyx_v_stride;
13420  PyObject *__pyx_r = NULL;
13421  __Pyx_RefNannyDeclarations
13422  int __pyx_t_1;
13423  PyObject *__pyx_t_2 = NULL;
13424  Py_ssize_t *__pyx_t_3;
13425  Py_ssize_t *__pyx_t_4;
13426  Py_ssize_t *__pyx_t_5;
13427  PyObject *__pyx_t_6 = NULL;
13428  int __pyx_lineno = 0;
13429  const char *__pyx_filename = NULL;
13430  int __pyx_clineno = 0;
13431  __Pyx_RefNannySetupContext("__get__", 0);
13432 
13433  /* "View.MemoryView":568
13434  * @property
13435  * def strides(self):
13436  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
13437  *
13438  * raise ValueError("Buffer view does not expose strides")
13439  */
13440  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
13441  if (unlikely(__pyx_t_1)) {
13442 
13443  /* "View.MemoryView":570
13444  * if self.view.strides == NULL:
13445  *
13446  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
13447  *
13448  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
13449  */
13450  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error)
13451  __Pyx_GOTREF(__pyx_t_2);
13452  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
13453  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13454  __PYX_ERR(1, 570, __pyx_L1_error)
13455 
13456  /* "View.MemoryView":568
13457  * @property
13458  * def strides(self):
13459  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
13460  *
13461  * raise ValueError("Buffer view does not expose strides")
13462  */
13463  }
13464 
13465  /* "View.MemoryView":572
13466  * raise ValueError("Buffer view does not expose strides")
13467  *
13468  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
13469  *
13470  * @property
13471  */
13472  __Pyx_XDECREF(__pyx_r);
13473  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
13474  __Pyx_GOTREF(__pyx_t_2);
13475  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
13476  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13477  __pyx_t_3 = __pyx_t_5;
13478  __pyx_v_stride = (__pyx_t_3[0]);
13479  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
13480  __Pyx_GOTREF(__pyx_t_6);
13481  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error)
13482  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13483  }
13484  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
13485  __Pyx_GOTREF(__pyx_t_6);
13486  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13487  __pyx_r = __pyx_t_6;
13488  __pyx_t_6 = 0;
13489  goto __pyx_L0;
13490 
13491  /* "View.MemoryView":567
13492  *
13493  * @property
13494  * def strides(self): # <<<<<<<<<<<<<<
13495  * if self.view.strides == NULL:
13496  *
13497  */
13498 
13499  /* function exit code */
13500  __pyx_L1_error:;
13501  __Pyx_XDECREF(__pyx_t_2);
13502  __Pyx_XDECREF(__pyx_t_6);
13503  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13504  __pyx_r = NULL;
13505  __pyx_L0:;
13506  __Pyx_XGIVEREF(__pyx_r);
13507  __Pyx_RefNannyFinishContext();
13508  return __pyx_r;
13509 }
13510 
13511 /* "View.MemoryView":575
13512  *
13513  * @property
13514  * def suboffsets(self): # <<<<<<<<<<<<<<
13515  * if self.view.suboffsets == NULL:
13516  * return (-1,) * self.view.ndim
13517  */
13518 
13519 /* Python wrapper */
13520 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
13521 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
13522  PyObject *__pyx_r = 0;
13523  __Pyx_RefNannyDeclarations
13524  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13525  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13526 
13527  /* function exit code */
13528  __Pyx_RefNannyFinishContext();
13529  return __pyx_r;
13530 }
13531 
13532 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13533  Py_ssize_t __pyx_v_suboffset;
13534  PyObject *__pyx_r = NULL;
13535  __Pyx_RefNannyDeclarations
13536  int __pyx_t_1;
13537  PyObject *__pyx_t_2 = NULL;
13538  PyObject *__pyx_t_3 = NULL;
13539  Py_ssize_t *__pyx_t_4;
13540  Py_ssize_t *__pyx_t_5;
13541  Py_ssize_t *__pyx_t_6;
13542  int __pyx_lineno = 0;
13543  const char *__pyx_filename = NULL;
13544  int __pyx_clineno = 0;
13545  __Pyx_RefNannySetupContext("__get__", 0);
13546 
13547  /* "View.MemoryView":576
13548  * @property
13549  * def suboffsets(self):
13550  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
13551  * return (-1,) * self.view.ndim
13552  *
13553  */
13554  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
13555  if (__pyx_t_1) {
13556 
13557  /* "View.MemoryView":577
13558  * def suboffsets(self):
13559  * if self.view.suboffsets == NULL:
13560  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
13561  *
13562  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
13563  */
13564  __Pyx_XDECREF(__pyx_r);
13565  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
13566  __Pyx_GOTREF(__pyx_t_2);
13567  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__18, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error)
13568  __Pyx_GOTREF(__pyx_t_3);
13569  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13570  __pyx_r = __pyx_t_3;
13571  __pyx_t_3 = 0;
13572  goto __pyx_L0;
13573 
13574  /* "View.MemoryView":576
13575  * @property
13576  * def suboffsets(self):
13577  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
13578  * return (-1,) * self.view.ndim
13579  *
13580  */
13581  }
13582 
13583  /* "View.MemoryView":579
13584  * return (-1,) * self.view.ndim
13585  *
13586  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
13587  *
13588  * @property
13589  */
13590  __Pyx_XDECREF(__pyx_r);
13591  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
13592  __Pyx_GOTREF(__pyx_t_3);
13593  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
13594  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
13595  __pyx_t_4 = __pyx_t_6;
13596  __pyx_v_suboffset = (__pyx_t_4[0]);
13597  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
13598  __Pyx_GOTREF(__pyx_t_2);
13599  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error)
13600  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13601  }
13602  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
13603  __Pyx_GOTREF(__pyx_t_2);
13604  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13605  __pyx_r = __pyx_t_2;
13606  __pyx_t_2 = 0;
13607  goto __pyx_L0;
13608 
13609  /* "View.MemoryView":575
13610  *
13611  * @property
13612  * def suboffsets(self): # <<<<<<<<<<<<<<
13613  * if self.view.suboffsets == NULL:
13614  * return (-1,) * self.view.ndim
13615  */
13616 
13617  /* function exit code */
13618  __pyx_L1_error:;
13619  __Pyx_XDECREF(__pyx_t_2);
13620  __Pyx_XDECREF(__pyx_t_3);
13621  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13622  __pyx_r = NULL;
13623  __pyx_L0:;
13624  __Pyx_XGIVEREF(__pyx_r);
13625  __Pyx_RefNannyFinishContext();
13626  return __pyx_r;
13627 }
13628 
13629 /* "View.MemoryView":582
13630  *
13631  * @property
13632  * def ndim(self): # <<<<<<<<<<<<<<
13633  * return self.view.ndim
13634  *
13635  */
13636 
13637 /* Python wrapper */
13638 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
13639 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
13640  PyObject *__pyx_r = 0;
13641  __Pyx_RefNannyDeclarations
13642  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13643  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13644 
13645  /* function exit code */
13646  __Pyx_RefNannyFinishContext();
13647  return __pyx_r;
13648 }
13649 
13650 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13651  PyObject *__pyx_r = NULL;
13652  __Pyx_RefNannyDeclarations
13653  PyObject *__pyx_t_1 = NULL;
13654  int __pyx_lineno = 0;
13655  const char *__pyx_filename = NULL;
13656  int __pyx_clineno = 0;
13657  __Pyx_RefNannySetupContext("__get__", 0);
13658 
13659  /* "View.MemoryView":583
13660  * @property
13661  * def ndim(self):
13662  * return self.view.ndim # <<<<<<<<<<<<<<
13663  *
13664  * @property
13665  */
13666  __Pyx_XDECREF(__pyx_r);
13667  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
13668  __Pyx_GOTREF(__pyx_t_1);
13669  __pyx_r = __pyx_t_1;
13670  __pyx_t_1 = 0;
13671  goto __pyx_L0;
13672 
13673  /* "View.MemoryView":582
13674  *
13675  * @property
13676  * def ndim(self): # <<<<<<<<<<<<<<
13677  * return self.view.ndim
13678  *
13679  */
13680 
13681  /* function exit code */
13682  __pyx_L1_error:;
13683  __Pyx_XDECREF(__pyx_t_1);
13684  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13685  __pyx_r = NULL;
13686  __pyx_L0:;
13687  __Pyx_XGIVEREF(__pyx_r);
13688  __Pyx_RefNannyFinishContext();
13689  return __pyx_r;
13690 }
13691 
13692 /* "View.MemoryView":586
13693  *
13694  * @property
13695  * def itemsize(self): # <<<<<<<<<<<<<<
13696  * return self.view.itemsize
13697  *
13698  */
13699 
13700 /* Python wrapper */
13701 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
13702 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
13703  PyObject *__pyx_r = 0;
13704  __Pyx_RefNannyDeclarations
13705  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13706  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13707 
13708  /* function exit code */
13709  __Pyx_RefNannyFinishContext();
13710  return __pyx_r;
13711 }
13712 
13713 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13714  PyObject *__pyx_r = NULL;
13715  __Pyx_RefNannyDeclarations
13716  PyObject *__pyx_t_1 = NULL;
13717  int __pyx_lineno = 0;
13718  const char *__pyx_filename = NULL;
13719  int __pyx_clineno = 0;
13720  __Pyx_RefNannySetupContext("__get__", 0);
13721 
13722  /* "View.MemoryView":587
13723  * @property
13724  * def itemsize(self):
13725  * return self.view.itemsize # <<<<<<<<<<<<<<
13726  *
13727  * @property
13728  */
13729  __Pyx_XDECREF(__pyx_r);
13730  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
13731  __Pyx_GOTREF(__pyx_t_1);
13732  __pyx_r = __pyx_t_1;
13733  __pyx_t_1 = 0;
13734  goto __pyx_L0;
13735 
13736  /* "View.MemoryView":586
13737  *
13738  * @property
13739  * def itemsize(self): # <<<<<<<<<<<<<<
13740  * return self.view.itemsize
13741  *
13742  */
13743 
13744  /* function exit code */
13745  __pyx_L1_error:;
13746  __Pyx_XDECREF(__pyx_t_1);
13747  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13748  __pyx_r = NULL;
13749  __pyx_L0:;
13750  __Pyx_XGIVEREF(__pyx_r);
13751  __Pyx_RefNannyFinishContext();
13752  return __pyx_r;
13753 }
13754 
13755 /* "View.MemoryView":590
13756  *
13757  * @property
13758  * def nbytes(self): # <<<<<<<<<<<<<<
13759  * return self.size * self.view.itemsize
13760  *
13761  */
13762 
13763 /* Python wrapper */
13764 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
13765 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
13766  PyObject *__pyx_r = 0;
13767  __Pyx_RefNannyDeclarations
13768  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13769  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13770 
13771  /* function exit code */
13772  __Pyx_RefNannyFinishContext();
13773  return __pyx_r;
13774 }
13775 
13776 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13777  PyObject *__pyx_r = NULL;
13778  __Pyx_RefNannyDeclarations
13779  PyObject *__pyx_t_1 = NULL;
13780  PyObject *__pyx_t_2 = NULL;
13781  PyObject *__pyx_t_3 = NULL;
13782  int __pyx_lineno = 0;
13783  const char *__pyx_filename = NULL;
13784  int __pyx_clineno = 0;
13785  __Pyx_RefNannySetupContext("__get__", 0);
13786 
13787  /* "View.MemoryView":591
13788  * @property
13789  * def nbytes(self):
13790  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
13791  *
13792  * @property
13793  */
13794  __Pyx_XDECREF(__pyx_r);
13795  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error)
13796  __Pyx_GOTREF(__pyx_t_1);
13797  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error)
13798  __Pyx_GOTREF(__pyx_t_2);
13799  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error)
13800  __Pyx_GOTREF(__pyx_t_3);
13801  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13802  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13803  __pyx_r = __pyx_t_3;
13804  __pyx_t_3 = 0;
13805  goto __pyx_L0;
13806 
13807  /* "View.MemoryView":590
13808  *
13809  * @property
13810  * def nbytes(self): # <<<<<<<<<<<<<<
13811  * return self.size * self.view.itemsize
13812  *
13813  */
13814 
13815  /* function exit code */
13816  __pyx_L1_error:;
13817  __Pyx_XDECREF(__pyx_t_1);
13818  __Pyx_XDECREF(__pyx_t_2);
13819  __Pyx_XDECREF(__pyx_t_3);
13820  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13821  __pyx_r = NULL;
13822  __pyx_L0:;
13823  __Pyx_XGIVEREF(__pyx_r);
13824  __Pyx_RefNannyFinishContext();
13825  return __pyx_r;
13826 }
13827 
13828 /* "View.MemoryView":594
13829  *
13830  * @property
13831  * def size(self): # <<<<<<<<<<<<<<
13832  * if self._size is None:
13833  * result = 1
13834  */
13835 
13836 /* Python wrapper */
13837 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
13838 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
13839  PyObject *__pyx_r = 0;
13840  __Pyx_RefNannyDeclarations
13841  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13842  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13843 
13844  /* function exit code */
13845  __Pyx_RefNannyFinishContext();
13846  return __pyx_r;
13847 }
13848 
13849 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13850  PyObject *__pyx_v_result = NULL;
13851  PyObject *__pyx_v_length = NULL;
13852  PyObject *__pyx_r = NULL;
13853  __Pyx_RefNannyDeclarations
13854  int __pyx_t_1;
13855  int __pyx_t_2;
13856  Py_ssize_t *__pyx_t_3;
13857  Py_ssize_t *__pyx_t_4;
13858  Py_ssize_t *__pyx_t_5;
13859  PyObject *__pyx_t_6 = NULL;
13860  int __pyx_lineno = 0;
13861  const char *__pyx_filename = NULL;
13862  int __pyx_clineno = 0;
13863  __Pyx_RefNannySetupContext("__get__", 0);
13864 
13865  /* "View.MemoryView":595
13866  * @property
13867  * def size(self):
13868  * if self._size is None: # <<<<<<<<<<<<<<
13869  * result = 1
13870  *
13871  */
13872  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
13873  __pyx_t_2 = (__pyx_t_1 != 0);
13874  if (__pyx_t_2) {
13875 
13876  /* "View.MemoryView":596
13877  * def size(self):
13878  * if self._size is None:
13879  * result = 1 # <<<<<<<<<<<<<<
13880  *
13881  * for length in self.view.shape[:self.view.ndim]:
13882  */
13883  __Pyx_INCREF(__pyx_int_1);
13884  __pyx_v_result = __pyx_int_1;
13885 
13886  /* "View.MemoryView":598
13887  * result = 1
13888  *
13889  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
13890  * result *= length
13891  *
13892  */
13893  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13894  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13895  __pyx_t_3 = __pyx_t_5;
13896  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
13897  __Pyx_GOTREF(__pyx_t_6);
13898  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
13899  __pyx_t_6 = 0;
13900 
13901  /* "View.MemoryView":599
13902  *
13903  * for length in self.view.shape[:self.view.ndim]:
13904  * result *= length # <<<<<<<<<<<<<<
13905  *
13906  * self._size = result
13907  */
13908  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
13909  __Pyx_GOTREF(__pyx_t_6);
13910  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
13911  __pyx_t_6 = 0;
13912  }
13913 
13914  /* "View.MemoryView":601
13915  * result *= length
13916  *
13917  * self._size = result # <<<<<<<<<<<<<<
13918  *
13919  * return self._size
13920  */
13921  __Pyx_INCREF(__pyx_v_result);
13922  __Pyx_GIVEREF(__pyx_v_result);
13923  __Pyx_GOTREF(__pyx_v_self->_size);
13924  __Pyx_DECREF(__pyx_v_self->_size);
13925  __pyx_v_self->_size = __pyx_v_result;
13926 
13927  /* "View.MemoryView":595
13928  * @property
13929  * def size(self):
13930  * if self._size is None: # <<<<<<<<<<<<<<
13931  * result = 1
13932  *
13933  */
13934  }
13935 
13936  /* "View.MemoryView":603
13937  * self._size = result
13938  *
13939  * return self._size # <<<<<<<<<<<<<<
13940  *
13941  * def __len__(self):
13942  */
13943  __Pyx_XDECREF(__pyx_r);
13944  __Pyx_INCREF(__pyx_v_self->_size);
13945  __pyx_r = __pyx_v_self->_size;
13946  goto __pyx_L0;
13947 
13948  /* "View.MemoryView":594
13949  *
13950  * @property
13951  * def size(self): # <<<<<<<<<<<<<<
13952  * if self._size is None:
13953  * result = 1
13954  */
13955 
13956  /* function exit code */
13957  __pyx_L1_error:;
13958  __Pyx_XDECREF(__pyx_t_6);
13959  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13960  __pyx_r = NULL;
13961  __pyx_L0:;
13962  __Pyx_XDECREF(__pyx_v_result);
13963  __Pyx_XDECREF(__pyx_v_length);
13964  __Pyx_XGIVEREF(__pyx_r);
13965  __Pyx_RefNannyFinishContext();
13966  return __pyx_r;
13967 }
13968 
13969 /* "View.MemoryView":605
13970  * return self._size
13971  *
13972  * def __len__(self): # <<<<<<<<<<<<<<
13973  * if self.view.ndim >= 1:
13974  * return self.view.shape[0]
13975  */
13976 
13977 /* Python wrapper */
13978 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
13979 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
13980  Py_ssize_t __pyx_r;
13981  __Pyx_RefNannyDeclarations
13982  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
13983  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13984 
13985  /* function exit code */
13986  __Pyx_RefNannyFinishContext();
13987  return __pyx_r;
13988 }
13989 
13990 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
13991  Py_ssize_t __pyx_r;
13992  __Pyx_RefNannyDeclarations
13993  int __pyx_t_1;
13994  __Pyx_RefNannySetupContext("__len__", 0);
13995 
13996  /* "View.MemoryView":606
13997  *
13998  * def __len__(self):
13999  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
14000  * return self.view.shape[0]
14001  *
14002  */
14003  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
14004  if (__pyx_t_1) {
14005 
14006  /* "View.MemoryView":607
14007  * def __len__(self):
14008  * if self.view.ndim >= 1:
14009  * return self.view.shape[0] # <<<<<<<<<<<<<<
14010  *
14011  * return 0
14012  */
14013  __pyx_r = (__pyx_v_self->view.shape[0]);
14014  goto __pyx_L0;
14015 
14016  /* "View.MemoryView":606
14017  *
14018  * def __len__(self):
14019  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
14020  * return self.view.shape[0]
14021  *
14022  */
14023  }
14024 
14025  /* "View.MemoryView":609
14026  * return self.view.shape[0]
14027  *
14028  * return 0 # <<<<<<<<<<<<<<
14029  *
14030  * def __repr__(self):
14031  */
14032  __pyx_r = 0;
14033  goto __pyx_L0;
14034 
14035  /* "View.MemoryView":605
14036  * return self._size
14037  *
14038  * def __len__(self): # <<<<<<<<<<<<<<
14039  * if self.view.ndim >= 1:
14040  * return self.view.shape[0]
14041  */
14042 
14043  /* function exit code */
14044  __pyx_L0:;
14045  __Pyx_RefNannyFinishContext();
14046  return __pyx_r;
14047 }
14048 
14049 /* "View.MemoryView":611
14050  * return 0
14051  *
14052  * def __repr__(self): # <<<<<<<<<<<<<<
14053  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14054  * id(self))
14055  */
14056 
14057 /* Python wrapper */
14058 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
14059 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
14060  PyObject *__pyx_r = 0;
14061  __Pyx_RefNannyDeclarations
14062  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
14063  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14064 
14065  /* function exit code */
14066  __Pyx_RefNannyFinishContext();
14067  return __pyx_r;
14068 }
14069 
14070 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
14071  PyObject *__pyx_r = NULL;
14072  __Pyx_RefNannyDeclarations
14073  PyObject *__pyx_t_1 = NULL;
14074  PyObject *__pyx_t_2 = NULL;
14075  PyObject *__pyx_t_3 = NULL;
14076  int __pyx_lineno = 0;
14077  const char *__pyx_filename = NULL;
14078  int __pyx_clineno = 0;
14079  __Pyx_RefNannySetupContext("__repr__", 0);
14080 
14081  /* "View.MemoryView":612
14082  *
14083  * def __repr__(self):
14084  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
14085  * id(self))
14086  *
14087  */
14088  __Pyx_XDECREF(__pyx_r);
14089  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
14090  __Pyx_GOTREF(__pyx_t_1);
14091  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
14092  __Pyx_GOTREF(__pyx_t_2);
14093  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14094  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
14095  __Pyx_GOTREF(__pyx_t_1);
14096  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14097 
14098  /* "View.MemoryView":613
14099  * def __repr__(self):
14100  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14101  * id(self)) # <<<<<<<<<<<<<<
14102  *
14103  * def __str__(self):
14104  */
14105  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error)
14106  __Pyx_GOTREF(__pyx_t_2);
14107 
14108  /* "View.MemoryView":612
14109  *
14110  * def __repr__(self):
14111  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
14112  * id(self))
14113  *
14114  */
14115  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
14116  __Pyx_GOTREF(__pyx_t_3);
14117  __Pyx_GIVEREF(__pyx_t_1);
14118  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
14119  __Pyx_GIVEREF(__pyx_t_2);
14120  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
14121  __pyx_t_1 = 0;
14122  __pyx_t_2 = 0;
14123  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
14124  __Pyx_GOTREF(__pyx_t_2);
14125  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14126  __pyx_r = __pyx_t_2;
14127  __pyx_t_2 = 0;
14128  goto __pyx_L0;
14129 
14130  /* "View.MemoryView":611
14131  * return 0
14132  *
14133  * def __repr__(self): # <<<<<<<<<<<<<<
14134  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
14135  * id(self))
14136  */
14137 
14138  /* function exit code */
14139  __pyx_L1_error:;
14140  __Pyx_XDECREF(__pyx_t_1);
14141  __Pyx_XDECREF(__pyx_t_2);
14142  __Pyx_XDECREF(__pyx_t_3);
14143  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14144  __pyx_r = NULL;
14145  __pyx_L0:;
14146  __Pyx_XGIVEREF(__pyx_r);
14147  __Pyx_RefNannyFinishContext();
14148  return __pyx_r;
14149 }
14150 
14151 /* "View.MemoryView":615
14152  * id(self))
14153  *
14154  * def __str__(self): # <<<<<<<<<<<<<<
14155  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
14156  *
14157  */
14158 
14159 /* Python wrapper */
14160 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
14161 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
14162  PyObject *__pyx_r = 0;
14163  __Pyx_RefNannyDeclarations
14164  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
14165  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14166 
14167  /* function exit code */
14168  __Pyx_RefNannyFinishContext();
14169  return __pyx_r;
14170 }
14171 
14172 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
14173  PyObject *__pyx_r = NULL;
14174  __Pyx_RefNannyDeclarations
14175  PyObject *__pyx_t_1 = NULL;
14176  PyObject *__pyx_t_2 = NULL;
14177  int __pyx_lineno = 0;
14178  const char *__pyx_filename = NULL;
14179  int __pyx_clineno = 0;
14180  __Pyx_RefNannySetupContext("__str__", 0);
14181 
14182  /* "View.MemoryView":616
14183  *
14184  * def __str__(self):
14185  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
14186  *
14187  *
14188  */
14189  __Pyx_XDECREF(__pyx_r);
14190  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
14191  __Pyx_GOTREF(__pyx_t_1);
14192  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
14193  __Pyx_GOTREF(__pyx_t_2);
14194  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14195  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
14196  __Pyx_GOTREF(__pyx_t_1);
14197  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14198  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
14199  __Pyx_GOTREF(__pyx_t_2);
14200  __Pyx_GIVEREF(__pyx_t_1);
14201  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
14202  __pyx_t_1 = 0;
14203  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
14204  __Pyx_GOTREF(__pyx_t_1);
14205  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14206  __pyx_r = __pyx_t_1;
14207  __pyx_t_1 = 0;
14208  goto __pyx_L0;
14209 
14210  /* "View.MemoryView":615
14211  * id(self))
14212  *
14213  * def __str__(self): # <<<<<<<<<<<<<<
14214  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
14215  *
14216  */
14217 
14218  /* function exit code */
14219  __pyx_L1_error:;
14220  __Pyx_XDECREF(__pyx_t_1);
14221  __Pyx_XDECREF(__pyx_t_2);
14222  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14223  __pyx_r = NULL;
14224  __pyx_L0:;
14225  __Pyx_XGIVEREF(__pyx_r);
14226  __Pyx_RefNannyFinishContext();
14227  return __pyx_r;
14228 }
14229 
14230 /* "View.MemoryView":619
14231  *
14232  *
14233  * def is_c_contig(self): # <<<<<<<<<<<<<<
14234  * cdef __Pyx_memviewslice *mslice
14235  * cdef __Pyx_memviewslice tmp
14236  */
14237 
14238 /* Python wrapper */
14239 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14240 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14241  PyObject *__pyx_r = 0;
14242  __Pyx_RefNannyDeclarations
14243  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
14244  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
14245 
14246  /* function exit code */
14247  __Pyx_RefNannyFinishContext();
14248  return __pyx_r;
14249 }
14250 
14251 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
14252  __Pyx_memviewslice *__pyx_v_mslice;
14253  __Pyx_memviewslice __pyx_v_tmp;
14254  PyObject *__pyx_r = NULL;
14255  __Pyx_RefNannyDeclarations
14256  __Pyx_memviewslice *__pyx_t_1;
14257  PyObject *__pyx_t_2 = NULL;
14258  int __pyx_lineno = 0;
14259  const char *__pyx_filename = NULL;
14260  int __pyx_clineno = 0;
14261  __Pyx_RefNannySetupContext("is_c_contig", 0);
14262 
14263  /* "View.MemoryView":622
14264  * cdef __Pyx_memviewslice *mslice
14265  * cdef __Pyx_memviewslice tmp
14266  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
14267  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14268  *
14269  */
14270  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 622, __pyx_L1_error)
14271  __pyx_v_mslice = __pyx_t_1;
14272 
14273  /* "View.MemoryView":623
14274  * cdef __Pyx_memviewslice tmp
14275  * mslice = get_slice_from_memview(self, &tmp)
14276  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
14277  *
14278  * def is_f_contig(self):
14279  */
14280  __Pyx_XDECREF(__pyx_r);
14281  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 623, __pyx_L1_error)
14282  __Pyx_GOTREF(__pyx_t_2);
14283  __pyx_r = __pyx_t_2;
14284  __pyx_t_2 = 0;
14285  goto __pyx_L0;
14286 
14287  /* "View.MemoryView":619
14288  *
14289  *
14290  * def is_c_contig(self): # <<<<<<<<<<<<<<
14291  * cdef __Pyx_memviewslice *mslice
14292  * cdef __Pyx_memviewslice tmp
14293  */
14294 
14295  /* function exit code */
14296  __pyx_L1_error:;
14297  __Pyx_XDECREF(__pyx_t_2);
14298  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14299  __pyx_r = NULL;
14300  __pyx_L0:;
14301  __Pyx_XGIVEREF(__pyx_r);
14302  __Pyx_RefNannyFinishContext();
14303  return __pyx_r;
14304 }
14305 
14306 /* "View.MemoryView":625
14307  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14308  *
14309  * def is_f_contig(self): # <<<<<<<<<<<<<<
14310  * cdef __Pyx_memviewslice *mslice
14311  * cdef __Pyx_memviewslice tmp
14312  */
14313 
14314 /* Python wrapper */
14315 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14316 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14317  PyObject *__pyx_r = 0;
14318  __Pyx_RefNannyDeclarations
14319  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
14320  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
14321 
14322  /* function exit code */
14323  __Pyx_RefNannyFinishContext();
14324  return __pyx_r;
14325 }
14326 
14327 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
14328  __Pyx_memviewslice *__pyx_v_mslice;
14329  __Pyx_memviewslice __pyx_v_tmp;
14330  PyObject *__pyx_r = NULL;
14331  __Pyx_RefNannyDeclarations
14332  __Pyx_memviewslice *__pyx_t_1;
14333  PyObject *__pyx_t_2 = NULL;
14334  int __pyx_lineno = 0;
14335  const char *__pyx_filename = NULL;
14336  int __pyx_clineno = 0;
14337  __Pyx_RefNannySetupContext("is_f_contig", 0);
14338 
14339  /* "View.MemoryView":628
14340  * cdef __Pyx_memviewslice *mslice
14341  * cdef __Pyx_memviewslice tmp
14342  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
14343  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14344  *
14345  */
14346  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 628, __pyx_L1_error)
14347  __pyx_v_mslice = __pyx_t_1;
14348 
14349  /* "View.MemoryView":629
14350  * cdef __Pyx_memviewslice tmp
14351  * mslice = get_slice_from_memview(self, &tmp)
14352  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
14353  *
14354  * def copy(self):
14355  */
14356  __Pyx_XDECREF(__pyx_r);
14357  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
14358  __Pyx_GOTREF(__pyx_t_2);
14359  __pyx_r = __pyx_t_2;
14360  __pyx_t_2 = 0;
14361  goto __pyx_L0;
14362 
14363  /* "View.MemoryView":625
14364  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
14365  *
14366  * def is_f_contig(self): # <<<<<<<<<<<<<<
14367  * cdef __Pyx_memviewslice *mslice
14368  * cdef __Pyx_memviewslice tmp
14369  */
14370 
14371  /* function exit code */
14372  __pyx_L1_error:;
14373  __Pyx_XDECREF(__pyx_t_2);
14374  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14375  __pyx_r = NULL;
14376  __pyx_L0:;
14377  __Pyx_XGIVEREF(__pyx_r);
14378  __Pyx_RefNannyFinishContext();
14379  return __pyx_r;
14380 }
14381 
14382 /* "View.MemoryView":631
14383  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14384  *
14385  * def copy(self): # <<<<<<<<<<<<<<
14386  * cdef __Pyx_memviewslice mslice
14387  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14388  */
14389 
14390 /* Python wrapper */
14391 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14392 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14393  PyObject *__pyx_r = 0;
14394  __Pyx_RefNannyDeclarations
14395  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
14396  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
14397 
14398  /* function exit code */
14399  __Pyx_RefNannyFinishContext();
14400  return __pyx_r;
14401 }
14402 
14403 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
14404  __Pyx_memviewslice __pyx_v_mslice;
14405  int __pyx_v_flags;
14406  PyObject *__pyx_r = NULL;
14407  __Pyx_RefNannyDeclarations
14408  __Pyx_memviewslice __pyx_t_1;
14409  PyObject *__pyx_t_2 = NULL;
14410  int __pyx_lineno = 0;
14411  const char *__pyx_filename = NULL;
14412  int __pyx_clineno = 0;
14413  __Pyx_RefNannySetupContext("copy", 0);
14414 
14415  /* "View.MemoryView":633
14416  * def copy(self):
14417  * cdef __Pyx_memviewslice mslice
14418  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
14419  *
14420  * slice_copy(self, &mslice)
14421  */
14422  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
14423 
14424  /* "View.MemoryView":635
14425  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14426  *
14427  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
14428  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
14429  * self.view.itemsize,
14430  */
14431  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
14432 
14433  /* "View.MemoryView":636
14434  *
14435  * slice_copy(self, &mslice)
14436  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
14437  * self.view.itemsize,
14438  * flags|PyBUF_C_CONTIGUOUS,
14439  */
14440  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 636, __pyx_L1_error)
14441  __pyx_v_mslice = __pyx_t_1;
14442 
14443  /* "View.MemoryView":641
14444  * self.dtype_is_object)
14445  *
14446  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
14447  *
14448  * def copy_fortran(self):
14449  */
14450  __Pyx_XDECREF(__pyx_r);
14451  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error)
14452  __Pyx_GOTREF(__pyx_t_2);
14453  __pyx_r = __pyx_t_2;
14454  __pyx_t_2 = 0;
14455  goto __pyx_L0;
14456 
14457  /* "View.MemoryView":631
14458  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14459  *
14460  * def copy(self): # <<<<<<<<<<<<<<
14461  * cdef __Pyx_memviewslice mslice
14462  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14463  */
14464 
14465  /* function exit code */
14466  __pyx_L1_error:;
14467  __Pyx_XDECREF(__pyx_t_2);
14468  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
14469  __pyx_r = NULL;
14470  __pyx_L0:;
14471  __Pyx_XGIVEREF(__pyx_r);
14472  __Pyx_RefNannyFinishContext();
14473  return __pyx_r;
14474 }
14475 
14476 /* "View.MemoryView":643
14477  * return memoryview_copy_from_slice(self, &mslice)
14478  *
14479  * def copy_fortran(self): # <<<<<<<<<<<<<<
14480  * cdef __Pyx_memviewslice src, dst
14481  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14482  */
14483 
14484 /* Python wrapper */
14485 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14486 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14487  PyObject *__pyx_r = 0;
14488  __Pyx_RefNannyDeclarations
14489  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
14490  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
14491 
14492  /* function exit code */
14493  __Pyx_RefNannyFinishContext();
14494  return __pyx_r;
14495 }
14496 
14497 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
14498  __Pyx_memviewslice __pyx_v_src;
14499  __Pyx_memviewslice __pyx_v_dst;
14500  int __pyx_v_flags;
14501  PyObject *__pyx_r = NULL;
14502  __Pyx_RefNannyDeclarations
14503  __Pyx_memviewslice __pyx_t_1;
14504  PyObject *__pyx_t_2 = NULL;
14505  int __pyx_lineno = 0;
14506  const char *__pyx_filename = NULL;
14507  int __pyx_clineno = 0;
14508  __Pyx_RefNannySetupContext("copy_fortran", 0);
14509 
14510  /* "View.MemoryView":645
14511  * def copy_fortran(self):
14512  * cdef __Pyx_memviewslice src, dst
14513  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
14514  *
14515  * slice_copy(self, &src)
14516  */
14517  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
14518 
14519  /* "View.MemoryView":647
14520  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14521  *
14522  * slice_copy(self, &src) # <<<<<<<<<<<<<<
14523  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
14524  * self.view.itemsize,
14525  */
14526  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
14527 
14528  /* "View.MemoryView":648
14529  *
14530  * slice_copy(self, &src)
14531  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
14532  * self.view.itemsize,
14533  * flags|PyBUF_F_CONTIGUOUS,
14534  */
14535  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 648, __pyx_L1_error)
14536  __pyx_v_dst = __pyx_t_1;
14537 
14538  /* "View.MemoryView":653
14539  * self.dtype_is_object)
14540  *
14541  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
14542  *
14543  *
14544  */
14545  __Pyx_XDECREF(__pyx_r);
14546  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
14547  __Pyx_GOTREF(__pyx_t_2);
14548  __pyx_r = __pyx_t_2;
14549  __pyx_t_2 = 0;
14550  goto __pyx_L0;
14551 
14552  /* "View.MemoryView":643
14553  * return memoryview_copy_from_slice(self, &mslice)
14554  *
14555  * def copy_fortran(self): # <<<<<<<<<<<<<<
14556  * cdef __Pyx_memviewslice src, dst
14557  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14558  */
14559 
14560  /* function exit code */
14561  __pyx_L1_error:;
14562  __Pyx_XDECREF(__pyx_t_2);
14563  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
14564  __pyx_r = NULL;
14565  __pyx_L0:;
14566  __Pyx_XGIVEREF(__pyx_r);
14567  __Pyx_RefNannyFinishContext();
14568  return __pyx_r;
14569 }
14570 
14571 /* "(tree fragment)":1
14572  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14573  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14574  * def __setstate_cython__(self, __pyx_state):
14575  */
14576 
14577 /* Python wrapper */
14578 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14579 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14580  PyObject *__pyx_r = 0;
14581  __Pyx_RefNannyDeclarations
14582  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
14583  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14584 
14585  /* function exit code */
14586  __Pyx_RefNannyFinishContext();
14587  return __pyx_r;
14588 }
14589 
14590 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
14591  PyObject *__pyx_r = NULL;
14592  __Pyx_RefNannyDeclarations
14593  PyObject *__pyx_t_1 = NULL;
14594  int __pyx_lineno = 0;
14595  const char *__pyx_filename = NULL;
14596  int __pyx_clineno = 0;
14597  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
14598 
14599  /* "(tree fragment)":2
14600  * def __reduce_cython__(self):
14601  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14602  * def __setstate_cython__(self, __pyx_state):
14603  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14604  */
14605  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
14606  __Pyx_GOTREF(__pyx_t_1);
14607  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14608  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14609  __PYX_ERR(1, 2, __pyx_L1_error)
14610 
14611  /* "(tree fragment)":1
14612  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14613  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14614  * def __setstate_cython__(self, __pyx_state):
14615  */
14616 
14617  /* function exit code */
14618  __pyx_L1_error:;
14619  __Pyx_XDECREF(__pyx_t_1);
14620  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14621  __pyx_r = NULL;
14622  __Pyx_XGIVEREF(__pyx_r);
14623  __Pyx_RefNannyFinishContext();
14624  return __pyx_r;
14625 }
14626 
14627 /* "(tree fragment)":3
14628  * def __reduce_cython__(self):
14629  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14630  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14631  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14632  */
14633 
14634 /* Python wrapper */
14635 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
14636 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14637  PyObject *__pyx_r = 0;
14638  __Pyx_RefNannyDeclarations
14639  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
14640  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14641 
14642  /* function exit code */
14643  __Pyx_RefNannyFinishContext();
14644  return __pyx_r;
14645 }
14646 
14647 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) {
14648  PyObject *__pyx_r = NULL;
14649  __Pyx_RefNannyDeclarations
14650  PyObject *__pyx_t_1 = NULL;
14651  int __pyx_lineno = 0;
14652  const char *__pyx_filename = NULL;
14653  int __pyx_clineno = 0;
14654  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
14655 
14656  /* "(tree fragment)":4
14657  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14658  * def __setstate_cython__(self, __pyx_state):
14659  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14660  */
14661  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
14662  __Pyx_GOTREF(__pyx_t_1);
14663  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14664  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14665  __PYX_ERR(1, 4, __pyx_L1_error)
14666 
14667  /* "(tree fragment)":3
14668  * def __reduce_cython__(self):
14669  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14670  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14671  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14672  */
14673 
14674  /* function exit code */
14675  __pyx_L1_error:;
14676  __Pyx_XDECREF(__pyx_t_1);
14677  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14678  __pyx_r = NULL;
14679  __Pyx_XGIVEREF(__pyx_r);
14680  __Pyx_RefNannyFinishContext();
14681  return __pyx_r;
14682 }
14683 
14684 /* "View.MemoryView":657
14685  *
14686  * @cname('__pyx_memoryview_new')
14687  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14688  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14689  * result.typeinfo = typeinfo
14690  */
14691 
14692 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
14693  struct __pyx_memoryview_obj *__pyx_v_result = 0;
14694  PyObject *__pyx_r = NULL;
14695  __Pyx_RefNannyDeclarations
14696  PyObject *__pyx_t_1 = NULL;
14697  PyObject *__pyx_t_2 = NULL;
14698  PyObject *__pyx_t_3 = NULL;
14699  int __pyx_lineno = 0;
14700  const char *__pyx_filename = NULL;
14701  int __pyx_clineno = 0;
14702  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
14703 
14704  /* "View.MemoryView":658
14705  * @cname('__pyx_memoryview_new')
14706  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14707  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
14708  * result.typeinfo = typeinfo
14709  * return result
14710  */
14711  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error)
14712  __Pyx_GOTREF(__pyx_t_1);
14713  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
14714  __Pyx_GOTREF(__pyx_t_2);
14715  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error)
14716  __Pyx_GOTREF(__pyx_t_3);
14717  __Pyx_INCREF(__pyx_v_o);
14718  __Pyx_GIVEREF(__pyx_v_o);
14719  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
14720  __Pyx_GIVEREF(__pyx_t_1);
14721  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14722  __Pyx_GIVEREF(__pyx_t_2);
14723  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14724  __pyx_t_1 = 0;
14725  __pyx_t_2 = 0;
14726  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
14727  __Pyx_GOTREF(__pyx_t_2);
14728  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14729  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
14730  __pyx_t_2 = 0;
14731 
14732  /* "View.MemoryView":659
14733  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14734  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14735  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
14736  * return result
14737  *
14738  */
14739  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
14740 
14741  /* "View.MemoryView":660
14742  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14743  * result.typeinfo = typeinfo
14744  * return result # <<<<<<<<<<<<<<
14745  *
14746  * @cname('__pyx_memoryview_check')
14747  */
14748  __Pyx_XDECREF(__pyx_r);
14749  __Pyx_INCREF(((PyObject *)__pyx_v_result));
14750  __pyx_r = ((PyObject *)__pyx_v_result);
14751  goto __pyx_L0;
14752 
14753  /* "View.MemoryView":657
14754  *
14755  * @cname('__pyx_memoryview_new')
14756  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14757  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14758  * result.typeinfo = typeinfo
14759  */
14760 
14761  /* function exit code */
14762  __pyx_L1_error:;
14763  __Pyx_XDECREF(__pyx_t_1);
14764  __Pyx_XDECREF(__pyx_t_2);
14765  __Pyx_XDECREF(__pyx_t_3);
14766  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
14767  __pyx_r = 0;
14768  __pyx_L0:;
14769  __Pyx_XDECREF((PyObject *)__pyx_v_result);
14770  __Pyx_XGIVEREF(__pyx_r);
14771  __Pyx_RefNannyFinishContext();
14772  return __pyx_r;
14773 }
14774 
14775 /* "View.MemoryView":663
14776  *
14777  * @cname('__pyx_memoryview_check')
14778  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
14779  * return isinstance(o, memoryview)
14780  *
14781  */
14782 
14783 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
14784  int __pyx_r;
14785  __Pyx_RefNannyDeclarations
14786  int __pyx_t_1;
14787  __Pyx_RefNannySetupContext("memoryview_check", 0);
14788 
14789  /* "View.MemoryView":664
14790  * @cname('__pyx_memoryview_check')
14791  * cdef inline bint memoryview_check(object o):
14792  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
14793  *
14794  * cdef tuple _unellipsify(object index, int ndim):
14795  */
14796  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
14797  __pyx_r = __pyx_t_1;
14798  goto __pyx_L0;
14799 
14800  /* "View.MemoryView":663
14801  *
14802  * @cname('__pyx_memoryview_check')
14803  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
14804  * return isinstance(o, memoryview)
14805  *
14806  */
14807 
14808  /* function exit code */
14809  __pyx_L0:;
14810  __Pyx_RefNannyFinishContext();
14811  return __pyx_r;
14812 }
14813 
14814 /* "View.MemoryView":666
14815  * return isinstance(o, memoryview)
14816  *
14817  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
14818  * """
14819  * Replace all ellipses with full slices and fill incomplete indices with
14820  */
14821 
14822 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
14823  PyObject *__pyx_v_tup = NULL;
14824  PyObject *__pyx_v_result = NULL;
14825  int __pyx_v_have_slices;
14826  int __pyx_v_seen_ellipsis;
14827  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
14828  PyObject *__pyx_v_item = NULL;
14829  Py_ssize_t __pyx_v_nslices;
14830  PyObject *__pyx_r = NULL;
14831  __Pyx_RefNannyDeclarations
14832  int __pyx_t_1;
14833  int __pyx_t_2;
14834  PyObject *__pyx_t_3 = NULL;
14835  PyObject *__pyx_t_4 = NULL;
14836  Py_ssize_t __pyx_t_5;
14837  PyObject *(*__pyx_t_6)(PyObject *);
14838  PyObject *__pyx_t_7 = NULL;
14839  Py_ssize_t __pyx_t_8;
14840  int __pyx_t_9;
14841  int __pyx_t_10;
14842  PyObject *__pyx_t_11 = NULL;
14843  int __pyx_lineno = 0;
14844  const char *__pyx_filename = NULL;
14845  int __pyx_clineno = 0;
14846  __Pyx_RefNannySetupContext("_unellipsify", 0);
14847 
14848  /* "View.MemoryView":671
14849  * full slices.
14850  * """
14851  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
14852  * tup = (index,)
14853  * else:
14854  */
14855  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
14856  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14857  if (__pyx_t_2) {
14858 
14859  /* "View.MemoryView":672
14860  * """
14861  * if not isinstance(index, tuple):
14862  * tup = (index,) # <<<<<<<<<<<<<<
14863  * else:
14864  * tup = index
14865  */
14866  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
14867  __Pyx_GOTREF(__pyx_t_3);
14868  __Pyx_INCREF(__pyx_v_index);
14869  __Pyx_GIVEREF(__pyx_v_index);
14870  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
14871  __pyx_v_tup = __pyx_t_3;
14872  __pyx_t_3 = 0;
14873 
14874  /* "View.MemoryView":671
14875  * full slices.
14876  * """
14877  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
14878  * tup = (index,)
14879  * else:
14880  */
14881  goto __pyx_L3;
14882  }
14883 
14884  /* "View.MemoryView":674
14885  * tup = (index,)
14886  * else:
14887  * tup = index # <<<<<<<<<<<<<<
14888  *
14889  * result = []
14890  */
14891  /*else*/ {
14892  __Pyx_INCREF(__pyx_v_index);
14893  __pyx_v_tup = __pyx_v_index;
14894  }
14895  __pyx_L3:;
14896 
14897  /* "View.MemoryView":676
14898  * tup = index
14899  *
14900  * result = [] # <<<<<<<<<<<<<<
14901  * have_slices = False
14902  * seen_ellipsis = False
14903  */
14904  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error)
14905  __Pyx_GOTREF(__pyx_t_3);
14906  __pyx_v_result = ((PyObject*)__pyx_t_3);
14907  __pyx_t_3 = 0;
14908 
14909  /* "View.MemoryView":677
14910  *
14911  * result = []
14912  * have_slices = False # <<<<<<<<<<<<<<
14913  * seen_ellipsis = False
14914  * for idx, item in enumerate(tup):
14915  */
14916  __pyx_v_have_slices = 0;
14917 
14918  /* "View.MemoryView":678
14919  * result = []
14920  * have_slices = False
14921  * seen_ellipsis = False # <<<<<<<<<<<<<<
14922  * for idx, item in enumerate(tup):
14923  * if item is Ellipsis:
14924  */
14925  __pyx_v_seen_ellipsis = 0;
14926 
14927  /* "View.MemoryView":679
14928  * have_slices = False
14929  * seen_ellipsis = False
14930  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
14931  * if item is Ellipsis:
14932  * if not seen_ellipsis:
14933  */
14934  __Pyx_INCREF(__pyx_int_0);
14935  __pyx_t_3 = __pyx_int_0;
14936  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
14937  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
14938  __pyx_t_6 = NULL;
14939  } else {
14940  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
14941  __Pyx_GOTREF(__pyx_t_4);
14942  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error)
14943  }
14944  for (;;) {
14945  if (likely(!__pyx_t_6)) {
14946  if (likely(PyList_CheckExact(__pyx_t_4))) {
14947  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
14948  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14949  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
14950  #else
14951  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14952  __Pyx_GOTREF(__pyx_t_7);
14953  #endif
14954  } else {
14955  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
14956  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14957  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
14958  #else
14959  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14960  __Pyx_GOTREF(__pyx_t_7);
14961  #endif
14962  }
14963  } else {
14964  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
14965  if (unlikely(!__pyx_t_7)) {
14966  PyObject* exc_type = PyErr_Occurred();
14967  if (exc_type) {
14968  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14969  else __PYX_ERR(1, 679, __pyx_L1_error)
14970  }
14971  break;
14972  }
14973  __Pyx_GOTREF(__pyx_t_7);
14974  }
14975  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
14976  __pyx_t_7 = 0;
14977  __Pyx_INCREF(__pyx_t_3);
14978  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
14979  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14980  __Pyx_GOTREF(__pyx_t_7);
14981  __Pyx_DECREF(__pyx_t_3);
14982  __pyx_t_3 = __pyx_t_7;
14983  __pyx_t_7 = 0;
14984 
14985  /* "View.MemoryView":680
14986  * seen_ellipsis = False
14987  * for idx, item in enumerate(tup):
14988  * if item is Ellipsis: # <<<<<<<<<<<<<<
14989  * if not seen_ellipsis:
14990  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14991  */
14992  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
14993  __pyx_t_1 = (__pyx_t_2 != 0);
14994  if (__pyx_t_1) {
14995 
14996  /* "View.MemoryView":681
14997  * for idx, item in enumerate(tup):
14998  * if item is Ellipsis:
14999  * if not seen_ellipsis: # <<<<<<<<<<<<<<
15000  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15001  * seen_ellipsis = True
15002  */
15003  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
15004  if (__pyx_t_1) {
15005 
15006  /* "View.MemoryView":682
15007  * if item is Ellipsis:
15008  * if not seen_ellipsis:
15009  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
15010  * seen_ellipsis = True
15011  * else:
15012  */
15013  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
15014  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 682, __pyx_L1_error)
15015  __Pyx_GOTREF(__pyx_t_7);
15016  { Py_ssize_t __pyx_temp;
15017  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
15018  __Pyx_INCREF(__pyx_slice__21);
15019  __Pyx_GIVEREF(__pyx_slice__21);
15020  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__21);
15021  }
15022  }
15023  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
15024  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15025 
15026  /* "View.MemoryView":683
15027  * if not seen_ellipsis:
15028  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15029  * seen_ellipsis = True # <<<<<<<<<<<<<<
15030  * else:
15031  * result.append(slice(None))
15032  */
15033  __pyx_v_seen_ellipsis = 1;
15034 
15035  /* "View.MemoryView":681
15036  * for idx, item in enumerate(tup):
15037  * if item is Ellipsis:
15038  * if not seen_ellipsis: # <<<<<<<<<<<<<<
15039  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15040  * seen_ellipsis = True
15041  */
15042  goto __pyx_L7;
15043  }
15044 
15045  /* "View.MemoryView":685
15046  * seen_ellipsis = True
15047  * else:
15048  * result.append(slice(None)) # <<<<<<<<<<<<<<
15049  * have_slices = True
15050  * else:
15051  */
15052  /*else*/ {
15053  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__21); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 685, __pyx_L1_error)
15054  }
15055  __pyx_L7:;
15056 
15057  /* "View.MemoryView":686
15058  * else:
15059  * result.append(slice(None))
15060  * have_slices = True # <<<<<<<<<<<<<<
15061  * else:
15062  * if not isinstance(item, slice) and not PyIndex_Check(item):
15063  */
15064  __pyx_v_have_slices = 1;
15065 
15066  /* "View.MemoryView":680
15067  * seen_ellipsis = False
15068  * for idx, item in enumerate(tup):
15069  * if item is Ellipsis: # <<<<<<<<<<<<<<
15070  * if not seen_ellipsis:
15071  * result.extend([slice(None)] * (ndim - len(tup) + 1))
15072  */
15073  goto __pyx_L6;
15074  }
15075 
15076  /* "View.MemoryView":688
15077  * have_slices = True
15078  * else:
15079  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
15080  * raise TypeError("Cannot index with type '%s'" % type(item))
15081  *
15082  */
15083  /*else*/ {
15084  __pyx_t_2 = PySlice_Check(__pyx_v_item);
15085  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
15086  if (__pyx_t_10) {
15087  } else {
15088  __pyx_t_1 = __pyx_t_10;
15089  goto __pyx_L9_bool_binop_done;
15090  }
15091  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
15092  __pyx_t_1 = __pyx_t_10;
15093  __pyx_L9_bool_binop_done:;
15094  if (unlikely(__pyx_t_1)) {
15095 
15096  /* "View.MemoryView":689
15097  * else:
15098  * if not isinstance(item, slice) and not PyIndex_Check(item):
15099  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
15100  *
15101  * have_slices = have_slices or isinstance(item, slice)
15102  */
15103  __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 689, __pyx_L1_error)
15104  __Pyx_GOTREF(__pyx_t_7);
15105  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error)
15106  __Pyx_GOTREF(__pyx_t_11);
15107  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15108  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
15109  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
15110  __PYX_ERR(1, 689, __pyx_L1_error)
15111 
15112  /* "View.MemoryView":688
15113  * have_slices = True
15114  * else:
15115  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
15116  * raise TypeError("Cannot index with type '%s'" % type(item))
15117  *
15118  */
15119  }
15120 
15121  /* "View.MemoryView":691
15122  * raise TypeError("Cannot index with type '%s'" % type(item))
15123  *
15124  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
15125  * result.append(item)
15126  *
15127  */
15128  __pyx_t_10 = (__pyx_v_have_slices != 0);
15129  if (!__pyx_t_10) {
15130  } else {
15131  __pyx_t_1 = __pyx_t_10;
15132  goto __pyx_L11_bool_binop_done;
15133  }
15134  __pyx_t_10 = PySlice_Check(__pyx_v_item);
15135  __pyx_t_2 = (__pyx_t_10 != 0);
15136  __pyx_t_1 = __pyx_t_2;
15137  __pyx_L11_bool_binop_done:;
15138  __pyx_v_have_slices = __pyx_t_1;
15139 
15140  /* "View.MemoryView":692
15141  *
15142  * have_slices = have_slices or isinstance(item, slice)
15143  * result.append(item) # <<<<<<<<<<<<<<
15144  *
15145  * nslices = ndim - len(result)
15146  */
15147  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
15148  }
15149  __pyx_L6:;
15150 
15151  /* "View.MemoryView":679
15152  * have_slices = False
15153  * seen_ellipsis = False
15154  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
15155  * if item is Ellipsis:
15156  * if not seen_ellipsis:
15157  */
15158  }
15159  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15160  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15161 
15162  /* "View.MemoryView":694
15163  * result.append(item)
15164  *
15165  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
15166  * if nslices:
15167  * result.extend([slice(None)] * nslices)
15168  */
15169  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
15170  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
15171 
15172  /* "View.MemoryView":695
15173  *
15174  * nslices = ndim - len(result)
15175  * if nslices: # <<<<<<<<<<<<<<
15176  * result.extend([slice(None)] * nslices)
15177  *
15178  */
15179  __pyx_t_1 = (__pyx_v_nslices != 0);
15180  if (__pyx_t_1) {
15181 
15182  /* "View.MemoryView":696
15183  * nslices = ndim - len(result)
15184  * if nslices:
15185  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
15186  *
15187  * return have_slices or nslices, tuple(result)
15188  */
15189  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error)
15190  __Pyx_GOTREF(__pyx_t_3);
15191  { Py_ssize_t __pyx_temp;
15192  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
15193  __Pyx_INCREF(__pyx_slice__21);
15194  __Pyx_GIVEREF(__pyx_slice__21);
15195  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__21);
15196  }
15197  }
15198  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
15199  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15200 
15201  /* "View.MemoryView":695
15202  *
15203  * nslices = ndim - len(result)
15204  * if nslices: # <<<<<<<<<<<<<<
15205  * result.extend([slice(None)] * nslices)
15206  *
15207  */
15208  }
15209 
15210  /* "View.MemoryView":698
15211  * result.extend([slice(None)] * nslices)
15212  *
15213  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
15214  *
15215  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15216  */
15217  __Pyx_XDECREF(__pyx_r);
15218  if (!__pyx_v_have_slices) {
15219  } else {
15220  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15221  __Pyx_GOTREF(__pyx_t_4);
15222  __pyx_t_3 = __pyx_t_4;
15223  __pyx_t_4 = 0;
15224  goto __pyx_L14_bool_binop_done;
15225  }
15226  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15227  __Pyx_GOTREF(__pyx_t_4);
15228  __pyx_t_3 = __pyx_t_4;
15229  __pyx_t_4 = 0;
15230  __pyx_L14_bool_binop_done:;
15231  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
15232  __Pyx_GOTREF(__pyx_t_4);
15233  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error)
15234  __Pyx_GOTREF(__pyx_t_11);
15235  __Pyx_GIVEREF(__pyx_t_3);
15236  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
15237  __Pyx_GIVEREF(__pyx_t_4);
15238  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
15239  __pyx_t_3 = 0;
15240  __pyx_t_4 = 0;
15241  __pyx_r = ((PyObject*)__pyx_t_11);
15242  __pyx_t_11 = 0;
15243  goto __pyx_L0;
15244 
15245  /* "View.MemoryView":666
15246  * return isinstance(o, memoryview)
15247  *
15248  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
15249  * """
15250  * Replace all ellipses with full slices and fill incomplete indices with
15251  */
15252 
15253  /* function exit code */
15254  __pyx_L1_error:;
15255  __Pyx_XDECREF(__pyx_t_3);
15256  __Pyx_XDECREF(__pyx_t_4);
15257  __Pyx_XDECREF(__pyx_t_7);
15258  __Pyx_XDECREF(__pyx_t_11);
15259  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
15260  __pyx_r = 0;
15261  __pyx_L0:;
15262  __Pyx_XDECREF(__pyx_v_tup);
15263  __Pyx_XDECREF(__pyx_v_result);
15264  __Pyx_XDECREF(__pyx_v_idx);
15265  __Pyx_XDECREF(__pyx_v_item);
15266  __Pyx_XGIVEREF(__pyx_r);
15267  __Pyx_RefNannyFinishContext();
15268  return __pyx_r;
15269 }
15270 
15271 /* "View.MemoryView":700
15272  * return have_slices or nslices, tuple(result)
15273  *
15274  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
15275  * for suboffset in suboffsets[:ndim]:
15276  * if suboffset >= 0:
15277  */
15278 
15279 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
15280  Py_ssize_t __pyx_v_suboffset;
15281  PyObject *__pyx_r = NULL;
15282  __Pyx_RefNannyDeclarations
15283  Py_ssize_t *__pyx_t_1;
15284  Py_ssize_t *__pyx_t_2;
15285  Py_ssize_t *__pyx_t_3;
15286  int __pyx_t_4;
15287  PyObject *__pyx_t_5 = NULL;
15288  int __pyx_lineno = 0;
15289  const char *__pyx_filename = NULL;
15290  int __pyx_clineno = 0;
15291  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
15292 
15293  /* "View.MemoryView":701
15294  *
15295  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15296  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
15297  * if suboffset >= 0:
15298  * raise ValueError("Indirect dimensions not supported")
15299  */
15300  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
15301  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
15302  __pyx_t_1 = __pyx_t_3;
15303  __pyx_v_suboffset = (__pyx_t_1[0]);
15304 
15305  /* "View.MemoryView":702
15306  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15307  * for suboffset in suboffsets[:ndim]:
15308  * if suboffset >= 0: # <<<<<<<<<<<<<<
15309  * raise ValueError("Indirect dimensions not supported")
15310  *
15311  */
15312  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
15313  if (unlikely(__pyx_t_4)) {
15314 
15315  /* "View.MemoryView":703
15316  * for suboffset in suboffsets[:ndim]:
15317  * if suboffset >= 0:
15318  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
15319  *
15320  *
15321  */
15322  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error)
15323  __Pyx_GOTREF(__pyx_t_5);
15324  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
15325  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15326  __PYX_ERR(1, 703, __pyx_L1_error)
15327 
15328  /* "View.MemoryView":702
15329  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
15330  * for suboffset in suboffsets[:ndim]:
15331  * if suboffset >= 0: # <<<<<<<<<<<<<<
15332  * raise ValueError("Indirect dimensions not supported")
15333  *
15334  */
15335  }
15336  }
15337 
15338  /* "View.MemoryView":700
15339  * return have_slices or nslices, tuple(result)
15340  *
15341  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
15342  * for suboffset in suboffsets[:ndim]:
15343  * if suboffset >= 0:
15344  */
15345 
15346  /* function exit code */
15347  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15348  goto __pyx_L0;
15349  __pyx_L1_error:;
15350  __Pyx_XDECREF(__pyx_t_5);
15351  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
15352  __pyx_r = 0;
15353  __pyx_L0:;
15354  __Pyx_XGIVEREF(__pyx_r);
15355  __Pyx_RefNannyFinishContext();
15356  return __pyx_r;
15357 }
15358 
15359 /* "View.MemoryView":710
15360  *
15361  * @cname('__pyx_memview_slice')
15362  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
15363  * cdef int new_ndim = 0, suboffset_dim = -1, dim
15364  * cdef bint negative_step
15365  */
15366 
15367 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
15368  int __pyx_v_new_ndim;
15369  int __pyx_v_suboffset_dim;
15370  int __pyx_v_dim;
15371  __Pyx_memviewslice __pyx_v_src;
15372  __Pyx_memviewslice __pyx_v_dst;
15373  __Pyx_memviewslice *__pyx_v_p_src;
15374  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
15375  __Pyx_memviewslice *__pyx_v_p_dst;
15376  int *__pyx_v_p_suboffset_dim;
15377  Py_ssize_t __pyx_v_start;
15378  Py_ssize_t __pyx_v_stop;
15379  Py_ssize_t __pyx_v_step;
15380  int __pyx_v_have_start;
15381  int __pyx_v_have_stop;
15382  int __pyx_v_have_step;
15383  PyObject *__pyx_v_index = NULL;
15384  struct __pyx_memoryview_obj *__pyx_r = NULL;
15385  __Pyx_RefNannyDeclarations
15386  int __pyx_t_1;
15387  int __pyx_t_2;
15388  PyObject *__pyx_t_3 = NULL;
15389  struct __pyx_memoryview_obj *__pyx_t_4;
15390  char *__pyx_t_5;
15391  int __pyx_t_6;
15392  Py_ssize_t __pyx_t_7;
15393  PyObject *(*__pyx_t_8)(PyObject *);
15394  PyObject *__pyx_t_9 = NULL;
15395  Py_ssize_t __pyx_t_10;
15396  int __pyx_t_11;
15397  Py_ssize_t __pyx_t_12;
15398  int __pyx_lineno = 0;
15399  const char *__pyx_filename = NULL;
15400  int __pyx_clineno = 0;
15401  __Pyx_RefNannySetupContext("memview_slice", 0);
15402 
15403  /* "View.MemoryView":711
15404  * @cname('__pyx_memview_slice')
15405  * cdef memoryview memview_slice(memoryview memview, object indices):
15406  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
15407  * cdef bint negative_step
15408  * cdef __Pyx_memviewslice src, dst
15409  */
15410  __pyx_v_new_ndim = 0;
15411  __pyx_v_suboffset_dim = -1;
15412 
15413  /* "View.MemoryView":718
15414  *
15415  *
15416  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
15417  *
15418  * cdef _memoryviewslice memviewsliceobj
15419  */
15420  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
15421 
15422  /* "View.MemoryView":722
15423  * cdef _memoryviewslice memviewsliceobj
15424  *
15425  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
15426  *
15427  * if isinstance(memview, _memoryviewslice):
15428  */
15429  #ifndef CYTHON_WITHOUT_ASSERTIONS
15430  if (unlikely(!Py_OptimizeFlag)) {
15431  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
15432  PyErr_SetNone(PyExc_AssertionError);
15433  __PYX_ERR(1, 722, __pyx_L1_error)
15434  }
15435  }
15436  #endif
15437 
15438  /* "View.MemoryView":724
15439  * assert memview.view.ndim > 0
15440  *
15441  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15442  * memviewsliceobj = memview
15443  * p_src = &memviewsliceobj.from_slice
15444  */
15445  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15446  __pyx_t_2 = (__pyx_t_1 != 0);
15447  if (__pyx_t_2) {
15448 
15449  /* "View.MemoryView":725
15450  *
15451  * if isinstance(memview, _memoryviewslice):
15452  * memviewsliceobj = memview # <<<<<<<<<<<<<<
15453  * p_src = &memviewsliceobj.from_slice
15454  * else:
15455  */
15456  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error)
15457  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
15458  __Pyx_INCREF(__pyx_t_3);
15459  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
15460  __pyx_t_3 = 0;
15461 
15462  /* "View.MemoryView":726
15463  * if isinstance(memview, _memoryviewslice):
15464  * memviewsliceobj = memview
15465  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
15466  * else:
15467  * slice_copy(memview, &src)
15468  */
15469  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
15470 
15471  /* "View.MemoryView":724
15472  * assert memview.view.ndim > 0
15473  *
15474  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15475  * memviewsliceobj = memview
15476  * p_src = &memviewsliceobj.from_slice
15477  */
15478  goto __pyx_L3;
15479  }
15480 
15481  /* "View.MemoryView":728
15482  * p_src = &memviewsliceobj.from_slice
15483  * else:
15484  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
15485  * p_src = &src
15486  *
15487  */
15488  /*else*/ {
15489  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
15490 
15491  /* "View.MemoryView":729
15492  * else:
15493  * slice_copy(memview, &src)
15494  * p_src = &src # <<<<<<<<<<<<<<
15495  *
15496  *
15497  */
15498  __pyx_v_p_src = (&__pyx_v_src);
15499  }
15500  __pyx_L3:;
15501 
15502  /* "View.MemoryView":735
15503  *
15504  *
15505  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
15506  * dst.data = p_src.data
15507  *
15508  */
15509  __pyx_t_4 = __pyx_v_p_src->memview;
15510  __pyx_v_dst.memview = __pyx_t_4;
15511 
15512  /* "View.MemoryView":736
15513  *
15514  * dst.memview = p_src.memview
15515  * dst.data = p_src.data # <<<<<<<<<<<<<<
15516  *
15517  *
15518  */
15519  __pyx_t_5 = __pyx_v_p_src->data;
15520  __pyx_v_dst.data = __pyx_t_5;
15521 
15522  /* "View.MemoryView":741
15523  *
15524  *
15525  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
15526  * cdef int *p_suboffset_dim = &suboffset_dim
15527  * cdef Py_ssize_t start, stop, step
15528  */
15529  __pyx_v_p_dst = (&__pyx_v_dst);
15530 
15531  /* "View.MemoryView":742
15532  *
15533  * cdef __Pyx_memviewslice *p_dst = &dst
15534  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
15535  * cdef Py_ssize_t start, stop, step
15536  * cdef bint have_start, have_stop, have_step
15537  */
15538  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
15539 
15540  /* "View.MemoryView":746
15541  * cdef bint have_start, have_stop, have_step
15542  *
15543  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15544  * if PyIndex_Check(index):
15545  * slice_memviewslice(
15546  */
15547  __pyx_t_6 = 0;
15548  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
15549  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
15550  __pyx_t_8 = NULL;
15551  } else {
15552  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error)
15553  __Pyx_GOTREF(__pyx_t_3);
15554  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error)
15555  }
15556  for (;;) {
15557  if (likely(!__pyx_t_8)) {
15558  if (likely(PyList_CheckExact(__pyx_t_3))) {
15559  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
15560  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15561  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
15562  #else
15563  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
15564  __Pyx_GOTREF(__pyx_t_9);
15565  #endif
15566  } else {
15567  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
15568  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15569  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
15570  #else
15571  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
15572  __Pyx_GOTREF(__pyx_t_9);
15573  #endif
15574  }
15575  } else {
15576  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
15577  if (unlikely(!__pyx_t_9)) {
15578  PyObject* exc_type = PyErr_Occurred();
15579  if (exc_type) {
15580  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15581  else __PYX_ERR(1, 746, __pyx_L1_error)
15582  }
15583  break;
15584  }
15585  __Pyx_GOTREF(__pyx_t_9);
15586  }
15587  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
15588  __pyx_t_9 = 0;
15589  __pyx_v_dim = __pyx_t_6;
15590  __pyx_t_6 = (__pyx_t_6 + 1);
15591 
15592  /* "View.MemoryView":747
15593  *
15594  * for dim, index in enumerate(indices):
15595  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15596  * slice_memviewslice(
15597  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15598  */
15599  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
15600  if (__pyx_t_2) {
15601 
15602  /* "View.MemoryView":751
15603  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15604  * dim, new_ndim, p_suboffset_dim,
15605  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
15606  * 0, 0, 0, # have_{start,stop,step}
15607  * False)
15608  */
15609  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error)
15610 
15611  /* "View.MemoryView":748
15612  * for dim, index in enumerate(indices):
15613  * if PyIndex_Check(index):
15614  * slice_memviewslice( # <<<<<<<<<<<<<<
15615  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15616  * dim, new_ndim, p_suboffset_dim,
15617  */
15618  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 748, __pyx_L1_error)
15619 
15620  /* "View.MemoryView":747
15621  *
15622  * for dim, index in enumerate(indices):
15623  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15624  * slice_memviewslice(
15625  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15626  */
15627  goto __pyx_L6;
15628  }
15629 
15630  /* "View.MemoryView":754
15631  * 0, 0, 0, # have_{start,stop,step}
15632  * False)
15633  * elif index is None: # <<<<<<<<<<<<<<
15634  * p_dst.shape[new_ndim] = 1
15635  * p_dst.strides[new_ndim] = 0
15636  */
15637  __pyx_t_2 = (__pyx_v_index == Py_None);
15638  __pyx_t_1 = (__pyx_t_2 != 0);
15639  if (__pyx_t_1) {
15640 
15641  /* "View.MemoryView":755
15642  * False)
15643  * elif index is None:
15644  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
15645  * p_dst.strides[new_ndim] = 0
15646  * p_dst.suboffsets[new_ndim] = -1
15647  */
15648  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
15649 
15650  /* "View.MemoryView":756
15651  * elif index is None:
15652  * p_dst.shape[new_ndim] = 1
15653  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
15654  * p_dst.suboffsets[new_ndim] = -1
15655  * new_ndim += 1
15656  */
15657  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
15658 
15659  /* "View.MemoryView":757
15660  * p_dst.shape[new_ndim] = 1
15661  * p_dst.strides[new_ndim] = 0
15662  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
15663  * new_ndim += 1
15664  * else:
15665  */
15666  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
15667 
15668  /* "View.MemoryView":758
15669  * p_dst.strides[new_ndim] = 0
15670  * p_dst.suboffsets[new_ndim] = -1
15671  * new_ndim += 1 # <<<<<<<<<<<<<<
15672  * else:
15673  * start = index.start or 0
15674  */
15675  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15676 
15677  /* "View.MemoryView":754
15678  * 0, 0, 0, # have_{start,stop,step}
15679  * False)
15680  * elif index is None: # <<<<<<<<<<<<<<
15681  * p_dst.shape[new_ndim] = 1
15682  * p_dst.strides[new_ndim] = 0
15683  */
15684  goto __pyx_L6;
15685  }
15686 
15687  /* "View.MemoryView":760
15688  * new_ndim += 1
15689  * else:
15690  * start = index.start or 0 # <<<<<<<<<<<<<<
15691  * stop = index.stop or 0
15692  * step = index.step or 0
15693  */
15694  /*else*/ {
15695  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
15696  __Pyx_GOTREF(__pyx_t_9);
15697  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error)
15698  if (!__pyx_t_1) {
15699  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15700  } else {
15701  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error)
15702  __pyx_t_10 = __pyx_t_12;
15703  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15704  goto __pyx_L7_bool_binop_done;
15705  }
15706  __pyx_t_10 = 0;
15707  __pyx_L7_bool_binop_done:;
15708  __pyx_v_start = __pyx_t_10;
15709 
15710  /* "View.MemoryView":761
15711  * else:
15712  * start = index.start or 0
15713  * stop = index.stop or 0 # <<<<<<<<<<<<<<
15714  * step = index.step or 0
15715  *
15716  */
15717  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
15718  __Pyx_GOTREF(__pyx_t_9);
15719  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error)
15720  if (!__pyx_t_1) {
15721  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15722  } else {
15723  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error)
15724  __pyx_t_10 = __pyx_t_12;
15725  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15726  goto __pyx_L9_bool_binop_done;
15727  }
15728  __pyx_t_10 = 0;
15729  __pyx_L9_bool_binop_done:;
15730  __pyx_v_stop = __pyx_t_10;
15731 
15732  /* "View.MemoryView":762
15733  * start = index.start or 0
15734  * stop = index.stop or 0
15735  * step = index.step or 0 # <<<<<<<<<<<<<<
15736  *
15737  * have_start = index.start is not None
15738  */
15739  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
15740  __Pyx_GOTREF(__pyx_t_9);
15741  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
15742  if (!__pyx_t_1) {
15743  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15744  } else {
15745  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
15746  __pyx_t_10 = __pyx_t_12;
15747  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15748  goto __pyx_L11_bool_binop_done;
15749  }
15750  __pyx_t_10 = 0;
15751  __pyx_L11_bool_binop_done:;
15752  __pyx_v_step = __pyx_t_10;
15753 
15754  /* "View.MemoryView":764
15755  * step = index.step or 0
15756  *
15757  * have_start = index.start is not None # <<<<<<<<<<<<<<
15758  * have_stop = index.stop is not None
15759  * have_step = index.step is not None
15760  */
15761  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
15762  __Pyx_GOTREF(__pyx_t_9);
15763  __pyx_t_1 = (__pyx_t_9 != Py_None);
15764  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15765  __pyx_v_have_start = __pyx_t_1;
15766 
15767  /* "View.MemoryView":765
15768  *
15769  * have_start = index.start is not None
15770  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
15771  * have_step = index.step is not None
15772  *
15773  */
15774  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error)
15775  __Pyx_GOTREF(__pyx_t_9);
15776  __pyx_t_1 = (__pyx_t_9 != Py_None);
15777  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15778  __pyx_v_have_stop = __pyx_t_1;
15779 
15780  /* "View.MemoryView":766
15781  * have_start = index.start is not None
15782  * have_stop = index.stop is not None
15783  * have_step = index.step is not None # <<<<<<<<<<<<<<
15784  *
15785  * slice_memviewslice(
15786  */
15787  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
15788  __Pyx_GOTREF(__pyx_t_9);
15789  __pyx_t_1 = (__pyx_t_9 != Py_None);
15790  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15791  __pyx_v_have_step = __pyx_t_1;
15792 
15793  /* "View.MemoryView":768
15794  * have_step = index.step is not None
15795  *
15796  * slice_memviewslice( # <<<<<<<<<<<<<<
15797  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15798  * dim, new_ndim, p_suboffset_dim,
15799  */
15800  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 768, __pyx_L1_error)
15801 
15802  /* "View.MemoryView":774
15803  * have_start, have_stop, have_step,
15804  * True)
15805  * new_ndim += 1 # <<<<<<<<<<<<<<
15806  *
15807  * if isinstance(memview, _memoryviewslice):
15808  */
15809  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15810  }
15811  __pyx_L6:;
15812 
15813  /* "View.MemoryView":746
15814  * cdef bint have_start, have_stop, have_step
15815  *
15816  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15817  * if PyIndex_Check(index):
15818  * slice_memviewslice(
15819  */
15820  }
15821  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15822 
15823  /* "View.MemoryView":776
15824  * new_ndim += 1
15825  *
15826  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15827  * return memoryview_fromslice(dst, new_ndim,
15828  * memviewsliceobj.to_object_func,
15829  */
15830  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15831  __pyx_t_2 = (__pyx_t_1 != 0);
15832  if (__pyx_t_2) {
15833 
15834  /* "View.MemoryView":777
15835  *
15836  * if isinstance(memview, _memoryviewslice):
15837  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
15838  * memviewsliceobj.to_object_func,
15839  * memviewsliceobj.to_dtype_func,
15840  */
15841  __Pyx_XDECREF(((PyObject *)__pyx_r));
15842 
15843  /* "View.MemoryView":778
15844  * if isinstance(memview, _memoryviewslice):
15845  * return memoryview_fromslice(dst, new_ndim,
15846  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
15847  * memviewsliceobj.to_dtype_func,
15848  * memview.dtype_is_object)
15849  */
15850  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) }
15851 
15852  /* "View.MemoryView":779
15853  * return memoryview_fromslice(dst, new_ndim,
15854  * memviewsliceobj.to_object_func,
15855  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
15856  * memview.dtype_is_object)
15857  * else:
15858  */
15859  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) }
15860 
15861  /* "View.MemoryView":777
15862  *
15863  * if isinstance(memview, _memoryviewslice):
15864  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
15865  * memviewsliceobj.to_object_func,
15866  * memviewsliceobj.to_dtype_func,
15867  */
15868  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
15869  __Pyx_GOTREF(__pyx_t_3);
15870  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
15871  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
15872  __pyx_t_3 = 0;
15873  goto __pyx_L0;
15874 
15875  /* "View.MemoryView":776
15876  * new_ndim += 1
15877  *
15878  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15879  * return memoryview_fromslice(dst, new_ndim,
15880  * memviewsliceobj.to_object_func,
15881  */
15882  }
15883 
15884  /* "View.MemoryView":782
15885  * memview.dtype_is_object)
15886  * else:
15887  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
15888  * memview.dtype_is_object)
15889  *
15890  */
15891  /*else*/ {
15892  __Pyx_XDECREF(((PyObject *)__pyx_r));
15893 
15894  /* "View.MemoryView":783
15895  * else:
15896  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
15897  * memview.dtype_is_object) # <<<<<<<<<<<<<<
15898  *
15899  *
15900  */
15901  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 782, __pyx_L1_error)
15902  __Pyx_GOTREF(__pyx_t_3);
15903 
15904  /* "View.MemoryView":782
15905  * memview.dtype_is_object)
15906  * else:
15907  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
15908  * memview.dtype_is_object)
15909  *
15910  */
15911  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error)
15912  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
15913  __pyx_t_3 = 0;
15914  goto __pyx_L0;
15915  }
15916 
15917  /* "View.MemoryView":710
15918  *
15919  * @cname('__pyx_memview_slice')
15920  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
15921  * cdef int new_ndim = 0, suboffset_dim = -1, dim
15922  * cdef bint negative_step
15923  */
15924 
15925  /* function exit code */
15926  __pyx_L1_error:;
15927  __Pyx_XDECREF(__pyx_t_3);
15928  __Pyx_XDECREF(__pyx_t_9);
15929  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15930  __pyx_r = 0;
15931  __pyx_L0:;
15932  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
15933  __Pyx_XDECREF(__pyx_v_index);
15934  __Pyx_XGIVEREF((PyObject *)__pyx_r);
15935  __Pyx_RefNannyFinishContext();
15936  return __pyx_r;
15937 }
15938 
15939 /* "View.MemoryView":807
15940  *
15941  * @cname('__pyx_memoryview_slice_memviewslice')
15942  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
15943  * __Pyx_memviewslice *dst,
15944  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
15945  */
15946 
15947 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) {
15948  Py_ssize_t __pyx_v_new_shape;
15949  int __pyx_v_negative_step;
15950  int __pyx_r;
15951  int __pyx_t_1;
15952  int __pyx_t_2;
15953  int __pyx_t_3;
15954  int __pyx_lineno = 0;
15955  const char *__pyx_filename = NULL;
15956  int __pyx_clineno = 0;
15957 
15958  /* "View.MemoryView":827
15959  * cdef bint negative_step
15960  *
15961  * if not is_slice: # <<<<<<<<<<<<<<
15962  *
15963  * if start < 0:
15964  */
15965  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
15966  if (__pyx_t_1) {
15967 
15968  /* "View.MemoryView":829
15969  * if not is_slice:
15970  *
15971  * if start < 0: # <<<<<<<<<<<<<<
15972  * start += shape
15973  * if not 0 <= start < shape:
15974  */
15975  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
15976  if (__pyx_t_1) {
15977 
15978  /* "View.MemoryView":830
15979  *
15980  * if start < 0:
15981  * start += shape # <<<<<<<<<<<<<<
15982  * if not 0 <= start < shape:
15983  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15984  */
15985  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15986 
15987  /* "View.MemoryView":829
15988  * if not is_slice:
15989  *
15990  * if start < 0: # <<<<<<<<<<<<<<
15991  * start += shape
15992  * if not 0 <= start < shape:
15993  */
15994  }
15995 
15996  /* "View.MemoryView":831
15997  * if start < 0:
15998  * start += shape
15999  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
16000  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16001  * else:
16002  */
16003  __pyx_t_1 = (0 <= __pyx_v_start);
16004  if (__pyx_t_1) {
16005  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
16006  }
16007  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
16008  if (__pyx_t_2) {
16009 
16010  /* "View.MemoryView":832
16011  * start += shape
16012  * if not 0 <= start < shape:
16013  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
16014  * else:
16015  *
16016  */
16017  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 832, __pyx_L1_error)
16018 
16019  /* "View.MemoryView":831
16020  * if start < 0:
16021  * start += shape
16022  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
16023  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
16024  * else:
16025  */
16026  }
16027 
16028  /* "View.MemoryView":827
16029  * cdef bint negative_step
16030  *
16031  * if not is_slice: # <<<<<<<<<<<<<<
16032  *
16033  * if start < 0:
16034  */
16035  goto __pyx_L3;
16036  }
16037 
16038  /* "View.MemoryView":835
16039  * else:
16040  *
16041  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
16042  *
16043  * if have_step and step == 0:
16044  */
16045  /*else*/ {
16046  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
16047  if (__pyx_t_1) {
16048  } else {
16049  __pyx_t_2 = __pyx_t_1;
16050  goto __pyx_L6_bool_binop_done;
16051  }
16052  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
16053  __pyx_t_2 = __pyx_t_1;
16054  __pyx_L6_bool_binop_done:;
16055  __pyx_v_negative_step = __pyx_t_2;
16056 
16057  /* "View.MemoryView":837
16058  * negative_step = have_step != 0 and step < 0
16059  *
16060  * if have_step and step == 0: # <<<<<<<<<<<<<<
16061  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
16062  *
16063  */
16064  __pyx_t_1 = (__pyx_v_have_step != 0);
16065  if (__pyx_t_1) {
16066  } else {
16067  __pyx_t_2 = __pyx_t_1;
16068  goto __pyx_L9_bool_binop_done;
16069  }
16070  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
16071  __pyx_t_2 = __pyx_t_1;
16072  __pyx_L9_bool_binop_done:;
16073  if (__pyx_t_2) {
16074 
16075  /* "View.MemoryView":838
16076  *
16077  * if have_step and step == 0:
16078  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
16079  *
16080  *
16081  */
16082  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 838, __pyx_L1_error)
16083 
16084  /* "View.MemoryView":837
16085  * negative_step = have_step != 0 and step < 0
16086  *
16087  * if have_step and step == 0: # <<<<<<<<<<<<<<
16088  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
16089  *
16090  */
16091  }
16092 
16093  /* "View.MemoryView":841
16094  *
16095  *
16096  * if have_start: # <<<<<<<<<<<<<<
16097  * if start < 0:
16098  * start += shape
16099  */
16100  __pyx_t_2 = (__pyx_v_have_start != 0);
16101  if (__pyx_t_2) {
16102 
16103  /* "View.MemoryView":842
16104  *
16105  * if have_start:
16106  * if start < 0: # <<<<<<<<<<<<<<
16107  * start += shape
16108  * if start < 0:
16109  */
16110  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16111  if (__pyx_t_2) {
16112 
16113  /* "View.MemoryView":843
16114  * if have_start:
16115  * if start < 0:
16116  * start += shape # <<<<<<<<<<<<<<
16117  * if start < 0:
16118  * start = 0
16119  */
16120  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
16121 
16122  /* "View.MemoryView":844
16123  * if start < 0:
16124  * start += shape
16125  * if start < 0: # <<<<<<<<<<<<<<
16126  * start = 0
16127  * elif start >= shape:
16128  */
16129  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16130  if (__pyx_t_2) {
16131 
16132  /* "View.MemoryView":845
16133  * start += shape
16134  * if start < 0:
16135  * start = 0 # <<<<<<<<<<<<<<
16136  * elif start >= shape:
16137  * if negative_step:
16138  */
16139  __pyx_v_start = 0;
16140 
16141  /* "View.MemoryView":844
16142  * if start < 0:
16143  * start += shape
16144  * if start < 0: # <<<<<<<<<<<<<<
16145  * start = 0
16146  * elif start >= shape:
16147  */
16148  }
16149 
16150  /* "View.MemoryView":842
16151  *
16152  * if have_start:
16153  * if start < 0: # <<<<<<<<<<<<<<
16154  * start += shape
16155  * if start < 0:
16156  */
16157  goto __pyx_L12;
16158  }
16159 
16160  /* "View.MemoryView":846
16161  * if start < 0:
16162  * start = 0
16163  * elif start >= shape: # <<<<<<<<<<<<<<
16164  * if negative_step:
16165  * start = shape - 1
16166  */
16167  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
16168  if (__pyx_t_2) {
16169 
16170  /* "View.MemoryView":847
16171  * start = 0
16172  * elif start >= shape:
16173  * if negative_step: # <<<<<<<<<<<<<<
16174  * start = shape - 1
16175  * else:
16176  */
16177  __pyx_t_2 = (__pyx_v_negative_step != 0);
16178  if (__pyx_t_2) {
16179 
16180  /* "View.MemoryView":848
16181  * elif start >= shape:
16182  * if negative_step:
16183  * start = shape - 1 # <<<<<<<<<<<<<<
16184  * else:
16185  * start = shape
16186  */
16187  __pyx_v_start = (__pyx_v_shape - 1);
16188 
16189  /* "View.MemoryView":847
16190  * start = 0
16191  * elif start >= shape:
16192  * if negative_step: # <<<<<<<<<<<<<<
16193  * start = shape - 1
16194  * else:
16195  */
16196  goto __pyx_L14;
16197  }
16198 
16199  /* "View.MemoryView":850
16200  * start = shape - 1
16201  * else:
16202  * start = shape # <<<<<<<<<<<<<<
16203  * else:
16204  * if negative_step:
16205  */
16206  /*else*/ {
16207  __pyx_v_start = __pyx_v_shape;
16208  }
16209  __pyx_L14:;
16210 
16211  /* "View.MemoryView":846
16212  * if start < 0:
16213  * start = 0
16214  * elif start >= shape: # <<<<<<<<<<<<<<
16215  * if negative_step:
16216  * start = shape - 1
16217  */
16218  }
16219  __pyx_L12:;
16220 
16221  /* "View.MemoryView":841
16222  *
16223  *
16224  * if have_start: # <<<<<<<<<<<<<<
16225  * if start < 0:
16226  * start += shape
16227  */
16228  goto __pyx_L11;
16229  }
16230 
16231  /* "View.MemoryView":852
16232  * start = shape
16233  * else:
16234  * if negative_step: # <<<<<<<<<<<<<<
16235  * start = shape - 1
16236  * else:
16237  */
16238  /*else*/ {
16239  __pyx_t_2 = (__pyx_v_negative_step != 0);
16240  if (__pyx_t_2) {
16241 
16242  /* "View.MemoryView":853
16243  * else:
16244  * if negative_step:
16245  * start = shape - 1 # <<<<<<<<<<<<<<
16246  * else:
16247  * start = 0
16248  */
16249  __pyx_v_start = (__pyx_v_shape - 1);
16250 
16251  /* "View.MemoryView":852
16252  * start = shape
16253  * else:
16254  * if negative_step: # <<<<<<<<<<<<<<
16255  * start = shape - 1
16256  * else:
16257  */
16258  goto __pyx_L15;
16259  }
16260 
16261  /* "View.MemoryView":855
16262  * start = shape - 1
16263  * else:
16264  * start = 0 # <<<<<<<<<<<<<<
16265  *
16266  * if have_stop:
16267  */
16268  /*else*/ {
16269  __pyx_v_start = 0;
16270  }
16271  __pyx_L15:;
16272  }
16273  __pyx_L11:;
16274 
16275  /* "View.MemoryView":857
16276  * start = 0
16277  *
16278  * if have_stop: # <<<<<<<<<<<<<<
16279  * if stop < 0:
16280  * stop += shape
16281  */
16282  __pyx_t_2 = (__pyx_v_have_stop != 0);
16283  if (__pyx_t_2) {
16284 
16285  /* "View.MemoryView":858
16286  *
16287  * if have_stop:
16288  * if stop < 0: # <<<<<<<<<<<<<<
16289  * stop += shape
16290  * if stop < 0:
16291  */
16292  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16293  if (__pyx_t_2) {
16294 
16295  /* "View.MemoryView":859
16296  * if have_stop:
16297  * if stop < 0:
16298  * stop += shape # <<<<<<<<<<<<<<
16299  * if stop < 0:
16300  * stop = 0
16301  */
16302  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
16303 
16304  /* "View.MemoryView":860
16305  * if stop < 0:
16306  * stop += shape
16307  * if stop < 0: # <<<<<<<<<<<<<<
16308  * stop = 0
16309  * elif stop > shape:
16310  */
16311  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16312  if (__pyx_t_2) {
16313 
16314  /* "View.MemoryView":861
16315  * stop += shape
16316  * if stop < 0:
16317  * stop = 0 # <<<<<<<<<<<<<<
16318  * elif stop > shape:
16319  * stop = shape
16320  */
16321  __pyx_v_stop = 0;
16322 
16323  /* "View.MemoryView":860
16324  * if stop < 0:
16325  * stop += shape
16326  * if stop < 0: # <<<<<<<<<<<<<<
16327  * stop = 0
16328  * elif stop > shape:
16329  */
16330  }
16331 
16332  /* "View.MemoryView":858
16333  *
16334  * if have_stop:
16335  * if stop < 0: # <<<<<<<<<<<<<<
16336  * stop += shape
16337  * if stop < 0:
16338  */
16339  goto __pyx_L17;
16340  }
16341 
16342  /* "View.MemoryView":862
16343  * if stop < 0:
16344  * stop = 0
16345  * elif stop > shape: # <<<<<<<<<<<<<<
16346  * stop = shape
16347  * else:
16348  */
16349  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
16350  if (__pyx_t_2) {
16351 
16352  /* "View.MemoryView":863
16353  * stop = 0
16354  * elif stop > shape:
16355  * stop = shape # <<<<<<<<<<<<<<
16356  * else:
16357  * if negative_step:
16358  */
16359  __pyx_v_stop = __pyx_v_shape;
16360 
16361  /* "View.MemoryView":862
16362  * if stop < 0:
16363  * stop = 0
16364  * elif stop > shape: # <<<<<<<<<<<<<<
16365  * stop = shape
16366  * else:
16367  */
16368  }
16369  __pyx_L17:;
16370 
16371  /* "View.MemoryView":857
16372  * start = 0
16373  *
16374  * if have_stop: # <<<<<<<<<<<<<<
16375  * if stop < 0:
16376  * stop += shape
16377  */
16378  goto __pyx_L16;
16379  }
16380 
16381  /* "View.MemoryView":865
16382  * stop = shape
16383  * else:
16384  * if negative_step: # <<<<<<<<<<<<<<
16385  * stop = -1
16386  * else:
16387  */
16388  /*else*/ {
16389  __pyx_t_2 = (__pyx_v_negative_step != 0);
16390  if (__pyx_t_2) {
16391 
16392  /* "View.MemoryView":866
16393  * else:
16394  * if negative_step:
16395  * stop = -1 # <<<<<<<<<<<<<<
16396  * else:
16397  * stop = shape
16398  */
16399  __pyx_v_stop = -1L;
16400 
16401  /* "View.MemoryView":865
16402  * stop = shape
16403  * else:
16404  * if negative_step: # <<<<<<<<<<<<<<
16405  * stop = -1
16406  * else:
16407  */
16408  goto __pyx_L19;
16409  }
16410 
16411  /* "View.MemoryView":868
16412  * stop = -1
16413  * else:
16414  * stop = shape # <<<<<<<<<<<<<<
16415  *
16416  * if not have_step:
16417  */
16418  /*else*/ {
16419  __pyx_v_stop = __pyx_v_shape;
16420  }
16421  __pyx_L19:;
16422  }
16423  __pyx_L16:;
16424 
16425  /* "View.MemoryView":870
16426  * stop = shape
16427  *
16428  * if not have_step: # <<<<<<<<<<<<<<
16429  * step = 1
16430  *
16431  */
16432  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
16433  if (__pyx_t_2) {
16434 
16435  /* "View.MemoryView":871
16436  *
16437  * if not have_step:
16438  * step = 1 # <<<<<<<<<<<<<<
16439  *
16440  *
16441  */
16442  __pyx_v_step = 1;
16443 
16444  /* "View.MemoryView":870
16445  * stop = shape
16446  *
16447  * if not have_step: # <<<<<<<<<<<<<<
16448  * step = 1
16449  *
16450  */
16451  }
16452 
16453  /* "View.MemoryView":875
16454  *
16455  * with cython.cdivision(True):
16456  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
16457  *
16458  * if (stop - start) - step * new_shape:
16459  */
16460  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
16461 
16462  /* "View.MemoryView":877
16463  * new_shape = (stop - start) // step
16464  *
16465  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16466  * new_shape += 1
16467  *
16468  */
16469  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
16470  if (__pyx_t_2) {
16471 
16472  /* "View.MemoryView":878
16473  *
16474  * if (stop - start) - step * new_shape:
16475  * new_shape += 1 # <<<<<<<<<<<<<<
16476  *
16477  * if new_shape < 0:
16478  */
16479  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
16480 
16481  /* "View.MemoryView":877
16482  * new_shape = (stop - start) // step
16483  *
16484  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16485  * new_shape += 1
16486  *
16487  */
16488  }
16489 
16490  /* "View.MemoryView":880
16491  * new_shape += 1
16492  *
16493  * if new_shape < 0: # <<<<<<<<<<<<<<
16494  * new_shape = 0
16495  *
16496  */
16497  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
16498  if (__pyx_t_2) {
16499 
16500  /* "View.MemoryView":881
16501  *
16502  * if new_shape < 0:
16503  * new_shape = 0 # <<<<<<<<<<<<<<
16504  *
16505  *
16506  */
16507  __pyx_v_new_shape = 0;
16508 
16509  /* "View.MemoryView":880
16510  * new_shape += 1
16511  *
16512  * if new_shape < 0: # <<<<<<<<<<<<<<
16513  * new_shape = 0
16514  *
16515  */
16516  }
16517 
16518  /* "View.MemoryView":884
16519  *
16520  *
16521  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
16522  * dst.shape[new_ndim] = new_shape
16523  * dst.suboffsets[new_ndim] = suboffset
16524  */
16525  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
16526 
16527  /* "View.MemoryView":885
16528  *
16529  * dst.strides[new_ndim] = stride * step
16530  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
16531  * dst.suboffsets[new_ndim] = suboffset
16532  *
16533  */
16534  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
16535 
16536  /* "View.MemoryView":886
16537  * dst.strides[new_ndim] = stride * step
16538  * dst.shape[new_ndim] = new_shape
16539  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
16540  *
16541  *
16542  */
16543  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
16544  }
16545  __pyx_L3:;
16546 
16547  /* "View.MemoryView":889
16548  *
16549  *
16550  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16551  * dst.data += start * stride
16552  * else:
16553  */
16554  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
16555  if (__pyx_t_2) {
16556 
16557  /* "View.MemoryView":890
16558  *
16559  * if suboffset_dim[0] < 0:
16560  * dst.data += start * stride # <<<<<<<<<<<<<<
16561  * else:
16562  * dst.suboffsets[suboffset_dim[0]] += start * stride
16563  */
16564  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
16565 
16566  /* "View.MemoryView":889
16567  *
16568  *
16569  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16570  * dst.data += start * stride
16571  * else:
16572  */
16573  goto __pyx_L23;
16574  }
16575 
16576  /* "View.MemoryView":892
16577  * dst.data += start * stride
16578  * else:
16579  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
16580  *
16581  * if suboffset >= 0:
16582  */
16583  /*else*/ {
16584  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
16585  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
16586  }
16587  __pyx_L23:;
16588 
16589  /* "View.MemoryView":894
16590  * dst.suboffsets[suboffset_dim[0]] += start * stride
16591  *
16592  * if suboffset >= 0: # <<<<<<<<<<<<<<
16593  * if not is_slice:
16594  * if new_ndim == 0:
16595  */
16596  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16597  if (__pyx_t_2) {
16598 
16599  /* "View.MemoryView":895
16600  *
16601  * if suboffset >= 0:
16602  * if not is_slice: # <<<<<<<<<<<<<<
16603  * if new_ndim == 0:
16604  * dst.data = (<char **> dst.data)[0] + suboffset
16605  */
16606  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
16607  if (__pyx_t_2) {
16608 
16609  /* "View.MemoryView":896
16610  * if suboffset >= 0:
16611  * if not is_slice:
16612  * if new_ndim == 0: # <<<<<<<<<<<<<<
16613  * dst.data = (<char **> dst.data)[0] + suboffset
16614  * else:
16615  */
16616  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
16617  if (__pyx_t_2) {
16618 
16619  /* "View.MemoryView":897
16620  * if not is_slice:
16621  * if new_ndim == 0:
16622  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
16623  * else:
16624  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16625  */
16626  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
16627 
16628  /* "View.MemoryView":896
16629  * if suboffset >= 0:
16630  * if not is_slice:
16631  * if new_ndim == 0: # <<<<<<<<<<<<<<
16632  * dst.data = (<char **> dst.data)[0] + suboffset
16633  * else:
16634  */
16635  goto __pyx_L26;
16636  }
16637 
16638  /* "View.MemoryView":899
16639  * dst.data = (<char **> dst.data)[0] + suboffset
16640  * else:
16641  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
16642  * "must be indexed and not sliced", dim)
16643  * else:
16644  */
16645  /*else*/ {
16646 
16647  /* "View.MemoryView":900
16648  * else:
16649  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16650  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
16651  * else:
16652  * suboffset_dim[0] = new_ndim
16653  */
16654  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 899, __pyx_L1_error)
16655  }
16656  __pyx_L26:;
16657 
16658  /* "View.MemoryView":895
16659  *
16660  * if suboffset >= 0:
16661  * if not is_slice: # <<<<<<<<<<<<<<
16662  * if new_ndim == 0:
16663  * dst.data = (<char **> dst.data)[0] + suboffset
16664  */
16665  goto __pyx_L25;
16666  }
16667 
16668  /* "View.MemoryView":902
16669  * "must be indexed and not sliced", dim)
16670  * else:
16671  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
16672  *
16673  * return 0
16674  */
16675  /*else*/ {
16676  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
16677  }
16678  __pyx_L25:;
16679 
16680  /* "View.MemoryView":894
16681  * dst.suboffsets[suboffset_dim[0]] += start * stride
16682  *
16683  * if suboffset >= 0: # <<<<<<<<<<<<<<
16684  * if not is_slice:
16685  * if new_ndim == 0:
16686  */
16687  }
16688 
16689  /* "View.MemoryView":904
16690  * suboffset_dim[0] = new_ndim
16691  *
16692  * return 0 # <<<<<<<<<<<<<<
16693  *
16694  *
16695  */
16696  __pyx_r = 0;
16697  goto __pyx_L0;
16698 
16699  /* "View.MemoryView":807
16700  *
16701  * @cname('__pyx_memoryview_slice_memviewslice')
16702  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
16703  * __Pyx_memviewslice *dst,
16704  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16705  */
16706 
16707  /* function exit code */
16708  __pyx_L1_error:;
16709  {
16710  #ifdef WITH_THREAD
16711  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16712  #endif
16713  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16714  #ifdef WITH_THREAD
16715  __Pyx_PyGILState_Release(__pyx_gilstate_save);
16716  #endif
16717  }
16718  __pyx_r = -1;
16719  __pyx_L0:;
16720  return __pyx_r;
16721 }
16722 
16723 /* "View.MemoryView":910
16724  *
16725  * @cname('__pyx_pybuffer_index')
16726  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
16727  * Py_ssize_t dim) except NULL:
16728  * cdef Py_ssize_t shape, stride, suboffset = -1
16729  */
16730 
16731 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) {
16732  Py_ssize_t __pyx_v_shape;
16733  Py_ssize_t __pyx_v_stride;
16734  Py_ssize_t __pyx_v_suboffset;
16735  Py_ssize_t __pyx_v_itemsize;
16736  char *__pyx_v_resultp;
16737  char *__pyx_r;
16738  __Pyx_RefNannyDeclarations
16739  Py_ssize_t __pyx_t_1;
16740  int __pyx_t_2;
16741  PyObject *__pyx_t_3 = NULL;
16742  PyObject *__pyx_t_4 = NULL;
16743  int __pyx_lineno = 0;
16744  const char *__pyx_filename = NULL;
16745  int __pyx_clineno = 0;
16746  __Pyx_RefNannySetupContext("pybuffer_index", 0);
16747 
16748  /* "View.MemoryView":912
16749  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
16750  * Py_ssize_t dim) except NULL:
16751  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
16752  * cdef Py_ssize_t itemsize = view.itemsize
16753  * cdef char *resultp
16754  */
16755  __pyx_v_suboffset = -1L;
16756 
16757  /* "View.MemoryView":913
16758  * Py_ssize_t dim) except NULL:
16759  * cdef Py_ssize_t shape, stride, suboffset = -1
16760  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
16761  * cdef char *resultp
16762  *
16763  */
16764  __pyx_t_1 = __pyx_v_view->itemsize;
16765  __pyx_v_itemsize = __pyx_t_1;
16766 
16767  /* "View.MemoryView":916
16768  * cdef char *resultp
16769  *
16770  * if view.ndim == 0: # <<<<<<<<<<<<<<
16771  * shape = view.len / itemsize
16772  * stride = itemsize
16773  */
16774  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
16775  if (__pyx_t_2) {
16776 
16777  /* "View.MemoryView":917
16778  *
16779  * if view.ndim == 0:
16780  * shape = view.len / itemsize # <<<<<<<<<<<<<<
16781  * stride = itemsize
16782  * else:
16783  */
16784  if (unlikely(__pyx_v_itemsize == 0)) {
16785  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
16786  __PYX_ERR(1, 917, __pyx_L1_error)
16787  }
16788  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))) {
16789  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
16790  __PYX_ERR(1, 917, __pyx_L1_error)
16791  }
16792  __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
16793 
16794  /* "View.MemoryView":918
16795  * if view.ndim == 0:
16796  * shape = view.len / itemsize
16797  * stride = itemsize # <<<<<<<<<<<<<<
16798  * else:
16799  * shape = view.shape[dim]
16800  */
16801  __pyx_v_stride = __pyx_v_itemsize;
16802 
16803  /* "View.MemoryView":916
16804  * cdef char *resultp
16805  *
16806  * if view.ndim == 0: # <<<<<<<<<<<<<<
16807  * shape = view.len / itemsize
16808  * stride = itemsize
16809  */
16810  goto __pyx_L3;
16811  }
16812 
16813  /* "View.MemoryView":920
16814  * stride = itemsize
16815  * else:
16816  * shape = view.shape[dim] # <<<<<<<<<<<<<<
16817  * stride = view.strides[dim]
16818  * if view.suboffsets != NULL:
16819  */
16820  /*else*/ {
16821  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
16822 
16823  /* "View.MemoryView":921
16824  * else:
16825  * shape = view.shape[dim]
16826  * stride = view.strides[dim] # <<<<<<<<<<<<<<
16827  * if view.suboffsets != NULL:
16828  * suboffset = view.suboffsets[dim]
16829  */
16830  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
16831 
16832  /* "View.MemoryView":922
16833  * shape = view.shape[dim]
16834  * stride = view.strides[dim]
16835  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
16836  * suboffset = view.suboffsets[dim]
16837  *
16838  */
16839  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
16840  if (__pyx_t_2) {
16841 
16842  /* "View.MemoryView":923
16843  * stride = view.strides[dim]
16844  * if view.suboffsets != NULL:
16845  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
16846  *
16847  * if index < 0:
16848  */
16849  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
16850 
16851  /* "View.MemoryView":922
16852  * shape = view.shape[dim]
16853  * stride = view.strides[dim]
16854  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
16855  * suboffset = view.suboffsets[dim]
16856  *
16857  */
16858  }
16859  }
16860  __pyx_L3:;
16861 
16862  /* "View.MemoryView":925
16863  * suboffset = view.suboffsets[dim]
16864  *
16865  * if index < 0: # <<<<<<<<<<<<<<
16866  * index += view.shape[dim]
16867  * if index < 0:
16868  */
16869  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16870  if (__pyx_t_2) {
16871 
16872  /* "View.MemoryView":926
16873  *
16874  * if index < 0:
16875  * index += view.shape[dim] # <<<<<<<<<<<<<<
16876  * if index < 0:
16877  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16878  */
16879  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
16880 
16881  /* "View.MemoryView":927
16882  * if index < 0:
16883  * index += view.shape[dim]
16884  * if index < 0: # <<<<<<<<<<<<<<
16885  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16886  *
16887  */
16888  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16889  if (unlikely(__pyx_t_2)) {
16890 
16891  /* "View.MemoryView":928
16892  * index += view.shape[dim]
16893  * if index < 0:
16894  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
16895  *
16896  * if index >= shape:
16897  */
16898  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
16899  __Pyx_GOTREF(__pyx_t_3);
16900  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 928, __pyx_L1_error)
16901  __Pyx_GOTREF(__pyx_t_4);
16902  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16903  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
16904  __Pyx_GOTREF(__pyx_t_3);
16905  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16906  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16907  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16908  __PYX_ERR(1, 928, __pyx_L1_error)
16909 
16910  /* "View.MemoryView":927
16911  * if index < 0:
16912  * index += view.shape[dim]
16913  * if index < 0: # <<<<<<<<<<<<<<
16914  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16915  *
16916  */
16917  }
16918 
16919  /* "View.MemoryView":925
16920  * suboffset = view.suboffsets[dim]
16921  *
16922  * if index < 0: # <<<<<<<<<<<<<<
16923  * index += view.shape[dim]
16924  * if index < 0:
16925  */
16926  }
16927 
16928  /* "View.MemoryView":930
16929  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16930  *
16931  * if index >= shape: # <<<<<<<<<<<<<<
16932  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16933  *
16934  */
16935  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
16936  if (unlikely(__pyx_t_2)) {
16937 
16938  /* "View.MemoryView":931
16939  *
16940  * if index >= shape:
16941  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
16942  *
16943  * resultp = bufp + index * stride
16944  */
16945  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
16946  __Pyx_GOTREF(__pyx_t_3);
16947  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 931, __pyx_L1_error)
16948  __Pyx_GOTREF(__pyx_t_4);
16949  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16950  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
16951  __Pyx_GOTREF(__pyx_t_3);
16952  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16953  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16954  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16955  __PYX_ERR(1, 931, __pyx_L1_error)
16956 
16957  /* "View.MemoryView":930
16958  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16959  *
16960  * if index >= shape: # <<<<<<<<<<<<<<
16961  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16962  *
16963  */
16964  }
16965 
16966  /* "View.MemoryView":933
16967  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16968  *
16969  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
16970  * if suboffset >= 0:
16971  * resultp = (<char **> resultp)[0] + suboffset
16972  */
16973  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
16974 
16975  /* "View.MemoryView":934
16976  *
16977  * resultp = bufp + index * stride
16978  * if suboffset >= 0: # <<<<<<<<<<<<<<
16979  * resultp = (<char **> resultp)[0] + suboffset
16980  *
16981  */
16982  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16983  if (__pyx_t_2) {
16984 
16985  /* "View.MemoryView":935
16986  * resultp = bufp + index * stride
16987  * if suboffset >= 0:
16988  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
16989  *
16990  * return resultp
16991  */
16992  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
16993 
16994  /* "View.MemoryView":934
16995  *
16996  * resultp = bufp + index * stride
16997  * if suboffset >= 0: # <<<<<<<<<<<<<<
16998  * resultp = (<char **> resultp)[0] + suboffset
16999  *
17000  */
17001  }
17002 
17003  /* "View.MemoryView":937
17004  * resultp = (<char **> resultp)[0] + suboffset
17005  *
17006  * return resultp # <<<<<<<<<<<<<<
17007  *
17008  *
17009  */
17010  __pyx_r = __pyx_v_resultp;
17011  goto __pyx_L0;
17012 
17013  /* "View.MemoryView":910
17014  *
17015  * @cname('__pyx_pybuffer_index')
17016  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
17017  * Py_ssize_t dim) except NULL:
17018  * cdef Py_ssize_t shape, stride, suboffset = -1
17019  */
17020 
17021  /* function exit code */
17022  __pyx_L1_error:;
17023  __Pyx_XDECREF(__pyx_t_3);
17024  __Pyx_XDECREF(__pyx_t_4);
17025  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
17026  __pyx_r = NULL;
17027  __pyx_L0:;
17028  __Pyx_RefNannyFinishContext();
17029  return __pyx_r;
17030 }
17031 
17032 /* "View.MemoryView":943
17033  *
17034  * @cname('__pyx_memslice_transpose')
17035  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
17036  * cdef int ndim = memslice.memview.view.ndim
17037  *
17038  */
17039 
17040 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
17041  int __pyx_v_ndim;
17042  Py_ssize_t *__pyx_v_shape;
17043  Py_ssize_t *__pyx_v_strides;
17044  int __pyx_v_i;
17045  int __pyx_v_j;
17046  int __pyx_r;
17047  int __pyx_t_1;
17048  Py_ssize_t *__pyx_t_2;
17049  long __pyx_t_3;
17050  long __pyx_t_4;
17051  Py_ssize_t __pyx_t_5;
17052  Py_ssize_t __pyx_t_6;
17053  int __pyx_t_7;
17054  int __pyx_t_8;
17055  int __pyx_t_9;
17056  int __pyx_lineno = 0;
17057  const char *__pyx_filename = NULL;
17058  int __pyx_clineno = 0;
17059 
17060  /* "View.MemoryView":944
17061  * @cname('__pyx_memslice_transpose')
17062  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
17063  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
17064  *
17065  * cdef Py_ssize_t *shape = memslice.shape
17066  */
17067  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
17068  __pyx_v_ndim = __pyx_t_1;
17069 
17070  /* "View.MemoryView":946
17071  * cdef int ndim = memslice.memview.view.ndim
17072  *
17073  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
17074  * cdef Py_ssize_t *strides = memslice.strides
17075  *
17076  */
17077  __pyx_t_2 = __pyx_v_memslice->shape;
17078  __pyx_v_shape = __pyx_t_2;
17079 
17080  /* "View.MemoryView":947
17081  *
17082  * cdef Py_ssize_t *shape = memslice.shape
17083  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
17084  *
17085  *
17086  */
17087  __pyx_t_2 = __pyx_v_memslice->strides;
17088  __pyx_v_strides = __pyx_t_2;
17089 
17090  /* "View.MemoryView":951
17091  *
17092  * cdef int i, j
17093  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
17094  * j = ndim - 1 - i
17095  * strides[i], strides[j] = strides[j], strides[i]
17096  */
17097  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
17098  __pyx_t_4 = __pyx_t_3;
17099  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
17100  __pyx_v_i = __pyx_t_1;
17101 
17102  /* "View.MemoryView":952
17103  * cdef int i, j
17104  * for i in range(ndim / 2):
17105  * j = ndim - 1 - i # <<<<<<<<<<<<<<
17106  * strides[i], strides[j] = strides[j], strides[i]
17107  * shape[i], shape[j] = shape[j], shape[i]
17108  */
17109  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
17110 
17111  /* "View.MemoryView":953
17112  * for i in range(ndim / 2):
17113  * j = ndim - 1 - i
17114  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
17115  * shape[i], shape[j] = shape[j], shape[i]
17116  *
17117  */
17118  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
17119  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
17120  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
17121  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
17122 
17123  /* "View.MemoryView":954
17124  * j = ndim - 1 - i
17125  * strides[i], strides[j] = strides[j], strides[i]
17126  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
17127  *
17128  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
17129  */
17130  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
17131  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
17132  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
17133  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
17134 
17135  /* "View.MemoryView":956
17136  * shape[i], shape[j] = shape[j], shape[i]
17137  *
17138  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
17139  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17140  *
17141  */
17142  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
17143  if (!__pyx_t_8) {
17144  } else {
17145  __pyx_t_7 = __pyx_t_8;
17146  goto __pyx_L6_bool_binop_done;
17147  }
17148  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
17149  __pyx_t_7 = __pyx_t_8;
17150  __pyx_L6_bool_binop_done:;
17151  if (__pyx_t_7) {
17152 
17153  /* "View.MemoryView":957
17154  *
17155  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
17156  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
17157  *
17158  * return 1
17159  */
17160  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 957, __pyx_L1_error)
17161 
17162  /* "View.MemoryView":956
17163  * shape[i], shape[j] = shape[j], shape[i]
17164  *
17165  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
17166  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17167  *
17168  */
17169  }
17170  }
17171 
17172  /* "View.MemoryView":959
17173  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
17174  *
17175  * return 1 # <<<<<<<<<<<<<<
17176  *
17177  *
17178  */
17179  __pyx_r = 1;
17180  goto __pyx_L0;
17181 
17182  /* "View.MemoryView":943
17183  *
17184  * @cname('__pyx_memslice_transpose')
17185  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
17186  * cdef int ndim = memslice.memview.view.ndim
17187  *
17188  */
17189 
17190  /* function exit code */
17191  __pyx_L1_error:;
17192  {
17193  #ifdef WITH_THREAD
17194  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17195  #endif
17196  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17197  #ifdef WITH_THREAD
17198  __Pyx_PyGILState_Release(__pyx_gilstate_save);
17199  #endif
17200  }
17201  __pyx_r = 0;
17202  __pyx_L0:;
17203  return __pyx_r;
17204 }
17205 
17206 /* "View.MemoryView":976
17207  * cdef int (*to_dtype_func)(char *, object) except 0
17208  *
17209  * def __dealloc__(self): # <<<<<<<<<<<<<<
17210  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17211  *
17212  */
17213 
17214 /* Python wrapper */
17215 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
17216 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
17217  __Pyx_RefNannyDeclarations
17218  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
17219  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17220 
17221  /* function exit code */
17222  __Pyx_RefNannyFinishContext();
17223 }
17224 
17225 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17226  __Pyx_RefNannyDeclarations
17227  __Pyx_RefNannySetupContext("__dealloc__", 0);
17228 
17229  /* "View.MemoryView":977
17230  *
17231  * def __dealloc__(self):
17232  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
17233  *
17234  * cdef convert_item_to_object(self, char *itemp):
17235  */
17236  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
17237 
17238  /* "View.MemoryView":976
17239  * cdef int (*to_dtype_func)(char *, object) except 0
17240  *
17241  * def __dealloc__(self): # <<<<<<<<<<<<<<
17242  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17243  *
17244  */
17245 
17246  /* function exit code */
17247  __Pyx_RefNannyFinishContext();
17248 }
17249 
17250 /* "View.MemoryView":979
17251  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17252  *
17253  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
17254  * if self.to_object_func != NULL:
17255  * return self.to_object_func(itemp)
17256  */
17257 
17258 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
17259  PyObject *__pyx_r = NULL;
17260  __Pyx_RefNannyDeclarations
17261  int __pyx_t_1;
17262  PyObject *__pyx_t_2 = NULL;
17263  int __pyx_lineno = 0;
17264  const char *__pyx_filename = NULL;
17265  int __pyx_clineno = 0;
17266  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
17267 
17268  /* "View.MemoryView":980
17269  *
17270  * cdef convert_item_to_object(self, char *itemp):
17271  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
17272  * return self.to_object_func(itemp)
17273  * else:
17274  */
17275  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
17276  if (__pyx_t_1) {
17277 
17278  /* "View.MemoryView":981
17279  * cdef convert_item_to_object(self, char *itemp):
17280  * if self.to_object_func != NULL:
17281  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
17282  * else:
17283  * return memoryview.convert_item_to_object(self, itemp)
17284  */
17285  __Pyx_XDECREF(__pyx_r);
17286  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error)
17287  __Pyx_GOTREF(__pyx_t_2);
17288  __pyx_r = __pyx_t_2;
17289  __pyx_t_2 = 0;
17290  goto __pyx_L0;
17291 
17292  /* "View.MemoryView":980
17293  *
17294  * cdef convert_item_to_object(self, char *itemp):
17295  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
17296  * return self.to_object_func(itemp)
17297  * else:
17298  */
17299  }
17300 
17301  /* "View.MemoryView":983
17302  * return self.to_object_func(itemp)
17303  * else:
17304  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
17305  *
17306  * cdef assign_item_from_object(self, char *itemp, object value):
17307  */
17308  /*else*/ {
17309  __Pyx_XDECREF(__pyx_r);
17310  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
17311  __Pyx_GOTREF(__pyx_t_2);
17312  __pyx_r = __pyx_t_2;
17313  __pyx_t_2 = 0;
17314  goto __pyx_L0;
17315  }
17316 
17317  /* "View.MemoryView":979
17318  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
17319  *
17320  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
17321  * if self.to_object_func != NULL:
17322  * return self.to_object_func(itemp)
17323  */
17324 
17325  /* function exit code */
17326  __pyx_L1_error:;
17327  __Pyx_XDECREF(__pyx_t_2);
17328  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17329  __pyx_r = 0;
17330  __pyx_L0:;
17331  __Pyx_XGIVEREF(__pyx_r);
17332  __Pyx_RefNannyFinishContext();
17333  return __pyx_r;
17334 }
17335 
17336 /* "View.MemoryView":985
17337  * return memoryview.convert_item_to_object(self, itemp)
17338  *
17339  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
17340  * if self.to_dtype_func != NULL:
17341  * self.to_dtype_func(itemp, value)
17342  */
17343 
17344 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
17345  PyObject *__pyx_r = NULL;
17346  __Pyx_RefNannyDeclarations
17347  int __pyx_t_1;
17348  int __pyx_t_2;
17349  PyObject *__pyx_t_3 = NULL;
17350  int __pyx_lineno = 0;
17351  const char *__pyx_filename = NULL;
17352  int __pyx_clineno = 0;
17353  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
17354 
17355  /* "View.MemoryView":986
17356  *
17357  * cdef assign_item_from_object(self, char *itemp, object value):
17358  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
17359  * self.to_dtype_func(itemp, value)
17360  * else:
17361  */
17362  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
17363  if (__pyx_t_1) {
17364 
17365  /* "View.MemoryView":987
17366  * cdef assign_item_from_object(self, char *itemp, object value):
17367  * if self.to_dtype_func != NULL:
17368  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
17369  * else:
17370  * memoryview.assign_item_from_object(self, itemp, value)
17371  */
17372  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 987, __pyx_L1_error)
17373 
17374  /* "View.MemoryView":986
17375  *
17376  * cdef assign_item_from_object(self, char *itemp, object value):
17377  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
17378  * self.to_dtype_func(itemp, value)
17379  * else:
17380  */
17381  goto __pyx_L3;
17382  }
17383 
17384  /* "View.MemoryView":989
17385  * self.to_dtype_func(itemp, value)
17386  * else:
17387  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
17388  *
17389  * @property
17390  */
17391  /*else*/ {
17392  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 989, __pyx_L1_error)
17393  __Pyx_GOTREF(__pyx_t_3);
17394  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17395  }
17396  __pyx_L3:;
17397 
17398  /* "View.MemoryView":985
17399  * return memoryview.convert_item_to_object(self, itemp)
17400  *
17401  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
17402  * if self.to_dtype_func != NULL:
17403  * self.to_dtype_func(itemp, value)
17404  */
17405 
17406  /* function exit code */
17407  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17408  goto __pyx_L0;
17409  __pyx_L1_error:;
17410  __Pyx_XDECREF(__pyx_t_3);
17411  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17412  __pyx_r = 0;
17413  __pyx_L0:;
17414  __Pyx_XGIVEREF(__pyx_r);
17415  __Pyx_RefNannyFinishContext();
17416  return __pyx_r;
17417 }
17418 
17419 /* "View.MemoryView":992
17420  *
17421  * @property
17422  * def base(self): # <<<<<<<<<<<<<<
17423  * return self.from_object
17424  *
17425  */
17426 
17427 /* Python wrapper */
17428 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
17429 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
17430  PyObject *__pyx_r = 0;
17431  __Pyx_RefNannyDeclarations
17432  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
17433  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17434 
17435  /* function exit code */
17436  __Pyx_RefNannyFinishContext();
17437  return __pyx_r;
17438 }
17439 
17440 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17441  PyObject *__pyx_r = NULL;
17442  __Pyx_RefNannyDeclarations
17443  __Pyx_RefNannySetupContext("__get__", 0);
17444 
17445  /* "View.MemoryView":993
17446  * @property
17447  * def base(self):
17448  * return self.from_object # <<<<<<<<<<<<<<
17449  *
17450  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
17451  */
17452  __Pyx_XDECREF(__pyx_r);
17453  __Pyx_INCREF(__pyx_v_self->from_object);
17454  __pyx_r = __pyx_v_self->from_object;
17455  goto __pyx_L0;
17456 
17457  /* "View.MemoryView":992
17458  *
17459  * @property
17460  * def base(self): # <<<<<<<<<<<<<<
17461  * return self.from_object
17462  *
17463  */
17464 
17465  /* function exit code */
17466  __pyx_L0:;
17467  __Pyx_XGIVEREF(__pyx_r);
17468  __Pyx_RefNannyFinishContext();
17469  return __pyx_r;
17470 }
17471 
17472 /* "(tree fragment)":1
17473  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17474  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17475  * def __setstate_cython__(self, __pyx_state):
17476  */
17477 
17478 /* Python wrapper */
17479 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
17480 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17481  PyObject *__pyx_r = 0;
17482  __Pyx_RefNannyDeclarations
17483  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
17484  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17485 
17486  /* function exit code */
17487  __Pyx_RefNannyFinishContext();
17488  return __pyx_r;
17489 }
17490 
17491 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17492  PyObject *__pyx_r = NULL;
17493  __Pyx_RefNannyDeclarations
17494  PyObject *__pyx_t_1 = NULL;
17495  int __pyx_lineno = 0;
17496  const char *__pyx_filename = NULL;
17497  int __pyx_clineno = 0;
17498  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
17499 
17500  /* "(tree fragment)":2
17501  * def __reduce_cython__(self):
17502  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17503  * def __setstate_cython__(self, __pyx_state):
17504  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17505  */
17506  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
17507  __Pyx_GOTREF(__pyx_t_1);
17508  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17509  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17510  __PYX_ERR(1, 2, __pyx_L1_error)
17511 
17512  /* "(tree fragment)":1
17513  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17514  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17515  * def __setstate_cython__(self, __pyx_state):
17516  */
17517 
17518  /* function exit code */
17519  __pyx_L1_error:;
17520  __Pyx_XDECREF(__pyx_t_1);
17521  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17522  __pyx_r = NULL;
17523  __Pyx_XGIVEREF(__pyx_r);
17524  __Pyx_RefNannyFinishContext();
17525  return __pyx_r;
17526 }
17527 
17528 /* "(tree fragment)":3
17529  * def __reduce_cython__(self):
17530  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17531  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17532  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17533  */
17534 
17535 /* Python wrapper */
17536 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
17537 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17538  PyObject *__pyx_r = 0;
17539  __Pyx_RefNannyDeclarations
17540  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
17541  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17542 
17543  /* function exit code */
17544  __Pyx_RefNannyFinishContext();
17545  return __pyx_r;
17546 }
17547 
17548 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) {
17549  PyObject *__pyx_r = NULL;
17550  __Pyx_RefNannyDeclarations
17551  PyObject *__pyx_t_1 = NULL;
17552  int __pyx_lineno = 0;
17553  const char *__pyx_filename = NULL;
17554  int __pyx_clineno = 0;
17555  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
17556 
17557  /* "(tree fragment)":4
17558  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17559  * def __setstate_cython__(self, __pyx_state):
17560  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17561  */
17562  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
17563  __Pyx_GOTREF(__pyx_t_1);
17564  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17565  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17566  __PYX_ERR(1, 4, __pyx_L1_error)
17567 
17568  /* "(tree fragment)":3
17569  * def __reduce_cython__(self):
17570  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17571  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17572  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17573  */
17574 
17575  /* function exit code */
17576  __pyx_L1_error:;
17577  __Pyx_XDECREF(__pyx_t_1);
17578  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17579  __pyx_r = NULL;
17580  __Pyx_XGIVEREF(__pyx_r);
17581  __Pyx_RefNannyFinishContext();
17582  return __pyx_r;
17583 }
17584 
17585 /* "View.MemoryView":999
17586  *
17587  * @cname('__pyx_memoryview_fromslice')
17588  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
17589  * int ndim,
17590  * object (*to_object_func)(char *),
17591  */
17592 
17593 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) {
17594  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
17595  Py_ssize_t __pyx_v_suboffset;
17596  PyObject *__pyx_v_length = NULL;
17597  PyObject *__pyx_r = NULL;
17598  __Pyx_RefNannyDeclarations
17599  int __pyx_t_1;
17600  PyObject *__pyx_t_2 = NULL;
17601  PyObject *__pyx_t_3 = NULL;
17602  __Pyx_TypeInfo *__pyx_t_4;
17603  Py_buffer __pyx_t_5;
17604  Py_ssize_t *__pyx_t_6;
17605  Py_ssize_t *__pyx_t_7;
17606  Py_ssize_t *__pyx_t_8;
17607  Py_ssize_t __pyx_t_9;
17608  int __pyx_lineno = 0;
17609  const char *__pyx_filename = NULL;
17610  int __pyx_clineno = 0;
17611  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
17612 
17613  /* "View.MemoryView":1007
17614  * cdef _memoryviewslice result
17615  *
17616  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17617  * return None
17618  *
17619  */
17620  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
17621  if (__pyx_t_1) {
17622 
17623  /* "View.MemoryView":1008
17624  *
17625  * if <PyObject *> memviewslice.memview == Py_None:
17626  * return None # <<<<<<<<<<<<<<
17627  *
17628  *
17629  */
17630  __Pyx_XDECREF(__pyx_r);
17631  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17632  goto __pyx_L0;
17633 
17634  /* "View.MemoryView":1007
17635  * cdef _memoryviewslice result
17636  *
17637  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17638  * return None
17639  *
17640  */
17641  }
17642 
17643  /* "View.MemoryView":1013
17644  *
17645  *
17646  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
17647  *
17648  * result.from_slice = memviewslice
17649  */
17650  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
17651  __Pyx_GOTREF(__pyx_t_2);
17652  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
17653  __Pyx_GOTREF(__pyx_t_3);
17654  __Pyx_INCREF(Py_None);
17655  __Pyx_GIVEREF(Py_None);
17656  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17657  __Pyx_INCREF(__pyx_int_0);
17658  __Pyx_GIVEREF(__pyx_int_0);
17659  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17660  __Pyx_GIVEREF(__pyx_t_2);
17661  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17662  __pyx_t_2 = 0;
17663  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
17664  __Pyx_GOTREF(__pyx_t_2);
17665  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17666  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
17667  __pyx_t_2 = 0;
17668 
17669  /* "View.MemoryView":1015
17670  * result = _memoryviewslice(None, 0, dtype_is_object)
17671  *
17672  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
17673  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17674  *
17675  */
17676  __pyx_v_result->from_slice = __pyx_v_memviewslice;
17677 
17678  /* "View.MemoryView":1016
17679  *
17680  * result.from_slice = memviewslice
17681  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
17682  *
17683  * result.from_object = (<memoryview> memviewslice.memview).base
17684  */
17685  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
17686 
17687  /* "View.MemoryView":1018
17688  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17689  *
17690  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
17691  * result.typeinfo = memviewslice.memview.typeinfo
17692  *
17693  */
17694  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
17695  __Pyx_GOTREF(__pyx_t_2);
17696  __Pyx_GIVEREF(__pyx_t_2);
17697  __Pyx_GOTREF(__pyx_v_result->from_object);
17698  __Pyx_DECREF(__pyx_v_result->from_object);
17699  __pyx_v_result->from_object = __pyx_t_2;
17700  __pyx_t_2 = 0;
17701 
17702  /* "View.MemoryView":1019
17703  *
17704  * result.from_object = (<memoryview> memviewslice.memview).base
17705  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
17706  *
17707  * result.view = memviewslice.memview.view
17708  */
17709  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
17710  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
17711 
17712  /* "View.MemoryView":1021
17713  * result.typeinfo = memviewslice.memview.typeinfo
17714  *
17715  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
17716  * result.view.buf = <void *> memviewslice.data
17717  * result.view.ndim = ndim
17718  */
17719  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
17720  __pyx_v_result->__pyx_base.view = __pyx_t_5;
17721 
17722  /* "View.MemoryView":1022
17723  *
17724  * result.view = memviewslice.memview.view
17725  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
17726  * result.view.ndim = ndim
17727  * (<__pyx_buffer *> &result.view).obj = Py_None
17728  */
17729  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
17730 
17731  /* "View.MemoryView":1023
17732  * result.view = memviewslice.memview.view
17733  * result.view.buf = <void *> memviewslice.data
17734  * result.view.ndim = ndim # <<<<<<<<<<<<<<
17735  * (<__pyx_buffer *> &result.view).obj = Py_None
17736  * Py_INCREF(Py_None)
17737  */
17738  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
17739 
17740  /* "View.MemoryView":1024
17741  * result.view.buf = <void *> memviewslice.data
17742  * result.view.ndim = ndim
17743  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
17744  * Py_INCREF(Py_None)
17745  *
17746  */
17747  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
17748 
17749  /* "View.MemoryView":1025
17750  * result.view.ndim = ndim
17751  * (<__pyx_buffer *> &result.view).obj = Py_None
17752  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
17753  *
17754  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17755  */
17756  Py_INCREF(Py_None);
17757 
17758  /* "View.MemoryView":1027
17759  * Py_INCREF(Py_None)
17760  *
17761  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17762  * result.flags = PyBUF_RECORDS
17763  * else:
17764  */
17765  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
17766  if (__pyx_t_1) {
17767 
17768  /* "View.MemoryView":1028
17769  *
17770  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17771  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
17772  * else:
17773  * result.flags = PyBUF_RECORDS_RO
17774  */
17775  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
17776 
17777  /* "View.MemoryView":1027
17778  * Py_INCREF(Py_None)
17779  *
17780  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17781  * result.flags = PyBUF_RECORDS
17782  * else:
17783  */
17784  goto __pyx_L4;
17785  }
17786 
17787  /* "View.MemoryView":1030
17788  * result.flags = PyBUF_RECORDS
17789  * else:
17790  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
17791  *
17792  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17793  */
17794  /*else*/ {
17795  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
17796  }
17797  __pyx_L4:;
17798 
17799  /* "View.MemoryView":1032
17800  * result.flags = PyBUF_RECORDS_RO
17801  *
17802  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
17803  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
17804  *
17805  */
17806  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
17807 
17808  /* "View.MemoryView":1033
17809  *
17810  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17811  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
17812  *
17813  *
17814  */
17815  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
17816 
17817  /* "View.MemoryView":1036
17818  *
17819  *
17820  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
17821  * for suboffset in result.from_slice.suboffsets[:ndim]:
17822  * if suboffset >= 0:
17823  */
17824  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
17825 
17826  /* "View.MemoryView":1037
17827  *
17828  * result.view.suboffsets = NULL
17829  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
17830  * if suboffset >= 0:
17831  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17832  */
17833  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
17834  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17835  __pyx_t_6 = __pyx_t_8;
17836  __pyx_v_suboffset = (__pyx_t_6[0]);
17837 
17838  /* "View.MemoryView":1038
17839  * result.view.suboffsets = NULL
17840  * for suboffset in result.from_slice.suboffsets[:ndim]:
17841  * if suboffset >= 0: # <<<<<<<<<<<<<<
17842  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17843  * break
17844  */
17845  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
17846  if (__pyx_t_1) {
17847 
17848  /* "View.MemoryView":1039
17849  * for suboffset in result.from_slice.suboffsets[:ndim]:
17850  * if suboffset >= 0:
17851  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
17852  * break
17853  *
17854  */
17855  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
17856 
17857  /* "View.MemoryView":1040
17858  * if suboffset >= 0:
17859  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17860  * break # <<<<<<<<<<<<<<
17861  *
17862  * result.view.len = result.view.itemsize
17863  */
17864  goto __pyx_L6_break;
17865 
17866  /* "View.MemoryView":1038
17867  * result.view.suboffsets = NULL
17868  * for suboffset in result.from_slice.suboffsets[:ndim]:
17869  * if suboffset >= 0: # <<<<<<<<<<<<<<
17870  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17871  * break
17872  */
17873  }
17874  }
17875  __pyx_L6_break:;
17876 
17877  /* "View.MemoryView":1042
17878  * break
17879  *
17880  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
17881  * for length in result.view.shape[:ndim]:
17882  * result.view.len *= length
17883  */
17884  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
17885  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17886 
17887  /* "View.MemoryView":1043
17888  *
17889  * result.view.len = result.view.itemsize
17890  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
17891  * result.view.len *= length
17892  *
17893  */
17894  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
17895  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17896  __pyx_t_6 = __pyx_t_8;
17897  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
17898  __Pyx_GOTREF(__pyx_t_2);
17899  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
17900  __pyx_t_2 = 0;
17901 
17902  /* "View.MemoryView":1044
17903  * result.view.len = result.view.itemsize
17904  * for length in result.view.shape[:ndim]:
17905  * result.view.len *= length # <<<<<<<<<<<<<<
17906  *
17907  * result.to_object_func = to_object_func
17908  */
17909  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
17910  __Pyx_GOTREF(__pyx_t_2);
17911  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
17912  __Pyx_GOTREF(__pyx_t_3);
17913  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17914  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
17915  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17916  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17917  }
17918 
17919  /* "View.MemoryView":1046
17920  * result.view.len *= length
17921  *
17922  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
17923  * result.to_dtype_func = to_dtype_func
17924  *
17925  */
17926  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
17927 
17928  /* "View.MemoryView":1047
17929  *
17930  * result.to_object_func = to_object_func
17931  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
17932  *
17933  * return result
17934  */
17935  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
17936 
17937  /* "View.MemoryView":1049
17938  * result.to_dtype_func = to_dtype_func
17939  *
17940  * return result # <<<<<<<<<<<<<<
17941  *
17942  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17943  */
17944  __Pyx_XDECREF(__pyx_r);
17945  __Pyx_INCREF(((PyObject *)__pyx_v_result));
17946  __pyx_r = ((PyObject *)__pyx_v_result);
17947  goto __pyx_L0;
17948 
17949  /* "View.MemoryView":999
17950  *
17951  * @cname('__pyx_memoryview_fromslice')
17952  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
17953  * int ndim,
17954  * object (*to_object_func)(char *),
17955  */
17956 
17957  /* function exit code */
17958  __pyx_L1_error:;
17959  __Pyx_XDECREF(__pyx_t_2);
17960  __Pyx_XDECREF(__pyx_t_3);
17961  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17962  __pyx_r = 0;
17963  __pyx_L0:;
17964  __Pyx_XDECREF((PyObject *)__pyx_v_result);
17965  __Pyx_XDECREF(__pyx_v_length);
17966  __Pyx_XGIVEREF(__pyx_r);
17967  __Pyx_RefNannyFinishContext();
17968  return __pyx_r;
17969 }
17970 
17971 /* "View.MemoryView":1052
17972  *
17973  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17974  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
17975  * __Pyx_memviewslice *mslice) except NULL:
17976  * cdef _memoryviewslice obj
17977  */
17978 
17979 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
17980  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
17981  __Pyx_memviewslice *__pyx_r;
17982  __Pyx_RefNannyDeclarations
17983  int __pyx_t_1;
17984  int __pyx_t_2;
17985  PyObject *__pyx_t_3 = NULL;
17986  int __pyx_lineno = 0;
17987  const char *__pyx_filename = NULL;
17988  int __pyx_clineno = 0;
17989  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
17990 
17991  /* "View.MemoryView":1055
17992  * __Pyx_memviewslice *mslice) except NULL:
17993  * cdef _memoryviewslice obj
17994  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17995  * obj = memview
17996  * return &obj.from_slice
17997  */
17998  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17999  __pyx_t_2 = (__pyx_t_1 != 0);
18000  if (__pyx_t_2) {
18001 
18002  /* "View.MemoryView":1056
18003  * cdef _memoryviewslice obj
18004  * if isinstance(memview, _memoryviewslice):
18005  * obj = memview # <<<<<<<<<<<<<<
18006  * return &obj.from_slice
18007  * else:
18008  */
18009  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
18010  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
18011  __Pyx_INCREF(__pyx_t_3);
18012  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
18013  __pyx_t_3 = 0;
18014 
18015  /* "View.MemoryView":1057
18016  * if isinstance(memview, _memoryviewslice):
18017  * obj = memview
18018  * return &obj.from_slice # <<<<<<<<<<<<<<
18019  * else:
18020  * slice_copy(memview, mslice)
18021  */
18022  __pyx_r = (&__pyx_v_obj->from_slice);
18023  goto __pyx_L0;
18024 
18025  /* "View.MemoryView":1055
18026  * __Pyx_memviewslice *mslice) except NULL:
18027  * cdef _memoryviewslice obj
18028  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18029  * obj = memview
18030  * return &obj.from_slice
18031  */
18032  }
18033 
18034  /* "View.MemoryView":1059
18035  * return &obj.from_slice
18036  * else:
18037  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
18038  * return mslice
18039  *
18040  */
18041  /*else*/ {
18042  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
18043 
18044  /* "View.MemoryView":1060
18045  * else:
18046  * slice_copy(memview, mslice)
18047  * return mslice # <<<<<<<<<<<<<<
18048  *
18049  * @cname('__pyx_memoryview_slice_copy')
18050  */
18051  __pyx_r = __pyx_v_mslice;
18052  goto __pyx_L0;
18053  }
18054 
18055  /* "View.MemoryView":1052
18056  *
18057  * @cname('__pyx_memoryview_get_slice_from_memoryview')
18058  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
18059  * __Pyx_memviewslice *mslice) except NULL:
18060  * cdef _memoryviewslice obj
18061  */
18062 
18063  /* function exit code */
18064  __pyx_L1_error:;
18065  __Pyx_XDECREF(__pyx_t_3);
18066  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
18067  __pyx_r = NULL;
18068  __pyx_L0:;
18069  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
18070  __Pyx_RefNannyFinishContext();
18071  return __pyx_r;
18072 }
18073 
18074 /* "View.MemoryView":1063
18075  *
18076  * @cname('__pyx_memoryview_slice_copy')
18077  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18078  * cdef int dim
18079  * cdef (Py_ssize_t*) shape, strides, suboffsets
18080  */
18081 
18082 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
18083  int __pyx_v_dim;
18084  Py_ssize_t *__pyx_v_shape;
18085  Py_ssize_t *__pyx_v_strides;
18086  Py_ssize_t *__pyx_v_suboffsets;
18087  __Pyx_RefNannyDeclarations
18088  Py_ssize_t *__pyx_t_1;
18089  int __pyx_t_2;
18090  int __pyx_t_3;
18091  int __pyx_t_4;
18092  Py_ssize_t __pyx_t_5;
18093  __Pyx_RefNannySetupContext("slice_copy", 0);
18094 
18095  /* "View.MemoryView":1067
18096  * cdef (Py_ssize_t*) shape, strides, suboffsets
18097  *
18098  * shape = memview.view.shape # <<<<<<<<<<<<<<
18099  * strides = memview.view.strides
18100  * suboffsets = memview.view.suboffsets
18101  */
18102  __pyx_t_1 = __pyx_v_memview->view.shape;
18103  __pyx_v_shape = __pyx_t_1;
18104 
18105  /* "View.MemoryView":1068
18106  *
18107  * shape = memview.view.shape
18108  * strides = memview.view.strides # <<<<<<<<<<<<<<
18109  * suboffsets = memview.view.suboffsets
18110  *
18111  */
18112  __pyx_t_1 = __pyx_v_memview->view.strides;
18113  __pyx_v_strides = __pyx_t_1;
18114 
18115  /* "View.MemoryView":1069
18116  * shape = memview.view.shape
18117  * strides = memview.view.strides
18118  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
18119  *
18120  * dst.memview = <__pyx_memoryview *> memview
18121  */
18122  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
18123  __pyx_v_suboffsets = __pyx_t_1;
18124 
18125  /* "View.MemoryView":1071
18126  * suboffsets = memview.view.suboffsets
18127  *
18128  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
18129  * dst.data = <char *> memview.view.buf
18130  *
18131  */
18132  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
18133 
18134  /* "View.MemoryView":1072
18135  *
18136  * dst.memview = <__pyx_memoryview *> memview
18137  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
18138  *
18139  * for dim in range(memview.view.ndim):
18140  */
18141  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
18142 
18143  /* "View.MemoryView":1074
18144  * dst.data = <char *> memview.view.buf
18145  *
18146  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
18147  * dst.shape[dim] = shape[dim]
18148  * dst.strides[dim] = strides[dim]
18149  */
18150  __pyx_t_2 = __pyx_v_memview->view.ndim;
18151  __pyx_t_3 = __pyx_t_2;
18152  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18153  __pyx_v_dim = __pyx_t_4;
18154 
18155  /* "View.MemoryView":1075
18156  *
18157  * for dim in range(memview.view.ndim):
18158  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
18159  * dst.strides[dim] = strides[dim]
18160  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
18161  */
18162  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
18163 
18164  /* "View.MemoryView":1076
18165  * for dim in range(memview.view.ndim):
18166  * dst.shape[dim] = shape[dim]
18167  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
18168  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
18169  *
18170  */
18171  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
18172 
18173  /* "View.MemoryView":1077
18174  * dst.shape[dim] = shape[dim]
18175  * dst.strides[dim] = strides[dim]
18176  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
18177  *
18178  * @cname('__pyx_memoryview_copy_object')
18179  */
18180  if ((__pyx_v_suboffsets != 0)) {
18181  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
18182  } else {
18183  __pyx_t_5 = -1L;
18184  }
18185  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
18186  }
18187 
18188  /* "View.MemoryView":1063
18189  *
18190  * @cname('__pyx_memoryview_slice_copy')
18191  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
18192  * cdef int dim
18193  * cdef (Py_ssize_t*) shape, strides, suboffsets
18194  */
18195 
18196  /* function exit code */
18197  __Pyx_RefNannyFinishContext();
18198 }
18199 
18200 /* "View.MemoryView":1080
18201  *
18202  * @cname('__pyx_memoryview_copy_object')
18203  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18204  * "Create a new memoryview object"
18205  * cdef __Pyx_memviewslice memviewslice
18206  */
18207 
18208 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
18209  __Pyx_memviewslice __pyx_v_memviewslice;
18210  PyObject *__pyx_r = NULL;
18211  __Pyx_RefNannyDeclarations
18212  PyObject *__pyx_t_1 = NULL;
18213  int __pyx_lineno = 0;
18214  const char *__pyx_filename = NULL;
18215  int __pyx_clineno = 0;
18216  __Pyx_RefNannySetupContext("memoryview_copy", 0);
18217 
18218  /* "View.MemoryView":1083
18219  * "Create a new memoryview object"
18220  * cdef __Pyx_memviewslice memviewslice
18221  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
18222  * return memoryview_copy_from_slice(memview, &memviewslice)
18223  *
18224  */
18225  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
18226 
18227  /* "View.MemoryView":1084
18228  * cdef __Pyx_memviewslice memviewslice
18229  * slice_copy(memview, &memviewslice)
18230  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
18231  *
18232  * @cname('__pyx_memoryview_copy_object_from_slice')
18233  */
18234  __Pyx_XDECREF(__pyx_r);
18235  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
18236  __Pyx_GOTREF(__pyx_t_1);
18237  __pyx_r = __pyx_t_1;
18238  __pyx_t_1 = 0;
18239  goto __pyx_L0;
18240 
18241  /* "View.MemoryView":1080
18242  *
18243  * @cname('__pyx_memoryview_copy_object')
18244  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
18245  * "Create a new memoryview object"
18246  * cdef __Pyx_memviewslice memviewslice
18247  */
18248 
18249  /* function exit code */
18250  __pyx_L1_error:;
18251  __Pyx_XDECREF(__pyx_t_1);
18252  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
18253  __pyx_r = 0;
18254  __pyx_L0:;
18255  __Pyx_XGIVEREF(__pyx_r);
18256  __Pyx_RefNannyFinishContext();
18257  return __pyx_r;
18258 }
18259 
18260 /* "View.MemoryView":1087
18261  *
18262  * @cname('__pyx_memoryview_copy_object_from_slice')
18263  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18264  * """
18265  * Create a new memoryview object from a given memoryview object and slice.
18266  */
18267 
18268 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
18269  PyObject *(*__pyx_v_to_object_func)(char *);
18270  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
18271  PyObject *__pyx_r = NULL;
18272  __Pyx_RefNannyDeclarations
18273  int __pyx_t_1;
18274  int __pyx_t_2;
18275  PyObject *(*__pyx_t_3)(char *);
18276  int (*__pyx_t_4)(char *, PyObject *);
18277  PyObject *__pyx_t_5 = NULL;
18278  int __pyx_lineno = 0;
18279  const char *__pyx_filename = NULL;
18280  int __pyx_clineno = 0;
18281  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
18282 
18283  /* "View.MemoryView":1094
18284  * cdef int (*to_dtype_func)(char *, object) except 0
18285  *
18286  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18287  * to_object_func = (<_memoryviewslice> memview).to_object_func
18288  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18289  */
18290  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18291  __pyx_t_2 = (__pyx_t_1 != 0);
18292  if (__pyx_t_2) {
18293 
18294  /* "View.MemoryView":1095
18295  *
18296  * if isinstance(memview, _memoryviewslice):
18297  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
18298  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18299  * else:
18300  */
18301  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
18302  __pyx_v_to_object_func = __pyx_t_3;
18303 
18304  /* "View.MemoryView":1096
18305  * if isinstance(memview, _memoryviewslice):
18306  * to_object_func = (<_memoryviewslice> memview).to_object_func
18307  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
18308  * else:
18309  * to_object_func = NULL
18310  */
18311  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
18312  __pyx_v_to_dtype_func = __pyx_t_4;
18313 
18314  /* "View.MemoryView":1094
18315  * cdef int (*to_dtype_func)(char *, object) except 0
18316  *
18317  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18318  * to_object_func = (<_memoryviewslice> memview).to_object_func
18319  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18320  */
18321  goto __pyx_L3;
18322  }
18323 
18324  /* "View.MemoryView":1098
18325  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
18326  * else:
18327  * to_object_func = NULL # <<<<<<<<<<<<<<
18328  * to_dtype_func = NULL
18329  *
18330  */
18331  /*else*/ {
18332  __pyx_v_to_object_func = NULL;
18333 
18334  /* "View.MemoryView":1099
18335  * else:
18336  * to_object_func = NULL
18337  * to_dtype_func = NULL # <<<<<<<<<<<<<<
18338  *
18339  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18340  */
18341  __pyx_v_to_dtype_func = NULL;
18342  }
18343  __pyx_L3:;
18344 
18345  /* "View.MemoryView":1101
18346  * to_dtype_func = NULL
18347  *
18348  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
18349  * to_object_func, to_dtype_func,
18350  * memview.dtype_is_object)
18351  */
18352  __Pyx_XDECREF(__pyx_r);
18353 
18354  /* "View.MemoryView":1103
18355  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
18356  * to_object_func, to_dtype_func,
18357  * memview.dtype_is_object) # <<<<<<<<<<<<<<
18358  *
18359  *
18360  */
18361  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1101, __pyx_L1_error)
18362  __Pyx_GOTREF(__pyx_t_5);
18363  __pyx_r = __pyx_t_5;
18364  __pyx_t_5 = 0;
18365  goto __pyx_L0;
18366 
18367  /* "View.MemoryView":1087
18368  *
18369  * @cname('__pyx_memoryview_copy_object_from_slice')
18370  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
18371  * """
18372  * Create a new memoryview object from a given memoryview object and slice.
18373  */
18374 
18375  /* function exit code */
18376  __pyx_L1_error:;
18377  __Pyx_XDECREF(__pyx_t_5);
18378  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18379  __pyx_r = 0;
18380  __pyx_L0:;
18381  __Pyx_XGIVEREF(__pyx_r);
18382  __Pyx_RefNannyFinishContext();
18383  return __pyx_r;
18384 }
18385 
18386 /* "View.MemoryView":1109
18387  *
18388  *
18389  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18390  * if arg < 0:
18391  * return -arg
18392  */
18393 
18394 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
18395  Py_ssize_t __pyx_r;
18396  int __pyx_t_1;
18397 
18398  /* "View.MemoryView":1110
18399  *
18400  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18401  * if arg < 0: # <<<<<<<<<<<<<<
18402  * return -arg
18403  * else:
18404  */
18405  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
18406  if (__pyx_t_1) {
18407 
18408  /* "View.MemoryView":1111
18409  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18410  * if arg < 0:
18411  * return -arg # <<<<<<<<<<<<<<
18412  * else:
18413  * return arg
18414  */
18415  __pyx_r = (-__pyx_v_arg);
18416  goto __pyx_L0;
18417 
18418  /* "View.MemoryView":1110
18419  *
18420  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
18421  * if arg < 0: # <<<<<<<<<<<<<<
18422  * return -arg
18423  * else:
18424  */
18425  }
18426 
18427  /* "View.MemoryView":1113
18428  * return -arg
18429  * else:
18430  * return arg # <<<<<<<<<<<<<<
18431  *
18432  * @cname('__pyx_get_best_slice_order')
18433  */
18434  /*else*/ {
18435  __pyx_r = __pyx_v_arg;
18436  goto __pyx_L0;
18437  }
18438 
18439  /* "View.MemoryView":1109
18440  *
18441  *
18442  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
18443  * if arg < 0:
18444  * return -arg
18445  */
18446 
18447  /* function exit code */
18448  __pyx_L0:;
18449  return __pyx_r;
18450 }
18451 
18452 /* "View.MemoryView":1116
18453  *
18454  * @cname('__pyx_get_best_slice_order')
18455  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18456  * """
18457  * Figure out the best memory access order for a given slice.
18458  */
18459 
18460 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
18461  int __pyx_v_i;
18462  Py_ssize_t __pyx_v_c_stride;
18463  Py_ssize_t __pyx_v_f_stride;
18464  char __pyx_r;
18465  int __pyx_t_1;
18466  int __pyx_t_2;
18467  int __pyx_t_3;
18468  int __pyx_t_4;
18469 
18470  /* "View.MemoryView":1121
18471  * """
18472  * cdef int i
18473  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
18474  * cdef Py_ssize_t f_stride = 0
18475  *
18476  */
18477  __pyx_v_c_stride = 0;
18478 
18479  /* "View.MemoryView":1122
18480  * cdef int i
18481  * cdef Py_ssize_t c_stride = 0
18482  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
18483  *
18484  * for i in range(ndim - 1, -1, -1):
18485  */
18486  __pyx_v_f_stride = 0;
18487 
18488  /* "View.MemoryView":1124
18489  * cdef Py_ssize_t f_stride = 0
18490  *
18491  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18492  * if mslice.shape[i] > 1:
18493  * c_stride = mslice.strides[i]
18494  */
18495  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18496  __pyx_v_i = __pyx_t_1;
18497 
18498  /* "View.MemoryView":1125
18499  *
18500  * for i in range(ndim - 1, -1, -1):
18501  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18502  * c_stride = mslice.strides[i]
18503  * break
18504  */
18505  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18506  if (__pyx_t_2) {
18507 
18508  /* "View.MemoryView":1126
18509  * for i in range(ndim - 1, -1, -1):
18510  * if mslice.shape[i] > 1:
18511  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18512  * break
18513  *
18514  */
18515  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18516 
18517  /* "View.MemoryView":1127
18518  * if mslice.shape[i] > 1:
18519  * c_stride = mslice.strides[i]
18520  * break # <<<<<<<<<<<<<<
18521  *
18522  * for i in range(ndim):
18523  */
18524  goto __pyx_L4_break;
18525 
18526  /* "View.MemoryView":1125
18527  *
18528  * for i in range(ndim - 1, -1, -1):
18529  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18530  * c_stride = mslice.strides[i]
18531  * break
18532  */
18533  }
18534  }
18535  __pyx_L4_break:;
18536 
18537  /* "View.MemoryView":1129
18538  * break
18539  *
18540  * for i in range(ndim): # <<<<<<<<<<<<<<
18541  * if mslice.shape[i] > 1:
18542  * f_stride = mslice.strides[i]
18543  */
18544  __pyx_t_1 = __pyx_v_ndim;
18545  __pyx_t_3 = __pyx_t_1;
18546  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18547  __pyx_v_i = __pyx_t_4;
18548 
18549  /* "View.MemoryView":1130
18550  *
18551  * for i in range(ndim):
18552  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18553  * f_stride = mslice.strides[i]
18554  * break
18555  */
18556  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18557  if (__pyx_t_2) {
18558 
18559  /* "View.MemoryView":1131
18560  * for i in range(ndim):
18561  * if mslice.shape[i] > 1:
18562  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18563  * break
18564  *
18565  */
18566  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18567 
18568  /* "View.MemoryView":1132
18569  * if mslice.shape[i] > 1:
18570  * f_stride = mslice.strides[i]
18571  * break # <<<<<<<<<<<<<<
18572  *
18573  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18574  */
18575  goto __pyx_L7_break;
18576 
18577  /* "View.MemoryView":1130
18578  *
18579  * for i in range(ndim):
18580  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18581  * f_stride = mslice.strides[i]
18582  * break
18583  */
18584  }
18585  }
18586  __pyx_L7_break:;
18587 
18588  /* "View.MemoryView":1134
18589  * break
18590  *
18591  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18592  * return 'C'
18593  * else:
18594  */
18595  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
18596  if (__pyx_t_2) {
18597 
18598  /* "View.MemoryView":1135
18599  *
18600  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18601  * return 'C' # <<<<<<<<<<<<<<
18602  * else:
18603  * return 'F'
18604  */
18605  __pyx_r = 'C';
18606  goto __pyx_L0;
18607 
18608  /* "View.MemoryView":1134
18609  * break
18610  *
18611  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18612  * return 'C'
18613  * else:
18614  */
18615  }
18616 
18617  /* "View.MemoryView":1137
18618  * return 'C'
18619  * else:
18620  * return 'F' # <<<<<<<<<<<<<<
18621  *
18622  * @cython.cdivision(True)
18623  */
18624  /*else*/ {
18625  __pyx_r = 'F';
18626  goto __pyx_L0;
18627  }
18628 
18629  /* "View.MemoryView":1116
18630  *
18631  * @cname('__pyx_get_best_slice_order')
18632  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18633  * """
18634  * Figure out the best memory access order for a given slice.
18635  */
18636 
18637  /* function exit code */
18638  __pyx_L0:;
18639  return __pyx_r;
18640 }
18641 
18642 /* "View.MemoryView":1140
18643  *
18644  * @cython.cdivision(True)
18645  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18646  * char *dst_data, Py_ssize_t *dst_strides,
18647  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18648  */
18649 
18650 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) {
18651  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18652  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
18653  Py_ssize_t __pyx_v_dst_extent;
18654  Py_ssize_t __pyx_v_src_stride;
18655  Py_ssize_t __pyx_v_dst_stride;
18656  int __pyx_t_1;
18657  int __pyx_t_2;
18658  int __pyx_t_3;
18659  Py_ssize_t __pyx_t_4;
18660  Py_ssize_t __pyx_t_5;
18661  Py_ssize_t __pyx_t_6;
18662 
18663  /* "View.MemoryView":1147
18664  *
18665  * cdef Py_ssize_t i
18666  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
18667  * cdef Py_ssize_t dst_extent = dst_shape[0]
18668  * cdef Py_ssize_t src_stride = src_strides[0]
18669  */
18670  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
18671 
18672  /* "View.MemoryView":1148
18673  * cdef Py_ssize_t i
18674  * cdef Py_ssize_t src_extent = src_shape[0]
18675  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
18676  * cdef Py_ssize_t src_stride = src_strides[0]
18677  * cdef Py_ssize_t dst_stride = dst_strides[0]
18678  */
18679  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
18680 
18681  /* "View.MemoryView":1149
18682  * cdef Py_ssize_t src_extent = src_shape[0]
18683  * cdef Py_ssize_t dst_extent = dst_shape[0]
18684  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
18685  * cdef Py_ssize_t dst_stride = dst_strides[0]
18686  *
18687  */
18688  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
18689 
18690  /* "View.MemoryView":1150
18691  * cdef Py_ssize_t dst_extent = dst_shape[0]
18692  * cdef Py_ssize_t src_stride = src_strides[0]
18693  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
18694  *
18695  * if ndim == 1:
18696  */
18697  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
18698 
18699  /* "View.MemoryView":1152
18700  * cdef Py_ssize_t dst_stride = dst_strides[0]
18701  *
18702  * if ndim == 1: # <<<<<<<<<<<<<<
18703  * if (src_stride > 0 and dst_stride > 0 and
18704  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18705  */
18706  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18707  if (__pyx_t_1) {
18708 
18709  /* "View.MemoryView":1153
18710  *
18711  * if ndim == 1:
18712  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18713  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18714  * memcpy(dst_data, src_data, itemsize * dst_extent)
18715  */
18716  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
18717  if (__pyx_t_2) {
18718  } else {
18719  __pyx_t_1 = __pyx_t_2;
18720  goto __pyx_L5_bool_binop_done;
18721  }
18722  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
18723  if (__pyx_t_2) {
18724  } else {
18725  __pyx_t_1 = __pyx_t_2;
18726  goto __pyx_L5_bool_binop_done;
18727  }
18728 
18729  /* "View.MemoryView":1154
18730  * if ndim == 1:
18731  * if (src_stride > 0 and dst_stride > 0 and
18732  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
18733  * memcpy(dst_data, src_data, itemsize * dst_extent)
18734  * else:
18735  */
18736  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
18737  if (__pyx_t_2) {
18738  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
18739  }
18740  __pyx_t_3 = (__pyx_t_2 != 0);
18741  __pyx_t_1 = __pyx_t_3;
18742  __pyx_L5_bool_binop_done:;
18743 
18744  /* "View.MemoryView":1153
18745  *
18746  * if ndim == 1:
18747  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18748  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18749  * memcpy(dst_data, src_data, itemsize * dst_extent)
18750  */
18751  if (__pyx_t_1) {
18752 
18753  /* "View.MemoryView":1155
18754  * if (src_stride > 0 and dst_stride > 0 and
18755  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18756  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
18757  * else:
18758  * for i in range(dst_extent):
18759  */
18760  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
18761 
18762  /* "View.MemoryView":1153
18763  *
18764  * if ndim == 1:
18765  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18766  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18767  * memcpy(dst_data, src_data, itemsize * dst_extent)
18768  */
18769  goto __pyx_L4;
18770  }
18771 
18772  /* "View.MemoryView":1157
18773  * memcpy(dst_data, src_data, itemsize * dst_extent)
18774  * else:
18775  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18776  * memcpy(dst_data, src_data, itemsize)
18777  * src_data += src_stride
18778  */
18779  /*else*/ {
18780  __pyx_t_4 = __pyx_v_dst_extent;
18781  __pyx_t_5 = __pyx_t_4;
18782  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18783  __pyx_v_i = __pyx_t_6;
18784 
18785  /* "View.MemoryView":1158
18786  * else:
18787  * for i in range(dst_extent):
18788  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
18789  * src_data += src_stride
18790  * dst_data += dst_stride
18791  */
18792  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
18793 
18794  /* "View.MemoryView":1159
18795  * for i in range(dst_extent):
18796  * memcpy(dst_data, src_data, itemsize)
18797  * src_data += src_stride # <<<<<<<<<<<<<<
18798  * dst_data += dst_stride
18799  * else:
18800  */
18801  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18802 
18803  /* "View.MemoryView":1160
18804  * memcpy(dst_data, src_data, itemsize)
18805  * src_data += src_stride
18806  * dst_data += dst_stride # <<<<<<<<<<<<<<
18807  * else:
18808  * for i in range(dst_extent):
18809  */
18810  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18811  }
18812  }
18813  __pyx_L4:;
18814 
18815  /* "View.MemoryView":1152
18816  * cdef Py_ssize_t dst_stride = dst_strides[0]
18817  *
18818  * if ndim == 1: # <<<<<<<<<<<<<<
18819  * if (src_stride > 0 and dst_stride > 0 and
18820  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18821  */
18822  goto __pyx_L3;
18823  }
18824 
18825  /* "View.MemoryView":1162
18826  * dst_data += dst_stride
18827  * else:
18828  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18829  * _copy_strided_to_strided(src_data, src_strides + 1,
18830  * dst_data, dst_strides + 1,
18831  */
18832  /*else*/ {
18833  __pyx_t_4 = __pyx_v_dst_extent;
18834  __pyx_t_5 = __pyx_t_4;
18835  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18836  __pyx_v_i = __pyx_t_6;
18837 
18838  /* "View.MemoryView":1163
18839  * else:
18840  * for i in range(dst_extent):
18841  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
18842  * dst_data, dst_strides + 1,
18843  * src_shape + 1, dst_shape + 1,
18844  */
18845  _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);
18846 
18847  /* "View.MemoryView":1167
18848  * src_shape + 1, dst_shape + 1,
18849  * ndim - 1, itemsize)
18850  * src_data += src_stride # <<<<<<<<<<<<<<
18851  * dst_data += dst_stride
18852  *
18853  */
18854  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18855 
18856  /* "View.MemoryView":1168
18857  * ndim - 1, itemsize)
18858  * src_data += src_stride
18859  * dst_data += dst_stride # <<<<<<<<<<<<<<
18860  *
18861  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
18862  */
18863  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18864  }
18865  }
18866  __pyx_L3:;
18867 
18868  /* "View.MemoryView":1140
18869  *
18870  * @cython.cdivision(True)
18871  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18872  * char *dst_data, Py_ssize_t *dst_strides,
18873  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18874  */
18875 
18876  /* function exit code */
18877 }
18878 
18879 /* "View.MemoryView":1170
18880  * dst_data += dst_stride
18881  *
18882  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18883  * __Pyx_memviewslice *dst,
18884  * int ndim, size_t itemsize) nogil:
18885  */
18886 
18887 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) {
18888 
18889  /* "View.MemoryView":1173
18890  * __Pyx_memviewslice *dst,
18891  * int ndim, size_t itemsize) nogil:
18892  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
18893  * src.shape, dst.shape, ndim, itemsize)
18894  *
18895  */
18896  _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);
18897 
18898  /* "View.MemoryView":1170
18899  * dst_data += dst_stride
18900  *
18901  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18902  * __Pyx_memviewslice *dst,
18903  * int ndim, size_t itemsize) nogil:
18904  */
18905 
18906  /* function exit code */
18907 }
18908 
18909 /* "View.MemoryView":1177
18910  *
18911  * @cname('__pyx_memoryview_slice_get_size')
18912  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
18913  * "Return the size of the memory occupied by the slice in number of bytes"
18914  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18915  */
18916 
18917 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
18918  Py_ssize_t __pyx_v_shape;
18919  Py_ssize_t __pyx_v_size;
18920  Py_ssize_t __pyx_r;
18921  Py_ssize_t __pyx_t_1;
18922  Py_ssize_t *__pyx_t_2;
18923  Py_ssize_t *__pyx_t_3;
18924  Py_ssize_t *__pyx_t_4;
18925 
18926  /* "View.MemoryView":1179
18927  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
18928  * "Return the size of the memory occupied by the slice in number of bytes"
18929  * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
18930  *
18931  * for shape in src.shape[:ndim]:
18932  */
18933  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18934  __pyx_v_size = __pyx_t_1;
18935 
18936  /* "View.MemoryView":1181
18937  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18938  *
18939  * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
18940  * size *= shape
18941  *
18942  */
18943  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
18944  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
18945  __pyx_t_2 = __pyx_t_4;
18946  __pyx_v_shape = (__pyx_t_2[0]);
18947 
18948  /* "View.MemoryView":1182
18949  *
18950  * for shape in src.shape[:ndim]:
18951  * size *= shape # <<<<<<<<<<<<<<
18952  *
18953  * return size
18954  */
18955  __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
18956  }
18957 
18958  /* "View.MemoryView":1184
18959  * size *= shape
18960  *
18961  * return size # <<<<<<<<<<<<<<
18962  *
18963  * @cname('__pyx_fill_contig_strides_array')
18964  */
18965  __pyx_r = __pyx_v_size;
18966  goto __pyx_L0;
18967 
18968  /* "View.MemoryView":1177
18969  *
18970  * @cname('__pyx_memoryview_slice_get_size')
18971  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
18972  * "Return the size of the memory occupied by the slice in number of bytes"
18973  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18974  */
18975 
18976  /* function exit code */
18977  __pyx_L0:;
18978  return __pyx_r;
18979 }
18980 
18981 /* "View.MemoryView":1187
18982  *
18983  * @cname('__pyx_fill_contig_strides_array')
18984  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
18985  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
18986  * int ndim, char order) nogil:
18987  */
18988 
18989 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) {
18990  int __pyx_v_idx;
18991  Py_ssize_t __pyx_r;
18992  int __pyx_t_1;
18993  int __pyx_t_2;
18994  int __pyx_t_3;
18995  int __pyx_t_4;
18996 
18997  /* "View.MemoryView":1196
18998  * cdef int idx
18999  *
19000  * if order == 'F': # <<<<<<<<<<<<<<
19001  * for idx in range(ndim):
19002  * strides[idx] = stride
19003  */
19004  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
19005  if (__pyx_t_1) {
19006 
19007  /* "View.MemoryView":1197
19008  *
19009  * if order == 'F':
19010  * for idx in range(ndim): # <<<<<<<<<<<<<<
19011  * strides[idx] = stride
19012  * stride *= shape[idx]
19013  */
19014  __pyx_t_2 = __pyx_v_ndim;
19015  __pyx_t_3 = __pyx_t_2;
19016  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19017  __pyx_v_idx = __pyx_t_4;
19018 
19019  /* "View.MemoryView":1198
19020  * if order == 'F':
19021  * for idx in range(ndim):
19022  * strides[idx] = stride # <<<<<<<<<<<<<<
19023  * stride *= shape[idx]
19024  * else:
19025  */
19026  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19027 
19028  /* "View.MemoryView":1199
19029  * for idx in range(ndim):
19030  * strides[idx] = stride
19031  * stride *= shape[idx] # <<<<<<<<<<<<<<
19032  * else:
19033  * for idx in range(ndim - 1, -1, -1):
19034  */
19035  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19036  }
19037 
19038  /* "View.MemoryView":1196
19039  * cdef int idx
19040  *
19041  * if order == 'F': # <<<<<<<<<<<<<<
19042  * for idx in range(ndim):
19043  * strides[idx] = stride
19044  */
19045  goto __pyx_L3;
19046  }
19047 
19048  /* "View.MemoryView":1201
19049  * stride *= shape[idx]
19050  * else:
19051  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
19052  * strides[idx] = stride
19053  * stride *= shape[idx]
19054  */
19055  /*else*/ {
19056  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
19057  __pyx_v_idx = __pyx_t_2;
19058 
19059  /* "View.MemoryView":1202
19060  * else:
19061  * for idx in range(ndim - 1, -1, -1):
19062  * strides[idx] = stride # <<<<<<<<<<<<<<
19063  * stride *= shape[idx]
19064  *
19065  */
19066  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
19067 
19068  /* "View.MemoryView":1203
19069  * for idx in range(ndim - 1, -1, -1):
19070  * strides[idx] = stride
19071  * stride *= shape[idx] # <<<<<<<<<<<<<<
19072  *
19073  * return stride
19074  */
19075  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
19076  }
19077  }
19078  __pyx_L3:;
19079 
19080  /* "View.MemoryView":1205
19081  * stride *= shape[idx]
19082  *
19083  * return stride # <<<<<<<<<<<<<<
19084  *
19085  * @cname('__pyx_memoryview_copy_data_to_temp')
19086  */
19087  __pyx_r = __pyx_v_stride;
19088  goto __pyx_L0;
19089 
19090  /* "View.MemoryView":1187
19091  *
19092  * @cname('__pyx_fill_contig_strides_array')
19093  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
19094  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
19095  * int ndim, char order) nogil:
19096  */
19097 
19098  /* function exit code */
19099  __pyx_L0:;
19100  return __pyx_r;
19101 }
19102 
19103 /* "View.MemoryView":1208
19104  *
19105  * @cname('__pyx_memoryview_copy_data_to_temp')
19106  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19107  * __Pyx_memviewslice *tmpslice,
19108  * char order,
19109  */
19110 
19111 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) {
19112  int __pyx_v_i;
19113  void *__pyx_v_result;
19114  size_t __pyx_v_itemsize;
19115  size_t __pyx_v_size;
19116  void *__pyx_r;
19117  Py_ssize_t __pyx_t_1;
19118  int __pyx_t_2;
19119  int __pyx_t_3;
19120  struct __pyx_memoryview_obj *__pyx_t_4;
19121  int __pyx_t_5;
19122  int __pyx_t_6;
19123  int __pyx_lineno = 0;
19124  const char *__pyx_filename = NULL;
19125  int __pyx_clineno = 0;
19126 
19127  /* "View.MemoryView":1219
19128  * cdef void *result
19129  *
19130  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19131  * cdef size_t size = slice_get_size(src, ndim)
19132  *
19133  */
19134  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
19135  __pyx_v_itemsize = __pyx_t_1;
19136 
19137  /* "View.MemoryView":1220
19138  *
19139  * cdef size_t itemsize = src.memview.view.itemsize
19140  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
19141  *
19142  * result = malloc(size)
19143  */
19144  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
19145 
19146  /* "View.MemoryView":1222
19147  * cdef size_t size = slice_get_size(src, ndim)
19148  *
19149  * result = malloc(size) # <<<<<<<<<<<<<<
19150  * if not result:
19151  * _err(MemoryError, NULL)
19152  */
19153  __pyx_v_result = malloc(__pyx_v_size);
19154 
19155  /* "View.MemoryView":1223
19156  *
19157  * result = malloc(size)
19158  * if not result: # <<<<<<<<<<<<<<
19159  * _err(MemoryError, NULL)
19160  *
19161  */
19162  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
19163  if (__pyx_t_2) {
19164 
19165  /* "View.MemoryView":1224
19166  * result = malloc(size)
19167  * if not result:
19168  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
19169  *
19170  *
19171  */
19172  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error)
19173 
19174  /* "View.MemoryView":1223
19175  *
19176  * result = malloc(size)
19177  * if not result: # <<<<<<<<<<<<<<
19178  * _err(MemoryError, NULL)
19179  *
19180  */
19181  }
19182 
19183  /* "View.MemoryView":1227
19184  *
19185  *
19186  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
19187  * tmpslice.memview = src.memview
19188  * for i in range(ndim):
19189  */
19190  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
19191 
19192  /* "View.MemoryView":1228
19193  *
19194  * tmpslice.data = <char *> result
19195  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
19196  * for i in range(ndim):
19197  * tmpslice.shape[i] = src.shape[i]
19198  */
19199  __pyx_t_4 = __pyx_v_src->memview;
19200  __pyx_v_tmpslice->memview = __pyx_t_4;
19201 
19202  /* "View.MemoryView":1229
19203  * tmpslice.data = <char *> result
19204  * tmpslice.memview = src.memview
19205  * for i in range(ndim): # <<<<<<<<<<<<<<
19206  * tmpslice.shape[i] = src.shape[i]
19207  * tmpslice.suboffsets[i] = -1
19208  */
19209  __pyx_t_3 = __pyx_v_ndim;
19210  __pyx_t_5 = __pyx_t_3;
19211  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19212  __pyx_v_i = __pyx_t_6;
19213 
19214  /* "View.MemoryView":1230
19215  * tmpslice.memview = src.memview
19216  * for i in range(ndim):
19217  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
19218  * tmpslice.suboffsets[i] = -1
19219  *
19220  */
19221  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
19222 
19223  /* "View.MemoryView":1231
19224  * for i in range(ndim):
19225  * tmpslice.shape[i] = src.shape[i]
19226  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
19227  *
19228  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
19229  */
19230  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
19231  }
19232 
19233  /* "View.MemoryView":1233
19234  * tmpslice.suboffsets[i] = -1
19235  *
19236  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
19237  * ndim, order)
19238  *
19239  */
19240  (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));
19241 
19242  /* "View.MemoryView":1237
19243  *
19244  *
19245  * for i in range(ndim): # <<<<<<<<<<<<<<
19246  * if tmpslice.shape[i] == 1:
19247  * tmpslice.strides[i] = 0
19248  */
19249  __pyx_t_3 = __pyx_v_ndim;
19250  __pyx_t_5 = __pyx_t_3;
19251  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19252  __pyx_v_i = __pyx_t_6;
19253 
19254  /* "View.MemoryView":1238
19255  *
19256  * for i in range(ndim):
19257  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19258  * tmpslice.strides[i] = 0
19259  *
19260  */
19261  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
19262  if (__pyx_t_2) {
19263 
19264  /* "View.MemoryView":1239
19265  * for i in range(ndim):
19266  * if tmpslice.shape[i] == 1:
19267  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
19268  *
19269  * if slice_is_contig(src[0], order, ndim):
19270  */
19271  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
19272 
19273  /* "View.MemoryView":1238
19274  *
19275  * for i in range(ndim):
19276  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
19277  * tmpslice.strides[i] = 0
19278  *
19279  */
19280  }
19281  }
19282 
19283  /* "View.MemoryView":1241
19284  * tmpslice.strides[i] = 0
19285  *
19286  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19287  * memcpy(result, src.data, size)
19288  * else:
19289  */
19290  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
19291  if (__pyx_t_2) {
19292 
19293  /* "View.MemoryView":1242
19294  *
19295  * if slice_is_contig(src[0], order, ndim):
19296  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
19297  * else:
19298  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19299  */
19300  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
19301 
19302  /* "View.MemoryView":1241
19303  * tmpslice.strides[i] = 0
19304  *
19305  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
19306  * memcpy(result, src.data, size)
19307  * else:
19308  */
19309  goto __pyx_L9;
19310  }
19311 
19312  /* "View.MemoryView":1244
19313  * memcpy(result, src.data, size)
19314  * else:
19315  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
19316  *
19317  * return result
19318  */
19319  /*else*/ {
19320  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
19321  }
19322  __pyx_L9:;
19323 
19324  /* "View.MemoryView":1246
19325  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
19326  *
19327  * return result # <<<<<<<<<<<<<<
19328  *
19329  *
19330  */
19331  __pyx_r = __pyx_v_result;
19332  goto __pyx_L0;
19333 
19334  /* "View.MemoryView":1208
19335  *
19336  * @cname('__pyx_memoryview_copy_data_to_temp')
19337  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
19338  * __Pyx_memviewslice *tmpslice,
19339  * char order,
19340  */
19341 
19342  /* function exit code */
19343  __pyx_L1_error:;
19344  {
19345  #ifdef WITH_THREAD
19346  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19347  #endif
19348  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
19349  #ifdef WITH_THREAD
19350  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19351  #endif
19352  }
19353  __pyx_r = NULL;
19354  __pyx_L0:;
19355  return __pyx_r;
19356 }
19357 
19358 /* "View.MemoryView":1251
19359  *
19360  * @cname('__pyx_memoryview_err_extents')
19361  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19362  * Py_ssize_t extent2) except -1 with gil:
19363  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19364  */
19365 
19366 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
19367  int __pyx_r;
19368  __Pyx_RefNannyDeclarations
19369  PyObject *__pyx_t_1 = NULL;
19370  PyObject *__pyx_t_2 = NULL;
19371  PyObject *__pyx_t_3 = NULL;
19372  PyObject *__pyx_t_4 = NULL;
19373  int __pyx_lineno = 0;
19374  const char *__pyx_filename = NULL;
19375  int __pyx_clineno = 0;
19376  #ifdef WITH_THREAD
19377  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19378  #endif
19379  __Pyx_RefNannySetupContext("_err_extents", 0);
19380 
19381  /* "View.MemoryView":1254
19382  * Py_ssize_t extent2) except -1 with gil:
19383  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19384  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
19385  *
19386  * @cname('__pyx_memoryview_err_dim')
19387  */
19388  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19389  __Pyx_GOTREF(__pyx_t_1);
19390  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
19391  __Pyx_GOTREF(__pyx_t_2);
19392  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
19393  __Pyx_GOTREF(__pyx_t_3);
19394  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
19395  __Pyx_GOTREF(__pyx_t_4);
19396  __Pyx_GIVEREF(__pyx_t_1);
19397  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
19398  __Pyx_GIVEREF(__pyx_t_2);
19399  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
19400  __Pyx_GIVEREF(__pyx_t_3);
19401  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
19402  __pyx_t_1 = 0;
19403  __pyx_t_2 = 0;
19404  __pyx_t_3 = 0;
19405 
19406  /* "View.MemoryView":1253
19407  * cdef int _err_extents(int i, Py_ssize_t extent1,
19408  * Py_ssize_t extent2) except -1 with gil:
19409  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
19410  * (i, extent1, extent2))
19411  *
19412  */
19413  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error)
19414  __Pyx_GOTREF(__pyx_t_3);
19415  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19416  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error)
19417  __Pyx_GOTREF(__pyx_t_4);
19418  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19419  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19420  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19421  __PYX_ERR(1, 1253, __pyx_L1_error)
19422 
19423  /* "View.MemoryView":1251
19424  *
19425  * @cname('__pyx_memoryview_err_extents')
19426  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
19427  * Py_ssize_t extent2) except -1 with gil:
19428  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
19429  */
19430 
19431  /* function exit code */
19432  __pyx_L1_error:;
19433  __Pyx_XDECREF(__pyx_t_1);
19434  __Pyx_XDECREF(__pyx_t_2);
19435  __Pyx_XDECREF(__pyx_t_3);
19436  __Pyx_XDECREF(__pyx_t_4);
19437  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19438  __pyx_r = -1;
19439  __Pyx_RefNannyFinishContext();
19440  #ifdef WITH_THREAD
19441  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19442  #endif
19443  return __pyx_r;
19444 }
19445 
19446 /* "View.MemoryView":1257
19447  *
19448  * @cname('__pyx_memoryview_err_dim')
19449  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19450  * raise error(msg.decode('ascii') % dim)
19451  *
19452  */
19453 
19454 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
19455  int __pyx_r;
19456  __Pyx_RefNannyDeclarations
19457  PyObject *__pyx_t_1 = NULL;
19458  PyObject *__pyx_t_2 = NULL;
19459  PyObject *__pyx_t_3 = NULL;
19460  PyObject *__pyx_t_4 = NULL;
19461  int __pyx_lineno = 0;
19462  const char *__pyx_filename = NULL;
19463  int __pyx_clineno = 0;
19464  #ifdef WITH_THREAD
19465  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19466  #endif
19467  __Pyx_RefNannySetupContext("_err_dim", 0);
19468  __Pyx_INCREF(__pyx_v_error);
19469 
19470  /* "View.MemoryView":1258
19471  * @cname('__pyx_memoryview_err_dim')
19472  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
19473  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
19474  *
19475  * @cname('__pyx_memoryview_err')
19476  */
19477  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error)
19478  __Pyx_GOTREF(__pyx_t_2);
19479  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error)
19480  __Pyx_GOTREF(__pyx_t_3);
19481  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error)
19482  __Pyx_GOTREF(__pyx_t_4);
19483  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19484  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19485  __Pyx_INCREF(__pyx_v_error);
19486  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
19487  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19488  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19489  if (likely(__pyx_t_2)) {
19490  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
19491  __Pyx_INCREF(__pyx_t_2);
19492  __Pyx_INCREF(function);
19493  __Pyx_DECREF_SET(__pyx_t_3, function);
19494  }
19495  }
19496  __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);
19497  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19498  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19499  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error)
19500  __Pyx_GOTREF(__pyx_t_1);
19501  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19502  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19503  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19504  __PYX_ERR(1, 1258, __pyx_L1_error)
19505 
19506  /* "View.MemoryView":1257
19507  *
19508  * @cname('__pyx_memoryview_err_dim')
19509  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19510  * raise error(msg.decode('ascii') % dim)
19511  *
19512  */
19513 
19514  /* function exit code */
19515  __pyx_L1_error:;
19516  __Pyx_XDECREF(__pyx_t_1);
19517  __Pyx_XDECREF(__pyx_t_2);
19518  __Pyx_XDECREF(__pyx_t_3);
19519  __Pyx_XDECREF(__pyx_t_4);
19520  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
19521  __pyx_r = -1;
19522  __Pyx_XDECREF(__pyx_v_error);
19523  __Pyx_RefNannyFinishContext();
19524  #ifdef WITH_THREAD
19525  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19526  #endif
19527  return __pyx_r;
19528 }
19529 
19530 /* "View.MemoryView":1261
19531  *
19532  * @cname('__pyx_memoryview_err')
19533  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19534  * if msg != NULL:
19535  * raise error(msg.decode('ascii'))
19536  */
19537 
19538 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
19539  int __pyx_r;
19540  __Pyx_RefNannyDeclarations
19541  int __pyx_t_1;
19542  PyObject *__pyx_t_2 = NULL;
19543  PyObject *__pyx_t_3 = NULL;
19544  PyObject *__pyx_t_4 = NULL;
19545  PyObject *__pyx_t_5 = NULL;
19546  int __pyx_lineno = 0;
19547  const char *__pyx_filename = NULL;
19548  int __pyx_clineno = 0;
19549  #ifdef WITH_THREAD
19550  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19551  #endif
19552  __Pyx_RefNannySetupContext("_err", 0);
19553  __Pyx_INCREF(__pyx_v_error);
19554 
19555  /* "View.MemoryView":1262
19556  * @cname('__pyx_memoryview_err')
19557  * cdef int _err(object error, char *msg) except -1 with gil:
19558  * if msg != NULL: # <<<<<<<<<<<<<<
19559  * raise error(msg.decode('ascii'))
19560  * else:
19561  */
19562  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
19563  if (unlikely(__pyx_t_1)) {
19564 
19565  /* "View.MemoryView":1263
19566  * cdef int _err(object error, char *msg) except -1 with gil:
19567  * if msg != NULL:
19568  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
19569  * else:
19570  * raise error
19571  */
19572  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error)
19573  __Pyx_GOTREF(__pyx_t_3);
19574  __Pyx_INCREF(__pyx_v_error);
19575  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
19576  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19577  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
19578  if (likely(__pyx_t_5)) {
19579  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
19580  __Pyx_INCREF(__pyx_t_5);
19581  __Pyx_INCREF(function);
19582  __Pyx_DECREF_SET(__pyx_t_4, function);
19583  }
19584  }
19585  __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);
19586  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19587  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19588  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error)
19589  __Pyx_GOTREF(__pyx_t_2);
19590  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19591  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
19592  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19593  __PYX_ERR(1, 1263, __pyx_L1_error)
19594 
19595  /* "View.MemoryView":1262
19596  * @cname('__pyx_memoryview_err')
19597  * cdef int _err(object error, char *msg) except -1 with gil:
19598  * if msg != NULL: # <<<<<<<<<<<<<<
19599  * raise error(msg.decode('ascii'))
19600  * else:
19601  */
19602  }
19603 
19604  /* "View.MemoryView":1265
19605  * raise error(msg.decode('ascii'))
19606  * else:
19607  * raise error # <<<<<<<<<<<<<<
19608  *
19609  * @cname('__pyx_memoryview_copy_contents')
19610  */
19611  /*else*/ {
19612  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
19613  __PYX_ERR(1, 1265, __pyx_L1_error)
19614  }
19615 
19616  /* "View.MemoryView":1261
19617  *
19618  * @cname('__pyx_memoryview_err')
19619  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19620  * if msg != NULL:
19621  * raise error(msg.decode('ascii'))
19622  */
19623 
19624  /* function exit code */
19625  __pyx_L1_error:;
19626  __Pyx_XDECREF(__pyx_t_2);
19627  __Pyx_XDECREF(__pyx_t_3);
19628  __Pyx_XDECREF(__pyx_t_4);
19629  __Pyx_XDECREF(__pyx_t_5);
19630  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
19631  __pyx_r = -1;
19632  __Pyx_XDECREF(__pyx_v_error);
19633  __Pyx_RefNannyFinishContext();
19634  #ifdef WITH_THREAD
19635  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19636  #endif
19637  return __pyx_r;
19638 }
19639 
19640 /* "View.MemoryView":1268
19641  *
19642  * @cname('__pyx_memoryview_copy_contents')
19643  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
19644  * __Pyx_memviewslice dst,
19645  * int src_ndim, int dst_ndim,
19646  */
19647 
19648 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) {
19649  void *__pyx_v_tmpdata;
19650  size_t __pyx_v_itemsize;
19651  int __pyx_v_i;
19652  char __pyx_v_order;
19653  int __pyx_v_broadcasting;
19654  int __pyx_v_direct_copy;
19655  __Pyx_memviewslice __pyx_v_tmp;
19656  int __pyx_v_ndim;
19657  int __pyx_r;
19658  Py_ssize_t __pyx_t_1;
19659  int __pyx_t_2;
19660  int __pyx_t_3;
19661  int __pyx_t_4;
19662  int __pyx_t_5;
19663  int __pyx_t_6;
19664  void *__pyx_t_7;
19665  int __pyx_t_8;
19666  int __pyx_lineno = 0;
19667  const char *__pyx_filename = NULL;
19668  int __pyx_clineno = 0;
19669 
19670  /* "View.MemoryView":1276
19671  * Check for overlapping memory and verify the shapes.
19672  * """
19673  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
19674  * cdef size_t itemsize = src.memview.view.itemsize
19675  * cdef int i
19676  */
19677  __pyx_v_tmpdata = NULL;
19678 
19679  /* "View.MemoryView":1277
19680  * """
19681  * cdef void *tmpdata = NULL
19682  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19683  * cdef int i
19684  * cdef char order = get_best_order(&src, src_ndim)
19685  */
19686  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
19687  __pyx_v_itemsize = __pyx_t_1;
19688 
19689  /* "View.MemoryView":1279
19690  * cdef size_t itemsize = src.memview.view.itemsize
19691  * cdef int i
19692  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
19693  * cdef bint broadcasting = False
19694  * cdef bint direct_copy = False
19695  */
19696  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
19697 
19698  /* "View.MemoryView":1280
19699  * cdef int i
19700  * cdef char order = get_best_order(&src, src_ndim)
19701  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
19702  * cdef bint direct_copy = False
19703  * cdef __Pyx_memviewslice tmp
19704  */
19705  __pyx_v_broadcasting = 0;
19706 
19707  /* "View.MemoryView":1281
19708  * cdef char order = get_best_order(&src, src_ndim)
19709  * cdef bint broadcasting = False
19710  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
19711  * cdef __Pyx_memviewslice tmp
19712  *
19713  */
19714  __pyx_v_direct_copy = 0;
19715 
19716  /* "View.MemoryView":1284
19717  * cdef __Pyx_memviewslice tmp
19718  *
19719  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19720  * broadcast_leading(&src, src_ndim, dst_ndim)
19721  * elif dst_ndim < src_ndim:
19722  */
19723  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
19724  if (__pyx_t_2) {
19725 
19726  /* "View.MemoryView":1285
19727  *
19728  * if src_ndim < dst_ndim:
19729  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19730  * elif dst_ndim < src_ndim:
19731  * broadcast_leading(&dst, dst_ndim, src_ndim)
19732  */
19733  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
19734 
19735  /* "View.MemoryView":1284
19736  * cdef __Pyx_memviewslice tmp
19737  *
19738  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19739  * broadcast_leading(&src, src_ndim, dst_ndim)
19740  * elif dst_ndim < src_ndim:
19741  */
19742  goto __pyx_L3;
19743  }
19744 
19745  /* "View.MemoryView":1286
19746  * if src_ndim < dst_ndim:
19747  * broadcast_leading(&src, src_ndim, dst_ndim)
19748  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19749  * broadcast_leading(&dst, dst_ndim, src_ndim)
19750  *
19751  */
19752  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
19753  if (__pyx_t_2) {
19754 
19755  /* "View.MemoryView":1287
19756  * broadcast_leading(&src, src_ndim, dst_ndim)
19757  * elif dst_ndim < src_ndim:
19758  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
19759  *
19760  * cdef int ndim = max(src_ndim, dst_ndim)
19761  */
19762  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
19763 
19764  /* "View.MemoryView":1286
19765  * if src_ndim < dst_ndim:
19766  * broadcast_leading(&src, src_ndim, dst_ndim)
19767  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19768  * broadcast_leading(&dst, dst_ndim, src_ndim)
19769  *
19770  */
19771  }
19772  __pyx_L3:;
19773 
19774  /* "View.MemoryView":1289
19775  * broadcast_leading(&dst, dst_ndim, src_ndim)
19776  *
19777  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19778  *
19779  * for i in range(ndim):
19780  */
19781  __pyx_t_3 = __pyx_v_dst_ndim;
19782  __pyx_t_4 = __pyx_v_src_ndim;
19783  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
19784  __pyx_t_5 = __pyx_t_3;
19785  } else {
19786  __pyx_t_5 = __pyx_t_4;
19787  }
19788  __pyx_v_ndim = __pyx_t_5;
19789 
19790  /* "View.MemoryView":1291
19791  * cdef int ndim = max(src_ndim, dst_ndim)
19792  *
19793  * for i in range(ndim): # <<<<<<<<<<<<<<
19794  * if src.shape[i] != dst.shape[i]:
19795  * if src.shape[i] == 1:
19796  */
19797  __pyx_t_5 = __pyx_v_ndim;
19798  __pyx_t_3 = __pyx_t_5;
19799  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19800  __pyx_v_i = __pyx_t_4;
19801 
19802  /* "View.MemoryView":1292
19803  *
19804  * for i in range(ndim):
19805  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
19806  * if src.shape[i] == 1:
19807  * broadcasting = True
19808  */
19809  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
19810  if (__pyx_t_2) {
19811 
19812  /* "View.MemoryView":1293
19813  * for i in range(ndim):
19814  * if src.shape[i] != dst.shape[i]:
19815  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
19816  * broadcasting = True
19817  * src.strides[i] = 0
19818  */
19819  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
19820  if (__pyx_t_2) {
19821 
19822  /* "View.MemoryView":1294
19823  * if src.shape[i] != dst.shape[i]:
19824  * if src.shape[i] == 1:
19825  * broadcasting = True # <<<<<<<<<<<<<<
19826  * src.strides[i] = 0
19827  * else:
19828  */
19829  __pyx_v_broadcasting = 1;
19830 
19831  /* "View.MemoryView":1295
19832  * if src.shape[i] == 1:
19833  * broadcasting = True
19834  * src.strides[i] = 0 # <<<<<<<<<<<<<<
19835  * else:
19836  * _err_extents(i, dst.shape[i], src.shape[i])
19837  */
19838  (__pyx_v_src.strides[__pyx_v_i]) = 0;
19839 
19840  /* "View.MemoryView":1293
19841  * for i in range(ndim):
19842  * if src.shape[i] != dst.shape[i]:
19843  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
19844  * broadcasting = True
19845  * src.strides[i] = 0
19846  */
19847  goto __pyx_L7;
19848  }
19849 
19850  /* "View.MemoryView":1297
19851  * src.strides[i] = 0
19852  * else:
19853  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
19854  *
19855  * if src.suboffsets[i] >= 0:
19856  */
19857  /*else*/ {
19858  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
19859  }
19860  __pyx_L7:;
19861 
19862  /* "View.MemoryView":1292
19863  *
19864  * for i in range(ndim):
19865  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
19866  * if src.shape[i] == 1:
19867  * broadcasting = True
19868  */
19869  }
19870 
19871  /* "View.MemoryView":1299
19872  * _err_extents(i, dst.shape[i], src.shape[i])
19873  *
19874  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
19875  * _err_dim(ValueError, "Dimension %d is not direct", i)
19876  *
19877  */
19878  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
19879  if (__pyx_t_2) {
19880 
19881  /* "View.MemoryView":1300
19882  *
19883  * if src.suboffsets[i] >= 0:
19884  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
19885  *
19886  * if slices_overlap(&src, &dst, ndim, itemsize):
19887  */
19888  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error)
19889 
19890  /* "View.MemoryView":1299
19891  * _err_extents(i, dst.shape[i], src.shape[i])
19892  *
19893  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
19894  * _err_dim(ValueError, "Dimension %d is not direct", i)
19895  *
19896  */
19897  }
19898  }
19899 
19900  /* "View.MemoryView":1302
19901  * _err_dim(ValueError, "Dimension %d is not direct", i)
19902  *
19903  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
19904  *
19905  * if not slice_is_contig(src, order, ndim):
19906  */
19907  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
19908  if (__pyx_t_2) {
19909 
19910  /* "View.MemoryView":1304
19911  * if slices_overlap(&src, &dst, ndim, itemsize):
19912  *
19913  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
19914  * order = get_best_order(&dst, ndim)
19915  *
19916  */
19917  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
19918  if (__pyx_t_2) {
19919 
19920  /* "View.MemoryView":1305
19921  *
19922  * if not slice_is_contig(src, order, ndim):
19923  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
19924  *
19925  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
19926  */
19927  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
19928 
19929  /* "View.MemoryView":1304
19930  * if slices_overlap(&src, &dst, ndim, itemsize):
19931  *
19932  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
19933  * order = get_best_order(&dst, ndim)
19934  *
19935  */
19936  }
19937 
19938  /* "View.MemoryView":1307
19939  * order = get_best_order(&dst, ndim)
19940  *
19941  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
19942  * src = tmp
19943  *
19944  */
19945  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1307, __pyx_L1_error)
19946  __pyx_v_tmpdata = __pyx_t_7;
19947 
19948  /* "View.MemoryView":1308
19949  *
19950  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
19951  * src = tmp # <<<<<<<<<<<<<<
19952  *
19953  * if not broadcasting:
19954  */
19955  __pyx_v_src = __pyx_v_tmp;
19956 
19957  /* "View.MemoryView":1302
19958  * _err_dim(ValueError, "Dimension %d is not direct", i)
19959  *
19960  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
19961  *
19962  * if not slice_is_contig(src, order, ndim):
19963  */
19964  }
19965 
19966  /* "View.MemoryView":1310
19967  * src = tmp
19968  *
19969  * if not broadcasting: # <<<<<<<<<<<<<<
19970  *
19971  *
19972  */
19973  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
19974  if (__pyx_t_2) {
19975 
19976  /* "View.MemoryView":1313
19977  *
19978  *
19979  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
19980  * direct_copy = slice_is_contig(dst, 'C', ndim)
19981  * elif slice_is_contig(src, 'F', ndim):
19982  */
19983  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
19984  if (__pyx_t_2) {
19985 
19986  /* "View.MemoryView":1314
19987  *
19988  * if slice_is_contig(src, 'C', ndim):
19989  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
19990  * elif slice_is_contig(src, 'F', ndim):
19991  * direct_copy = slice_is_contig(dst, 'F', ndim)
19992  */
19993  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
19994 
19995  /* "View.MemoryView":1313
19996  *
19997  *
19998  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
19999  * direct_copy = slice_is_contig(dst, 'C', ndim)
20000  * elif slice_is_contig(src, 'F', ndim):
20001  */
20002  goto __pyx_L12;
20003  }
20004 
20005  /* "View.MemoryView":1315
20006  * if slice_is_contig(src, 'C', ndim):
20007  * direct_copy = slice_is_contig(dst, 'C', ndim)
20008  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
20009  * direct_copy = slice_is_contig(dst, 'F', ndim)
20010  *
20011  */
20012  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
20013  if (__pyx_t_2) {
20014 
20015  /* "View.MemoryView":1316
20016  * direct_copy = slice_is_contig(dst, 'C', ndim)
20017  * elif slice_is_contig(src, 'F', ndim):
20018  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
20019  *
20020  * if direct_copy:
20021  */
20022  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
20023 
20024  /* "View.MemoryView":1315
20025  * if slice_is_contig(src, 'C', ndim):
20026  * direct_copy = slice_is_contig(dst, 'C', ndim)
20027  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
20028  * direct_copy = slice_is_contig(dst, 'F', ndim)
20029  *
20030  */
20031  }
20032  __pyx_L12:;
20033 
20034  /* "View.MemoryView":1318
20035  * direct_copy = slice_is_contig(dst, 'F', ndim)
20036  *
20037  * if direct_copy: # <<<<<<<<<<<<<<
20038  *
20039  * refcount_copying(&dst, dtype_is_object, ndim, False)
20040  */
20041  __pyx_t_2 = (__pyx_v_direct_copy != 0);
20042  if (__pyx_t_2) {
20043 
20044  /* "View.MemoryView":1320
20045  * if direct_copy:
20046  *
20047  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20048  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20049  * refcount_copying(&dst, dtype_is_object, ndim, True)
20050  */
20051  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20052 
20053  /* "View.MemoryView":1321
20054  *
20055  * refcount_copying(&dst, dtype_is_object, ndim, False)
20056  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
20057  * refcount_copying(&dst, dtype_is_object, ndim, True)
20058  * free(tmpdata)
20059  */
20060  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
20061 
20062  /* "View.MemoryView":1322
20063  * refcount_copying(&dst, dtype_is_object, ndim, False)
20064  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20065  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20066  * free(tmpdata)
20067  * return 0
20068  */
20069  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20070 
20071  /* "View.MemoryView":1323
20072  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
20073  * refcount_copying(&dst, dtype_is_object, ndim, True)
20074  * free(tmpdata) # <<<<<<<<<<<<<<
20075  * return 0
20076  *
20077  */
20078  free(__pyx_v_tmpdata);
20079 
20080  /* "View.MemoryView":1324
20081  * refcount_copying(&dst, dtype_is_object, ndim, True)
20082  * free(tmpdata)
20083  * return 0 # <<<<<<<<<<<<<<
20084  *
20085  * if order == 'F' == get_best_order(&dst, ndim):
20086  */
20087  __pyx_r = 0;
20088  goto __pyx_L0;
20089 
20090  /* "View.MemoryView":1318
20091  * direct_copy = slice_is_contig(dst, 'F', ndim)
20092  *
20093  * if direct_copy: # <<<<<<<<<<<<<<
20094  *
20095  * refcount_copying(&dst, dtype_is_object, ndim, False)
20096  */
20097  }
20098 
20099  /* "View.MemoryView":1310
20100  * src = tmp
20101  *
20102  * if not broadcasting: # <<<<<<<<<<<<<<
20103  *
20104  *
20105  */
20106  }
20107 
20108  /* "View.MemoryView":1326
20109  * return 0
20110  *
20111  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20112  *
20113  *
20114  */
20115  __pyx_t_2 = (__pyx_v_order == 'F');
20116  if (__pyx_t_2) {
20117  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
20118  }
20119  __pyx_t_8 = (__pyx_t_2 != 0);
20120  if (__pyx_t_8) {
20121 
20122  /* "View.MemoryView":1329
20123  *
20124  *
20125  * transpose_memslice(&src) # <<<<<<<<<<<<<<
20126  * transpose_memslice(&dst)
20127  *
20128  */
20129  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1329, __pyx_L1_error)
20130 
20131  /* "View.MemoryView":1330
20132  *
20133  * transpose_memslice(&src)
20134  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
20135  *
20136  * refcount_copying(&dst, dtype_is_object, ndim, False)
20137  */
20138  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1330, __pyx_L1_error)
20139 
20140  /* "View.MemoryView":1326
20141  * return 0
20142  *
20143  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
20144  *
20145  *
20146  */
20147  }
20148 
20149  /* "View.MemoryView":1332
20150  * transpose_memslice(&dst)
20151  *
20152  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20153  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20154  * refcount_copying(&dst, dtype_is_object, ndim, True)
20155  */
20156  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20157 
20158  /* "View.MemoryView":1333
20159  *
20160  * refcount_copying(&dst, dtype_is_object, ndim, False)
20161  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
20162  * refcount_copying(&dst, dtype_is_object, ndim, True)
20163  *
20164  */
20165  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
20166 
20167  /* "View.MemoryView":1334
20168  * refcount_copying(&dst, dtype_is_object, ndim, False)
20169  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
20170  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20171  *
20172  * free(tmpdata)
20173  */
20174  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20175 
20176  /* "View.MemoryView":1336
20177  * refcount_copying(&dst, dtype_is_object, ndim, True)
20178  *
20179  * free(tmpdata) # <<<<<<<<<<<<<<
20180  * return 0
20181  *
20182  */
20183  free(__pyx_v_tmpdata);
20184 
20185  /* "View.MemoryView":1337
20186  *
20187  * free(tmpdata)
20188  * return 0 # <<<<<<<<<<<<<<
20189  *
20190  * @cname('__pyx_memoryview_broadcast_leading')
20191  */
20192  __pyx_r = 0;
20193  goto __pyx_L0;
20194 
20195  /* "View.MemoryView":1268
20196  *
20197  * @cname('__pyx_memoryview_copy_contents')
20198  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
20199  * __Pyx_memviewslice dst,
20200  * int src_ndim, int dst_ndim,
20201  */
20202 
20203  /* function exit code */
20204  __pyx_L1_error:;
20205  {
20206  #ifdef WITH_THREAD
20207  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20208  #endif
20209  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20210  #ifdef WITH_THREAD
20211  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20212  #endif
20213  }
20214  __pyx_r = -1;
20215  __pyx_L0:;
20216  return __pyx_r;
20217 }
20218 
20219 /* "View.MemoryView":1340
20220  *
20221  * @cname('__pyx_memoryview_broadcast_leading')
20222  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20223  * int ndim,
20224  * int ndim_other) nogil:
20225  */
20226 
20227 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
20228  int __pyx_v_i;
20229  int __pyx_v_offset;
20230  int __pyx_t_1;
20231  int __pyx_t_2;
20232  int __pyx_t_3;
20233 
20234  /* "View.MemoryView":1344
20235  * int ndim_other) nogil:
20236  * cdef int i
20237  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
20238  *
20239  * for i in range(ndim - 1, -1, -1):
20240  */
20241  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
20242 
20243  /* "View.MemoryView":1346
20244  * cdef int offset = ndim_other - ndim
20245  *
20246  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
20247  * mslice.shape[i + offset] = mslice.shape[i]
20248  * mslice.strides[i + offset] = mslice.strides[i]
20249  */
20250  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
20251  __pyx_v_i = __pyx_t_1;
20252 
20253  /* "View.MemoryView":1347
20254  *
20255  * for i in range(ndim - 1, -1, -1):
20256  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
20257  * mslice.strides[i + offset] = mslice.strides[i]
20258  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20259  */
20260  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
20261 
20262  /* "View.MemoryView":1348
20263  * for i in range(ndim - 1, -1, -1):
20264  * mslice.shape[i + offset] = mslice.shape[i]
20265  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
20266  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20267  *
20268  */
20269  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
20270 
20271  /* "View.MemoryView":1349
20272  * mslice.shape[i + offset] = mslice.shape[i]
20273  * mslice.strides[i + offset] = mslice.strides[i]
20274  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
20275  *
20276  * for i in range(offset):
20277  */
20278  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
20279  }
20280 
20281  /* "View.MemoryView":1351
20282  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
20283  *
20284  * for i in range(offset): # <<<<<<<<<<<<<<
20285  * mslice.shape[i] = 1
20286  * mslice.strides[i] = mslice.strides[0]
20287  */
20288  __pyx_t_1 = __pyx_v_offset;
20289  __pyx_t_2 = __pyx_t_1;
20290  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20291  __pyx_v_i = __pyx_t_3;
20292 
20293  /* "View.MemoryView":1352
20294  *
20295  * for i in range(offset):
20296  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
20297  * mslice.strides[i] = mslice.strides[0]
20298  * mslice.suboffsets[i] = -1
20299  */
20300  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
20301 
20302  /* "View.MemoryView":1353
20303  * for i in range(offset):
20304  * mslice.shape[i] = 1
20305  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
20306  * mslice.suboffsets[i] = -1
20307  *
20308  */
20309  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
20310 
20311  /* "View.MemoryView":1354
20312  * mslice.shape[i] = 1
20313  * mslice.strides[i] = mslice.strides[0]
20314  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
20315  *
20316  *
20317  */
20318  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
20319  }
20320 
20321  /* "View.MemoryView":1340
20322  *
20323  * @cname('__pyx_memoryview_broadcast_leading')
20324  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
20325  * int ndim,
20326  * int ndim_other) nogil:
20327  */
20328 
20329  /* function exit code */
20330 }
20331 
20332 /* "View.MemoryView":1362
20333  *
20334  * @cname('__pyx_memoryview_refcount_copying')
20335  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20336  * int ndim, bint inc) nogil:
20337  *
20338  */
20339 
20340 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) {
20341  int __pyx_t_1;
20342 
20343  /* "View.MemoryView":1366
20344  *
20345  *
20346  * if dtype_is_object: # <<<<<<<<<<<<<<
20347  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20348  * dst.strides, ndim, inc)
20349  */
20350  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
20351  if (__pyx_t_1) {
20352 
20353  /* "View.MemoryView":1367
20354  *
20355  * if dtype_is_object:
20356  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
20357  * dst.strides, ndim, inc)
20358  *
20359  */
20360  __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);
20361 
20362  /* "View.MemoryView":1366
20363  *
20364  *
20365  * if dtype_is_object: # <<<<<<<<<<<<<<
20366  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
20367  * dst.strides, ndim, inc)
20368  */
20369  }
20370 
20371  /* "View.MemoryView":1362
20372  *
20373  * @cname('__pyx_memoryview_refcount_copying')
20374  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
20375  * int ndim, bint inc) nogil:
20376  *
20377  */
20378 
20379  /* function exit code */
20380 }
20381 
20382 /* "View.MemoryView":1371
20383  *
20384  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20385  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20386  * Py_ssize_t *strides, int ndim,
20387  * bint inc) with gil:
20388  */
20389 
20390 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) {
20391  __Pyx_RefNannyDeclarations
20392  #ifdef WITH_THREAD
20393  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20394  #endif
20395  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
20396 
20397  /* "View.MemoryView":1374
20398  * Py_ssize_t *strides, int ndim,
20399  * bint inc) with gil:
20400  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
20401  *
20402  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20403  */
20404  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
20405 
20406  /* "View.MemoryView":1371
20407  *
20408  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20409  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20410  * Py_ssize_t *strides, int ndim,
20411  * bint inc) with gil:
20412  */
20413 
20414  /* function exit code */
20415  __Pyx_RefNannyFinishContext();
20416  #ifdef WITH_THREAD
20417  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20418  #endif
20419 }
20420 
20421 /* "View.MemoryView":1377
20422  *
20423  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20424  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20425  * Py_ssize_t *strides, int ndim, bint inc):
20426  * cdef Py_ssize_t i
20427  */
20428 
20429 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) {
20430  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20431  __Pyx_RefNannyDeclarations
20432  Py_ssize_t __pyx_t_1;
20433  Py_ssize_t __pyx_t_2;
20434  Py_ssize_t __pyx_t_3;
20435  int __pyx_t_4;
20436  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
20437 
20438  /* "View.MemoryView":1381
20439  * cdef Py_ssize_t i
20440  *
20441  * for i in range(shape[0]): # <<<<<<<<<<<<<<
20442  * if ndim == 1:
20443  * if inc:
20444  */
20445  __pyx_t_1 = (__pyx_v_shape[0]);
20446  __pyx_t_2 = __pyx_t_1;
20447  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20448  __pyx_v_i = __pyx_t_3;
20449 
20450  /* "View.MemoryView":1382
20451  *
20452  * for i in range(shape[0]):
20453  * if ndim == 1: # <<<<<<<<<<<<<<
20454  * if inc:
20455  * Py_INCREF((<PyObject **> data)[0])
20456  */
20457  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20458  if (__pyx_t_4) {
20459 
20460  /* "View.MemoryView":1383
20461  * for i in range(shape[0]):
20462  * if ndim == 1:
20463  * if inc: # <<<<<<<<<<<<<<
20464  * Py_INCREF((<PyObject **> data)[0])
20465  * else:
20466  */
20467  __pyx_t_4 = (__pyx_v_inc != 0);
20468  if (__pyx_t_4) {
20469 
20470  /* "View.MemoryView":1384
20471  * if ndim == 1:
20472  * if inc:
20473  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20474  * else:
20475  * Py_DECREF((<PyObject **> data)[0])
20476  */
20477  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20478 
20479  /* "View.MemoryView":1383
20480  * for i in range(shape[0]):
20481  * if ndim == 1:
20482  * if inc: # <<<<<<<<<<<<<<
20483  * Py_INCREF((<PyObject **> data)[0])
20484  * else:
20485  */
20486  goto __pyx_L6;
20487  }
20488 
20489  /* "View.MemoryView":1386
20490  * Py_INCREF((<PyObject **> data)[0])
20491  * else:
20492  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20493  * else:
20494  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20495  */
20496  /*else*/ {
20497  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20498  }
20499  __pyx_L6:;
20500 
20501  /* "View.MemoryView":1382
20502  *
20503  * for i in range(shape[0]):
20504  * if ndim == 1: # <<<<<<<<<<<<<<
20505  * if inc:
20506  * Py_INCREF((<PyObject **> data)[0])
20507  */
20508  goto __pyx_L5;
20509  }
20510 
20511  /* "View.MemoryView":1388
20512  * Py_DECREF((<PyObject **> data)[0])
20513  * else:
20514  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20515  * ndim - 1, inc)
20516  *
20517  */
20518  /*else*/ {
20519 
20520  /* "View.MemoryView":1389
20521  * else:
20522  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20523  * ndim - 1, inc) # <<<<<<<<<<<<<<
20524  *
20525  * data += strides[0]
20526  */
20527  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
20528  }
20529  __pyx_L5:;
20530 
20531  /* "View.MemoryView":1391
20532  * ndim - 1, inc)
20533  *
20534  * data += strides[0] # <<<<<<<<<<<<<<
20535  *
20536  *
20537  */
20538  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
20539  }
20540 
20541  /* "View.MemoryView":1377
20542  *
20543  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20544  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20545  * Py_ssize_t *strides, int ndim, bint inc):
20546  * cdef Py_ssize_t i
20547  */
20548 
20549  /* function exit code */
20550  __Pyx_RefNannyFinishContext();
20551 }
20552 
20553 /* "View.MemoryView":1397
20554  *
20555  * @cname('__pyx_memoryview_slice_assign_scalar')
20556  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20557  * size_t itemsize, void *item,
20558  * bint dtype_is_object) nogil:
20559  */
20560 
20561 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) {
20562 
20563  /* "View.MemoryView":1400
20564  * size_t itemsize, void *item,
20565  * bint dtype_is_object) nogil:
20566  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20567  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20568  * itemsize, item)
20569  */
20570  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20571 
20572  /* "View.MemoryView":1401
20573  * bint dtype_is_object) nogil:
20574  * refcount_copying(dst, dtype_is_object, ndim, False)
20575  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
20576  * itemsize, item)
20577  * refcount_copying(dst, dtype_is_object, ndim, True)
20578  */
20579  __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);
20580 
20581  /* "View.MemoryView":1403
20582  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20583  * itemsize, item)
20584  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20585  *
20586  *
20587  */
20588  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20589 
20590  /* "View.MemoryView":1397
20591  *
20592  * @cname('__pyx_memoryview_slice_assign_scalar')
20593  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20594  * size_t itemsize, void *item,
20595  * bint dtype_is_object) nogil:
20596  */
20597 
20598  /* function exit code */
20599 }
20600 
20601 /* "View.MemoryView":1407
20602  *
20603  * @cname('__pyx_memoryview__slice_assign_scalar')
20604  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20605  * Py_ssize_t *strides, int ndim,
20606  * size_t itemsize, void *item) nogil:
20607  */
20608 
20609 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) {
20610  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20611  Py_ssize_t __pyx_v_stride;
20612  Py_ssize_t __pyx_v_extent;
20613  int __pyx_t_1;
20614  Py_ssize_t __pyx_t_2;
20615  Py_ssize_t __pyx_t_3;
20616  Py_ssize_t __pyx_t_4;
20617 
20618  /* "View.MemoryView":1411
20619  * size_t itemsize, void *item) nogil:
20620  * cdef Py_ssize_t i
20621  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
20622  * cdef Py_ssize_t extent = shape[0]
20623  *
20624  */
20625  __pyx_v_stride = (__pyx_v_strides[0]);
20626 
20627  /* "View.MemoryView":1412
20628  * cdef Py_ssize_t i
20629  * cdef Py_ssize_t stride = strides[0]
20630  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
20631  *
20632  * if ndim == 1:
20633  */
20634  __pyx_v_extent = (__pyx_v_shape[0]);
20635 
20636  /* "View.MemoryView":1414
20637  * cdef Py_ssize_t extent = shape[0]
20638  *
20639  * if ndim == 1: # <<<<<<<<<<<<<<
20640  * for i in range(extent):
20641  * memcpy(data, item, itemsize)
20642  */
20643  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
20644  if (__pyx_t_1) {
20645 
20646  /* "View.MemoryView":1415
20647  *
20648  * if ndim == 1:
20649  * for i in range(extent): # <<<<<<<<<<<<<<
20650  * memcpy(data, item, itemsize)
20651  * data += stride
20652  */
20653  __pyx_t_2 = __pyx_v_extent;
20654  __pyx_t_3 = __pyx_t_2;
20655  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20656  __pyx_v_i = __pyx_t_4;
20657 
20658  /* "View.MemoryView":1416
20659  * if ndim == 1:
20660  * for i in range(extent):
20661  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
20662  * data += stride
20663  * else:
20664  */
20665  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
20666 
20667  /* "View.MemoryView":1417
20668  * for i in range(extent):
20669  * memcpy(data, item, itemsize)
20670  * data += stride # <<<<<<<<<<<<<<
20671  * else:
20672  * for i in range(extent):
20673  */
20674  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20675  }
20676 
20677  /* "View.MemoryView":1414
20678  * cdef Py_ssize_t extent = shape[0]
20679  *
20680  * if ndim == 1: # <<<<<<<<<<<<<<
20681  * for i in range(extent):
20682  * memcpy(data, item, itemsize)
20683  */
20684  goto __pyx_L3;
20685  }
20686 
20687  /* "View.MemoryView":1419
20688  * data += stride
20689  * else:
20690  * for i in range(extent): # <<<<<<<<<<<<<<
20691  * _slice_assign_scalar(data, shape + 1, strides + 1,
20692  * ndim - 1, itemsize, item)
20693  */
20694  /*else*/ {
20695  __pyx_t_2 = __pyx_v_extent;
20696  __pyx_t_3 = __pyx_t_2;
20697  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20698  __pyx_v_i = __pyx_t_4;
20699 
20700  /* "View.MemoryView":1420
20701  * else:
20702  * for i in range(extent):
20703  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20704  * ndim - 1, itemsize, item)
20705  * data += stride
20706  */
20707  __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);
20708 
20709  /* "View.MemoryView":1422
20710  * _slice_assign_scalar(data, shape + 1, strides + 1,
20711  * ndim - 1, itemsize, item)
20712  * data += stride # <<<<<<<<<<<<<<
20713  *
20714  *
20715  */
20716  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20717  }
20718  }
20719  __pyx_L3:;
20720 
20721  /* "View.MemoryView":1407
20722  *
20723  * @cname('__pyx_memoryview__slice_assign_scalar')
20724  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20725  * Py_ssize_t *strides, int ndim,
20726  * size_t itemsize, void *item) nogil:
20727  */
20728 
20729  /* function exit code */
20730 }
20731 
20732 /* "(tree fragment)":1
20733  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
20734  * cdef object __pyx_PickleError
20735  * cdef object __pyx_result
20736  */
20737 
20738 /* Python wrapper */
20739 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
20740 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};
20741 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20742  PyObject *__pyx_v___pyx_type = 0;
20743  long __pyx_v___pyx_checksum;
20744  PyObject *__pyx_v___pyx_state = 0;
20745  int __pyx_lineno = 0;
20746  const char *__pyx_filename = NULL;
20747  int __pyx_clineno = 0;
20748  PyObject *__pyx_r = 0;
20749  __Pyx_RefNannyDeclarations
20750  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
20751  {
20752  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
20753  PyObject* values[3] = {0,0,0};
20754  if (unlikely(__pyx_kwds)) {
20755  Py_ssize_t kw_args;
20756  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20757  switch (pos_args) {
20758  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20759  CYTHON_FALLTHROUGH;
20760  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20761  CYTHON_FALLTHROUGH;
20762  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20763  CYTHON_FALLTHROUGH;
20764  case 0: break;
20765  default: goto __pyx_L5_argtuple_error;
20766  }
20767  kw_args = PyDict_Size(__pyx_kwds);
20768  switch (pos_args) {
20769  case 0:
20770  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
20771  else goto __pyx_L5_argtuple_error;
20772  CYTHON_FALLTHROUGH;
20773  case 1:
20774  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
20775  else {
20776  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
20777  }
20778  CYTHON_FALLTHROUGH;
20779  case 2:
20780  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
20781  else {
20782  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
20783  }
20784  }
20785  if (unlikely(kw_args > 0)) {
20786  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
20787  }
20788  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20789  goto __pyx_L5_argtuple_error;
20790  } else {
20791  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20792  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20793  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20794  }
20795  __pyx_v___pyx_type = values[0];
20796  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
20797  __pyx_v___pyx_state = values[2];
20798  }
20799  goto __pyx_L4_argument_unpacking_done;
20800  __pyx_L5_argtuple_error:;
20801  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
20802  __pyx_L3_error:;
20803  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20804  __Pyx_RefNannyFinishContext();
20805  return NULL;
20806  __pyx_L4_argument_unpacking_done:;
20807  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
20808 
20809  /* function exit code */
20810  __Pyx_RefNannyFinishContext();
20811  return __pyx_r;
20812 }
20813 
20814 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) {
20815  PyObject *__pyx_v___pyx_PickleError = 0;
20816  PyObject *__pyx_v___pyx_result = 0;
20817  PyObject *__pyx_r = NULL;
20818  __Pyx_RefNannyDeclarations
20819  PyObject *__pyx_t_1 = NULL;
20820  int __pyx_t_2;
20821  int __pyx_t_3;
20822  PyObject *__pyx_t_4 = NULL;
20823  PyObject *__pyx_t_5 = NULL;
20824  PyObject *__pyx_t_6 = NULL;
20825  int __pyx_lineno = 0;
20826  const char *__pyx_filename = NULL;
20827  int __pyx_clineno = 0;
20828  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
20829 
20830  /* "(tree fragment)":4
20831  * cdef object __pyx_PickleError
20832  * cdef object __pyx_result
20833  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
20834  * from pickle import PickleError as __pyx_PickleError
20835  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
20836  */
20837  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
20838  __Pyx_GOTREF(__pyx_t_1);
20839  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__25, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error)
20840  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20841  __pyx_t_3 = (__pyx_t_2 != 0);
20842  if (__pyx_t_3) {
20843 
20844  /* "(tree fragment)":5
20845  * cdef object __pyx_result
20846  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
20847  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
20848  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
20849  * __pyx_result = Enum.__new__(__pyx_type)
20850  */
20851  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
20852  __Pyx_GOTREF(__pyx_t_1);
20853  __Pyx_INCREF(__pyx_n_s_PickleError);
20854  __Pyx_GIVEREF(__pyx_n_s_PickleError);
20855  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
20856  __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
20857  __Pyx_GOTREF(__pyx_t_4);
20858  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20859  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
20860  __Pyx_GOTREF(__pyx_t_1);
20861  __Pyx_INCREF(__pyx_t_1);
20862  __pyx_v___pyx_PickleError = __pyx_t_1;
20863  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20864  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20865 
20866  /* "(tree fragment)":6
20867  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
20868  * from pickle import PickleError as __pyx_PickleError
20869  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
20870  * __pyx_result = Enum.__new__(__pyx_type)
20871  * if __pyx_state is not None:
20872  */
20873  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
20874  __Pyx_GOTREF(__pyx_t_1);
20875  __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
20876  __Pyx_GOTREF(__pyx_t_5);
20877  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20878  __Pyx_INCREF(__pyx_v___pyx_PickleError);
20879  __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
20880  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
20881  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
20882  if (likely(__pyx_t_6)) {
20883  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
20884  __Pyx_INCREF(__pyx_t_6);
20885  __Pyx_INCREF(function);
20886  __Pyx_DECREF_SET(__pyx_t_1, function);
20887  }
20888  }
20889  __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);
20890  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
20891  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20892  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
20893  __Pyx_GOTREF(__pyx_t_4);
20894  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20895  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
20896  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20897  __PYX_ERR(1, 6, __pyx_L1_error)
20898 
20899  /* "(tree fragment)":4
20900  * cdef object __pyx_PickleError
20901  * cdef object __pyx_result
20902  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
20903  * from pickle import PickleError as __pyx_PickleError
20904  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
20905  */
20906  }
20907 
20908  /* "(tree fragment)":7
20909  * from pickle import PickleError as __pyx_PickleError
20910  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
20911  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
20912  * if __pyx_state is not None:
20913  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20914  */
20915  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
20916  __Pyx_GOTREF(__pyx_t_1);
20917  __pyx_t_5 = NULL;
20918  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
20919  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
20920  if (likely(__pyx_t_5)) {
20921  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
20922  __Pyx_INCREF(__pyx_t_5);
20923  __Pyx_INCREF(function);
20924  __Pyx_DECREF_SET(__pyx_t_1, function);
20925  }
20926  }
20927  __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);
20928  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20929  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error)
20930  __Pyx_GOTREF(__pyx_t_4);
20931  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20932  __pyx_v___pyx_result = __pyx_t_4;
20933  __pyx_t_4 = 0;
20934 
20935  /* "(tree fragment)":8
20936  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
20937  * __pyx_result = Enum.__new__(__pyx_type)
20938  * if __pyx_state is not None: # <<<<<<<<<<<<<<
20939  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20940  * return __pyx_result
20941  */
20942  __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
20943  __pyx_t_2 = (__pyx_t_3 != 0);
20944  if (__pyx_t_2) {
20945 
20946  /* "(tree fragment)":9
20947  * __pyx_result = Enum.__new__(__pyx_type)
20948  * if __pyx_state is not None:
20949  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
20950  * return __pyx_result
20951  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20952  */
20953  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
20954  __pyx_t_4 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error)
20955  __Pyx_GOTREF(__pyx_t_4);
20956  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20957 
20958  /* "(tree fragment)":8
20959  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
20960  * __pyx_result = Enum.__new__(__pyx_type)
20961  * if __pyx_state is not None: # <<<<<<<<<<<<<<
20962  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20963  * return __pyx_result
20964  */
20965  }
20966 
20967  /* "(tree fragment)":10
20968  * if __pyx_state is not None:
20969  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20970  * return __pyx_result # <<<<<<<<<<<<<<
20971  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20972  * __pyx_result.name = __pyx_state[0]
20973  */
20974  __Pyx_XDECREF(__pyx_r);
20975  __Pyx_INCREF(__pyx_v___pyx_result);
20976  __pyx_r = __pyx_v___pyx_result;
20977  goto __pyx_L0;
20978 
20979  /* "(tree fragment)":1
20980  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
20981  * cdef object __pyx_PickleError
20982  * cdef object __pyx_result
20983  */
20984 
20985  /* function exit code */
20986  __pyx_L1_error:;
20987  __Pyx_XDECREF(__pyx_t_1);
20988  __Pyx_XDECREF(__pyx_t_4);
20989  __Pyx_XDECREF(__pyx_t_5);
20990  __Pyx_XDECREF(__pyx_t_6);
20991  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20992  __pyx_r = NULL;
20993  __pyx_L0:;
20994  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
20995  __Pyx_XDECREF(__pyx_v___pyx_result);
20996  __Pyx_XGIVEREF(__pyx_r);
20997  __Pyx_RefNannyFinishContext();
20998  return __pyx_r;
20999 }
21000 
21001 /* "(tree fragment)":11
21002  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21003  * return __pyx_result
21004  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21005  * __pyx_result.name = __pyx_state[0]
21006  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21007  */
21008 
21009 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
21010  PyObject *__pyx_r = NULL;
21011  __Pyx_RefNannyDeclarations
21012  PyObject *__pyx_t_1 = NULL;
21013  int __pyx_t_2;
21014  Py_ssize_t __pyx_t_3;
21015  int __pyx_t_4;
21016  int __pyx_t_5;
21017  PyObject *__pyx_t_6 = NULL;
21018  PyObject *__pyx_t_7 = NULL;
21019  PyObject *__pyx_t_8 = NULL;
21020  int __pyx_lineno = 0;
21021  const char *__pyx_filename = NULL;
21022  int __pyx_clineno = 0;
21023  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
21024 
21025  /* "(tree fragment)":12
21026  * return __pyx_result
21027  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21028  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
21029  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21030  * __pyx_result.__dict__.update(__pyx_state[1])
21031  */
21032  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21033  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21034  __PYX_ERR(1, 12, __pyx_L1_error)
21035  }
21036  __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(1, 12, __pyx_L1_error)
21037  __Pyx_GOTREF(__pyx_t_1);
21038  __Pyx_GIVEREF(__pyx_t_1);
21039  __Pyx_GOTREF(__pyx_v___pyx_result->name);
21040  __Pyx_DECREF(__pyx_v___pyx_result->name);
21041  __pyx_v___pyx_result->name = __pyx_t_1;
21042  __pyx_t_1 = 0;
21043 
21044  /* "(tree fragment)":13
21045  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21046  * __pyx_result.name = __pyx_state[0]
21047  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21048  * __pyx_result.__dict__.update(__pyx_state[1])
21049  */
21050  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21051  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
21052  __PYX_ERR(1, 13, __pyx_L1_error)
21053  }
21054  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21055  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
21056  if (__pyx_t_4) {
21057  } else {
21058  __pyx_t_2 = __pyx_t_4;
21059  goto __pyx_L4_bool_binop_done;
21060  }
21061  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
21062  __pyx_t_5 = (__pyx_t_4 != 0);
21063  __pyx_t_2 = __pyx_t_5;
21064  __pyx_L4_bool_binop_done:;
21065  if (__pyx_t_2) {
21066 
21067  /* "(tree fragment)":14
21068  * __pyx_result.name = __pyx_state[0]
21069  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21070  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
21071  */
21072  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
21073  __Pyx_GOTREF(__pyx_t_6);
21074  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
21075  __Pyx_GOTREF(__pyx_t_7);
21076  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21077  if (unlikely(__pyx_v___pyx_state == Py_None)) {
21078  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
21079  __PYX_ERR(1, 14, __pyx_L1_error)
21080  }
21081  __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(1, 14, __pyx_L1_error)
21082  __Pyx_GOTREF(__pyx_t_6);
21083  __pyx_t_8 = NULL;
21084  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
21085  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
21086  if (likely(__pyx_t_8)) {
21087  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
21088  __Pyx_INCREF(__pyx_t_8);
21089  __Pyx_INCREF(function);
21090  __Pyx_DECREF_SET(__pyx_t_7, function);
21091  }
21092  }
21093  __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);
21094  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21095  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21096  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
21097  __Pyx_GOTREF(__pyx_t_1);
21098  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21099  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21100 
21101  /* "(tree fragment)":13
21102  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
21103  * __pyx_result.name = __pyx_state[0]
21104  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
21105  * __pyx_result.__dict__.update(__pyx_state[1])
21106  */
21107  }
21108 
21109  /* "(tree fragment)":11
21110  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
21111  * return __pyx_result
21112  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
21113  * __pyx_result.name = __pyx_state[0]
21114  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
21115  */
21116 
21117  /* function exit code */
21118  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21119  goto __pyx_L0;
21120  __pyx_L1_error:;
21121  __Pyx_XDECREF(__pyx_t_1);
21122  __Pyx_XDECREF(__pyx_t_6);
21123  __Pyx_XDECREF(__pyx_t_7);
21124  __Pyx_XDECREF(__pyx_t_8);
21125  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21126  __pyx_r = 0;
21127  __pyx_L0:;
21128  __Pyx_XGIVEREF(__pyx_r);
21129  __Pyx_RefNannyFinishContext();
21130  return __pyx_r;
21131 }
21132 
21133 static PyObject *__pyx_tp_new_10csmoothers_cASMFactor(PyTypeObject *t, PyObject *a, PyObject *k) {
21134  PyObject *o;
21135  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21136  o = (*t->tp_alloc)(t, 0);
21137  } else {
21138  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21139  }
21140  if (unlikely(!o)) return 0;
21141  if (unlikely(__pyx_pw_10csmoothers_10cASMFactor_1__cinit__(o, a, k) < 0)) goto bad;
21142  return o;
21143  bad:
21144  Py_DECREF(o); o = 0;
21145  return NULL;
21146 }
21147 
21148 static void __pyx_tp_dealloc_10csmoothers_cASMFactor(PyObject *o) {
21149  #if CYTHON_USE_TP_FINALIZE
21150  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))) {
21151  if (PyObject_CallFinalizerFromDealloc(o)) return;
21152  }
21153  #endif
21154  {
21155  PyObject *etype, *eval, *etb;
21156  PyErr_Fetch(&etype, &eval, &etb);
21157  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21158  __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(o);
21159  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21160  PyErr_Restore(etype, eval, etb);
21161  }
21162  (*Py_TYPE(o)->tp_free)(o);
21163 }
21164 
21165 static PyMethodDef __pyx_methods_10csmoothers_cASMFactor[] = {
21166  {"__reduce_cython__", (PyCFunction)__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__, METH_NOARGS, 0},
21167  {"__setstate_cython__", (PyCFunction)__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__, METH_O, 0},
21168  {0, 0, 0, 0}
21169 };
21170 
21171 static PyTypeObject __pyx_type_10csmoothers_cASMFactor = {
21172  PyVarObject_HEAD_INIT(0, 0)
21173  "csmoothers.cASMFactor", /*tp_name*/
21174  sizeof(struct __pyx_obj_10csmoothers_cASMFactor), /*tp_basicsize*/
21175  0, /*tp_itemsize*/
21176  __pyx_tp_dealloc_10csmoothers_cASMFactor, /*tp_dealloc*/
21177  #if PY_VERSION_HEX < 0x030800b4
21178  0, /*tp_print*/
21179  #endif
21180  #if PY_VERSION_HEX >= 0x030800b4
21181  0, /*tp_vectorcall_offset*/
21182  #endif
21183  0, /*tp_getattr*/
21184  0, /*tp_setattr*/
21185  #if PY_MAJOR_VERSION < 3
21186  0, /*tp_compare*/
21187  #endif
21188  #if PY_MAJOR_VERSION >= 3
21189  0, /*tp_as_async*/
21190  #endif
21191  0, /*tp_repr*/
21192  0, /*tp_as_number*/
21193  0, /*tp_as_sequence*/
21194  0, /*tp_as_mapping*/
21195  0, /*tp_hash*/
21196  0, /*tp_call*/
21197  0, /*tp_str*/
21198  0, /*tp_getattro*/
21199  0, /*tp_setattro*/
21200  0, /*tp_as_buffer*/
21201  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
21202  0, /*tp_doc*/
21203  0, /*tp_traverse*/
21204  0, /*tp_clear*/
21205  0, /*tp_richcompare*/
21206  0, /*tp_weaklistoffset*/
21207  0, /*tp_iter*/
21208  0, /*tp_iternext*/
21209  __pyx_methods_10csmoothers_cASMFactor, /*tp_methods*/
21210  0, /*tp_members*/
21211  0, /*tp_getset*/
21212  0, /*tp_base*/
21213  0, /*tp_dict*/
21214  0, /*tp_descr_get*/
21215  0, /*tp_descr_set*/
21216  0, /*tp_dictoffset*/
21217  0, /*tp_init*/
21218  0, /*tp_alloc*/
21219  __pyx_tp_new_10csmoothers_cASMFactor, /*tp_new*/
21220  0, /*tp_free*/
21221  0, /*tp_is_gc*/
21222  0, /*tp_bases*/
21223  0, /*tp_mro*/
21224  0, /*tp_cache*/
21225  0, /*tp_subclasses*/
21226  0, /*tp_weaklist*/
21227  0, /*tp_del*/
21228  0, /*tp_version_tag*/
21229  #if PY_VERSION_HEX >= 0x030400a1
21230  0, /*tp_finalize*/
21231  #endif
21232  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21233  0, /*tp_vectorcall*/
21234  #endif
21235  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21236  0, /*tp_print*/
21237  #endif
21238  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
21239  0, /*tp_pypy_flags*/
21240  #endif
21241 };
21242 
21243 static PyObject *__pyx_tp_new_10csmoothers_cBASMFactor(PyTypeObject *t, PyObject *a, PyObject *k) {
21244  PyObject *o;
21245  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21246  o = (*t->tp_alloc)(t, 0);
21247  } else {
21248  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21249  }
21250  if (unlikely(!o)) return 0;
21251  if (unlikely(__pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(o, a, k) < 0)) goto bad;
21252  return o;
21253  bad:
21254  Py_DECREF(o); o = 0;
21255  return NULL;
21256 }
21257 
21258 static void __pyx_tp_dealloc_10csmoothers_cBASMFactor(PyObject *o) {
21259  #if CYTHON_USE_TP_FINALIZE
21260  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))) {
21261  if (PyObject_CallFinalizerFromDealloc(o)) return;
21262  }
21263  #endif
21264  {
21265  PyObject *etype, *eval, *etb;
21266  PyErr_Fetch(&etype, &eval, &etb);
21267  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21268  __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(o);
21269  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21270  PyErr_Restore(etype, eval, etb);
21271  }
21272  (*Py_TYPE(o)->tp_free)(o);
21273 }
21274 
21275 static PyMethodDef __pyx_methods_10csmoothers_cBASMFactor[] = {
21276  {"__reduce_cython__", (PyCFunction)__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__, METH_NOARGS, 0},
21277  {"__setstate_cython__", (PyCFunction)__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__, METH_O, 0},
21278  {0, 0, 0, 0}
21279 };
21280 
21281 static PyTypeObject __pyx_type_10csmoothers_cBASMFactor = {
21282  PyVarObject_HEAD_INIT(0, 0)
21283  "csmoothers.cBASMFactor", /*tp_name*/
21284  sizeof(struct __pyx_obj_10csmoothers_cBASMFactor), /*tp_basicsize*/
21285  0, /*tp_itemsize*/
21286  __pyx_tp_dealloc_10csmoothers_cBASMFactor, /*tp_dealloc*/
21287  #if PY_VERSION_HEX < 0x030800b4
21288  0, /*tp_print*/
21289  #endif
21290  #if PY_VERSION_HEX >= 0x030800b4
21291  0, /*tp_vectorcall_offset*/
21292  #endif
21293  0, /*tp_getattr*/
21294  0, /*tp_setattr*/
21295  #if PY_MAJOR_VERSION < 3
21296  0, /*tp_compare*/
21297  #endif
21298  #if PY_MAJOR_VERSION >= 3
21299  0, /*tp_as_async*/
21300  #endif
21301  0, /*tp_repr*/
21302  0, /*tp_as_number*/
21303  0, /*tp_as_sequence*/
21304  0, /*tp_as_mapping*/
21305  0, /*tp_hash*/
21306  0, /*tp_call*/
21307  0, /*tp_str*/
21308  0, /*tp_getattro*/
21309  0, /*tp_setattro*/
21310  0, /*tp_as_buffer*/
21311  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
21312  0, /*tp_doc*/
21313  0, /*tp_traverse*/
21314  0, /*tp_clear*/
21315  0, /*tp_richcompare*/
21316  0, /*tp_weaklistoffset*/
21317  0, /*tp_iter*/
21318  0, /*tp_iternext*/
21319  __pyx_methods_10csmoothers_cBASMFactor, /*tp_methods*/
21320  0, /*tp_members*/
21321  0, /*tp_getset*/
21322  0, /*tp_base*/
21323  0, /*tp_dict*/
21324  0, /*tp_descr_get*/
21325  0, /*tp_descr_set*/
21326  0, /*tp_dictoffset*/
21327  0, /*tp_init*/
21328  0, /*tp_alloc*/
21329  __pyx_tp_new_10csmoothers_cBASMFactor, /*tp_new*/
21330  0, /*tp_free*/
21331  0, /*tp_is_gc*/
21332  0, /*tp_bases*/
21333  0, /*tp_mro*/
21334  0, /*tp_cache*/
21335  0, /*tp_subclasses*/
21336  0, /*tp_weaklist*/
21337  0, /*tp_del*/
21338  0, /*tp_version_tag*/
21339  #if PY_VERSION_HEX >= 0x030400a1
21340  0, /*tp_finalize*/
21341  #endif
21342  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21343  0, /*tp_vectorcall*/
21344  #endif
21345  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21346  0, /*tp_print*/
21347  #endif
21348  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
21349  0, /*tp_pypy_flags*/
21350  #endif
21351 };
21352 static struct __pyx_vtabstruct_array __pyx_vtable_array;
21353 
21354 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
21355  struct __pyx_array_obj *p;
21356  PyObject *o;
21357  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21358  o = (*t->tp_alloc)(t, 0);
21359  } else {
21360  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21361  }
21362  if (unlikely(!o)) return 0;
21363  p = ((struct __pyx_array_obj *)o);
21364  p->__pyx_vtab = __pyx_vtabptr_array;
21365  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
21366  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
21367  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
21368  return o;
21369  bad:
21370  Py_DECREF(o); o = 0;
21371  return NULL;
21372 }
21373 
21374 static void __pyx_tp_dealloc_array(PyObject *o) {
21375  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
21376  #if CYTHON_USE_TP_FINALIZE
21377  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))) {
21378  if (PyObject_CallFinalizerFromDealloc(o)) return;
21379  }
21380  #endif
21381  {
21382  PyObject *etype, *eval, *etb;
21383  PyErr_Fetch(&etype, &eval, &etb);
21384  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21385  __pyx_array___dealloc__(o);
21386  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21387  PyErr_Restore(etype, eval, etb);
21388  }
21389  Py_CLEAR(p->mode);
21390  Py_CLEAR(p->_format);
21391  (*Py_TYPE(o)->tp_free)(o);
21392 }
21393 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
21394  PyObject *r;
21395  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
21396  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21397  Py_DECREF(x);
21398  return r;
21399 }
21400 
21401 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
21402  if (v) {
21403  return __pyx_array___setitem__(o, i, v);
21404  }
21405  else {
21406  PyErr_Format(PyExc_NotImplementedError,
21407  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21408  return -1;
21409  }
21410 }
21411 
21412 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
21413  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
21414  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
21415  PyErr_Clear();
21416  v = __pyx_array___getattr__(o, n);
21417  }
21418  return v;
21419 }
21420 
21421 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
21422  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
21423 }
21424 
21425 static PyMethodDef __pyx_methods_array[] = {
21426  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
21427  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
21428  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
21429  {0, 0, 0, 0}
21430 };
21431 
21432 static struct PyGetSetDef __pyx_getsets_array[] = {
21433  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
21434  {0, 0, 0, 0, 0}
21435 };
21436 
21437 static PySequenceMethods __pyx_tp_as_sequence_array = {
21438  __pyx_array___len__, /*sq_length*/
21439  0, /*sq_concat*/
21440  0, /*sq_repeat*/
21441  __pyx_sq_item_array, /*sq_item*/
21442  0, /*sq_slice*/
21443  0, /*sq_ass_item*/
21444  0, /*sq_ass_slice*/
21445  0, /*sq_contains*/
21446  0, /*sq_inplace_concat*/
21447  0, /*sq_inplace_repeat*/
21448 };
21449 
21450 static PyMappingMethods __pyx_tp_as_mapping_array = {
21451  __pyx_array___len__, /*mp_length*/
21452  __pyx_array___getitem__, /*mp_subscript*/
21453  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
21454 };
21455 
21456 static PyBufferProcs __pyx_tp_as_buffer_array = {
21457  #if PY_MAJOR_VERSION < 3
21458  0, /*bf_getreadbuffer*/
21459  #endif
21460  #if PY_MAJOR_VERSION < 3
21461  0, /*bf_getwritebuffer*/
21462  #endif
21463  #if PY_MAJOR_VERSION < 3
21464  0, /*bf_getsegcount*/
21465  #endif
21466  #if PY_MAJOR_VERSION < 3
21467  0, /*bf_getcharbuffer*/
21468  #endif
21469  __pyx_array_getbuffer, /*bf_getbuffer*/
21470  0, /*bf_releasebuffer*/
21471 };
21472 
21473 static PyTypeObject __pyx_type___pyx_array = {
21474  PyVarObject_HEAD_INIT(0, 0)
21475  "csmoothers.array", /*tp_name*/
21476  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
21477  0, /*tp_itemsize*/
21478  __pyx_tp_dealloc_array, /*tp_dealloc*/
21479  #if PY_VERSION_HEX < 0x030800b4
21480  0, /*tp_print*/
21481  #endif
21482  #if PY_VERSION_HEX >= 0x030800b4
21483  0, /*tp_vectorcall_offset*/
21484  #endif
21485  0, /*tp_getattr*/
21486  0, /*tp_setattr*/
21487  #if PY_MAJOR_VERSION < 3
21488  0, /*tp_compare*/
21489  #endif
21490  #if PY_MAJOR_VERSION >= 3
21491  0, /*tp_as_async*/
21492  #endif
21493  0, /*tp_repr*/
21494  0, /*tp_as_number*/
21495  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
21496  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
21497  0, /*tp_hash*/
21498  0, /*tp_call*/
21499  0, /*tp_str*/
21500  __pyx_tp_getattro_array, /*tp_getattro*/
21501  0, /*tp_setattro*/
21502  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
21503  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
21504  0, /*tp_doc*/
21505  0, /*tp_traverse*/
21506  0, /*tp_clear*/
21507  0, /*tp_richcompare*/
21508  0, /*tp_weaklistoffset*/
21509  0, /*tp_iter*/
21510  0, /*tp_iternext*/
21511  __pyx_methods_array, /*tp_methods*/
21512  0, /*tp_members*/
21513  __pyx_getsets_array, /*tp_getset*/
21514  0, /*tp_base*/
21515  0, /*tp_dict*/
21516  0, /*tp_descr_get*/
21517  0, /*tp_descr_set*/
21518  0, /*tp_dictoffset*/
21519  0, /*tp_init*/
21520  0, /*tp_alloc*/
21521  __pyx_tp_new_array, /*tp_new*/
21522  0, /*tp_free*/
21523  0, /*tp_is_gc*/
21524  0, /*tp_bases*/
21525  0, /*tp_mro*/
21526  0, /*tp_cache*/
21527  0, /*tp_subclasses*/
21528  0, /*tp_weaklist*/
21529  0, /*tp_del*/
21530  0, /*tp_version_tag*/
21531  #if PY_VERSION_HEX >= 0x030400a1
21532  0, /*tp_finalize*/
21533  #endif
21534  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21535  0, /*tp_vectorcall*/
21536  #endif
21537  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21538  0, /*tp_print*/
21539  #endif
21540  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
21541  0, /*tp_pypy_flags*/
21542  #endif
21543 };
21544 
21545 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21546  struct __pyx_MemviewEnum_obj *p;
21547  PyObject *o;
21548  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21549  o = (*t->tp_alloc)(t, 0);
21550  } else {
21551  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21552  }
21553  if (unlikely(!o)) return 0;
21554  p = ((struct __pyx_MemviewEnum_obj *)o);
21555  p->name = Py_None; Py_INCREF(Py_None);
21556  return o;
21557 }
21558 
21559 static void __pyx_tp_dealloc_Enum(PyObject *o) {
21560  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21561  #if CYTHON_USE_TP_FINALIZE
21562  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21563  if (PyObject_CallFinalizerFromDealloc(o)) return;
21564  }
21565  #endif
21566  PyObject_GC_UnTrack(o);
21567  Py_CLEAR(p->name);
21568  (*Py_TYPE(o)->tp_free)(o);
21569 }
21570 
21571 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
21572  int e;
21573  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21574  if (p->name) {
21575  e = (*v)(p->name, a); if (e) return e;
21576  }
21577  return 0;
21578 }
21579 
21580 static int __pyx_tp_clear_Enum(PyObject *o) {
21581  PyObject* tmp;
21582  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21583  tmp = ((PyObject*)p->name);
21584  p->name = Py_None; Py_INCREF(Py_None);
21585  Py_XDECREF(tmp);
21586  return 0;
21587 }
21588 
21589 static PyMethodDef __pyx_methods_Enum[] = {
21590  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
21591  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
21592  {0, 0, 0, 0}
21593 };
21594 
21595 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
21596  PyVarObject_HEAD_INIT(0, 0)
21597  "csmoothers.Enum", /*tp_name*/
21598  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
21599  0, /*tp_itemsize*/
21600  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
21601  #if PY_VERSION_HEX < 0x030800b4
21602  0, /*tp_print*/
21603  #endif
21604  #if PY_VERSION_HEX >= 0x030800b4
21605  0, /*tp_vectorcall_offset*/
21606  #endif
21607  0, /*tp_getattr*/
21608  0, /*tp_setattr*/
21609  #if PY_MAJOR_VERSION < 3
21610  0, /*tp_compare*/
21611  #endif
21612  #if PY_MAJOR_VERSION >= 3
21613  0, /*tp_as_async*/
21614  #endif
21615  __pyx_MemviewEnum___repr__, /*tp_repr*/
21616  0, /*tp_as_number*/
21617  0, /*tp_as_sequence*/
21618  0, /*tp_as_mapping*/
21619  0, /*tp_hash*/
21620  0, /*tp_call*/
21621  0, /*tp_str*/
21622  0, /*tp_getattro*/
21623  0, /*tp_setattro*/
21624  0, /*tp_as_buffer*/
21625  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21626  0, /*tp_doc*/
21627  __pyx_tp_traverse_Enum, /*tp_traverse*/
21628  __pyx_tp_clear_Enum, /*tp_clear*/
21629  0, /*tp_richcompare*/
21630  0, /*tp_weaklistoffset*/
21631  0, /*tp_iter*/
21632  0, /*tp_iternext*/
21633  __pyx_methods_Enum, /*tp_methods*/
21634  0, /*tp_members*/
21635  0, /*tp_getset*/
21636  0, /*tp_base*/
21637  0, /*tp_dict*/
21638  0, /*tp_descr_get*/
21639  0, /*tp_descr_set*/
21640  0, /*tp_dictoffset*/
21641  __pyx_MemviewEnum___init__, /*tp_init*/
21642  0, /*tp_alloc*/
21643  __pyx_tp_new_Enum, /*tp_new*/
21644  0, /*tp_free*/
21645  0, /*tp_is_gc*/
21646  0, /*tp_bases*/
21647  0, /*tp_mro*/
21648  0, /*tp_cache*/
21649  0, /*tp_subclasses*/
21650  0, /*tp_weaklist*/
21651  0, /*tp_del*/
21652  0, /*tp_version_tag*/
21653  #if PY_VERSION_HEX >= 0x030400a1
21654  0, /*tp_finalize*/
21655  #endif
21656  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21657  0, /*tp_vectorcall*/
21658  #endif
21659  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21660  0, /*tp_print*/
21661  #endif
21662  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
21663  0, /*tp_pypy_flags*/
21664  #endif
21665 };
21666 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
21667 
21668 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
21669  struct __pyx_memoryview_obj *p;
21670  PyObject *o;
21671  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21672  o = (*t->tp_alloc)(t, 0);
21673  } else {
21674  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21675  }
21676  if (unlikely(!o)) return 0;
21677  p = ((struct __pyx_memoryview_obj *)o);
21678  p->__pyx_vtab = __pyx_vtabptr_memoryview;
21679  p->obj = Py_None; Py_INCREF(Py_None);
21680  p->_size = Py_None; Py_INCREF(Py_None);
21681  p->_array_interface = Py_None; Py_INCREF(Py_None);
21682  p->view.obj = NULL;
21683  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
21684  return o;
21685  bad:
21686  Py_DECREF(o); o = 0;
21687  return NULL;
21688 }
21689 
21690 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
21691  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21692  #if CYTHON_USE_TP_FINALIZE
21693  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21694  if (PyObject_CallFinalizerFromDealloc(o)) return;
21695  }
21696  #endif
21697  PyObject_GC_UnTrack(o);
21698  {
21699  PyObject *etype, *eval, *etb;
21700  PyErr_Fetch(&etype, &eval, &etb);
21701  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21702  __pyx_memoryview___dealloc__(o);
21703  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21704  PyErr_Restore(etype, eval, etb);
21705  }
21706  Py_CLEAR(p->obj);
21707  Py_CLEAR(p->_size);
21708  Py_CLEAR(p->_array_interface);
21709  (*Py_TYPE(o)->tp_free)(o);
21710 }
21711 
21712 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
21713  int e;
21714  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21715  if (p->obj) {
21716  e = (*v)(p->obj, a); if (e) return e;
21717  }
21718  if (p->_size) {
21719  e = (*v)(p->_size, a); if (e) return e;
21720  }
21721  if (p->_array_interface) {
21722  e = (*v)(p->_array_interface, a); if (e) return e;
21723  }
21724  if (p->view.obj) {
21725  e = (*v)(p->view.obj, a); if (e) return e;
21726  }
21727  return 0;
21728 }
21729 
21730 static int __pyx_tp_clear_memoryview(PyObject *o) {
21731  PyObject* tmp;
21732  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21733  tmp = ((PyObject*)p->obj);
21734  p->obj = Py_None; Py_INCREF(Py_None);
21735  Py_XDECREF(tmp);
21736  tmp = ((PyObject*)p->_size);
21737  p->_size = Py_None; Py_INCREF(Py_None);
21738  Py_XDECREF(tmp);
21739  tmp = ((PyObject*)p->_array_interface);
21740  p->_array_interface = Py_None; Py_INCREF(Py_None);
21741  Py_XDECREF(tmp);
21742  Py_CLEAR(p->view.obj);
21743  return 0;
21744 }
21745 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
21746  PyObject *r;
21747  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
21748  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21749  Py_DECREF(x);
21750  return r;
21751 }
21752 
21753 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
21754  if (v) {
21755  return __pyx_memoryview___setitem__(o, i, v);
21756  }
21757  else {
21758  PyErr_Format(PyExc_NotImplementedError,
21759  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21760  return -1;
21761  }
21762 }
21763 
21764 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
21765  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
21766 }
21767 
21768 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
21769  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
21770 }
21771 
21772 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
21773  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
21774 }
21775 
21776 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
21777  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
21778 }
21779 
21780 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
21781  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
21782 }
21783 
21784 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
21785  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
21786 }
21787 
21788 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
21789  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
21790 }
21791 
21792 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
21793  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
21794 }
21795 
21796 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
21797  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
21798 }
21799 
21800 static PyMethodDef __pyx_methods_memoryview[] = {
21801  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
21802  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
21803  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
21804  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
21805  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
21806  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
21807  {0, 0, 0, 0}
21808 };
21809 
21810 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
21811  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
21812  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
21813  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
21814  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
21815  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
21816  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
21817  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
21818  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
21819  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
21820  {0, 0, 0, 0, 0}
21821 };
21822 
21823 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
21824  __pyx_memoryview___len__, /*sq_length*/
21825  0, /*sq_concat*/
21826  0, /*sq_repeat*/
21827  __pyx_sq_item_memoryview, /*sq_item*/
21828  0, /*sq_slice*/
21829  0, /*sq_ass_item*/
21830  0, /*sq_ass_slice*/
21831  0, /*sq_contains*/
21832  0, /*sq_inplace_concat*/
21833  0, /*sq_inplace_repeat*/
21834 };
21835 
21836 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
21837  __pyx_memoryview___len__, /*mp_length*/
21838  __pyx_memoryview___getitem__, /*mp_subscript*/
21839  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
21840 };
21841 
21842 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
21843  #if PY_MAJOR_VERSION < 3
21844  0, /*bf_getreadbuffer*/
21845  #endif
21846  #if PY_MAJOR_VERSION < 3
21847  0, /*bf_getwritebuffer*/
21848  #endif
21849  #if PY_MAJOR_VERSION < 3
21850  0, /*bf_getsegcount*/
21851  #endif
21852  #if PY_MAJOR_VERSION < 3
21853  0, /*bf_getcharbuffer*/
21854  #endif
21855  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
21856  0, /*bf_releasebuffer*/
21857 };
21858 
21859 static PyTypeObject __pyx_type___pyx_memoryview = {
21860  PyVarObject_HEAD_INIT(0, 0)
21861  "csmoothers.memoryview", /*tp_name*/
21862  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
21863  0, /*tp_itemsize*/
21864  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
21865  #if PY_VERSION_HEX < 0x030800b4
21866  0, /*tp_print*/
21867  #endif
21868  #if PY_VERSION_HEX >= 0x030800b4
21869  0, /*tp_vectorcall_offset*/
21870  #endif
21871  0, /*tp_getattr*/
21872  0, /*tp_setattr*/
21873  #if PY_MAJOR_VERSION < 3
21874  0, /*tp_compare*/
21875  #endif
21876  #if PY_MAJOR_VERSION >= 3
21877  0, /*tp_as_async*/
21878  #endif
21879  __pyx_memoryview___repr__, /*tp_repr*/
21880  0, /*tp_as_number*/
21881  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
21882  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
21883  0, /*tp_hash*/
21884  0, /*tp_call*/
21885  __pyx_memoryview___str__, /*tp_str*/
21886  0, /*tp_getattro*/
21887  0, /*tp_setattro*/
21888  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
21889  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21890  0, /*tp_doc*/
21891  __pyx_tp_traverse_memoryview, /*tp_traverse*/
21892  __pyx_tp_clear_memoryview, /*tp_clear*/
21893  0, /*tp_richcompare*/
21894  0, /*tp_weaklistoffset*/
21895  0, /*tp_iter*/
21896  0, /*tp_iternext*/
21897  __pyx_methods_memoryview, /*tp_methods*/
21898  0, /*tp_members*/
21899  __pyx_getsets_memoryview, /*tp_getset*/
21900  0, /*tp_base*/
21901  0, /*tp_dict*/
21902  0, /*tp_descr_get*/
21903  0, /*tp_descr_set*/
21904  0, /*tp_dictoffset*/
21905  0, /*tp_init*/
21906  0, /*tp_alloc*/
21907  __pyx_tp_new_memoryview, /*tp_new*/
21908  0, /*tp_free*/
21909  0, /*tp_is_gc*/
21910  0, /*tp_bases*/
21911  0, /*tp_mro*/
21912  0, /*tp_cache*/
21913  0, /*tp_subclasses*/
21914  0, /*tp_weaklist*/
21915  0, /*tp_del*/
21916  0, /*tp_version_tag*/
21917  #if PY_VERSION_HEX >= 0x030400a1
21918  0, /*tp_finalize*/
21919  #endif
21920  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
21921  0, /*tp_vectorcall*/
21922  #endif
21923  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21924  0, /*tp_print*/
21925  #endif
21926  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
21927  0, /*tp_pypy_flags*/
21928  #endif
21929 };
21930 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
21931 
21932 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
21933  struct __pyx_memoryviewslice_obj *p;
21934  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
21935  if (unlikely(!o)) return 0;
21936  p = ((struct __pyx_memoryviewslice_obj *)o);
21937  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
21938  p->from_object = Py_None; Py_INCREF(Py_None);
21939  p->from_slice.memview = NULL;
21940  return o;
21941 }
21942 
21943 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
21944  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
21945  #if CYTHON_USE_TP_FINALIZE
21946  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21947  if (PyObject_CallFinalizerFromDealloc(o)) return;
21948  }
21949  #endif
21950  PyObject_GC_UnTrack(o);
21951  {
21952  PyObject *etype, *eval, *etb;
21953  PyErr_Fetch(&etype, &eval, &etb);
21954  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21955  __pyx_memoryviewslice___dealloc__(o);
21956  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21957  PyErr_Restore(etype, eval, etb);
21958  }
21959  Py_CLEAR(p->from_object);
21960  PyObject_GC_Track(o);
21961  __pyx_tp_dealloc_memoryview(o);
21962 }
21963 
21964 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
21965  int e;
21966  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
21967  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
21968  if (p->from_object) {
21969  e = (*v)(p->from_object, a); if (e) return e;
21970  }
21971  return 0;
21972 }
21973 
21974 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
21975  PyObject* tmp;
21976  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
21977  __pyx_tp_clear_memoryview(o);
21978  tmp = ((PyObject*)p->from_object);
21979  p->from_object = Py_None; Py_INCREF(Py_None);
21980  Py_XDECREF(tmp);
21981  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
21982  return 0;
21983 }
21984 
21985 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
21986  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
21987 }
21988 
21989 static PyMethodDef __pyx_methods__memoryviewslice[] = {
21990  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
21991  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
21992  {0, 0, 0, 0}
21993 };
21994 
21995 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
21996  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
21997  {0, 0, 0, 0, 0}
21998 };
21999 
22000 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
22001  PyVarObject_HEAD_INIT(0, 0)
22002  "csmoothers._memoryviewslice", /*tp_name*/
22003  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
22004  0, /*tp_itemsize*/
22005  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
22006  #if PY_VERSION_HEX < 0x030800b4
22007  0, /*tp_print*/
22008  #endif
22009  #if PY_VERSION_HEX >= 0x030800b4
22010  0, /*tp_vectorcall_offset*/
22011  #endif
22012  0, /*tp_getattr*/
22013  0, /*tp_setattr*/
22014  #if PY_MAJOR_VERSION < 3
22015  0, /*tp_compare*/
22016  #endif
22017  #if PY_MAJOR_VERSION >= 3
22018  0, /*tp_as_async*/
22019  #endif
22020  #if CYTHON_COMPILING_IN_PYPY
22021  __pyx_memoryview___repr__, /*tp_repr*/
22022  #else
22023  0, /*tp_repr*/
22024  #endif
22025  0, /*tp_as_number*/
22026  0, /*tp_as_sequence*/
22027  0, /*tp_as_mapping*/
22028  0, /*tp_hash*/
22029  0, /*tp_call*/
22030  #if CYTHON_COMPILING_IN_PYPY
22031  __pyx_memoryview___str__, /*tp_str*/
22032  #else
22033  0, /*tp_str*/
22034  #endif
22035  0, /*tp_getattro*/
22036  0, /*tp_setattro*/
22037  0, /*tp_as_buffer*/
22038  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
22039  "Internal class for passing memoryview slices to Python", /*tp_doc*/
22040  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
22041  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
22042  0, /*tp_richcompare*/
22043  0, /*tp_weaklistoffset*/
22044  0, /*tp_iter*/
22045  0, /*tp_iternext*/
22046  __pyx_methods__memoryviewslice, /*tp_methods*/
22047  0, /*tp_members*/
22048  __pyx_getsets__memoryviewslice, /*tp_getset*/
22049  0, /*tp_base*/
22050  0, /*tp_dict*/
22051  0, /*tp_descr_get*/
22052  0, /*tp_descr_set*/
22053  0, /*tp_dictoffset*/
22054  0, /*tp_init*/
22055  0, /*tp_alloc*/
22056  __pyx_tp_new__memoryviewslice, /*tp_new*/
22057  0, /*tp_free*/
22058  0, /*tp_is_gc*/
22059  0, /*tp_bases*/
22060  0, /*tp_mro*/
22061  0, /*tp_cache*/
22062  0, /*tp_subclasses*/
22063  0, /*tp_weaklist*/
22064  0, /*tp_del*/
22065  0, /*tp_version_tag*/
22066  #if PY_VERSION_HEX >= 0x030400a1
22067  0, /*tp_finalize*/
22068  #endif
22069  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
22070  0, /*tp_vectorcall*/
22071  #endif
22072  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
22073  0, /*tp_print*/
22074  #endif
22075  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
22076  0, /*tp_pypy_flags*/
22077  #endif
22078 };
22079 
22080 static PyMethodDef __pyx_methods[] = {
22081  {0, 0, 0, 0}
22082 };
22083 
22084 #if PY_MAJOR_VERSION >= 3
22085 #if CYTHON_PEP489_MULTI_PHASE_INIT
22086 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
22087 static int __pyx_pymod_exec_csmoothers(PyObject* module); /*proto*/
22088 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
22089  {Py_mod_create, (void*)__pyx_pymod_create},
22090  {Py_mod_exec, (void*)__pyx_pymod_exec_csmoothers},
22091  {0, NULL}
22092 };
22093 #endif
22094 
22095 static struct PyModuleDef __pyx_moduledef = {
22096  PyModuleDef_HEAD_INIT,
22097  "csmoothers",
22098  0, /* m_doc */
22099  #if CYTHON_PEP489_MULTI_PHASE_INIT
22100  0, /* m_size */
22101  #else
22102  -1, /* m_size */
22103  #endif
22104  __pyx_methods /* m_methods */,
22105  #if CYTHON_PEP489_MULTI_PHASE_INIT
22106  __pyx_moduledef_slots, /* m_slots */
22107  #else
22108  NULL, /* m_reload */
22109  #endif
22110  NULL, /* m_traverse */
22111  NULL, /* m_clear */
22112  NULL /* m_free */
22113 };
22114 #endif
22115 #ifndef CYTHON_SMALL_CODE
22116 #if defined(__clang__)
22117  #define CYTHON_SMALL_CODE
22118 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
22119  #define CYTHON_SMALL_CODE __attribute__((cold))
22120 #else
22121  #define CYTHON_SMALL_CODE
22122 #endif
22123 #endif
22124 
22125 static __Pyx_StringTabEntry __pyx_string_tab[] = {
22126  {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1},
22127  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
22128  {&__pyx_n_s_ASMFactor, __pyx_k_ASMFactor, sizeof(__pyx_k_ASMFactor), 0, 0, 1, 1},
22129  {&__pyx_n_s_ASMFactor___init, __pyx_k_ASMFactor___init, sizeof(__pyx_k_ASMFactor___init), 0, 0, 1, 1},
22130  {&__pyx_n_s_BASMFactor, __pyx_k_BASMFactor, sizeof(__pyx_k_BASMFactor), 0, 0, 1, 1},
22131  {&__pyx_n_s_BASMFactor___init, __pyx_k_BASMFactor___init, sizeof(__pyx_k_BASMFactor___init), 0, 0, 1, 1},
22132  {&__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},
22133  {&__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},
22134  {&__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},
22135  {&__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},
22136  {&__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},
22137  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
22138  {&__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},
22139  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
22140  {&__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},
22141  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
22142  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
22143  {&__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},
22144  {&__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},
22145  {&__pyx_n_s_L, __pyx_k_L, sizeof(__pyx_k_L), 0, 0, 1, 1},
22146  {&__pyx_n_s_M, __pyx_k_M, sizeof(__pyx_k_M), 0, 0, 1, 1},
22147  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
22148  {&__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},
22149  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
22150  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
22151  {&__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},
22152  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
22153  {&__pyx_n_s_R, __pyx_k_R, sizeof(__pyx_k_R), 0, 0, 1, 1},
22154  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
22155  {&__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},
22156  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
22157  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
22158  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
22159  {&__pyx_n_s_asmFactor, __pyx_k_asmFactor, sizeof(__pyx_k_asmFactor), 0, 0, 1, 1},
22160  {&__pyx_n_s_asm_NR_prepare, __pyx_k_asm_NR_prepare, sizeof(__pyx_k_asm_NR_prepare), 0, 0, 1, 1},
22161  {&__pyx_n_s_asm_NR_solve, __pyx_k_asm_NR_solve, sizeof(__pyx_k_asm_NR_solve), 0, 0, 1, 1},
22162  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
22163  {&__pyx_n_s_basmFactor, __pyx_k_basmFactor, sizeof(__pyx_k_basmFactor), 0, 0, 1, 1},
22164  {&__pyx_n_s_basm_NR_prepare, __pyx_k_basm_NR_prepare, sizeof(__pyx_k_basm_NR_prepare), 0, 0, 1, 1},
22165  {&__pyx_n_s_basm_NR_solve, __pyx_k_basm_NR_solve, sizeof(__pyx_k_basm_NR_solve), 0, 0, 1, 1},
22166  {&__pyx_n_s_bs, __pyx_k_bs, sizeof(__pyx_k_bs), 0, 0, 1, 1},
22167  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
22168  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
22169  {&__pyx_n_s_cASMFactor, __pyx_k_cASMFactor, sizeof(__pyx_k_cASMFactor), 0, 0, 1, 1},
22170  {&__pyx_n_s_cASMFactor_2, __pyx_k_cASMFactor_2, sizeof(__pyx_k_cASMFactor_2), 0, 0, 1, 1},
22171  {&__pyx_n_s_cBASMFactor, __pyx_k_cBASMFactor, sizeof(__pyx_k_cBASMFactor), 0, 0, 1, 1},
22172  {&__pyx_n_s_cBASMFactor_2, __pyx_k_cBASMFactor_2, sizeof(__pyx_k_cBASMFactor_2), 0, 0, 1, 1},
22173  {&__pyx_n_s_cSparseMatrix, __pyx_k_cSparseMatrix, sizeof(__pyx_k_cSparseMatrix), 0, 0, 1, 1},
22174  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
22175  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22176  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
22177  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
22178  {&__pyx_n_s_csmoothers, __pyx_k_csmoothers, sizeof(__pyx_k_csmoothers), 0, 0, 1, 1},
22179  {&__pyx_n_s_dX, __pyx_k_dX, sizeof(__pyx_k_dX), 0, 0, 1, 1},
22180  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
22181  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
22182  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
22183  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
22184  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
22185  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
22186  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
22187  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
22188  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
22189  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
22190  {&__pyx_n_s_gauss_seidel_NR_preare, __pyx_k_gauss_seidel_NR_preare, sizeof(__pyx_k_gauss_seidel_NR_preare), 0, 0, 1, 1},
22191  {&__pyx_n_s_gauss_seidel_NR_solve, __pyx_k_gauss_seidel_NR_solve, sizeof(__pyx_k_gauss_seidel_NR_solve), 0, 0, 1, 1},
22192  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
22193  {&__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},
22194  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
22195  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
22196  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
22197  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
22198  {&__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},
22199  {&__pyx_n_s_jacobi_NR_prepare, __pyx_k_jacobi_NR_prepare, sizeof(__pyx_k_jacobi_NR_prepare), 0, 0, 1, 1},
22200  {&__pyx_n_s_jacobi_NR_solve, __pyx_k_jacobi_NR_solve, sizeof(__pyx_k_jacobi_NR_solve), 0, 0, 1, 1},
22201  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
22202  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
22203  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
22204  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
22205  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
22206  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
22207  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
22208  {&__pyx_n_s_nc, __pyx_k_nc, sizeof(__pyx_k_nc), 0, 0, 1, 1},
22209  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
22210  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
22211  {&__pyx_n_s_nl_gauss_seidel_NR_solve, __pyx_k_nl_gauss_seidel_NR_solve, sizeof(__pyx_k_nl_gauss_seidel_NR_solve), 0, 0, 1, 1},
22212  {&__pyx_n_s_nl_jacobi_NR_solve, __pyx_k_nl_jacobi_NR_solve, sizeof(__pyx_k_nl_jacobi_NR_solve), 0, 0, 1, 1},
22213  {&__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},
22214  {&__pyx_n_s_node_order, __pyx_k_node_order, sizeof(__pyx_k_node_order), 0, 0, 1, 1},
22215  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
22216  {&__pyx_n_s_nr, __pyx_k_nr, sizeof(__pyx_k_nr), 0, 0, 1, 1},
22217  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
22218  {&__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},
22219  {&__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},
22220  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
22221  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
22222  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
22223  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
22224  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
22225  {&__pyx_kp_s_proteus_csmoothers_pyx, __pyx_k_proteus_csmoothers_pyx, sizeof(__pyx_k_proteus_csmoothers_pyx), 0, 0, 1, 0},
22226  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
22227  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
22228  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
22229  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
22230  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
22231  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
22232  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
22233  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
22234  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
22235  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
22236  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
22237  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
22238  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
22239  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
22240  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
22241  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
22242  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
22243  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
22244  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
22245  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
22246  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
22247  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
22248  {&__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},
22249  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
22250  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
22251  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
22252  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
22253  {&__pyx_n_s_tol, __pyx_k_tol, sizeof(__pyx_k_tol), 0, 0, 1, 1},
22254  {&__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},
22255  {&__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},
22256  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
22257  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
22258  {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
22259  {0, 0, 0, 0, 0, 0, 0}
22260 };
22261 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
22262  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 5, __pyx_L1_error)
22263  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
22264  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 945, __pyx_L1_error)
22265  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 133, __pyx_L1_error)
22266  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
22267  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
22268  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 180, __pyx_L1_error)
22269  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error)
22270  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error)
22271  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error)
22272  return 0;
22273  __pyx_L1_error:;
22274  return -1;
22275 }
22276 
22277 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
22278  __Pyx_RefNannyDeclarations
22279  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
22280 
22281  /* "(tree fragment)":2
22282  * def __reduce_cython__(self):
22283  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22284  * def __setstate_cython__(self, __pyx_state):
22285  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22286  */
22287  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error)
22288  __Pyx_GOTREF(__pyx_tuple_);
22289  __Pyx_GIVEREF(__pyx_tuple_);
22290 
22291  /* "(tree fragment)":4
22292  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22293  * def __setstate_cython__(self, __pyx_state):
22294  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22295  */
22296  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error)
22297  __Pyx_GOTREF(__pyx_tuple__2);
22298  __Pyx_GIVEREF(__pyx_tuple__2);
22299 
22300  /* "(tree fragment)":2
22301  * def __reduce_cython__(self):
22302  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22303  * def __setstate_cython__(self, __pyx_state):
22304  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22305  */
22306  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 2, __pyx_L1_error)
22307  __Pyx_GOTREF(__pyx_tuple__3);
22308  __Pyx_GIVEREF(__pyx_tuple__3);
22309 
22310  /* "(tree fragment)":4
22311  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22312  * def __setstate_cython__(self, __pyx_state):
22313  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22314  */
22315  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 4, __pyx_L1_error)
22316  __Pyx_GOTREF(__pyx_tuple__4);
22317  __Pyx_GIVEREF(__pyx_tuple__4);
22318 
22319  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":945
22320  * __pyx_import_array()
22321  * except Exception:
22322  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
22323  *
22324  * cdef inline int import_umath() except -1:
22325  */
22326  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(2, 945, __pyx_L1_error)
22327  __Pyx_GOTREF(__pyx_tuple__5);
22328  __Pyx_GIVEREF(__pyx_tuple__5);
22329 
22330  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":951
22331  * _import_umath()
22332  * except Exception:
22333  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
22334  *
22335  * cdef inline int import_ufunc() except -1:
22336  */
22337  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 951, __pyx_L1_error)
22338  __Pyx_GOTREF(__pyx_tuple__6);
22339  __Pyx_GIVEREF(__pyx_tuple__6);
22340 
22341  /* "View.MemoryView":133
22342  *
22343  * if not self.ndim:
22344  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
22345  *
22346  * if itemsize <= 0:
22347  */
22348  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 133, __pyx_L1_error)
22349  __Pyx_GOTREF(__pyx_tuple__7);
22350  __Pyx_GIVEREF(__pyx_tuple__7);
22351 
22352  /* "View.MemoryView":136
22353  *
22354  * if itemsize <= 0:
22355  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
22356  *
22357  * if not isinstance(format, bytes):
22358  */
22359  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 136, __pyx_L1_error)
22360  __Pyx_GOTREF(__pyx_tuple__8);
22361  __Pyx_GIVEREF(__pyx_tuple__8);
22362 
22363  /* "View.MemoryView":148
22364  *
22365  * if not self._shape:
22366  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
22367  *
22368  *
22369  */
22370  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 148, __pyx_L1_error)
22371  __Pyx_GOTREF(__pyx_tuple__9);
22372  __Pyx_GIVEREF(__pyx_tuple__9);
22373 
22374  /* "View.MemoryView":176
22375  * self.data = <char *>malloc(self.len)
22376  * if not self.data:
22377  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
22378  *
22379  * if self.dtype_is_object:
22380  */
22381  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 176, __pyx_L1_error)
22382  __Pyx_GOTREF(__pyx_tuple__10);
22383  __Pyx_GIVEREF(__pyx_tuple__10);
22384 
22385  /* "View.MemoryView":192
22386  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
22387  * if not (flags & bufmode):
22388  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
22389  * info.buf = self.data
22390  * info.len = self.len
22391  */
22392  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 192, __pyx_L1_error)
22393  __Pyx_GOTREF(__pyx_tuple__11);
22394  __Pyx_GIVEREF(__pyx_tuple__11);
22395 
22396  /* "(tree fragment)":2
22397  * def __reduce_cython__(self):
22398  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22399  * def __setstate_cython__(self, __pyx_state):
22400  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22401  */
22402  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 2, __pyx_L1_error)
22403  __Pyx_GOTREF(__pyx_tuple__12);
22404  __Pyx_GIVEREF(__pyx_tuple__12);
22405 
22406  /* "(tree fragment)":4
22407  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22408  * def __setstate_cython__(self, __pyx_state):
22409  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22410  */
22411  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 4, __pyx_L1_error)
22412  __Pyx_GOTREF(__pyx_tuple__13);
22413  __Pyx_GIVEREF(__pyx_tuple__13);
22414 
22415  /* "View.MemoryView":418
22416  * def __setitem__(memoryview self, object index, object value):
22417  * if self.view.readonly:
22418  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
22419  *
22420  * have_slices, index = _unellipsify(index, self.view.ndim)
22421  */
22422  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 418, __pyx_L1_error)
22423  __Pyx_GOTREF(__pyx_tuple__14);
22424  __Pyx_GIVEREF(__pyx_tuple__14);
22425 
22426  /* "View.MemoryView":495
22427  * result = struct.unpack(self.view.format, bytesitem)
22428  * except struct.error:
22429  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
22430  * else:
22431  * if len(self.view.format) == 1:
22432  */
22433  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 495, __pyx_L1_error)
22434  __Pyx_GOTREF(__pyx_tuple__15);
22435  __Pyx_GIVEREF(__pyx_tuple__15);
22436 
22437  /* "View.MemoryView":520
22438  * def __getbuffer__(self, Py_buffer *info, int flags):
22439  * if flags & PyBUF_WRITABLE and self.view.readonly:
22440  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
22441  *
22442  * if flags & PyBUF_ND:
22443  */
22444  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 520, __pyx_L1_error)
22445  __Pyx_GOTREF(__pyx_tuple__16);
22446  __Pyx_GIVEREF(__pyx_tuple__16);
22447 
22448  /* "View.MemoryView":570
22449  * if self.view.strides == NULL:
22450  *
22451  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
22452  *
22453  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
22454  */
22455  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 570, __pyx_L1_error)
22456  __Pyx_GOTREF(__pyx_tuple__17);
22457  __Pyx_GIVEREF(__pyx_tuple__17);
22458 
22459  /* "View.MemoryView":577
22460  * def suboffsets(self):
22461  * if self.view.suboffsets == NULL:
22462  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
22463  *
22464  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
22465  */
22466  __pyx_tuple__18 = PyTuple_New(1); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 577, __pyx_L1_error)
22467  __Pyx_GOTREF(__pyx_tuple__18);
22468  __Pyx_INCREF(__pyx_int_neg_1);
22469  __Pyx_GIVEREF(__pyx_int_neg_1);
22470  PyTuple_SET_ITEM(__pyx_tuple__18, 0, __pyx_int_neg_1);
22471  __Pyx_GIVEREF(__pyx_tuple__18);
22472 
22473  /* "(tree fragment)":2
22474  * def __reduce_cython__(self):
22475  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22476  * def __setstate_cython__(self, __pyx_state):
22477  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22478  */
22479  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 2, __pyx_L1_error)
22480  __Pyx_GOTREF(__pyx_tuple__19);
22481  __Pyx_GIVEREF(__pyx_tuple__19);
22482 
22483  /* "(tree fragment)":4
22484  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22485  * def __setstate_cython__(self, __pyx_state):
22486  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22487  */
22488  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 4, __pyx_L1_error)
22489  __Pyx_GOTREF(__pyx_tuple__20);
22490  __Pyx_GIVEREF(__pyx_tuple__20);
22491 
22492  /* "View.MemoryView":682
22493  * if item is Ellipsis:
22494  * if not seen_ellipsis:
22495  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
22496  * seen_ellipsis = True
22497  * else:
22498  */
22499  __pyx_slice__21 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__21)) __PYX_ERR(1, 682, __pyx_L1_error)
22500  __Pyx_GOTREF(__pyx_slice__21);
22501  __Pyx_GIVEREF(__pyx_slice__21);
22502 
22503  /* "View.MemoryView":703
22504  * for suboffset in suboffsets[:ndim]:
22505  * if suboffset >= 0:
22506  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
22507  *
22508  *
22509  */
22510  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 703, __pyx_L1_error)
22511  __Pyx_GOTREF(__pyx_tuple__22);
22512  __Pyx_GIVEREF(__pyx_tuple__22);
22513 
22514  /* "(tree fragment)":2
22515  * def __reduce_cython__(self):
22516  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22517  * def __setstate_cython__(self, __pyx_state):
22518  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22519  */
22520  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 2, __pyx_L1_error)
22521  __Pyx_GOTREF(__pyx_tuple__23);
22522  __Pyx_GIVEREF(__pyx_tuple__23);
22523 
22524  /* "(tree fragment)":4
22525  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22526  * def __setstate_cython__(self, __pyx_state):
22527  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22528  */
22529  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 4, __pyx_L1_error)
22530  __Pyx_GOTREF(__pyx_tuple__24);
22531  __Pyx_GIVEREF(__pyx_tuple__24);
22532  __pyx_tuple__25 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 4, __pyx_L1_error)
22533  __Pyx_GOTREF(__pyx_tuple__25);
22534  __Pyx_GIVEREF(__pyx_tuple__25);
22535 
22536  /* "csmoothers.pyx":5
22537  * cimport numpy as np
22538  *
22539  * class ASMFactor(object): # <<<<<<<<<<<<<<
22540  *
22541  * def __init__(self, L):
22542  */
22543  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 5, __pyx_L1_error)
22544  __Pyx_GOTREF(__pyx_tuple__26);
22545  __Pyx_GIVEREF(__pyx_tuple__26);
22546 
22547  /* "csmoothers.pyx":7
22548  * class ASMFactor(object):
22549  *
22550  * def __init__(self, L): # <<<<<<<<<<<<<<
22551  * self.L = L
22552  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
22553  */
22554  __pyx_tuple__27 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_L); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 7, __pyx_L1_error)
22555  __Pyx_GOTREF(__pyx_tuple__27);
22556  __Pyx_GIVEREF(__pyx_tuple__27);
22557  __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_init, 7, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 7, __pyx_L1_error)
22558 
22559  /* "csmoothers.pyx":42
22560  *
22561  *
22562  * class BASMFactor(object): # <<<<<<<<<<<<<<
22563  *
22564  * def __init__(self, L, bs):
22565  */
22566  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 42, __pyx_L1_error)
22567  __Pyx_GOTREF(__pyx_tuple__29);
22568  __Pyx_GIVEREF(__pyx_tuple__29);
22569 
22570  /* "csmoothers.pyx":44
22571  * class BASMFactor(object):
22572  *
22573  * def __init__(self, L, bs): # <<<<<<<<<<<<<<
22574  * self.L = L
22575  * self.bs = bs
22576  */
22577  __pyx_tuple__30 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_L, __pyx_n_s_bs); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 44, __pyx_L1_error)
22578  __Pyx_GOTREF(__pyx_tuple__30);
22579  __Pyx_GIVEREF(__pyx_tuple__30);
22580  __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_init, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 44, __pyx_L1_error)
22581 
22582  /* "csmoothers.pyx":84
22583  * self.subdomain_col_pivots)
22584  *
22585  * def jacobi_NR_prepare(A, w, tol, M): # <<<<<<<<<<<<<<
22586  * """
22587  *
22588  */
22589  __pyx_tuple__32 = PyTuple_Pack(4, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_M); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 84, __pyx_L1_error)
22590  __Pyx_GOTREF(__pyx_tuple__32);
22591  __Pyx_GIVEREF(__pyx_tuple__32);
22592  __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_jacobi_NR_prepare, 84, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 84, __pyx_L1_error)
22593 
22594  /* "csmoothers.pyx":109
22595  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
22596  *
22597  * def jacobi_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
22598  * """
22599  *
22600  */
22601  __pyx_tuple__34 = PyTuple_Pack(5, __pyx_n_s_A, __pyx_n_s_M, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 109, __pyx_L1_error)
22602  __Pyx_GOTREF(__pyx_tuple__34);
22603  __Pyx_GIVEREF(__pyx_tuple__34);
22604  __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_jacobi_NR_solve, 109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 109, __pyx_L1_error)
22605 
22606  /* "csmoothers.pyx":136
22607  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
22608  *
22609  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
22610  * """
22611  *
22612  */
22613  __pyx_tuple__36 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 136, __pyx_L1_error)
22614  __Pyx_GOTREF(__pyx_tuple__36);
22615  __Pyx_GIVEREF(__pyx_tuple__36);
22616  __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_nl_jacobi_NR_solve, 136, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 136, __pyx_L1_error)
22617 
22618  /* "csmoothers.pyx":165
22619  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
22620  *
22621  * def gauss_seidel_NR_preare(A, w, tol, M): # <<<<<<<<<<<<<<
22622  * """
22623  *
22624  */
22625  __pyx_tuple__38 = PyTuple_Pack(4, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_M); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 165, __pyx_L1_error)
22626  __Pyx_GOTREF(__pyx_tuple__38);
22627  __Pyx_GIVEREF(__pyx_tuple__38);
22628  __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_gauss_seidel_NR_preare, 165, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 165, __pyx_L1_error)
22629 
22630  /* "csmoothers.pyx":190
22631  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
22632  *
22633  * def gauss_seidel_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
22634  * """
22635  *
22636  */
22637  __pyx_tuple__40 = PyTuple_Pack(5, __pyx_n_s_A, __pyx_n_s_M, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 190, __pyx_L1_error)
22638  __Pyx_GOTREF(__pyx_tuple__40);
22639  __Pyx_GIVEREF(__pyx_tuple__40);
22640  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_gauss_seidel_NR_solve, 190, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 190, __pyx_L1_error)
22641 
22642  /* "csmoothers.pyx":217
22643  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
22644  *
22645  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
22646  * """
22647  *
22648  */
22649  __pyx_tuple__42 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_R, __pyx_n_s_node_order, __pyx_n_s_w, __pyx_n_s_tol, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 217, __pyx_L1_error)
22650  __Pyx_GOTREF(__pyx_tuple__42);
22651  __Pyx_GIVEREF(__pyx_tuple__42);
22652  __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_nl_gauss_seidel_NR_solve, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 217, __pyx_L1_error)
22653 
22654  /* "csmoothers.pyx":251
22655  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
22656  *
22657  * def asm_NR_prepare(A, asmFactor): # <<<<<<<<<<<<<<
22658  * """
22659  *
22660  */
22661  __pyx_tuple__44 = PyTuple_Pack(2, __pyx_n_s_A, __pyx_n_s_asmFactor); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 251, __pyx_L1_error)
22662  __Pyx_GOTREF(__pyx_tuple__44);
22663  __Pyx_GIVEREF(__pyx_tuple__44);
22664  __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_asm_NR_prepare, 251, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 251, __pyx_L1_error)
22665 
22666  /* "csmoothers.pyx":277
22667  * asmFactor.subdomain_pivots)
22668  *
22669  * def asm_NR_solve(A, w, asmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
22670  * """
22671  *
22672  */
22673  __pyx_tuple__46 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_asmFactor, __pyx_n_s_node_order, __pyx_n_s_R, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 277, __pyx_L1_error)
22674  __Pyx_GOTREF(__pyx_tuple__46);
22675  __Pyx_GIVEREF(__pyx_tuple__46);
22676  __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_asm_NR_solve, 277, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 277, __pyx_L1_error)
22677 
22678  /* "csmoothers.pyx":321
22679  * asmFactor.subdomain_pivots)
22680  *
22681  * def basm_NR_prepare(A, basmFactor): # <<<<<<<<<<<<<<
22682  * """
22683  *
22684  */
22685  __pyx_tuple__48 = PyTuple_Pack(2, __pyx_n_s_A, __pyx_n_s_basmFactor); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 321, __pyx_L1_error)
22686  __Pyx_GOTREF(__pyx_tuple__48);
22687  __Pyx_GIVEREF(__pyx_tuple__48);
22688  __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_basm_NR_prepare, 321, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 321, __pyx_L1_error)
22689 
22690  /* "csmoothers.pyx":350
22691  *
22692  *
22693  * def basm_NR_solve(A, w, basmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
22694  * """
22695  *
22696  */
22697  __pyx_tuple__50 = PyTuple_Pack(6, __pyx_n_s_A, __pyx_n_s_w, __pyx_n_s_basmFactor, __pyx_n_s_node_order, __pyx_n_s_R, __pyx_n_s_dX); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 350, __pyx_L1_error)
22698  __Pyx_GOTREF(__pyx_tuple__50);
22699  __Pyx_GIVEREF(__pyx_tuple__50);
22700  __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_csmoothers_pyx, __pyx_n_s_basm_NR_solve, 350, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 350, __pyx_L1_error)
22701 
22702  /* "View.MemoryView":286
22703  * return self.name
22704  *
22705  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
22706  * cdef strided = Enum("<strided and direct>") # default
22707  * cdef indirect = Enum("<strided and indirect>")
22708  */
22709  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 286, __pyx_L1_error)
22710  __Pyx_GOTREF(__pyx_tuple__52);
22711  __Pyx_GIVEREF(__pyx_tuple__52);
22712 
22713  /* "View.MemoryView":287
22714  *
22715  * cdef generic = Enum("<strided and direct or indirect>")
22716  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
22717  * cdef indirect = Enum("<strided and indirect>")
22718  *
22719  */
22720  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 287, __pyx_L1_error)
22721  __Pyx_GOTREF(__pyx_tuple__53);
22722  __Pyx_GIVEREF(__pyx_tuple__53);
22723 
22724  /* "View.MemoryView":288
22725  * cdef generic = Enum("<strided and direct or indirect>")
22726  * cdef strided = Enum("<strided and direct>") # default
22727  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
22728  *
22729  *
22730  */
22731  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 288, __pyx_L1_error)
22732  __Pyx_GOTREF(__pyx_tuple__54);
22733  __Pyx_GIVEREF(__pyx_tuple__54);
22734 
22735  /* "View.MemoryView":291
22736  *
22737  *
22738  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
22739  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
22740  *
22741  */
22742  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 291, __pyx_L1_error)
22743  __Pyx_GOTREF(__pyx_tuple__55);
22744  __Pyx_GIVEREF(__pyx_tuple__55);
22745 
22746  /* "View.MemoryView":292
22747  *
22748  * cdef contiguous = Enum("<contiguous and direct>")
22749  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
22750  *
22751  *
22752  */
22753  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 292, __pyx_L1_error)
22754  __Pyx_GOTREF(__pyx_tuple__56);
22755  __Pyx_GIVEREF(__pyx_tuple__56);
22756 
22757  /* "(tree fragment)":1
22758  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
22759  * cdef object __pyx_PickleError
22760  * cdef object __pyx_result
22761  */
22762  __pyx_tuple__57 = 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__57)) __PYX_ERR(1, 1, __pyx_L1_error)
22763  __Pyx_GOTREF(__pyx_tuple__57);
22764  __Pyx_GIVEREF(__pyx_tuple__57);
22765  __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(1, 1, __pyx_L1_error)
22766  __Pyx_RefNannyFinishContext();
22767  return 0;
22768  __pyx_L1_error:;
22769  __Pyx_RefNannyFinishContext();
22770  return -1;
22771 }
22772 
22773 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
22774  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
22775  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
22776  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22777  __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
22778  __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
22779  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
22780  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22781  return 0;
22782  __pyx_L1_error:;
22783  return -1;
22784 }
22785 
22786 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
22787 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
22788 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
22789 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
22790 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
22791 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
22792 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
22793 
22794 static int __Pyx_modinit_global_init_code(void) {
22795  __Pyx_RefNannyDeclarations
22796  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
22797  /*--- Global init code ---*/
22798  generic = Py_None; Py_INCREF(Py_None);
22799  strided = Py_None; Py_INCREF(Py_None);
22800  indirect = Py_None; Py_INCREF(Py_None);
22801  contiguous = Py_None; Py_INCREF(Py_None);
22802  indirect_contiguous = Py_None; Py_INCREF(Py_None);
22803  __Pyx_RefNannyFinishContext();
22804  return 0;
22805 }
22806 
22807 static int __Pyx_modinit_variable_export_code(void) {
22808  __Pyx_RefNannyDeclarations
22809  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
22810  /*--- Variable export code ---*/
22811  __Pyx_RefNannyFinishContext();
22812  return 0;
22813 }
22814 
22815 static int __Pyx_modinit_function_export_code(void) {
22816  __Pyx_RefNannyDeclarations
22817  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
22818  /*--- Function export code ---*/
22819  __Pyx_RefNannyFinishContext();
22820  return 0;
22821 }
22822 
22823 static int __Pyx_modinit_type_init_code(void) {
22824  __Pyx_RefNannyDeclarations
22825  int __pyx_lineno = 0;
22826  const char *__pyx_filename = NULL;
22827  int __pyx_clineno = 0;
22828  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
22829  /*--- Type init code ---*/
22830  if (PyType_Ready(&__pyx_type_10csmoothers_cASMFactor) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
22831  #if PY_VERSION_HEX < 0x030800B1
22832  __pyx_type_10csmoothers_cASMFactor.tp_print = 0;
22833  #endif
22834  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10csmoothers_cASMFactor.tp_dictoffset && __pyx_type_10csmoothers_cASMFactor.tp_getattro == PyObject_GenericGetAttr)) {
22835  __pyx_type_10csmoothers_cASMFactor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22836  }
22837  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_cASMFactor_2, (PyObject *)&__pyx_type_10csmoothers_cASMFactor) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
22838  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10csmoothers_cASMFactor) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
22839  __pyx_ptype_10csmoothers_cASMFactor = &__pyx_type_10csmoothers_cASMFactor;
22840  if (PyType_Ready(&__pyx_type_10csmoothers_cBASMFactor) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
22841  #if PY_VERSION_HEX < 0x030800B1
22842  __pyx_type_10csmoothers_cBASMFactor.tp_print = 0;
22843  #endif
22844  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10csmoothers_cBASMFactor.tp_dictoffset && __pyx_type_10csmoothers_cBASMFactor.tp_getattro == PyObject_GenericGetAttr)) {
22845  __pyx_type_10csmoothers_cBASMFactor.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22846  }
22847  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_cBASMFactor_2, (PyObject *)&__pyx_type_10csmoothers_cBASMFactor) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
22848  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10csmoothers_cBASMFactor) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
22849  __pyx_ptype_10csmoothers_cBASMFactor = &__pyx_type_10csmoothers_cBASMFactor;
22850  __pyx_vtabptr_array = &__pyx_vtable_array;
22851  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
22852  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
22853  #if PY_VERSION_HEX < 0x030800B1
22854  __pyx_type___pyx_array.tp_print = 0;
22855  #endif
22856  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
22857  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
22858  __pyx_array_type = &__pyx_type___pyx_array;
22859  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
22860  #if PY_VERSION_HEX < 0x030800B1
22861  __pyx_type___pyx_MemviewEnum.tp_print = 0;
22862  #endif
22863  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
22864  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22865  }
22866  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
22867  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
22868  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
22869  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
22870  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
22871  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
22872  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
22873  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
22874  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
22875  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
22876  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
22877  #if PY_VERSION_HEX < 0x030800B1
22878  __pyx_type___pyx_memoryview.tp_print = 0;
22879  #endif
22880  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
22881  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22882  }
22883  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
22884  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
22885  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
22886  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
22887  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
22888  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
22889  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
22890  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
22891  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
22892  #if PY_VERSION_HEX < 0x030800B1
22893  __pyx_type___pyx_memoryviewslice.tp_print = 0;
22894  #endif
22895  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
22896  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22897  }
22898  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
22899  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
22900  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
22901  __Pyx_RefNannyFinishContext();
22902  return 0;
22903  __pyx_L1_error:;
22904  __Pyx_RefNannyFinishContext();
22905  return -1;
22906 }
22907 
22908 static int __Pyx_modinit_type_import_code(void) {
22909  __Pyx_RefNannyDeclarations
22910  PyObject *__pyx_t_1 = NULL;
22911  int __pyx_lineno = 0;
22912  const char *__pyx_filename = NULL;
22913  int __pyx_clineno = 0;
22914  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
22915  /*--- Type import code ---*/
22916  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
22917  __Pyx_GOTREF(__pyx_t_1);
22918  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
22919  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
22920  sizeof(PyTypeObject),
22921  #else
22922  sizeof(PyHeapTypeObject),
22923  #endif
22924  __Pyx_ImportType_CheckSize_Warn);
22925  if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
22926  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22927  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 200, __pyx_L1_error)
22928  __Pyx_GOTREF(__pyx_t_1);
22929  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
22930  if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 200, __pyx_L1_error)
22931  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
22932  if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 223, __pyx_L1_error)
22933  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
22934  if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 227, __pyx_L1_error)
22935  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
22936  if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 239, __pyx_L1_error)
22937  __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22938  if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 771, __pyx_L1_error)
22939  __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22940  if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 773, __pyx_L1_error)
22941  __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22942  if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 775, __pyx_L1_error)
22943  __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22944  if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 777, __pyx_L1_error)
22945  __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22946  if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 779, __pyx_L1_error)
22947  __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22948  if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 781, __pyx_L1_error)
22949  __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22950  if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 783, __pyx_L1_error)
22951  __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22952  if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 785, __pyx_L1_error)
22953  __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22954  if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 787, __pyx_L1_error)
22955  __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
22956  if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 789, __pyx_L1_error)
22957  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
22958  if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 827, __pyx_L1_error)
22959  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22960  __pyx_t_1 = PyImport_ImportModule("proteus.superluWrappers"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 67, __pyx_L1_error)
22961  __Pyx_GOTREF(__pyx_t_1);
22962  __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix = __Pyx_ImportType(__pyx_t_1, "proteus.superluWrappers", "cSparseMatrix", sizeof(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix), __Pyx_ImportType_CheckSize_Warn);
22963  if (!__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix) __PYX_ERR(4, 67, __pyx_L1_error)
22964  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22965  __Pyx_RefNannyFinishContext();
22966  return 0;
22967  __pyx_L1_error:;
22968  __Pyx_XDECREF(__pyx_t_1);
22969  __Pyx_RefNannyFinishContext();
22970  return -1;
22971 }
22972 
22973 static int __Pyx_modinit_variable_import_code(void) {
22974  __Pyx_RefNannyDeclarations
22975  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
22976  /*--- Variable import code ---*/
22977  __Pyx_RefNannyFinishContext();
22978  return 0;
22979 }
22980 
22981 static int __Pyx_modinit_function_import_code(void) {
22982  __Pyx_RefNannyDeclarations
22983  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
22984  /*--- Function import code ---*/
22985  __Pyx_RefNannyFinishContext();
22986  return 0;
22987 }
22988 
22989 
22990 #ifndef CYTHON_NO_PYINIT_EXPORT
22991 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
22992 #elif PY_MAJOR_VERSION < 3
22993 #ifdef __cplusplus
22994 #define __Pyx_PyMODINIT_FUNC extern "C" void
22995 #else
22996 #define __Pyx_PyMODINIT_FUNC void
22997 #endif
22998 #else
22999 #ifdef __cplusplus
23000 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
23001 #else
23002 #define __Pyx_PyMODINIT_FUNC PyObject *
23003 #endif
23004 #endif
23005 
23006 
23007 #if PY_MAJOR_VERSION < 3
23008 __Pyx_PyMODINIT_FUNC initcsmoothers(void) CYTHON_SMALL_CODE; /*proto*/
23009 __Pyx_PyMODINIT_FUNC initcsmoothers(void)
23010 #else
23011 __Pyx_PyMODINIT_FUNC PyInit_csmoothers(void) CYTHON_SMALL_CODE; /*proto*/
23012 __Pyx_PyMODINIT_FUNC PyInit_csmoothers(void)
23013 #if CYTHON_PEP489_MULTI_PHASE_INIT
23014 {
23015  return PyModuleDef_Init(&__pyx_moduledef);
23016 }
23017 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
23018  #if PY_VERSION_HEX >= 0x030700A1
23019  static PY_INT64_T main_interpreter_id = -1;
23020  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
23021  if (main_interpreter_id == -1) {
23022  main_interpreter_id = current_id;
23023  return (unlikely(current_id == -1)) ? -1 : 0;
23024  } else if (unlikely(main_interpreter_id != current_id))
23025  #else
23026  static PyInterpreterState *main_interpreter = NULL;
23027  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
23028  if (!main_interpreter) {
23029  main_interpreter = current_interpreter;
23030  } else if (unlikely(main_interpreter != current_interpreter))
23031  #endif
23032  {
23033  PyErr_SetString(
23034  PyExc_ImportError,
23035  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
23036  return -1;
23037  }
23038  return 0;
23039 }
23040 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) {
23041  PyObject *value = PyObject_GetAttrString(spec, from_name);
23042  int result = 0;
23043  if (likely(value)) {
23044  if (allow_none || value != Py_None) {
23045  result = PyDict_SetItemString(moddict, to_name, value);
23046  }
23047  Py_DECREF(value);
23048  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
23049  PyErr_Clear();
23050  } else {
23051  result = -1;
23052  }
23053  return result;
23054 }
23055 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
23056  PyObject *module = NULL, *moddict, *modname;
23057  if (__Pyx_check_single_interpreter())
23058  return NULL;
23059  if (__pyx_m)
23060  return __Pyx_NewRef(__pyx_m);
23061  modname = PyObject_GetAttrString(spec, "name");
23062  if (unlikely(!modname)) goto bad;
23063  module = PyModule_NewObject(modname);
23064  Py_DECREF(modname);
23065  if (unlikely(!module)) goto bad;
23066  moddict = PyModule_GetDict(module);
23067  if (unlikely(!moddict)) goto bad;
23068  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
23069  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
23070  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
23071  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
23072  return module;
23073 bad:
23074  Py_XDECREF(module);
23075  return NULL;
23076 }
23077 
23078 
23079 static CYTHON_SMALL_CODE int __pyx_pymod_exec_csmoothers(PyObject *__pyx_pyinit_module)
23080 #endif
23081 #endif
23082 {
23083  PyObject *__pyx_t_1 = NULL;
23084  PyObject *__pyx_t_2 = NULL;
23085  PyObject *__pyx_t_3 = NULL;
23086  static PyThread_type_lock __pyx_t_4[8];
23087  int __pyx_lineno = 0;
23088  const char *__pyx_filename = NULL;
23089  int __pyx_clineno = 0;
23090  __Pyx_RefNannyDeclarations
23091  #if CYTHON_PEP489_MULTI_PHASE_INIT
23092  if (__pyx_m) {
23093  if (__pyx_m == __pyx_pyinit_module) return 0;
23094  PyErr_SetString(PyExc_RuntimeError, "Module 'csmoothers' has already been imported. Re-initialisation is not supported.");
23095  return -1;
23096  }
23097  #elif PY_MAJOR_VERSION >= 3
23098  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
23099  #endif
23100  #if CYTHON_REFNANNY
23101 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
23102 if (!__Pyx_RefNanny) {
23103  PyErr_Clear();
23104  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
23105  if (!__Pyx_RefNanny)
23106  Py_FatalError("failed to import 'refnanny' module");
23107 }
23108 #endif
23109  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_csmoothers(void)", 0);
23110  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23111  #ifdef __Pxy_PyFrame_Initialize_Offsets
23112  __Pxy_PyFrame_Initialize_Offsets();
23113  #endif
23114  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
23115  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
23116  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
23117  #ifdef __Pyx_CyFunction_USED
23118  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23119  #endif
23120  #ifdef __Pyx_FusedFunction_USED
23121  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23122  #endif
23123  #ifdef __Pyx_Coroutine_USED
23124  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23125  #endif
23126  #ifdef __Pyx_Generator_USED
23127  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23128  #endif
23129  #ifdef __Pyx_AsyncGen_USED
23130  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23131  #endif
23132  #ifdef __Pyx_StopAsyncIteration_USED
23133  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23134  #endif
23135  /*--- Library function declarations ---*/
23136  /*--- Threads initialization code ---*/
23137  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
23138  PyEval_InitThreads();
23139  #endif
23140  /*--- Module creation code ---*/
23141  #if CYTHON_PEP489_MULTI_PHASE_INIT
23142  __pyx_m = __pyx_pyinit_module;
23143  Py_INCREF(__pyx_m);
23144  #else
23145  #if PY_MAJOR_VERSION < 3
23146  __pyx_m = Py_InitModule4("csmoothers", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23147  #else
23148  __pyx_m = PyModule_Create(&__pyx_moduledef);
23149  #endif
23150  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
23151  #endif
23152  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
23153  Py_INCREF(__pyx_d);
23154  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
23155  Py_INCREF(__pyx_b);
23156  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
23157  Py_INCREF(__pyx_cython_runtime);
23158  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23159  /*--- Initialize various global constants etc. ---*/
23160  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23161  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
23162  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23163  #endif
23164  if (__pyx_module_is_main_csmoothers) {
23165  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23166  }
23167  #if PY_MAJOR_VERSION >= 3
23168  {
23169  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
23170  if (!PyDict_GetItemString(modules, "csmoothers")) {
23171  if (unlikely(PyDict_SetItemString(modules, "csmoothers", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23172  }
23173  }
23174  #endif
23175  /*--- Builtin init code ---*/
23176  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23177  /*--- Constants init code ---*/
23178  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23179  /*--- Global type/function init code ---*/
23180  (void)__Pyx_modinit_global_init_code();
23181  (void)__Pyx_modinit_variable_export_code();
23182  (void)__Pyx_modinit_function_export_code();
23183  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23184  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23185  (void)__Pyx_modinit_variable_import_code();
23186  (void)__Pyx_modinit_function_import_code();
23187  /*--- Execution code ---*/
23188  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23189  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23190  #endif
23191 
23192  /* "csmoothers.pyx":1
23193  * import numpy as np # <<<<<<<<<<<<<<
23194  * import cython
23195  * cimport numpy as np
23196  */
23197  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23198  __Pyx_GOTREF(__pyx_t_1);
23199  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23200  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23201 
23202  /* "csmoothers.pyx":5
23203  * cimport numpy as np
23204  *
23205  * class ASMFactor(object): # <<<<<<<<<<<<<<
23206  *
23207  * def __init__(self, L):
23208  */
23209  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__26); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
23210  __Pyx_GOTREF(__pyx_t_1);
23211  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__26, __pyx_n_s_ASMFactor, __pyx_n_s_ASMFactor, (PyObject *) NULL, __pyx_n_s_csmoothers, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)
23212  __Pyx_GOTREF(__pyx_t_2);
23213 
23214  /* "csmoothers.pyx":7
23215  * class ASMFactor(object):
23216  *
23217  * def __init__(self, L): # <<<<<<<<<<<<<<
23218  * self.L = L
23219  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
23220  */
23221  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_9ASMFactor_1__init__, 0, __pyx_n_s_ASMFactor___init, NULL, __pyx_n_s_csmoothers, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error)
23222  __Pyx_GOTREF(__pyx_t_3);
23223  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
23224  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23225 
23226  /* "csmoothers.pyx":5
23227  * cimport numpy as np
23228  *
23229  * class ASMFactor(object): # <<<<<<<<<<<<<<
23230  *
23231  * def __init__(self, L):
23232  */
23233  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ASMFactor, __pyx_tuple__26, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
23234  __Pyx_GOTREF(__pyx_t_3);
23235  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASMFactor, __pyx_t_3) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
23236  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23237  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23238  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23239 
23240  /* "csmoothers.pyx":42
23241  *
23242  *
23243  * class BASMFactor(object): # <<<<<<<<<<<<<<
23244  *
23245  * def __init__(self, L, bs):
23246  */
23247  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__29); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
23248  __Pyx_GOTREF(__pyx_t_1);
23249  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__29, __pyx_n_s_BASMFactor, __pyx_n_s_BASMFactor, (PyObject *) NULL, __pyx_n_s_csmoothers, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
23250  __Pyx_GOTREF(__pyx_t_2);
23251 
23252  /* "csmoothers.pyx":44
23253  * class BASMFactor(object):
23254  *
23255  * def __init__(self, L, bs): # <<<<<<<<<<<<<<
23256  * self.L = L
23257  * self.bs = bs
23258  */
23259  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10csmoothers_10BASMFactor_1__init__, 0, __pyx_n_s_BASMFactor___init, NULL, __pyx_n_s_csmoothers, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error)
23260  __Pyx_GOTREF(__pyx_t_3);
23261  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 44, __pyx_L1_error)
23262  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23263 
23264  /* "csmoothers.pyx":42
23265  *
23266  *
23267  * class BASMFactor(object): # <<<<<<<<<<<<<<
23268  *
23269  * def __init__(self, L, bs):
23270  */
23271  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_BASMFactor, __pyx_tuple__29, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
23272  __Pyx_GOTREF(__pyx_t_3);
23273  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BASMFactor, __pyx_t_3) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
23274  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23275  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23276  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23277 
23278  /* "csmoothers.pyx":84
23279  * self.subdomain_col_pivots)
23280  *
23281  * def jacobi_NR_prepare(A, w, tol, M): # <<<<<<<<<<<<<<
23282  * """
23283  *
23284  */
23285  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_1jacobi_NR_prepare, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
23286  __Pyx_GOTREF(__pyx_t_1);
23287  if (PyDict_SetItem(__pyx_d, __pyx_n_s_jacobi_NR_prepare, __pyx_t_1) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
23288  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23289 
23290  /* "csmoothers.pyx":109
23291  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
23292  *
23293  * def jacobi_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
23294  * """
23295  *
23296  */
23297  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_3jacobi_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
23298  __Pyx_GOTREF(__pyx_t_1);
23299  if (PyDict_SetItem(__pyx_d, __pyx_n_s_jacobi_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
23300  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23301 
23302  /* "csmoothers.pyx":136
23303  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
23304  *
23305  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
23306  * """
23307  *
23308  */
23309  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_5nl_jacobi_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error)
23310  __Pyx_GOTREF(__pyx_t_1);
23311  if (PyDict_SetItem(__pyx_d, __pyx_n_s_nl_jacobi_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 136, __pyx_L1_error)
23312  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23313 
23314  /* "csmoothers.pyx":165
23315  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
23316  *
23317  * def gauss_seidel_NR_preare(A, w, tol, M): # <<<<<<<<<<<<<<
23318  * """
23319  *
23320  */
23321  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_7gauss_seidel_NR_preare, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
23322  __Pyx_GOTREF(__pyx_t_1);
23323  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gauss_seidel_NR_preare, __pyx_t_1) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
23324  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23325 
23326  /* "csmoothers.pyx":190
23327  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
23328  *
23329  * def gauss_seidel_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
23330  * """
23331  *
23332  */
23333  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_9gauss_seidel_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
23334  __Pyx_GOTREF(__pyx_t_1);
23335  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gauss_seidel_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 190, __pyx_L1_error)
23336  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23337 
23338  /* "csmoothers.pyx":217
23339  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
23340  *
23341  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
23342  * """
23343  *
23344  */
23345  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_11nl_gauss_seidel_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
23346  __Pyx_GOTREF(__pyx_t_1);
23347  if (PyDict_SetItem(__pyx_d, __pyx_n_s_nl_gauss_seidel_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 217, __pyx_L1_error)
23348  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23349 
23350  /* "csmoothers.pyx":251
23351  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
23352  *
23353  * def asm_NR_prepare(A, asmFactor): # <<<<<<<<<<<<<<
23354  * """
23355  *
23356  */
23357  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_13asm_NR_prepare, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error)
23358  __Pyx_GOTREF(__pyx_t_1);
23359  if (PyDict_SetItem(__pyx_d, __pyx_n_s_asm_NR_prepare, __pyx_t_1) < 0) __PYX_ERR(0, 251, __pyx_L1_error)
23360  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23361 
23362  /* "csmoothers.pyx":277
23363  * asmFactor.subdomain_pivots)
23364  *
23365  * def asm_NR_solve(A, w, asmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
23366  * """
23367  *
23368  */
23369  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_15asm_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
23370  __Pyx_GOTREF(__pyx_t_1);
23371  if (PyDict_SetItem(__pyx_d, __pyx_n_s_asm_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 277, __pyx_L1_error)
23372  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23373 
23374  /* "csmoothers.pyx":321
23375  * asmFactor.subdomain_pivots)
23376  *
23377  * def basm_NR_prepare(A, basmFactor): # <<<<<<<<<<<<<<
23378  * """
23379  *
23380  */
23381  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_17basm_NR_prepare, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error)
23382  __Pyx_GOTREF(__pyx_t_1);
23383  if (PyDict_SetItem(__pyx_d, __pyx_n_s_basm_NR_prepare, __pyx_t_1) < 0) __PYX_ERR(0, 321, __pyx_L1_error)
23384  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23385 
23386  /* "csmoothers.pyx":350
23387  *
23388  *
23389  * def basm_NR_solve(A, w, basmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
23390  * """
23391  *
23392  */
23393  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_10csmoothers_19basm_NR_solve, NULL, __pyx_n_s_csmoothers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error)
23394  __Pyx_GOTREF(__pyx_t_1);
23395  if (PyDict_SetItem(__pyx_d, __pyx_n_s_basm_NR_solve, __pyx_t_1) < 0) __PYX_ERR(0, 350, __pyx_L1_error)
23396  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23397 
23398  /* "csmoothers.pyx":1
23399  * import numpy as np # <<<<<<<<<<<<<<
23400  * import cython
23401  * cimport numpy as np
23402  */
23403  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23404  __Pyx_GOTREF(__pyx_t_1);
23405  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23406  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23407 
23408  /* "View.MemoryView":209
23409  * info.obj = self
23410  *
23411  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23412  *
23413  * def __dealloc__(array self):
23414  */
23415  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 209, __pyx_L1_error)
23416  __Pyx_GOTREF(__pyx_t_1);
23417  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
23418  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23419  PyType_Modified(__pyx_array_type);
23420 
23421  /* "View.MemoryView":286
23422  * return self.name
23423  *
23424  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
23425  * cdef strided = Enum("<strided and direct>") # default
23426  * cdef indirect = Enum("<strided and indirect>")
23427  */
23428  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
23429  __Pyx_GOTREF(__pyx_t_1);
23430  __Pyx_XGOTREF(generic);
23431  __Pyx_DECREF_SET(generic, __pyx_t_1);
23432  __Pyx_GIVEREF(__pyx_t_1);
23433  __pyx_t_1 = 0;
23434 
23435  /* "View.MemoryView":287
23436  *
23437  * cdef generic = Enum("<strided and direct or indirect>")
23438  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
23439  * cdef indirect = Enum("<strided and indirect>")
23440  *
23441  */
23442  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
23443  __Pyx_GOTREF(__pyx_t_1);
23444  __Pyx_XGOTREF(strided);
23445  __Pyx_DECREF_SET(strided, __pyx_t_1);
23446  __Pyx_GIVEREF(__pyx_t_1);
23447  __pyx_t_1 = 0;
23448 
23449  /* "View.MemoryView":288
23450  * cdef generic = Enum("<strided and direct or indirect>")
23451  * cdef strided = Enum("<strided and direct>") # default
23452  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
23453  *
23454  *
23455  */
23456  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
23457  __Pyx_GOTREF(__pyx_t_1);
23458  __Pyx_XGOTREF(indirect);
23459  __Pyx_DECREF_SET(indirect, __pyx_t_1);
23460  __Pyx_GIVEREF(__pyx_t_1);
23461  __pyx_t_1 = 0;
23462 
23463  /* "View.MemoryView":291
23464  *
23465  *
23466  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
23467  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
23468  *
23469  */
23470  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
23471  __Pyx_GOTREF(__pyx_t_1);
23472  __Pyx_XGOTREF(contiguous);
23473  __Pyx_DECREF_SET(contiguous, __pyx_t_1);
23474  __Pyx_GIVEREF(__pyx_t_1);
23475  __pyx_t_1 = 0;
23476 
23477  /* "View.MemoryView":292
23478  *
23479  * cdef contiguous = Enum("<contiguous and direct>")
23480  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
23481  *
23482  *
23483  */
23484  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
23485  __Pyx_GOTREF(__pyx_t_1);
23486  __Pyx_XGOTREF(indirect_contiguous);
23487  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
23488  __Pyx_GIVEREF(__pyx_t_1);
23489  __pyx_t_1 = 0;
23490 
23491  /* "View.MemoryView":316
23492  *
23493  * DEF THREAD_LOCKS_PREALLOCATED = 8
23494  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
23495  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
23496  * PyThread_allocate_lock(),
23497  */
23498  __pyx_memoryview_thread_locks_used = 0;
23499 
23500  /* "View.MemoryView":317
23501  * DEF THREAD_LOCKS_PREALLOCATED = 8
23502  * cdef int __pyx_memoryview_thread_locks_used = 0
23503  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
23504  * PyThread_allocate_lock(),
23505  * PyThread_allocate_lock(),
23506  */
23507  __pyx_t_4[0] = PyThread_allocate_lock();
23508  __pyx_t_4[1] = PyThread_allocate_lock();
23509  __pyx_t_4[2] = PyThread_allocate_lock();
23510  __pyx_t_4[3] = PyThread_allocate_lock();
23511  __pyx_t_4[4] = PyThread_allocate_lock();
23512  __pyx_t_4[5] = PyThread_allocate_lock();
23513  __pyx_t_4[6] = PyThread_allocate_lock();
23514  __pyx_t_4[7] = PyThread_allocate_lock();
23515  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_4, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
23516 
23517  /* "View.MemoryView":549
23518  * info.obj = self
23519  *
23520  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23521  *
23522  *
23523  */
23524  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error)
23525  __Pyx_GOTREF(__pyx_t_1);
23526  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
23527  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23528  PyType_Modified(__pyx_memoryview_type);
23529 
23530  /* "View.MemoryView":995
23531  * return self.from_object
23532  *
23533  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23534  *
23535  *
23536  */
23537  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 995, __pyx_L1_error)
23538  __Pyx_GOTREF(__pyx_t_1);
23539  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 995, __pyx_L1_error)
23540  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23541  PyType_Modified(__pyx_memoryviewslice_type);
23542 
23543  /* "(tree fragment)":1
23544  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23545  * cdef object __pyx_PickleError
23546  * cdef object __pyx_result
23547  */
23548  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23549  __Pyx_GOTREF(__pyx_t_1);
23550  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23551  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23552 
23553  /* "(tree fragment)":11
23554  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
23555  * return __pyx_result
23556  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
23557  * __pyx_result.name = __pyx_state[0]
23558  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
23559  */
23560 
23561  /*--- Wrapped vars code ---*/
23562 
23563  goto __pyx_L0;
23564  __pyx_L1_error:;
23565  __Pyx_XDECREF(__pyx_t_1);
23566  __Pyx_XDECREF(__pyx_t_2);
23567  __Pyx_XDECREF(__pyx_t_3);
23568  if (__pyx_m) {
23569  if (__pyx_d) {
23570  __Pyx_AddTraceback("init csmoothers", __pyx_clineno, __pyx_lineno, __pyx_filename);
23571  }
23572  Py_CLEAR(__pyx_m);
23573  } else if (!PyErr_Occurred()) {
23574  PyErr_SetString(PyExc_ImportError, "init csmoothers");
23575  }
23576  __pyx_L0:;
23577  __Pyx_RefNannyFinishContext();
23578  #if CYTHON_PEP489_MULTI_PHASE_INIT
23579  return (__pyx_m != NULL) ? 0 : -1;
23580  #elif PY_MAJOR_VERSION >= 3
23581  return __pyx_m;
23582  #else
23583  return;
23584  #endif
23585 }
23586 
23587 /* --- Runtime support code --- */
23588 /* Refnanny */
23589 #if CYTHON_REFNANNY
23590 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
23591  PyObject *m = NULL, *p = NULL;
23592  void *r = NULL;
23593  m = PyImport_ImportModule(modname);
23594  if (!m) goto end;
23595  p = PyObject_GetAttrString(m, "RefNannyAPI");
23596  if (!p) goto end;
23597  r = PyLong_AsVoidPtr(p);
23598 end:
23599  Py_XDECREF(p);
23600  Py_XDECREF(m);
23601  return (__Pyx_RefNannyAPIStruct *)r;
23602 }
23603 #endif
23604 
23605 /* PyObjectGetAttrStr */
23606 #if CYTHON_USE_TYPE_SLOTS
23607 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
23608  PyTypeObject* tp = Py_TYPE(obj);
23609  if (likely(tp->tp_getattro))
23610  return tp->tp_getattro(obj, attr_name);
23611 #if PY_MAJOR_VERSION < 3
23612  if (likely(tp->tp_getattr))
23613  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
23614 #endif
23615  return PyObject_GetAttr(obj, attr_name);
23616 }
23617 #endif
23618 
23619 /* GetBuiltinName */
23620 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
23621  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
23622  if (unlikely(!result)) {
23623  PyErr_Format(PyExc_NameError,
23624 #if PY_MAJOR_VERSION >= 3
23625  "name '%U' is not defined", name);
23626 #else
23627  "name '%.200s' is not defined", PyString_AS_STRING(name));
23628 #endif
23629  }
23630  return result;
23631 }
23632 
23633 /* RaiseArgTupleInvalid */
23634 static void __Pyx_RaiseArgtupleInvalid(
23635  const char* func_name,
23636  int exact,
23637  Py_ssize_t num_min,
23638  Py_ssize_t num_max,
23639  Py_ssize_t num_found)
23640 {
23641  Py_ssize_t num_expected;
23642  const char *more_or_less;
23643  if (num_found < num_min) {
23644  num_expected = num_min;
23645  more_or_less = "at least";
23646  } else {
23647  num_expected = num_max;
23648  more_or_less = "at most";
23649  }
23650  if (exact) {
23651  more_or_less = "exactly";
23652  }
23653  PyErr_Format(PyExc_TypeError,
23654  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
23655  func_name, more_or_less, num_expected,
23656  (num_expected == 1) ? "" : "s", num_found);
23657 }
23658 
23659 /* RaiseDoubleKeywords */
23660 static void __Pyx_RaiseDoubleKeywordsError(
23661  const char* func_name,
23662  PyObject* kw_name)
23663 {
23664  PyErr_Format(PyExc_TypeError,
23665  #if PY_MAJOR_VERSION >= 3
23666  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23667  #else
23668  "%s() got multiple values for keyword argument '%s'", func_name,
23669  PyString_AsString(kw_name));
23670  #endif
23671 }
23672 
23673 /* ParseKeywords */
23674 static int __Pyx_ParseOptionalKeywords(
23675  PyObject *kwds,
23676  PyObject **argnames[],
23677  PyObject *kwds2,
23678  PyObject *values[],
23679  Py_ssize_t num_pos_args,
23680  const char* function_name)
23681 {
23682  PyObject *key = 0, *value = 0;
23683  Py_ssize_t pos = 0;
23684  PyObject*** name;
23685  PyObject*** first_kw_arg = argnames + num_pos_args;
23686  while (PyDict_Next(kwds, &pos, &key, &value)) {
23687  name = first_kw_arg;
23688  while (*name && (**name != key)) name++;
23689  if (*name) {
23690  values[name-argnames] = value;
23691  continue;
23692  }
23693  name = first_kw_arg;
23694  #if PY_MAJOR_VERSION < 3
23695  if (likely(PyString_Check(key))) {
23696  while (*name) {
23697  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
23698  && _PyString_Eq(**name, key)) {
23699  values[name-argnames] = value;
23700  break;
23701  }
23702  name++;
23703  }
23704  if (*name) continue;
23705  else {
23706  PyObject*** argname = argnames;
23707  while (argname != first_kw_arg) {
23708  if ((**argname == key) || (
23709  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
23710  && _PyString_Eq(**argname, key))) {
23711  goto arg_passed_twice;
23712  }
23713  argname++;
23714  }
23715  }
23716  } else
23717  #endif
23718  if (likely(PyUnicode_Check(key))) {
23719  while (*name) {
23720  int cmp = (**name == key) ? 0 :
23721  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23722  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23723  #endif
23724  PyUnicode_Compare(**name, key);
23725  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23726  if (cmp == 0) {
23727  values[name-argnames] = value;
23728  break;
23729  }
23730  name++;
23731  }
23732  if (*name) continue;
23733  else {
23734  PyObject*** argname = argnames;
23735  while (argname != first_kw_arg) {
23736  int cmp = (**argname == key) ? 0 :
23737  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23738  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23739  #endif
23740  PyUnicode_Compare(**argname, key);
23741  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23742  if (cmp == 0) goto arg_passed_twice;
23743  argname++;
23744  }
23745  }
23746  } else
23747  goto invalid_keyword_type;
23748  if (kwds2) {
23749  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
23750  } else {
23751  goto invalid_keyword;
23752  }
23753  }
23754  return 0;
23755 arg_passed_twice:
23756  __Pyx_RaiseDoubleKeywordsError(function_name, key);
23757  goto bad;
23758 invalid_keyword_type:
23759  PyErr_Format(PyExc_TypeError,
23760  "%.200s() keywords must be strings", function_name);
23761  goto bad;
23762 invalid_keyword:
23763  PyErr_Format(PyExc_TypeError,
23764  #if PY_MAJOR_VERSION < 3
23765  "%.200s() got an unexpected keyword argument '%.200s'",
23766  function_name, PyString_AsString(key));
23767  #else
23768  "%s() got an unexpected keyword argument '%U'",
23769  function_name, key);
23770  #endif
23771 bad:
23772  return -1;
23773 }
23774 
23775 /* PyObjectSetAttrStr */
23776 #if CYTHON_USE_TYPE_SLOTS
23777 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
23778  PyTypeObject* tp = Py_TYPE(obj);
23779  if (likely(tp->tp_setattro))
23780  return tp->tp_setattro(obj, attr_name, value);
23781 #if PY_MAJOR_VERSION < 3
23782  if (likely(tp->tp_setattr))
23783  return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
23784 #endif
23785  return PyObject_SetAttr(obj, attr_name, value);
23786 }
23787 #endif
23788 
23789 /* PyCFunctionFastCall */
23790 #if CYTHON_FAST_PYCCALL
23791 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
23792  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
23793  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
23794  PyObject *self = PyCFunction_GET_SELF(func);
23795  int flags = PyCFunction_GET_FLAGS(func);
23796  assert(PyCFunction_Check(func));
23797  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
23798  assert(nargs >= 0);
23799  assert(nargs == 0 || args != NULL);
23800  /* _PyCFunction_FastCallDict() must not be called with an exception set,
23801  because it may clear it (directly or indirectly) and so the
23802  caller loses its exception */
23803  assert(!PyErr_Occurred());
23804  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
23805  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
23806  } else {
23807  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
23808  }
23809 }
23810 #endif
23811 
23812 /* PyFunctionFastCall */
23813 #if CYTHON_FAST_PYCALL
23814 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
23815  PyObject *globals) {
23816  PyFrameObject *f;
23817  PyThreadState *tstate = __Pyx_PyThreadState_Current;
23818  PyObject **fastlocals;
23819  Py_ssize_t i;
23820  PyObject *result;
23821  assert(globals != NULL);
23822  /* XXX Perhaps we should create a specialized
23823  PyFrame_New() that doesn't take locals, but does
23824  take builtins without sanity checking them.
23825  */
23826  assert(tstate != NULL);
23827  f = PyFrame_New(tstate, co, globals, NULL);
23828  if (f == NULL) {
23829  return NULL;
23830  }
23831  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
23832  for (i = 0; i < na; i++) {
23833  Py_INCREF(*args);
23834  fastlocals[i] = *args++;
23835  }
23836  result = PyEval_EvalFrameEx(f,0);
23837  ++tstate->recursion_depth;
23838  Py_DECREF(f);
23839  --tstate->recursion_depth;
23840  return result;
23841 }
23842 #if 1 || PY_VERSION_HEX < 0x030600B1
23843 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
23844  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
23845  PyObject *globals = PyFunction_GET_GLOBALS(func);
23846  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
23847  PyObject *closure;
23848 #if PY_MAJOR_VERSION >= 3
23849  PyObject *kwdefs;
23850 #endif
23851  PyObject *kwtuple, **k;
23852  PyObject **d;
23853  Py_ssize_t nd;
23854  Py_ssize_t nk;
23855  PyObject *result;
23856  assert(kwargs == NULL || PyDict_Check(kwargs));
23857  nk = kwargs ? PyDict_Size(kwargs) : 0;
23858  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
23859  return NULL;
23860  }
23861  if (
23862 #if PY_MAJOR_VERSION >= 3
23863  co->co_kwonlyargcount == 0 &&
23864 #endif
23865  likely(kwargs == NULL || nk == 0) &&
23866  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
23867  if (argdefs == NULL && co->co_argcount == nargs) {
23868  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
23869  goto done;
23870  }
23871  else if (nargs == 0 && argdefs != NULL
23872  && co->co_argcount == Py_SIZE(argdefs)) {
23873  /* function called with no arguments, but all parameters have
23874  a default value: use default values as arguments .*/
23875  args = &PyTuple_GET_ITEM(argdefs, 0);
23876  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
23877  goto done;
23878  }
23879  }
23880  if (kwargs != NULL) {
23881  Py_ssize_t pos, i;
23882  kwtuple = PyTuple_New(2 * nk);
23883  if (kwtuple == NULL) {
23884  result = NULL;
23885  goto done;
23886  }
23887  k = &PyTuple_GET_ITEM(kwtuple, 0);
23888  pos = i = 0;
23889  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
23890  Py_INCREF(k[i]);
23891  Py_INCREF(k[i+1]);
23892  i += 2;
23893  }
23894  nk = i / 2;
23895  }
23896  else {
23897  kwtuple = NULL;
23898  k = NULL;
23899  }
23900  closure = PyFunction_GET_CLOSURE(func);
23901 #if PY_MAJOR_VERSION >= 3
23902  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
23903 #endif
23904  if (argdefs != NULL) {
23905  d = &PyTuple_GET_ITEM(argdefs, 0);
23906  nd = Py_SIZE(argdefs);
23907  }
23908  else {
23909  d = NULL;
23910  nd = 0;
23911  }
23912 #if PY_MAJOR_VERSION >= 3
23913  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
23914  args, (int)nargs,
23915  k, (int)nk,
23916  d, (int)nd, kwdefs, closure);
23917 #else
23918  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
23919  args, (int)nargs,
23920  k, (int)nk,
23921  d, (int)nd, closure);
23922 #endif
23923  Py_XDECREF(kwtuple);
23924 done:
23925  Py_LeaveRecursiveCall();
23926  return result;
23927 }
23928 #endif
23929 #endif
23930 
23931 /* PyObjectCall */
23932 #if CYTHON_COMPILING_IN_CPYTHON
23933 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
23934  PyObject *result;
23935  ternaryfunc call = Py_TYPE(func)->tp_call;
23936  if (unlikely(!call))
23937  return PyObject_Call(func, arg, kw);
23938  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
23939  return NULL;
23940  result = (*call)(func, arg, kw);
23941  Py_LeaveRecursiveCall();
23942  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
23943  PyErr_SetString(
23944  PyExc_SystemError,
23945  "NULL result without error in PyObject_Call");
23946  }
23947  return result;
23948 }
23949 #endif
23950 
23951 /* PyObjectCallMethO */
23952 #if CYTHON_COMPILING_IN_CPYTHON
23953 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
23954  PyObject *self, *result;
23955  PyCFunction cfunc;
23956  cfunc = PyCFunction_GET_FUNCTION(func);
23957  self = PyCFunction_GET_SELF(func);
23958  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
23959  return NULL;
23960  result = cfunc(self, arg);
23961  Py_LeaveRecursiveCall();
23962  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
23963  PyErr_SetString(
23964  PyExc_SystemError,
23965  "NULL result without error in PyObject_Call");
23966  }
23967  return result;
23968 }
23969 #endif
23970 
23971 /* PyObjectCallOneArg */
23972 #if CYTHON_COMPILING_IN_CPYTHON
23973 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23974  PyObject *result;
23975  PyObject *args = PyTuple_New(1);
23976  if (unlikely(!args)) return NULL;
23977  Py_INCREF(arg);
23978  PyTuple_SET_ITEM(args, 0, arg);
23979  result = __Pyx_PyObject_Call(func, args, NULL);
23980  Py_DECREF(args);
23981  return result;
23982 }
23983 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23984 #if CYTHON_FAST_PYCALL
23985  if (PyFunction_Check(func)) {
23986  return __Pyx_PyFunction_FastCall(func, &arg, 1);
23987  }
23988 #endif
23989  if (likely(PyCFunction_Check(func))) {
23990  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
23991  return __Pyx_PyObject_CallMethO(func, arg);
23992 #if CYTHON_FAST_PYCCALL
23993  } else if (__Pyx_PyFastCFunction_Check(func)) {
23994  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
23995 #endif
23996  }
23997  }
23998  return __Pyx__PyObject_CallOneArg(func, arg);
23999 }
24000 #else
24001 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24002  PyObject *result;
24003  PyObject *args = PyTuple_Pack(1, arg);
24004  if (unlikely(!args)) return NULL;
24005  result = __Pyx_PyObject_Call(func, args, NULL);
24006  Py_DECREF(args);
24007  return result;
24008 }
24009 #endif
24010 
24011 /* ArgTypeTest */
24012 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
24013 {
24014  if (unlikely(!type)) {
24015  PyErr_SetString(PyExc_SystemError, "Missing type object");
24016  return 0;
24017  }
24018  else if (exact) {
24019  #if PY_MAJOR_VERSION == 2
24020  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
24021  #endif
24022  }
24023  else {
24024  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
24025  }
24026  PyErr_Format(PyExc_TypeError,
24027  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
24028  name, type->tp_name, Py_TYPE(obj)->tp_name);
24029  return 0;
24030 }
24031 
24032 /* PyErrFetchRestore */
24033 #if CYTHON_FAST_THREAD_STATE
24034 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24035  PyObject *tmp_type, *tmp_value, *tmp_tb;
24036  tmp_type = tstate->curexc_type;
24037  tmp_value = tstate->curexc_value;
24038  tmp_tb = tstate->curexc_traceback;
24039  tstate->curexc_type = type;
24040  tstate->curexc_value = value;
24041  tstate->curexc_traceback = tb;
24042  Py_XDECREF(tmp_type);
24043  Py_XDECREF(tmp_value);
24044  Py_XDECREF(tmp_tb);
24045 }
24046 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24047  *type = tstate->curexc_type;
24048  *value = tstate->curexc_value;
24049  *tb = tstate->curexc_traceback;
24050  tstate->curexc_type = 0;
24051  tstate->curexc_value = 0;
24052  tstate->curexc_traceback = 0;
24053 }
24054 #endif
24055 
24056 /* RaiseException */
24057 #if PY_MAJOR_VERSION < 3
24058 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
24059  CYTHON_UNUSED PyObject *cause) {
24060  __Pyx_PyThreadState_declare
24061  Py_XINCREF(type);
24062  if (!value || value == Py_None)
24063  value = NULL;
24064  else
24065  Py_INCREF(value);
24066  if (!tb || tb == Py_None)
24067  tb = NULL;
24068  else {
24069  Py_INCREF(tb);
24070  if (!PyTraceBack_Check(tb)) {
24071  PyErr_SetString(PyExc_TypeError,
24072  "raise: arg 3 must be a traceback or None");
24073  goto raise_error;
24074  }
24075  }
24076  if (PyType_Check(type)) {
24077 #if CYTHON_COMPILING_IN_PYPY
24078  if (!value) {
24079  Py_INCREF(Py_None);
24080  value = Py_None;
24081  }
24082 #endif
24083  PyErr_NormalizeException(&type, &value, &tb);
24084  } else {
24085  if (value) {
24086  PyErr_SetString(PyExc_TypeError,
24087  "instance exception may not have a separate value");
24088  goto raise_error;
24089  }
24090  value = type;
24091  type = (PyObject*) Py_TYPE(type);
24092  Py_INCREF(type);
24093  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
24094  PyErr_SetString(PyExc_TypeError,
24095  "raise: exception class must be a subclass of BaseException");
24096  goto raise_error;
24097  }
24098  }
24099  __Pyx_PyThreadState_assign
24100  __Pyx_ErrRestore(type, value, tb);
24101  return;
24102 raise_error:
24103  Py_XDECREF(value);
24104  Py_XDECREF(type);
24105  Py_XDECREF(tb);
24106  return;
24107 }
24108 #else
24109 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
24110  PyObject* owned_instance = NULL;
24111  if (tb == Py_None) {
24112  tb = 0;
24113  } else if (tb && !PyTraceBack_Check(tb)) {
24114  PyErr_SetString(PyExc_TypeError,
24115  "raise: arg 3 must be a traceback or None");
24116  goto bad;
24117  }
24118  if (value == Py_None)
24119  value = 0;
24120  if (PyExceptionInstance_Check(type)) {
24121  if (value) {
24122  PyErr_SetString(PyExc_TypeError,
24123  "instance exception may not have a separate value");
24124  goto bad;
24125  }
24126  value = type;
24127  type = (PyObject*) Py_TYPE(value);
24128  } else if (PyExceptionClass_Check(type)) {
24129  PyObject *instance_class = NULL;
24130  if (value && PyExceptionInstance_Check(value)) {
24131  instance_class = (PyObject*) Py_TYPE(value);
24132  if (instance_class != type) {
24133  int is_subclass = PyObject_IsSubclass(instance_class, type);
24134  if (!is_subclass) {
24135  instance_class = NULL;
24136  } else if (unlikely(is_subclass == -1)) {
24137  goto bad;
24138  } else {
24139  type = instance_class;
24140  }
24141  }
24142  }
24143  if (!instance_class) {
24144  PyObject *args;
24145  if (!value)
24146  args = PyTuple_New(0);
24147  else if (PyTuple_Check(value)) {
24148  Py_INCREF(value);
24149  args = value;
24150  } else
24151  args = PyTuple_Pack(1, value);
24152  if (!args)
24153  goto bad;
24154  owned_instance = PyObject_Call(type, args, NULL);
24155  Py_DECREF(args);
24156  if (!owned_instance)
24157  goto bad;
24158  value = owned_instance;
24159  if (!PyExceptionInstance_Check(value)) {
24160  PyErr_Format(PyExc_TypeError,
24161  "calling %R should have returned an instance of "
24162  "BaseException, not %R",
24163  type, Py_TYPE(value));
24164  goto bad;
24165  }
24166  }
24167  } else {
24168  PyErr_SetString(PyExc_TypeError,
24169  "raise: exception class must be a subclass of BaseException");
24170  goto bad;
24171  }
24172  if (cause) {
24173  PyObject *fixed_cause;
24174  if (cause == Py_None) {
24175  fixed_cause = NULL;
24176  } else if (PyExceptionClass_Check(cause)) {
24177  fixed_cause = PyObject_CallObject(cause, NULL);
24178  if (fixed_cause == NULL)
24179  goto bad;
24180  } else if (PyExceptionInstance_Check(cause)) {
24181  fixed_cause = cause;
24182  Py_INCREF(fixed_cause);
24183  } else {
24184  PyErr_SetString(PyExc_TypeError,
24185  "exception causes must derive from "
24186  "BaseException");
24187  goto bad;
24188  }
24189  PyException_SetCause(value, fixed_cause);
24190  }
24191  PyErr_SetObject(type, value);
24192  if (tb) {
24193 #if CYTHON_COMPILING_IN_PYPY
24194  PyObject *tmp_type, *tmp_value, *tmp_tb;
24195  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
24196  Py_INCREF(tb);
24197  PyErr_Restore(tmp_type, tmp_value, tb);
24198  Py_XDECREF(tmp_tb);
24199 #else
24200  PyThreadState *tstate = __Pyx_PyThreadState_Current;
24201  PyObject* tmp_tb = tstate->curexc_traceback;
24202  if (tb != tmp_tb) {
24203  Py_INCREF(tb);
24204  tstate->curexc_traceback = tb;
24205  Py_XDECREF(tmp_tb);
24206  }
24207 #endif
24208  }
24209 bad:
24210  Py_XDECREF(owned_instance);
24211  return;
24212 }
24213 #endif
24214 
24215 /* ExtTypeTest */
24216 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
24217  if (unlikely(!type)) {
24218  PyErr_SetString(PyExc_SystemError, "Missing type object");
24219  return 0;
24220  }
24221  if (likely(__Pyx_TypeCheck(obj, type)))
24222  return 1;
24223  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
24224  Py_TYPE(obj)->tp_name, type->tp_name);
24225  return 0;
24226 }
24227 
24228 /* MemviewSliceInit */
24229 static int
24230 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
24231  int ndim,
24232  __Pyx_memviewslice *memviewslice,
24233  int memview_is_new_reference)
24234 {
24235  __Pyx_RefNannyDeclarations
24236  int i, retval=-1;
24237  Py_buffer *buf = &memview->view;
24238  __Pyx_RefNannySetupContext("init_memviewslice", 0);
24239  if (unlikely(memviewslice->memview || memviewslice->data)) {
24240  PyErr_SetString(PyExc_ValueError,
24241  "memviewslice is already initialized!");
24242  goto fail;
24243  }
24244  if (buf->strides) {
24245  for (i = 0; i < ndim; i++) {
24246  memviewslice->strides[i] = buf->strides[i];
24247  }
24248  } else {
24249  Py_ssize_t stride = buf->itemsize;
24250  for (i = ndim - 1; i >= 0; i--) {
24251  memviewslice->strides[i] = stride;
24252  stride *= buf->shape[i];
24253  }
24254  }
24255  for (i = 0; i < ndim; i++) {
24256  memviewslice->shape[i] = buf->shape[i];
24257  if (buf->suboffsets) {
24258  memviewslice->suboffsets[i] = buf->suboffsets[i];
24259  } else {
24260  memviewslice->suboffsets[i] = -1;
24261  }
24262  }
24263  memviewslice->memview = memview;
24264  memviewslice->data = (char *)buf->buf;
24265  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
24266  Py_INCREF(memview);
24267  }
24268  retval = 0;
24269  goto no_fail;
24270 fail:
24271  memviewslice->memview = 0;
24272  memviewslice->data = 0;
24273  retval = -1;
24274 no_fail:
24275  __Pyx_RefNannyFinishContext();
24276  return retval;
24277 }
24278 #ifndef Py_NO_RETURN
24279 #define Py_NO_RETURN
24280 #endif
24281 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
24282  va_list vargs;
24283  char msg[200];
24284 #ifdef HAVE_STDARG_PROTOTYPES
24285  va_start(vargs, fmt);
24286 #else
24287  va_start(vargs);
24288 #endif
24289  vsnprintf(msg, 200, fmt, vargs);
24290  va_end(vargs);
24291  Py_FatalError(msg);
24292 }
24293 static CYTHON_INLINE int
24294 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24295  PyThread_type_lock lock)
24296 {
24297  int result;
24298  PyThread_acquire_lock(lock, 1);
24299  result = (*acquisition_count)++;
24300  PyThread_release_lock(lock);
24301  return result;
24302 }
24303 static CYTHON_INLINE int
24304 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24305  PyThread_type_lock lock)
24306 {
24307  int result;
24308  PyThread_acquire_lock(lock, 1);
24309  result = (*acquisition_count)--;
24310  PyThread_release_lock(lock);
24311  return result;
24312 }
24313 static CYTHON_INLINE void
24314 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
24315 {
24316  int first_time;
24317  struct __pyx_memoryview_obj *memview = memslice->memview;
24318  if (unlikely(!memview || (PyObject *) memview == Py_None))
24319  return;
24320  if (unlikely(__pyx_get_slice_count(memview) < 0))
24321  __pyx_fatalerror("Acquisition count is %d (line %d)",
24322  __pyx_get_slice_count(memview), lineno);
24323  first_time = __pyx_add_acquisition_count(memview) == 0;
24324  if (unlikely(first_time)) {
24325  if (have_gil) {
24326  Py_INCREF((PyObject *) memview);
24327  } else {
24328  PyGILState_STATE _gilstate = PyGILState_Ensure();
24329  Py_INCREF((PyObject *) memview);
24330  PyGILState_Release(_gilstate);
24331  }
24332  }
24333 }
24334 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
24335  int have_gil, int lineno) {
24336  int last_time;
24337  struct __pyx_memoryview_obj *memview = memslice->memview;
24338  if (unlikely(!memview || (PyObject *) memview == Py_None)) {
24339  memslice->memview = NULL;
24340  return;
24341  }
24342  if (unlikely(__pyx_get_slice_count(memview) <= 0))
24343  __pyx_fatalerror("Acquisition count is %d (line %d)",
24344  __pyx_get_slice_count(memview), lineno);
24345  last_time = __pyx_sub_acquisition_count(memview) == 1;
24346  memslice->data = NULL;
24347  if (unlikely(last_time)) {
24348  if (have_gil) {
24349  Py_CLEAR(memslice->memview);
24350  } else {
24351  PyGILState_STATE _gilstate = PyGILState_Ensure();
24352  Py_CLEAR(memslice->memview);
24353  PyGILState_Release(_gilstate);
24354  }
24355  } else {
24356  memslice->memview = NULL;
24357  }
24358 }
24359 
24360 /* BufferIndexError */
24361 static void __Pyx_RaiseBufferIndexError(int axis) {
24362  PyErr_Format(PyExc_IndexError,
24363  "Out of bounds on buffer access (axis %d)", axis);
24364 }
24365 
24366 /* WriteUnraisableException */
24367 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
24368  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
24369  int full_traceback, CYTHON_UNUSED int nogil) {
24370  PyObject *old_exc, *old_val, *old_tb;
24371  PyObject *ctx;
24372  __Pyx_PyThreadState_declare
24373 #ifdef WITH_THREAD
24374  PyGILState_STATE state;
24375  if (nogil)
24376  state = PyGILState_Ensure();
24377 #ifdef _MSC_VER
24378  else state = (PyGILState_STATE)-1;
24379 #endif
24380 #endif
24381  __Pyx_PyThreadState_assign
24382  __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
24383  if (full_traceback) {
24384  Py_XINCREF(old_exc);
24385  Py_XINCREF(old_val);
24386  Py_XINCREF(old_tb);
24387  __Pyx_ErrRestore(old_exc, old_val, old_tb);
24388  PyErr_PrintEx(1);
24389  }
24390  #if PY_MAJOR_VERSION < 3
24391  ctx = PyString_FromString(name);
24392  #else
24393  ctx = PyUnicode_FromString(name);
24394  #endif
24395  __Pyx_ErrRestore(old_exc, old_val, old_tb);
24396  if (!ctx) {
24397  PyErr_WriteUnraisable(Py_None);
24398  } else {
24399  PyErr_WriteUnraisable(ctx);
24400  Py_DECREF(ctx);
24401  }
24402 #ifdef WITH_THREAD
24403  if (nogil)
24404  PyGILState_Release(state);
24405 #endif
24406 }
24407 
24408 /* GetTopmostException */
24409 #if CYTHON_USE_EXC_INFO_STACK
24410 static _PyErr_StackItem *
24411 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
24412 {
24413  _PyErr_StackItem *exc_info = tstate->exc_info;
24414  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
24415  exc_info->previous_item != NULL)
24416  {
24417  exc_info = exc_info->previous_item;
24418  }
24419  return exc_info;
24420 }
24421 #endif
24422 
24423 /* SaveResetException */
24424 #if CYTHON_FAST_THREAD_STATE
24425 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24426  #if CYTHON_USE_EXC_INFO_STACK
24427  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
24428  *type = exc_info->exc_type;
24429  *value = exc_info->exc_value;
24430  *tb = exc_info->exc_traceback;
24431  #else
24432  *type = tstate->exc_type;
24433  *value = tstate->exc_value;
24434  *tb = tstate->exc_traceback;
24435  #endif
24436  Py_XINCREF(*type);
24437  Py_XINCREF(*value);
24438  Py_XINCREF(*tb);
24439 }
24440 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24441  PyObject *tmp_type, *tmp_value, *tmp_tb;
24442  #if CYTHON_USE_EXC_INFO_STACK
24443  _PyErr_StackItem *exc_info = tstate->exc_info;
24444  tmp_type = exc_info->exc_type;
24445  tmp_value = exc_info->exc_value;
24446  tmp_tb = exc_info->exc_traceback;
24447  exc_info->exc_type = type;
24448  exc_info->exc_value = value;
24449  exc_info->exc_traceback = tb;
24450  #else
24451  tmp_type = tstate->exc_type;
24452  tmp_value = tstate->exc_value;
24453  tmp_tb = tstate->exc_traceback;
24454  tstate->exc_type = type;
24455  tstate->exc_value = value;
24456  tstate->exc_traceback = tb;
24457  #endif
24458  Py_XDECREF(tmp_type);
24459  Py_XDECREF(tmp_value);
24460  Py_XDECREF(tmp_tb);
24461 }
24462 #endif
24463 
24464 /* PyErrExceptionMatches */
24465 #if CYTHON_FAST_THREAD_STATE
24466 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24467  Py_ssize_t i, n;
24468  n = PyTuple_GET_SIZE(tuple);
24469 #if PY_MAJOR_VERSION >= 3
24470  for (i=0; i<n; i++) {
24471  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
24472  }
24473 #endif
24474  for (i=0; i<n; i++) {
24475  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
24476  }
24477  return 0;
24478 }
24479 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
24480  PyObject *exc_type = tstate->curexc_type;
24481  if (exc_type == err) return 1;
24482  if (unlikely(!exc_type)) return 0;
24483  if (unlikely(PyTuple_Check(err)))
24484  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
24485  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
24486 }
24487 #endif
24488 
24489 /* GetException */
24490 #if CYTHON_FAST_THREAD_STATE
24491 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
24492 #else
24493 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
24494 #endif
24495 {
24496  PyObject *local_type, *local_value, *local_tb;
24497 #if CYTHON_FAST_THREAD_STATE
24498  PyObject *tmp_type, *tmp_value, *tmp_tb;
24499  local_type = tstate->curexc_type;
24500  local_value = tstate->curexc_value;
24501  local_tb = tstate->curexc_traceback;
24502  tstate->curexc_type = 0;
24503  tstate->curexc_value = 0;
24504  tstate->curexc_traceback = 0;
24505 #else
24506  PyErr_Fetch(&local_type, &local_value, &local_tb);
24507 #endif
24508  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
24509 #if CYTHON_FAST_THREAD_STATE
24510  if (unlikely(tstate->curexc_type))
24511 #else
24512  if (unlikely(PyErr_Occurred()))
24513 #endif
24514  goto bad;
24515  #if PY_MAJOR_VERSION >= 3
24516  if (local_tb) {
24517  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
24518  goto bad;
24519  }
24520  #endif
24521  Py_XINCREF(local_tb);
24522  Py_XINCREF(local_type);
24523  Py_XINCREF(local_value);
24524  *type = local_type;
24525  *value = local_value;
24526  *tb = local_tb;
24527 #if CYTHON_FAST_THREAD_STATE
24528  #if CYTHON_USE_EXC_INFO_STACK
24529  {
24530  _PyErr_StackItem *exc_info = tstate->exc_info;
24531  tmp_type = exc_info->exc_type;
24532  tmp_value = exc_info->exc_value;
24533  tmp_tb = exc_info->exc_traceback;
24534  exc_info->exc_type = local_type;
24535  exc_info->exc_value = local_value;
24536  exc_info->exc_traceback = local_tb;
24537  }
24538  #else
24539  tmp_type = tstate->exc_type;
24540  tmp_value = tstate->exc_value;
24541  tmp_tb = tstate->exc_traceback;
24542  tstate->exc_type = local_type;
24543  tstate->exc_value = local_value;
24544  tstate->exc_traceback = local_tb;
24545  #endif
24546  Py_XDECREF(tmp_type);
24547  Py_XDECREF(tmp_value);
24548  Py_XDECREF(tmp_tb);
24549 #else
24550  PyErr_SetExcInfo(local_type, local_value, local_tb);
24551 #endif
24552  return 0;
24553 bad:
24554  *type = 0;
24555  *value = 0;
24556  *tb = 0;
24557  Py_XDECREF(local_type);
24558  Py_XDECREF(local_value);
24559  Py_XDECREF(local_tb);
24560  return -1;
24561 }
24562 
24563 /* PyObjectCall2Args */
24564 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
24565  PyObject *args, *result = NULL;
24566  #if CYTHON_FAST_PYCALL
24567  if (PyFunction_Check(function)) {
24568  PyObject *args[2] = {arg1, arg2};
24569  return __Pyx_PyFunction_FastCall(function, args, 2);
24570  }
24571  #endif
24572  #if CYTHON_FAST_PYCCALL
24573  if (__Pyx_PyFastCFunction_Check(function)) {
24574  PyObject *args[2] = {arg1, arg2};
24575  return __Pyx_PyCFunction_FastCall(function, args, 2);
24576  }
24577  #endif
24578  args = PyTuple_New(2);
24579  if (unlikely(!args)) goto done;
24580  Py_INCREF(arg1);
24581  PyTuple_SET_ITEM(args, 0, arg1);
24582  Py_INCREF(arg2);
24583  PyTuple_SET_ITEM(args, 1, arg2);
24584  Py_INCREF(function);
24585  result = __Pyx_PyObject_Call(function, args, NULL);
24586  Py_DECREF(args);
24587  Py_DECREF(function);
24588 done:
24589  return result;
24590 }
24591 
24592 /* BytesEquals */
24593 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
24594 #if CYTHON_COMPILING_IN_PYPY
24595  return PyObject_RichCompareBool(s1, s2, equals);
24596 #else
24597  if (s1 == s2) {
24598  return (equals == Py_EQ);
24599  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
24600  const char *ps1, *ps2;
24601  Py_ssize_t length = PyBytes_GET_SIZE(s1);
24602  if (length != PyBytes_GET_SIZE(s2))
24603  return (equals == Py_NE);
24604  ps1 = PyBytes_AS_STRING(s1);
24605  ps2 = PyBytes_AS_STRING(s2);
24606  if (ps1[0] != ps2[0]) {
24607  return (equals == Py_NE);
24608  } else if (length == 1) {
24609  return (equals == Py_EQ);
24610  } else {
24611  int result;
24612 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
24613  Py_hash_t hash1, hash2;
24614  hash1 = ((PyBytesObject*)s1)->ob_shash;
24615  hash2 = ((PyBytesObject*)s2)->ob_shash;
24616  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
24617  return (equals == Py_NE);
24618  }
24619 #endif
24620  result = memcmp(ps1, ps2, (size_t)length);
24621  return (equals == Py_EQ) ? (result == 0) : (result != 0);
24622  }
24623  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
24624  return (equals == Py_NE);
24625  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
24626  return (equals == Py_NE);
24627  } else {
24628  int result;
24629  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24630  if (!py_result)
24631  return -1;
24632  result = __Pyx_PyObject_IsTrue(py_result);
24633  Py_DECREF(py_result);
24634  return result;
24635  }
24636 #endif
24637 }
24638 
24639 /* UnicodeEquals */
24640 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
24641 #if CYTHON_COMPILING_IN_PYPY
24642  return PyObject_RichCompareBool(s1, s2, equals);
24643 #else
24644 #if PY_MAJOR_VERSION < 3
24645  PyObject* owned_ref = NULL;
24646 #endif
24647  int s1_is_unicode, s2_is_unicode;
24648  if (s1 == s2) {
24649  goto return_eq;
24650  }
24651  s1_is_unicode = PyUnicode_CheckExact(s1);
24652  s2_is_unicode = PyUnicode_CheckExact(s2);
24653 #if PY_MAJOR_VERSION < 3
24654  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
24655  owned_ref = PyUnicode_FromObject(s2);
24656  if (unlikely(!owned_ref))
24657  return -1;
24658  s2 = owned_ref;
24659  s2_is_unicode = 1;
24660  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
24661  owned_ref = PyUnicode_FromObject(s1);
24662  if (unlikely(!owned_ref))
24663  return -1;
24664  s1 = owned_ref;
24665  s1_is_unicode = 1;
24666  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
24667  return __Pyx_PyBytes_Equals(s1, s2, equals);
24668  }
24669 #endif
24670  if (s1_is_unicode & s2_is_unicode) {
24671  Py_ssize_t length;
24672  int kind;
24673  void *data1, *data2;
24674  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
24675  return -1;
24676  length = __Pyx_PyUnicode_GET_LENGTH(s1);
24677  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
24678  goto return_ne;
24679  }
24680 #if CYTHON_USE_UNICODE_INTERNALS
24681  {
24682  Py_hash_t hash1, hash2;
24683  #if CYTHON_PEP393_ENABLED
24684  hash1 = ((PyASCIIObject*)s1)->hash;
24685  hash2 = ((PyASCIIObject*)s2)->hash;
24686  #else
24687  hash1 = ((PyUnicodeObject*)s1)->hash;
24688  hash2 = ((PyUnicodeObject*)s2)->hash;
24689  #endif
24690  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
24691  goto return_ne;
24692  }
24693  }
24694 #endif
24695  kind = __Pyx_PyUnicode_KIND(s1);
24696  if (kind != __Pyx_PyUnicode_KIND(s2)) {
24697  goto return_ne;
24698  }
24699  data1 = __Pyx_PyUnicode_DATA(s1);
24700  data2 = __Pyx_PyUnicode_DATA(s2);
24701  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
24702  goto return_ne;
24703  } else if (length == 1) {
24704  goto return_eq;
24705  } else {
24706  int result = memcmp(data1, data2, (size_t)(length * kind));
24707  #if PY_MAJOR_VERSION < 3
24708  Py_XDECREF(owned_ref);
24709  #endif
24710  return (equals == Py_EQ) ? (result == 0) : (result != 0);
24711  }
24712  } else if ((s1 == Py_None) & s2_is_unicode) {
24713  goto return_ne;
24714  } else if ((s2 == Py_None) & s1_is_unicode) {
24715  goto return_ne;
24716  } else {
24717  int result;
24718  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24719  #if PY_MAJOR_VERSION < 3
24720  Py_XDECREF(owned_ref);
24721  #endif
24722  if (!py_result)
24723  return -1;
24724  result = __Pyx_PyObject_IsTrue(py_result);
24725  Py_DECREF(py_result);
24726  return result;
24727  }
24728 return_eq:
24729  #if PY_MAJOR_VERSION < 3
24730  Py_XDECREF(owned_ref);
24731  #endif
24732  return (equals == Py_EQ);
24733 return_ne:
24734  #if PY_MAJOR_VERSION < 3
24735  Py_XDECREF(owned_ref);
24736  #endif
24737  return (equals == Py_NE);
24738 #endif
24739 }
24740 
24741 /* DivInt[Py_ssize_t] */
24742 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
24743  Py_ssize_t q = a / b;
24744  Py_ssize_t r = a - q*b;
24745  q -= ((r != 0) & ((r ^ b) < 0));
24746  return q;
24747 }
24748 
24749 /* GetAttr */
24750 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
24751 #if CYTHON_USE_TYPE_SLOTS
24752 #if PY_MAJOR_VERSION >= 3
24753  if (likely(PyUnicode_Check(n)))
24754 #else
24755  if (likely(PyString_Check(n)))
24756 #endif
24757  return __Pyx_PyObject_GetAttrStr(o, n);
24758 #endif
24759  return PyObject_GetAttr(o, n);
24760 }
24761 
24762 /* GetItemInt */
24763 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24764  PyObject *r;
24765  if (!j) return NULL;
24766  r = PyObject_GetItem(o, j);
24767  Py_DECREF(j);
24768  return r;
24769 }
24770 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24771  CYTHON_NCP_UNUSED int wraparound,
24772  CYTHON_NCP_UNUSED int boundscheck) {
24773 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24774  Py_ssize_t wrapped_i = i;
24775  if (wraparound & unlikely(i < 0)) {
24776  wrapped_i += PyList_GET_SIZE(o);
24777  }
24778  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
24779  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
24780  Py_INCREF(r);
24781  return r;
24782  }
24783  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24784 #else
24785  return PySequence_GetItem(o, i);
24786 #endif
24787 }
24788 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24789  CYTHON_NCP_UNUSED int wraparound,
24790  CYTHON_NCP_UNUSED int boundscheck) {
24791 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24792  Py_ssize_t wrapped_i = i;
24793  if (wraparound & unlikely(i < 0)) {
24794  wrapped_i += PyTuple_GET_SIZE(o);
24795  }
24796  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
24797  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
24798  Py_INCREF(r);
24799  return r;
24800  }
24801  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24802 #else
24803  return PySequence_GetItem(o, i);
24804 #endif
24805 }
24806 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
24807  CYTHON_NCP_UNUSED int wraparound,
24808  CYTHON_NCP_UNUSED int boundscheck) {
24809 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
24810  if (is_list || PyList_CheckExact(o)) {
24811  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24812  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
24813  PyObject *r = PyList_GET_ITEM(o, n);
24814  Py_INCREF(r);
24815  return r;
24816  }
24817  }
24818  else if (PyTuple_CheckExact(o)) {
24819  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24820  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
24821  PyObject *r = PyTuple_GET_ITEM(o, n);
24822  Py_INCREF(r);
24823  return r;
24824  }
24825  } else {
24826  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24827  if (likely(m && m->sq_item)) {
24828  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24829  Py_ssize_t l = m->sq_length(o);
24830  if (likely(l >= 0)) {
24831  i += l;
24832  } else {
24833  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24834  return NULL;
24835  PyErr_Clear();
24836  }
24837  }
24838  return m->sq_item(o, i);
24839  }
24840  }
24841 #else
24842  if (is_list || PySequence_Check(o)) {
24843  return PySequence_GetItem(o, i);
24844  }
24845 #endif
24846  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24847 }
24848 
24849 /* ObjectGetItem */
24850 #if CYTHON_USE_TYPE_SLOTS
24851 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
24852  PyObject *runerr;
24853  Py_ssize_t key_value;
24854  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
24855  if (unlikely(!(m && m->sq_item))) {
24856  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
24857  return NULL;
24858  }
24859  key_value = __Pyx_PyIndex_AsSsize_t(index);
24860  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
24861  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
24862  }
24863  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
24864  PyErr_Clear();
24865  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
24866  }
24867  return NULL;
24868 }
24869 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
24870  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
24871  if (likely(m && m->mp_subscript)) {
24872  return m->mp_subscript(obj, key);
24873  }
24874  return __Pyx_PyObject_GetIndex(obj, key);
24875 }
24876 #endif
24877 
24878 /* decode_c_string */
24879 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
24880  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
24881  const char* encoding, const char* errors,
24882  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
24883  Py_ssize_t length;
24884  if (unlikely((start < 0) | (stop < 0))) {
24885  size_t slen = strlen(cstring);
24886  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
24887  PyErr_SetString(PyExc_OverflowError,
24888  "c-string too long to convert to Python");
24889  return NULL;
24890  }
24891  length = (Py_ssize_t) slen;
24892  if (start < 0) {
24893  start += length;
24894  if (start < 0)
24895  start = 0;
24896  }
24897  if (stop < 0)
24898  stop += length;
24899  }
24900  if (unlikely(stop <= start))
24901  return __Pyx_NewRef(__pyx_empty_unicode);
24902  length = stop - start;
24903  cstring += start;
24904  if (decode_func) {
24905  return decode_func(cstring, length, errors);
24906  } else {
24907  return PyUnicode_Decode(cstring, length, encoding, errors);
24908  }
24909 }
24910 
24911 /* GetAttr3 */
24912 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
24913  __Pyx_PyThreadState_declare
24914  __Pyx_PyThreadState_assign
24915  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
24916  return NULL;
24917  __Pyx_PyErr_Clear();
24918  Py_INCREF(d);
24919  return d;
24920 }
24921 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
24922  PyObject *r = __Pyx_GetAttr(o, n);
24923  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
24924 }
24925 
24926 /* PyDictVersioning */
24927 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
24928 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
24929  PyObject *dict = Py_TYPE(obj)->tp_dict;
24930  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
24931 }
24932 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
24933  PyObject **dictptr = NULL;
24934  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
24935  if (offset) {
24936 #if CYTHON_COMPILING_IN_CPYTHON
24937  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
24938 #else
24939  dictptr = _PyObject_GetDictPtr(obj);
24940 #endif
24941  }
24942  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
24943 }
24944 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
24945  PyObject *dict = Py_TYPE(obj)->tp_dict;
24946  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
24947  return 0;
24948  return obj_dict_version == __Pyx_get_object_dict_version(obj);
24949 }
24950 #endif
24951 
24952 /* GetModuleGlobalName */
24953 #if CYTHON_USE_DICT_VERSIONS
24954 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
24955 #else
24956 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
24957 #endif
24958 {
24959  PyObject *result;
24960 #if !CYTHON_AVOID_BORROWED_REFS
24961 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
24962  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
24963  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24964  if (likely(result)) {
24965  return __Pyx_NewRef(result);
24966  } else if (unlikely(PyErr_Occurred())) {
24967  return NULL;
24968  }
24969 #else
24970  result = PyDict_GetItem(__pyx_d, name);
24971  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24972  if (likely(result)) {
24973  return __Pyx_NewRef(result);
24974  }
24975 #endif
24976 #else
24977  result = PyObject_GetItem(__pyx_d, name);
24978  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24979  if (likely(result)) {
24980  return __Pyx_NewRef(result);
24981  }
24982  PyErr_Clear();
24983 #endif
24984  return __Pyx_GetBuiltinName(name);
24985 }
24986 
24987 /* RaiseTooManyValuesToUnpack */
24988 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
24989  PyErr_Format(PyExc_ValueError,
24990  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
24991 }
24992 
24993 /* RaiseNeedMoreValuesToUnpack */
24994 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
24995  PyErr_Format(PyExc_ValueError,
24996  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
24997  index, (index == 1) ? "" : "s");
24998 }
24999 
25000 /* RaiseNoneIterError */
25001 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
25002  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
25003 }
25004 
25005 /* SwapException */
25006 #if CYTHON_FAST_THREAD_STATE
25007 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25008  PyObject *tmp_type, *tmp_value, *tmp_tb;
25009  #if CYTHON_USE_EXC_INFO_STACK
25010  _PyErr_StackItem *exc_info = tstate->exc_info;
25011  tmp_type = exc_info->exc_type;
25012  tmp_value = exc_info->exc_value;
25013  tmp_tb = exc_info->exc_traceback;
25014  exc_info->exc_type = *type;
25015  exc_info->exc_value = *value;
25016  exc_info->exc_traceback = *tb;
25017  #else
25018  tmp_type = tstate->exc_type;
25019  tmp_value = tstate->exc_value;
25020  tmp_tb = tstate->exc_traceback;
25021  tstate->exc_type = *type;
25022  tstate->exc_value = *value;
25023  tstate->exc_traceback = *tb;
25024  #endif
25025  *type = tmp_type;
25026  *value = tmp_value;
25027  *tb = tmp_tb;
25028 }
25029 #else
25030 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
25031  PyObject *tmp_type, *tmp_value, *tmp_tb;
25032  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
25033  PyErr_SetExcInfo(*type, *value, *tb);
25034  *type = tmp_type;
25035  *value = tmp_value;
25036  *tb = tmp_tb;
25037 }
25038 #endif
25039 
25040 /* Import */
25041 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
25042  PyObject *empty_list = 0;
25043  PyObject *module = 0;
25044  PyObject *global_dict = 0;
25045  PyObject *empty_dict = 0;
25046  PyObject *list;
25047  #if PY_MAJOR_VERSION < 3
25048  PyObject *py_import;
25049  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25050  if (!py_import)
25051  goto bad;
25052  #endif
25053  if (from_list)
25054  list = from_list;
25055  else {
25056  empty_list = PyList_New(0);
25057  if (!empty_list)
25058  goto bad;
25059  list = empty_list;
25060  }
25061  global_dict = PyModule_GetDict(__pyx_m);
25062  if (!global_dict)
25063  goto bad;
25064  empty_dict = PyDict_New();
25065  if (!empty_dict)
25066  goto bad;
25067  {
25068  #if PY_MAJOR_VERSION >= 3
25069  if (level == -1) {
25070  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
25071  module = PyImport_ImportModuleLevelObject(
25072  name, global_dict, empty_dict, list, 1);
25073  if (!module) {
25074  if (!PyErr_ExceptionMatches(PyExc_ImportError))
25075  goto bad;
25076  PyErr_Clear();
25077  }
25078  }
25079  level = 0;
25080  }
25081  #endif
25082  if (!module) {
25083  #if PY_MAJOR_VERSION < 3
25084  PyObject *py_level = PyInt_FromLong(level);
25085  if (!py_level)
25086  goto bad;
25087  module = PyObject_CallFunctionObjArgs(py_import,
25088  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
25089  Py_DECREF(py_level);
25090  #else
25091  module = PyImport_ImportModuleLevelObject(
25092  name, global_dict, empty_dict, list, level);
25093  #endif
25094  }
25095  }
25096 bad:
25097  #if PY_MAJOR_VERSION < 3
25098  Py_XDECREF(py_import);
25099  #endif
25100  Py_XDECREF(empty_list);
25101  Py_XDECREF(empty_dict);
25102  return module;
25103 }
25104 
25105 /* FastTypeChecks */
25106 #if CYTHON_COMPILING_IN_CPYTHON
25107 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
25108  while (a) {
25109  a = a->tp_base;
25110  if (a == b)
25111  return 1;
25112  }
25113  return b == &PyBaseObject_Type;
25114 }
25115 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
25116  PyObject *mro;
25117  if (a == b) return 1;
25118  mro = a->tp_mro;
25119  if (likely(mro)) {
25120  Py_ssize_t i, n;
25121  n = PyTuple_GET_SIZE(mro);
25122  for (i = 0; i < n; i++) {
25123  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
25124  return 1;
25125  }
25126  return 0;
25127  }
25128  return __Pyx_InBases(a, b);
25129 }
25130 #if PY_MAJOR_VERSION == 2
25131 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
25132  PyObject *exception, *value, *tb;
25133  int res;
25134  __Pyx_PyThreadState_declare
25135  __Pyx_PyThreadState_assign
25136  __Pyx_ErrFetch(&exception, &value, &tb);
25137  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
25138  if (unlikely(res == -1)) {
25139  PyErr_WriteUnraisable(err);
25140  res = 0;
25141  }
25142  if (!res) {
25143  res = PyObject_IsSubclass(err, exc_type2);
25144  if (unlikely(res == -1)) {
25145  PyErr_WriteUnraisable(err);
25146  res = 0;
25147  }
25148  }
25149  __Pyx_ErrRestore(exception, value, tb);
25150  return res;
25151 }
25152 #else
25153 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
25154  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
25155  if (!res) {
25156  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
25157  }
25158  return res;
25159 }
25160 #endif
25161 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25162  Py_ssize_t i, n;
25163  assert(PyExceptionClass_Check(exc_type));
25164  n = PyTuple_GET_SIZE(tuple);
25165 #if PY_MAJOR_VERSION >= 3
25166  for (i=0; i<n; i++) {
25167  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
25168  }
25169 #endif
25170  for (i=0; i<n; i++) {
25171  PyObject *t = PyTuple_GET_ITEM(tuple, i);
25172  #if PY_MAJOR_VERSION < 3
25173  if (likely(exc_type == t)) return 1;
25174  #endif
25175  if (likely(PyExceptionClass_Check(t))) {
25176  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
25177  } else {
25178  }
25179  }
25180  return 0;
25181 }
25182 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
25183  if (likely(err == exc_type)) return 1;
25184  if (likely(PyExceptionClass_Check(err))) {
25185  if (likely(PyExceptionClass_Check(exc_type))) {
25186  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
25187  } else if (likely(PyTuple_Check(exc_type))) {
25188  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
25189  } else {
25190  }
25191  }
25192  return PyErr_GivenExceptionMatches(err, exc_type);
25193 }
25194 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
25195  assert(PyExceptionClass_Check(exc_type1));
25196  assert(PyExceptionClass_Check(exc_type2));
25197  if (likely(err == exc_type1 || err == exc_type2)) return 1;
25198  if (likely(PyExceptionClass_Check(err))) {
25199  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
25200  }
25201  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
25202 }
25203 #endif
25204 
25205 /* PyIntBinop */
25206 #if !CYTHON_COMPILING_IN_PYPY
25207 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
25208  (void)inplace;
25209  (void)zerodivision_check;
25210  #if PY_MAJOR_VERSION < 3
25211  if (likely(PyInt_CheckExact(op1))) {
25212  const long b = intval;
25213  long x;
25214  long a = PyInt_AS_LONG(op1);
25215  x = (long)((unsigned long)a + b);
25216  if (likely((x^a) >= 0 || (x^b) >= 0))
25217  return PyInt_FromLong(x);
25218  return PyLong_Type.tp_as_number->nb_add(op1, op2);
25219  }
25220  #endif
25221  #if CYTHON_USE_PYLONG_INTERNALS
25222  if (likely(PyLong_CheckExact(op1))) {
25223  const long b = intval;
25224  long a, x;
25225 #ifdef HAVE_LONG_LONG
25226  const PY_LONG_LONG llb = intval;
25227  PY_LONG_LONG lla, llx;
25228 #endif
25229  const digit* digits = ((PyLongObject*)op1)->ob_digit;
25230  const Py_ssize_t size = Py_SIZE(op1);
25231  if (likely(__Pyx_sst_abs(size) <= 1)) {
25232  a = likely(size) ? digits[0] : 0;
25233  if (size == -1) a = -a;
25234  } else {
25235  switch (size) {
25236  case -2:
25237  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
25238  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25239  break;
25240 #ifdef HAVE_LONG_LONG
25241  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25242  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25243  goto long_long;
25244 #endif
25245  }
25246  CYTHON_FALLTHROUGH;
25247  case 2:
25248  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
25249  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25250  break;
25251 #ifdef HAVE_LONG_LONG
25252  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25253  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25254  goto long_long;
25255 #endif
25256  }
25257  CYTHON_FALLTHROUGH;
25258  case -3:
25259  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
25260  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25261  break;
25262 #ifdef HAVE_LONG_LONG
25263  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25264  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]));
25265  goto long_long;
25266 #endif
25267  }
25268  CYTHON_FALLTHROUGH;
25269  case 3:
25270  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
25271  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25272  break;
25273 #ifdef HAVE_LONG_LONG
25274  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25275  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]));
25276  goto long_long;
25277 #endif
25278  }
25279  CYTHON_FALLTHROUGH;
25280  case -4:
25281  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
25282  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25283  break;
25284 #ifdef HAVE_LONG_LONG
25285  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25286  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]));
25287  goto long_long;
25288 #endif
25289  }
25290  CYTHON_FALLTHROUGH;
25291  case 4:
25292  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
25293  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25294  break;
25295 #ifdef HAVE_LONG_LONG
25296  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25297  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]));
25298  goto long_long;
25299 #endif
25300  }
25301  CYTHON_FALLTHROUGH;
25302  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
25303  }
25304  }
25305  x = a + b;
25306  return PyLong_FromLong(x);
25307 #ifdef HAVE_LONG_LONG
25308  long_long:
25309  llx = lla + llb;
25310  return PyLong_FromLongLong(llx);
25311 #endif
25312 
25313 
25314  }
25315  #endif
25316  if (PyFloat_CheckExact(op1)) {
25317  const long b = intval;
25318  double a = PyFloat_AS_DOUBLE(op1);
25319  double result;
25320  PyFPE_START_PROTECT("add", return NULL)
25321  result = ((double)a) + (double)b;
25322  PyFPE_END_PROTECT(result)
25323  return PyFloat_FromDouble(result);
25324  }
25325  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
25326 }
25327 #endif
25328 
25329 /* None */
25330 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
25331  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
25332 }
25333 
25334 /* DivInt[long] */
25335 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
25336  long q = a / b;
25337  long r = a - q*b;
25338  q -= ((r != 0) & ((r ^ b) < 0));
25339  return q;
25340 }
25341 
25342 /* ImportFrom */
25343 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
25344  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
25345  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25346  PyErr_Format(PyExc_ImportError,
25347  #if PY_MAJOR_VERSION < 3
25348  "cannot import name %.230s", PyString_AS_STRING(name));
25349  #else
25350  "cannot import name %S", name);
25351  #endif
25352  }
25353  return value;
25354 }
25355 
25356 /* HasAttr */
25357 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
25358  PyObject *r;
25359  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
25360  PyErr_SetString(PyExc_TypeError,
25361  "hasattr(): attribute name must be string");
25362  return -1;
25363  }
25364  r = __Pyx_GetAttr(o, n);
25365  if (unlikely(!r)) {
25366  PyErr_Clear();
25367  return 0;
25368  } else {
25369  Py_DECREF(r);
25370  return 1;
25371  }
25372 }
25373 
25374 /* PyObject_GenericGetAttrNoDict */
25375 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25376 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
25377  PyErr_Format(PyExc_AttributeError,
25378 #if PY_MAJOR_VERSION >= 3
25379  "'%.50s' object has no attribute '%U'",
25380  tp->tp_name, attr_name);
25381 #else
25382  "'%.50s' object has no attribute '%.400s'",
25383  tp->tp_name, PyString_AS_STRING(attr_name));
25384 #endif
25385  return NULL;
25386 }
25387 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
25388  PyObject *descr;
25389  PyTypeObject *tp = Py_TYPE(obj);
25390  if (unlikely(!PyString_Check(attr_name))) {
25391  return PyObject_GenericGetAttr(obj, attr_name);
25392  }
25393  assert(!tp->tp_dictoffset);
25394  descr = _PyType_Lookup(tp, attr_name);
25395  if (unlikely(!descr)) {
25396  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
25397  }
25398  Py_INCREF(descr);
25399  #if PY_MAJOR_VERSION < 3
25400  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
25401  #endif
25402  {
25403  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
25404  if (unlikely(f)) {
25405  PyObject *res = f(descr, obj, (PyObject *)tp);
25406  Py_DECREF(descr);
25407  return res;
25408  }
25409  }
25410  return descr;
25411 }
25412 #endif
25413 
25414 /* PyObject_GenericGetAttr */
25415 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25416 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
25417  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
25418  return PyObject_GenericGetAttr(obj, attr_name);
25419  }
25420  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
25421 }
25422 #endif
25423 
25424 /* PyObjectGetAttrStrNoError */
25425 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
25426  __Pyx_PyThreadState_declare
25427  __Pyx_PyThreadState_assign
25428  if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25429  __Pyx_PyErr_Clear();
25430 }
25431 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
25432  PyObject *result;
25433 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
25434  PyTypeObject* tp = Py_TYPE(obj);
25435  if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
25436  return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
25437  }
25438 #endif
25439  result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
25440  if (unlikely(!result)) {
25441  __Pyx_PyObject_GetAttrStr_ClearAttributeError();
25442  }
25443  return result;
25444 }
25445 
25446 /* SetupReduce */
25447 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
25448  int ret;
25449  PyObject *name_attr;
25450  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
25451  if (likely(name_attr)) {
25452  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
25453  } else {
25454  ret = -1;
25455  }
25456  if (unlikely(ret < 0)) {
25457  PyErr_Clear();
25458  ret = 0;
25459  }
25460  Py_XDECREF(name_attr);
25461  return ret;
25462 }
25463 static int __Pyx_setup_reduce(PyObject* type_obj) {
25464  int ret = 0;
25465  PyObject *object_reduce = NULL;
25466  PyObject *object_getstate = NULL;
25467  PyObject *object_reduce_ex = NULL;
25468  PyObject *reduce = NULL;
25469  PyObject *reduce_ex = NULL;
25470  PyObject *reduce_cython = NULL;
25471  PyObject *setstate = NULL;
25472  PyObject *setstate_cython = NULL;
25473  PyObject *getstate = NULL;
25474 #if CYTHON_USE_PYTYPE_LOOKUP
25475  getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
25476 #else
25477  getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
25478  if (!getstate && PyErr_Occurred()) {
25479  goto __PYX_BAD;
25480  }
25481 #endif
25482  if (getstate) {
25483 #if CYTHON_USE_PYTYPE_LOOKUP
25484  object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
25485 #else
25486  object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
25487  if (!object_getstate && PyErr_Occurred()) {
25488  goto __PYX_BAD;
25489  }
25490 #endif
25491  if (object_getstate != getstate) {
25492  goto __PYX_GOOD;
25493  }
25494  }
25495 #if CYTHON_USE_PYTYPE_LOOKUP
25496  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
25497 #else
25498  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
25499 #endif
25500  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
25501  if (reduce_ex == object_reduce_ex) {
25502 #if CYTHON_USE_PYTYPE_LOOKUP
25503  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
25504 #else
25505  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
25506 #endif
25507  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
25508  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
25509  reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
25510  if (likely(reduce_cython)) {
25511  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25512  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25513  } else if (reduce == object_reduce || PyErr_Occurred()) {
25514  goto __PYX_BAD;
25515  }
25516  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
25517  if (!setstate) PyErr_Clear();
25518  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
25519  setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
25520  if (likely(setstate_cython)) {
25521  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25522  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25523  } else if (!setstate || PyErr_Occurred()) {
25524  goto __PYX_BAD;
25525  }
25526  }
25527  PyType_Modified((PyTypeObject*)type_obj);
25528  }
25529  }
25530  goto __PYX_GOOD;
25531 __PYX_BAD:
25532  if (!PyErr_Occurred())
25533  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
25534  ret = -1;
25535 __PYX_GOOD:
25536 #if !CYTHON_USE_PYTYPE_LOOKUP
25537  Py_XDECREF(object_reduce);
25538  Py_XDECREF(object_reduce_ex);
25539  Py_XDECREF(object_getstate);
25540  Py_XDECREF(getstate);
25541 #endif
25542  Py_XDECREF(reduce);
25543  Py_XDECREF(reduce_ex);
25544  Py_XDECREF(reduce_cython);
25545  Py_XDECREF(setstate);
25546  Py_XDECREF(setstate_cython);
25547  return ret;
25548 }
25549 
25550 /* SetVTable */
25551 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
25552 #if PY_VERSION_HEX >= 0x02070000
25553  PyObject *ob = PyCapsule_New(vtable, 0, 0);
25554 #else
25555  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
25556 #endif
25557  if (!ob)
25558  goto bad;
25559  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
25560  goto bad;
25561  Py_DECREF(ob);
25562  return 0;
25563 bad:
25564  Py_XDECREF(ob);
25565  return -1;
25566 }
25567 
25568 /* TypeImport */
25569 #ifndef __PYX_HAVE_RT_ImportType
25570 #define __PYX_HAVE_RT_ImportType
25571 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
25572  size_t size, enum __Pyx_ImportType_CheckSize check_size)
25573 {
25574  PyObject *result = 0;
25575  char warning[200];
25576  Py_ssize_t basicsize;
25577 #ifdef Py_LIMITED_API
25578  PyObject *py_basicsize;
25579 #endif
25580  result = PyObject_GetAttrString(module, class_name);
25581  if (!result)
25582  goto bad;
25583  if (!PyType_Check(result)) {
25584  PyErr_Format(PyExc_TypeError,
25585  "%.200s.%.200s is not a type object",
25586  module_name, class_name);
25587  goto bad;
25588  }
25589 #ifndef Py_LIMITED_API
25590  basicsize = ((PyTypeObject *)result)->tp_basicsize;
25591 #else
25592  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
25593  if (!py_basicsize)
25594  goto bad;
25595  basicsize = PyLong_AsSsize_t(py_basicsize);
25596  Py_DECREF(py_basicsize);
25597  py_basicsize = 0;
25598  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
25599  goto bad;
25600 #endif
25601  if ((size_t)basicsize < size) {
25602  PyErr_Format(PyExc_ValueError,
25603  "%.200s.%.200s size changed, may indicate binary incompatibility. "
25604  "Expected %zd from C header, got %zd from PyObject",
25605  module_name, class_name, size, basicsize);
25606  goto bad;
25607  }
25608  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
25609  PyErr_Format(PyExc_ValueError,
25610  "%.200s.%.200s size changed, may indicate binary incompatibility. "
25611  "Expected %zd from C header, got %zd from PyObject",
25612  module_name, class_name, size, basicsize);
25613  goto bad;
25614  }
25615  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
25616  PyOS_snprintf(warning, sizeof(warning),
25617  "%s.%s size changed, may indicate binary incompatibility. "
25618  "Expected %zd from C header, got %zd from PyObject",
25619  module_name, class_name, size, basicsize);
25620  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
25621  }
25622  return (PyTypeObject *)result;
25623 bad:
25624  Py_XDECREF(result);
25625  return NULL;
25626 }
25627 #endif
25628 
25629 /* CalculateMetaclass */
25630 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
25631  Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
25632  for (i=0; i < nbases; i++) {
25633  PyTypeObject *tmptype;
25634  PyObject *tmp = PyTuple_GET_ITEM(bases, i);
25635  tmptype = Py_TYPE(tmp);
25636 #if PY_MAJOR_VERSION < 3
25637  if (tmptype == &PyClass_Type)
25638  continue;
25639 #endif
25640  if (!metaclass) {
25641  metaclass = tmptype;
25642  continue;
25643  }
25644  if (PyType_IsSubtype(metaclass, tmptype))
25645  continue;
25646  if (PyType_IsSubtype(tmptype, metaclass)) {
25647  metaclass = tmptype;
25648  continue;
25649  }
25650  PyErr_SetString(PyExc_TypeError,
25651  "metaclass conflict: "
25652  "the metaclass of a derived class "
25653  "must be a (non-strict) subclass "
25654  "of the metaclasses of all its bases");
25655  return NULL;
25656  }
25657  if (!metaclass) {
25658 #if PY_MAJOR_VERSION < 3
25659  metaclass = &PyClass_Type;
25660 #else
25661  metaclass = &PyType_Type;
25662 #endif
25663  }
25664  Py_INCREF((PyObject*) metaclass);
25665  return (PyObject*) metaclass;
25666 }
25667 
25668 /* FetchCommonType */
25669 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
25670  PyObject* fake_module;
25671  PyTypeObject* cached_type = NULL;
25672  fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
25673  if (!fake_module) return NULL;
25674  Py_INCREF(fake_module);
25675  cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
25676  if (cached_type) {
25677  if (!PyType_Check((PyObject*)cached_type)) {
25678  PyErr_Format(PyExc_TypeError,
25679  "Shared Cython type %.200s is not a type object",
25680  type->tp_name);
25681  goto bad;
25682  }
25683  if (cached_type->tp_basicsize != type->tp_basicsize) {
25684  PyErr_Format(PyExc_TypeError,
25685  "Shared Cython type %.200s has the wrong size, try recompiling",
25686  type->tp_name);
25687  goto bad;
25688  }
25689  } else {
25690  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
25691  PyErr_Clear();
25692  if (PyType_Ready(type) < 0) goto bad;
25693  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
25694  goto bad;
25695  Py_INCREF(type);
25696  cached_type = type;
25697  }
25698 done:
25699  Py_DECREF(fake_module);
25700  return cached_type;
25701 bad:
25702  Py_XDECREF(cached_type);
25703  cached_type = NULL;
25704  goto done;
25705 }
25706 
25707 /* CythonFunctionShared */
25708 #include <structmember.h>
25709 static PyObject *
25710 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
25711 {
25712  if (unlikely(op->func_doc == NULL)) {
25713  if (op->func.m_ml->ml_doc) {
25714 #if PY_MAJOR_VERSION >= 3
25715  op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
25716 #else
25717  op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
25718 #endif
25719  if (unlikely(op->func_doc == NULL))
25720  return NULL;
25721  } else {
25722  Py_INCREF(Py_None);
25723  return Py_None;
25724  }
25725  }
25726  Py_INCREF(op->func_doc);
25727  return op->func_doc;
25728 }
25729 static int
25730 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25731 {
25732  PyObject *tmp = op->func_doc;
25733  if (value == NULL) {
25734  value = Py_None;
25735  }
25736  Py_INCREF(value);
25737  op->func_doc = value;
25738  Py_XDECREF(tmp);
25739  return 0;
25740 }
25741 static PyObject *
25742 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25743 {
25744  if (unlikely(op->func_name == NULL)) {
25745 #if PY_MAJOR_VERSION >= 3
25746  op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
25747 #else
25748  op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
25749 #endif
25750  if (unlikely(op->func_name == NULL))
25751  return NULL;
25752  }
25753  Py_INCREF(op->func_name);
25754  return op->func_name;
25755 }
25756 static int
25757 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25758 {
25759  PyObject *tmp;
25760 #if PY_MAJOR_VERSION >= 3
25761  if (unlikely(value == NULL || !PyUnicode_Check(value)))
25762 #else
25763  if (unlikely(value == NULL || !PyString_Check(value)))
25764 #endif
25765  {
25766  PyErr_SetString(PyExc_TypeError,
25767  "__name__ must be set to a string object");
25768  return -1;
25769  }
25770  tmp = op->func_name;
25771  Py_INCREF(value);
25772  op->func_name = value;
25773  Py_XDECREF(tmp);
25774  return 0;
25775 }
25776 static PyObject *
25777 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25778 {
25779  Py_INCREF(op->func_qualname);
25780  return op->func_qualname;
25781 }
25782 static int
25783 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25784 {
25785  PyObject *tmp;
25786 #if PY_MAJOR_VERSION >= 3
25787  if (unlikely(value == NULL || !PyUnicode_Check(value)))
25788 #else
25789  if (unlikely(value == NULL || !PyString_Check(value)))
25790 #endif
25791  {
25792  PyErr_SetString(PyExc_TypeError,
25793  "__qualname__ must be set to a string object");
25794  return -1;
25795  }
25796  tmp = op->func_qualname;
25797  Py_INCREF(value);
25798  op->func_qualname = value;
25799  Py_XDECREF(tmp);
25800  return 0;
25801 }
25802 static PyObject *
25803 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
25804 {
25805  PyObject *self;
25806  self = m->func_closure;
25807  if (self == NULL)
25808  self = Py_None;
25809  Py_INCREF(self);
25810  return self;
25811 }
25812 static PyObject *
25813 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25814 {
25815  if (unlikely(op->func_dict == NULL)) {
25816  op->func_dict = PyDict_New();
25817  if (unlikely(op->func_dict == NULL))
25818  return NULL;
25819  }
25820  Py_INCREF(op->func_dict);
25821  return op->func_dict;
25822 }
25823 static int
25824 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25825 {
25826  PyObject *tmp;
25827  if (unlikely(value == NULL)) {
25828  PyErr_SetString(PyExc_TypeError,
25829  "function's dictionary may not be deleted");
25830  return -1;
25831  }
25832  if (unlikely(!PyDict_Check(value))) {
25833  PyErr_SetString(PyExc_TypeError,
25834  "setting function's dictionary to a non-dict");
25835  return -1;
25836  }
25837  tmp = op->func_dict;
25838  Py_INCREF(value);
25839  op->func_dict = value;
25840  Py_XDECREF(tmp);
25841  return 0;
25842 }
25843 static PyObject *
25844 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25845 {
25846  Py_INCREF(op->func_globals);
25847  return op->func_globals;
25848 }
25849 static PyObject *
25850 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25851 {
25852  Py_INCREF(Py_None);
25853  return Py_None;
25854 }
25855 static PyObject *
25856 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25857 {
25858  PyObject* result = (op->func_code) ? op->func_code : Py_None;
25859  Py_INCREF(result);
25860  return result;
25861 }
25862 static int
25863 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
25864  int result = 0;
25865  PyObject *res = op->defaults_getter((PyObject *) op);
25866  if (unlikely(!res))
25867  return -1;
25868  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25869  op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
25870  Py_INCREF(op->defaults_tuple);
25871  op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
25872  Py_INCREF(op->defaults_kwdict);
25873  #else
25874  op->defaults_tuple = PySequence_ITEM(res, 0);
25875  if (unlikely(!op->defaults_tuple)) result = -1;
25876  else {
25877  op->defaults_kwdict = PySequence_ITEM(res, 1);
25878  if (unlikely(!op->defaults_kwdict)) result = -1;
25879  }
25880  #endif
25881  Py_DECREF(res);
25882  return result;
25883 }
25884 static int
25885 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
25886  PyObject* tmp;
25887  if (!value) {
25888  value = Py_None;
25889  } else if (value != Py_None && !PyTuple_Check(value)) {
25890  PyErr_SetString(PyExc_TypeError,
25891  "__defaults__ must be set to a tuple object");
25892  return -1;
25893  }
25894  Py_INCREF(value);
25895  tmp = op->defaults_tuple;
25896  op->defaults_tuple = value;
25897  Py_XDECREF(tmp);
25898  return 0;
25899 }
25900 static PyObject *
25901 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
25902  PyObject* result = op->defaults_tuple;
25903  if (unlikely(!result)) {
25904  if (op->defaults_getter) {
25905  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
25906  result = op->defaults_tuple;
25907  } else {
25908  result = Py_None;
25909  }
25910  }
25911  Py_INCREF(result);
25912  return result;
25913 }
25914 static int
25915 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
25916  PyObject* tmp;
25917  if (!value) {
25918  value = Py_None;
25919  } else if (value != Py_None && !PyDict_Check(value)) {
25920  PyErr_SetString(PyExc_TypeError,
25921  "__kwdefaults__ must be set to a dict object");
25922  return -1;
25923  }
25924  Py_INCREF(value);
25925  tmp = op->defaults_kwdict;
25926  op->defaults_kwdict = value;
25927  Py_XDECREF(tmp);
25928  return 0;
25929 }
25930 static PyObject *
25931 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
25932  PyObject* result = op->defaults_kwdict;
25933  if (unlikely(!result)) {
25934  if (op->defaults_getter) {
25935  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
25936  result = op->defaults_kwdict;
25937  } else {
25938  result = Py_None;
25939  }
25940  }
25941  Py_INCREF(result);
25942  return result;
25943 }
25944 static int
25945 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
25946  PyObject* tmp;
25947  if (!value || value == Py_None) {
25948  value = NULL;
25949  } else if (!PyDict_Check(value)) {
25950  PyErr_SetString(PyExc_TypeError,
25951  "__annotations__ must be set to a dict object");
25952  return -1;
25953  }
25954  Py_XINCREF(value);
25955  tmp = op->func_annotations;
25956  op->func_annotations = value;
25957  Py_XDECREF(tmp);
25958  return 0;
25959 }
25960 static PyObject *
25961 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
25962  PyObject* result = op->func_annotations;
25963  if (unlikely(!result)) {
25964  result = PyDict_New();
25965  if (unlikely(!result)) return NULL;
25966  op->func_annotations = result;
25967  }
25968  Py_INCREF(result);
25969  return result;
25970 }
25971 static PyGetSetDef __pyx_CyFunction_getsets[] = {
25972  {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25973  {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25974  {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25975  {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25976  {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
25977  {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
25978  {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25979  {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25980  {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25981  {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25982  {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25983  {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25984  {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25985  {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25986  {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25987  {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25988  {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
25989  {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
25990  {0, 0, 0, 0, 0}
25991 };
25992 static PyMemberDef __pyx_CyFunction_members[] = {
25993  {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
25994  {0, 0, 0, 0, 0}
25995 };
25996 static PyObject *
25997 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
25998 {
25999 #if PY_MAJOR_VERSION >= 3
26000  Py_INCREF(m->func_qualname);
26001  return m->func_qualname;
26002 #else
26003  return PyString_FromString(m->func.m_ml->ml_name);
26004 #endif
26005 }
26006 static PyMethodDef __pyx_CyFunction_methods[] = {
26007  {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
26008  {0, 0, 0, 0}
26009 };
26010 #if PY_VERSION_HEX < 0x030500A0
26011 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
26012 #else
26013 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
26014 #endif
26015 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
26016  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26017  if (unlikely(op == NULL))
26018  return NULL;
26019  op->flags = flags;
26020  __Pyx_CyFunction_weakreflist(op) = NULL;
26021  op->func.m_ml = ml;
26022  op->func.m_self = (PyObject *) op;
26023  Py_XINCREF(closure);
26024  op->func_closure = closure;
26025  Py_XINCREF(module);
26026  op->func.m_module = module;
26027  op->func_dict = NULL;
26028  op->func_name = NULL;
26029  Py_INCREF(qualname);
26030  op->func_qualname = qualname;
26031  op->func_doc = NULL;
26032  op->func_classobj = NULL;
26033  op->func_globals = globals;
26034  Py_INCREF(op->func_globals);
26035  Py_XINCREF(code);
26036  op->func_code = code;
26037  op->defaults_pyobjects = 0;
26038  op->defaults_size = 0;
26039  op->defaults = NULL;
26040  op->defaults_tuple = NULL;
26041  op->defaults_kwdict = NULL;
26042  op->defaults_getter = NULL;
26043  op->func_annotations = NULL;
26044  return (PyObject *) op;
26045 }
26046 static int
26047 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
26048 {
26049  Py_CLEAR(m->func_closure);
26050  Py_CLEAR(m->func.m_module);
26051  Py_CLEAR(m->func_dict);
26052  Py_CLEAR(m->func_name);
26053  Py_CLEAR(m->func_qualname);
26054  Py_CLEAR(m->func_doc);
26055  Py_CLEAR(m->func_globals);
26056  Py_CLEAR(m->func_code);
26057  Py_CLEAR(m->func_classobj);
26058  Py_CLEAR(m->defaults_tuple);
26059  Py_CLEAR(m->defaults_kwdict);
26060  Py_CLEAR(m->func_annotations);
26061  if (m->defaults) {
26062  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26063  int i;
26064  for (i = 0; i < m->defaults_pyobjects; i++)
26065  Py_XDECREF(pydefaults[i]);
26066  PyObject_Free(m->defaults);
26067  m->defaults = NULL;
26068  }
26069  return 0;
26070 }
26071 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
26072 {
26073  if (__Pyx_CyFunction_weakreflist(m) != NULL)
26074  PyObject_ClearWeakRefs((PyObject *) m);
26075  __Pyx_CyFunction_clear(m);
26076  PyObject_GC_Del(m);
26077 }
26078 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
26079 {
26080  PyObject_GC_UnTrack(m);
26081  __Pyx__CyFunction_dealloc(m);
26082 }
26083 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
26084 {
26085  Py_VISIT(m->func_closure);
26086  Py_VISIT(m->func.m_module);
26087  Py_VISIT(m->func_dict);
26088  Py_VISIT(m->func_name);
26089  Py_VISIT(m->func_qualname);
26090  Py_VISIT(m->func_doc);
26091  Py_VISIT(m->func_globals);
26092  Py_VISIT(m->func_code);
26093  Py_VISIT(m->func_classobj);
26094  Py_VISIT(m->defaults_tuple);
26095  Py_VISIT(m->defaults_kwdict);
26096  if (m->defaults) {
26097  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26098  int i;
26099  for (i = 0; i < m->defaults_pyobjects; i++)
26100  Py_VISIT(pydefaults[i]);
26101  }
26102  return 0;
26103 }
26104 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
26105 {
26106 #if PY_MAJOR_VERSION < 3
26107  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26108  if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
26109  Py_INCREF(func);
26110  return func;
26111  }
26112  if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
26113  if (type == NULL)
26114  type = (PyObject *)(Py_TYPE(obj));
26115  return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
26116  }
26117  if (obj == Py_None)
26118  obj = NULL;
26119 #endif
26120  return __Pyx_PyMethod_New(func, obj, type);
26121 }
26122 static PyObject*
26123 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
26124 {
26125 #if PY_MAJOR_VERSION >= 3
26126  return PyUnicode_FromFormat("<cyfunction %U at %p>",
26127  op->func_qualname, (void *)op);
26128 #else
26129  return PyString_FromFormat("<cyfunction %s at %p>",
26130  PyString_AsString(op->func_qualname), (void *)op);
26131 #endif
26132 }
26133 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
26134  PyCFunctionObject* f = (PyCFunctionObject*)func;
26135  PyCFunction meth = f->m_ml->ml_meth;
26136  Py_ssize_t size;
26137  switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
26138  case METH_VARARGS:
26139  if (likely(kw == NULL || PyDict_Size(kw) == 0))
26140  return (*meth)(self, arg);
26141  break;
26142  case METH_VARARGS | METH_KEYWORDS:
26143  return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
26144  case METH_NOARGS:
26145  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26146  size = PyTuple_GET_SIZE(arg);
26147  if (likely(size == 0))
26148  return (*meth)(self, NULL);
26149  PyErr_Format(PyExc_TypeError,
26150  "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
26151  f->m_ml->ml_name, size);
26152  return NULL;
26153  }
26154  break;
26155  case METH_O:
26156  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26157  size = PyTuple_GET_SIZE(arg);
26158  if (likely(size == 1)) {
26159  PyObject *result, *arg0;
26160  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26161  arg0 = PyTuple_GET_ITEM(arg, 0);
26162  #else
26163  arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
26164  #endif
26165  result = (*meth)(self, arg0);
26166  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
26167  Py_DECREF(arg0);
26168  #endif
26169  return result;
26170  }
26171  PyErr_Format(PyExc_TypeError,
26172  "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
26173  f->m_ml->ml_name, size);
26174  return NULL;
26175  }
26176  break;
26177  default:
26178  PyErr_SetString(PyExc_SystemError, "Bad call flags in "
26179  "__Pyx_CyFunction_Call. METH_OLDARGS is no "
26180  "longer supported!");
26181  return NULL;
26182  }
26183  PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
26184  f->m_ml->ml_name);
26185  return NULL;
26186 }
26187 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
26188  return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
26189 }
26190 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
26191  PyObject *result;
26192  __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
26193  if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
26194  Py_ssize_t argc;
26195  PyObject *new_args;
26196  PyObject *self;
26197  argc = PyTuple_GET_SIZE(args);
26198  new_args = PyTuple_GetSlice(args, 1, argc);
26199  if (unlikely(!new_args))
26200  return NULL;
26201  self = PyTuple_GetItem(args, 0);
26202  if (unlikely(!self)) {
26203  Py_DECREF(new_args);
26204  PyErr_Format(PyExc_TypeError,
26205  "unbound method %.200S() needs an argument",
26206  cyfunc->func_qualname);
26207  return NULL;
26208  }
26209  result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
26210  Py_DECREF(new_args);
26211  } else {
26212  result = __Pyx_CyFunction_Call(func, args, kw);
26213  }
26214  return result;
26215 }
26216 static PyTypeObject __pyx_CyFunctionType_type = {
26217  PyVarObject_HEAD_INIT(0, 0)
26218  "cython_function_or_method",
26219  sizeof(__pyx_CyFunctionObject),
26220  0,
26221  (destructor) __Pyx_CyFunction_dealloc,
26222  0,
26223  0,
26224  0,
26225 #if PY_MAJOR_VERSION < 3
26226  0,
26227 #else
26228  0,
26229 #endif
26230  (reprfunc) __Pyx_CyFunction_repr,
26231  0,
26232  0,
26233  0,
26234  0,
26235  __Pyx_CyFunction_CallAsMethod,
26236  0,
26237  0,
26238  0,
26239  0,
26240  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
26241  0,
26242  (traverseproc) __Pyx_CyFunction_traverse,
26243  (inquiry) __Pyx_CyFunction_clear,
26244  0,
26245 #if PY_VERSION_HEX < 0x030500A0
26246  offsetof(__pyx_CyFunctionObject, func_weakreflist),
26247 #else
26248  offsetof(PyCFunctionObject, m_weakreflist),
26249 #endif
26250  0,
26251  0,
26252  __pyx_CyFunction_methods,
26253  __pyx_CyFunction_members,
26254  __pyx_CyFunction_getsets,
26255  0,
26256  0,
26257  __Pyx_CyFunction_descr_get,
26258  0,
26259  offsetof(__pyx_CyFunctionObject, func_dict),
26260  0,
26261  0,
26262  0,
26263  0,
26264  0,
26265  0,
26266  0,
26267  0,
26268  0,
26269  0,
26270  0,
26271  0,
26272 #if PY_VERSION_HEX >= 0x030400a1
26273  0,
26274 #endif
26275 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
26276  0,
26277 #endif
26278 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
26279  0,
26280 #endif
26281 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
26282  0,
26283 #endif
26284 };
26285 static int __pyx_CyFunction_init(void) {
26286  __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
26287  if (unlikely(__pyx_CyFunctionType == NULL)) {
26288  return -1;
26289  }
26290  return 0;
26291 }
26292 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
26293  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26294  m->defaults = PyObject_Malloc(size);
26295  if (unlikely(!m->defaults))
26296  return PyErr_NoMemory();
26297  memset(m->defaults, 0, size);
26298  m->defaults_pyobjects = pyobjects;
26299  m->defaults_size = size;
26300  return m->defaults;
26301 }
26302 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
26303  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26304  m->defaults_tuple = tuple;
26305  Py_INCREF(tuple);
26306 }
26307 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
26308  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26309  m->defaults_kwdict = dict;
26310  Py_INCREF(dict);
26311 }
26312 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
26313  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26314  m->func_annotations = dict;
26315  Py_INCREF(dict);
26316 }
26317 
26318 /* CythonFunction */
26319 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
26320  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26321  PyObject *op = __Pyx_CyFunction_Init(
26322  PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
26323  ml, flags, qualname, closure, module, globals, code
26324  );
26325  if (likely(op)) {
26326  PyObject_GC_Track(op);
26327  }
26328  return op;
26329 }
26330 
26331 /* Py3ClassCreate */
26332 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
26333  PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
26334  PyObject *ns;
26335  if (metaclass) {
26336  PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
26337  if (prep) {
26338  PyObject *pargs = PyTuple_Pack(2, name, bases);
26339  if (unlikely(!pargs)) {
26340  Py_DECREF(prep);
26341  return NULL;
26342  }
26343  ns = PyObject_Call(prep, pargs, mkw);
26344  Py_DECREF(prep);
26345  Py_DECREF(pargs);
26346  } else {
26347  if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
26348  return NULL;
26349  PyErr_Clear();
26350  ns = PyDict_New();
26351  }
26352  } else {
26353  ns = PyDict_New();
26354  }
26355  if (unlikely(!ns))
26356  return NULL;
26357  if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
26358  if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
26359  if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
26360  return ns;
26361 bad:
26362  Py_DECREF(ns);
26363  return NULL;
26364 }
26365 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
26366  PyObject *dict, PyObject *mkw,
26367  int calculate_metaclass, int allow_py2_metaclass) {
26368  PyObject *result, *margs;
26369  PyObject *owned_metaclass = NULL;
26370  if (allow_py2_metaclass) {
26371  owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
26372  if (owned_metaclass) {
26373  metaclass = owned_metaclass;
26374  } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
26375  PyErr_Clear();
26376  } else {
26377  return NULL;
26378  }
26379  }
26380  if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
26381  metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
26382  Py_XDECREF(owned_metaclass);
26383  if (unlikely(!metaclass))
26384  return NULL;
26385  owned_metaclass = metaclass;
26386  }
26387  margs = PyTuple_Pack(3, name, bases, dict);
26388  if (unlikely(!margs)) {
26389  result = NULL;
26390  } else {
26391  result = PyObject_Call(metaclass, margs, mkw);
26392  Py_DECREF(margs);
26393  }
26394  Py_XDECREF(owned_metaclass);
26395  return result;
26396 }
26397 
26398 /* CLineInTraceback */
26399 #ifndef CYTHON_CLINE_IN_TRACEBACK
26400 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
26401  PyObject *use_cline;
26402  PyObject *ptype, *pvalue, *ptraceback;
26403 #if CYTHON_COMPILING_IN_CPYTHON
26404  PyObject **cython_runtime_dict;
26405 #endif
26406  if (unlikely(!__pyx_cython_runtime)) {
26407  return c_line;
26408  }
26409  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
26410 #if CYTHON_COMPILING_IN_CPYTHON
26411  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
26412  if (likely(cython_runtime_dict)) {
26413  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
26414  use_cline, *cython_runtime_dict,
26415  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
26416  } else
26417 #endif
26418  {
26419  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
26420  if (use_cline_obj) {
26421  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
26422  Py_DECREF(use_cline_obj);
26423  } else {
26424  PyErr_Clear();
26425  use_cline = NULL;
26426  }
26427  }
26428  if (!use_cline) {
26429  c_line = 0;
26430  (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
26431  }
26432  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
26433  c_line = 0;
26434  }
26435  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
26436  return c_line;
26437 }
26438 #endif
26439 
26440 /* CodeObjectCache */
26441 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
26442  int start = 0, mid = 0, end = count - 1;
26443  if (end >= 0 && code_line > entries[end].code_line) {
26444  return count;
26445  }
26446  while (start < end) {
26447  mid = start + (end - start) / 2;
26448  if (code_line < entries[mid].code_line) {
26449  end = mid;
26450  } else if (code_line > entries[mid].code_line) {
26451  start = mid + 1;
26452  } else {
26453  return mid;
26454  }
26455  }
26456  if (code_line <= entries[mid].code_line) {
26457  return mid;
26458  } else {
26459  return mid + 1;
26460  }
26461 }
26462 static PyCodeObject *__pyx_find_code_object(int code_line) {
26463  PyCodeObject* code_object;
26464  int pos;
26465  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
26466  return NULL;
26467  }
26468  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26469  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
26470  return NULL;
26471  }
26472  code_object = __pyx_code_cache.entries[pos].code_object;
26473  Py_INCREF(code_object);
26474  return code_object;
26475 }
26476 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
26477  int pos, i;
26478  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
26479  if (unlikely(!code_line)) {
26480  return;
26481  }
26482  if (unlikely(!entries)) {
26483  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
26484  if (likely(entries)) {
26485  __pyx_code_cache.entries = entries;
26486  __pyx_code_cache.max_count = 64;
26487  __pyx_code_cache.count = 1;
26488  entries[0].code_line = code_line;
26489  entries[0].code_object = code_object;
26490  Py_INCREF(code_object);
26491  }
26492  return;
26493  }
26494  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26495  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
26496  PyCodeObject* tmp = entries[pos].code_object;
26497  entries[pos].code_object = code_object;
26498  Py_DECREF(tmp);
26499  return;
26500  }
26501  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
26502  int new_max = __pyx_code_cache.max_count + 64;
26503  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
26504  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
26505  if (unlikely(!entries)) {
26506  return;
26507  }
26508  __pyx_code_cache.entries = entries;
26509  __pyx_code_cache.max_count = new_max;
26510  }
26511  for (i=__pyx_code_cache.count; i>pos; i--) {
26512  entries[i] = entries[i-1];
26513  }
26514  entries[pos].code_line = code_line;
26515  entries[pos].code_object = code_object;
26516  __pyx_code_cache.count++;
26517  Py_INCREF(code_object);
26518 }
26519 
26520 /* AddTraceback */
26521 #include "compile.h"
26522 #include "frameobject.h"
26523 #include "traceback.h"
26524 #if PY_VERSION_HEX >= 0x030b00a6
26525  #ifndef Py_BUILD_CORE
26526  #define Py_BUILD_CORE 1
26527  #endif
26528  #include "internal/pycore_frame.h"
26529 #endif
26530 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
26531  const char *funcname, int c_line,
26532  int py_line, const char *filename) {
26533  PyCodeObject *py_code = NULL;
26534  PyObject *py_funcname = NULL;
26535  #if PY_MAJOR_VERSION < 3
26536  PyObject *py_srcfile = NULL;
26537  py_srcfile = PyString_FromString(filename);
26538  if (!py_srcfile) goto bad;
26539  #endif
26540  if (c_line) {
26541  #if PY_MAJOR_VERSION < 3
26542  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26543  if (!py_funcname) goto bad;
26544  #else
26545  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26546  if (!py_funcname) goto bad;
26547  funcname = PyUnicode_AsUTF8(py_funcname);
26548  if (!funcname) goto bad;
26549  #endif
26550  }
26551  else {
26552  #if PY_MAJOR_VERSION < 3
26553  py_funcname = PyString_FromString(funcname);
26554  if (!py_funcname) goto bad;
26555  #endif
26556  }
26557  #if PY_MAJOR_VERSION < 3
26558  py_code = __Pyx_PyCode_New(
26559  0,
26560  0,
26561  0,
26562  0,
26563  0,
26564  __pyx_empty_bytes, /*PyObject *code,*/
26565  __pyx_empty_tuple, /*PyObject *consts,*/
26566  __pyx_empty_tuple, /*PyObject *names,*/
26567  __pyx_empty_tuple, /*PyObject *varnames,*/
26568  __pyx_empty_tuple, /*PyObject *freevars,*/
26569  __pyx_empty_tuple, /*PyObject *cellvars,*/
26570  py_srcfile, /*PyObject *filename,*/
26571  py_funcname, /*PyObject *name,*/
26572  py_line,
26573  __pyx_empty_bytes /*PyObject *lnotab*/
26574  );
26575  Py_DECREF(py_srcfile);
26576  #else
26577  py_code = PyCode_NewEmpty(filename, funcname, py_line);
26578  #endif
26579  Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
26580  return py_code;
26581 bad:
26582  Py_XDECREF(py_funcname);
26583  #if PY_MAJOR_VERSION < 3
26584  Py_XDECREF(py_srcfile);
26585  #endif
26586  return NULL;
26587 }
26588 static void __Pyx_AddTraceback(const char *funcname, int c_line,
26589  int py_line, const char *filename) {
26590  PyCodeObject *py_code = 0;
26591  PyFrameObject *py_frame = 0;
26592  PyThreadState *tstate = __Pyx_PyThreadState_Current;
26593  PyObject *ptype, *pvalue, *ptraceback;
26594  if (c_line) {
26595  c_line = __Pyx_CLineForTraceback(tstate, c_line);
26596  }
26597  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
26598  if (!py_code) {
26599  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
26600  py_code = __Pyx_CreateCodeObjectForTraceback(
26601  funcname, c_line, py_line, filename);
26602  if (!py_code) {
26603  /* If the code object creation fails, then we should clear the
26604  fetched exception references and propagate the new exception */
26605  Py_XDECREF(ptype);
26606  Py_XDECREF(pvalue);
26607  Py_XDECREF(ptraceback);
26608  goto bad;
26609  }
26610  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
26611  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
26612  }
26613  py_frame = PyFrame_New(
26614  tstate, /*PyThreadState *tstate,*/
26615  py_code, /*PyCodeObject *code,*/
26616  __pyx_d, /*PyObject *globals,*/
26617  0 /*PyObject *locals*/
26618  );
26619  if (!py_frame) goto bad;
26620  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
26621  PyTraceBack_Here(py_frame);
26622 bad:
26623  Py_XDECREF(py_code);
26624  Py_XDECREF(py_frame);
26625 }
26626 
26627 #if PY_MAJOR_VERSION < 3
26628 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
26629  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
26630  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
26631  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
26632  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
26633  return -1;
26634 }
26635 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
26636  PyObject *obj = view->obj;
26637  if (!obj) return;
26638  if (PyObject_CheckBuffer(obj)) {
26639  PyBuffer_Release(view);
26640  return;
26641  }
26642  if ((0)) {}
26643  view->obj = NULL;
26644  Py_DECREF(obj);
26645 }
26646 #endif
26647 
26648 
26649 /* MemviewSliceIsContig */
26650 static int
26651 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
26652 {
26653  int i, index, step, start;
26654  Py_ssize_t itemsize = mvs.memview->view.itemsize;
26655  if (order == 'F') {
26656  step = 1;
26657  start = 0;
26658  } else {
26659  step = -1;
26660  start = ndim - 1;
26661  }
26662  for (i = 0; i < ndim; i++) {
26663  index = start + step * i;
26664  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
26665  return 0;
26666  itemsize *= mvs.shape[index];
26667  }
26668  return 1;
26669 }
26670 
26671 /* OverlappingSlices */
26672 static void
26673 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
26674  void **out_start, void **out_end,
26675  int ndim, size_t itemsize)
26676 {
26677  char *start, *end;
26678  int i;
26679  start = end = slice->data;
26680  for (i = 0; i < ndim; i++) {
26681  Py_ssize_t stride = slice->strides[i];
26682  Py_ssize_t extent = slice->shape[i];
26683  if (extent == 0) {
26684  *out_start = *out_end = start;
26685  return;
26686  } else {
26687  if (stride > 0)
26688  end += stride * (extent - 1);
26689  else
26690  start += stride * (extent - 1);
26691  }
26692  }
26693  *out_start = start;
26694  *out_end = end + itemsize;
26695 }
26696 static int
26697 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
26698  __Pyx_memviewslice *slice2,
26699  int ndim, size_t itemsize)
26700 {
26701  void *start1, *end1, *start2, *end2;
26702  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
26703  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
26704  return (start1 < end2) && (start2 < end1);
26705 }
26706 
26707 /* Capsule */
26708 static CYTHON_INLINE PyObject *
26709 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
26710 {
26711  PyObject *cobj;
26712 #if PY_VERSION_HEX >= 0x02070000
26713  cobj = PyCapsule_New(p, sig, NULL);
26714 #else
26715  cobj = PyCObject_FromVoidPtr(p, NULL);
26716 #endif
26717  return cobj;
26718 }
26719 
26720 /* CIntFromPyVerify */
26721 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
26722  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
26723 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
26724  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
26725 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
26726  {\
26727  func_type value = func_value;\
26728  if (sizeof(target_type) < sizeof(func_type)) {\
26729  if (unlikely(value != (func_type) (target_type) value)) {\
26730  func_type zero = 0;\
26731  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
26732  return (target_type) -1;\
26733  if (is_unsigned && unlikely(value < zero))\
26734  goto raise_neg_overflow;\
26735  else\
26736  goto raise_overflow;\
26737  }\
26738  }\
26739  return (target_type) value;\
26740  }
26741 
26742 /* IsLittleEndian */
26743 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
26744 {
26745  union {
26746  uint32_t u32;
26747  uint8_t u8[4];
26748  } S;
26749  S.u32 = 0x01020304;
26750  return S.u8[0] == 4;
26751 }
26752 
26753 /* BufferFormatCheck */
26754 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
26755  __Pyx_BufFmt_StackElem* stack,
26756  __Pyx_TypeInfo* type) {
26757  stack[0].field = &ctx->root;
26758  stack[0].parent_offset = 0;
26759  ctx->root.type = type;
26760  ctx->root.name = "buffer dtype";
26761  ctx->root.offset = 0;
26762  ctx->head = stack;
26763  ctx->head->field = &ctx->root;
26764  ctx->fmt_offset = 0;
26765  ctx->head->parent_offset = 0;
26766  ctx->new_packmode = '@';
26767  ctx->enc_packmode = '@';
26768  ctx->new_count = 1;
26769  ctx->enc_count = 0;
26770  ctx->enc_type = 0;
26771  ctx->is_complex = 0;
26772  ctx->is_valid_array = 0;
26773  ctx->struct_alignment = 0;
26774  while (type->typegroup == 'S') {
26775  ++ctx->head;
26776  ctx->head->field = type->fields;
26777  ctx->head->parent_offset = 0;
26778  type = type->fields->type;
26779  }
26780 }
26781 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
26782  int count;
26783  const char* t = *ts;
26784  if (*t < '0' || *t > '9') {
26785  return -1;
26786  } else {
26787  count = *t++ - '0';
26788  while (*t >= '0' && *t <= '9') {
26789  count *= 10;
26790  count += *t++ - '0';
26791  }
26792  }
26793  *ts = t;
26794  return count;
26795 }
26796 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
26797  int number = __Pyx_BufFmt_ParseNumber(ts);
26798  if (number == -1)
26799  PyErr_Format(PyExc_ValueError,\
26800  "Does not understand character buffer dtype format string ('%c')", **ts);
26801  return number;
26802 }
26803 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
26804  PyErr_Format(PyExc_ValueError,
26805  "Unexpected format string character: '%c'", ch);
26806 }
26807 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
26808  switch (ch) {
26809  case '?': return "'bool'";
26810  case 'c': return "'char'";
26811  case 'b': return "'signed char'";
26812  case 'B': return "'unsigned char'";
26813  case 'h': return "'short'";
26814  case 'H': return "'unsigned short'";
26815  case 'i': return "'int'";
26816  case 'I': return "'unsigned int'";
26817  case 'l': return "'long'";
26818  case 'L': return "'unsigned long'";
26819  case 'q': return "'long long'";
26820  case 'Q': return "'unsigned long long'";
26821  case 'f': return (is_complex ? "'complex float'" : "'float'");
26822  case 'd': return (is_complex ? "'complex double'" : "'double'");
26823  case 'g': return (is_complex ? "'complex long double'" : "'long double'");
26824  case 'T': return "a struct";
26825  case 'O': return "Python object";
26826  case 'P': return "a pointer";
26827  case 's': case 'p': return "a string";
26828  case 0: return "end";
26829  default: return "unparseable format string";
26830  }
26831 }
26832 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
26833  switch (ch) {
26834  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26835  case 'h': case 'H': return 2;
26836  case 'i': case 'I': case 'l': case 'L': return 4;
26837  case 'q': case 'Q': return 8;
26838  case 'f': return (is_complex ? 8 : 4);
26839  case 'd': return (is_complex ? 16 : 8);
26840  case 'g': {
26841  PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
26842  return 0;
26843  }
26844  case 'O': case 'P': return sizeof(void*);
26845  default:
26846  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26847  return 0;
26848  }
26849 }
26850 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
26851  switch (ch) {
26852  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26853  case 'h': case 'H': return sizeof(short);
26854  case 'i': case 'I': return sizeof(int);
26855  case 'l': case 'L': return sizeof(long);
26856  #ifdef HAVE_LONG_LONG
26857  case 'q': case 'Q': return sizeof(PY_LONG_LONG);
26858  #endif
26859  case 'f': return sizeof(float) * (is_complex ? 2 : 1);
26860  case 'd': return sizeof(double) * (is_complex ? 2 : 1);
26861  case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
26862  case 'O': case 'P': return sizeof(void*);
26863  default: {
26864  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26865  return 0;
26866  }
26867  }
26868 }
26869 typedef struct { char c; short x; } __Pyx_st_short;
26870 typedef struct { char c; int x; } __Pyx_st_int;
26871 typedef struct { char c; long x; } __Pyx_st_long;
26872 typedef struct { char c; float x; } __Pyx_st_float;
26873 typedef struct { char c; double x; } __Pyx_st_double;
26874 typedef struct { char c; long double x; } __Pyx_st_longdouble;
26875 typedef struct { char c; void *x; } __Pyx_st_void_p;
26876 #ifdef HAVE_LONG_LONG
26877 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
26878 #endif
26879 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
26880  switch (ch) {
26881  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26882  case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
26883  case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
26884  case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
26885 #ifdef HAVE_LONG_LONG
26886  case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
26887 #endif
26888  case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
26889  case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
26890  case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
26891  case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
26892  default:
26893  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26894  return 0;
26895  }
26896 }
26897 /* These are for computing the padding at the end of the struct to align
26898  on the first member of the struct. This will probably the same as above,
26899  but we don't have any guarantees.
26900  */
26901 typedef struct { short x; char c; } __Pyx_pad_short;
26902 typedef struct { int x; char c; } __Pyx_pad_int;
26903 typedef struct { long x; char c; } __Pyx_pad_long;
26904 typedef struct { float x; char c; } __Pyx_pad_float;
26905 typedef struct { double x; char c; } __Pyx_pad_double;
26906 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
26907 typedef struct { void *x; char c; } __Pyx_pad_void_p;
26908 #ifdef HAVE_LONG_LONG
26909 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
26910 #endif
26911 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
26912  switch (ch) {
26913  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26914  case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
26915  case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
26916  case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
26917 #ifdef HAVE_LONG_LONG
26918  case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
26919 #endif
26920  case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
26921  case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
26922  case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
26923  case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
26924  default:
26925  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26926  return 0;
26927  }
26928 }
26929 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
26930  switch (ch) {
26931  case 'c':
26932  return 'H';
26933  case 'b': case 'h': case 'i':
26934  case 'l': case 'q': case 's': case 'p':
26935  return 'I';
26936  case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
26937  return 'U';
26938  case 'f': case 'd': case 'g':
26939  return (is_complex ? 'C' : 'R');
26940  case 'O':
26941  return 'O';
26942  case 'P':
26943  return 'P';
26944  default: {
26945  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26946  return 0;
26947  }
26948  }
26949 }
26950 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
26951  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
26952  const char* expected;
26953  const char* quote;
26954  if (ctx->head == NULL) {
26955  expected = "end";
26956  quote = "";
26957  } else {
26958  expected = ctx->head->field->type->name;
26959  quote = "'";
26960  }
26961  PyErr_Format(PyExc_ValueError,
26962  "Buffer dtype mismatch, expected %s%s%s but got %s",
26963  quote, expected, quote,
26964  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
26965  } else {
26966  __Pyx_StructField* field = ctx->head->field;
26967  __Pyx_StructField* parent = (ctx->head - 1)->field;
26968  PyErr_Format(PyExc_ValueError,
26969  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
26970  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
26971  parent->type->name, field->name);
26972  }
26973 }
26974 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
26975  char group;
26976  size_t size, offset, arraysize = 1;
26977  if (ctx->enc_type == 0) return 0;
26978  if (ctx->head->field->type->arraysize[0]) {
26979  int i, ndim = 0;
26980  if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
26981  ctx->is_valid_array = ctx->head->field->type->ndim == 1;
26982  ndim = 1;
26983  if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
26984  PyErr_Format(PyExc_ValueError,
26985  "Expected a dimension of size %zu, got %zu",
26986  ctx->head->field->type->arraysize[0], ctx->enc_count);
26987  return -1;
26988  }
26989  }
26990  if (!ctx->is_valid_array) {
26991  PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
26992  ctx->head->field->type->ndim, ndim);
26993  return -1;
26994  }
26995  for (i = 0; i < ctx->head->field->type->ndim; i++) {
26996  arraysize *= ctx->head->field->type->arraysize[i];
26997  }
26998  ctx->is_valid_array = 0;
26999  ctx->enc_count = 1;
27000  }
27001  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
27002  do {
27003  __Pyx_StructField* field = ctx->head->field;
27004  __Pyx_TypeInfo* type = field->type;
27005  if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
27006  size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
27007  } else {
27008  size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
27009  }
27010  if (ctx->enc_packmode == '@') {
27011  size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
27012  size_t align_mod_offset;
27013  if (align_at == 0) return -1;
27014  align_mod_offset = ctx->fmt_offset % align_at;
27015  if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
27016  if (ctx->struct_alignment == 0)
27017  ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
27018  ctx->is_complex);
27019  }
27020  if (type->size != size || type->typegroup != group) {
27021  if (type->typegroup == 'C' && type->fields != NULL) {
27022  size_t parent_offset = ctx->head->parent_offset + field->offset;
27023  ++ctx->head;
27024  ctx->head->field = type->fields;
27025  ctx->head->parent_offset = parent_offset;
27026  continue;
27027  }
27028  if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
27029  } else {
27030  __Pyx_BufFmt_RaiseExpected(ctx);
27031  return -1;
27032  }
27033  }
27034  offset = ctx->head->parent_offset + field->offset;
27035  if (ctx->fmt_offset != offset) {
27036  PyErr_Format(PyExc_ValueError,
27037  "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
27038  (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
27039  return -1;
27040  }
27041  ctx->fmt_offset += size;
27042  if (arraysize)
27043  ctx->fmt_offset += (arraysize - 1) * size;
27044  --ctx->enc_count;
27045  while (1) {
27046  if (field == &ctx->root) {
27047  ctx->head = NULL;
27048  if (ctx->enc_count != 0) {
27049  __Pyx_BufFmt_RaiseExpected(ctx);
27050  return -1;
27051  }
27052  break;
27053  }
27054  ctx->head->field = ++field;
27055  if (field->type == NULL) {
27056  --ctx->head;
27057  field = ctx->head->field;
27058  continue;
27059  } else if (field->type->typegroup == 'S') {
27060  size_t parent_offset = ctx->head->parent_offset + field->offset;
27061  if (field->type->fields->type == NULL) continue;
27062  field = field->type->fields;
27063  ++ctx->head;
27064  ctx->head->field = field;
27065  ctx->head->parent_offset = parent_offset;
27066  break;
27067  } else {
27068  break;
27069  }
27070  }
27071  } while (ctx->enc_count);
27072  ctx->enc_type = 0;
27073  ctx->is_complex = 0;
27074  return 0;
27075 }
27076 static PyObject *
27077 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
27078 {
27079  const char *ts = *tsp;
27080  int i = 0, number, ndim;
27081  ++ts;
27082  if (ctx->new_count != 1) {
27083  PyErr_SetString(PyExc_ValueError,
27084  "Cannot handle repeated arrays in format string");
27085  return NULL;
27086  }
27087  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27088  ndim = ctx->head->field->type->ndim;
27089  while (*ts && *ts != ')') {
27090  switch (*ts) {
27091  case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
27092  default: break;
27093  }
27094  number = __Pyx_BufFmt_ExpectNumber(&ts);
27095  if (number == -1) return NULL;
27096  if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
27097  return PyErr_Format(PyExc_ValueError,
27098  "Expected a dimension of size %zu, got %d",
27099  ctx->head->field->type->arraysize[i], number);
27100  if (*ts != ',' && *ts != ')')
27101  return PyErr_Format(PyExc_ValueError,
27102  "Expected a comma in format string, got '%c'", *ts);
27103  if (*ts == ',') ts++;
27104  i++;
27105  }
27106  if (i != ndim)
27107  return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
27108  ctx->head->field->type->ndim, i);
27109  if (!*ts) {
27110  PyErr_SetString(PyExc_ValueError,
27111  "Unexpected end of format string, expected ')'");
27112  return NULL;
27113  }
27114  ctx->is_valid_array = 1;
27115  ctx->new_count = 1;
27116  *tsp = ++ts;
27117  return Py_None;
27118 }
27119 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
27120  int got_Z = 0;
27121  while (1) {
27122  switch(*ts) {
27123  case 0:
27124  if (ctx->enc_type != 0 && ctx->head == NULL) {
27125  __Pyx_BufFmt_RaiseExpected(ctx);
27126  return NULL;
27127  }
27128  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27129  if (ctx->head != NULL) {
27130  __Pyx_BufFmt_RaiseExpected(ctx);
27131  return NULL;
27132  }
27133  return ts;
27134  case ' ':
27135  case '\r':
27136  case '\n':
27137  ++ts;
27138  break;
27139  case '<':
27140  if (!__Pyx_Is_Little_Endian()) {
27141  PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
27142  return NULL;
27143  }
27144  ctx->new_packmode = '=';
27145  ++ts;
27146  break;
27147  case '>':
27148  case '!':
27149  if (__Pyx_Is_Little_Endian()) {
27150  PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
27151  return NULL;
27152  }
27153  ctx->new_packmode = '=';
27154  ++ts;
27155  break;
27156  case '=':
27157  case '@':
27158  case '^':
27159  ctx->new_packmode = *ts++;
27160  break;
27161  case 'T':
27162  {
27163  const char* ts_after_sub;
27164  size_t i, struct_count = ctx->new_count;
27165  size_t struct_alignment = ctx->struct_alignment;
27166  ctx->new_count = 1;
27167  ++ts;
27168  if (*ts != '{') {
27169  PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
27170  return NULL;
27171  }
27172  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27173  ctx->enc_type = 0;
27174  ctx->enc_count = 0;
27175  ctx->struct_alignment = 0;
27176  ++ts;
27177  ts_after_sub = ts;
27178  for (i = 0; i != struct_count; ++i) {
27179  ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
27180  if (!ts_after_sub) return NULL;
27181  }
27182  ts = ts_after_sub;
27183  if (struct_alignment) ctx->struct_alignment = struct_alignment;
27184  }
27185  break;
27186  case '}':
27187  {
27188  size_t alignment = ctx->struct_alignment;
27189  ++ts;
27190  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27191  ctx->enc_type = 0;
27192  if (alignment && ctx->fmt_offset % alignment) {
27193  ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
27194  }
27195  }
27196  return ts;
27197  case 'x':
27198  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27199  ctx->fmt_offset += ctx->new_count;
27200  ctx->new_count = 1;
27201  ctx->enc_count = 0;
27202  ctx->enc_type = 0;
27203  ctx->enc_packmode = ctx->new_packmode;
27204  ++ts;
27205  break;
27206  case 'Z':
27207  got_Z = 1;
27208  ++ts;
27209  if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
27210  __Pyx_BufFmt_RaiseUnexpectedChar('Z');
27211  return NULL;
27212  }
27213  CYTHON_FALLTHROUGH;
27214  case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
27215  case 'l': case 'L': case 'q': case 'Q':
27216  case 'f': case 'd': case 'g':
27217  case 'O': case 'p':
27218  if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
27219  (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
27220  ctx->enc_count += ctx->new_count;
27221  ctx->new_count = 1;
27222  got_Z = 0;
27223  ++ts;
27224  break;
27225  }
27226  CYTHON_FALLTHROUGH;
27227  case 's':
27228  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27229  ctx->enc_count = ctx->new_count;
27230  ctx->enc_packmode = ctx->new_packmode;
27231  ctx->enc_type = *ts;
27232  ctx->is_complex = got_Z;
27233  ++ts;
27234  ctx->new_count = 1;
27235  got_Z = 0;
27236  break;
27237  case ':':
27238  ++ts;
27239  while(*ts != ':') ++ts;
27240  ++ts;
27241  break;
27242  case '(':
27243  if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
27244  break;
27245  default:
27246  {
27247  int number = __Pyx_BufFmt_ExpectNumber(&ts);
27248  if (number == -1) return NULL;
27249  ctx->new_count = (size_t)number;
27250  }
27251  }
27252  }
27253 }
27254 
27255 /* TypeInfoCompare */
27256  static int
27257 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
27258 {
27259  int i;
27260  if (!a || !b)
27261  return 0;
27262  if (a == b)
27263  return 1;
27264  if (a->size != b->size || a->typegroup != b->typegroup ||
27265  a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
27266  if (a->typegroup == 'H' || b->typegroup == 'H') {
27267  return a->size == b->size;
27268  } else {
27269  return 0;
27270  }
27271  }
27272  if (a->ndim) {
27273  for (i = 0; i < a->ndim; i++)
27274  if (a->arraysize[i] != b->arraysize[i])
27275  return 0;
27276  }
27277  if (a->typegroup == 'S') {
27278  if (a->flags != b->flags)
27279  return 0;
27280  if (a->fields || b->fields) {
27281  if (!(a->fields && b->fields))
27282  return 0;
27283  for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
27284  __Pyx_StructField *field_a = a->fields + i;
27285  __Pyx_StructField *field_b = b->fields + i;
27286  if (field_a->offset != field_b->offset ||
27287  !__pyx_typeinfo_cmp(field_a->type, field_b->type))
27288  return 0;
27289  }
27290  return !a->fields[i].type && !b->fields[i].type;
27291  }
27292  }
27293  return 1;
27294 }
27295 
27296 /* MemviewSliceValidateAndInit */
27297  static int
27298 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
27299 {
27300  if (buf->shape[dim] <= 1)
27301  return 1;
27302  if (buf->strides) {
27303  if (spec & __Pyx_MEMVIEW_CONTIG) {
27304  if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
27305  if (unlikely(buf->strides[dim] != sizeof(void *))) {
27306  PyErr_Format(PyExc_ValueError,
27307  "Buffer is not indirectly contiguous "
27308  "in dimension %d.", dim);
27309  goto fail;
27310  }
27311  } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
27312  PyErr_SetString(PyExc_ValueError,
27313  "Buffer and memoryview are not contiguous "
27314  "in the same dimension.");
27315  goto fail;
27316  }
27317  }
27318  if (spec & __Pyx_MEMVIEW_FOLLOW) {
27319  Py_ssize_t stride = buf->strides[dim];
27320  if (stride < 0)
27321  stride = -stride;
27322  if (unlikely(stride < buf->itemsize)) {
27323  PyErr_SetString(PyExc_ValueError,
27324  "Buffer and memoryview are not contiguous "
27325  "in the same dimension.");
27326  goto fail;
27327  }
27328  }
27329  } else {
27330  if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
27331  PyErr_Format(PyExc_ValueError,
27332  "C-contiguous buffer is not contiguous in "
27333  "dimension %d", dim);
27334  goto fail;
27335  } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
27336  PyErr_Format(PyExc_ValueError,
27337  "C-contiguous buffer is not indirect in "
27338  "dimension %d", dim);
27339  goto fail;
27340  } else if (unlikely(buf->suboffsets)) {
27341  PyErr_SetString(PyExc_ValueError,
27342  "Buffer exposes suboffsets but no strides");
27343  goto fail;
27344  }
27345  }
27346  return 1;
27347 fail:
27348  return 0;
27349 }
27350 static int
27351 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
27352 {
27353  if (spec & __Pyx_MEMVIEW_DIRECT) {
27354  if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
27355  PyErr_Format(PyExc_ValueError,
27356  "Buffer not compatible with direct access "
27357  "in dimension %d.", dim);
27358  goto fail;
27359  }
27360  }
27361  if (spec & __Pyx_MEMVIEW_PTR) {
27362  if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
27363  PyErr_Format(PyExc_ValueError,
27364  "Buffer is not indirectly accessible "
27365  "in dimension %d.", dim);
27366  goto fail;
27367  }
27368  }
27369  return 1;
27370 fail:
27371  return 0;
27372 }
27373 static int
27374 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
27375 {
27376  int i;
27377  if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
27378  Py_ssize_t stride = 1;
27379  for (i = 0; i < ndim; i++) {
27380  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
27381  PyErr_SetString(PyExc_ValueError,
27382  "Buffer not fortran contiguous.");
27383  goto fail;
27384  }
27385  stride = stride * buf->shape[i];
27386  }
27387  } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
27388  Py_ssize_t stride = 1;
27389  for (i = ndim - 1; i >- 1; i--) {
27390  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
27391  PyErr_SetString(PyExc_ValueError,
27392  "Buffer not C contiguous.");
27393  goto fail;
27394  }
27395  stride = stride * buf->shape[i];
27396  }
27397  }
27398  return 1;
27399 fail:
27400  return 0;
27401 }
27402 static int __Pyx_ValidateAndInit_memviewslice(
27403  int *axes_specs,
27404  int c_or_f_flag,
27405  int buf_flags,
27406  int ndim,
27407  __Pyx_TypeInfo *dtype,
27408  __Pyx_BufFmt_StackElem stack[],
27409  __Pyx_memviewslice *memviewslice,
27410  PyObject *original_obj)
27411 {
27412  struct __pyx_memoryview_obj *memview, *new_memview;
27413  __Pyx_RefNannyDeclarations
27414  Py_buffer *buf;
27415  int i, spec = 0, retval = -1;
27416  __Pyx_BufFmt_Context ctx;
27417  int from_memoryview = __pyx_memoryview_check(original_obj);
27418  __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
27419  if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
27420  original_obj)->typeinfo)) {
27421  memview = (struct __pyx_memoryview_obj *) original_obj;
27422  new_memview = NULL;
27423  } else {
27424  memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27425  original_obj, buf_flags, 0, dtype);
27426  new_memview = memview;
27427  if (unlikely(!memview))
27428  goto fail;
27429  }
27430  buf = &memview->view;
27431  if (unlikely(buf->ndim != ndim)) {
27432  PyErr_Format(PyExc_ValueError,
27433  "Buffer has wrong number of dimensions (expected %d, got %d)",
27434  ndim, buf->ndim);
27435  goto fail;
27436  }
27437  if (new_memview) {
27438  __Pyx_BufFmt_Init(&ctx, stack, dtype);
27439  if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
27440  }
27441  if (unlikely((unsigned) buf->itemsize != dtype->size)) {
27442  PyErr_Format(PyExc_ValueError,
27443  "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
27444  "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
27445  buf->itemsize,
27446  (buf->itemsize > 1) ? "s" : "",
27447  dtype->name,
27448  dtype->size,
27449  (dtype->size > 1) ? "s" : "");
27450  goto fail;
27451  }
27452  if (buf->len > 0) {
27453  for (i = 0; i < ndim; i++) {
27454  spec = axes_specs[i];
27455  if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
27456  goto fail;
27457  if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
27458  goto fail;
27459  }
27460  if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
27461  goto fail;
27462  }
27463  if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
27464  new_memview != NULL) == -1)) {
27465  goto fail;
27466  }
27467  retval = 0;
27468  goto no_fail;
27469 fail:
27470  Py_XDECREF(new_memview);
27471  retval = -1;
27472 no_fail:
27473  __Pyx_RefNannyFinishContext();
27474  return retval;
27475 }
27476 
27477 /* ObjectToMemviewSlice */
27478  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj, int writable_flag) {
27479  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27480  __Pyx_BufFmt_StackElem stack[1];
27481  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27482  int retcode;
27483  if (obj == Py_None) {
27484  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27485  return result;
27486  }
27487  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
27488  PyBUF_RECORDS_RO | writable_flag, 1,
27489  &__Pyx_TypeInfo_double, stack,
27490  &result, obj);
27491  if (unlikely(retcode == -1))
27492  goto __pyx_fail;
27493  return result;
27494 __pyx_fail:
27495  result.memview = NULL;
27496  result.data = NULL;
27497  return result;
27498 }
27499 
27500 /* ObjectToMemviewSlice */
27501  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj, int writable_flag) {
27502  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27503  __Pyx_BufFmt_StackElem stack[1];
27504  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27505  int retcode;
27506  if (obj == Py_None) {
27507  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27508  return result;
27509  }
27510  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
27511  PyBUF_RECORDS_RO | writable_flag, 1,
27512  &__Pyx_TypeInfo_int, stack,
27513  &result, obj);
27514  if (unlikely(retcode == -1))
27515  goto __pyx_fail;
27516  return result;
27517 __pyx_fail:
27518  result.memview = NULL;
27519  result.data = NULL;
27520  return result;
27521 }
27522 
27523 /* Declarations */
27524  #if CYTHON_CCOMPLEX
27525  #ifdef __cplusplus
27526  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27527  return ::std::complex< float >(x, y);
27528  }
27529  #else
27530  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27531  return x + y*(__pyx_t_float_complex)_Complex_I;
27532  }
27533  #endif
27534 #else
27535  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27536  __pyx_t_float_complex z;
27537  z.real = x;
27538  z.imag = y;
27539  return z;
27540  }
27541 #endif
27542 
27543 /* Arithmetic */
27544  #if CYTHON_CCOMPLEX
27545 #else
27546  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27547  return (a.real == b.real) && (a.imag == b.imag);
27548  }
27549  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27550  __pyx_t_float_complex z;
27551  z.real = a.real + b.real;
27552  z.imag = a.imag + b.imag;
27553  return z;
27554  }
27555  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27556  __pyx_t_float_complex z;
27557  z.real = a.real - b.real;
27558  z.imag = a.imag - b.imag;
27559  return z;
27560  }
27561  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27562  __pyx_t_float_complex z;
27563  z.real = a.real * b.real - a.imag * b.imag;
27564  z.imag = a.real * b.imag + a.imag * b.real;
27565  return z;
27566  }
27567  #if 1
27568  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27569  if (b.imag == 0) {
27570  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27571  } else if (fabsf(b.real) >= fabsf(b.imag)) {
27572  if (b.real == 0 && b.imag == 0) {
27573  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
27574  } else {
27575  float r = b.imag / b.real;
27576  float s = (float)(1.0) / (b.real + b.imag * r);
27577  return __pyx_t_float_complex_from_parts(
27578  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
27579  }
27580  } else {
27581  float r = b.real / b.imag;
27582  float s = (float)(1.0) / (b.imag + b.real * r);
27583  return __pyx_t_float_complex_from_parts(
27584  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
27585  }
27586  }
27587  #else
27588  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27589  if (b.imag == 0) {
27590  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27591  } else {
27592  float denom = b.real * b.real + b.imag * b.imag;
27593  return __pyx_t_float_complex_from_parts(
27594  (a.real * b.real + a.imag * b.imag) / denom,
27595  (a.imag * b.real - a.real * b.imag) / denom);
27596  }
27597  }
27598  #endif
27599  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
27600  __pyx_t_float_complex z;
27601  z.real = -a.real;
27602  z.imag = -a.imag;
27603  return z;
27604  }
27605  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
27606  return (a.real == 0) && (a.imag == 0);
27607  }
27608  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
27609  __pyx_t_float_complex z;
27610  z.real = a.real;
27611  z.imag = -a.imag;
27612  return z;
27613  }
27614  #if 1
27615  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
27616  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27617  return sqrtf(z.real*z.real + z.imag*z.imag);
27618  #else
27619  return hypotf(z.real, z.imag);
27620  #endif
27621  }
27622  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27623  __pyx_t_float_complex z;
27624  float r, lnr, theta, z_r, z_theta;
27625  if (b.imag == 0 && b.real == (int)b.real) {
27626  if (b.real < 0) {
27627  float denom = a.real * a.real + a.imag * a.imag;
27628  a.real = a.real / denom;
27629  a.imag = -a.imag / denom;
27630  b.real = -b.real;
27631  }
27632  switch ((int)b.real) {
27633  case 0:
27634  z.real = 1;
27635  z.imag = 0;
27636  return z;
27637  case 1:
27638  return a;
27639  case 2:
27640  return __Pyx_c_prod_float(a, a);
27641  case 3:
27642  z = __Pyx_c_prod_float(a, a);
27643  return __Pyx_c_prod_float(z, a);
27644  case 4:
27645  z = __Pyx_c_prod_float(a, a);
27646  return __Pyx_c_prod_float(z, z);
27647  }
27648  }
27649  if (a.imag == 0) {
27650  if (a.real == 0) {
27651  return a;
27652  } else if (b.imag == 0) {
27653  z.real = powf(a.real, b.real);
27654  z.imag = 0;
27655  return z;
27656  } else if (a.real > 0) {
27657  r = a.real;
27658  theta = 0;
27659  } else {
27660  r = -a.real;
27661  theta = atan2f(0.0, -1.0);
27662  }
27663  } else {
27664  r = __Pyx_c_abs_float(a);
27665  theta = atan2f(a.imag, a.real);
27666  }
27667  lnr = logf(r);
27668  z_r = expf(lnr * b.real - theta * b.imag);
27669  z_theta = theta * b.real + lnr * b.imag;
27670  z.real = z_r * cosf(z_theta);
27671  z.imag = z_r * sinf(z_theta);
27672  return z;
27673  }
27674  #endif
27675 #endif
27676 
27677 /* Declarations */
27678  #if CYTHON_CCOMPLEX
27679  #ifdef __cplusplus
27680  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27681  return ::std::complex< double >(x, y);
27682  }
27683  #else
27684  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27685  return x + y*(__pyx_t_double_complex)_Complex_I;
27686  }
27687  #endif
27688 #else
27689  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27690  __pyx_t_double_complex z;
27691  z.real = x;
27692  z.imag = y;
27693  return z;
27694  }
27695 #endif
27696 
27697 /* Arithmetic */
27698  #if CYTHON_CCOMPLEX
27699 #else
27700  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27701  return (a.real == b.real) && (a.imag == b.imag);
27702  }
27703  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27704  __pyx_t_double_complex z;
27705  z.real = a.real + b.real;
27706  z.imag = a.imag + b.imag;
27707  return z;
27708  }
27709  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27710  __pyx_t_double_complex z;
27711  z.real = a.real - b.real;
27712  z.imag = a.imag - b.imag;
27713  return z;
27714  }
27715  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27716  __pyx_t_double_complex z;
27717  z.real = a.real * b.real - a.imag * b.imag;
27718  z.imag = a.real * b.imag + a.imag * b.real;
27719  return z;
27720  }
27721  #if 1
27722  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27723  if (b.imag == 0) {
27724  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27725  } else if (fabs(b.real) >= fabs(b.imag)) {
27726  if (b.real == 0 && b.imag == 0) {
27727  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
27728  } else {
27729  double r = b.imag / b.real;
27730  double s = (double)(1.0) / (b.real + b.imag * r);
27731  return __pyx_t_double_complex_from_parts(
27732  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
27733  }
27734  } else {
27735  double r = b.real / b.imag;
27736  double s = (double)(1.0) / (b.imag + b.real * r);
27737  return __pyx_t_double_complex_from_parts(
27738  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
27739  }
27740  }
27741  #else
27742  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27743  if (b.imag == 0) {
27744  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27745  } else {
27746  double denom = b.real * b.real + b.imag * b.imag;
27747  return __pyx_t_double_complex_from_parts(
27748  (a.real * b.real + a.imag * b.imag) / denom,
27749  (a.imag * b.real - a.real * b.imag) / denom);
27750  }
27751  }
27752  #endif
27753  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
27754  __pyx_t_double_complex z;
27755  z.real = -a.real;
27756  z.imag = -a.imag;
27757  return z;
27758  }
27759  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
27760  return (a.real == 0) && (a.imag == 0);
27761  }
27762  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
27763  __pyx_t_double_complex z;
27764  z.real = a.real;
27765  z.imag = -a.imag;
27766  return z;
27767  }
27768  #if 1
27769  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
27770  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27771  return sqrt(z.real*z.real + z.imag*z.imag);
27772  #else
27773  return hypot(z.real, z.imag);
27774  #endif
27775  }
27776  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27777  __pyx_t_double_complex z;
27778  double r, lnr, theta, z_r, z_theta;
27779  if (b.imag == 0 && b.real == (int)b.real) {
27780  if (b.real < 0) {
27781  double denom = a.real * a.real + a.imag * a.imag;
27782  a.real = a.real / denom;
27783  a.imag = -a.imag / denom;
27784  b.real = -b.real;
27785  }
27786  switch ((int)b.real) {
27787  case 0:
27788  z.real = 1;
27789  z.imag = 0;
27790  return z;
27791  case 1:
27792  return a;
27793  case 2:
27794  return __Pyx_c_prod_double(a, a);
27795  case 3:
27796  z = __Pyx_c_prod_double(a, a);
27797  return __Pyx_c_prod_double(z, a);
27798  case 4:
27799  z = __Pyx_c_prod_double(a, a);
27800  return __Pyx_c_prod_double(z, z);
27801  }
27802  }
27803  if (a.imag == 0) {
27804  if (a.real == 0) {
27805  return a;
27806  } else if (b.imag == 0) {
27807  z.real = pow(a.real, b.real);
27808  z.imag = 0;
27809  return z;
27810  } else if (a.real > 0) {
27811  r = a.real;
27812  theta = 0;
27813  } else {
27814  r = -a.real;
27815  theta = atan2(0.0, -1.0);
27816  }
27817  } else {
27818  r = __Pyx_c_abs_double(a);
27819  theta = atan2(a.imag, a.real);
27820  }
27821  lnr = log(r);
27822  z_r = exp(lnr * b.real - theta * b.imag);
27823  z_theta = theta * b.real + lnr * b.imag;
27824  z.real = z_r * cos(z_theta);
27825  z.imag = z_r * sin(z_theta);
27826  return z;
27827  }
27828  #endif
27829 #endif
27830 
27831 /* MemviewSliceCopyTemplate */
27832  static __Pyx_memviewslice
27833 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
27834  const char *mode, int ndim,
27835  size_t sizeof_dtype, int contig_flag,
27836  int dtype_is_object)
27837 {
27838  __Pyx_RefNannyDeclarations
27839  int i;
27840  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
27841  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
27842  Py_buffer *buf = &from_memview->view;
27843  PyObject *shape_tuple = NULL;
27844  PyObject *temp_int = NULL;
27845  struct __pyx_array_obj *array_obj = NULL;
27846  struct __pyx_memoryview_obj *memview_obj = NULL;
27847  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
27848  for (i = 0; i < ndim; i++) {
27849  if (unlikely(from_mvs->suboffsets[i] >= 0)) {
27850  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
27851  "indirect dimensions (axis %d)", i);
27852  goto fail;
27853  }
27854  }
27855  shape_tuple = PyTuple_New(ndim);
27856  if (unlikely(!shape_tuple)) {
27857  goto fail;
27858  }
27859  __Pyx_GOTREF(shape_tuple);
27860  for(i = 0; i < ndim; i++) {
27861  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
27862  if(unlikely(!temp_int)) {
27863  goto fail;
27864  } else {
27865  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
27866  temp_int = NULL;
27867  }
27868  }
27869  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
27870  if (unlikely(!array_obj)) {
27871  goto fail;
27872  }
27873  __Pyx_GOTREF(array_obj);
27874  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27875  (PyObject *) array_obj, contig_flag,
27876  dtype_is_object,
27877  from_mvs->memview->typeinfo);
27878  if (unlikely(!memview_obj))
27879  goto fail;
27880  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
27881  goto fail;
27882  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
27883  dtype_is_object) < 0))
27884  goto fail;
27885  goto no_fail;
27886 fail:
27887  __Pyx_XDECREF(new_mvs.memview);
27888  new_mvs.memview = NULL;
27889  new_mvs.data = NULL;
27890 no_fail:
27891  __Pyx_XDECREF(shape_tuple);
27892  __Pyx_XDECREF(temp_int);
27893  __Pyx_XDECREF(array_obj);
27894  __Pyx_RefNannyFinishContext();
27895  return new_mvs;
27896 }
27897 
27898 /* CIntFromPy */
27899  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
27900 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27901 #pragma GCC diagnostic push
27902 #pragma GCC diagnostic ignored "-Wconversion"
27903 #endif
27904  const int neg_one = (int) -1, const_zero = (int) 0;
27905 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27906 #pragma GCC diagnostic pop
27907 #endif
27908  const int is_unsigned = neg_one > const_zero;
27909 #if PY_MAJOR_VERSION < 3
27910  if (likely(PyInt_Check(x))) {
27911  if (sizeof(int) < sizeof(long)) {
27912  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
27913  } else {
27914  long val = PyInt_AS_LONG(x);
27915  if (is_unsigned && unlikely(val < 0)) {
27916  goto raise_neg_overflow;
27917  }
27918  return (int) val;
27919  }
27920  } else
27921 #endif
27922  if (likely(PyLong_Check(x))) {
27923  if (is_unsigned) {
27924 #if CYTHON_USE_PYLONG_INTERNALS
27925  const digit* digits = ((PyLongObject*)x)->ob_digit;
27926  switch (Py_SIZE(x)) {
27927  case 0: return (int) 0;
27928  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
27929  case 2:
27930  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
27931  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27932  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27933  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
27934  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27935  }
27936  }
27937  break;
27938  case 3:
27939  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
27940  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27941  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27942  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
27943  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27944  }
27945  }
27946  break;
27947  case 4:
27948  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
27949  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27950  __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])))
27951  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
27952  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27953  }
27954  }
27955  break;
27956  }
27957 #endif
27958 #if CYTHON_COMPILING_IN_CPYTHON
27959  if (unlikely(Py_SIZE(x) < 0)) {
27960  goto raise_neg_overflow;
27961  }
27962 #else
27963  {
27964  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27965  if (unlikely(result < 0))
27966  return (int) -1;
27967  if (unlikely(result == 1))
27968  goto raise_neg_overflow;
27969  }
27970 #endif
27971  if (sizeof(int) <= sizeof(unsigned long)) {
27972  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
27973 #ifdef HAVE_LONG_LONG
27974  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
27975  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27976 #endif
27977  }
27978  } else {
27979 #if CYTHON_USE_PYLONG_INTERNALS
27980  const digit* digits = ((PyLongObject*)x)->ob_digit;
27981  switch (Py_SIZE(x)) {
27982  case 0: return (int) 0;
27983  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
27984  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
27985  case -2:
27986  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
27987  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27988  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27989  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
27990  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27991  }
27992  }
27993  break;
27994  case 2:
27995  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
27996  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27997  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27998  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
27999  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28000  }
28001  }
28002  break;
28003  case -3:
28004  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
28005  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28006  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28007  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28008  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28009  }
28010  }
28011  break;
28012  case 3:
28013  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
28014  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28015  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28016  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28017  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28018  }
28019  }
28020  break;
28021  case -4:
28022  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
28023  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28024  __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])))
28025  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
28026  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28027  }
28028  }
28029  break;
28030  case 4:
28031  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
28032  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28033  __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])))
28034  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
28035  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28036  }
28037  }
28038  break;
28039  }
28040 #endif
28041  if (sizeof(int) <= sizeof(long)) {
28042  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
28043 #ifdef HAVE_LONG_LONG
28044  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
28045  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
28046 #endif
28047  }
28048  }
28049  {
28050 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28051  PyErr_SetString(PyExc_RuntimeError,
28052  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28053 #else
28054  int val;
28055  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28056  #if PY_MAJOR_VERSION < 3
28057  if (likely(v) && !PyLong_Check(v)) {
28058  PyObject *tmp = v;
28059  v = PyNumber_Long(tmp);
28060  Py_DECREF(tmp);
28061  }
28062  #endif
28063  if (likely(v)) {
28064  int one = 1; int is_little = (int)*(unsigned char *)&one;
28065  unsigned char *bytes = (unsigned char *)&val;
28066  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28067  bytes, sizeof(val),
28068  is_little, !is_unsigned);
28069  Py_DECREF(v);
28070  if (likely(!ret))
28071  return val;
28072  }
28073 #endif
28074  return (int) -1;
28075  }
28076  } else {
28077  int val;
28078  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28079  if (!tmp) return (int) -1;
28080  val = __Pyx_PyInt_As_int(tmp);
28081  Py_DECREF(tmp);
28082  return val;
28083  }
28084 raise_overflow:
28085  PyErr_SetString(PyExc_OverflowError,
28086  "value too large to convert to int");
28087  return (int) -1;
28088 raise_neg_overflow:
28089  PyErr_SetString(PyExc_OverflowError,
28090  "can't convert negative value to int");
28091  return (int) -1;
28092 }
28093 
28094 /* CIntFromPy */
28095  static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
28096 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28097 #pragma GCC diagnostic push
28098 #pragma GCC diagnostic ignored "-Wconversion"
28099 #endif
28100  const long neg_one = (long) -1, const_zero = (long) 0;
28101 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28102 #pragma GCC diagnostic pop
28103 #endif
28104  const int is_unsigned = neg_one > const_zero;
28105 #if PY_MAJOR_VERSION < 3
28106  if (likely(PyInt_Check(x))) {
28107  if (sizeof(long) < sizeof(long)) {
28108  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
28109  } else {
28110  long val = PyInt_AS_LONG(x);
28111  if (is_unsigned && unlikely(val < 0)) {
28112  goto raise_neg_overflow;
28113  }
28114  return (long) val;
28115  }
28116  } else
28117 #endif
28118  if (likely(PyLong_Check(x))) {
28119  if (is_unsigned) {
28120 #if CYTHON_USE_PYLONG_INTERNALS
28121  const digit* digits = ((PyLongObject*)x)->ob_digit;
28122  switch (Py_SIZE(x)) {
28123  case 0: return (long) 0;
28124  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
28125  case 2:
28126  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
28127  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28128  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28129  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
28130  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28131  }
28132  }
28133  break;
28134  case 3:
28135  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
28136  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28137  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28138  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
28139  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28140  }
28141  }
28142  break;
28143  case 4:
28144  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
28145  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28146  __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])))
28147  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
28148  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28149  }
28150  }
28151  break;
28152  }
28153 #endif
28154 #if CYTHON_COMPILING_IN_CPYTHON
28155  if (unlikely(Py_SIZE(x) < 0)) {
28156  goto raise_neg_overflow;
28157  }
28158 #else
28159  {
28160  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28161  if (unlikely(result < 0))
28162  return (long) -1;
28163  if (unlikely(result == 1))
28164  goto raise_neg_overflow;
28165  }
28166 #endif
28167  if (sizeof(long) <= sizeof(unsigned long)) {
28168  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
28169 #ifdef HAVE_LONG_LONG
28170  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
28171  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28172 #endif
28173  }
28174  } else {
28175 #if CYTHON_USE_PYLONG_INTERNALS
28176  const digit* digits = ((PyLongObject*)x)->ob_digit;
28177  switch (Py_SIZE(x)) {
28178  case 0: return (long) 0;
28179  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
28180  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
28181  case -2:
28182  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
28183  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28184  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28185  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28186  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28187  }
28188  }
28189  break;
28190  case 2:
28191  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
28192  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28193  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28194  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28195  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28196  }
28197  }
28198  break;
28199  case -3:
28200  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28201  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28202  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28203  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28204  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28205  }
28206  }
28207  break;
28208  case 3:
28209  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
28210  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28211  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28212  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28213  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28214  }
28215  }
28216  break;
28217  case -4:
28218  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28219  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28220  __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])))
28221  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28222  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28223  }
28224  }
28225  break;
28226  case 4:
28227  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
28228  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28229  __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])))
28230  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28231  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28232  }
28233  }
28234  break;
28235  }
28236 #endif
28237  if (sizeof(long) <= sizeof(long)) {
28238  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
28239 #ifdef HAVE_LONG_LONG
28240  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
28241  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
28242 #endif
28243  }
28244  }
28245  {
28246 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28247  PyErr_SetString(PyExc_RuntimeError,
28248  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28249 #else
28250  long val;
28251  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28252  #if PY_MAJOR_VERSION < 3
28253  if (likely(v) && !PyLong_Check(v)) {
28254  PyObject *tmp = v;
28255  v = PyNumber_Long(tmp);
28256  Py_DECREF(tmp);
28257  }
28258  #endif
28259  if (likely(v)) {
28260  int one = 1; int is_little = (int)*(unsigned char *)&one;
28261  unsigned char *bytes = (unsigned char *)&val;
28262  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28263  bytes, sizeof(val),
28264  is_little, !is_unsigned);
28265  Py_DECREF(v);
28266  if (likely(!ret))
28267  return val;
28268  }
28269 #endif
28270  return (long) -1;
28271  }
28272  } else {
28273  long val;
28274  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28275  if (!tmp) return (long) -1;
28276  val = __Pyx_PyInt_As_long(tmp);
28277  Py_DECREF(tmp);
28278  return val;
28279  }
28280 raise_overflow:
28281  PyErr_SetString(PyExc_OverflowError,
28282  "value too large to convert to long");
28283  return (long) -1;
28284 raise_neg_overflow:
28285  PyErr_SetString(PyExc_OverflowError,
28286  "can't convert negative value to long");
28287  return (long) -1;
28288 }
28289 
28290 /* CIntToPy */
28291  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
28292 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28293 #pragma GCC diagnostic push
28294 #pragma GCC diagnostic ignored "-Wconversion"
28295 #endif
28296  const int neg_one = (int) -1, const_zero = (int) 0;
28297 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28298 #pragma GCC diagnostic pop
28299 #endif
28300  const int is_unsigned = neg_one > const_zero;
28301  if (is_unsigned) {
28302  if (sizeof(int) < sizeof(long)) {
28303  return PyInt_FromLong((long) value);
28304  } else if (sizeof(int) <= sizeof(unsigned long)) {
28305  return PyLong_FromUnsignedLong((unsigned long) value);
28306 #ifdef HAVE_LONG_LONG
28307  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
28308  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
28309 #endif
28310  }
28311  } else {
28312  if (sizeof(int) <= sizeof(long)) {
28313  return PyInt_FromLong((long) value);
28314 #ifdef HAVE_LONG_LONG
28315  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
28316  return PyLong_FromLongLong((PY_LONG_LONG) value);
28317 #endif
28318  }
28319  }
28320  {
28321  int one = 1; int little = (int)*(unsigned char *)&one;
28322  unsigned char *bytes = (unsigned char *)&value;
28323  return _PyLong_FromByteArray(bytes, sizeof(int),
28324  little, !is_unsigned);
28325  }
28326 }
28327 
28328 /* CIntToPy */
28329  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
28330 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28331 #pragma GCC diagnostic push
28332 #pragma GCC diagnostic ignored "-Wconversion"
28333 #endif
28334  const long neg_one = (long) -1, const_zero = (long) 0;
28335 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28336 #pragma GCC diagnostic pop
28337 #endif
28338  const int is_unsigned = neg_one > const_zero;
28339  if (is_unsigned) {
28340  if (sizeof(long) < sizeof(long)) {
28341  return PyInt_FromLong((long) value);
28342  } else if (sizeof(long) <= sizeof(unsigned long)) {
28343  return PyLong_FromUnsignedLong((unsigned long) value);
28344 #ifdef HAVE_LONG_LONG
28345  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
28346  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
28347 #endif
28348  }
28349  } else {
28350  if (sizeof(long) <= sizeof(long)) {
28351  return PyInt_FromLong((long) value);
28352 #ifdef HAVE_LONG_LONG
28353  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
28354  return PyLong_FromLongLong((PY_LONG_LONG) value);
28355 #endif
28356  }
28357  }
28358  {
28359  int one = 1; int little = (int)*(unsigned char *)&one;
28360  unsigned char *bytes = (unsigned char *)&value;
28361  return _PyLong_FromByteArray(bytes, sizeof(long),
28362  little, !is_unsigned);
28363  }
28364 }
28365 
28366 /* CIntFromPy */
28367  static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
28368 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28369 #pragma GCC diagnostic push
28370 #pragma GCC diagnostic ignored "-Wconversion"
28371 #endif
28372  const char neg_one = (char) -1, const_zero = (char) 0;
28373 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28374 #pragma GCC diagnostic pop
28375 #endif
28376  const int is_unsigned = neg_one > const_zero;
28377 #if PY_MAJOR_VERSION < 3
28378  if (likely(PyInt_Check(x))) {
28379  if (sizeof(char) < sizeof(long)) {
28380  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
28381  } else {
28382  long val = PyInt_AS_LONG(x);
28383  if (is_unsigned && unlikely(val < 0)) {
28384  goto raise_neg_overflow;
28385  }
28386  return (char) val;
28387  }
28388  } else
28389 #endif
28390  if (likely(PyLong_Check(x))) {
28391  if (is_unsigned) {
28392 #if CYTHON_USE_PYLONG_INTERNALS
28393  const digit* digits = ((PyLongObject*)x)->ob_digit;
28394  switch (Py_SIZE(x)) {
28395  case 0: return (char) 0;
28396  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
28397  case 2:
28398  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
28399  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28400  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28401  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
28402  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28403  }
28404  }
28405  break;
28406  case 3:
28407  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
28408  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28409  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28410  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
28411  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28412  }
28413  }
28414  break;
28415  case 4:
28416  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
28417  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28418  __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])))
28419  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
28420  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28421  }
28422  }
28423  break;
28424  }
28425 #endif
28426 #if CYTHON_COMPILING_IN_CPYTHON
28427  if (unlikely(Py_SIZE(x) < 0)) {
28428  goto raise_neg_overflow;
28429  }
28430 #else
28431  {
28432  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28433  if (unlikely(result < 0))
28434  return (char) -1;
28435  if (unlikely(result == 1))
28436  goto raise_neg_overflow;
28437  }
28438 #endif
28439  if (sizeof(char) <= sizeof(unsigned long)) {
28440  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
28441 #ifdef HAVE_LONG_LONG
28442  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
28443  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28444 #endif
28445  }
28446  } else {
28447 #if CYTHON_USE_PYLONG_INTERNALS
28448  const digit* digits = ((PyLongObject*)x)->ob_digit;
28449  switch (Py_SIZE(x)) {
28450  case 0: return (char) 0;
28451  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
28452  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
28453  case -2:
28454  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
28455  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28456  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28457  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28458  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28459  }
28460  }
28461  break;
28462  case 2:
28463  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
28464  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28465  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28466  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28467  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28468  }
28469  }
28470  break;
28471  case -3:
28472  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28473  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28474  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28475  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28476  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28477  }
28478  }
28479  break;
28480  case 3:
28481  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
28482  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28483  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28484  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28485  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28486  }
28487  }
28488  break;
28489  case -4:
28490  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28491  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28492  __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])))
28493  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
28494  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28495  }
28496  }
28497  break;
28498  case 4:
28499  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
28500  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28501  __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])))
28502  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
28503  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28504  }
28505  }
28506  break;
28507  }
28508 #endif
28509  if (sizeof(char) <= sizeof(long)) {
28510  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
28511 #ifdef HAVE_LONG_LONG
28512  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
28513  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
28514 #endif
28515  }
28516  }
28517  {
28518 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28519  PyErr_SetString(PyExc_RuntimeError,
28520  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28521 #else
28522  char val;
28523  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28524  #if PY_MAJOR_VERSION < 3
28525  if (likely(v) && !PyLong_Check(v)) {
28526  PyObject *tmp = v;
28527  v = PyNumber_Long(tmp);
28528  Py_DECREF(tmp);
28529  }
28530  #endif
28531  if (likely(v)) {
28532  int one = 1; int is_little = (int)*(unsigned char *)&one;
28533  unsigned char *bytes = (unsigned char *)&val;
28534  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28535  bytes, sizeof(val),
28536  is_little, !is_unsigned);
28537  Py_DECREF(v);
28538  if (likely(!ret))
28539  return val;
28540  }
28541 #endif
28542  return (char) -1;
28543  }
28544  } else {
28545  char val;
28546  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28547  if (!tmp) return (char) -1;
28548  val = __Pyx_PyInt_As_char(tmp);
28549  Py_DECREF(tmp);
28550  return val;
28551  }
28552 raise_overflow:
28553  PyErr_SetString(PyExc_OverflowError,
28554  "value too large to convert to char");
28555  return (char) -1;
28556 raise_neg_overflow:
28557  PyErr_SetString(PyExc_OverflowError,
28558  "can't convert negative value to char");
28559  return (char) -1;
28560 }
28561 
28562 /* CheckBinaryVersion */
28563  static int __Pyx_check_binary_version(void) {
28564  char ctversion[5];
28565  int same=1, i, found_dot;
28566  const char* rt_from_call = Py_GetVersion();
28567  PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
28568  found_dot = 0;
28569  for (i = 0; i < 4; i++) {
28570  if (!ctversion[i]) {
28571  same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
28572  break;
28573  }
28574  if (rt_from_call[i] != ctversion[i]) {
28575  same = 0;
28576  break;
28577  }
28578  }
28579  if (!same) {
28580  char rtversion[5] = {'\0'};
28581  char message[200];
28582  for (i=0; i<4; ++i) {
28583  if (rt_from_call[i] == '.') {
28584  if (found_dot) break;
28585  found_dot = 1;
28586  } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
28587  break;
28588  }
28589  rtversion[i] = rt_from_call[i];
28590  }
28591  PyOS_snprintf(message, sizeof(message),
28592  "compiletime version %s of module '%.100s' "
28593  "does not match runtime version %s",
28594  ctversion, __Pyx_MODULE_NAME, rtversion);
28595  return PyErr_WarnEx(NULL, message, 1);
28596  }
28597  return 0;
28598 }
28599 
28600 /* InitStrings */
28601  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
28602  while (t->p) {
28603  #if PY_MAJOR_VERSION < 3
28604  if (t->is_unicode) {
28605  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
28606  } else if (t->intern) {
28607  *t->p = PyString_InternFromString(t->s);
28608  } else {
28609  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
28610  }
28611  #else
28612  if (t->is_unicode | t->is_str) {
28613  if (t->intern) {
28614  *t->p = PyUnicode_InternFromString(t->s);
28615  } else if (t->encoding) {
28616  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
28617  } else {
28618  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
28619  }
28620  } else {
28621  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
28622  }
28623  #endif
28624  if (!*t->p)
28625  return -1;
28626  if (PyObject_Hash(*t->p) == -1)
28627  return -1;
28628  ++t;
28629  }
28630  return 0;
28631 }
28632 
28633 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
28634  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
28635 }
28636 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
28637  Py_ssize_t ignore;
28638  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
28639 }
28640 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
28641 #if !CYTHON_PEP393_ENABLED
28642 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28643  char* defenc_c;
28644  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
28645  if (!defenc) return NULL;
28646  defenc_c = PyBytes_AS_STRING(defenc);
28647 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28648  {
28649  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
28650  char* c;
28651  for (c = defenc_c; c < end; c++) {
28652  if ((unsigned char) (*c) >= 128) {
28653  PyUnicode_AsASCIIString(o);
28654  return NULL;
28655  }
28656  }
28657  }
28658 #endif
28659  *length = PyBytes_GET_SIZE(defenc);
28660  return defenc_c;
28661 }
28662 #else
28663 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28664  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
28665 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28666  if (likely(PyUnicode_IS_ASCII(o))) {
28667  *length = PyUnicode_GET_LENGTH(o);
28668  return PyUnicode_AsUTF8(o);
28669  } else {
28670  PyUnicode_AsASCIIString(o);
28671  return NULL;
28672  }
28673 #else
28674  return PyUnicode_AsUTF8AndSize(o, length);
28675 #endif
28676 }
28677 #endif
28678 #endif
28679 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28680 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
28681  if (
28682 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28683  __Pyx_sys_getdefaultencoding_not_ascii &&
28684 #endif
28685  PyUnicode_Check(o)) {
28686  return __Pyx_PyUnicode_AsStringAndSize(o, length);
28687  } else
28688 #endif
28689 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
28690  if (PyByteArray_Check(o)) {
28691  *length = PyByteArray_GET_SIZE(o);
28692  return PyByteArray_AS_STRING(o);
28693  } else
28694 #endif
28695  {
28696  char* result;
28697  int r = PyBytes_AsStringAndSize(o, &result, length);
28698  if (unlikely(r < 0)) {
28699  return NULL;
28700  } else {
28701  return result;
28702  }
28703  }
28704 }
28705 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
28706  int is_true = x == Py_True;
28707  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
28708  else return PyObject_IsTrue(x);
28709 }
28710 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
28711  int retval;
28712  if (unlikely(!x)) return -1;
28713  retval = __Pyx_PyObject_IsTrue(x);
28714  Py_DECREF(x);
28715  return retval;
28716 }
28717 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
28718 #if PY_MAJOR_VERSION >= 3
28719  if (PyLong_Check(result)) {
28720  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
28721  "__int__ returned non-int (type %.200s). "
28722  "The ability to return an instance of a strict subclass of int "
28723  "is deprecated, and may be removed in a future version of Python.",
28724  Py_TYPE(result)->tp_name)) {
28725  Py_DECREF(result);
28726  return NULL;
28727  }
28728  return result;
28729  }
28730 #endif
28731  PyErr_Format(PyExc_TypeError,
28732  "__%.4s__ returned non-%.4s (type %.200s)",
28733  type_name, type_name, Py_TYPE(result)->tp_name);
28734  Py_DECREF(result);
28735  return NULL;
28736 }
28737 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
28738 #if CYTHON_USE_TYPE_SLOTS
28739  PyNumberMethods *m;
28740 #endif
28741  const char *name = NULL;
28742  PyObject *res = NULL;
28743 #if PY_MAJOR_VERSION < 3
28744  if (likely(PyInt_Check(x) || PyLong_Check(x)))
28745 #else
28746  if (likely(PyLong_Check(x)))
28747 #endif
28748  return __Pyx_NewRef(x);
28749 #if CYTHON_USE_TYPE_SLOTS
28750  m = Py_TYPE(x)->tp_as_number;
28751  #if PY_MAJOR_VERSION < 3
28752  if (m && m->nb_int) {
28753  name = "int";
28754  res = m->nb_int(x);
28755  }
28756  else if (m && m->nb_long) {
28757  name = "long";
28758  res = m->nb_long(x);
28759  }
28760  #else
28761  if (likely(m && m->nb_int)) {
28762  name = "int";
28763  res = m->nb_int(x);
28764  }
28765  #endif
28766 #else
28767  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
28768  res = PyNumber_Int(x);
28769  }
28770 #endif
28771  if (likely(res)) {
28772 #if PY_MAJOR_VERSION < 3
28773  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
28774 #else
28775  if (unlikely(!PyLong_CheckExact(res))) {
28776 #endif
28777  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
28778  }
28779  }
28780  else if (!PyErr_Occurred()) {
28781  PyErr_SetString(PyExc_TypeError,
28782  "an integer is required");
28783  }
28784  return res;
28785 }
28786 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
28787  Py_ssize_t ival;
28788  PyObject *x;
28789 #if PY_MAJOR_VERSION < 3
28790  if (likely(PyInt_CheckExact(b))) {
28791  if (sizeof(Py_ssize_t) >= sizeof(long))
28792  return PyInt_AS_LONG(b);
28793  else
28794  return PyInt_AsSsize_t(b);
28795  }
28796 #endif
28797  if (likely(PyLong_CheckExact(b))) {
28798  #if CYTHON_USE_PYLONG_INTERNALS
28799  const digit* digits = ((PyLongObject*)b)->ob_digit;
28800  const Py_ssize_t size = Py_SIZE(b);
28801  if (likely(__Pyx_sst_abs(size) <= 1)) {
28802  ival = likely(size) ? digits[0] : 0;
28803  if (size == -1) ival = -ival;
28804  return ival;
28805  } else {
28806  switch (size) {
28807  case 2:
28808  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28809  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28810  }
28811  break;
28812  case -2:
28813  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28814  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28815  }
28816  break;
28817  case 3:
28818  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28819  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28820  }
28821  break;
28822  case -3:
28823  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28824  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28825  }
28826  break;
28827  case 4:
28828  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28829  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]));
28830  }
28831  break;
28832  case -4:
28833  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28834  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]));
28835  }
28836  break;
28837  }
28838  }
28839  #endif
28840  return PyLong_AsSsize_t(b);
28841  }
28842  x = PyNumber_Index(b);
28843  if (!x) return -1;
28844  ival = PyInt_AsSsize_t(x);
28845  Py_DECREF(x);
28846  return ival;
28847 }
28848 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
28849  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
28850  return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
28851 #if PY_MAJOR_VERSION < 3
28852  } else if (likely(PyInt_CheckExact(o))) {
28853  return PyInt_AS_LONG(o);
28854 #endif
28855  } else {
28856  Py_ssize_t ival;
28857  PyObject *x;
28858  x = PyNumber_Index(o);
28859  if (!x) return -1;
28860  ival = PyInt_AsLong(x);
28861  Py_DECREF(x);
28862  return ival;
28863  }
28864 }
28865 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
28866  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
28867 }
28868 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
28869  return PyInt_FromSize_t(ival);
28870 }
28871 
28872 
28873 #endif /* Py_PYTHON_H */
asm_NR_prepare
void asm_NR_prepare(SuperMatrix *A, int *subdomain_dim, int **l2g_L, double **subdomainL, PROTEUS_LAPACK_INTEGER **subdomainPivots)
Definition: smoothers.c:293
jacobi_NR_prepare
void jacobi_NR_prepare(SuperMatrix *A, double w, double tol, double *M)
Definition: smoothers.c:10
basm_NR_prepare
void basm_NR_prepare(int rowBlocks, int N, SuperMatrix *A, int *subdomain_dim, int **l2g_L, double **subdomainL, PROTEUS_LAPACK_INTEGER **subdomainPivots, PROTEUS_LAPACK_INTEGER **subdomainColPivots)
Definition: smoothers.c:602
smoothers.h
C implementations of multilevel smoother algorithms.
jacobi_NR_solve
void jacobi_NR_solve(SuperMatrix *A, double *M, double *R, int *node_order, double *dX)
Definition: smoothers.c:15
gauss_seidel_NR_prepare
void gauss_seidel_NR_prepare(SuperMatrix *A, double w, double tol, double *M)
Definition: smoothers.c:71
f
Double f
Definition: Headers.h:64
number
Int number
Definition: Headers.h:33
asm_NR_free
void asm_NR_free(int N, int *subdomain_dim, int **l2g_L, double **subdomain_L, double **subdomain_R, double **subdomain_dX, PROTEUS_LAPACK_INTEGER **subdomain_pivots)
Definition: smoothers.c:268
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
basm_NR_init
int basm_NR_init(int rowBlocks, SuperMatrix *A, int **subdomain_dim_p, int ***l2g_L_p, double ***subdomain_L_p, double ***subdomain_R_p, double ***subdomain_dX_p, PROTEUS_LAPACK_INTEGER ***subdomain_pivots_p, PROTEUS_LAPACK_INTEGER ***subdomain_col_pivots_p)
Definition: smoothers.c:391
asm_NR_init
int asm_NR_init(SuperMatrix *A, int **subdomain_dim_p, int ***l2g_L_p, double ***subdomain_L_p, double ***subdomain_R_p, double ***subdomain_dX_p, PROTEUS_LAPACK_INTEGER ***subdomain_pivots_p)
Definition: smoothers.c:189
v
Double v
Definition: Headers.h:95
T
Double T
Definition: Headers.h:87
z
Double * z
Definition: Headers.h:49
u
Double u
Definition: Headers.h:89
ns
Int ns
Definition: Headers.h:30
c
Double c
Definition: Headers.h:54
asm_NR_solve
void asm_NR_solve(SuperMatrix *A, double w, double **subdomainL, int *subdomain_dim, int **l2g_L, double *R, double **subdomainR, int *node_order, double **subdomain_dX, double *dX, PROTEUS_LAPACK_INTEGER **subdomainPivots)
Definition: smoothers.c:324
basm_NR_free
void basm_NR_free(int N, int *subdomain_dim, int **l2g_L, double **subdomain_L, double **subdomain_R, double **subdomain_dX, PROTEUS_LAPACK_INTEGER **subdomain_pivots, PROTEUS_LAPACK_INTEGER **subdomain_col_pivots)
Definition: smoothers.c:574
proteus_superlu.h
nl_gauss_seidel_NR_solve
void nl_gauss_seidel_NR_solve(SuperMatrix *A, double *R, int *node_order, double w, double tol, double *dX)
Definition: smoothers.c:142
nl_jacobi_NR_solve
void nl_jacobi_NR_solve(SuperMatrix *A, double *R, int *node_order, double w, double tol, double *dX)
Definition: smoothers.c:26
r
Double r
Definition: Headers.h:83
pos
double pos(double a)
Definition: testFMMandFSW.cpp:8
gauss_seidel_NR_solve
void gauss_seidel_NR_solve(SuperMatrix *A, double *M, double *R, int *node_order, double *dX)
Definition: smoothers.c:114
basm_NR_solve
void basm_NR_solve(int rowBlocks, int N, SuperMatrix *A, double w, double **subdomainL, int *subdomain_dim, int **l2g_L, double *R, double **subdomainR, int *node_order, double **subdomain_dX, double *dX, PROTEUS_LAPACK_INTEGER **subdomainPivots, PROTEUS_LAPACK_INTEGER **subdomainColPivots)
Definition: smoothers.c:668
nnz
#define nnz
Definition: Richards.h:9