proteus  1.8.1
C/C++/Fortran libraries
clapack.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__clapack
694 #define __PYX_HAVE_API__clapack
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_lapack.h"
707 #include "proteus_blas.h"
708 #ifdef _OPENMP
709 #include <omp.h>
710 #endif /* _OPENMP */
711 
712 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
713 #define CYTHON_WITHOUT_ASSERTIONS
714 #endif
715 
716 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
717  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
718 
719 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
720 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
721 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
722 #define __PYX_DEFAULT_STRING_ENCODING ""
723 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
724 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
725 #define __Pyx_uchar_cast(c) ((unsigned char)c)
726 #define __Pyx_long_cast(x) ((long)x)
727 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
728  (sizeof(type) < sizeof(Py_ssize_t)) ||\
729  (sizeof(type) > sizeof(Py_ssize_t) &&\
730  likely(v < (type)PY_SSIZE_T_MAX ||\
731  v == (type)PY_SSIZE_T_MAX) &&\
732  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
733  v == (type)PY_SSIZE_T_MIN))) ||\
734  (sizeof(type) == sizeof(Py_ssize_t) &&\
735  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
736  v == (type)PY_SSIZE_T_MAX))) )
737 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
738  return (size_t) i < (size_t) limit;
739 }
740 #if defined (__cplusplus) && __cplusplus >= 201103L
741  #include <cstdlib>
742  #define __Pyx_sst_abs(value) std::abs(value)
743 #elif SIZEOF_INT >= SIZEOF_SIZE_T
744  #define __Pyx_sst_abs(value) abs(value)
745 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
746  #define __Pyx_sst_abs(value) labs(value)
747 #elif defined (_MSC_VER)
748  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
749 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
750  #define __Pyx_sst_abs(value) llabs(value)
751 #elif defined (__GNUC__)
752  #define __Pyx_sst_abs(value) __builtin_llabs(value)
753 #else
754  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
755 #endif
756 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
757 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
758 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
759 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
760 #define __Pyx_PyBytes_FromString PyBytes_FromString
761 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
762 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
763 #if PY_MAJOR_VERSION < 3
764  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
765  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
766 #else
767  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
768  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
769 #endif
770 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
771 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
772 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
773 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
774 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
775 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
776 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
777 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
778 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
779 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
780 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
781 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
782 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
783 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
784 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
785 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
786 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
787  const Py_UNICODE *u_end = u;
788  while (*u_end++) ;
789  return (size_t)(u_end - u - 1);
790 }
791 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
792 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
793 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
794 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
795 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
796 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
797 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
798 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
799 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
800 #define __Pyx_PySequence_Tuple(obj)\
801  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
802 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
803 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
804 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
805 #if CYTHON_ASSUME_SAFE_MACROS
806 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
807 #else
808 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
809 #endif
810 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
811 #if PY_MAJOR_VERSION >= 3
812 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
813 #else
814 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
815 #endif
816 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
817 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
818 static int __Pyx_sys_getdefaultencoding_not_ascii;
819 static int __Pyx_init_sys_getdefaultencoding_params(void) {
820  PyObject* sys;
821  PyObject* default_encoding = NULL;
822  PyObject* ascii_chars_u = NULL;
823  PyObject* ascii_chars_b = NULL;
824  const char* default_encoding_c;
825  sys = PyImport_ImportModule("sys");
826  if (!sys) goto bad;
827  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
828  Py_DECREF(sys);
829  if (!default_encoding) goto bad;
830  default_encoding_c = PyBytes_AsString(default_encoding);
831  if (!default_encoding_c) goto bad;
832  if (strcmp(default_encoding_c, "ascii") == 0) {
833  __Pyx_sys_getdefaultencoding_not_ascii = 0;
834  } else {
835  char ascii_chars[128];
836  int c;
837  for (c = 0; c < 128; c++) {
838  ascii_chars[c] = c;
839  }
840  __Pyx_sys_getdefaultencoding_not_ascii = 1;
841  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
842  if (!ascii_chars_u) goto bad;
843  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
844  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
845  PyErr_Format(
846  PyExc_ValueError,
847  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
848  default_encoding_c);
849  goto bad;
850  }
851  Py_DECREF(ascii_chars_u);
852  Py_DECREF(ascii_chars_b);
853  }
854  Py_DECREF(default_encoding);
855  return 0;
856 bad:
857  Py_XDECREF(default_encoding);
858  Py_XDECREF(ascii_chars_u);
859  Py_XDECREF(ascii_chars_b);
860  return -1;
861 }
862 #endif
863 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
864 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
865 #else
866 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
867 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
868 static char* __PYX_DEFAULT_STRING_ENCODING;
869 static int __Pyx_init_sys_getdefaultencoding_params(void) {
870  PyObject* sys;
871  PyObject* default_encoding = NULL;
872  char* default_encoding_c;
873  sys = PyImport_ImportModule("sys");
874  if (!sys) goto bad;
875  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
876  Py_DECREF(sys);
877  if (!default_encoding) goto bad;
878  default_encoding_c = PyBytes_AsString(default_encoding);
879  if (!default_encoding_c) goto bad;
880  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
881  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
882  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
883  Py_DECREF(default_encoding);
884  return 0;
885 bad:
886  Py_XDECREF(default_encoding);
887  return -1;
888 }
889 #endif
890 #endif
891 
892 
893 /* Test for GCC > 2.95 */
894 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
895  #define likely(x) __builtin_expect(!!(x), 1)
896  #define unlikely(x) __builtin_expect(!!(x), 0)
897 #else /* !__GNUC__ or GCC < 2.95 */
898  #define likely(x) (x)
899  #define unlikely(x) (x)
900 #endif /* __GNUC__ */
901 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
902 
903 static PyObject *__pyx_m = NULL;
904 static PyObject *__pyx_d;
905 static PyObject *__pyx_b;
906 static PyObject *__pyx_cython_runtime = NULL;
907 static PyObject *__pyx_empty_tuple;
908 static PyObject *__pyx_empty_bytes;
909 static PyObject *__pyx_empty_unicode;
910 static int __pyx_lineno;
911 static int __pyx_clineno = 0;
912 static const char * __pyx_cfilenm= __FILE__;
913 static const char *__pyx_filename;
914 
915 /* Header.proto */
916 #if !defined(CYTHON_CCOMPLEX)
917  #if defined(__cplusplus)
918  #define CYTHON_CCOMPLEX 1
919  #elif defined(_Complex_I)
920  #define CYTHON_CCOMPLEX 1
921  #else
922  #define CYTHON_CCOMPLEX 0
923  #endif
924 #endif
925 #if CYTHON_CCOMPLEX
926  #ifdef __cplusplus
927  #include <complex>
928  #else
929  #include <complex.h>
930  #endif
931 #endif
932 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
933  #undef _Complex_I
934  #define _Complex_I 1.0fj
935 #endif
936 
937 
938 static const char *__pyx_f[] = {
939  "proteus/clapack.pyx",
940  "__init__.pxd",
941  "type.pxd",
942 };
943 
944 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":690
945  * # in Cython to enable them only on the right systems.
946  *
947  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
948  * ctypedef npy_int16 int16_t
949  * ctypedef npy_int32 int32_t
950  */
951 typedef npy_int8 __pyx_t_5numpy_int8_t;
952 
953 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":691
954  *
955  * ctypedef npy_int8 int8_t
956  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
957  * ctypedef npy_int32 int32_t
958  * ctypedef npy_int64 int64_t
959  */
960 typedef npy_int16 __pyx_t_5numpy_int16_t;
961 
962 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":692
963  * ctypedef npy_int8 int8_t
964  * ctypedef npy_int16 int16_t
965  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
966  * ctypedef npy_int64 int64_t
967  * #ctypedef npy_int96 int96_t
968  */
969 typedef npy_int32 __pyx_t_5numpy_int32_t;
970 
971 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":693
972  * ctypedef npy_int16 int16_t
973  * ctypedef npy_int32 int32_t
974  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
975  * #ctypedef npy_int96 int96_t
976  * #ctypedef npy_int128 int128_t
977  */
978 typedef npy_int64 __pyx_t_5numpy_int64_t;
979 
980 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":697
981  * #ctypedef npy_int128 int128_t
982  *
983  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
984  * ctypedef npy_uint16 uint16_t
985  * ctypedef npy_uint32 uint32_t
986  */
987 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
988 
989 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":698
990  *
991  * ctypedef npy_uint8 uint8_t
992  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
993  * ctypedef npy_uint32 uint32_t
994  * ctypedef npy_uint64 uint64_t
995  */
996 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
997 
998 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":699
999  * ctypedef npy_uint8 uint8_t
1000  * ctypedef npy_uint16 uint16_t
1001  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1002  * ctypedef npy_uint64 uint64_t
1003  * #ctypedef npy_uint96 uint96_t
1004  */
1005 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1006 
1007 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":700
1008  * ctypedef npy_uint16 uint16_t
1009  * ctypedef npy_uint32 uint32_t
1010  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1011  * #ctypedef npy_uint96 uint96_t
1012  * #ctypedef npy_uint128 uint128_t
1013  */
1014 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1015 
1016 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":704
1017  * #ctypedef npy_uint128 uint128_t
1018  *
1019  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1020  * ctypedef npy_float64 float64_t
1021  * #ctypedef npy_float80 float80_t
1022  */
1023 typedef npy_float32 __pyx_t_5numpy_float32_t;
1024 
1025 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":705
1026  *
1027  * ctypedef npy_float32 float32_t
1028  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1029  * #ctypedef npy_float80 float80_t
1030  * #ctypedef npy_float128 float128_t
1031  */
1032 typedef npy_float64 __pyx_t_5numpy_float64_t;
1033 
1034 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":714
1035  * # The int types are mapped a bit surprising --
1036  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1037  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1038  * ctypedef npy_longlong long_t
1039  * ctypedef npy_longlong longlong_t
1040  */
1041 typedef npy_long __pyx_t_5numpy_int_t;
1042 
1043 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":715
1044  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1045  * ctypedef npy_long int_t
1046  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1047  * ctypedef npy_longlong longlong_t
1048  *
1049  */
1050 typedef npy_longlong __pyx_t_5numpy_long_t;
1051 
1052 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":716
1053  * ctypedef npy_long int_t
1054  * ctypedef npy_longlong long_t
1055  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1056  *
1057  * ctypedef npy_ulong uint_t
1058  */
1059 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1060 
1061 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":718
1062  * ctypedef npy_longlong longlong_t
1063  *
1064  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1065  * ctypedef npy_ulonglong ulong_t
1066  * ctypedef npy_ulonglong ulonglong_t
1067  */
1068 typedef npy_ulong __pyx_t_5numpy_uint_t;
1069 
1070 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":719
1071  *
1072  * ctypedef npy_ulong uint_t
1073  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1074  * ctypedef npy_ulonglong ulonglong_t
1075  *
1076  */
1077 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1078 
1079 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":720
1080  * ctypedef npy_ulong uint_t
1081  * ctypedef npy_ulonglong ulong_t
1082  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1083  *
1084  * ctypedef npy_intp intp_t
1085  */
1086 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1087 
1088 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":722
1089  * ctypedef npy_ulonglong ulonglong_t
1090  *
1091  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1092  * ctypedef npy_uintp uintp_t
1093  *
1094  */
1095 typedef npy_intp __pyx_t_5numpy_intp_t;
1096 
1097 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":723
1098  *
1099  * ctypedef npy_intp intp_t
1100  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1101  *
1102  * ctypedef npy_double float_t
1103  */
1104 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1105 
1106 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":725
1107  * ctypedef npy_uintp uintp_t
1108  *
1109  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1110  * ctypedef npy_double double_t
1111  * ctypedef npy_longdouble longdouble_t
1112  */
1113 typedef npy_double __pyx_t_5numpy_float_t;
1114 
1115 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":726
1116  *
1117  * ctypedef npy_double float_t
1118  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1119  * ctypedef npy_longdouble longdouble_t
1120  *
1121  */
1122 typedef npy_double __pyx_t_5numpy_double_t;
1123 
1124 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":727
1125  * ctypedef npy_double float_t
1126  * ctypedef npy_double double_t
1127  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1128  *
1129  * ctypedef npy_cfloat cfloat_t
1130  */
1131 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1132 /* Declarations.proto */
1133 #if CYTHON_CCOMPLEX
1134  #ifdef __cplusplus
1135  typedef ::std::complex< float > __pyx_t_float_complex;
1136  #else
1137  typedef float _Complex __pyx_t_float_complex;
1138  #endif
1139 #else
1140  typedef struct { float real, imag; } __pyx_t_float_complex;
1141 #endif
1142 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1143 
1144 /* Declarations.proto */
1145 #if CYTHON_CCOMPLEX
1146  #ifdef __cplusplus
1147  typedef ::std::complex< double > __pyx_t_double_complex;
1148  #else
1149  typedef double _Complex __pyx_t_double_complex;
1150  #endif
1151 #else
1152  typedef struct { double real, imag; } __pyx_t_double_complex;
1153 #endif
1154 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1155 
1156 
1157 /*--- Type declarations ---*/
1158 
1159 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":729
1160  * ctypedef npy_longdouble longdouble_t
1161  *
1162  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1163  * ctypedef npy_cdouble cdouble_t
1164  * ctypedef npy_clongdouble clongdouble_t
1165  */
1166 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1167 
1168 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":730
1169  *
1170  * ctypedef npy_cfloat cfloat_t
1171  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1172  * ctypedef npy_clongdouble clongdouble_t
1173  *
1174  */
1175 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1176 
1177 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":731
1178  * ctypedef npy_cfloat cfloat_t
1179  * ctypedef npy_cdouble cdouble_t
1180  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1181  *
1182  * ctypedef npy_cdouble complex_t
1183  */
1184 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1185 
1186 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":733
1187  * ctypedef npy_clongdouble clongdouble_t
1188  *
1189  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1190  *
1191  * cdef inline object PyArray_MultiIterNew1(a):
1192  */
1193 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1194 
1195 /* --- Runtime support code (head) --- */
1196 /* Refnanny.proto */
1197 #ifndef CYTHON_REFNANNY
1198  #define CYTHON_REFNANNY 0
1199 #endif
1200 #if CYTHON_REFNANNY
1201  typedef struct {
1202  void (*INCREF)(void*, PyObject*, int);
1203  void (*DECREF)(void*, PyObject*, int);
1204  void (*GOTREF)(void*, PyObject*, int);
1205  void (*GIVEREF)(void*, PyObject*, int);
1206  void* (*SetupContext)(const char*, int, const char*);
1207  void (*FinishContext)(void**);
1208  } __Pyx_RefNannyAPIStruct;
1209  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1210  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1211  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1212 #ifdef WITH_THREAD
1213  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1214  if (acquire_gil) {\
1215  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1216  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1217  PyGILState_Release(__pyx_gilstate_save);\
1218  } else {\
1219  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1220  }
1221 #else
1222  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1223  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1224 #endif
1225  #define __Pyx_RefNannyFinishContext()\
1226  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1227  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1228  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1229  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1230  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1231  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1232  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1233  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1234  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1235 #else
1236  #define __Pyx_RefNannyDeclarations
1237  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1238  #define __Pyx_RefNannyFinishContext()
1239  #define __Pyx_INCREF(r) Py_INCREF(r)
1240  #define __Pyx_DECREF(r) Py_DECREF(r)
1241  #define __Pyx_GOTREF(r)
1242  #define __Pyx_GIVEREF(r)
1243  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1244  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1245  #define __Pyx_XGOTREF(r)
1246  #define __Pyx_XGIVEREF(r)
1247 #endif
1248 #define __Pyx_XDECREF_SET(r, v) do {\
1249  PyObject *tmp = (PyObject *) r;\
1250  r = v; __Pyx_XDECREF(tmp);\
1251  } while (0)
1252 #define __Pyx_DECREF_SET(r, v) do {\
1253  PyObject *tmp = (PyObject *) r;\
1254  r = v; __Pyx_DECREF(tmp);\
1255  } while (0)
1256 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1257 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1258 
1259 /* RaiseArgTupleInvalid.proto */
1260 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1261  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1262 
1263 /* RaiseDoubleKeywords.proto */
1264 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1265 
1266 /* ParseKeywords.proto */
1267 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1268  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1269  const char* function_name);
1270 
1271 /* PyObjectSetAttrStr.proto */
1272 #if CYTHON_USE_TYPE_SLOTS
1273 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1274 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1275 #else
1276 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1277 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1278 #endif
1279 
1280 /* PyObjectGetAttrStr.proto */
1281 #if CYTHON_USE_TYPE_SLOTS
1282 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1283 #else
1284 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1285 #endif
1286 
1287 /* GetBuiltinName.proto */
1288 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1289 
1290 /* PyDictVersioning.proto */
1291 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1292 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1293 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1294 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1295  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1296  (cache_var) = (value);
1297 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1298  static PY_UINT64_T __pyx_dict_version = 0;\
1299  static PyObject *__pyx_dict_cached_value = NULL;\
1300  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1301  (VAR) = __pyx_dict_cached_value;\
1302  } else {\
1303  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1304  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1305  }\
1306 }
1307 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1308 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1309 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1310 #else
1311 #define __PYX_GET_DICT_VERSION(dict) (0)
1312 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1313 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1314 #endif
1315 
1316 /* GetModuleGlobalName.proto */
1317 #if CYTHON_USE_DICT_VERSIONS
1318 #define __Pyx_GetModuleGlobalName(var, name) {\
1319  static PY_UINT64_T __pyx_dict_version = 0;\
1320  static PyObject *__pyx_dict_cached_value = NULL;\
1321  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1322  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1323  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1324 }
1325 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1326  PY_UINT64_T __pyx_dict_version;\
1327  PyObject *__pyx_dict_cached_value;\
1328  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1329 }
1330 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1331 #else
1332 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1333 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1334 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1335 #endif
1336 
1337 /* PyObjectCall.proto */
1338 #if CYTHON_COMPILING_IN_CPYTHON
1339 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1340 #else
1341 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1342 #endif
1343 
1344 /* ExtTypeTest.proto */
1345 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1346 
1347 /* GetTopmostException.proto */
1348 #if CYTHON_USE_EXC_INFO_STACK
1349 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1350 #endif
1351 
1352 /* PyThreadStateGet.proto */
1353 #if CYTHON_FAST_THREAD_STATE
1354 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1355 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1356 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1357 #else
1358 #define __Pyx_PyThreadState_declare
1359 #define __Pyx_PyThreadState_assign
1360 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1361 #endif
1362 
1363 /* SaveResetException.proto */
1364 #if CYTHON_FAST_THREAD_STATE
1365 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1366 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1367 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1368 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1369 #else
1370 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1371 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1372 #endif
1373 
1374 /* PyErrExceptionMatches.proto */
1375 #if CYTHON_FAST_THREAD_STATE
1376 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1377 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1378 #else
1379 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1380 #endif
1381 
1382 /* GetException.proto */
1383 #if CYTHON_FAST_THREAD_STATE
1384 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1385 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1386 #else
1387 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1388 #endif
1389 
1390 /* PyErrFetchRestore.proto */
1391 #if CYTHON_FAST_THREAD_STATE
1392 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1393 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1394 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1395 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1396 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1397 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1398 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1399 #if CYTHON_COMPILING_IN_CPYTHON
1400 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1401 #else
1402 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1403 #endif
1404 #else
1405 #define __Pyx_PyErr_Clear() PyErr_Clear()
1406 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1407 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1408 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1409 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1410 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1411 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1412 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1413 #endif
1414 
1415 /* RaiseException.proto */
1416 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1417 
1418 /* TypeImport.proto */
1419 #ifndef __PYX_HAVE_RT_ImportType_proto
1420 #define __PYX_HAVE_RT_ImportType_proto
1421 enum __Pyx_ImportType_CheckSize {
1422  __Pyx_ImportType_CheckSize_Error = 0,
1423  __Pyx_ImportType_CheckSize_Warn = 1,
1424  __Pyx_ImportType_CheckSize_Ignore = 2
1425 };
1426 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1427 #endif
1428 
1429 /* Import.proto */
1430 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1431 
1432 /* FetchCommonType.proto */
1433 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1434 
1435 /* CythonFunctionShared.proto */
1436 #define __Pyx_CyFunction_USED 1
1437 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
1438 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
1439 #define __Pyx_CYFUNCTION_CCLASS 0x04
1440 #define __Pyx_CyFunction_GetClosure(f)\
1441  (((__pyx_CyFunctionObject *) (f))->func_closure)
1442 #define __Pyx_CyFunction_GetClassObj(f)\
1443  (((__pyx_CyFunctionObject *) (f))->func_classobj)
1444 #define __Pyx_CyFunction_Defaults(type, f)\
1445  ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
1446 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
1447  ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
1448 typedef struct {
1449  PyCFunctionObject func;
1450 #if PY_VERSION_HEX < 0x030500A0
1451  PyObject *func_weakreflist;
1452 #endif
1453  PyObject *func_dict;
1454  PyObject *func_name;
1455  PyObject *func_qualname;
1456  PyObject *func_doc;
1457  PyObject *func_globals;
1458  PyObject *func_code;
1459  PyObject *func_closure;
1460  PyObject *func_classobj;
1461  void *defaults;
1462  int defaults_pyobjects;
1463  size_t defaults_size; // used by FusedFunction for copying defaults
1464  int flags;
1465  PyObject *defaults_tuple;
1466  PyObject *defaults_kwdict;
1467  PyObject *(*defaults_getter)(PyObject *);
1468  PyObject *func_annotations;
1469 } __pyx_CyFunctionObject;
1470 static PyTypeObject *__pyx_CyFunctionType = 0;
1471 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
1472 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
1473  int flags, PyObject* qualname,
1474  PyObject *self,
1475  PyObject *module, PyObject *globals,
1476  PyObject* code);
1477 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
1478  size_t size,
1479  int pyobjects);
1480 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
1481  PyObject *tuple);
1482 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
1483  PyObject *dict);
1484 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
1485  PyObject *dict);
1486 static int __pyx_CyFunction_init(void);
1487 
1488 /* CythonFunction.proto */
1489 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
1490  int flags, PyObject* qualname,
1491  PyObject *closure,
1492  PyObject *module, PyObject *globals,
1493  PyObject* code);
1494 
1495 /* SetNameInClass.proto */
1496 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
1497 #define __Pyx_SetNameInClass(ns, name, value)\
1498  (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
1499 #elif CYTHON_COMPILING_IN_CPYTHON
1500 #define __Pyx_SetNameInClass(ns, name, value)\
1501  (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
1502 #else
1503 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
1504 #endif
1505 
1506 /* CalculateMetaclass.proto */
1507 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
1508 
1509 /* Py3ClassCreate.proto */
1510 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
1511  PyObject *mkw, PyObject *modname, PyObject *doc);
1512 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
1513  PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
1514 
1515 /* CLineInTraceback.proto */
1516 #ifdef CYTHON_CLINE_IN_TRACEBACK
1517 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1518 #else
1519 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1520 #endif
1521 
1522 /* CodeObjectCache.proto */
1523 typedef struct {
1524  PyCodeObject* code_object;
1525  int code_line;
1526 } __Pyx_CodeObjectCacheEntry;
1527 struct __Pyx_CodeObjectCache {
1528  int count;
1529  int max_count;
1530  __Pyx_CodeObjectCacheEntry* entries;
1531 };
1532 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1533 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1534 static PyCodeObject *__pyx_find_code_object(int code_line);
1535 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1536 
1537 /* AddTraceback.proto */
1538 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1539  int py_line, const char *filename);
1540 
1541 /* IntPow.proto */
1542 static CYTHON_INLINE long __Pyx_pow_long(long, long);
1543 
1544 /* GCCDiagnostics.proto */
1545 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
1546 #define __Pyx_HAS_GCC_DIAGNOSTIC
1547 #endif
1548 
1549 /* RealImag.proto */
1550 #if CYTHON_CCOMPLEX
1551  #ifdef __cplusplus
1552  #define __Pyx_CREAL(z) ((z).real())
1553  #define __Pyx_CIMAG(z) ((z).imag())
1554  #else
1555  #define __Pyx_CREAL(z) (__real__(z))
1556  #define __Pyx_CIMAG(z) (__imag__(z))
1557  #endif
1558 #else
1559  #define __Pyx_CREAL(z) ((z).real)
1560  #define __Pyx_CIMAG(z) ((z).imag)
1561 #endif
1562 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
1563  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
1564  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1565  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1566 #else
1567  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1568  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1569 #endif
1570 
1571 /* Arithmetic.proto */
1572 #if CYTHON_CCOMPLEX
1573  #define __Pyx_c_eq_float(a, b) ((a)==(b))
1574  #define __Pyx_c_sum_float(a, b) ((a)+(b))
1575  #define __Pyx_c_diff_float(a, b) ((a)-(b))
1576  #define __Pyx_c_prod_float(a, b) ((a)*(b))
1577  #define __Pyx_c_quot_float(a, b) ((a)/(b))
1578  #define __Pyx_c_neg_float(a) (-(a))
1579  #ifdef __cplusplus
1580  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
1581  #define __Pyx_c_conj_float(z) (::std::conj(z))
1582  #if 1
1583  #define __Pyx_c_abs_float(z) (::std::abs(z))
1584  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
1585  #endif
1586  #else
1587  #define __Pyx_c_is_zero_float(z) ((z)==0)
1588  #define __Pyx_c_conj_float(z) (conjf(z))
1589  #if 1
1590  #define __Pyx_c_abs_float(z) (cabsf(z))
1591  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
1592  #endif
1593  #endif
1594 #else
1595  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
1596  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
1597  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
1598  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
1599  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
1600  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
1601  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
1602  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
1603  #if 1
1604  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
1605  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
1606  #endif
1607 #endif
1608 
1609 /* Arithmetic.proto */
1610 #if CYTHON_CCOMPLEX
1611  #define __Pyx_c_eq_double(a, b) ((a)==(b))
1612  #define __Pyx_c_sum_double(a, b) ((a)+(b))
1613  #define __Pyx_c_diff_double(a, b) ((a)-(b))
1614  #define __Pyx_c_prod_double(a, b) ((a)*(b))
1615  #define __Pyx_c_quot_double(a, b) ((a)/(b))
1616  #define __Pyx_c_neg_double(a) (-(a))
1617  #ifdef __cplusplus
1618  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
1619  #define __Pyx_c_conj_double(z) (::std::conj(z))
1620  #if 1
1621  #define __Pyx_c_abs_double(z) (::std::abs(z))
1622  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
1623  #endif
1624  #else
1625  #define __Pyx_c_is_zero_double(z) ((z)==0)
1626  #define __Pyx_c_conj_double(z) (conj(z))
1627  #if 1
1628  #define __Pyx_c_abs_double(z) (cabs(z))
1629  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
1630  #endif
1631  #endif
1632 #else
1633  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
1634  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
1635  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
1636  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
1637  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
1638  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
1639  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
1640  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
1641  #if 1
1642  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
1643  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
1644  #endif
1645 #endif
1646 
1647 /* CIntFromPy.proto */
1648 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1649 
1650 /* CIntToPy.proto */
1651 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1652 
1653 /* CIntFromPy.proto */
1654 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1655 
1656 /* FastTypeChecks.proto */
1657 #if CYTHON_COMPILING_IN_CPYTHON
1658 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1659 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1660 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1661 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1662 #else
1663 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1664 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1665 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1666 #endif
1667 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1668 
1669 /* CheckBinaryVersion.proto */
1670 static int __Pyx_check_binary_version(void);
1671 
1672 /* InitStrings.proto */
1673 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1674 
1675 
1676 /* Module declarations from 'cpython.buffer' */
1677 
1678 /* Module declarations from 'libc.string' */
1679 
1680 /* Module declarations from 'libc.stdio' */
1681 
1682 /* Module declarations from '__builtin__' */
1683 
1684 /* Module declarations from 'cpython.type' */
1685 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
1686 
1687 /* Module declarations from 'cpython' */
1688 
1689 /* Module declarations from 'cpython.object' */
1690 
1691 /* Module declarations from 'cpython.ref' */
1692 
1693 /* Module declarations from 'cpython.mem' */
1694 
1695 /* Module declarations from 'numpy' */
1696 
1697 /* Module declarations from 'numpy' */
1698 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
1699 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
1700 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
1701 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
1702 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
1703 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
1704 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
1705 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
1706 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
1707 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
1708 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
1709 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
1710 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
1711 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
1712 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
1713 
1714 /* Module declarations from 'clapack' */
1715 static PyObject *__pyx_f_7clapack_lapackWrappersDCopy(int, PyArrayObject *, PyArrayObject *); /*proto*/
1716 static PyObject *__pyx_f_7clapack_lapackWrappersDenseFactorPrepare(int, PyArrayObject *, PyArrayObject *); /*proto*/
1717 static PyObject *__pyx_f_7clapack_lapackWrappersDenseFactorSolve(int, PyArrayObject *, PyArrayObject *, PyArrayObject *); /*proto*/
1718 static PyObject *__pyx_f_7clapack_lapackWrappersDenseCalculateEigenvalues(char *, char *, int, PyArrayObject *, int, PyArrayObject *, PyArrayObject *, PyArrayObject *, int, PyArrayObject *, int, PyArrayObject *, int); /*proto*/
1719 #define __Pyx_MODULE_NAME "clapack"
1720 extern int __pyx_module_is_main_clapack;
1721 int __pyx_module_is_main_clapack = 0;
1722 
1723 /* Implementation of 'clapack' */
1724 static PyObject *__pyx_builtin_ImportError;
1725 static const char __pyx_k_b[] = "b";
1726 static const char __pyx_k_n[] = "n";
1727 static const char __pyx_k_lu[] = "lu";
1728 static const char __pyx_k_np[] = "np";
1729 static const char __pyx_k_doc[] = "__doc__";
1730 static const char __pyx_k_lda[] = "lda";
1731 static const char __pyx_k_mat[] = "mat";
1732 static const char __pyx_k_init[] = "__init__";
1733 static const char __pyx_k_ldvl[] = "ldvl";
1734 static const char __pyx_k_ldvr[] = "ldvr";
1735 static const char __pyx_k_leig[] = "leig";
1736 static const char __pyx_k_main[] = "__main__";
1737 static const char __pyx_k_name[] = "__name__";
1738 static const char __pyx_k_self[] = "self";
1739 static const char __pyx_k_test[] = "__test__";
1740 static const char __pyx_k_work[] = "work";
1741 static const char __pyx_k_DF_lu[] = "DF_lu";
1742 static const char __pyx_k_dtype[] = "dtype";
1743 static const char __pyx_k_int32[] = "int32";
1744 static const char __pyx_k_jobvl[] = "jobvl";
1745 static const char __pyx_k_jobvr[] = "jobvr";
1746 static const char __pyx_k_lwork[] = "lwork";
1747 static const char __pyx_k_numpy[] = "numpy";
1748 static const char __pyx_k_shape[] = "shape";
1749 static const char __pyx_k_zeros[] = "zeros";
1750 static const char __pyx_k_import[] = "__import__";
1751 static const char __pyx_k_module[] = "__module__";
1752 static const char __pyx_k_pivots[] = "pivots";
1753 static const char __pyx_k_clapack[] = "clapack";
1754 static const char __pyx_k_prepare[] = "__prepare__";
1755 static const char __pyx_k_blasCopy[] = "blasCopy";
1756 static const char __pyx_k_qualname[] = "__qualname__";
1757 static const char __pyx_k_DF_pivots[] = "DF_pivots";
1758 static const char __pyx_k_metaclass[] = "__metaclass__";
1759 static const char __pyx_k_DenseFactor[] = "DenseFactor";
1760 static const char __pyx_k_ImportError[] = "ImportError";
1761 static const char __pyx_k_denseFactor[] = "denseFactor";
1762 static const char __pyx_k_eigenvalues_i[] = "eigenvalues_i";
1763 static const char __pyx_k_eigenvalues_r[] = "eigenvalues_r";
1764 static const char __pyx_k_denseFactorSolve[] = "denseFactorSolve";
1765 static const char __pyx_k_leftEigenvectors[] = "leftEigenvectors";
1766 static const char __pyx_k_rightEigenvectors[] = "rightEigenvectors";
1767 static const char __pyx_k_DenseFactor___init[] = "DenseFactor.__init__";
1768 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
1769 static const char __pyx_k_denseFactorPrepare[] = "denseFactorPrepare";
1770 static const char __pyx_k_proteus_clapack_pyx[] = "proteus/clapack.pyx";
1771 static const char __pyx_k_denseCalculateEigenvalues[] = "denseCalculateEigenvalues";
1772 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
1773 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
1774 static PyObject *__pyx_n_s_DF_lu;
1775 static PyObject *__pyx_n_s_DF_pivots;
1776 static PyObject *__pyx_n_s_DenseFactor;
1777 static PyObject *__pyx_n_s_DenseFactor___init;
1778 static PyObject *__pyx_n_s_ImportError;
1779 static PyObject *__pyx_n_s_b;
1780 static PyObject *__pyx_n_s_blasCopy;
1781 static PyObject *__pyx_n_s_clapack;
1782 static PyObject *__pyx_n_s_cline_in_traceback;
1783 static PyObject *__pyx_n_s_denseCalculateEigenvalues;
1784 static PyObject *__pyx_n_s_denseFactor;
1785 static PyObject *__pyx_n_s_denseFactorPrepare;
1786 static PyObject *__pyx_n_s_denseFactorSolve;
1787 static PyObject *__pyx_n_s_doc;
1788 static PyObject *__pyx_n_s_dtype;
1789 static PyObject *__pyx_n_s_eigenvalues_i;
1790 static PyObject *__pyx_n_s_eigenvalues_r;
1791 static PyObject *__pyx_n_s_import;
1792 static PyObject *__pyx_n_s_init;
1793 static PyObject *__pyx_n_s_int32;
1794 static PyObject *__pyx_n_s_jobvl;
1795 static PyObject *__pyx_n_s_jobvr;
1796 static PyObject *__pyx_n_s_lda;
1797 static PyObject *__pyx_n_s_ldvl;
1798 static PyObject *__pyx_n_s_ldvr;
1799 static PyObject *__pyx_n_s_leftEigenvectors;
1800 static PyObject *__pyx_n_s_leig;
1801 static PyObject *__pyx_n_s_lu;
1802 static PyObject *__pyx_n_s_lwork;
1803 static PyObject *__pyx_n_s_main;
1804 static PyObject *__pyx_n_s_mat;
1805 static PyObject *__pyx_n_s_metaclass;
1806 static PyObject *__pyx_n_s_module;
1807 static PyObject *__pyx_n_s_n;
1808 static PyObject *__pyx_n_s_name;
1809 static PyObject *__pyx_n_s_np;
1810 static PyObject *__pyx_n_s_numpy;
1811 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
1812 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
1813 static PyObject *__pyx_n_s_pivots;
1814 static PyObject *__pyx_n_s_prepare;
1815 static PyObject *__pyx_kp_s_proteus_clapack_pyx;
1816 static PyObject *__pyx_n_s_qualname;
1817 static PyObject *__pyx_n_s_rightEigenvectors;
1818 static PyObject *__pyx_n_s_self;
1819 static PyObject *__pyx_n_s_shape;
1820 static PyObject *__pyx_n_s_test;
1821 static PyObject *__pyx_n_s_work;
1822 static PyObject *__pyx_n_s_zeros;
1823 static PyObject *__pyx_pf_7clapack_11DenseFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
1824 static PyObject *__pyx_pf_7clapack_blasCopy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n, PyObject *__pyx_v_mat, PyObject *__pyx_v_denseFactor); /* proto */
1825 static PyObject *__pyx_pf_7clapack_2denseFactorPrepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n, PyObject *__pyx_v_mat, PyObject *__pyx_v_denseFactor); /* proto */
1826 static PyObject *__pyx_pf_7clapack_4denseFactorSolve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n, CYTHON_UNUSED PyObject *__pyx_v_mat, PyObject *__pyx_v_denseFactor, PyObject *__pyx_v_b); /* proto */
1827 static PyObject *__pyx_pf_7clapack_6denseCalculateEigenvalues(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_jobvl, PyObject *__pyx_v_jobvr, PyObject *__pyx_v_n, PyObject *__pyx_v_leig, PyObject *__pyx_v_lda, PyObject *__pyx_v_eigenvalues_r, PyObject *__pyx_v_eigenvalues_i, PyObject *__pyx_v_leftEigenvectors, PyObject *__pyx_v_ldvl, PyObject *__pyx_v_rightEigenvectors, PyObject *__pyx_v_ldvr, PyObject *__pyx_v_work, PyObject *__pyx_v_lwork); /* proto */
1828 static PyObject *__pyx_tuple_;
1829 static PyObject *__pyx_tuple__2;
1830 static PyObject *__pyx_tuple__3;
1831 static PyObject *__pyx_tuple__5;
1832 static PyObject *__pyx_tuple__7;
1833 static PyObject *__pyx_tuple__9;
1834 static PyObject *__pyx_tuple__11;
1835 static PyObject *__pyx_codeobj__4;
1836 static PyObject *__pyx_codeobj__6;
1837 static PyObject *__pyx_codeobj__8;
1838 static PyObject *__pyx_codeobj__10;
1839 static PyObject *__pyx_codeobj__12;
1840 /* Late includes */
1841 
1842 /* "clapack.pyx":17
1843  *
1844  * class DenseFactor:
1845  * def __init__(self, n): # <<<<<<<<<<<<<<
1846  * self.n = n
1847  * self.lu = np.zeros(shape=(n,n), dtype=float)
1848  */
1849 
1850 /* Python wrapper */
1851 static PyObject *__pyx_pw_7clapack_11DenseFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1852 static PyMethodDef __pyx_mdef_7clapack_11DenseFactor_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7clapack_11DenseFactor_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
1853 static PyObject *__pyx_pw_7clapack_11DenseFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1854  PyObject *__pyx_v_self = 0;
1855  PyObject *__pyx_v_n = 0;
1856  int __pyx_lineno = 0;
1857  const char *__pyx_filename = NULL;
1858  int __pyx_clineno = 0;
1859  PyObject *__pyx_r = 0;
1860  __Pyx_RefNannyDeclarations
1861  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
1862  {
1863  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_n,0};
1864  PyObject* values[2] = {0,0};
1865  if (unlikely(__pyx_kwds)) {
1866  Py_ssize_t kw_args;
1867  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1868  switch (pos_args) {
1869  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1870  CYTHON_FALLTHROUGH;
1871  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1872  CYTHON_FALLTHROUGH;
1873  case 0: break;
1874  default: goto __pyx_L5_argtuple_error;
1875  }
1876  kw_args = PyDict_Size(__pyx_kwds);
1877  switch (pos_args) {
1878  case 0:
1879  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
1880  else goto __pyx_L5_argtuple_error;
1881  CYTHON_FALLTHROUGH;
1882  case 1:
1883  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
1884  else {
1885  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 17, __pyx_L3_error)
1886  }
1887  }
1888  if (unlikely(kw_args > 0)) {
1889  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 17, __pyx_L3_error)
1890  }
1891  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
1892  goto __pyx_L5_argtuple_error;
1893  } else {
1894  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1895  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1896  }
1897  __pyx_v_self = values[0];
1898  __pyx_v_n = values[1];
1899  }
1900  goto __pyx_L4_argument_unpacking_done;
1901  __pyx_L5_argtuple_error:;
1902  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 17, __pyx_L3_error)
1903  __pyx_L3_error:;
1904  __Pyx_AddTraceback("clapack.DenseFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1905  __Pyx_RefNannyFinishContext();
1906  return NULL;
1907  __pyx_L4_argument_unpacking_done:;
1908  __pyx_r = __pyx_pf_7clapack_11DenseFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_n);
1909 
1910  /* function exit code */
1911  __Pyx_RefNannyFinishContext();
1912  return __pyx_r;
1913 }
1914 
1915 static PyObject *__pyx_pf_7clapack_11DenseFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n) {
1916  PyObject *__pyx_r = NULL;
1917  __Pyx_RefNannyDeclarations
1918  PyObject *__pyx_t_1 = NULL;
1919  PyObject *__pyx_t_2 = NULL;
1920  PyObject *__pyx_t_3 = NULL;
1921  int __pyx_lineno = 0;
1922  const char *__pyx_filename = NULL;
1923  int __pyx_clineno = 0;
1924  __Pyx_RefNannySetupContext("__init__", 0);
1925 
1926  /* "clapack.pyx":18
1927  * class DenseFactor:
1928  * def __init__(self, n):
1929  * self.n = n # <<<<<<<<<<<<<<
1930  * self.lu = np.zeros(shape=(n,n), dtype=float)
1931  * self.pivots = np.zeros(shape=n, dtype='int32')
1932  */
1933  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_n, __pyx_v_n) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
1934 
1935  /* "clapack.pyx":19
1936  * def __init__(self, n):
1937  * self.n = n
1938  * self.lu = np.zeros(shape=(n,n), dtype=float) # <<<<<<<<<<<<<<
1939  * self.pivots = np.zeros(shape=n, dtype='int32')
1940  *
1941  */
1942  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
1943  __Pyx_GOTREF(__pyx_t_1);
1944  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
1945  __Pyx_GOTREF(__pyx_t_2);
1946  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1947  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
1948  __Pyx_GOTREF(__pyx_t_1);
1949  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L1_error)
1950  __Pyx_GOTREF(__pyx_t_3);
1951  __Pyx_INCREF(__pyx_v_n);
1952  __Pyx_GIVEREF(__pyx_v_n);
1953  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_n);
1954  __Pyx_INCREF(__pyx_v_n);
1955  __Pyx_GIVEREF(__pyx_v_n);
1956  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_n);
1957  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_3) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
1958  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1959  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
1960  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L1_error)
1961  __Pyx_GOTREF(__pyx_t_3);
1962  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1963  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1964  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lu, __pyx_t_3) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
1965  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1966 
1967  /* "clapack.pyx":20
1968  * self.n = n
1969  * self.lu = np.zeros(shape=(n,n), dtype=float)
1970  * self.pivots = np.zeros(shape=n, dtype='int32') # <<<<<<<<<<<<<<
1971  *
1972  * cdef lapackWrappersDCopy(int n,
1973  */
1974  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error)
1975  __Pyx_GOTREF(__pyx_t_3);
1976  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
1977  __Pyx_GOTREF(__pyx_t_1);
1978  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1979  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error)
1980  __Pyx_GOTREF(__pyx_t_3);
1981  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_shape, __pyx_v_n) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
1982  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_n_s_int32) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
1983  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
1984  __Pyx_GOTREF(__pyx_t_2);
1985  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1986  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1987  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_pivots, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
1988  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1989 
1990  /* "clapack.pyx":17
1991  *
1992  * class DenseFactor:
1993  * def __init__(self, n): # <<<<<<<<<<<<<<
1994  * self.n = n
1995  * self.lu = np.zeros(shape=(n,n), dtype=float)
1996  */
1997 
1998  /* function exit code */
1999  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2000  goto __pyx_L0;
2001  __pyx_L1_error:;
2002  __Pyx_XDECREF(__pyx_t_1);
2003  __Pyx_XDECREF(__pyx_t_2);
2004  __Pyx_XDECREF(__pyx_t_3);
2005  __Pyx_AddTraceback("clapack.DenseFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2006  __pyx_r = NULL;
2007  __pyx_L0:;
2008  __Pyx_XGIVEREF(__pyx_r);
2009  __Pyx_RefNannyFinishContext();
2010  return __pyx_r;
2011 }
2012 
2013 /* "clapack.pyx":22
2014  * self.pivots = np.zeros(shape=n, dtype='int32')
2015  *
2016  * cdef lapackWrappersDCopy(int n, # <<<<<<<<<<<<<<
2017  * np.ndarray mat,
2018  * np.ndarray lu):
2019  */
2020 
2021 static PyObject *__pyx_f_7clapack_lapackWrappersDCopy(int __pyx_v_n, PyArrayObject *__pyx_v_mat, PyArrayObject *__pyx_v_lu) {
2022  CYTHON_UNUSED int __pyx_v_dim;
2023  int __pyx_v_incr1;
2024  int __pyx_v_incr2;
2025  int __pyx_v_dim2;
2026  PyObject *__pyx_r = NULL;
2027  __Pyx_RefNannyDeclarations
2028  __Pyx_RefNannySetupContext("lapackWrappersDCopy", 0);
2029 
2030  /* "clapack.pyx":25
2031  * np.ndarray mat,
2032  * np.ndarray lu):
2033  * cdef int dim=n, incr1=1, incr2=1, dim2=n**2 # <<<<<<<<<<<<<<
2034  *
2035  * cdcopy_(&dim2,
2036  */
2037  __pyx_v_dim = __pyx_v_n;
2038  __pyx_v_incr1 = 1;
2039  __pyx_v_incr2 = 1;
2040  __pyx_v_dim2 = __Pyx_pow_long(((long)__pyx_v_n), 2);
2041 
2042  /* "clapack.pyx":27
2043  * cdef int dim=n, incr1=1, incr2=1, dim2=n**2
2044  *
2045  * cdcopy_(&dim2, # <<<<<<<<<<<<<<
2046  * <double *> mat.data,
2047  * &incr1,
2048  */
2049  dcopy_((&__pyx_v_dim2), ((double *)__pyx_v_mat->data), (&__pyx_v_incr1), ((double *)__pyx_v_lu->data), (&__pyx_v_incr2));
2050 
2051  /* "clapack.pyx":22
2052  * self.pivots = np.zeros(shape=n, dtype='int32')
2053  *
2054  * cdef lapackWrappersDCopy(int n, # <<<<<<<<<<<<<<
2055  * np.ndarray mat,
2056  * np.ndarray lu):
2057  */
2058 
2059  /* function exit code */
2060  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2061  __Pyx_XGIVEREF(__pyx_r);
2062  __Pyx_RefNannyFinishContext();
2063  return __pyx_r;
2064 }
2065 
2066 /* "clapack.pyx":33
2067  * &incr2)
2068  *
2069  * cdef lapackWrappersDenseFactorPrepare(int dim, # <<<<<<<<<<<<<<
2070  * np.ndarray lu,
2071  * np.ndarray pivot):
2072  */
2073 
2074 static PyObject *__pyx_f_7clapack_lapackWrappersDenseFactorPrepare(int __pyx_v_dim, PyArrayObject *__pyx_v_lu, PyArrayObject *__pyx_v_pivot) {
2075  int __pyx_v_info;
2076  int __pyx_v_N;
2077  PyObject *__pyx_r = NULL;
2078  __Pyx_RefNannyDeclarations
2079  __Pyx_RefNannySetupContext("lapackWrappersDenseFactorPrepare", 0);
2080 
2081  /* "clapack.pyx":36
2082  * np.ndarray lu,
2083  * np.ndarray pivot):
2084  * cdef int info=0, N=dim # <<<<<<<<<<<<<<
2085  * cdgetrf_(&N,
2086  * &N,
2087  */
2088  __pyx_v_info = 0;
2089  __pyx_v_N = __pyx_v_dim;
2090 
2091  /* "clapack.pyx":37
2092  * np.ndarray pivot):
2093  * cdef int info=0, N=dim
2094  * cdgetrf_(&N, # <<<<<<<<<<<<<<
2095  * &N,
2096  * <double*> lu.data,
2097  */
2098  (void)(dgetrf_((&__pyx_v_N), (&__pyx_v_N), ((double *)__pyx_v_lu->data), (&__pyx_v_N), ((int *)__pyx_v_pivot->data), (&__pyx_v_info)));
2099 
2100  /* "clapack.pyx":33
2101  * &incr2)
2102  *
2103  * cdef lapackWrappersDenseFactorPrepare(int dim, # <<<<<<<<<<<<<<
2104  * np.ndarray lu,
2105  * np.ndarray pivot):
2106  */
2107 
2108  /* function exit code */
2109  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2110  __Pyx_XGIVEREF(__pyx_r);
2111  __Pyx_RefNannyFinishContext();
2112  return __pyx_r;
2113 }
2114 
2115 /* "clapack.pyx":45
2116  * # # ARB - this int should be a PROTEUS_LAPACK_INTEGER, but the complier does not seem to be picking it up
2117  *
2118  * cdef lapackWrappersDenseFactorSolve(int dim, # <<<<<<<<<<<<<<
2119  * np.ndarray lu,
2120  * np.ndarray pivots,
2121  */
2122 
2123 static PyObject *__pyx_f_7clapack_lapackWrappersDenseFactorSolve(int __pyx_v_dim, PyArrayObject *__pyx_v_lu, PyArrayObject *__pyx_v_pivots, PyArrayObject *__pyx_v_b) {
2124  char __pyx_v_trans;
2125  int __pyx_v_N;
2126  int __pyx_v_info;
2127  int __pyx_v_nrhs;
2128  PyObject *__pyx_r = NULL;
2129  __Pyx_RefNannyDeclarations
2130  __Pyx_RefNannySetupContext("lapackWrappersDenseFactorSolve", 0);
2131 
2132  /* "clapack.pyx":49
2133  * np.ndarray pivots,
2134  * np.ndarray b):
2135  * cdef char trans ='T' # <<<<<<<<<<<<<<
2136  * # ARB Note - relative to how I would think about this, it seems this needs a transpose?!
2137  * cdef int N=dim, info=0, nrhs=1
2138  */
2139  __pyx_v_trans = 'T';
2140 
2141  /* "clapack.pyx":51
2142  * cdef char trans ='T'
2143  * # ARB Note - relative to how I would think about this, it seems this needs a transpose?!
2144  * cdef int N=dim, info=0, nrhs=1 # <<<<<<<<<<<<<<
2145  * cdgetrs_(&trans,
2146  * &N,
2147  */
2148  __pyx_v_N = __pyx_v_dim;
2149  __pyx_v_info = 0;
2150  __pyx_v_nrhs = 1;
2151 
2152  /* "clapack.pyx":52
2153  * # ARB Note - relative to how I would think about this, it seems this needs a transpose?!
2154  * cdef int N=dim, info=0, nrhs=1
2155  * cdgetrs_(&trans, # <<<<<<<<<<<<<<
2156  * &N,
2157  * &nrhs,
2158  */
2159  (void)(dgetrs_((&__pyx_v_trans), (&__pyx_v_N), (&__pyx_v_nrhs), ((double *)__pyx_v_lu->data), (&__pyx_v_N), ((int *)__pyx_v_pivots->data), ((double *)__pyx_v_b->data), (&__pyx_v_N), (&__pyx_v_info)));
2160 
2161  /* "clapack.pyx":45
2162  * # # ARB - this int should be a PROTEUS_LAPACK_INTEGER, but the complier does not seem to be picking it up
2163  *
2164  * cdef lapackWrappersDenseFactorSolve(int dim, # <<<<<<<<<<<<<<
2165  * np.ndarray lu,
2166  * np.ndarray pivots,
2167  */
2168 
2169  /* function exit code */
2170  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2171  __Pyx_XGIVEREF(__pyx_r);
2172  __Pyx_RefNannyFinishContext();
2173  return __pyx_r;
2174 }
2175 
2176 /* "clapack.pyx":62
2177  * &info)
2178  *
2179  * cdef lapackWrappersDenseCalculateEigenvalues(char* jobvl, # <<<<<<<<<<<<<<
2180  * char* jobvr,
2181  * int n,
2182  */
2183 
2184 static PyObject *__pyx_f_7clapack_lapackWrappersDenseCalculateEigenvalues(char *__pyx_v_jobvl, char *__pyx_v_jobvr, int __pyx_v_n, PyArrayObject *__pyx_v_A, int __pyx_v_lda, PyArrayObject *__pyx_v_wr, PyArrayObject *__pyx_v_wi, PyArrayObject *__pyx_v_vl, int __pyx_v_ldvl, PyArrayObject *__pyx_v_vr, int __pyx_v_ldvr, PyArrayObject *__pyx_v_work, int __pyx_v_nwork) {
2185  int __pyx_v_info;
2186  PyObject *__pyx_r = NULL;
2187  __Pyx_RefNannyDeclarations
2188  __Pyx_RefNannySetupContext("lapackWrappersDenseCalculateEigenvalues", 0);
2189 
2190  /* "clapack.pyx":75
2191  * np.ndarray work,
2192  * int nwork):
2193  * cdef int info = 0 # <<<<<<<<<<<<<<
2194  * cdgeev_(jobvl,
2195  * jobvr,
2196  */
2197  __pyx_v_info = 0;
2198 
2199  /* "clapack.pyx":76
2200  * int nwork):
2201  * cdef int info = 0
2202  * cdgeev_(jobvl, # <<<<<<<<<<<<<<
2203  * jobvr,
2204  * &n,
2205  */
2206  (void)(dgeev_(__pyx_v_jobvl, __pyx_v_jobvr, (&__pyx_v_n), ((double *)__pyx_v_A->data), (&__pyx_v_lda), ((double *)__pyx_v_wr->data), ((double *)__pyx_v_wi->data), ((double *)__pyx_v_vl->data), (&__pyx_v_ldvl), ((double *)__pyx_v_vr->data), (&__pyx_v_ldvr), ((double *)__pyx_v_work->data), (&__pyx_v_nwork), (&__pyx_v_info)));
2207 
2208  /* "clapack.pyx":62
2209  * &info)
2210  *
2211  * cdef lapackWrappersDenseCalculateEigenvalues(char* jobvl, # <<<<<<<<<<<<<<
2212  * char* jobvr,
2213  * int n,
2214  */
2215 
2216  /* function exit code */
2217  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2218  __Pyx_XGIVEREF(__pyx_r);
2219  __Pyx_RefNannyFinishContext();
2220  return __pyx_r;
2221 }
2222 
2223 /* "clapack.pyx":91
2224  * &info)
2225  *
2226  * def blasCopy(n, # <<<<<<<<<<<<<<
2227  * mat,
2228  * denseFactor):
2229  */
2230 
2231 /* Python wrapper */
2232 static PyObject *__pyx_pw_7clapack_1blasCopy(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2233 static PyMethodDef __pyx_mdef_7clapack_1blasCopy = {"blasCopy", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7clapack_1blasCopy, METH_VARARGS|METH_KEYWORDS, 0};
2234 static PyObject *__pyx_pw_7clapack_1blasCopy(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2235  PyObject *__pyx_v_n = 0;
2236  PyObject *__pyx_v_mat = 0;
2237  PyObject *__pyx_v_denseFactor = 0;
2238  int __pyx_lineno = 0;
2239  const char *__pyx_filename = NULL;
2240  int __pyx_clineno = 0;
2241  PyObject *__pyx_r = 0;
2242  __Pyx_RefNannyDeclarations
2243  __Pyx_RefNannySetupContext("blasCopy (wrapper)", 0);
2244  {
2245  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_mat,&__pyx_n_s_denseFactor,0};
2246  PyObject* values[3] = {0,0,0};
2247  if (unlikely(__pyx_kwds)) {
2248  Py_ssize_t kw_args;
2249  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2250  switch (pos_args) {
2251  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2252  CYTHON_FALLTHROUGH;
2253  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2254  CYTHON_FALLTHROUGH;
2255  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2256  CYTHON_FALLTHROUGH;
2257  case 0: break;
2258  default: goto __pyx_L5_argtuple_error;
2259  }
2260  kw_args = PyDict_Size(__pyx_kwds);
2261  switch (pos_args) {
2262  case 0:
2263  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
2264  else goto __pyx_L5_argtuple_error;
2265  CYTHON_FALLTHROUGH;
2266  case 1:
2267  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
2268  else {
2269  __Pyx_RaiseArgtupleInvalid("blasCopy", 1, 3, 3, 1); __PYX_ERR(0, 91, __pyx_L3_error)
2270  }
2271  CYTHON_FALLTHROUGH;
2272  case 2:
2273  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_denseFactor)) != 0)) kw_args--;
2274  else {
2275  __Pyx_RaiseArgtupleInvalid("blasCopy", 1, 3, 3, 2); __PYX_ERR(0, 91, __pyx_L3_error)
2276  }
2277  }
2278  if (unlikely(kw_args > 0)) {
2279  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "blasCopy") < 0)) __PYX_ERR(0, 91, __pyx_L3_error)
2280  }
2281  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
2282  goto __pyx_L5_argtuple_error;
2283  } else {
2284  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2285  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2286  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2287  }
2288  __pyx_v_n = values[0];
2289  __pyx_v_mat = values[1];
2290  __pyx_v_denseFactor = values[2];
2291  }
2292  goto __pyx_L4_argument_unpacking_done;
2293  __pyx_L5_argtuple_error:;
2294  __Pyx_RaiseArgtupleInvalid("blasCopy", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 91, __pyx_L3_error)
2295  __pyx_L3_error:;
2296  __Pyx_AddTraceback("clapack.blasCopy", __pyx_clineno, __pyx_lineno, __pyx_filename);
2297  __Pyx_RefNannyFinishContext();
2298  return NULL;
2299  __pyx_L4_argument_unpacking_done:;
2300  __pyx_r = __pyx_pf_7clapack_blasCopy(__pyx_self, __pyx_v_n, __pyx_v_mat, __pyx_v_denseFactor);
2301 
2302  /* function exit code */
2303  __Pyx_RefNannyFinishContext();
2304  return __pyx_r;
2305 }
2306 
2307 static PyObject *__pyx_pf_7clapack_blasCopy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n, PyObject *__pyx_v_mat, PyObject *__pyx_v_denseFactor) {
2308  PyObject *__pyx_v_DF_lu = NULL;
2309  PyObject *__pyx_r = NULL;
2310  __Pyx_RefNannyDeclarations
2311  PyObject *__pyx_t_1 = NULL;
2312  int __pyx_t_2;
2313  int __pyx_lineno = 0;
2314  const char *__pyx_filename = NULL;
2315  int __pyx_clineno = 0;
2316  __Pyx_RefNannySetupContext("blasCopy", 0);
2317 
2318  /* "clapack.pyx":94
2319  * mat,
2320  * denseFactor):
2321  * DF_lu = denseFactor.lu # <<<<<<<<<<<<<<
2322  *
2323  * lapackWrappersDCopy(n,
2324  */
2325  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_denseFactor, __pyx_n_s_lu); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
2326  __Pyx_GOTREF(__pyx_t_1);
2327  __pyx_v_DF_lu = __pyx_t_1;
2328  __pyx_t_1 = 0;
2329 
2330  /* "clapack.pyx":96
2331  * DF_lu = denseFactor.lu
2332  *
2333  * lapackWrappersDCopy(n, # <<<<<<<<<<<<<<
2334  * mat,
2335  * DF_lu)
2336  */
2337  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_n); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error)
2338 
2339  /* "clapack.pyx":97
2340  *
2341  * lapackWrappersDCopy(n,
2342  * mat, # <<<<<<<<<<<<<<
2343  * DF_lu)
2344  *
2345  */
2346  if (!(likely(((__pyx_v_mat) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_mat, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 97, __pyx_L1_error)
2347 
2348  /* "clapack.pyx":98
2349  * lapackWrappersDCopy(n,
2350  * mat,
2351  * DF_lu) # <<<<<<<<<<<<<<
2352  *
2353  * def denseFactorPrepare(n,
2354  */
2355  if (!(likely(((__pyx_v_DF_lu) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_DF_lu, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 98, __pyx_L1_error)
2356 
2357  /* "clapack.pyx":96
2358  * DF_lu = denseFactor.lu
2359  *
2360  * lapackWrappersDCopy(n, # <<<<<<<<<<<<<<
2361  * mat,
2362  * DF_lu)
2363  */
2364  __pyx_t_1 = __pyx_f_7clapack_lapackWrappersDCopy(__pyx_t_2, ((PyArrayObject *)__pyx_v_mat), ((PyArrayObject *)__pyx_v_DF_lu)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
2365  __Pyx_GOTREF(__pyx_t_1);
2366  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2367 
2368  /* "clapack.pyx":91
2369  * &info)
2370  *
2371  * def blasCopy(n, # <<<<<<<<<<<<<<
2372  * mat,
2373  * denseFactor):
2374  */
2375 
2376  /* function exit code */
2377  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2378  goto __pyx_L0;
2379  __pyx_L1_error:;
2380  __Pyx_XDECREF(__pyx_t_1);
2381  __Pyx_AddTraceback("clapack.blasCopy", __pyx_clineno, __pyx_lineno, __pyx_filename);
2382  __pyx_r = NULL;
2383  __pyx_L0:;
2384  __Pyx_XDECREF(__pyx_v_DF_lu);
2385  __Pyx_XGIVEREF(__pyx_r);
2386  __Pyx_RefNannyFinishContext();
2387  return __pyx_r;
2388 }
2389 
2390 /* "clapack.pyx":100
2391  * DF_lu)
2392  *
2393  * def denseFactorPrepare(n, # <<<<<<<<<<<<<<
2394  * mat,
2395  * denseFactor):
2396  */
2397 
2398 /* Python wrapper */
2399 static PyObject *__pyx_pw_7clapack_3denseFactorPrepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2400 static PyMethodDef __pyx_mdef_7clapack_3denseFactorPrepare = {"denseFactorPrepare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7clapack_3denseFactorPrepare, METH_VARARGS|METH_KEYWORDS, 0};
2401 static PyObject *__pyx_pw_7clapack_3denseFactorPrepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2402  PyObject *__pyx_v_n = 0;
2403  PyObject *__pyx_v_mat = 0;
2404  PyObject *__pyx_v_denseFactor = 0;
2405  int __pyx_lineno = 0;
2406  const char *__pyx_filename = NULL;
2407  int __pyx_clineno = 0;
2408  PyObject *__pyx_r = 0;
2409  __Pyx_RefNannyDeclarations
2410  __Pyx_RefNannySetupContext("denseFactorPrepare (wrapper)", 0);
2411  {
2412  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_mat,&__pyx_n_s_denseFactor,0};
2413  PyObject* values[3] = {0,0,0};
2414  if (unlikely(__pyx_kwds)) {
2415  Py_ssize_t kw_args;
2416  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2417  switch (pos_args) {
2418  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2419  CYTHON_FALLTHROUGH;
2420  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2421  CYTHON_FALLTHROUGH;
2422  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2423  CYTHON_FALLTHROUGH;
2424  case 0: break;
2425  default: goto __pyx_L5_argtuple_error;
2426  }
2427  kw_args = PyDict_Size(__pyx_kwds);
2428  switch (pos_args) {
2429  case 0:
2430  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
2431  else goto __pyx_L5_argtuple_error;
2432  CYTHON_FALLTHROUGH;
2433  case 1:
2434  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
2435  else {
2436  __Pyx_RaiseArgtupleInvalid("denseFactorPrepare", 1, 3, 3, 1); __PYX_ERR(0, 100, __pyx_L3_error)
2437  }
2438  CYTHON_FALLTHROUGH;
2439  case 2:
2440  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_denseFactor)) != 0)) kw_args--;
2441  else {
2442  __Pyx_RaiseArgtupleInvalid("denseFactorPrepare", 1, 3, 3, 2); __PYX_ERR(0, 100, __pyx_L3_error)
2443  }
2444  }
2445  if (unlikely(kw_args > 0)) {
2446  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "denseFactorPrepare") < 0)) __PYX_ERR(0, 100, __pyx_L3_error)
2447  }
2448  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
2449  goto __pyx_L5_argtuple_error;
2450  } else {
2451  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2452  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2453  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2454  }
2455  __pyx_v_n = values[0];
2456  __pyx_v_mat = values[1];
2457  __pyx_v_denseFactor = values[2];
2458  }
2459  goto __pyx_L4_argument_unpacking_done;
2460  __pyx_L5_argtuple_error:;
2461  __Pyx_RaiseArgtupleInvalid("denseFactorPrepare", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 100, __pyx_L3_error)
2462  __pyx_L3_error:;
2463  __Pyx_AddTraceback("clapack.denseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
2464  __Pyx_RefNannyFinishContext();
2465  return NULL;
2466  __pyx_L4_argument_unpacking_done:;
2467  __pyx_r = __pyx_pf_7clapack_2denseFactorPrepare(__pyx_self, __pyx_v_n, __pyx_v_mat, __pyx_v_denseFactor);
2468 
2469  /* function exit code */
2470  __Pyx_RefNannyFinishContext();
2471  return __pyx_r;
2472 }
2473 
2474 static PyObject *__pyx_pf_7clapack_2denseFactorPrepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n, PyObject *__pyx_v_mat, PyObject *__pyx_v_denseFactor) {
2475  PyObject *__pyx_v_DF_pivots = NULL;
2476  PyObject *__pyx_v_DF_lu = NULL;
2477  PyObject *__pyx_r = NULL;
2478  __Pyx_RefNannyDeclarations
2479  PyObject *__pyx_t_1 = NULL;
2480  int __pyx_t_2;
2481  int __pyx_lineno = 0;
2482  const char *__pyx_filename = NULL;
2483  int __pyx_clineno = 0;
2484  __Pyx_RefNannySetupContext("denseFactorPrepare", 0);
2485 
2486  /* "clapack.pyx":103
2487  * mat,
2488  * denseFactor):
2489  * DF_pivots = denseFactor.pivots # <<<<<<<<<<<<<<
2490  * DF_lu = denseFactor.lu
2491  *
2492  */
2493  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_denseFactor, __pyx_n_s_pivots); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
2494  __Pyx_GOTREF(__pyx_t_1);
2495  __pyx_v_DF_pivots = __pyx_t_1;
2496  __pyx_t_1 = 0;
2497 
2498  /* "clapack.pyx":104
2499  * denseFactor):
2500  * DF_pivots = denseFactor.pivots
2501  * DF_lu = denseFactor.lu # <<<<<<<<<<<<<<
2502  *
2503  * lapackWrappersDCopy(n,
2504  */
2505  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_denseFactor, __pyx_n_s_lu); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
2506  __Pyx_GOTREF(__pyx_t_1);
2507  __pyx_v_DF_lu = __pyx_t_1;
2508  __pyx_t_1 = 0;
2509 
2510  /* "clapack.pyx":106
2511  * DF_lu = denseFactor.lu
2512  *
2513  * lapackWrappersDCopy(n, # <<<<<<<<<<<<<<
2514  * mat,
2515  * DF_lu)
2516  */
2517  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_n); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L1_error)
2518 
2519  /* "clapack.pyx":107
2520  *
2521  * lapackWrappersDCopy(n,
2522  * mat, # <<<<<<<<<<<<<<
2523  * DF_lu)
2524  *
2525  */
2526  if (!(likely(((__pyx_v_mat) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_mat, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 107, __pyx_L1_error)
2527 
2528  /* "clapack.pyx":108
2529  * lapackWrappersDCopy(n,
2530  * mat,
2531  * DF_lu) # <<<<<<<<<<<<<<
2532  *
2533  * lapackWrappersDenseFactorPrepare(n,
2534  */
2535  if (!(likely(((__pyx_v_DF_lu) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_DF_lu, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 108, __pyx_L1_error)
2536 
2537  /* "clapack.pyx":106
2538  * DF_lu = denseFactor.lu
2539  *
2540  * lapackWrappersDCopy(n, # <<<<<<<<<<<<<<
2541  * mat,
2542  * DF_lu)
2543  */
2544  __pyx_t_1 = __pyx_f_7clapack_lapackWrappersDCopy(__pyx_t_2, ((PyArrayObject *)__pyx_v_mat), ((PyArrayObject *)__pyx_v_DF_lu)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error)
2545  __Pyx_GOTREF(__pyx_t_1);
2546  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2547 
2548  /* "clapack.pyx":110
2549  * DF_lu)
2550  *
2551  * lapackWrappersDenseFactorPrepare(n, # <<<<<<<<<<<<<<
2552  * DF_lu,
2553  * DF_pivots)
2554  */
2555  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_n); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L1_error)
2556 
2557  /* "clapack.pyx":111
2558  *
2559  * lapackWrappersDenseFactorPrepare(n,
2560  * DF_lu, # <<<<<<<<<<<<<<
2561  * DF_pivots)
2562  *
2563  */
2564  if (!(likely(((__pyx_v_DF_lu) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_DF_lu, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 111, __pyx_L1_error)
2565 
2566  /* "clapack.pyx":112
2567  * lapackWrappersDenseFactorPrepare(n,
2568  * DF_lu,
2569  * DF_pivots) # <<<<<<<<<<<<<<
2570  *
2571  * def denseFactorSolve(n,
2572  */
2573  if (!(likely(((__pyx_v_DF_pivots) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_DF_pivots, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 112, __pyx_L1_error)
2574 
2575  /* "clapack.pyx":110
2576  * DF_lu)
2577  *
2578  * lapackWrappersDenseFactorPrepare(n, # <<<<<<<<<<<<<<
2579  * DF_lu,
2580  * DF_pivots)
2581  */
2582  __pyx_t_1 = __pyx_f_7clapack_lapackWrappersDenseFactorPrepare(__pyx_t_2, ((PyArrayObject *)__pyx_v_DF_lu), ((PyArrayObject *)__pyx_v_DF_pivots)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error)
2583  __Pyx_GOTREF(__pyx_t_1);
2584  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2585 
2586  /* "clapack.pyx":100
2587  * DF_lu)
2588  *
2589  * def denseFactorPrepare(n, # <<<<<<<<<<<<<<
2590  * mat,
2591  * denseFactor):
2592  */
2593 
2594  /* function exit code */
2595  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2596  goto __pyx_L0;
2597  __pyx_L1_error:;
2598  __Pyx_XDECREF(__pyx_t_1);
2599  __Pyx_AddTraceback("clapack.denseFactorPrepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
2600  __pyx_r = NULL;
2601  __pyx_L0:;
2602  __Pyx_XDECREF(__pyx_v_DF_pivots);
2603  __Pyx_XDECREF(__pyx_v_DF_lu);
2604  __Pyx_XGIVEREF(__pyx_r);
2605  __Pyx_RefNannyFinishContext();
2606  return __pyx_r;
2607 }
2608 
2609 /* "clapack.pyx":114
2610  * DF_pivots)
2611  *
2612  * def denseFactorSolve(n, # <<<<<<<<<<<<<<
2613  * mat,
2614  * denseFactor,
2615  */
2616 
2617 /* Python wrapper */
2618 static PyObject *__pyx_pw_7clapack_5denseFactorSolve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2619 static PyMethodDef __pyx_mdef_7clapack_5denseFactorSolve = {"denseFactorSolve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7clapack_5denseFactorSolve, METH_VARARGS|METH_KEYWORDS, 0};
2620 static PyObject *__pyx_pw_7clapack_5denseFactorSolve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2621  PyObject *__pyx_v_n = 0;
2622  CYTHON_UNUSED PyObject *__pyx_v_mat = 0;
2623  PyObject *__pyx_v_denseFactor = 0;
2624  PyObject *__pyx_v_b = 0;
2625  int __pyx_lineno = 0;
2626  const char *__pyx_filename = NULL;
2627  int __pyx_clineno = 0;
2628  PyObject *__pyx_r = 0;
2629  __Pyx_RefNannyDeclarations
2630  __Pyx_RefNannySetupContext("denseFactorSolve (wrapper)", 0);
2631  {
2632  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_mat,&__pyx_n_s_denseFactor,&__pyx_n_s_b,0};
2633  PyObject* values[4] = {0,0,0,0};
2634  if (unlikely(__pyx_kwds)) {
2635  Py_ssize_t kw_args;
2636  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2637  switch (pos_args) {
2638  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2639  CYTHON_FALLTHROUGH;
2640  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2641  CYTHON_FALLTHROUGH;
2642  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2643  CYTHON_FALLTHROUGH;
2644  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2645  CYTHON_FALLTHROUGH;
2646  case 0: break;
2647  default: goto __pyx_L5_argtuple_error;
2648  }
2649  kw_args = PyDict_Size(__pyx_kwds);
2650  switch (pos_args) {
2651  case 0:
2652  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
2653  else goto __pyx_L5_argtuple_error;
2654  CYTHON_FALLTHROUGH;
2655  case 1:
2656  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mat)) != 0)) kw_args--;
2657  else {
2658  __Pyx_RaiseArgtupleInvalid("denseFactorSolve", 1, 4, 4, 1); __PYX_ERR(0, 114, __pyx_L3_error)
2659  }
2660  CYTHON_FALLTHROUGH;
2661  case 2:
2662  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_denseFactor)) != 0)) kw_args--;
2663  else {
2664  __Pyx_RaiseArgtupleInvalid("denseFactorSolve", 1, 4, 4, 2); __PYX_ERR(0, 114, __pyx_L3_error)
2665  }
2666  CYTHON_FALLTHROUGH;
2667  case 3:
2668  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
2669  else {
2670  __Pyx_RaiseArgtupleInvalid("denseFactorSolve", 1, 4, 4, 3); __PYX_ERR(0, 114, __pyx_L3_error)
2671  }
2672  }
2673  if (unlikely(kw_args > 0)) {
2674  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "denseFactorSolve") < 0)) __PYX_ERR(0, 114, __pyx_L3_error)
2675  }
2676  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
2677  goto __pyx_L5_argtuple_error;
2678  } else {
2679  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2680  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2681  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2682  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2683  }
2684  __pyx_v_n = values[0];
2685  __pyx_v_mat = values[1];
2686  __pyx_v_denseFactor = values[2];
2687  __pyx_v_b = values[3];
2688  }
2689  goto __pyx_L4_argument_unpacking_done;
2690  __pyx_L5_argtuple_error:;
2691  __Pyx_RaiseArgtupleInvalid("denseFactorSolve", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 114, __pyx_L3_error)
2692  __pyx_L3_error:;
2693  __Pyx_AddTraceback("clapack.denseFactorSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
2694  __Pyx_RefNannyFinishContext();
2695  return NULL;
2696  __pyx_L4_argument_unpacking_done:;
2697  __pyx_r = __pyx_pf_7clapack_4denseFactorSolve(__pyx_self, __pyx_v_n, __pyx_v_mat, __pyx_v_denseFactor, __pyx_v_b);
2698 
2699  /* function exit code */
2700  __Pyx_RefNannyFinishContext();
2701  return __pyx_r;
2702 }
2703 
2704 static PyObject *__pyx_pf_7clapack_4denseFactorSolve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_n, CYTHON_UNUSED PyObject *__pyx_v_mat, PyObject *__pyx_v_denseFactor, PyObject *__pyx_v_b) {
2705  PyObject *__pyx_v_DF_pivots = NULL;
2706  PyObject *__pyx_v_DF_lu = NULL;
2707  PyObject *__pyx_r = NULL;
2708  __Pyx_RefNannyDeclarations
2709  PyObject *__pyx_t_1 = NULL;
2710  int __pyx_t_2;
2711  int __pyx_lineno = 0;
2712  const char *__pyx_filename = NULL;
2713  int __pyx_clineno = 0;
2714  __Pyx_RefNannySetupContext("denseFactorSolve", 0);
2715 
2716  /* "clapack.pyx":118
2717  * denseFactor,
2718  * b):
2719  * DF_pivots = denseFactor.pivots # <<<<<<<<<<<<<<
2720  * DF_lu = denseFactor.lu
2721  *
2722  */
2723  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_denseFactor, __pyx_n_s_pivots); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
2724  __Pyx_GOTREF(__pyx_t_1);
2725  __pyx_v_DF_pivots = __pyx_t_1;
2726  __pyx_t_1 = 0;
2727 
2728  /* "clapack.pyx":119
2729  * b):
2730  * DF_pivots = denseFactor.pivots
2731  * DF_lu = denseFactor.lu # <<<<<<<<<<<<<<
2732  *
2733  * lapackWrappersDenseFactorSolve(n,
2734  */
2735  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_denseFactor, __pyx_n_s_lu); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
2736  __Pyx_GOTREF(__pyx_t_1);
2737  __pyx_v_DF_lu = __pyx_t_1;
2738  __pyx_t_1 = 0;
2739 
2740  /* "clapack.pyx":121
2741  * DF_lu = denseFactor.lu
2742  *
2743  * lapackWrappersDenseFactorSolve(n, # <<<<<<<<<<<<<<
2744  * DF_lu,
2745  * DF_pivots,
2746  */
2747  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_n); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L1_error)
2748 
2749  /* "clapack.pyx":122
2750  *
2751  * lapackWrappersDenseFactorSolve(n,
2752  * DF_lu, # <<<<<<<<<<<<<<
2753  * DF_pivots,
2754  * b)
2755  */
2756  if (!(likely(((__pyx_v_DF_lu) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_DF_lu, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 122, __pyx_L1_error)
2757 
2758  /* "clapack.pyx":123
2759  * lapackWrappersDenseFactorSolve(n,
2760  * DF_lu,
2761  * DF_pivots, # <<<<<<<<<<<<<<
2762  * b)
2763  *
2764  */
2765  if (!(likely(((__pyx_v_DF_pivots) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_DF_pivots, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 123, __pyx_L1_error)
2766 
2767  /* "clapack.pyx":124
2768  * DF_lu,
2769  * DF_pivots,
2770  * b) # <<<<<<<<<<<<<<
2771  *
2772  * def denseCalculateEigenvalues(jobvl,
2773  */
2774  if (!(likely(((__pyx_v_b) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_b, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 124, __pyx_L1_error)
2775 
2776  /* "clapack.pyx":121
2777  * DF_lu = denseFactor.lu
2778  *
2779  * lapackWrappersDenseFactorSolve(n, # <<<<<<<<<<<<<<
2780  * DF_lu,
2781  * DF_pivots,
2782  */
2783  __pyx_t_1 = __pyx_f_7clapack_lapackWrappersDenseFactorSolve(__pyx_t_2, ((PyArrayObject *)__pyx_v_DF_lu), ((PyArrayObject *)__pyx_v_DF_pivots), ((PyArrayObject *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
2784  __Pyx_GOTREF(__pyx_t_1);
2785  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2786 
2787  /* "clapack.pyx":114
2788  * DF_pivots)
2789  *
2790  * def denseFactorSolve(n, # <<<<<<<<<<<<<<
2791  * mat,
2792  * denseFactor,
2793  */
2794 
2795  /* function exit code */
2796  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2797  goto __pyx_L0;
2798  __pyx_L1_error:;
2799  __Pyx_XDECREF(__pyx_t_1);
2800  __Pyx_AddTraceback("clapack.denseFactorSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
2801  __pyx_r = NULL;
2802  __pyx_L0:;
2803  __Pyx_XDECREF(__pyx_v_DF_pivots);
2804  __Pyx_XDECREF(__pyx_v_DF_lu);
2805  __Pyx_XGIVEREF(__pyx_r);
2806  __Pyx_RefNannyFinishContext();
2807  return __pyx_r;
2808 }
2809 
2810 /* "clapack.pyx":126
2811  * b)
2812  *
2813  * def denseCalculateEigenvalues(jobvl, # <<<<<<<<<<<<<<
2814  * jobvr,
2815  * n,
2816  */
2817 
2818 /* Python wrapper */
2819 static PyObject *__pyx_pw_7clapack_7denseCalculateEigenvalues(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2820 static char __pyx_doc_7clapack_6denseCalculateEigenvalues[] = "\n Parameters\n ----------\n jobvl (input) : str\n 'N' indicates left eigenvectors are not computed\n 'V' indicates left eigenvectors are computed\n jobvr (input) : str\n 'N' indicates right eigenvectors are not computed\n 'V' indicates right eigenvectors are computed\n n (input) : int\n order of matrix A\n leig (input / output) : np array\n on entry matrix A, on exit overwritten\n lda (input) : int\n leading dimension of the array A\n eigenvalues_r (output) : array\n real part of computed eigenvalues\n eigenvalues_i (output) : array\n imaginary part of computed eigenvalues\n vl (output) : array\n storage container for left eigenvectors\n ldvl (input) : int\n leading dimension of the array vl\n vr (output) : array\n storage container for right eigenvectos\n ldvr (input) : int\n leading dimension of array vr\n work (workspace / output) : array\n lwork (input) : int\n ";
2821 static PyMethodDef __pyx_mdef_7clapack_7denseCalculateEigenvalues = {"denseCalculateEigenvalues", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7clapack_7denseCalculateEigenvalues, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7clapack_6denseCalculateEigenvalues};
2822 static PyObject *__pyx_pw_7clapack_7denseCalculateEigenvalues(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2823  PyObject *__pyx_v_jobvl = 0;
2824  PyObject *__pyx_v_jobvr = 0;
2825  PyObject *__pyx_v_n = 0;
2826  PyObject *__pyx_v_leig = 0;
2827  PyObject *__pyx_v_lda = 0;
2828  PyObject *__pyx_v_eigenvalues_r = 0;
2829  PyObject *__pyx_v_eigenvalues_i = 0;
2830  PyObject *__pyx_v_leftEigenvectors = 0;
2831  PyObject *__pyx_v_ldvl = 0;
2832  PyObject *__pyx_v_rightEigenvectors = 0;
2833  PyObject *__pyx_v_ldvr = 0;
2834  PyObject *__pyx_v_work = 0;
2835  PyObject *__pyx_v_lwork = 0;
2836  int __pyx_lineno = 0;
2837  const char *__pyx_filename = NULL;
2838  int __pyx_clineno = 0;
2839  PyObject *__pyx_r = 0;
2840  __Pyx_RefNannyDeclarations
2841  __Pyx_RefNannySetupContext("denseCalculateEigenvalues (wrapper)", 0);
2842  {
2843  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_jobvl,&__pyx_n_s_jobvr,&__pyx_n_s_n,&__pyx_n_s_leig,&__pyx_n_s_lda,&__pyx_n_s_eigenvalues_r,&__pyx_n_s_eigenvalues_i,&__pyx_n_s_leftEigenvectors,&__pyx_n_s_ldvl,&__pyx_n_s_rightEigenvectors,&__pyx_n_s_ldvr,&__pyx_n_s_work,&__pyx_n_s_lwork,0};
2844  PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
2845  if (unlikely(__pyx_kwds)) {
2846  Py_ssize_t kw_args;
2847  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2848  switch (pos_args) {
2849  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
2850  CYTHON_FALLTHROUGH;
2851  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
2852  CYTHON_FALLTHROUGH;
2853  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
2854  CYTHON_FALLTHROUGH;
2855  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
2856  CYTHON_FALLTHROUGH;
2857  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
2858  CYTHON_FALLTHROUGH;
2859  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
2860  CYTHON_FALLTHROUGH;
2861  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2862  CYTHON_FALLTHROUGH;
2863  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2864  CYTHON_FALLTHROUGH;
2865  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2866  CYTHON_FALLTHROUGH;
2867  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2868  CYTHON_FALLTHROUGH;
2869  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2870  CYTHON_FALLTHROUGH;
2871  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2872  CYTHON_FALLTHROUGH;
2873  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2874  CYTHON_FALLTHROUGH;
2875  case 0: break;
2876  default: goto __pyx_L5_argtuple_error;
2877  }
2878  kw_args = PyDict_Size(__pyx_kwds);
2879  switch (pos_args) {
2880  case 0:
2881  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_jobvl)) != 0)) kw_args--;
2882  else goto __pyx_L5_argtuple_error;
2883  CYTHON_FALLTHROUGH;
2884  case 1:
2885  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_jobvr)) != 0)) kw_args--;
2886  else {
2887  __Pyx_RaiseArgtupleInvalid("denseCalculateEigenvalues", 1, 13, 13, 1); __PYX_ERR(0, 126, __pyx_L3_error)
2888  }
2889  CYTHON_FALLTHROUGH;
2890  case 2:
2891  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
2892  else {
2893  __Pyx_RaiseArgtupleInvalid("denseCalculateEigenvalues", 1, 13, 13, 2); __PYX_ERR(0, 126, __pyx_L3_error)
2894  }
2895  CYTHON_FALLTHROUGH;
2896  case 3:
2897  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leig)) != 0)) kw_args--;
2898  else {
2899  __Pyx_RaiseArgtupleInvalid("denseCalculateEigenvalues", 1, 13, 13, 3); __PYX_ERR(0, 126, __pyx_L3_error)
2900  }
2901  CYTHON_FALLTHROUGH;
2902  case 4:
2903  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lda)) != 0)) kw_args--;
2904  else {
2905  __Pyx_RaiseArgtupleInvalid("denseCalculateEigenvalues", 1, 13, 13, 4); __PYX_ERR(0, 126, __pyx_L3_error)
2906  }
2907  CYTHON_FALLTHROUGH;
2908  case 5:
2909  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_eigenvalues_r)) != 0)) kw_args--;
2910  else {
2911  __Pyx_RaiseArgtupleInvalid("denseCalculateEigenvalues", 1, 13, 13, 5); __PYX_ERR(0, 126, __pyx_L3_error)
2912  }
2913  CYTHON_FALLTHROUGH;
2914  case 6:
2915  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_eigenvalues_i)) != 0)) kw_args--;
2916  else {
2917  __Pyx_RaiseArgtupleInvalid("denseCalculateEigenvalues", 1, 13, 13, 6); __PYX_ERR(0, 126, __pyx_L3_error)
2918  }
2919  CYTHON_FALLTHROUGH;
2920  case 7:
2921  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leftEigenvectors)) != 0)) kw_args--;
2922  else {
2923  __Pyx_RaiseArgtupleInvalid("denseCalculateEigenvalues", 1, 13, 13, 7); __PYX_ERR(0, 126, __pyx_L3_error)
2924  }
2925  CYTHON_FALLTHROUGH;
2926  case 8:
2927  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldvl)) != 0)) kw_args--;
2928  else {
2929  __Pyx_RaiseArgtupleInvalid("denseCalculateEigenvalues", 1, 13, 13, 8); __PYX_ERR(0, 126, __pyx_L3_error)
2930  }
2931  CYTHON_FALLTHROUGH;
2932  case 9:
2933  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rightEigenvectors)) != 0)) kw_args--;
2934  else {
2935  __Pyx_RaiseArgtupleInvalid("denseCalculateEigenvalues", 1, 13, 13, 9); __PYX_ERR(0, 126, __pyx_L3_error)
2936  }
2937  CYTHON_FALLTHROUGH;
2938  case 10:
2939  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ldvr)) != 0)) kw_args--;
2940  else {
2941  __Pyx_RaiseArgtupleInvalid("denseCalculateEigenvalues", 1, 13, 13, 10); __PYX_ERR(0, 126, __pyx_L3_error)
2942  }
2943  CYTHON_FALLTHROUGH;
2944  case 11:
2945  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_work)) != 0)) kw_args--;
2946  else {
2947  __Pyx_RaiseArgtupleInvalid("denseCalculateEigenvalues", 1, 13, 13, 11); __PYX_ERR(0, 126, __pyx_L3_error)
2948  }
2949  CYTHON_FALLTHROUGH;
2950  case 12:
2951  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lwork)) != 0)) kw_args--;
2952  else {
2953  __Pyx_RaiseArgtupleInvalid("denseCalculateEigenvalues", 1, 13, 13, 12); __PYX_ERR(0, 126, __pyx_L3_error)
2954  }
2955  }
2956  if (unlikely(kw_args > 0)) {
2957  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "denseCalculateEigenvalues") < 0)) __PYX_ERR(0, 126, __pyx_L3_error)
2958  }
2959  } else if (PyTuple_GET_SIZE(__pyx_args) != 13) {
2960  goto __pyx_L5_argtuple_error;
2961  } else {
2962  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2963  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2964  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2965  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2966  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2967  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2968  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2969  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
2970  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
2971  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
2972  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
2973  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
2974  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
2975  }
2976  __pyx_v_jobvl = values[0];
2977  __pyx_v_jobvr = values[1];
2978  __pyx_v_n = values[2];
2979  __pyx_v_leig = values[3];
2980  __pyx_v_lda = values[4];
2981  __pyx_v_eigenvalues_r = values[5];
2982  __pyx_v_eigenvalues_i = values[6];
2983  __pyx_v_leftEigenvectors = values[7];
2984  __pyx_v_ldvl = values[8];
2985  __pyx_v_rightEigenvectors = values[9];
2986  __pyx_v_ldvr = values[10];
2987  __pyx_v_work = values[11];
2988  __pyx_v_lwork = values[12];
2989  }
2990  goto __pyx_L4_argument_unpacking_done;
2991  __pyx_L5_argtuple_error:;
2992  __Pyx_RaiseArgtupleInvalid("denseCalculateEigenvalues", 1, 13, 13, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 126, __pyx_L3_error)
2993  __pyx_L3_error:;
2994  __Pyx_AddTraceback("clapack.denseCalculateEigenvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
2995  __Pyx_RefNannyFinishContext();
2996  return NULL;
2997  __pyx_L4_argument_unpacking_done:;
2998  __pyx_r = __pyx_pf_7clapack_6denseCalculateEigenvalues(__pyx_self, __pyx_v_jobvl, __pyx_v_jobvr, __pyx_v_n, __pyx_v_leig, __pyx_v_lda, __pyx_v_eigenvalues_r, __pyx_v_eigenvalues_i, __pyx_v_leftEigenvectors, __pyx_v_ldvl, __pyx_v_rightEigenvectors, __pyx_v_ldvr, __pyx_v_work, __pyx_v_lwork);
2999 
3000  /* function exit code */
3001  __Pyx_RefNannyFinishContext();
3002  return __pyx_r;
3003 }
3004 
3005 static PyObject *__pyx_pf_7clapack_6denseCalculateEigenvalues(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_jobvl, PyObject *__pyx_v_jobvr, PyObject *__pyx_v_n, PyObject *__pyx_v_leig, PyObject *__pyx_v_lda, PyObject *__pyx_v_eigenvalues_r, PyObject *__pyx_v_eigenvalues_i, PyObject *__pyx_v_leftEigenvectors, PyObject *__pyx_v_ldvl, PyObject *__pyx_v_rightEigenvectors, PyObject *__pyx_v_ldvr, PyObject *__pyx_v_work, PyObject *__pyx_v_lwork) {
3006  PyObject *__pyx_r = NULL;
3007  __Pyx_RefNannyDeclarations
3008  char *__pyx_t_1;
3009  char *__pyx_t_2;
3010  int __pyx_t_3;
3011  int __pyx_t_4;
3012  int __pyx_t_5;
3013  int __pyx_t_6;
3014  int __pyx_t_7;
3015  PyObject *__pyx_t_8 = NULL;
3016  int __pyx_lineno = 0;
3017  const char *__pyx_filename = NULL;
3018  int __pyx_clineno = 0;
3019  __Pyx_RefNannySetupContext("denseCalculateEigenvalues", 0);
3020 
3021  /* "clapack.pyx":170
3022  * """
3023  *
3024  * lapackWrappersDenseCalculateEigenvalues(jobvl, # <<<<<<<<<<<<<<
3025  * jobvr,
3026  * n,
3027  */
3028  __pyx_t_1 = __Pyx_PyObject_AsWritableString(__pyx_v_jobvl); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 170, __pyx_L1_error)
3029 
3030  /* "clapack.pyx":171
3031  *
3032  * lapackWrappersDenseCalculateEigenvalues(jobvl,
3033  * jobvr, # <<<<<<<<<<<<<<
3034  * n,
3035  * leig,
3036  */
3037  __pyx_t_2 = __Pyx_PyObject_AsWritableString(__pyx_v_jobvr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 171, __pyx_L1_error)
3038 
3039  /* "clapack.pyx":172
3040  * lapackWrappersDenseCalculateEigenvalues(jobvl,
3041  * jobvr,
3042  * n, # <<<<<<<<<<<<<<
3043  * leig,
3044  * lda,
3045  */
3046  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_n); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error)
3047 
3048  /* "clapack.pyx":173
3049  * jobvr,
3050  * n,
3051  * leig, # <<<<<<<<<<<<<<
3052  * lda,
3053  * eigenvalues_r,
3054  */
3055  if (!(likely(((__pyx_v_leig) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_leig, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 173, __pyx_L1_error)
3056 
3057  /* "clapack.pyx":174
3058  * n,
3059  * leig,
3060  * lda, # <<<<<<<<<<<<<<
3061  * eigenvalues_r,
3062  * eigenvalues_i,
3063  */
3064  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_lda); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 174, __pyx_L1_error)
3065 
3066  /* "clapack.pyx":175
3067  * leig,
3068  * lda,
3069  * eigenvalues_r, # <<<<<<<<<<<<<<
3070  * eigenvalues_i,
3071  * leftEigenvectors,
3072  */
3073  if (!(likely(((__pyx_v_eigenvalues_r) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eigenvalues_r, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 175, __pyx_L1_error)
3074 
3075  /* "clapack.pyx":176
3076  * lda,
3077  * eigenvalues_r,
3078  * eigenvalues_i, # <<<<<<<<<<<<<<
3079  * leftEigenvectors,
3080  * ldvl,
3081  */
3082  if (!(likely(((__pyx_v_eigenvalues_i) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eigenvalues_i, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 176, __pyx_L1_error)
3083 
3084  /* "clapack.pyx":177
3085  * eigenvalues_r,
3086  * eigenvalues_i,
3087  * leftEigenvectors, # <<<<<<<<<<<<<<
3088  * ldvl,
3089  * rightEigenvectors,
3090  */
3091  if (!(likely(((__pyx_v_leftEigenvectors) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_leftEigenvectors, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 177, __pyx_L1_error)
3092 
3093  /* "clapack.pyx":178
3094  * eigenvalues_i,
3095  * leftEigenvectors,
3096  * ldvl, # <<<<<<<<<<<<<<
3097  * rightEigenvectors,
3098  * ldvr,
3099  */
3100  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_ldvl); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L1_error)
3101 
3102  /* "clapack.pyx":179
3103  * leftEigenvectors,
3104  * ldvl,
3105  * rightEigenvectors, # <<<<<<<<<<<<<<
3106  * ldvr,
3107  * work,
3108  */
3109  if (!(likely(((__pyx_v_rightEigenvectors) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_rightEigenvectors, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 179, __pyx_L1_error)
3110 
3111  /* "clapack.pyx":180
3112  * ldvl,
3113  * rightEigenvectors,
3114  * ldvr, # <<<<<<<<<<<<<<
3115  * work,
3116  * lwork)
3117  */
3118  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_ldvr); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L1_error)
3119 
3120  /* "clapack.pyx":181
3121  * rightEigenvectors,
3122  * ldvr,
3123  * work, # <<<<<<<<<<<<<<
3124  * lwork)
3125  *
3126  */
3127  if (!(likely(((__pyx_v_work) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_work, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 181, __pyx_L1_error)
3128 
3129  /* "clapack.pyx":182
3130  * ldvr,
3131  * work,
3132  * lwork) # <<<<<<<<<<<<<<
3133  *
3134  */
3135  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_lwork); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L1_error)
3136 
3137  /* "clapack.pyx":170
3138  * """
3139  *
3140  * lapackWrappersDenseCalculateEigenvalues(jobvl, # <<<<<<<<<<<<<<
3141  * jobvr,
3142  * n,
3143  */
3144  __pyx_t_8 = __pyx_f_7clapack_lapackWrappersDenseCalculateEigenvalues(__pyx_t_1, __pyx_t_2, __pyx_t_3, ((PyArrayObject *)__pyx_v_leig), __pyx_t_4, ((PyArrayObject *)__pyx_v_eigenvalues_r), ((PyArrayObject *)__pyx_v_eigenvalues_i), ((PyArrayObject *)__pyx_v_leftEigenvectors), __pyx_t_5, ((PyArrayObject *)__pyx_v_rightEigenvectors), __pyx_t_6, ((PyArrayObject *)__pyx_v_work), __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 170, __pyx_L1_error)
3145  __Pyx_GOTREF(__pyx_t_8);
3146  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3147 
3148  /* "clapack.pyx":126
3149  * b)
3150  *
3151  * def denseCalculateEigenvalues(jobvl, # <<<<<<<<<<<<<<
3152  * jobvr,
3153  * n,
3154  */
3155 
3156  /* function exit code */
3157  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3158  goto __pyx_L0;
3159  __pyx_L1_error:;
3160  __Pyx_XDECREF(__pyx_t_8);
3161  __Pyx_AddTraceback("clapack.denseCalculateEigenvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
3162  __pyx_r = NULL;
3163  __pyx_L0:;
3164  __Pyx_XGIVEREF(__pyx_r);
3165  __Pyx_RefNannyFinishContext();
3166  return __pyx_r;
3167 }
3168 
3169 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":735
3170  * ctypedef npy_cdouble complex_t
3171  *
3172  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
3173  * return PyArray_MultiIterNew(1, <void*>a)
3174  *
3175  */
3176 
3177 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
3178  PyObject *__pyx_r = NULL;
3179  __Pyx_RefNannyDeclarations
3180  PyObject *__pyx_t_1 = NULL;
3181  int __pyx_lineno = 0;
3182  const char *__pyx_filename = NULL;
3183  int __pyx_clineno = 0;
3184  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
3185 
3186  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":736
3187  *
3188  * cdef inline object PyArray_MultiIterNew1(a):
3189  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
3190  *
3191  * cdef inline object PyArray_MultiIterNew2(a, b):
3192  */
3193  __Pyx_XDECREF(__pyx_r);
3194  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 736, __pyx_L1_error)
3195  __Pyx_GOTREF(__pyx_t_1);
3196  __pyx_r = __pyx_t_1;
3197  __pyx_t_1 = 0;
3198  goto __pyx_L0;
3199 
3200  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":735
3201  * ctypedef npy_cdouble complex_t
3202  *
3203  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
3204  * return PyArray_MultiIterNew(1, <void*>a)
3205  *
3206  */
3207 
3208  /* function exit code */
3209  __pyx_L1_error:;
3210  __Pyx_XDECREF(__pyx_t_1);
3211  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
3212  __pyx_r = 0;
3213  __pyx_L0:;
3214  __Pyx_XGIVEREF(__pyx_r);
3215  __Pyx_RefNannyFinishContext();
3216  return __pyx_r;
3217 }
3218 
3219 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":738
3220  * return PyArray_MultiIterNew(1, <void*>a)
3221  *
3222  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
3223  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
3224  *
3225  */
3226 
3227 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
3228  PyObject *__pyx_r = NULL;
3229  __Pyx_RefNannyDeclarations
3230  PyObject *__pyx_t_1 = NULL;
3231  int __pyx_lineno = 0;
3232  const char *__pyx_filename = NULL;
3233  int __pyx_clineno = 0;
3234  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
3235 
3236  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":739
3237  *
3238  * cdef inline object PyArray_MultiIterNew2(a, b):
3239  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
3240  *
3241  * cdef inline object PyArray_MultiIterNew3(a, b, c):
3242  */
3243  __Pyx_XDECREF(__pyx_r);
3244  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 739, __pyx_L1_error)
3245  __Pyx_GOTREF(__pyx_t_1);
3246  __pyx_r = __pyx_t_1;
3247  __pyx_t_1 = 0;
3248  goto __pyx_L0;
3249 
3250  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":738
3251  * return PyArray_MultiIterNew(1, <void*>a)
3252  *
3253  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
3254  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
3255  *
3256  */
3257 
3258  /* function exit code */
3259  __pyx_L1_error:;
3260  __Pyx_XDECREF(__pyx_t_1);
3261  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
3262  __pyx_r = 0;
3263  __pyx_L0:;
3264  __Pyx_XGIVEREF(__pyx_r);
3265  __Pyx_RefNannyFinishContext();
3266  return __pyx_r;
3267 }
3268 
3269 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":741
3270  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
3271  *
3272  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
3273  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
3274  *
3275  */
3276 
3277 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
3278  PyObject *__pyx_r = NULL;
3279  __Pyx_RefNannyDeclarations
3280  PyObject *__pyx_t_1 = NULL;
3281  int __pyx_lineno = 0;
3282  const char *__pyx_filename = NULL;
3283  int __pyx_clineno = 0;
3284  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
3285 
3286  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":742
3287  *
3288  * cdef inline object PyArray_MultiIterNew3(a, b, c):
3289  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
3290  *
3291  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
3292  */
3293  __Pyx_XDECREF(__pyx_r);
3294  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 742, __pyx_L1_error)
3295  __Pyx_GOTREF(__pyx_t_1);
3296  __pyx_r = __pyx_t_1;
3297  __pyx_t_1 = 0;
3298  goto __pyx_L0;
3299 
3300  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":741
3301  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
3302  *
3303  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
3304  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
3305  *
3306  */
3307 
3308  /* function exit code */
3309  __pyx_L1_error:;
3310  __Pyx_XDECREF(__pyx_t_1);
3311  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
3312  __pyx_r = 0;
3313  __pyx_L0:;
3314  __Pyx_XGIVEREF(__pyx_r);
3315  __Pyx_RefNannyFinishContext();
3316  return __pyx_r;
3317 }
3318 
3319 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":744
3320  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
3321  *
3322  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
3323  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
3324  *
3325  */
3326 
3327 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) {
3328  PyObject *__pyx_r = NULL;
3329  __Pyx_RefNannyDeclarations
3330  PyObject *__pyx_t_1 = NULL;
3331  int __pyx_lineno = 0;
3332  const char *__pyx_filename = NULL;
3333  int __pyx_clineno = 0;
3334  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
3335 
3336  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":745
3337  *
3338  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
3339  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
3340  *
3341  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
3342  */
3343  __Pyx_XDECREF(__pyx_r);
3344  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 745, __pyx_L1_error)
3345  __Pyx_GOTREF(__pyx_t_1);
3346  __pyx_r = __pyx_t_1;
3347  __pyx_t_1 = 0;
3348  goto __pyx_L0;
3349 
3350  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":744
3351  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
3352  *
3353  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
3354  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
3355  *
3356  */
3357 
3358  /* function exit code */
3359  __pyx_L1_error:;
3360  __Pyx_XDECREF(__pyx_t_1);
3361  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
3362  __pyx_r = 0;
3363  __pyx_L0:;
3364  __Pyx_XGIVEREF(__pyx_r);
3365  __Pyx_RefNannyFinishContext();
3366  return __pyx_r;
3367 }
3368 
3369 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":747
3370  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
3371  *
3372  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
3373  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
3374  *
3375  */
3376 
3377 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) {
3378  PyObject *__pyx_r = NULL;
3379  __Pyx_RefNannyDeclarations
3380  PyObject *__pyx_t_1 = NULL;
3381  int __pyx_lineno = 0;
3382  const char *__pyx_filename = NULL;
3383  int __pyx_clineno = 0;
3384  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
3385 
3386  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":748
3387  *
3388  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
3389  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
3390  *
3391  * cdef inline tuple PyDataType_SHAPE(dtype d):
3392  */
3393  __Pyx_XDECREF(__pyx_r);
3394  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 748, __pyx_L1_error)
3395  __Pyx_GOTREF(__pyx_t_1);
3396  __pyx_r = __pyx_t_1;
3397  __pyx_t_1 = 0;
3398  goto __pyx_L0;
3399 
3400  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":747
3401  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
3402  *
3403  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
3404  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
3405  *
3406  */
3407 
3408  /* function exit code */
3409  __pyx_L1_error:;
3410  __Pyx_XDECREF(__pyx_t_1);
3411  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
3412  __pyx_r = 0;
3413  __pyx_L0:;
3414  __Pyx_XGIVEREF(__pyx_r);
3415  __Pyx_RefNannyFinishContext();
3416  return __pyx_r;
3417 }
3418 
3419 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":750
3420  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
3421  *
3422  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
3423  * if PyDataType_HASSUBARRAY(d):
3424  * return <tuple>d.subarray.shape
3425  */
3426 
3427 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
3428  PyObject *__pyx_r = NULL;
3429  __Pyx_RefNannyDeclarations
3430  int __pyx_t_1;
3431  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
3432 
3433  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":751
3434  *
3435  * cdef inline tuple PyDataType_SHAPE(dtype d):
3436  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
3437  * return <tuple>d.subarray.shape
3438  * else:
3439  */
3440  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
3441  if (__pyx_t_1) {
3442 
3443  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":752
3444  * cdef inline tuple PyDataType_SHAPE(dtype d):
3445  * if PyDataType_HASSUBARRAY(d):
3446  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
3447  * else:
3448  * return ()
3449  */
3450  __Pyx_XDECREF(__pyx_r);
3451  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
3452  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
3453  goto __pyx_L0;
3454 
3455  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":751
3456  *
3457  * cdef inline tuple PyDataType_SHAPE(dtype d):
3458  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
3459  * return <tuple>d.subarray.shape
3460  * else:
3461  */
3462  }
3463 
3464  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":754
3465  * return <tuple>d.subarray.shape
3466  * else:
3467  * return () # <<<<<<<<<<<<<<
3468  *
3469  *
3470  */
3471  /*else*/ {
3472  __Pyx_XDECREF(__pyx_r);
3473  __Pyx_INCREF(__pyx_empty_tuple);
3474  __pyx_r = __pyx_empty_tuple;
3475  goto __pyx_L0;
3476  }
3477 
3478  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":750
3479  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
3480  *
3481  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
3482  * if PyDataType_HASSUBARRAY(d):
3483  * return <tuple>d.subarray.shape
3484  */
3485 
3486  /* function exit code */
3487  __pyx_L0:;
3488  __Pyx_XGIVEREF(__pyx_r);
3489  __Pyx_RefNannyFinishContext();
3490  return __pyx_r;
3491 }
3492 
3493 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":929
3494  * int _import_umath() except -1
3495  *
3496  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
3497  * Py_INCREF(base) # important to do this before stealing the reference below!
3498  * PyArray_SetBaseObject(arr, base)
3499  */
3500 
3501 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
3502  __Pyx_RefNannyDeclarations
3503  __Pyx_RefNannySetupContext("set_array_base", 0);
3504 
3505  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":930
3506  *
3507  * cdef inline void set_array_base(ndarray arr, object base):
3508  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
3509  * PyArray_SetBaseObject(arr, base)
3510  *
3511  */
3512  Py_INCREF(__pyx_v_base);
3513 
3514  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":931
3515  * cdef inline void set_array_base(ndarray arr, object base):
3516  * Py_INCREF(base) # important to do this before stealing the reference below!
3517  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
3518  *
3519  * cdef inline object get_array_base(ndarray arr):
3520  */
3521  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
3522 
3523  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":929
3524  * int _import_umath() except -1
3525  *
3526  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
3527  * Py_INCREF(base) # important to do this before stealing the reference below!
3528  * PyArray_SetBaseObject(arr, base)
3529  */
3530 
3531  /* function exit code */
3532  __Pyx_RefNannyFinishContext();
3533 }
3534 
3535 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":933
3536  * PyArray_SetBaseObject(arr, base)
3537  *
3538  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
3539  * base = PyArray_BASE(arr)
3540  * if base is NULL:
3541  */
3542 
3543 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
3544  PyObject *__pyx_v_base;
3545  PyObject *__pyx_r = NULL;
3546  __Pyx_RefNannyDeclarations
3547  int __pyx_t_1;
3548  __Pyx_RefNannySetupContext("get_array_base", 0);
3549 
3550  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":934
3551  *
3552  * cdef inline object get_array_base(ndarray arr):
3553  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
3554  * if base is NULL:
3555  * return None
3556  */
3557  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
3558 
3559  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":935
3560  * cdef inline object get_array_base(ndarray arr):
3561  * base = PyArray_BASE(arr)
3562  * if base is NULL: # <<<<<<<<<<<<<<
3563  * return None
3564  * return <object>base
3565  */
3566  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
3567  if (__pyx_t_1) {
3568 
3569  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":936
3570  * base = PyArray_BASE(arr)
3571  * if base is NULL:
3572  * return None # <<<<<<<<<<<<<<
3573  * return <object>base
3574  *
3575  */
3576  __Pyx_XDECREF(__pyx_r);
3577  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3578  goto __pyx_L0;
3579 
3580  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":935
3581  * cdef inline object get_array_base(ndarray arr):
3582  * base = PyArray_BASE(arr)
3583  * if base is NULL: # <<<<<<<<<<<<<<
3584  * return None
3585  * return <object>base
3586  */
3587  }
3588 
3589  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":937
3590  * if base is NULL:
3591  * return None
3592  * return <object>base # <<<<<<<<<<<<<<
3593  *
3594  * # Versions of the import_* functions which are more suitable for
3595  */
3596  __Pyx_XDECREF(__pyx_r);
3597  __Pyx_INCREF(((PyObject *)__pyx_v_base));
3598  __pyx_r = ((PyObject *)__pyx_v_base);
3599  goto __pyx_L0;
3600 
3601  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":933
3602  * PyArray_SetBaseObject(arr, base)
3603  *
3604  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
3605  * base = PyArray_BASE(arr)
3606  * if base is NULL:
3607  */
3608 
3609  /* function exit code */
3610  __pyx_L0:;
3611  __Pyx_XGIVEREF(__pyx_r);
3612  __Pyx_RefNannyFinishContext();
3613  return __pyx_r;
3614 }
3615 
3616 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":941
3617  * # Versions of the import_* functions which are more suitable for
3618  * # Cython code.
3619  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
3620  * try:
3621  * __pyx_import_array()
3622  */
3623 
3624 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
3625  int __pyx_r;
3626  __Pyx_RefNannyDeclarations
3627  PyObject *__pyx_t_1 = NULL;
3628  PyObject *__pyx_t_2 = NULL;
3629  PyObject *__pyx_t_3 = NULL;
3630  int __pyx_t_4;
3631  PyObject *__pyx_t_5 = NULL;
3632  PyObject *__pyx_t_6 = NULL;
3633  PyObject *__pyx_t_7 = NULL;
3634  PyObject *__pyx_t_8 = NULL;
3635  int __pyx_lineno = 0;
3636  const char *__pyx_filename = NULL;
3637  int __pyx_clineno = 0;
3638  __Pyx_RefNannySetupContext("import_array", 0);
3639 
3640  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
3641  * # Cython code.
3642  * cdef inline int import_array() except -1:
3643  * try: # <<<<<<<<<<<<<<
3644  * __pyx_import_array()
3645  * except Exception:
3646  */
3647  {
3648  __Pyx_PyThreadState_declare
3649  __Pyx_PyThreadState_assign
3650  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
3651  __Pyx_XGOTREF(__pyx_t_1);
3652  __Pyx_XGOTREF(__pyx_t_2);
3653  __Pyx_XGOTREF(__pyx_t_3);
3654  /*try:*/ {
3655 
3656  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":943
3657  * cdef inline int import_array() except -1:
3658  * try:
3659  * __pyx_import_array() # <<<<<<<<<<<<<<
3660  * except Exception:
3661  * raise ImportError("numpy.core.multiarray failed to import")
3662  */
3663  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 943, __pyx_L3_error)
3664 
3665  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
3666  * # Cython code.
3667  * cdef inline int import_array() except -1:
3668  * try: # <<<<<<<<<<<<<<
3669  * __pyx_import_array()
3670  * except Exception:
3671  */
3672  }
3673  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3674  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3675  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3676  goto __pyx_L8_try_end;
3677  __pyx_L3_error:;
3678 
3679  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":944
3680  * try:
3681  * __pyx_import_array()
3682  * except Exception: # <<<<<<<<<<<<<<
3683  * raise ImportError("numpy.core.multiarray failed to import")
3684  *
3685  */
3686  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
3687  if (__pyx_t_4) {
3688  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
3689  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 944, __pyx_L5_except_error)
3690  __Pyx_GOTREF(__pyx_t_5);
3691  __Pyx_GOTREF(__pyx_t_6);
3692  __Pyx_GOTREF(__pyx_t_7);
3693 
3694  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":945
3695  * __pyx_import_array()
3696  * except Exception:
3697  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
3698  *
3699  * cdef inline int import_umath() except -1:
3700  */
3701  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 945, __pyx_L5_except_error)
3702  __Pyx_GOTREF(__pyx_t_8);
3703  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
3704  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3705  __PYX_ERR(1, 945, __pyx_L5_except_error)
3706  }
3707  goto __pyx_L5_except_error;
3708  __pyx_L5_except_error:;
3709 
3710  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
3711  * # Cython code.
3712  * cdef inline int import_array() except -1:
3713  * try: # <<<<<<<<<<<<<<
3714  * __pyx_import_array()
3715  * except Exception:
3716  */
3717  __Pyx_XGIVEREF(__pyx_t_1);
3718  __Pyx_XGIVEREF(__pyx_t_2);
3719  __Pyx_XGIVEREF(__pyx_t_3);
3720  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
3721  goto __pyx_L1_error;
3722  __pyx_L8_try_end:;
3723  }
3724 
3725  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":941
3726  * # Versions of the import_* functions which are more suitable for
3727  * # Cython code.
3728  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
3729  * try:
3730  * __pyx_import_array()
3731  */
3732 
3733  /* function exit code */
3734  __pyx_r = 0;
3735  goto __pyx_L0;
3736  __pyx_L1_error:;
3737  __Pyx_XDECREF(__pyx_t_5);
3738  __Pyx_XDECREF(__pyx_t_6);
3739  __Pyx_XDECREF(__pyx_t_7);
3740  __Pyx_XDECREF(__pyx_t_8);
3741  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
3742  __pyx_r = -1;
3743  __pyx_L0:;
3744  __Pyx_RefNannyFinishContext();
3745  return __pyx_r;
3746 }
3747 
3748 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":947
3749  * raise ImportError("numpy.core.multiarray failed to import")
3750  *
3751  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
3752  * try:
3753  * _import_umath()
3754  */
3755 
3756 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
3757  int __pyx_r;
3758  __Pyx_RefNannyDeclarations
3759  PyObject *__pyx_t_1 = NULL;
3760  PyObject *__pyx_t_2 = NULL;
3761  PyObject *__pyx_t_3 = NULL;
3762  int __pyx_t_4;
3763  PyObject *__pyx_t_5 = NULL;
3764  PyObject *__pyx_t_6 = NULL;
3765  PyObject *__pyx_t_7 = NULL;
3766  PyObject *__pyx_t_8 = NULL;
3767  int __pyx_lineno = 0;
3768  const char *__pyx_filename = NULL;
3769  int __pyx_clineno = 0;
3770  __Pyx_RefNannySetupContext("import_umath", 0);
3771 
3772  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
3773  *
3774  * cdef inline int import_umath() except -1:
3775  * try: # <<<<<<<<<<<<<<
3776  * _import_umath()
3777  * except Exception:
3778  */
3779  {
3780  __Pyx_PyThreadState_declare
3781  __Pyx_PyThreadState_assign
3782  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
3783  __Pyx_XGOTREF(__pyx_t_1);
3784  __Pyx_XGOTREF(__pyx_t_2);
3785  __Pyx_XGOTREF(__pyx_t_3);
3786  /*try:*/ {
3787 
3788  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":949
3789  * cdef inline int import_umath() except -1:
3790  * try:
3791  * _import_umath() # <<<<<<<<<<<<<<
3792  * except Exception:
3793  * raise ImportError("numpy.core.umath failed to import")
3794  */
3795  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 949, __pyx_L3_error)
3796 
3797  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
3798  *
3799  * cdef inline int import_umath() except -1:
3800  * try: # <<<<<<<<<<<<<<
3801  * _import_umath()
3802  * except Exception:
3803  */
3804  }
3805  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3806  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3807  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3808  goto __pyx_L8_try_end;
3809  __pyx_L3_error:;
3810 
3811  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":950
3812  * try:
3813  * _import_umath()
3814  * except Exception: # <<<<<<<<<<<<<<
3815  * raise ImportError("numpy.core.umath failed to import")
3816  *
3817  */
3818  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
3819  if (__pyx_t_4) {
3820  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
3821  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 950, __pyx_L5_except_error)
3822  __Pyx_GOTREF(__pyx_t_5);
3823  __Pyx_GOTREF(__pyx_t_6);
3824  __Pyx_GOTREF(__pyx_t_7);
3825 
3826  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":951
3827  * _import_umath()
3828  * except Exception:
3829  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
3830  *
3831  * cdef inline int import_ufunc() except -1:
3832  */
3833  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 951, __pyx_L5_except_error)
3834  __Pyx_GOTREF(__pyx_t_8);
3835  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
3836  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3837  __PYX_ERR(1, 951, __pyx_L5_except_error)
3838  }
3839  goto __pyx_L5_except_error;
3840  __pyx_L5_except_error:;
3841 
3842  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
3843  *
3844  * cdef inline int import_umath() except -1:
3845  * try: # <<<<<<<<<<<<<<
3846  * _import_umath()
3847  * except Exception:
3848  */
3849  __Pyx_XGIVEREF(__pyx_t_1);
3850  __Pyx_XGIVEREF(__pyx_t_2);
3851  __Pyx_XGIVEREF(__pyx_t_3);
3852  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
3853  goto __pyx_L1_error;
3854  __pyx_L8_try_end:;
3855  }
3856 
3857  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":947
3858  * raise ImportError("numpy.core.multiarray failed to import")
3859  *
3860  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
3861  * try:
3862  * _import_umath()
3863  */
3864 
3865  /* function exit code */
3866  __pyx_r = 0;
3867  goto __pyx_L0;
3868  __pyx_L1_error:;
3869  __Pyx_XDECREF(__pyx_t_5);
3870  __Pyx_XDECREF(__pyx_t_6);
3871  __Pyx_XDECREF(__pyx_t_7);
3872  __Pyx_XDECREF(__pyx_t_8);
3873  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
3874  __pyx_r = -1;
3875  __pyx_L0:;
3876  __Pyx_RefNannyFinishContext();
3877  return __pyx_r;
3878 }
3879 
3880 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":953
3881  * raise ImportError("numpy.core.umath failed to import")
3882  *
3883  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
3884  * try:
3885  * _import_umath()
3886  */
3887 
3888 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
3889  int __pyx_r;
3890  __Pyx_RefNannyDeclarations
3891  PyObject *__pyx_t_1 = NULL;
3892  PyObject *__pyx_t_2 = NULL;
3893  PyObject *__pyx_t_3 = NULL;
3894  int __pyx_t_4;
3895  PyObject *__pyx_t_5 = NULL;
3896  PyObject *__pyx_t_6 = NULL;
3897  PyObject *__pyx_t_7 = NULL;
3898  PyObject *__pyx_t_8 = NULL;
3899  int __pyx_lineno = 0;
3900  const char *__pyx_filename = NULL;
3901  int __pyx_clineno = 0;
3902  __Pyx_RefNannySetupContext("import_ufunc", 0);
3903 
3904  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
3905  *
3906  * cdef inline int import_ufunc() except -1:
3907  * try: # <<<<<<<<<<<<<<
3908  * _import_umath()
3909  * except Exception:
3910  */
3911  {
3912  __Pyx_PyThreadState_declare
3913  __Pyx_PyThreadState_assign
3914  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
3915  __Pyx_XGOTREF(__pyx_t_1);
3916  __Pyx_XGOTREF(__pyx_t_2);
3917  __Pyx_XGOTREF(__pyx_t_3);
3918  /*try:*/ {
3919 
3920  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":955
3921  * cdef inline int import_ufunc() except -1:
3922  * try:
3923  * _import_umath() # <<<<<<<<<<<<<<
3924  * except Exception:
3925  * raise ImportError("numpy.core.umath failed to import")
3926  */
3927  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 955, __pyx_L3_error)
3928 
3929  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
3930  *
3931  * cdef inline int import_ufunc() except -1:
3932  * try: # <<<<<<<<<<<<<<
3933  * _import_umath()
3934  * except Exception:
3935  */
3936  }
3937  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3938  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3939  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3940  goto __pyx_L8_try_end;
3941  __pyx_L3_error:;
3942 
3943  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":956
3944  * try:
3945  * _import_umath()
3946  * except Exception: # <<<<<<<<<<<<<<
3947  * raise ImportError("numpy.core.umath failed to import")
3948  *
3949  */
3950  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
3951  if (__pyx_t_4) {
3952  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
3953  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 956, __pyx_L5_except_error)
3954  __Pyx_GOTREF(__pyx_t_5);
3955  __Pyx_GOTREF(__pyx_t_6);
3956  __Pyx_GOTREF(__pyx_t_7);
3957 
3958  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":957
3959  * _import_umath()
3960  * except Exception:
3961  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
3962  *
3963  * cdef extern from *:
3964  */
3965  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 957, __pyx_L5_except_error)
3966  __Pyx_GOTREF(__pyx_t_8);
3967  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
3968  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3969  __PYX_ERR(1, 957, __pyx_L5_except_error)
3970  }
3971  goto __pyx_L5_except_error;
3972  __pyx_L5_except_error:;
3973 
3974  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
3975  *
3976  * cdef inline int import_ufunc() except -1:
3977  * try: # <<<<<<<<<<<<<<
3978  * _import_umath()
3979  * except Exception:
3980  */
3981  __Pyx_XGIVEREF(__pyx_t_1);
3982  __Pyx_XGIVEREF(__pyx_t_2);
3983  __Pyx_XGIVEREF(__pyx_t_3);
3984  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
3985  goto __pyx_L1_error;
3986  __pyx_L8_try_end:;
3987  }
3988 
3989  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":953
3990  * raise ImportError("numpy.core.umath failed to import")
3991  *
3992  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
3993  * try:
3994  * _import_umath()
3995  */
3996 
3997  /* function exit code */
3998  __pyx_r = 0;
3999  goto __pyx_L0;
4000  __pyx_L1_error:;
4001  __Pyx_XDECREF(__pyx_t_5);
4002  __Pyx_XDECREF(__pyx_t_6);
4003  __Pyx_XDECREF(__pyx_t_7);
4004  __Pyx_XDECREF(__pyx_t_8);
4005  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
4006  __pyx_r = -1;
4007  __pyx_L0:;
4008  __Pyx_RefNannyFinishContext();
4009  return __pyx_r;
4010 }
4011 
4012 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":967
4013  *
4014  *
4015  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
4016  * """
4017  * Cython equivalent of `isinstance(obj, np.timedelta64)`
4018  */
4019 
4020 static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
4021  int __pyx_r;
4022  __Pyx_RefNannyDeclarations
4023  __Pyx_RefNannySetupContext("is_timedelta64_object", 0);
4024 
4025  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":979
4026  * bool
4027  * """
4028  * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
4029  *
4030  *
4031  */
4032  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
4033  goto __pyx_L0;
4034 
4035  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":967
4036  *
4037  *
4038  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
4039  * """
4040  * Cython equivalent of `isinstance(obj, np.timedelta64)`
4041  */
4042 
4043  /* function exit code */
4044  __pyx_L0:;
4045  __Pyx_RefNannyFinishContext();
4046  return __pyx_r;
4047 }
4048 
4049 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":982
4050  *
4051  *
4052  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
4053  * """
4054  * Cython equivalent of `isinstance(obj, np.datetime64)`
4055  */
4056 
4057 static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
4058  int __pyx_r;
4059  __Pyx_RefNannyDeclarations
4060  __Pyx_RefNannySetupContext("is_datetime64_object", 0);
4061 
4062  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":994
4063  * bool
4064  * """
4065  * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
4066  *
4067  *
4068  */
4069  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
4070  goto __pyx_L0;
4071 
4072  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":982
4073  *
4074  *
4075  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
4076  * """
4077  * Cython equivalent of `isinstance(obj, np.datetime64)`
4078  */
4079 
4080  /* function exit code */
4081  __pyx_L0:;
4082  __Pyx_RefNannyFinishContext();
4083  return __pyx_r;
4084 }
4085 
4086 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":997
4087  *
4088  *
4089  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
4090  * """
4091  * returns the int64 value underlying scalar numpy datetime64 object
4092  */
4093 
4094 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
4095  npy_datetime __pyx_r;
4096 
4097  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1004
4098  * also needed. That can be found using `get_datetime64_unit`.
4099  * """
4100  * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
4101  *
4102  *
4103  */
4104  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
4105  goto __pyx_L0;
4106 
4107  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":997
4108  *
4109  *
4110  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
4111  * """
4112  * returns the int64 value underlying scalar numpy datetime64 object
4113  */
4114 
4115  /* function exit code */
4116  __pyx_L0:;
4117  return __pyx_r;
4118 }
4119 
4120 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1007
4121  *
4122  *
4123  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
4124  * """
4125  * returns the int64 value underlying scalar numpy timedelta64 object
4126  */
4127 
4128 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
4129  npy_timedelta __pyx_r;
4130 
4131  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1011
4132  * returns the int64 value underlying scalar numpy timedelta64 object
4133  * """
4134  * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
4135  *
4136  *
4137  */
4138  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
4139  goto __pyx_L0;
4140 
4141  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1007
4142  *
4143  *
4144  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
4145  * """
4146  * returns the int64 value underlying scalar numpy timedelta64 object
4147  */
4148 
4149  /* function exit code */
4150  __pyx_L0:;
4151  return __pyx_r;
4152 }
4153 
4154 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
4155  *
4156  *
4157  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
4158  * """
4159  * returns the unit part of the dtype for a numpy datetime64 object.
4160  */
4161 
4162 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
4163  NPY_DATETIMEUNIT __pyx_r;
4164 
4165  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1018
4166  * returns the unit part of the dtype for a numpy datetime64 object.
4167  * """
4168  * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
4169  */
4170  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
4171  goto __pyx_L0;
4172 
4173  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
4174  *
4175  *
4176  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
4177  * """
4178  * returns the unit part of the dtype for a numpy datetime64 object.
4179  */
4180 
4181  /* function exit code */
4182  __pyx_L0:;
4183  return __pyx_r;
4184 }
4185 
4186 static PyMethodDef __pyx_methods[] = {
4187  {0, 0, 0, 0}
4188 };
4189 
4190 #if PY_MAJOR_VERSION >= 3
4191 #if CYTHON_PEP489_MULTI_PHASE_INIT
4192 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
4193 static int __pyx_pymod_exec_clapack(PyObject* module); /*proto*/
4194 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
4195  {Py_mod_create, (void*)__pyx_pymod_create},
4196  {Py_mod_exec, (void*)__pyx_pymod_exec_clapack},
4197  {0, NULL}
4198 };
4199 #endif
4200 
4201 static struct PyModuleDef __pyx_moduledef = {
4202  PyModuleDef_HEAD_INIT,
4203  "clapack",
4204  0, /* m_doc */
4205  #if CYTHON_PEP489_MULTI_PHASE_INIT
4206  0, /* m_size */
4207  #else
4208  -1, /* m_size */
4209  #endif
4210  __pyx_methods /* m_methods */,
4211  #if CYTHON_PEP489_MULTI_PHASE_INIT
4212  __pyx_moduledef_slots, /* m_slots */
4213  #else
4214  NULL, /* m_reload */
4215  #endif
4216  NULL, /* m_traverse */
4217  NULL, /* m_clear */
4218  NULL /* m_free */
4219 };
4220 #endif
4221 #ifndef CYTHON_SMALL_CODE
4222 #if defined(__clang__)
4223  #define CYTHON_SMALL_CODE
4224 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
4225  #define CYTHON_SMALL_CODE __attribute__((cold))
4226 #else
4227  #define CYTHON_SMALL_CODE
4228 #endif
4229 #endif
4230 
4231 static __Pyx_StringTabEntry __pyx_string_tab[] = {
4232  {&__pyx_n_s_DF_lu, __pyx_k_DF_lu, sizeof(__pyx_k_DF_lu), 0, 0, 1, 1},
4233  {&__pyx_n_s_DF_pivots, __pyx_k_DF_pivots, sizeof(__pyx_k_DF_pivots), 0, 0, 1, 1},
4234  {&__pyx_n_s_DenseFactor, __pyx_k_DenseFactor, sizeof(__pyx_k_DenseFactor), 0, 0, 1, 1},
4235  {&__pyx_n_s_DenseFactor___init, __pyx_k_DenseFactor___init, sizeof(__pyx_k_DenseFactor___init), 0, 0, 1, 1},
4236  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
4237  {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
4238  {&__pyx_n_s_blasCopy, __pyx_k_blasCopy, sizeof(__pyx_k_blasCopy), 0, 0, 1, 1},
4239  {&__pyx_n_s_clapack, __pyx_k_clapack, sizeof(__pyx_k_clapack), 0, 0, 1, 1},
4240  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
4241  {&__pyx_n_s_denseCalculateEigenvalues, __pyx_k_denseCalculateEigenvalues, sizeof(__pyx_k_denseCalculateEigenvalues), 0, 0, 1, 1},
4242  {&__pyx_n_s_denseFactor, __pyx_k_denseFactor, sizeof(__pyx_k_denseFactor), 0, 0, 1, 1},
4243  {&__pyx_n_s_denseFactorPrepare, __pyx_k_denseFactorPrepare, sizeof(__pyx_k_denseFactorPrepare), 0, 0, 1, 1},
4244  {&__pyx_n_s_denseFactorSolve, __pyx_k_denseFactorSolve, sizeof(__pyx_k_denseFactorSolve), 0, 0, 1, 1},
4245  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
4246  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
4247  {&__pyx_n_s_eigenvalues_i, __pyx_k_eigenvalues_i, sizeof(__pyx_k_eigenvalues_i), 0, 0, 1, 1},
4248  {&__pyx_n_s_eigenvalues_r, __pyx_k_eigenvalues_r, sizeof(__pyx_k_eigenvalues_r), 0, 0, 1, 1},
4249  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
4250  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
4251  {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
4252  {&__pyx_n_s_jobvl, __pyx_k_jobvl, sizeof(__pyx_k_jobvl), 0, 0, 1, 1},
4253  {&__pyx_n_s_jobvr, __pyx_k_jobvr, sizeof(__pyx_k_jobvr), 0, 0, 1, 1},
4254  {&__pyx_n_s_lda, __pyx_k_lda, sizeof(__pyx_k_lda), 0, 0, 1, 1},
4255  {&__pyx_n_s_ldvl, __pyx_k_ldvl, sizeof(__pyx_k_ldvl), 0, 0, 1, 1},
4256  {&__pyx_n_s_ldvr, __pyx_k_ldvr, sizeof(__pyx_k_ldvr), 0, 0, 1, 1},
4257  {&__pyx_n_s_leftEigenvectors, __pyx_k_leftEigenvectors, sizeof(__pyx_k_leftEigenvectors), 0, 0, 1, 1},
4258  {&__pyx_n_s_leig, __pyx_k_leig, sizeof(__pyx_k_leig), 0, 0, 1, 1},
4259  {&__pyx_n_s_lu, __pyx_k_lu, sizeof(__pyx_k_lu), 0, 0, 1, 1},
4260  {&__pyx_n_s_lwork, __pyx_k_lwork, sizeof(__pyx_k_lwork), 0, 0, 1, 1},
4261  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
4262  {&__pyx_n_s_mat, __pyx_k_mat, sizeof(__pyx_k_mat), 0, 0, 1, 1},
4263  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
4264  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
4265  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
4266  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
4267  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
4268  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
4269  {&__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},
4270  {&__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},
4271  {&__pyx_n_s_pivots, __pyx_k_pivots, sizeof(__pyx_k_pivots), 0, 0, 1, 1},
4272  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
4273  {&__pyx_kp_s_proteus_clapack_pyx, __pyx_k_proteus_clapack_pyx, sizeof(__pyx_k_proteus_clapack_pyx), 0, 0, 1, 0},
4274  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
4275  {&__pyx_n_s_rightEigenvectors, __pyx_k_rightEigenvectors, sizeof(__pyx_k_rightEigenvectors), 0, 0, 1, 1},
4276  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
4277  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
4278  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
4279  {&__pyx_n_s_work, __pyx_k_work, sizeof(__pyx_k_work), 0, 0, 1, 1},
4280  {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
4281  {0, 0, 0, 0, 0, 0, 0}
4282 };
4283 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
4284  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 945, __pyx_L1_error)
4285  return 0;
4286  __pyx_L1_error:;
4287  return -1;
4288 }
4289 
4290 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
4291  __Pyx_RefNannyDeclarations
4292  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
4293 
4294  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":945
4295  * __pyx_import_array()
4296  * except Exception:
4297  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
4298  *
4299  * cdef inline int import_umath() except -1:
4300  */
4301  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 945, __pyx_L1_error)
4302  __Pyx_GOTREF(__pyx_tuple_);
4303  __Pyx_GIVEREF(__pyx_tuple_);
4304 
4305  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":951
4306  * _import_umath()
4307  * except Exception:
4308  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
4309  *
4310  * cdef inline int import_ufunc() except -1:
4311  */
4312  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 951, __pyx_L1_error)
4313  __Pyx_GOTREF(__pyx_tuple__2);
4314  __Pyx_GIVEREF(__pyx_tuple__2);
4315 
4316  /* "clapack.pyx":17
4317  *
4318  * class DenseFactor:
4319  * def __init__(self, n): # <<<<<<<<<<<<<<
4320  * self.n = n
4321  * self.lu = np.zeros(shape=(n,n), dtype=float)
4322  */
4323  __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_n); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 17, __pyx_L1_error)
4324  __Pyx_GOTREF(__pyx_tuple__3);
4325  __Pyx_GIVEREF(__pyx_tuple__3);
4326  __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_clapack_pyx, __pyx_n_s_init, 17, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 17, __pyx_L1_error)
4327 
4328  /* "clapack.pyx":91
4329  * &info)
4330  *
4331  * def blasCopy(n, # <<<<<<<<<<<<<<
4332  * mat,
4333  * denseFactor):
4334  */
4335  __pyx_tuple__5 = PyTuple_Pack(4, __pyx_n_s_n, __pyx_n_s_mat, __pyx_n_s_denseFactor, __pyx_n_s_DF_lu); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 91, __pyx_L1_error)
4336  __Pyx_GOTREF(__pyx_tuple__5);
4337  __Pyx_GIVEREF(__pyx_tuple__5);
4338  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_clapack_pyx, __pyx_n_s_blasCopy, 91, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 91, __pyx_L1_error)
4339 
4340  /* "clapack.pyx":100
4341  * DF_lu)
4342  *
4343  * def denseFactorPrepare(n, # <<<<<<<<<<<<<<
4344  * mat,
4345  * denseFactor):
4346  */
4347  __pyx_tuple__7 = PyTuple_Pack(5, __pyx_n_s_n, __pyx_n_s_mat, __pyx_n_s_denseFactor, __pyx_n_s_DF_pivots, __pyx_n_s_DF_lu); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 100, __pyx_L1_error)
4348  __Pyx_GOTREF(__pyx_tuple__7);
4349  __Pyx_GIVEREF(__pyx_tuple__7);
4350  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_clapack_pyx, __pyx_n_s_denseFactorPrepare, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 100, __pyx_L1_error)
4351 
4352  /* "clapack.pyx":114
4353  * DF_pivots)
4354  *
4355  * def denseFactorSolve(n, # <<<<<<<<<<<<<<
4356  * mat,
4357  * denseFactor,
4358  */
4359  __pyx_tuple__9 = PyTuple_Pack(6, __pyx_n_s_n, __pyx_n_s_mat, __pyx_n_s_denseFactor, __pyx_n_s_b, __pyx_n_s_DF_pivots, __pyx_n_s_DF_lu); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 114, __pyx_L1_error)
4360  __Pyx_GOTREF(__pyx_tuple__9);
4361  __Pyx_GIVEREF(__pyx_tuple__9);
4362  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_clapack_pyx, __pyx_n_s_denseFactorSolve, 114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 114, __pyx_L1_error)
4363 
4364  /* "clapack.pyx":126
4365  * b)
4366  *
4367  * def denseCalculateEigenvalues(jobvl, # <<<<<<<<<<<<<<
4368  * jobvr,
4369  * n,
4370  */
4371  __pyx_tuple__11 = PyTuple_Pack(13, __pyx_n_s_jobvl, __pyx_n_s_jobvr, __pyx_n_s_n, __pyx_n_s_leig, __pyx_n_s_lda, __pyx_n_s_eigenvalues_r, __pyx_n_s_eigenvalues_i, __pyx_n_s_leftEigenvectors, __pyx_n_s_ldvl, __pyx_n_s_rightEigenvectors, __pyx_n_s_ldvr, __pyx_n_s_work, __pyx_n_s_lwork); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 126, __pyx_L1_error)
4372  __Pyx_GOTREF(__pyx_tuple__11);
4373  __Pyx_GIVEREF(__pyx_tuple__11);
4374  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(13, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_clapack_pyx, __pyx_n_s_denseCalculateEigenvalues, 126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 126, __pyx_L1_error)
4375  __Pyx_RefNannyFinishContext();
4376  return 0;
4377  __pyx_L1_error:;
4378  __Pyx_RefNannyFinishContext();
4379  return -1;
4380 }
4381 
4382 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
4383  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
4384  return 0;
4385  __pyx_L1_error:;
4386  return -1;
4387 }
4388 
4389 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
4390 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
4391 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
4392 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
4393 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
4394 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
4395 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
4396 
4397 static int __Pyx_modinit_global_init_code(void) {
4398  __Pyx_RefNannyDeclarations
4399  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
4400  /*--- Global init code ---*/
4401  __Pyx_RefNannyFinishContext();
4402  return 0;
4403 }
4404 
4405 static int __Pyx_modinit_variable_export_code(void) {
4406  __Pyx_RefNannyDeclarations
4407  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
4408  /*--- Variable export code ---*/
4409  __Pyx_RefNannyFinishContext();
4410  return 0;
4411 }
4412 
4413 static int __Pyx_modinit_function_export_code(void) {
4414  __Pyx_RefNannyDeclarations
4415  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
4416  /*--- Function export code ---*/
4417  __Pyx_RefNannyFinishContext();
4418  return 0;
4419 }
4420 
4421 static int __Pyx_modinit_type_init_code(void) {
4422  __Pyx_RefNannyDeclarations
4423  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
4424  /*--- Type init code ---*/
4425  __Pyx_RefNannyFinishContext();
4426  return 0;
4427 }
4428 
4429 static int __Pyx_modinit_type_import_code(void) {
4430  __Pyx_RefNannyDeclarations
4431  PyObject *__pyx_t_1 = NULL;
4432  int __pyx_lineno = 0;
4433  const char *__pyx_filename = NULL;
4434  int __pyx_clineno = 0;
4435  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
4436  /*--- Type import code ---*/
4437  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
4438  __Pyx_GOTREF(__pyx_t_1);
4439  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
4440  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
4441  sizeof(PyTypeObject),
4442  #else
4443  sizeof(PyHeapTypeObject),
4444  #endif
4445  __Pyx_ImportType_CheckSize_Warn);
4446  if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
4447  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4448  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 200, __pyx_L1_error)
4449  __Pyx_GOTREF(__pyx_t_1);
4450  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
4451  if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 200, __pyx_L1_error)
4452  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
4453  if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 223, __pyx_L1_error)
4454  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
4455  if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 227, __pyx_L1_error)
4456  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
4457  if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 239, __pyx_L1_error)
4458  __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
4459  if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 771, __pyx_L1_error)
4460  __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
4461  if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 773, __pyx_L1_error)
4462  __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
4463  if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 775, __pyx_L1_error)
4464  __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
4465  if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 777, __pyx_L1_error)
4466  __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
4467  if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 779, __pyx_L1_error)
4468  __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
4469  if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 781, __pyx_L1_error)
4470  __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
4471  if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 783, __pyx_L1_error)
4472  __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
4473  if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 785, __pyx_L1_error)
4474  __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
4475  if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 787, __pyx_L1_error)
4476  __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
4477  if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 789, __pyx_L1_error)
4478  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
4479  if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 827, __pyx_L1_error)
4480  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4481  __Pyx_RefNannyFinishContext();
4482  return 0;
4483  __pyx_L1_error:;
4484  __Pyx_XDECREF(__pyx_t_1);
4485  __Pyx_RefNannyFinishContext();
4486  return -1;
4487 }
4488 
4489 static int __Pyx_modinit_variable_import_code(void) {
4490  __Pyx_RefNannyDeclarations
4491  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
4492  /*--- Variable import code ---*/
4493  __Pyx_RefNannyFinishContext();
4494  return 0;
4495 }
4496 
4497 static int __Pyx_modinit_function_import_code(void) {
4498  __Pyx_RefNannyDeclarations
4499  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
4500  /*--- Function import code ---*/
4501  __Pyx_RefNannyFinishContext();
4502  return 0;
4503 }
4504 
4505 
4506 #ifndef CYTHON_NO_PYINIT_EXPORT
4507 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
4508 #elif PY_MAJOR_VERSION < 3
4509 #ifdef __cplusplus
4510 #define __Pyx_PyMODINIT_FUNC extern "C" void
4511 #else
4512 #define __Pyx_PyMODINIT_FUNC void
4513 #endif
4514 #else
4515 #ifdef __cplusplus
4516 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
4517 #else
4518 #define __Pyx_PyMODINIT_FUNC PyObject *
4519 #endif
4520 #endif
4521 
4522 
4523 #if PY_MAJOR_VERSION < 3
4524 __Pyx_PyMODINIT_FUNC initclapack(void) CYTHON_SMALL_CODE; /*proto*/
4525 __Pyx_PyMODINIT_FUNC initclapack(void)
4526 #else
4527 __Pyx_PyMODINIT_FUNC PyInit_clapack(void) CYTHON_SMALL_CODE; /*proto*/
4528 __Pyx_PyMODINIT_FUNC PyInit_clapack(void)
4529 #if CYTHON_PEP489_MULTI_PHASE_INIT
4530 {
4531  return PyModuleDef_Init(&__pyx_moduledef);
4532 }
4533 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
4534  #if PY_VERSION_HEX >= 0x030700A1
4535  static PY_INT64_T main_interpreter_id = -1;
4536  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
4537  if (main_interpreter_id == -1) {
4538  main_interpreter_id = current_id;
4539  return (unlikely(current_id == -1)) ? -1 : 0;
4540  } else if (unlikely(main_interpreter_id != current_id))
4541  #else
4542  static PyInterpreterState *main_interpreter = NULL;
4543  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
4544  if (!main_interpreter) {
4545  main_interpreter = current_interpreter;
4546  } else if (unlikely(main_interpreter != current_interpreter))
4547  #endif
4548  {
4549  PyErr_SetString(
4550  PyExc_ImportError,
4551  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
4552  return -1;
4553  }
4554  return 0;
4555 }
4556 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) {
4557  PyObject *value = PyObject_GetAttrString(spec, from_name);
4558  int result = 0;
4559  if (likely(value)) {
4560  if (allow_none || value != Py_None) {
4561  result = PyDict_SetItemString(moddict, to_name, value);
4562  }
4563  Py_DECREF(value);
4564  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
4565  PyErr_Clear();
4566  } else {
4567  result = -1;
4568  }
4569  return result;
4570 }
4571 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
4572  PyObject *module = NULL, *moddict, *modname;
4573  if (__Pyx_check_single_interpreter())
4574  return NULL;
4575  if (__pyx_m)
4576  return __Pyx_NewRef(__pyx_m);
4577  modname = PyObject_GetAttrString(spec, "name");
4578  if (unlikely(!modname)) goto bad;
4579  module = PyModule_NewObject(modname);
4580  Py_DECREF(modname);
4581  if (unlikely(!module)) goto bad;
4582  moddict = PyModule_GetDict(module);
4583  if (unlikely(!moddict)) goto bad;
4584  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
4585  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
4586  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
4587  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
4588  return module;
4589 bad:
4590  Py_XDECREF(module);
4591  return NULL;
4592 }
4593 
4594 
4595 static CYTHON_SMALL_CODE int __pyx_pymod_exec_clapack(PyObject *__pyx_pyinit_module)
4596 #endif
4597 #endif
4598 {
4599  PyObject *__pyx_t_1 = NULL;
4600  PyObject *__pyx_t_2 = NULL;
4601  int __pyx_lineno = 0;
4602  const char *__pyx_filename = NULL;
4603  int __pyx_clineno = 0;
4604  __Pyx_RefNannyDeclarations
4605  #if CYTHON_PEP489_MULTI_PHASE_INIT
4606  if (__pyx_m) {
4607  if (__pyx_m == __pyx_pyinit_module) return 0;
4608  PyErr_SetString(PyExc_RuntimeError, "Module 'clapack' has already been imported. Re-initialisation is not supported.");
4609  return -1;
4610  }
4611  #elif PY_MAJOR_VERSION >= 3
4612  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
4613  #endif
4614  #if CYTHON_REFNANNY
4615 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
4616 if (!__Pyx_RefNanny) {
4617  PyErr_Clear();
4618  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
4619  if (!__Pyx_RefNanny)
4620  Py_FatalError("failed to import 'refnanny' module");
4621 }
4622 #endif
4623  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_clapack(void)", 0);
4624  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4625  #ifdef __Pxy_PyFrame_Initialize_Offsets
4626  __Pxy_PyFrame_Initialize_Offsets();
4627  #endif
4628  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
4629  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
4630  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
4631  #ifdef __Pyx_CyFunction_USED
4632  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4633  #endif
4634  #ifdef __Pyx_FusedFunction_USED
4635  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4636  #endif
4637  #ifdef __Pyx_Coroutine_USED
4638  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4639  #endif
4640  #ifdef __Pyx_Generator_USED
4641  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4642  #endif
4643  #ifdef __Pyx_AsyncGen_USED
4644  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4645  #endif
4646  #ifdef __Pyx_StopAsyncIteration_USED
4647  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4648  #endif
4649  /*--- Library function declarations ---*/
4650  /*--- Threads initialization code ---*/
4651  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
4652  PyEval_InitThreads();
4653  #endif
4654  /*--- Module creation code ---*/
4655  #if CYTHON_PEP489_MULTI_PHASE_INIT
4656  __pyx_m = __pyx_pyinit_module;
4657  Py_INCREF(__pyx_m);
4658  #else
4659  #if PY_MAJOR_VERSION < 3
4660  __pyx_m = Py_InitModule4("clapack", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
4661  #else
4662  __pyx_m = PyModule_Create(&__pyx_moduledef);
4663  #endif
4664  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
4665  #endif
4666  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
4667  Py_INCREF(__pyx_d);
4668  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
4669  Py_INCREF(__pyx_b);
4670  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
4671  Py_INCREF(__pyx_cython_runtime);
4672  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
4673  /*--- Initialize various global constants etc. ---*/
4674  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4675  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
4676  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4677  #endif
4678  if (__pyx_module_is_main_clapack) {
4679  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4680  }
4681  #if PY_MAJOR_VERSION >= 3
4682  {
4683  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
4684  if (!PyDict_GetItemString(modules, "clapack")) {
4685  if (unlikely(PyDict_SetItemString(modules, "clapack", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
4686  }
4687  }
4688  #endif
4689  /*--- Builtin init code ---*/
4690  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4691  /*--- Constants init code ---*/
4692  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4693  /*--- Global type/function init code ---*/
4694  (void)__Pyx_modinit_global_init_code();
4695  (void)__Pyx_modinit_variable_export_code();
4696  (void)__Pyx_modinit_function_export_code();
4697  (void)__Pyx_modinit_type_init_code();
4698  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
4699  (void)__Pyx_modinit_variable_import_code();
4700  (void)__Pyx_modinit_function_import_code();
4701  /*--- Execution code ---*/
4702  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
4703  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4704  #endif
4705 
4706  /* "clapack.pyx":1
4707  * import numpy as np # <<<<<<<<<<<<<<
4708  * cimport numpy as np
4709  *
4710  */
4711  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
4712  __Pyx_GOTREF(__pyx_t_1);
4713  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4714  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4715 
4716  /* "clapack.pyx":16
4717  * extern void cdcopy_ "dcopy_"(const int* N, const double *X, const int* incX, double *Y, const int* incY)
4718  *
4719  * class DenseFactor: # <<<<<<<<<<<<<<
4720  * def __init__(self, n):
4721  * self.n = n
4722  */
4723  __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_DenseFactor, __pyx_n_s_DenseFactor, (PyObject *) NULL, __pyx_n_s_clapack, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
4724  __Pyx_GOTREF(__pyx_t_1);
4725 
4726  /* "clapack.pyx":17
4727  *
4728  * class DenseFactor:
4729  * def __init__(self, n): # <<<<<<<<<<<<<<
4730  * self.n = n
4731  * self.lu = np.zeros(shape=(n,n), dtype=float)
4732  */
4733  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_7clapack_11DenseFactor_1__init__, 0, __pyx_n_s_DenseFactor___init, NULL, __pyx_n_s_clapack, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
4734  __Pyx_GOTREF(__pyx_t_2);
4735  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
4736  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4737 
4738  /* "clapack.pyx":16
4739  * extern void cdcopy_ "dcopy_"(const int* N, const double *X, const int* incX, double *Y, const int* incY)
4740  *
4741  * class DenseFactor: # <<<<<<<<<<<<<<
4742  * def __init__(self, n):
4743  * self.n = n
4744  */
4745  __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_DenseFactor, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
4746  __Pyx_GOTREF(__pyx_t_2);
4747  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DenseFactor, __pyx_t_2) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
4748  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4749  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4750 
4751  /* "clapack.pyx":91
4752  * &info)
4753  *
4754  * def blasCopy(n, # <<<<<<<<<<<<<<
4755  * mat,
4756  * denseFactor):
4757  */
4758  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7clapack_1blasCopy, NULL, __pyx_n_s_clapack); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
4759  __Pyx_GOTREF(__pyx_t_1);
4760  if (PyDict_SetItem(__pyx_d, __pyx_n_s_blasCopy, __pyx_t_1) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
4761  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4762 
4763  /* "clapack.pyx":100
4764  * DF_lu)
4765  *
4766  * def denseFactorPrepare(n, # <<<<<<<<<<<<<<
4767  * mat,
4768  * denseFactor):
4769  */
4770  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7clapack_3denseFactorPrepare, NULL, __pyx_n_s_clapack); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
4771  __Pyx_GOTREF(__pyx_t_1);
4772  if (PyDict_SetItem(__pyx_d, __pyx_n_s_denseFactorPrepare, __pyx_t_1) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
4773  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4774 
4775  /* "clapack.pyx":114
4776  * DF_pivots)
4777  *
4778  * def denseFactorSolve(n, # <<<<<<<<<<<<<<
4779  * mat,
4780  * denseFactor,
4781  */
4782  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7clapack_5denseFactorSolve, NULL, __pyx_n_s_clapack); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
4783  __Pyx_GOTREF(__pyx_t_1);
4784  if (PyDict_SetItem(__pyx_d, __pyx_n_s_denseFactorSolve, __pyx_t_1) < 0) __PYX_ERR(0, 114, __pyx_L1_error)
4785  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4786 
4787  /* "clapack.pyx":126
4788  * b)
4789  *
4790  * def denseCalculateEigenvalues(jobvl, # <<<<<<<<<<<<<<
4791  * jobvr,
4792  * n,
4793  */
4794  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7clapack_7denseCalculateEigenvalues, NULL, __pyx_n_s_clapack); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
4795  __Pyx_GOTREF(__pyx_t_1);
4796  if (PyDict_SetItem(__pyx_d, __pyx_n_s_denseCalculateEigenvalues, __pyx_t_1) < 0) __PYX_ERR(0, 126, __pyx_L1_error)
4797  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4798 
4799  /* "clapack.pyx":1
4800  * import numpy as np # <<<<<<<<<<<<<<
4801  * cimport numpy as np
4802  *
4803  */
4804  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
4805  __Pyx_GOTREF(__pyx_t_1);
4806  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4807  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4808 
4809  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
4810  *
4811  *
4812  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
4813  * """
4814  * returns the unit part of the dtype for a numpy datetime64 object.
4815  */
4816 
4817  /*--- Wrapped vars code ---*/
4818 
4819  goto __pyx_L0;
4820  __pyx_L1_error:;
4821  __Pyx_XDECREF(__pyx_t_1);
4822  __Pyx_XDECREF(__pyx_t_2);
4823  if (__pyx_m) {
4824  if (__pyx_d) {
4825  __Pyx_AddTraceback("init clapack", __pyx_clineno, __pyx_lineno, __pyx_filename);
4826  }
4827  Py_CLEAR(__pyx_m);
4828  } else if (!PyErr_Occurred()) {
4829  PyErr_SetString(PyExc_ImportError, "init clapack");
4830  }
4831  __pyx_L0:;
4832  __Pyx_RefNannyFinishContext();
4833  #if CYTHON_PEP489_MULTI_PHASE_INIT
4834  return (__pyx_m != NULL) ? 0 : -1;
4835  #elif PY_MAJOR_VERSION >= 3
4836  return __pyx_m;
4837  #else
4838  return;
4839  #endif
4840 }
4841 
4842 /* --- Runtime support code --- */
4843 /* Refnanny */
4844 #if CYTHON_REFNANNY
4845 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
4846  PyObject *m = NULL, *p = NULL;
4847  void *r = NULL;
4848  m = PyImport_ImportModule(modname);
4849  if (!m) goto end;
4850  p = PyObject_GetAttrString(m, "RefNannyAPI");
4851  if (!p) goto end;
4852  r = PyLong_AsVoidPtr(p);
4853 end:
4854  Py_XDECREF(p);
4855  Py_XDECREF(m);
4856  return (__Pyx_RefNannyAPIStruct *)r;
4857 }
4858 #endif
4859 
4860 /* RaiseArgTupleInvalid */
4861 static void __Pyx_RaiseArgtupleInvalid(
4862  const char* func_name,
4863  int exact,
4864  Py_ssize_t num_min,
4865  Py_ssize_t num_max,
4866  Py_ssize_t num_found)
4867 {
4868  Py_ssize_t num_expected;
4869  const char *more_or_less;
4870  if (num_found < num_min) {
4871  num_expected = num_min;
4872  more_or_less = "at least";
4873  } else {
4874  num_expected = num_max;
4875  more_or_less = "at most";
4876  }
4877  if (exact) {
4878  more_or_less = "exactly";
4879  }
4880  PyErr_Format(PyExc_TypeError,
4881  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
4882  func_name, more_or_less, num_expected,
4883  (num_expected == 1) ? "" : "s", num_found);
4884 }
4885 
4886 /* RaiseDoubleKeywords */
4887 static void __Pyx_RaiseDoubleKeywordsError(
4888  const char* func_name,
4889  PyObject* kw_name)
4890 {
4891  PyErr_Format(PyExc_TypeError,
4892  #if PY_MAJOR_VERSION >= 3
4893  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
4894  #else
4895  "%s() got multiple values for keyword argument '%s'", func_name,
4896  PyString_AsString(kw_name));
4897  #endif
4898 }
4899 
4900 /* ParseKeywords */
4901 static int __Pyx_ParseOptionalKeywords(
4902  PyObject *kwds,
4903  PyObject **argnames[],
4904  PyObject *kwds2,
4905  PyObject *values[],
4906  Py_ssize_t num_pos_args,
4907  const char* function_name)
4908 {
4909  PyObject *key = 0, *value = 0;
4910  Py_ssize_t pos = 0;
4911  PyObject*** name;
4912  PyObject*** first_kw_arg = argnames + num_pos_args;
4913  while (PyDict_Next(kwds, &pos, &key, &value)) {
4914  name = first_kw_arg;
4915  while (*name && (**name != key)) name++;
4916  if (*name) {
4917  values[name-argnames] = value;
4918  continue;
4919  }
4920  name = first_kw_arg;
4921  #if PY_MAJOR_VERSION < 3
4922  if (likely(PyString_Check(key))) {
4923  while (*name) {
4924  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
4925  && _PyString_Eq(**name, key)) {
4926  values[name-argnames] = value;
4927  break;
4928  }
4929  name++;
4930  }
4931  if (*name) continue;
4932  else {
4933  PyObject*** argname = argnames;
4934  while (argname != first_kw_arg) {
4935  if ((**argname == key) || (
4936  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
4937  && _PyString_Eq(**argname, key))) {
4938  goto arg_passed_twice;
4939  }
4940  argname++;
4941  }
4942  }
4943  } else
4944  #endif
4945  if (likely(PyUnicode_Check(key))) {
4946  while (*name) {
4947  int cmp = (**name == key) ? 0 :
4948  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
4949  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
4950  #endif
4951  PyUnicode_Compare(**name, key);
4952  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
4953  if (cmp == 0) {
4954  values[name-argnames] = value;
4955  break;
4956  }
4957  name++;
4958  }
4959  if (*name) continue;
4960  else {
4961  PyObject*** argname = argnames;
4962  while (argname != first_kw_arg) {
4963  int cmp = (**argname == key) ? 0 :
4964  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
4965  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
4966  #endif
4967  PyUnicode_Compare(**argname, key);
4968  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
4969  if (cmp == 0) goto arg_passed_twice;
4970  argname++;
4971  }
4972  }
4973  } else
4974  goto invalid_keyword_type;
4975  if (kwds2) {
4976  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
4977  } else {
4978  goto invalid_keyword;
4979  }
4980  }
4981  return 0;
4982 arg_passed_twice:
4983  __Pyx_RaiseDoubleKeywordsError(function_name, key);
4984  goto bad;
4985 invalid_keyword_type:
4986  PyErr_Format(PyExc_TypeError,
4987  "%.200s() keywords must be strings", function_name);
4988  goto bad;
4989 invalid_keyword:
4990  PyErr_Format(PyExc_TypeError,
4991  #if PY_MAJOR_VERSION < 3
4992  "%.200s() got an unexpected keyword argument '%.200s'",
4993  function_name, PyString_AsString(key));
4994  #else
4995  "%s() got an unexpected keyword argument '%U'",
4996  function_name, key);
4997  #endif
4998 bad:
4999  return -1;
5000 }
5001 
5002 /* PyObjectSetAttrStr */
5003 #if CYTHON_USE_TYPE_SLOTS
5004 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
5005  PyTypeObject* tp = Py_TYPE(obj);
5006  if (likely(tp->tp_setattro))
5007  return tp->tp_setattro(obj, attr_name, value);
5008 #if PY_MAJOR_VERSION < 3
5009  if (likely(tp->tp_setattr))
5010  return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
5011 #endif
5012  return PyObject_SetAttr(obj, attr_name, value);
5013 }
5014 #endif
5015 
5016 /* PyObjectGetAttrStr */
5017 #if CYTHON_USE_TYPE_SLOTS
5018 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
5019  PyTypeObject* tp = Py_TYPE(obj);
5020  if (likely(tp->tp_getattro))
5021  return tp->tp_getattro(obj, attr_name);
5022 #if PY_MAJOR_VERSION < 3
5023  if (likely(tp->tp_getattr))
5024  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
5025 #endif
5026  return PyObject_GetAttr(obj, attr_name);
5027 }
5028 #endif
5029 
5030 /* GetBuiltinName */
5031 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
5032  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
5033  if (unlikely(!result)) {
5034  PyErr_Format(PyExc_NameError,
5035 #if PY_MAJOR_VERSION >= 3
5036  "name '%U' is not defined", name);
5037 #else
5038  "name '%.200s' is not defined", PyString_AS_STRING(name));
5039 #endif
5040  }
5041  return result;
5042 }
5043 
5044 /* PyDictVersioning */
5045 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
5046 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
5047  PyObject *dict = Py_TYPE(obj)->tp_dict;
5048  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
5049 }
5050 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
5051  PyObject **dictptr = NULL;
5052  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
5053  if (offset) {
5054 #if CYTHON_COMPILING_IN_CPYTHON
5055  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
5056 #else
5057  dictptr = _PyObject_GetDictPtr(obj);
5058 #endif
5059  }
5060  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
5061 }
5062 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
5063  PyObject *dict = Py_TYPE(obj)->tp_dict;
5064  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
5065  return 0;
5066  return obj_dict_version == __Pyx_get_object_dict_version(obj);
5067 }
5068 #endif
5069 
5070 /* GetModuleGlobalName */
5071 #if CYTHON_USE_DICT_VERSIONS
5072 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
5073 #else
5074 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
5075 #endif
5076 {
5077  PyObject *result;
5078 #if !CYTHON_AVOID_BORROWED_REFS
5079 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
5080  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
5081  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
5082  if (likely(result)) {
5083  return __Pyx_NewRef(result);
5084  } else if (unlikely(PyErr_Occurred())) {
5085  return NULL;
5086  }
5087 #else
5088  result = PyDict_GetItem(__pyx_d, name);
5089  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
5090  if (likely(result)) {
5091  return __Pyx_NewRef(result);
5092  }
5093 #endif
5094 #else
5095  result = PyObject_GetItem(__pyx_d, name);
5096  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
5097  if (likely(result)) {
5098  return __Pyx_NewRef(result);
5099  }
5100  PyErr_Clear();
5101 #endif
5102  return __Pyx_GetBuiltinName(name);
5103 }
5104 
5105 /* PyObjectCall */
5106 #if CYTHON_COMPILING_IN_CPYTHON
5107 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
5108  PyObject *result;
5109  ternaryfunc call = Py_TYPE(func)->tp_call;
5110  if (unlikely(!call))
5111  return PyObject_Call(func, arg, kw);
5112  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
5113  return NULL;
5114  result = (*call)(func, arg, kw);
5115  Py_LeaveRecursiveCall();
5116  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
5117  PyErr_SetString(
5118  PyExc_SystemError,
5119  "NULL result without error in PyObject_Call");
5120  }
5121  return result;
5122 }
5123 #endif
5124 
5125 /* ExtTypeTest */
5126 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
5127  if (unlikely(!type)) {
5128  PyErr_SetString(PyExc_SystemError, "Missing type object");
5129  return 0;
5130  }
5131  if (likely(__Pyx_TypeCheck(obj, type)))
5132  return 1;
5133  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
5134  Py_TYPE(obj)->tp_name, type->tp_name);
5135  return 0;
5136 }
5137 
5138 /* GetTopmostException */
5139 #if CYTHON_USE_EXC_INFO_STACK
5140 static _PyErr_StackItem *
5141 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
5142 {
5143  _PyErr_StackItem *exc_info = tstate->exc_info;
5144  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
5145  exc_info->previous_item != NULL)
5146  {
5147  exc_info = exc_info->previous_item;
5148  }
5149  return exc_info;
5150 }
5151 #endif
5152 
5153 /* SaveResetException */
5154 #if CYTHON_FAST_THREAD_STATE
5155 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
5156  #if CYTHON_USE_EXC_INFO_STACK
5157  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
5158  *type = exc_info->exc_type;
5159  *value = exc_info->exc_value;
5160  *tb = exc_info->exc_traceback;
5161  #else
5162  *type = tstate->exc_type;
5163  *value = tstate->exc_value;
5164  *tb = tstate->exc_traceback;
5165  #endif
5166  Py_XINCREF(*type);
5167  Py_XINCREF(*value);
5168  Py_XINCREF(*tb);
5169 }
5170 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
5171  PyObject *tmp_type, *tmp_value, *tmp_tb;
5172  #if CYTHON_USE_EXC_INFO_STACK
5173  _PyErr_StackItem *exc_info = tstate->exc_info;
5174  tmp_type = exc_info->exc_type;
5175  tmp_value = exc_info->exc_value;
5176  tmp_tb = exc_info->exc_traceback;
5177  exc_info->exc_type = type;
5178  exc_info->exc_value = value;
5179  exc_info->exc_traceback = tb;
5180  #else
5181  tmp_type = tstate->exc_type;
5182  tmp_value = tstate->exc_value;
5183  tmp_tb = tstate->exc_traceback;
5184  tstate->exc_type = type;
5185  tstate->exc_value = value;
5186  tstate->exc_traceback = tb;
5187  #endif
5188  Py_XDECREF(tmp_type);
5189  Py_XDECREF(tmp_value);
5190  Py_XDECREF(tmp_tb);
5191 }
5192 #endif
5193 
5194 /* PyErrExceptionMatches */
5195 #if CYTHON_FAST_THREAD_STATE
5196 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
5197  Py_ssize_t i, n;
5198  n = PyTuple_GET_SIZE(tuple);
5199 #if PY_MAJOR_VERSION >= 3
5200  for (i=0; i<n; i++) {
5201  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
5202  }
5203 #endif
5204  for (i=0; i<n; i++) {
5205  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
5206  }
5207  return 0;
5208 }
5209 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
5210  PyObject *exc_type = tstate->curexc_type;
5211  if (exc_type == err) return 1;
5212  if (unlikely(!exc_type)) return 0;
5213  if (unlikely(PyTuple_Check(err)))
5214  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
5215  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
5216 }
5217 #endif
5218 
5219 /* GetException */
5220 #if CYTHON_FAST_THREAD_STATE
5221 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
5222 #else
5223 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
5224 #endif
5225 {
5226  PyObject *local_type, *local_value, *local_tb;
5227 #if CYTHON_FAST_THREAD_STATE
5228  PyObject *tmp_type, *tmp_value, *tmp_tb;
5229  local_type = tstate->curexc_type;
5230  local_value = tstate->curexc_value;
5231  local_tb = tstate->curexc_traceback;
5232  tstate->curexc_type = 0;
5233  tstate->curexc_value = 0;
5234  tstate->curexc_traceback = 0;
5235 #else
5236  PyErr_Fetch(&local_type, &local_value, &local_tb);
5237 #endif
5238  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
5239 #if CYTHON_FAST_THREAD_STATE
5240  if (unlikely(tstate->curexc_type))
5241 #else
5242  if (unlikely(PyErr_Occurred()))
5243 #endif
5244  goto bad;
5245  #if PY_MAJOR_VERSION >= 3
5246  if (local_tb) {
5247  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
5248  goto bad;
5249  }
5250  #endif
5251  Py_XINCREF(local_tb);
5252  Py_XINCREF(local_type);
5253  Py_XINCREF(local_value);
5254  *type = local_type;
5255  *value = local_value;
5256  *tb = local_tb;
5257 #if CYTHON_FAST_THREAD_STATE
5258  #if CYTHON_USE_EXC_INFO_STACK
5259  {
5260  _PyErr_StackItem *exc_info = tstate->exc_info;
5261  tmp_type = exc_info->exc_type;
5262  tmp_value = exc_info->exc_value;
5263  tmp_tb = exc_info->exc_traceback;
5264  exc_info->exc_type = local_type;
5265  exc_info->exc_value = local_value;
5266  exc_info->exc_traceback = local_tb;
5267  }
5268  #else
5269  tmp_type = tstate->exc_type;
5270  tmp_value = tstate->exc_value;
5271  tmp_tb = tstate->exc_traceback;
5272  tstate->exc_type = local_type;
5273  tstate->exc_value = local_value;
5274  tstate->exc_traceback = local_tb;
5275  #endif
5276  Py_XDECREF(tmp_type);
5277  Py_XDECREF(tmp_value);
5278  Py_XDECREF(tmp_tb);
5279 #else
5280  PyErr_SetExcInfo(local_type, local_value, local_tb);
5281 #endif
5282  return 0;
5283 bad:
5284  *type = 0;
5285  *value = 0;
5286  *tb = 0;
5287  Py_XDECREF(local_type);
5288  Py_XDECREF(local_value);
5289  Py_XDECREF(local_tb);
5290  return -1;
5291 }
5292 
5293 /* PyErrFetchRestore */
5294 #if CYTHON_FAST_THREAD_STATE
5295 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
5296  PyObject *tmp_type, *tmp_value, *tmp_tb;
5297  tmp_type = tstate->curexc_type;
5298  tmp_value = tstate->curexc_value;
5299  tmp_tb = tstate->curexc_traceback;
5300  tstate->curexc_type = type;
5301  tstate->curexc_value = value;
5302  tstate->curexc_traceback = tb;
5303  Py_XDECREF(tmp_type);
5304  Py_XDECREF(tmp_value);
5305  Py_XDECREF(tmp_tb);
5306 }
5307 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
5308  *type = tstate->curexc_type;
5309  *value = tstate->curexc_value;
5310  *tb = tstate->curexc_traceback;
5311  tstate->curexc_type = 0;
5312  tstate->curexc_value = 0;
5313  tstate->curexc_traceback = 0;
5314 }
5315 #endif
5316 
5317 /* RaiseException */
5318 #if PY_MAJOR_VERSION < 3
5319 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
5320  CYTHON_UNUSED PyObject *cause) {
5321  __Pyx_PyThreadState_declare
5322  Py_XINCREF(type);
5323  if (!value || value == Py_None)
5324  value = NULL;
5325  else
5326  Py_INCREF(value);
5327  if (!tb || tb == Py_None)
5328  tb = NULL;
5329  else {
5330  Py_INCREF(tb);
5331  if (!PyTraceBack_Check(tb)) {
5332  PyErr_SetString(PyExc_TypeError,
5333  "raise: arg 3 must be a traceback or None");
5334  goto raise_error;
5335  }
5336  }
5337  if (PyType_Check(type)) {
5338 #if CYTHON_COMPILING_IN_PYPY
5339  if (!value) {
5340  Py_INCREF(Py_None);
5341  value = Py_None;
5342  }
5343 #endif
5344  PyErr_NormalizeException(&type, &value, &tb);
5345  } else {
5346  if (value) {
5347  PyErr_SetString(PyExc_TypeError,
5348  "instance exception may not have a separate value");
5349  goto raise_error;
5350  }
5351  value = type;
5352  type = (PyObject*) Py_TYPE(type);
5353  Py_INCREF(type);
5354  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
5355  PyErr_SetString(PyExc_TypeError,
5356  "raise: exception class must be a subclass of BaseException");
5357  goto raise_error;
5358  }
5359  }
5360  __Pyx_PyThreadState_assign
5361  __Pyx_ErrRestore(type, value, tb);
5362  return;
5363 raise_error:
5364  Py_XDECREF(value);
5365  Py_XDECREF(type);
5366  Py_XDECREF(tb);
5367  return;
5368 }
5369 #else
5370 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
5371  PyObject* owned_instance = NULL;
5372  if (tb == Py_None) {
5373  tb = 0;
5374  } else if (tb && !PyTraceBack_Check(tb)) {
5375  PyErr_SetString(PyExc_TypeError,
5376  "raise: arg 3 must be a traceback or None");
5377  goto bad;
5378  }
5379  if (value == Py_None)
5380  value = 0;
5381  if (PyExceptionInstance_Check(type)) {
5382  if (value) {
5383  PyErr_SetString(PyExc_TypeError,
5384  "instance exception may not have a separate value");
5385  goto bad;
5386  }
5387  value = type;
5388  type = (PyObject*) Py_TYPE(value);
5389  } else if (PyExceptionClass_Check(type)) {
5390  PyObject *instance_class = NULL;
5391  if (value && PyExceptionInstance_Check(value)) {
5392  instance_class = (PyObject*) Py_TYPE(value);
5393  if (instance_class != type) {
5394  int is_subclass = PyObject_IsSubclass(instance_class, type);
5395  if (!is_subclass) {
5396  instance_class = NULL;
5397  } else if (unlikely(is_subclass == -1)) {
5398  goto bad;
5399  } else {
5400  type = instance_class;
5401  }
5402  }
5403  }
5404  if (!instance_class) {
5405  PyObject *args;
5406  if (!value)
5407  args = PyTuple_New(0);
5408  else if (PyTuple_Check(value)) {
5409  Py_INCREF(value);
5410  args = value;
5411  } else
5412  args = PyTuple_Pack(1, value);
5413  if (!args)
5414  goto bad;
5415  owned_instance = PyObject_Call(type, args, NULL);
5416  Py_DECREF(args);
5417  if (!owned_instance)
5418  goto bad;
5419  value = owned_instance;
5420  if (!PyExceptionInstance_Check(value)) {
5421  PyErr_Format(PyExc_TypeError,
5422  "calling %R should have returned an instance of "
5423  "BaseException, not %R",
5424  type, Py_TYPE(value));
5425  goto bad;
5426  }
5427  }
5428  } else {
5429  PyErr_SetString(PyExc_TypeError,
5430  "raise: exception class must be a subclass of BaseException");
5431  goto bad;
5432  }
5433  if (cause) {
5434  PyObject *fixed_cause;
5435  if (cause == Py_None) {
5436  fixed_cause = NULL;
5437  } else if (PyExceptionClass_Check(cause)) {
5438  fixed_cause = PyObject_CallObject(cause, NULL);
5439  if (fixed_cause == NULL)
5440  goto bad;
5441  } else if (PyExceptionInstance_Check(cause)) {
5442  fixed_cause = cause;
5443  Py_INCREF(fixed_cause);
5444  } else {
5445  PyErr_SetString(PyExc_TypeError,
5446  "exception causes must derive from "
5447  "BaseException");
5448  goto bad;
5449  }
5450  PyException_SetCause(value, fixed_cause);
5451  }
5452  PyErr_SetObject(type, value);
5453  if (tb) {
5454 #if CYTHON_COMPILING_IN_PYPY
5455  PyObject *tmp_type, *tmp_value, *tmp_tb;
5456  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
5457  Py_INCREF(tb);
5458  PyErr_Restore(tmp_type, tmp_value, tb);
5459  Py_XDECREF(tmp_tb);
5460 #else
5461  PyThreadState *tstate = __Pyx_PyThreadState_Current;
5462  PyObject* tmp_tb = tstate->curexc_traceback;
5463  if (tb != tmp_tb) {
5464  Py_INCREF(tb);
5465  tstate->curexc_traceback = tb;
5466  Py_XDECREF(tmp_tb);
5467  }
5468 #endif
5469  }
5470 bad:
5471  Py_XDECREF(owned_instance);
5472  return;
5473 }
5474 #endif
5475 
5476 /* TypeImport */
5477 #ifndef __PYX_HAVE_RT_ImportType
5478 #define __PYX_HAVE_RT_ImportType
5479 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
5480  size_t size, enum __Pyx_ImportType_CheckSize check_size)
5481 {
5482  PyObject *result = 0;
5483  char warning[200];
5484  Py_ssize_t basicsize;
5485 #ifdef Py_LIMITED_API
5486  PyObject *py_basicsize;
5487 #endif
5488  result = PyObject_GetAttrString(module, class_name);
5489  if (!result)
5490  goto bad;
5491  if (!PyType_Check(result)) {
5492  PyErr_Format(PyExc_TypeError,
5493  "%.200s.%.200s is not a type object",
5494  module_name, class_name);
5495  goto bad;
5496  }
5497 #ifndef Py_LIMITED_API
5498  basicsize = ((PyTypeObject *)result)->tp_basicsize;
5499 #else
5500  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
5501  if (!py_basicsize)
5502  goto bad;
5503  basicsize = PyLong_AsSsize_t(py_basicsize);
5504  Py_DECREF(py_basicsize);
5505  py_basicsize = 0;
5506  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
5507  goto bad;
5508 #endif
5509  if ((size_t)basicsize < size) {
5510  PyErr_Format(PyExc_ValueError,
5511  "%.200s.%.200s size changed, may indicate binary incompatibility. "
5512  "Expected %zd from C header, got %zd from PyObject",
5513  module_name, class_name, size, basicsize);
5514  goto bad;
5515  }
5516  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
5517  PyErr_Format(PyExc_ValueError,
5518  "%.200s.%.200s size changed, may indicate binary incompatibility. "
5519  "Expected %zd from C header, got %zd from PyObject",
5520  module_name, class_name, size, basicsize);
5521  goto bad;
5522  }
5523  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
5524  PyOS_snprintf(warning, sizeof(warning),
5525  "%s.%s size changed, may indicate binary incompatibility. "
5526  "Expected %zd from C header, got %zd from PyObject",
5527  module_name, class_name, size, basicsize);
5528  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
5529  }
5530  return (PyTypeObject *)result;
5531 bad:
5532  Py_XDECREF(result);
5533  return NULL;
5534 }
5535 #endif
5536 
5537 /* Import */
5538 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
5539  PyObject *empty_list = 0;
5540  PyObject *module = 0;
5541  PyObject *global_dict = 0;
5542  PyObject *empty_dict = 0;
5543  PyObject *list;
5544  #if PY_MAJOR_VERSION < 3
5545  PyObject *py_import;
5546  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
5547  if (!py_import)
5548  goto bad;
5549  #endif
5550  if (from_list)
5551  list = from_list;
5552  else {
5553  empty_list = PyList_New(0);
5554  if (!empty_list)
5555  goto bad;
5556  list = empty_list;
5557  }
5558  global_dict = PyModule_GetDict(__pyx_m);
5559  if (!global_dict)
5560  goto bad;
5561  empty_dict = PyDict_New();
5562  if (!empty_dict)
5563  goto bad;
5564  {
5565  #if PY_MAJOR_VERSION >= 3
5566  if (level == -1) {
5567  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
5568  module = PyImport_ImportModuleLevelObject(
5569  name, global_dict, empty_dict, list, 1);
5570  if (!module) {
5571  if (!PyErr_ExceptionMatches(PyExc_ImportError))
5572  goto bad;
5573  PyErr_Clear();
5574  }
5575  }
5576  level = 0;
5577  }
5578  #endif
5579  if (!module) {
5580  #if PY_MAJOR_VERSION < 3
5581  PyObject *py_level = PyInt_FromLong(level);
5582  if (!py_level)
5583  goto bad;
5584  module = PyObject_CallFunctionObjArgs(py_import,
5585  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
5586  Py_DECREF(py_level);
5587  #else
5588  module = PyImport_ImportModuleLevelObject(
5589  name, global_dict, empty_dict, list, level);
5590  #endif
5591  }
5592  }
5593 bad:
5594  #if PY_MAJOR_VERSION < 3
5595  Py_XDECREF(py_import);
5596  #endif
5597  Py_XDECREF(empty_list);
5598  Py_XDECREF(empty_dict);
5599  return module;
5600 }
5601 
5602 /* FetchCommonType */
5603 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
5604  PyObject* fake_module;
5605  PyTypeObject* cached_type = NULL;
5606  fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
5607  if (!fake_module) return NULL;
5608  Py_INCREF(fake_module);
5609  cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
5610  if (cached_type) {
5611  if (!PyType_Check((PyObject*)cached_type)) {
5612  PyErr_Format(PyExc_TypeError,
5613  "Shared Cython type %.200s is not a type object",
5614  type->tp_name);
5615  goto bad;
5616  }
5617  if (cached_type->tp_basicsize != type->tp_basicsize) {
5618  PyErr_Format(PyExc_TypeError,
5619  "Shared Cython type %.200s has the wrong size, try recompiling",
5620  type->tp_name);
5621  goto bad;
5622  }
5623  } else {
5624  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
5625  PyErr_Clear();
5626  if (PyType_Ready(type) < 0) goto bad;
5627  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
5628  goto bad;
5629  Py_INCREF(type);
5630  cached_type = type;
5631  }
5632 done:
5633  Py_DECREF(fake_module);
5634  return cached_type;
5635 bad:
5636  Py_XDECREF(cached_type);
5637  cached_type = NULL;
5638  goto done;
5639 }
5640 
5641 /* CythonFunctionShared */
5642 #include <structmember.h>
5643 static PyObject *
5644 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
5645 {
5646  if (unlikely(op->func_doc == NULL)) {
5647  if (op->func.m_ml->ml_doc) {
5648 #if PY_MAJOR_VERSION >= 3
5649  op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
5650 #else
5651  op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
5652 #endif
5653  if (unlikely(op->func_doc == NULL))
5654  return NULL;
5655  } else {
5656  Py_INCREF(Py_None);
5657  return Py_None;
5658  }
5659  }
5660  Py_INCREF(op->func_doc);
5661  return op->func_doc;
5662 }
5663 static int
5664 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
5665 {
5666  PyObject *tmp = op->func_doc;
5667  if (value == NULL) {
5668  value = Py_None;
5669  }
5670  Py_INCREF(value);
5671  op->func_doc = value;
5672  Py_XDECREF(tmp);
5673  return 0;
5674 }
5675 static PyObject *
5676 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
5677 {
5678  if (unlikely(op->func_name == NULL)) {
5679 #if PY_MAJOR_VERSION >= 3
5680  op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
5681 #else
5682  op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
5683 #endif
5684  if (unlikely(op->func_name == NULL))
5685  return NULL;
5686  }
5687  Py_INCREF(op->func_name);
5688  return op->func_name;
5689 }
5690 static int
5691 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
5692 {
5693  PyObject *tmp;
5694 #if PY_MAJOR_VERSION >= 3
5695  if (unlikely(value == NULL || !PyUnicode_Check(value)))
5696 #else
5697  if (unlikely(value == NULL || !PyString_Check(value)))
5698 #endif
5699  {
5700  PyErr_SetString(PyExc_TypeError,
5701  "__name__ must be set to a string object");
5702  return -1;
5703  }
5704  tmp = op->func_name;
5705  Py_INCREF(value);
5706  op->func_name = value;
5707  Py_XDECREF(tmp);
5708  return 0;
5709 }
5710 static PyObject *
5711 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
5712 {
5713  Py_INCREF(op->func_qualname);
5714  return op->func_qualname;
5715 }
5716 static int
5717 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
5718 {
5719  PyObject *tmp;
5720 #if PY_MAJOR_VERSION >= 3
5721  if (unlikely(value == NULL || !PyUnicode_Check(value)))
5722 #else
5723  if (unlikely(value == NULL || !PyString_Check(value)))
5724 #endif
5725  {
5726  PyErr_SetString(PyExc_TypeError,
5727  "__qualname__ must be set to a string object");
5728  return -1;
5729  }
5730  tmp = op->func_qualname;
5731  Py_INCREF(value);
5732  op->func_qualname = value;
5733  Py_XDECREF(tmp);
5734  return 0;
5735 }
5736 static PyObject *
5737 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
5738 {
5739  PyObject *self;
5740  self = m->func_closure;
5741  if (self == NULL)
5742  self = Py_None;
5743  Py_INCREF(self);
5744  return self;
5745 }
5746 static PyObject *
5747 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
5748 {
5749  if (unlikely(op->func_dict == NULL)) {
5750  op->func_dict = PyDict_New();
5751  if (unlikely(op->func_dict == NULL))
5752  return NULL;
5753  }
5754  Py_INCREF(op->func_dict);
5755  return op->func_dict;
5756 }
5757 static int
5758 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
5759 {
5760  PyObject *tmp;
5761  if (unlikely(value == NULL)) {
5762  PyErr_SetString(PyExc_TypeError,
5763  "function's dictionary may not be deleted");
5764  return -1;
5765  }
5766  if (unlikely(!PyDict_Check(value))) {
5767  PyErr_SetString(PyExc_TypeError,
5768  "setting function's dictionary to a non-dict");
5769  return -1;
5770  }
5771  tmp = op->func_dict;
5772  Py_INCREF(value);
5773  op->func_dict = value;
5774  Py_XDECREF(tmp);
5775  return 0;
5776 }
5777 static PyObject *
5778 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
5779 {
5780  Py_INCREF(op->func_globals);
5781  return op->func_globals;
5782 }
5783 static PyObject *
5784 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
5785 {
5786  Py_INCREF(Py_None);
5787  return Py_None;
5788 }
5789 static PyObject *
5790 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
5791 {
5792  PyObject* result = (op->func_code) ? op->func_code : Py_None;
5793  Py_INCREF(result);
5794  return result;
5795 }
5796 static int
5797 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
5798  int result = 0;
5799  PyObject *res = op->defaults_getter((PyObject *) op);
5800  if (unlikely(!res))
5801  return -1;
5802  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5803  op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
5804  Py_INCREF(op->defaults_tuple);
5805  op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
5806  Py_INCREF(op->defaults_kwdict);
5807  #else
5808  op->defaults_tuple = PySequence_ITEM(res, 0);
5809  if (unlikely(!op->defaults_tuple)) result = -1;
5810  else {
5811  op->defaults_kwdict = PySequence_ITEM(res, 1);
5812  if (unlikely(!op->defaults_kwdict)) result = -1;
5813  }
5814  #endif
5815  Py_DECREF(res);
5816  return result;
5817 }
5818 static int
5819 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
5820  PyObject* tmp;
5821  if (!value) {
5822  value = Py_None;
5823  } else if (value != Py_None && !PyTuple_Check(value)) {
5824  PyErr_SetString(PyExc_TypeError,
5825  "__defaults__ must be set to a tuple object");
5826  return -1;
5827  }
5828  Py_INCREF(value);
5829  tmp = op->defaults_tuple;
5830  op->defaults_tuple = value;
5831  Py_XDECREF(tmp);
5832  return 0;
5833 }
5834 static PyObject *
5835 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
5836  PyObject* result = op->defaults_tuple;
5837  if (unlikely(!result)) {
5838  if (op->defaults_getter) {
5839  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
5840  result = op->defaults_tuple;
5841  } else {
5842  result = Py_None;
5843  }
5844  }
5845  Py_INCREF(result);
5846  return result;
5847 }
5848 static int
5849 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
5850  PyObject* tmp;
5851  if (!value) {
5852  value = Py_None;
5853  } else if (value != Py_None && !PyDict_Check(value)) {
5854  PyErr_SetString(PyExc_TypeError,
5855  "__kwdefaults__ must be set to a dict object");
5856  return -1;
5857  }
5858  Py_INCREF(value);
5859  tmp = op->defaults_kwdict;
5860  op->defaults_kwdict = value;
5861  Py_XDECREF(tmp);
5862  return 0;
5863 }
5864 static PyObject *
5865 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
5866  PyObject* result = op->defaults_kwdict;
5867  if (unlikely(!result)) {
5868  if (op->defaults_getter) {
5869  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
5870  result = op->defaults_kwdict;
5871  } else {
5872  result = Py_None;
5873  }
5874  }
5875  Py_INCREF(result);
5876  return result;
5877 }
5878 static int
5879 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
5880  PyObject* tmp;
5881  if (!value || value == Py_None) {
5882  value = NULL;
5883  } else if (!PyDict_Check(value)) {
5884  PyErr_SetString(PyExc_TypeError,
5885  "__annotations__ must be set to a dict object");
5886  return -1;
5887  }
5888  Py_XINCREF(value);
5889  tmp = op->func_annotations;
5890  op->func_annotations = value;
5891  Py_XDECREF(tmp);
5892  return 0;
5893 }
5894 static PyObject *
5895 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
5896  PyObject* result = op->func_annotations;
5897  if (unlikely(!result)) {
5898  result = PyDict_New();
5899  if (unlikely(!result)) return NULL;
5900  op->func_annotations = result;
5901  }
5902  Py_INCREF(result);
5903  return result;
5904 }
5905 static PyGetSetDef __pyx_CyFunction_getsets[] = {
5906  {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
5907  {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
5908  {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
5909  {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
5910  {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
5911  {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
5912  {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
5913  {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
5914  {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
5915  {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
5916  {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
5917  {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
5918  {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
5919  {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
5920  {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
5921  {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
5922  {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
5923  {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
5924  {0, 0, 0, 0, 0}
5925 };
5926 static PyMemberDef __pyx_CyFunction_members[] = {
5927  {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
5928  {0, 0, 0, 0, 0}
5929 };
5930 static PyObject *
5931 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
5932 {
5933 #if PY_MAJOR_VERSION >= 3
5934  Py_INCREF(m->func_qualname);
5935  return m->func_qualname;
5936 #else
5937  return PyString_FromString(m->func.m_ml->ml_name);
5938 #endif
5939 }
5940 static PyMethodDef __pyx_CyFunction_methods[] = {
5941  {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
5942  {0, 0, 0, 0}
5943 };
5944 #if PY_VERSION_HEX < 0x030500A0
5945 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
5946 #else
5947 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
5948 #endif
5949 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
5950  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
5951  if (unlikely(op == NULL))
5952  return NULL;
5953  op->flags = flags;
5954  __Pyx_CyFunction_weakreflist(op) = NULL;
5955  op->func.m_ml = ml;
5956  op->func.m_self = (PyObject *) op;
5957  Py_XINCREF(closure);
5958  op->func_closure = closure;
5959  Py_XINCREF(module);
5960  op->func.m_module = module;
5961  op->func_dict = NULL;
5962  op->func_name = NULL;
5963  Py_INCREF(qualname);
5964  op->func_qualname = qualname;
5965  op->func_doc = NULL;
5966  op->func_classobj = NULL;
5967  op->func_globals = globals;
5968  Py_INCREF(op->func_globals);
5969  Py_XINCREF(code);
5970  op->func_code = code;
5971  op->defaults_pyobjects = 0;
5972  op->defaults_size = 0;
5973  op->defaults = NULL;
5974  op->defaults_tuple = NULL;
5975  op->defaults_kwdict = NULL;
5976  op->defaults_getter = NULL;
5977  op->func_annotations = NULL;
5978  return (PyObject *) op;
5979 }
5980 static int
5981 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
5982 {
5983  Py_CLEAR(m->func_closure);
5984  Py_CLEAR(m->func.m_module);
5985  Py_CLEAR(m->func_dict);
5986  Py_CLEAR(m->func_name);
5987  Py_CLEAR(m->func_qualname);
5988  Py_CLEAR(m->func_doc);
5989  Py_CLEAR(m->func_globals);
5990  Py_CLEAR(m->func_code);
5991  Py_CLEAR(m->func_classobj);
5992  Py_CLEAR(m->defaults_tuple);
5993  Py_CLEAR(m->defaults_kwdict);
5994  Py_CLEAR(m->func_annotations);
5995  if (m->defaults) {
5996  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
5997  int i;
5998  for (i = 0; i < m->defaults_pyobjects; i++)
5999  Py_XDECREF(pydefaults[i]);
6000  PyObject_Free(m->defaults);
6001  m->defaults = NULL;
6002  }
6003  return 0;
6004 }
6005 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
6006 {
6007  if (__Pyx_CyFunction_weakreflist(m) != NULL)
6008  PyObject_ClearWeakRefs((PyObject *) m);
6009  __Pyx_CyFunction_clear(m);
6010  PyObject_GC_Del(m);
6011 }
6012 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
6013 {
6014  PyObject_GC_UnTrack(m);
6015  __Pyx__CyFunction_dealloc(m);
6016 }
6017 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
6018 {
6019  Py_VISIT(m->func_closure);
6020  Py_VISIT(m->func.m_module);
6021  Py_VISIT(m->func_dict);
6022  Py_VISIT(m->func_name);
6023  Py_VISIT(m->func_qualname);
6024  Py_VISIT(m->func_doc);
6025  Py_VISIT(m->func_globals);
6026  Py_VISIT(m->func_code);
6027  Py_VISIT(m->func_classobj);
6028  Py_VISIT(m->defaults_tuple);
6029  Py_VISIT(m->defaults_kwdict);
6030  if (m->defaults) {
6031  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
6032  int i;
6033  for (i = 0; i < m->defaults_pyobjects; i++)
6034  Py_VISIT(pydefaults[i]);
6035  }
6036  return 0;
6037 }
6038 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
6039 {
6040 #if PY_MAJOR_VERSION < 3
6041  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
6042  if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
6043  Py_INCREF(func);
6044  return func;
6045  }
6046  if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
6047  if (type == NULL)
6048  type = (PyObject *)(Py_TYPE(obj));
6049  return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
6050  }
6051  if (obj == Py_None)
6052  obj = NULL;
6053 #endif
6054  return __Pyx_PyMethod_New(func, obj, type);
6055 }
6056 static PyObject*
6057 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
6058 {
6059 #if PY_MAJOR_VERSION >= 3
6060  return PyUnicode_FromFormat("<cyfunction %U at %p>",
6061  op->func_qualname, (void *)op);
6062 #else
6063  return PyString_FromFormat("<cyfunction %s at %p>",
6064  PyString_AsString(op->func_qualname), (void *)op);
6065 #endif
6066 }
6067 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
6068  PyCFunctionObject* f = (PyCFunctionObject*)func;
6069  PyCFunction meth = f->m_ml->ml_meth;
6070  Py_ssize_t size;
6071  switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
6072  case METH_VARARGS:
6073  if (likely(kw == NULL || PyDict_Size(kw) == 0))
6074  return (*meth)(self, arg);
6075  break;
6076  case METH_VARARGS | METH_KEYWORDS:
6077  return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
6078  case METH_NOARGS:
6079  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
6080  size = PyTuple_GET_SIZE(arg);
6081  if (likely(size == 0))
6082  return (*meth)(self, NULL);
6083  PyErr_Format(PyExc_TypeError,
6084  "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
6085  f->m_ml->ml_name, size);
6086  return NULL;
6087  }
6088  break;
6089  case METH_O:
6090  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
6091  size = PyTuple_GET_SIZE(arg);
6092  if (likely(size == 1)) {
6093  PyObject *result, *arg0;
6094  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6095  arg0 = PyTuple_GET_ITEM(arg, 0);
6096  #else
6097  arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
6098  #endif
6099  result = (*meth)(self, arg0);
6100  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
6101  Py_DECREF(arg0);
6102  #endif
6103  return result;
6104  }
6105  PyErr_Format(PyExc_TypeError,
6106  "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
6107  f->m_ml->ml_name, size);
6108  return NULL;
6109  }
6110  break;
6111  default:
6112  PyErr_SetString(PyExc_SystemError, "Bad call flags in "
6113  "__Pyx_CyFunction_Call. METH_OLDARGS is no "
6114  "longer supported!");
6115  return NULL;
6116  }
6117  PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
6118  f->m_ml->ml_name);
6119  return NULL;
6120 }
6121 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
6122  return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
6123 }
6124 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
6125  PyObject *result;
6126  __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
6127  if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
6128  Py_ssize_t argc;
6129  PyObject *new_args;
6130  PyObject *self;
6131  argc = PyTuple_GET_SIZE(args);
6132  new_args = PyTuple_GetSlice(args, 1, argc);
6133  if (unlikely(!new_args))
6134  return NULL;
6135  self = PyTuple_GetItem(args, 0);
6136  if (unlikely(!self)) {
6137  Py_DECREF(new_args);
6138  PyErr_Format(PyExc_TypeError,
6139  "unbound method %.200S() needs an argument",
6140  cyfunc->func_qualname);
6141  return NULL;
6142  }
6143  result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
6144  Py_DECREF(new_args);
6145  } else {
6146  result = __Pyx_CyFunction_Call(func, args, kw);
6147  }
6148  return result;
6149 }
6150 static PyTypeObject __pyx_CyFunctionType_type = {
6151  PyVarObject_HEAD_INIT(0, 0)
6152  "cython_function_or_method",
6153  sizeof(__pyx_CyFunctionObject),
6154  0,
6155  (destructor) __Pyx_CyFunction_dealloc,
6156  0,
6157  0,
6158  0,
6159 #if PY_MAJOR_VERSION < 3
6160  0,
6161 #else
6162  0,
6163 #endif
6164  (reprfunc) __Pyx_CyFunction_repr,
6165  0,
6166  0,
6167  0,
6168  0,
6169  __Pyx_CyFunction_CallAsMethod,
6170  0,
6171  0,
6172  0,
6173  0,
6174  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
6175  0,
6176  (traverseproc) __Pyx_CyFunction_traverse,
6177  (inquiry) __Pyx_CyFunction_clear,
6178  0,
6179 #if PY_VERSION_HEX < 0x030500A0
6180  offsetof(__pyx_CyFunctionObject, func_weakreflist),
6181 #else
6182  offsetof(PyCFunctionObject, m_weakreflist),
6183 #endif
6184  0,
6185  0,
6186  __pyx_CyFunction_methods,
6187  __pyx_CyFunction_members,
6188  __pyx_CyFunction_getsets,
6189  0,
6190  0,
6191  __Pyx_CyFunction_descr_get,
6192  0,
6193  offsetof(__pyx_CyFunctionObject, func_dict),
6194  0,
6195  0,
6196  0,
6197  0,
6198  0,
6199  0,
6200  0,
6201  0,
6202  0,
6203  0,
6204  0,
6205  0,
6206 #if PY_VERSION_HEX >= 0x030400a1
6207  0,
6208 #endif
6209 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
6210  0,
6211 #endif
6212 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
6213  0,
6214 #endif
6215 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
6216  0,
6217 #endif
6218 };
6219 static int __pyx_CyFunction_init(void) {
6220  __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
6221  if (unlikely(__pyx_CyFunctionType == NULL)) {
6222  return -1;
6223  }
6224  return 0;
6225 }
6226 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
6227  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
6228  m->defaults = PyObject_Malloc(size);
6229  if (unlikely(!m->defaults))
6230  return PyErr_NoMemory();
6231  memset(m->defaults, 0, size);
6232  m->defaults_pyobjects = pyobjects;
6233  m->defaults_size = size;
6234  return m->defaults;
6235 }
6236 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
6237  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
6238  m->defaults_tuple = tuple;
6239  Py_INCREF(tuple);
6240 }
6241 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
6242  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
6243  m->defaults_kwdict = dict;
6244  Py_INCREF(dict);
6245 }
6246 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
6247  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
6248  m->func_annotations = dict;
6249  Py_INCREF(dict);
6250 }
6251 
6252 /* CythonFunction */
6253 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
6254  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
6255  PyObject *op = __Pyx_CyFunction_Init(
6256  PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
6257  ml, flags, qualname, closure, module, globals, code
6258  );
6259  if (likely(op)) {
6260  PyObject_GC_Track(op);
6261  }
6262  return op;
6263 }
6264 
6265 /* CalculateMetaclass */
6266 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
6267  Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
6268  for (i=0; i < nbases; i++) {
6269  PyTypeObject *tmptype;
6270  PyObject *tmp = PyTuple_GET_ITEM(bases, i);
6271  tmptype = Py_TYPE(tmp);
6272 #if PY_MAJOR_VERSION < 3
6273  if (tmptype == &PyClass_Type)
6274  continue;
6275 #endif
6276  if (!metaclass) {
6277  metaclass = tmptype;
6278  continue;
6279  }
6280  if (PyType_IsSubtype(metaclass, tmptype))
6281  continue;
6282  if (PyType_IsSubtype(tmptype, metaclass)) {
6283  metaclass = tmptype;
6284  continue;
6285  }
6286  PyErr_SetString(PyExc_TypeError,
6287  "metaclass conflict: "
6288  "the metaclass of a derived class "
6289  "must be a (non-strict) subclass "
6290  "of the metaclasses of all its bases");
6291  return NULL;
6292  }
6293  if (!metaclass) {
6294 #if PY_MAJOR_VERSION < 3
6295  metaclass = &PyClass_Type;
6296 #else
6297  metaclass = &PyType_Type;
6298 #endif
6299  }
6300  Py_INCREF((PyObject*) metaclass);
6301  return (PyObject*) metaclass;
6302 }
6303 
6304 /* Py3ClassCreate */
6305 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
6306  PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
6307  PyObject *ns;
6308  if (metaclass) {
6309  PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
6310  if (prep) {
6311  PyObject *pargs = PyTuple_Pack(2, name, bases);
6312  if (unlikely(!pargs)) {
6313  Py_DECREF(prep);
6314  return NULL;
6315  }
6316  ns = PyObject_Call(prep, pargs, mkw);
6317  Py_DECREF(prep);
6318  Py_DECREF(pargs);
6319  } else {
6320  if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
6321  return NULL;
6322  PyErr_Clear();
6323  ns = PyDict_New();
6324  }
6325  } else {
6326  ns = PyDict_New();
6327  }
6328  if (unlikely(!ns))
6329  return NULL;
6330  if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
6331  if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
6332  if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
6333  return ns;
6334 bad:
6335  Py_DECREF(ns);
6336  return NULL;
6337 }
6338 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
6339  PyObject *dict, PyObject *mkw,
6340  int calculate_metaclass, int allow_py2_metaclass) {
6341  PyObject *result, *margs;
6342  PyObject *owned_metaclass = NULL;
6343  if (allow_py2_metaclass) {
6344  owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
6345  if (owned_metaclass) {
6346  metaclass = owned_metaclass;
6347  } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
6348  PyErr_Clear();
6349  } else {
6350  return NULL;
6351  }
6352  }
6353  if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
6354  metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
6355  Py_XDECREF(owned_metaclass);
6356  if (unlikely(!metaclass))
6357  return NULL;
6358  owned_metaclass = metaclass;
6359  }
6360  margs = PyTuple_Pack(3, name, bases, dict);
6361  if (unlikely(!margs)) {
6362  result = NULL;
6363  } else {
6364  result = PyObject_Call(metaclass, margs, mkw);
6365  Py_DECREF(margs);
6366  }
6367  Py_XDECREF(owned_metaclass);
6368  return result;
6369 }
6370 
6371 /* CLineInTraceback */
6372 #ifndef CYTHON_CLINE_IN_TRACEBACK
6373 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
6374  PyObject *use_cline;
6375  PyObject *ptype, *pvalue, *ptraceback;
6376 #if CYTHON_COMPILING_IN_CPYTHON
6377  PyObject **cython_runtime_dict;
6378 #endif
6379  if (unlikely(!__pyx_cython_runtime)) {
6380  return c_line;
6381  }
6382  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
6383 #if CYTHON_COMPILING_IN_CPYTHON
6384  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
6385  if (likely(cython_runtime_dict)) {
6386  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
6387  use_cline, *cython_runtime_dict,
6388  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
6389  } else
6390 #endif
6391  {
6392  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
6393  if (use_cline_obj) {
6394  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
6395  Py_DECREF(use_cline_obj);
6396  } else {
6397  PyErr_Clear();
6398  use_cline = NULL;
6399  }
6400  }
6401  if (!use_cline) {
6402  c_line = 0;
6403  (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
6404  }
6405  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
6406  c_line = 0;
6407  }
6408  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
6409  return c_line;
6410 }
6411 #endif
6412 
6413 /* CodeObjectCache */
6414 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
6415  int start = 0, mid = 0, end = count - 1;
6416  if (end >= 0 && code_line > entries[end].code_line) {
6417  return count;
6418  }
6419  while (start < end) {
6420  mid = start + (end - start) / 2;
6421  if (code_line < entries[mid].code_line) {
6422  end = mid;
6423  } else if (code_line > entries[mid].code_line) {
6424  start = mid + 1;
6425  } else {
6426  return mid;
6427  }
6428  }
6429  if (code_line <= entries[mid].code_line) {
6430  return mid;
6431  } else {
6432  return mid + 1;
6433  }
6434 }
6435 static PyCodeObject *__pyx_find_code_object(int code_line) {
6436  PyCodeObject* code_object;
6437  int pos;
6438  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
6439  return NULL;
6440  }
6441  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
6442  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
6443  return NULL;
6444  }
6445  code_object = __pyx_code_cache.entries[pos].code_object;
6446  Py_INCREF(code_object);
6447  return code_object;
6448 }
6449 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
6450  int pos, i;
6451  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
6452  if (unlikely(!code_line)) {
6453  return;
6454  }
6455  if (unlikely(!entries)) {
6456  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
6457  if (likely(entries)) {
6458  __pyx_code_cache.entries = entries;
6459  __pyx_code_cache.max_count = 64;
6460  __pyx_code_cache.count = 1;
6461  entries[0].code_line = code_line;
6462  entries[0].code_object = code_object;
6463  Py_INCREF(code_object);
6464  }
6465  return;
6466  }
6467  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
6468  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
6469  PyCodeObject* tmp = entries[pos].code_object;
6470  entries[pos].code_object = code_object;
6471  Py_DECREF(tmp);
6472  return;
6473  }
6474  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
6475  int new_max = __pyx_code_cache.max_count + 64;
6476  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
6477  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
6478  if (unlikely(!entries)) {
6479  return;
6480  }
6481  __pyx_code_cache.entries = entries;
6482  __pyx_code_cache.max_count = new_max;
6483  }
6484  for (i=__pyx_code_cache.count; i>pos; i--) {
6485  entries[i] = entries[i-1];
6486  }
6487  entries[pos].code_line = code_line;
6488  entries[pos].code_object = code_object;
6489  __pyx_code_cache.count++;
6490  Py_INCREF(code_object);
6491 }
6492 
6493 /* AddTraceback */
6494 #include "compile.h"
6495 #include "frameobject.h"
6496 #include "traceback.h"
6497 #if PY_VERSION_HEX >= 0x030b00a6
6498  #ifndef Py_BUILD_CORE
6499  #define Py_BUILD_CORE 1
6500  #endif
6501  #include "internal/pycore_frame.h"
6502 #endif
6503 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
6504  const char *funcname, int c_line,
6505  int py_line, const char *filename) {
6506  PyCodeObject *py_code = NULL;
6507  PyObject *py_funcname = NULL;
6508  #if PY_MAJOR_VERSION < 3
6509  PyObject *py_srcfile = NULL;
6510  py_srcfile = PyString_FromString(filename);
6511  if (!py_srcfile) goto bad;
6512  #endif
6513  if (c_line) {
6514  #if PY_MAJOR_VERSION < 3
6515  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
6516  if (!py_funcname) goto bad;
6517  #else
6518  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
6519  if (!py_funcname) goto bad;
6520  funcname = PyUnicode_AsUTF8(py_funcname);
6521  if (!funcname) goto bad;
6522  #endif
6523  }
6524  else {
6525  #if PY_MAJOR_VERSION < 3
6526  py_funcname = PyString_FromString(funcname);
6527  if (!py_funcname) goto bad;
6528  #endif
6529  }
6530  #if PY_MAJOR_VERSION < 3
6531  py_code = __Pyx_PyCode_New(
6532  0,
6533  0,
6534  0,
6535  0,
6536  0,
6537  __pyx_empty_bytes, /*PyObject *code,*/
6538  __pyx_empty_tuple, /*PyObject *consts,*/
6539  __pyx_empty_tuple, /*PyObject *names,*/
6540  __pyx_empty_tuple, /*PyObject *varnames,*/
6541  __pyx_empty_tuple, /*PyObject *freevars,*/
6542  __pyx_empty_tuple, /*PyObject *cellvars,*/
6543  py_srcfile, /*PyObject *filename,*/
6544  py_funcname, /*PyObject *name,*/
6545  py_line,
6546  __pyx_empty_bytes /*PyObject *lnotab*/
6547  );
6548  Py_DECREF(py_srcfile);
6549  #else
6550  py_code = PyCode_NewEmpty(filename, funcname, py_line);
6551  #endif
6552  Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
6553  return py_code;
6554 bad:
6555  Py_XDECREF(py_funcname);
6556  #if PY_MAJOR_VERSION < 3
6557  Py_XDECREF(py_srcfile);
6558  #endif
6559  return NULL;
6560 }
6561 static void __Pyx_AddTraceback(const char *funcname, int c_line,
6562  int py_line, const char *filename) {
6563  PyCodeObject *py_code = 0;
6564  PyFrameObject *py_frame = 0;
6565  PyThreadState *tstate = __Pyx_PyThreadState_Current;
6566  PyObject *ptype, *pvalue, *ptraceback;
6567  if (c_line) {
6568  c_line = __Pyx_CLineForTraceback(tstate, c_line);
6569  }
6570  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
6571  if (!py_code) {
6572  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
6573  py_code = __Pyx_CreateCodeObjectForTraceback(
6574  funcname, c_line, py_line, filename);
6575  if (!py_code) {
6576  /* If the code object creation fails, then we should clear the
6577  fetched exception references and propagate the new exception */
6578  Py_XDECREF(ptype);
6579  Py_XDECREF(pvalue);
6580  Py_XDECREF(ptraceback);
6581  goto bad;
6582  }
6583  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
6584  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
6585  }
6586  py_frame = PyFrame_New(
6587  tstate, /*PyThreadState *tstate,*/
6588  py_code, /*PyCodeObject *code,*/
6589  __pyx_d, /*PyObject *globals,*/
6590  0 /*PyObject *locals*/
6591  );
6592  if (!py_frame) goto bad;
6593  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
6594  PyTraceBack_Here(py_frame);
6595 bad:
6596  Py_XDECREF(py_code);
6597  Py_XDECREF(py_frame);
6598 }
6599 
6600 /* IntPow */
6601 static CYTHON_INLINE long __Pyx_pow_long(long b, long e) {
6602  long t = b;
6603  switch (e) {
6604  case 3:
6605  t *= b;
6606  CYTHON_FALLTHROUGH;
6607  case 2:
6608  t *= b;
6609  CYTHON_FALLTHROUGH;
6610  case 1:
6611  return t;
6612  case 0:
6613  return 1;
6614  }
6615  #if 1
6616  if (unlikely(e<0)) return 0;
6617  #endif
6618  t = 1;
6619  while (likely(e)) {
6620  t *= (b * (e&1)) | ((~e)&1);
6621  b *= b;
6622  e >>= 1;
6623  }
6624  return t;
6625 }
6626 
6627 /* CIntFromPyVerify */
6628 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
6629  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
6630 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
6631  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
6632 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
6633  {\
6634  func_type value = func_value;\
6635  if (sizeof(target_type) < sizeof(func_type)) {\
6636  if (unlikely(value != (func_type) (target_type) value)) {\
6637  func_type zero = 0;\
6638  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
6639  return (target_type) -1;\
6640  if (is_unsigned && unlikely(value < zero))\
6641  goto raise_neg_overflow;\
6642  else\
6643  goto raise_overflow;\
6644  }\
6645  }\
6646  return (target_type) value;\
6647  }
6648 
6649 /* Declarations */
6650 #if CYTHON_CCOMPLEX
6651  #ifdef __cplusplus
6652  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
6653  return ::std::complex< float >(x, y);
6654  }
6655  #else
6656  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
6657  return x + y*(__pyx_t_float_complex)_Complex_I;
6658  }
6659  #endif
6660 #else
6661  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
6662  __pyx_t_float_complex z;
6663  z.real = x;
6664  z.imag = y;
6665  return z;
6666  }
6667 #endif
6668 
6669 /* Arithmetic */
6670 #if CYTHON_CCOMPLEX
6671 #else
6672  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
6673  return (a.real == b.real) && (a.imag == b.imag);
6674  }
6675  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
6676  __pyx_t_float_complex z;
6677  z.real = a.real + b.real;
6678  z.imag = a.imag + b.imag;
6679  return z;
6680  }
6681  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
6682  __pyx_t_float_complex z;
6683  z.real = a.real - b.real;
6684  z.imag = a.imag - b.imag;
6685  return z;
6686  }
6687  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
6688  __pyx_t_float_complex z;
6689  z.real = a.real * b.real - a.imag * b.imag;
6690  z.imag = a.real * b.imag + a.imag * b.real;
6691  return z;
6692  }
6693  #if 1
6694  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
6695  if (b.imag == 0) {
6696  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
6697  } else if (fabsf(b.real) >= fabsf(b.imag)) {
6698  if (b.real == 0 && b.imag == 0) {
6699  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
6700  } else {
6701  float r = b.imag / b.real;
6702  float s = (float)(1.0) / (b.real + b.imag * r);
6703  return __pyx_t_float_complex_from_parts(
6704  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
6705  }
6706  } else {
6707  float r = b.real / b.imag;
6708  float s = (float)(1.0) / (b.imag + b.real * r);
6709  return __pyx_t_float_complex_from_parts(
6710  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
6711  }
6712  }
6713  #else
6714  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
6715  if (b.imag == 0) {
6716  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
6717  } else {
6718  float denom = b.real * b.real + b.imag * b.imag;
6719  return __pyx_t_float_complex_from_parts(
6720  (a.real * b.real + a.imag * b.imag) / denom,
6721  (a.imag * b.real - a.real * b.imag) / denom);
6722  }
6723  }
6724  #endif
6725  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
6726  __pyx_t_float_complex z;
6727  z.real = -a.real;
6728  z.imag = -a.imag;
6729  return z;
6730  }
6731  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
6732  return (a.real == 0) && (a.imag == 0);
6733  }
6734  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
6735  __pyx_t_float_complex z;
6736  z.real = a.real;
6737  z.imag = -a.imag;
6738  return z;
6739  }
6740  #if 1
6741  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
6742  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
6743  return sqrtf(z.real*z.real + z.imag*z.imag);
6744  #else
6745  return hypotf(z.real, z.imag);
6746  #endif
6747  }
6748  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
6749  __pyx_t_float_complex z;
6750  float r, lnr, theta, z_r, z_theta;
6751  if (b.imag == 0 && b.real == (int)b.real) {
6752  if (b.real < 0) {
6753  float denom = a.real * a.real + a.imag * a.imag;
6754  a.real = a.real / denom;
6755  a.imag = -a.imag / denom;
6756  b.real = -b.real;
6757  }
6758  switch ((int)b.real) {
6759  case 0:
6760  z.real = 1;
6761  z.imag = 0;
6762  return z;
6763  case 1:
6764  return a;
6765  case 2:
6766  return __Pyx_c_prod_float(a, a);
6767  case 3:
6768  z = __Pyx_c_prod_float(a, a);
6769  return __Pyx_c_prod_float(z, a);
6770  case 4:
6771  z = __Pyx_c_prod_float(a, a);
6772  return __Pyx_c_prod_float(z, z);
6773  }
6774  }
6775  if (a.imag == 0) {
6776  if (a.real == 0) {
6777  return a;
6778  } else if (b.imag == 0) {
6779  z.real = powf(a.real, b.real);
6780  z.imag = 0;
6781  return z;
6782  } else if (a.real > 0) {
6783  r = a.real;
6784  theta = 0;
6785  } else {
6786  r = -a.real;
6787  theta = atan2f(0.0, -1.0);
6788  }
6789  } else {
6790  r = __Pyx_c_abs_float(a);
6791  theta = atan2f(a.imag, a.real);
6792  }
6793  lnr = logf(r);
6794  z_r = expf(lnr * b.real - theta * b.imag);
6795  z_theta = theta * b.real + lnr * b.imag;
6796  z.real = z_r * cosf(z_theta);
6797  z.imag = z_r * sinf(z_theta);
6798  return z;
6799  }
6800  #endif
6801 #endif
6802 
6803 /* Declarations */
6804 #if CYTHON_CCOMPLEX
6805  #ifdef __cplusplus
6806  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
6807  return ::std::complex< double >(x, y);
6808  }
6809  #else
6810  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
6811  return x + y*(__pyx_t_double_complex)_Complex_I;
6812  }
6813  #endif
6814 #else
6815  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
6816  __pyx_t_double_complex z;
6817  z.real = x;
6818  z.imag = y;
6819  return z;
6820  }
6821 #endif
6822 
6823 /* Arithmetic */
6824 #if CYTHON_CCOMPLEX
6825 #else
6826  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
6827  return (a.real == b.real) && (a.imag == b.imag);
6828  }
6829  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
6830  __pyx_t_double_complex z;
6831  z.real = a.real + b.real;
6832  z.imag = a.imag + b.imag;
6833  return z;
6834  }
6835  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
6836  __pyx_t_double_complex z;
6837  z.real = a.real - b.real;
6838  z.imag = a.imag - b.imag;
6839  return z;
6840  }
6841  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
6842  __pyx_t_double_complex z;
6843  z.real = a.real * b.real - a.imag * b.imag;
6844  z.imag = a.real * b.imag + a.imag * b.real;
6845  return z;
6846  }
6847  #if 1
6848  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
6849  if (b.imag == 0) {
6850  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
6851  } else if (fabs(b.real) >= fabs(b.imag)) {
6852  if (b.real == 0 && b.imag == 0) {
6853  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
6854  } else {
6855  double r = b.imag / b.real;
6856  double s = (double)(1.0) / (b.real + b.imag * r);
6857  return __pyx_t_double_complex_from_parts(
6858  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
6859  }
6860  } else {
6861  double r = b.real / b.imag;
6862  double s = (double)(1.0) / (b.imag + b.real * r);
6863  return __pyx_t_double_complex_from_parts(
6864  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
6865  }
6866  }
6867  #else
6868  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
6869  if (b.imag == 0) {
6870  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
6871  } else {
6872  double denom = b.real * b.real + b.imag * b.imag;
6873  return __pyx_t_double_complex_from_parts(
6874  (a.real * b.real + a.imag * b.imag) / denom,
6875  (a.imag * b.real - a.real * b.imag) / denom);
6876  }
6877  }
6878  #endif
6879  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
6880  __pyx_t_double_complex z;
6881  z.real = -a.real;
6882  z.imag = -a.imag;
6883  return z;
6884  }
6885  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
6886  return (a.real == 0) && (a.imag == 0);
6887  }
6888  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
6889  __pyx_t_double_complex z;
6890  z.real = a.real;
6891  z.imag = -a.imag;
6892  return z;
6893  }
6894  #if 1
6895  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
6896  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
6897  return sqrt(z.real*z.real + z.imag*z.imag);
6898  #else
6899  return hypot(z.real, z.imag);
6900  #endif
6901  }
6902  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
6903  __pyx_t_double_complex z;
6904  double r, lnr, theta, z_r, z_theta;
6905  if (b.imag == 0 && b.real == (int)b.real) {
6906  if (b.real < 0) {
6907  double denom = a.real * a.real + a.imag * a.imag;
6908  a.real = a.real / denom;
6909  a.imag = -a.imag / denom;
6910  b.real = -b.real;
6911  }
6912  switch ((int)b.real) {
6913  case 0:
6914  z.real = 1;
6915  z.imag = 0;
6916  return z;
6917  case 1:
6918  return a;
6919  case 2:
6920  return __Pyx_c_prod_double(a, a);
6921  case 3:
6922  z = __Pyx_c_prod_double(a, a);
6923  return __Pyx_c_prod_double(z, a);
6924  case 4:
6925  z = __Pyx_c_prod_double(a, a);
6926  return __Pyx_c_prod_double(z, z);
6927  }
6928  }
6929  if (a.imag == 0) {
6930  if (a.real == 0) {
6931  return a;
6932  } else if (b.imag == 0) {
6933  z.real = pow(a.real, b.real);
6934  z.imag = 0;
6935  return z;
6936  } else if (a.real > 0) {
6937  r = a.real;
6938  theta = 0;
6939  } else {
6940  r = -a.real;
6941  theta = atan2(0.0, -1.0);
6942  }
6943  } else {
6944  r = __Pyx_c_abs_double(a);
6945  theta = atan2(a.imag, a.real);
6946  }
6947  lnr = log(r);
6948  z_r = exp(lnr * b.real - theta * b.imag);
6949  z_theta = theta * b.real + lnr * b.imag;
6950  z.real = z_r * cos(z_theta);
6951  z.imag = z_r * sin(z_theta);
6952  return z;
6953  }
6954  #endif
6955 #endif
6956 
6957 /* CIntFromPy */
6958 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
6959 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
6960 #pragma GCC diagnostic push
6961 #pragma GCC diagnostic ignored "-Wconversion"
6962 #endif
6963  const int neg_one = (int) -1, const_zero = (int) 0;
6964 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
6965 #pragma GCC diagnostic pop
6966 #endif
6967  const int is_unsigned = neg_one > const_zero;
6968 #if PY_MAJOR_VERSION < 3
6969  if (likely(PyInt_Check(x))) {
6970  if (sizeof(int) < sizeof(long)) {
6971  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
6972  } else {
6973  long val = PyInt_AS_LONG(x);
6974  if (is_unsigned && unlikely(val < 0)) {
6975  goto raise_neg_overflow;
6976  }
6977  return (int) val;
6978  }
6979  } else
6980 #endif
6981  if (likely(PyLong_Check(x))) {
6982  if (is_unsigned) {
6983 #if CYTHON_USE_PYLONG_INTERNALS
6984  const digit* digits = ((PyLongObject*)x)->ob_digit;
6985  switch (Py_SIZE(x)) {
6986  case 0: return (int) 0;
6987  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
6988  case 2:
6989  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
6990  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
6991  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
6992  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
6993  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
6994  }
6995  }
6996  break;
6997  case 3:
6998  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
6999  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
7000  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7001  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
7002  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
7003  }
7004  }
7005  break;
7006  case 4:
7007  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
7008  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
7009  __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])))
7010  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
7011  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
7012  }
7013  }
7014  break;
7015  }
7016 #endif
7017 #if CYTHON_COMPILING_IN_CPYTHON
7018  if (unlikely(Py_SIZE(x) < 0)) {
7019  goto raise_neg_overflow;
7020  }
7021 #else
7022  {
7023  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
7024  if (unlikely(result < 0))
7025  return (int) -1;
7026  if (unlikely(result == 1))
7027  goto raise_neg_overflow;
7028  }
7029 #endif
7030  if (sizeof(int) <= sizeof(unsigned long)) {
7031  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
7032 #ifdef HAVE_LONG_LONG
7033  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
7034  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
7035 #endif
7036  }
7037  } else {
7038 #if CYTHON_USE_PYLONG_INTERNALS
7039  const digit* digits = ((PyLongObject*)x)->ob_digit;
7040  switch (Py_SIZE(x)) {
7041  case 0: return (int) 0;
7042  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
7043  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
7044  case -2:
7045  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
7046  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
7047  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7048  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
7049  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
7050  }
7051  }
7052  break;
7053  case 2:
7054  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
7055  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
7056  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7057  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
7058  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
7059  }
7060  }
7061  break;
7062  case -3:
7063  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
7064  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
7065  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7066  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
7067  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
7068  }
7069  }
7070  break;
7071  case 3:
7072  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
7073  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
7074  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7075  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
7076  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
7077  }
7078  }
7079  break;
7080  case -4:
7081  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
7082  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
7083  __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])))
7084  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
7085  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
7086  }
7087  }
7088  break;
7089  case 4:
7090  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
7091  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
7092  __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])))
7093  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
7094  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
7095  }
7096  }
7097  break;
7098  }
7099 #endif
7100  if (sizeof(int) <= sizeof(long)) {
7101  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
7102 #ifdef HAVE_LONG_LONG
7103  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
7104  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
7105 #endif
7106  }
7107  }
7108  {
7109 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
7110  PyErr_SetString(PyExc_RuntimeError,
7111  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
7112 #else
7113  int val;
7114  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
7115  #if PY_MAJOR_VERSION < 3
7116  if (likely(v) && !PyLong_Check(v)) {
7117  PyObject *tmp = v;
7118  v = PyNumber_Long(tmp);
7119  Py_DECREF(tmp);
7120  }
7121  #endif
7122  if (likely(v)) {
7123  int one = 1; int is_little = (int)*(unsigned char *)&one;
7124  unsigned char *bytes = (unsigned char *)&val;
7125  int ret = _PyLong_AsByteArray((PyLongObject *)v,
7126  bytes, sizeof(val),
7127  is_little, !is_unsigned);
7128  Py_DECREF(v);
7129  if (likely(!ret))
7130  return val;
7131  }
7132 #endif
7133  return (int) -1;
7134  }
7135  } else {
7136  int val;
7137  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
7138  if (!tmp) return (int) -1;
7139  val = __Pyx_PyInt_As_int(tmp);
7140  Py_DECREF(tmp);
7141  return val;
7142  }
7143 raise_overflow:
7144  PyErr_SetString(PyExc_OverflowError,
7145  "value too large to convert to int");
7146  return (int) -1;
7147 raise_neg_overflow:
7148  PyErr_SetString(PyExc_OverflowError,
7149  "can't convert negative value to int");
7150  return (int) -1;
7151 }
7152 
7153 /* CIntToPy */
7154 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
7155 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
7156 #pragma GCC diagnostic push
7157 #pragma GCC diagnostic ignored "-Wconversion"
7158 #endif
7159  const long neg_one = (long) -1, const_zero = (long) 0;
7160 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
7161 #pragma GCC diagnostic pop
7162 #endif
7163  const int is_unsigned = neg_one > const_zero;
7164  if (is_unsigned) {
7165  if (sizeof(long) < sizeof(long)) {
7166  return PyInt_FromLong((long) value);
7167  } else if (sizeof(long) <= sizeof(unsigned long)) {
7168  return PyLong_FromUnsignedLong((unsigned long) value);
7169 #ifdef HAVE_LONG_LONG
7170  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
7171  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
7172 #endif
7173  }
7174  } else {
7175  if (sizeof(long) <= sizeof(long)) {
7176  return PyInt_FromLong((long) value);
7177 #ifdef HAVE_LONG_LONG
7178  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
7179  return PyLong_FromLongLong((PY_LONG_LONG) value);
7180 #endif
7181  }
7182  }
7183  {
7184  int one = 1; int little = (int)*(unsigned char *)&one;
7185  unsigned char *bytes = (unsigned char *)&value;
7186  return _PyLong_FromByteArray(bytes, sizeof(long),
7187  little, !is_unsigned);
7188  }
7189 }
7190 
7191 /* CIntFromPy */
7192 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
7193 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
7194 #pragma GCC diagnostic push
7195 #pragma GCC diagnostic ignored "-Wconversion"
7196 #endif
7197  const long neg_one = (long) -1, const_zero = (long) 0;
7198 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
7199 #pragma GCC diagnostic pop
7200 #endif
7201  const int is_unsigned = neg_one > const_zero;
7202 #if PY_MAJOR_VERSION < 3
7203  if (likely(PyInt_Check(x))) {
7204  if (sizeof(long) < sizeof(long)) {
7205  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
7206  } else {
7207  long val = PyInt_AS_LONG(x);
7208  if (is_unsigned && unlikely(val < 0)) {
7209  goto raise_neg_overflow;
7210  }
7211  return (long) val;
7212  }
7213  } else
7214 #endif
7215  if (likely(PyLong_Check(x))) {
7216  if (is_unsigned) {
7217 #if CYTHON_USE_PYLONG_INTERNALS
7218  const digit* digits = ((PyLongObject*)x)->ob_digit;
7219  switch (Py_SIZE(x)) {
7220  case 0: return (long) 0;
7221  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
7222  case 2:
7223  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
7224  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
7225  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7226  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
7227  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
7228  }
7229  }
7230  break;
7231  case 3:
7232  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
7233  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
7234  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7235  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
7236  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
7237  }
7238  }
7239  break;
7240  case 4:
7241  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
7242  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
7243  __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])))
7244  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
7245  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
7246  }
7247  }
7248  break;
7249  }
7250 #endif
7251 #if CYTHON_COMPILING_IN_CPYTHON
7252  if (unlikely(Py_SIZE(x) < 0)) {
7253  goto raise_neg_overflow;
7254  }
7255 #else
7256  {
7257  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
7258  if (unlikely(result < 0))
7259  return (long) -1;
7260  if (unlikely(result == 1))
7261  goto raise_neg_overflow;
7262  }
7263 #endif
7264  if (sizeof(long) <= sizeof(unsigned long)) {
7265  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
7266 #ifdef HAVE_LONG_LONG
7267  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
7268  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
7269 #endif
7270  }
7271  } else {
7272 #if CYTHON_USE_PYLONG_INTERNALS
7273  const digit* digits = ((PyLongObject*)x)->ob_digit;
7274  switch (Py_SIZE(x)) {
7275  case 0: return (long) 0;
7276  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
7277  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
7278  case -2:
7279  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
7280  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
7281  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7282  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
7283  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
7284  }
7285  }
7286  break;
7287  case 2:
7288  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
7289  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
7290  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7291  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
7292  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
7293  }
7294  }
7295  break;
7296  case -3:
7297  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
7298  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
7299  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7300  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
7301  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
7302  }
7303  }
7304  break;
7305  case 3:
7306  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
7307  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
7308  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
7309  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
7310  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
7311  }
7312  }
7313  break;
7314  case -4:
7315  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
7316  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
7317  __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])))
7318  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
7319  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
7320  }
7321  }
7322  break;
7323  case 4:
7324  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
7325  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
7326  __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])))
7327  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
7328  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
7329  }
7330  }
7331  break;
7332  }
7333 #endif
7334  if (sizeof(long) <= sizeof(long)) {
7335  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
7336 #ifdef HAVE_LONG_LONG
7337  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
7338  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
7339 #endif
7340  }
7341  }
7342  {
7343 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
7344  PyErr_SetString(PyExc_RuntimeError,
7345  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
7346 #else
7347  long val;
7348  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
7349  #if PY_MAJOR_VERSION < 3
7350  if (likely(v) && !PyLong_Check(v)) {
7351  PyObject *tmp = v;
7352  v = PyNumber_Long(tmp);
7353  Py_DECREF(tmp);
7354  }
7355  #endif
7356  if (likely(v)) {
7357  int one = 1; int is_little = (int)*(unsigned char *)&one;
7358  unsigned char *bytes = (unsigned char *)&val;
7359  int ret = _PyLong_AsByteArray((PyLongObject *)v,
7360  bytes, sizeof(val),
7361  is_little, !is_unsigned);
7362  Py_DECREF(v);
7363  if (likely(!ret))
7364  return val;
7365  }
7366 #endif
7367  return (long) -1;
7368  }
7369  } else {
7370  long val;
7371  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
7372  if (!tmp) return (long) -1;
7373  val = __Pyx_PyInt_As_long(tmp);
7374  Py_DECREF(tmp);
7375  return val;
7376  }
7377 raise_overflow:
7378  PyErr_SetString(PyExc_OverflowError,
7379  "value too large to convert to long");
7380  return (long) -1;
7381 raise_neg_overflow:
7382  PyErr_SetString(PyExc_OverflowError,
7383  "can't convert negative value to long");
7384  return (long) -1;
7385 }
7386 
7387 /* FastTypeChecks */
7388 #if CYTHON_COMPILING_IN_CPYTHON
7389 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
7390  while (a) {
7391  a = a->tp_base;
7392  if (a == b)
7393  return 1;
7394  }
7395  return b == &PyBaseObject_Type;
7396 }
7397 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
7398  PyObject *mro;
7399  if (a == b) return 1;
7400  mro = a->tp_mro;
7401  if (likely(mro)) {
7402  Py_ssize_t i, n;
7403  n = PyTuple_GET_SIZE(mro);
7404  for (i = 0; i < n; i++) {
7405  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
7406  return 1;
7407  }
7408  return 0;
7409  }
7410  return __Pyx_InBases(a, b);
7411 }
7412 #if PY_MAJOR_VERSION == 2
7413 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
7414  PyObject *exception, *value, *tb;
7415  int res;
7416  __Pyx_PyThreadState_declare
7417  __Pyx_PyThreadState_assign
7418  __Pyx_ErrFetch(&exception, &value, &tb);
7419  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
7420  if (unlikely(res == -1)) {
7421  PyErr_WriteUnraisable(err);
7422  res = 0;
7423  }
7424  if (!res) {
7425  res = PyObject_IsSubclass(err, exc_type2);
7426  if (unlikely(res == -1)) {
7427  PyErr_WriteUnraisable(err);
7428  res = 0;
7429  }
7430  }
7431  __Pyx_ErrRestore(exception, value, tb);
7432  return res;
7433 }
7434 #else
7435 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
7436  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
7437  if (!res) {
7438  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
7439  }
7440  return res;
7441 }
7442 #endif
7443 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
7444  Py_ssize_t i, n;
7445  assert(PyExceptionClass_Check(exc_type));
7446  n = PyTuple_GET_SIZE(tuple);
7447 #if PY_MAJOR_VERSION >= 3
7448  for (i=0; i<n; i++) {
7449  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
7450  }
7451 #endif
7452  for (i=0; i<n; i++) {
7453  PyObject *t = PyTuple_GET_ITEM(tuple, i);
7454  #if PY_MAJOR_VERSION < 3
7455  if (likely(exc_type == t)) return 1;
7456  #endif
7457  if (likely(PyExceptionClass_Check(t))) {
7458  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
7459  } else {
7460  }
7461  }
7462  return 0;
7463 }
7464 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
7465  if (likely(err == exc_type)) return 1;
7466  if (likely(PyExceptionClass_Check(err))) {
7467  if (likely(PyExceptionClass_Check(exc_type))) {
7468  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
7469  } else if (likely(PyTuple_Check(exc_type))) {
7470  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
7471  } else {
7472  }
7473  }
7474  return PyErr_GivenExceptionMatches(err, exc_type);
7475 }
7476 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
7477  assert(PyExceptionClass_Check(exc_type1));
7478  assert(PyExceptionClass_Check(exc_type2));
7479  if (likely(err == exc_type1 || err == exc_type2)) return 1;
7480  if (likely(PyExceptionClass_Check(err))) {
7481  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
7482  }
7483  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
7484 }
7485 #endif
7486 
7487 /* CheckBinaryVersion */
7488 static int __Pyx_check_binary_version(void) {
7489  char ctversion[5];
7490  int same=1, i, found_dot;
7491  const char* rt_from_call = Py_GetVersion();
7492  PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
7493  found_dot = 0;
7494  for (i = 0; i < 4; i++) {
7495  if (!ctversion[i]) {
7496  same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
7497  break;
7498  }
7499  if (rt_from_call[i] != ctversion[i]) {
7500  same = 0;
7501  break;
7502  }
7503  }
7504  if (!same) {
7505  char rtversion[5] = {'\0'};
7506  char message[200];
7507  for (i=0; i<4; ++i) {
7508  if (rt_from_call[i] == '.') {
7509  if (found_dot) break;
7510  found_dot = 1;
7511  } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
7512  break;
7513  }
7514  rtversion[i] = rt_from_call[i];
7515  }
7516  PyOS_snprintf(message, sizeof(message),
7517  "compiletime version %s of module '%.100s' "
7518  "does not match runtime version %s",
7519  ctversion, __Pyx_MODULE_NAME, rtversion);
7520  return PyErr_WarnEx(NULL, message, 1);
7521  }
7522  return 0;
7523 }
7524 
7525 /* InitStrings */
7526 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
7527  while (t->p) {
7528  #if PY_MAJOR_VERSION < 3
7529  if (t->is_unicode) {
7530  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
7531  } else if (t->intern) {
7532  *t->p = PyString_InternFromString(t->s);
7533  } else {
7534  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
7535  }
7536  #else
7537  if (t->is_unicode | t->is_str) {
7538  if (t->intern) {
7539  *t->p = PyUnicode_InternFromString(t->s);
7540  } else if (t->encoding) {
7541  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
7542  } else {
7543  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
7544  }
7545  } else {
7546  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
7547  }
7548  #endif
7549  if (!*t->p)
7550  return -1;
7551  if (PyObject_Hash(*t->p) == -1)
7552  return -1;
7553  ++t;
7554  }
7555  return 0;
7556 }
7557 
7558 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
7559  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
7560 }
7561 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
7562  Py_ssize_t ignore;
7563  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
7564 }
7565 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
7566 #if !CYTHON_PEP393_ENABLED
7567 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
7568  char* defenc_c;
7569  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
7570  if (!defenc) return NULL;
7571  defenc_c = PyBytes_AS_STRING(defenc);
7572 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
7573  {
7574  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
7575  char* c;
7576  for (c = defenc_c; c < end; c++) {
7577  if ((unsigned char) (*c) >= 128) {
7578  PyUnicode_AsASCIIString(o);
7579  return NULL;
7580  }
7581  }
7582  }
7583 #endif
7584  *length = PyBytes_GET_SIZE(defenc);
7585  return defenc_c;
7586 }
7587 #else
7588 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
7589  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
7590 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
7591  if (likely(PyUnicode_IS_ASCII(o))) {
7592  *length = PyUnicode_GET_LENGTH(o);
7593  return PyUnicode_AsUTF8(o);
7594  } else {
7595  PyUnicode_AsASCIIString(o);
7596  return NULL;
7597  }
7598 #else
7599  return PyUnicode_AsUTF8AndSize(o, length);
7600 #endif
7601 }
7602 #endif
7603 #endif
7604 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
7605 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
7606  if (
7607 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
7608  __Pyx_sys_getdefaultencoding_not_ascii &&
7609 #endif
7610  PyUnicode_Check(o)) {
7611  return __Pyx_PyUnicode_AsStringAndSize(o, length);
7612  } else
7613 #endif
7614 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
7615  if (PyByteArray_Check(o)) {
7616  *length = PyByteArray_GET_SIZE(o);
7617  return PyByteArray_AS_STRING(o);
7618  } else
7619 #endif
7620  {
7621  char* result;
7622  int r = PyBytes_AsStringAndSize(o, &result, length);
7623  if (unlikely(r < 0)) {
7624  return NULL;
7625  } else {
7626  return result;
7627  }
7628  }
7629 }
7630 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
7631  int is_true = x == Py_True;
7632  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
7633  else return PyObject_IsTrue(x);
7634 }
7635 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
7636  int retval;
7637  if (unlikely(!x)) return -1;
7638  retval = __Pyx_PyObject_IsTrue(x);
7639  Py_DECREF(x);
7640  return retval;
7641 }
7642 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
7643 #if PY_MAJOR_VERSION >= 3
7644  if (PyLong_Check(result)) {
7645  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
7646  "__int__ returned non-int (type %.200s). "
7647  "The ability to return an instance of a strict subclass of int "
7648  "is deprecated, and may be removed in a future version of Python.",
7649  Py_TYPE(result)->tp_name)) {
7650  Py_DECREF(result);
7651  return NULL;
7652  }
7653  return result;
7654  }
7655 #endif
7656  PyErr_Format(PyExc_TypeError,
7657  "__%.4s__ returned non-%.4s (type %.200s)",
7658  type_name, type_name, Py_TYPE(result)->tp_name);
7659  Py_DECREF(result);
7660  return NULL;
7661 }
7662 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
7663 #if CYTHON_USE_TYPE_SLOTS
7664  PyNumberMethods *m;
7665 #endif
7666  const char *name = NULL;
7667  PyObject *res = NULL;
7668 #if PY_MAJOR_VERSION < 3
7669  if (likely(PyInt_Check(x) || PyLong_Check(x)))
7670 #else
7671  if (likely(PyLong_Check(x)))
7672 #endif
7673  return __Pyx_NewRef(x);
7674 #if CYTHON_USE_TYPE_SLOTS
7675  m = Py_TYPE(x)->tp_as_number;
7676  #if PY_MAJOR_VERSION < 3
7677  if (m && m->nb_int) {
7678  name = "int";
7679  res = m->nb_int(x);
7680  }
7681  else if (m && m->nb_long) {
7682  name = "long";
7683  res = m->nb_long(x);
7684  }
7685  #else
7686  if (likely(m && m->nb_int)) {
7687  name = "int";
7688  res = m->nb_int(x);
7689  }
7690  #endif
7691 #else
7692  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
7693  res = PyNumber_Int(x);
7694  }
7695 #endif
7696  if (likely(res)) {
7697 #if PY_MAJOR_VERSION < 3
7698  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
7699 #else
7700  if (unlikely(!PyLong_CheckExact(res))) {
7701 #endif
7702  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
7703  }
7704  }
7705  else if (!PyErr_Occurred()) {
7706  PyErr_SetString(PyExc_TypeError,
7707  "an integer is required");
7708  }
7709  return res;
7710 }
7711 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
7712  Py_ssize_t ival;
7713  PyObject *x;
7714 #if PY_MAJOR_VERSION < 3
7715  if (likely(PyInt_CheckExact(b))) {
7716  if (sizeof(Py_ssize_t) >= sizeof(long))
7717  return PyInt_AS_LONG(b);
7718  else
7719  return PyInt_AsSsize_t(b);
7720  }
7721 #endif
7722  if (likely(PyLong_CheckExact(b))) {
7723  #if CYTHON_USE_PYLONG_INTERNALS
7724  const digit* digits = ((PyLongObject*)b)->ob_digit;
7725  const Py_ssize_t size = Py_SIZE(b);
7726  if (likely(__Pyx_sst_abs(size) <= 1)) {
7727  ival = likely(size) ? digits[0] : 0;
7728  if (size == -1) ival = -ival;
7729  return ival;
7730  } else {
7731  switch (size) {
7732  case 2:
7733  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
7734  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
7735  }
7736  break;
7737  case -2:
7738  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
7739  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
7740  }
7741  break;
7742  case 3:
7743  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
7744  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
7745  }
7746  break;
7747  case -3:
7748  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
7749  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
7750  }
7751  break;
7752  case 4:
7753  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
7754  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]));
7755  }
7756  break;
7757  case -4:
7758  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
7759  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]));
7760  }
7761  break;
7762  }
7763  }
7764  #endif
7765  return PyLong_AsSsize_t(b);
7766  }
7767  x = PyNumber_Index(b);
7768  if (!x) return -1;
7769  ival = PyInt_AsSsize_t(x);
7770  Py_DECREF(x);
7771  return ival;
7772 }
7773 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
7774  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
7775  return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
7776 #if PY_MAJOR_VERSION < 3
7777  } else if (likely(PyInt_CheckExact(o))) {
7778  return PyInt_AS_LONG(o);
7779 #endif
7780  } else {
7781  Py_ssize_t ival;
7782  PyObject *x;
7783  x = PyNumber_Index(o);
7784  if (!x) return -1;
7785  ival = PyInt_AsLong(x);
7786  Py_DECREF(x);
7787  return ival;
7788  }
7789 }
7790 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
7791  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
7792 }
7793 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
7794  return PyInt_FromSize_t(ival);
7795 }
7796 
7797 
7798 #endif /* Py_PYTHON_H */
dcopy_
void dcopy_(const int *N, const double *X, const int *incX, double *Y, const int *incY)
f
Double f
Definition: Headers.h:64
s
Double s
Definition: Headers.h:84
n
Int n
Definition: Headers.h:28
dgeev_
int dgeev_(char *jobvl, char *jobvr, int *n, double *a, int *lda, double *wr, double *wi, double *vl, int *ldvl, double *vr, int *ldvr, double *work, int *lwork, int *info)
dgetrf_
int dgetrf_(int *m, int *n, double *a, int *lda, int *ipiv, int *info)
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
proteus_lapack.h
dgetrs_
int dgetrs_(char *trans, int *n, int *nrhs, double *a, int *lda, int *ipiv, double *b, int *ldb, int *info)
r
Double r
Definition: Headers.h:83
pos
double pos(double a)
Definition: testFMMandFSW.cpp:8
proteus_blas.h