3 #ifndef PY_SSIZE_T_CLEAN
4 #define PY_SSIZE_T_CLEAN
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+.
12 #define CYTHON_ABI "0_29_30"
13 #define CYTHON_HEX_VERSION 0x001D1EF0
14 #define CYTHON_FUTURE_DIVISION 0
17 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
19 #if !defined(WIN32) && !defined(MS_WINDOWS)
31 #define DL_IMPORT(t) t
34 #define DL_EXPORT(t) t
37 #ifndef HAVE_LONG_LONG
38 #if PY_VERSION_HEX >= 0x02070000
39 #define HAVE_LONG_LONG
43 #define PY_LONG_LONG LONG_LONG
46 #define Py_HUGE_VAL HUGE_VAL
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
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)
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
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
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
114 #ifndef CYTHON_ASSUME_SAFE_MACROS
115 #define CYTHON_ASSUME_SAFE_MACROS 1
117 #ifndef CYTHON_UNPACK_METHODS
118 #define CYTHON_UNPACK_METHODS 1
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
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
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
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
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
160 #ifndef CYTHON_USE_PYLIST_INTERNALS
161 #define CYTHON_USE_PYLIST_INTERNALS 1
163 #ifndef CYTHON_USE_UNICODE_INTERNALS
164 #define CYTHON_USE_UNICODE_INTERNALS 1
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
172 #ifndef CYTHON_AVOID_BORROWED_REFS
173 #define CYTHON_AVOID_BORROWED_REFS 0
175 #ifndef CYTHON_ASSUME_SAFE_MACROS
176 #define CYTHON_ASSUME_SAFE_MACROS 1
178 #ifndef CYTHON_UNPACK_METHODS
179 #define CYTHON_UNPACK_METHODS 1
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
187 #ifndef CYTHON_FAST_PYCALL
188 #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
190 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
191 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
193 #ifndef CYTHON_USE_TP_FINALIZE
194 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
196 #ifndef CYTHON_USE_DICT_VERSIONS
197 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
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)
205 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
206 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
209 #if !defined(CYTHON_FAST_PYCCALL)
210 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
212 #if CYTHON_USE_PYLONG_INTERNALS
213 #if PY_MAJOR_VERSION < 3
214 #include "longintrepr.h"
220 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
223 #ifndef __has_attribute
224 #define __has_attribute(x) 0
226 #ifndef __has_cpp_attribute
227 #define __has_cpp_attribute(x) 0
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
237 #define CYTHON_RESTRICT
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__))
245 # define CYTHON_UNUSED
247 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
248 # define CYTHON_UNUSED __attribute__ ((__unused__))
250 # define CYTHON_UNUSED
253 #ifndef CYTHON_MAYBE_UNUSED_VAR
254 # if defined(__cplusplus)
255 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
257 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
260 #ifndef CYTHON_NCP_UNUSED
261 # if CYTHON_COMPILING_IN_CPYTHON
262 # define CYTHON_NCP_UNUSED
264 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
267 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
269 #ifndef _MSC_STDINT_H_
271 typedef unsigned char uint8_t;
272 typedef unsigned int uint32_t;
274 typedef unsigned __int8 uint8_t;
275 typedef unsigned __int32 uint32_t;
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]]
291 #ifndef CYTHON_FALLTHROUGH
292 #if __has_attribute(fallthrough)
293 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
295 #define CYTHON_FALLTHROUGH
298 #if defined(__clang__ ) && defined(__apple_build_version__)
299 #if __apple_build_version__ < 7000000
300 #undef CYTHON_FALLTHROUGH
301 #define CYTHON_FALLTHROUGH
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
316 #define CYTHON_INLINE
320 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
321 #define Py_OptimizeFlag 0
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
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;
370 if (!(call_result = PyObject_Call(replace, empty, kwds)))
goto cleanup_code_too;
371 Py_XDECREF((PyObject*)co);
372 co = (PyCodeObject*)call_result;
376 Py_XDECREF((PyObject*)co);
381 Py_XDECREF(argcount);
382 Py_XDECREF(posonlyargcount);
383 Py_XDECREF(kwonlyargcount);
385 Py_XDECREF(stacksize);
387 Py_XDECREF(call_result);
390 PyErr_Restore(type, value, traceback);
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)
398 #define __Pyx_DefaultClassType PyType_Type
400 #ifndef Py_TPFLAGS_CHECKTYPES
401 #define Py_TPFLAGS_CHECKTYPES 0
403 #ifndef Py_TPFLAGS_HAVE_INDEX
404 #define Py_TPFLAGS_HAVE_INDEX 0
406 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
407 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
409 #ifndef Py_TPFLAGS_HAVE_FINALIZE
410 #define Py_TPFLAGS_HAVE_FINALIZE 0
412 #ifndef METH_STACKLESS
413 #define METH_STACKLESS 0
415 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
416 #ifndef METH_FASTCALL
417 #define METH_FASTCALL 0x80
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);
423 #define __Pyx_PyCFunctionFast _PyCFunctionFast
424 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
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)))))
430 #define __Pyx_PyFastCFunction_Check(func) 0
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)
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)
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)
446 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
447 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
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()
456 #define __Pyx_PyThreadState_Current _PyThreadState_Current
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();
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;
471 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
474 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
475 return *key != Py_tss_NEEDS_INIT;
477 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
478 PyThread_delete_key(*key);
479 *key = Py_tss_NEEDS_INIT;
481 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
482 return PyThread_set_key_value(*key, value);
484 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
485 return PyThread_get_key_value(*key);
488 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
489 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
491 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
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)
497 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
498 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
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)
503 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
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)))
511 #define __Pyx_PyUnicode_READY(op) (0)
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))
524 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
527 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
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))
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)
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))
552 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
553 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
555 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
556 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
558 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
559 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
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)
566 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
568 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
569 #define PyObject_ASCII(o) PyObject_Repr(o)
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
581 #if PY_MAJOR_VERSION >= 3
582 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
583 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
585 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
586 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
588 #ifndef PySet_CheckExact
589 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
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)
595 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
596 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
598 #if CYTHON_ASSUME_SAFE_MACROS
599 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
601 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
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
620 #if PY_MAJOR_VERSION >= 3
621 #define PyBoolObject PyLongObject
623 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
624 #ifndef PyUnicode_InternFromString
625 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
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
633 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
634 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
636 #if PY_MAJOR_VERSION >= 3
637 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
639 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
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)
646 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
649 #define __Pyx_PyType_AsAsync(obj) NULL
651 #ifndef __Pyx_PyAsyncMethodsStruct
656 } __Pyx_PyAsyncMethodsStruct;
659 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
660 #if !defined(_USE_MATH_DEFINES)
661 #define _USE_MATH_DEFINES
666 #define __PYX_NAN() ((float) NAN)
668 static CYTHON_INLINE
float __PYX_NAN() {
670 memset(&value, 0xFF,
sizeof(value));
674 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
675 #define __Pyx_truncl trunc
677 #define __Pyx_truncl truncl
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; }
685 #ifndef __PYX_EXTERN_C
687 #define __PYX_EXTERN_C extern "C"
689 #define __PYX_EXTERN_C extern
693 #define __PYX_HAVE__csmoothers
694 #define __PYX_HAVE_API__csmoothers
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"
708 #include "pythread.h"
715 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
716 #define CYTHON_WITHOUT_ASSERTIONS
719 typedef struct {PyObject **p;
const char *
s;
const Py_ssize_t
n;
const char* encoding;
720 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
722 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
723 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
724 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
725 #define __PYX_DEFAULT_STRING_ENCODING ""
726 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
727 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
728 #define __Pyx_uchar_cast(c) ((unsigned char)c)
729 #define __Pyx_long_cast(x) ((long)x)
730 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
731 (sizeof(type) < sizeof(Py_ssize_t)) ||\
732 (sizeof(type) > sizeof(Py_ssize_t) &&\
733 likely(v < (type)PY_SSIZE_T_MAX ||\
734 v == (type)PY_SSIZE_T_MAX) &&\
735 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
736 v == (type)PY_SSIZE_T_MIN))) ||\
737 (sizeof(type) == sizeof(Py_ssize_t) &&\
738 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
739 v == (type)PY_SSIZE_T_MAX))) )
740 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
741 return (
size_t) i < (size_t) limit;
743 #if defined (__cplusplus) && __cplusplus >= 201103L
745 #define __Pyx_sst_abs(value) std::abs(value)
746 #elif SIZEOF_INT >= SIZEOF_SIZE_T
747 #define __Pyx_sst_abs(value) abs(value)
748 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
749 #define __Pyx_sst_abs(value) labs(value)
750 #elif defined (_MSC_VER)
751 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
752 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
753 #define __Pyx_sst_abs(value) llabs(value)
754 #elif defined (__GNUC__)
755 #define __Pyx_sst_abs(value) __builtin_llabs(value)
757 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
759 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
760 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
761 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
762 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
763 #define __Pyx_PyBytes_FromString PyBytes_FromString
764 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
765 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
766 #if PY_MAJOR_VERSION < 3
767 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
768 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
770 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
771 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
773 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
774 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
775 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
776 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
777 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
778 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
779 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
780 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
781 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
782 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
783 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
784 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
785 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
786 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
787 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
788 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
789 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *
u) {
790 const Py_UNICODE *u_end =
u;
792 return (
size_t)(u_end -
u - 1);
794 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
795 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
796 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
797 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
798 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
799 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
800 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
801 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
802 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
803 #define __Pyx_PySequence_Tuple(obj)\
804 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
805 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
806 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
807 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
808 #if CYTHON_ASSUME_SAFE_MACROS
809 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
811 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
813 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
814 #if PY_MAJOR_VERSION >= 3
815 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
817 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
819 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
820 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
821 static int __Pyx_sys_getdefaultencoding_not_ascii;
822 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
824 PyObject* default_encoding = NULL;
825 PyObject* ascii_chars_u = NULL;
826 PyObject* ascii_chars_b = NULL;
827 const char* default_encoding_c;
828 sys = PyImport_ImportModule(
"sys");
830 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
832 if (!default_encoding)
goto bad;
833 default_encoding_c = PyBytes_AsString(default_encoding);
834 if (!default_encoding_c)
goto bad;
835 if (strcmp(default_encoding_c,
"ascii") == 0) {
836 __Pyx_sys_getdefaultencoding_not_ascii = 0;
838 char ascii_chars[128];
840 for (
c = 0;
c < 128;
c++) {
843 __Pyx_sys_getdefaultencoding_not_ascii = 1;
844 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
845 if (!ascii_chars_u)
goto bad;
846 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
847 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
850 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
854 Py_DECREF(ascii_chars_u);
855 Py_DECREF(ascii_chars_b);
857 Py_DECREF(default_encoding);
860 Py_XDECREF(default_encoding);
861 Py_XDECREF(ascii_chars_u);
862 Py_XDECREF(ascii_chars_b);
866 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
867 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
869 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
870 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
871 static char* __PYX_DEFAULT_STRING_ENCODING;
872 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
874 PyObject* default_encoding = NULL;
875 char* default_encoding_c;
876 sys = PyImport_ImportModule(
"sys");
878 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
880 if (!default_encoding)
goto bad;
881 default_encoding_c = PyBytes_AsString(default_encoding);
882 if (!default_encoding_c)
goto bad;
883 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
884 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
885 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
886 Py_DECREF(default_encoding);
889 Py_XDECREF(default_encoding);
897 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
898 #define likely(x) __builtin_expect(!!(x), 1)
899 #define unlikely(x) __builtin_expect(!!(x), 0)
901 #define likely(x) (x)
902 #define unlikely(x) (x)
904 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
906 static PyObject *__pyx_m = NULL;
907 static PyObject *__pyx_d;
908 static PyObject *__pyx_b;
909 static PyObject *__pyx_cython_runtime = NULL;
910 static PyObject *__pyx_empty_tuple;
911 static PyObject *__pyx_empty_bytes;
912 static PyObject *__pyx_empty_unicode;
913 static int __pyx_lineno;
914 static int __pyx_clineno = 0;
915 static const char * __pyx_cfilenm= __FILE__;
916 static const char *__pyx_filename;
919 #if !defined(CYTHON_CCOMPLEX)
920 #if defined(__cplusplus)
921 #define CYTHON_CCOMPLEX 1
922 #elif defined(_Complex_I)
923 #define CYTHON_CCOMPLEX 1
925 #define CYTHON_CCOMPLEX 0
935 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
937 #define _Complex_I 1.0fj
941 static const char *__pyx_f[] = {
942 "proteus/csmoothers.pyx",
946 "proteus/superluWrappers.pxd",
949 struct __pyx_memoryview_obj;
951 struct __pyx_memoryview_obj *memview;
954 Py_ssize_t strides[8];
955 Py_ssize_t suboffsets[8];
956 } __Pyx_memviewslice;
957 #define __Pyx_MemoryView_Len(m) (m.shape[0])
960 #include <pythread.h>
961 #ifndef CYTHON_ATOMICS
962 #define CYTHON_ATOMICS 1
964 #define __pyx_atomic_int_type int
965 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
966 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
968 #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
969 #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
970 #ifdef __PYX_DEBUG_ATOMICS
971 #warning "Using GNU atomics"
973 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
975 #undef __pyx_atomic_int_type
976 #define __pyx_atomic_int_type LONG
977 #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
978 #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
979 #ifdef __PYX_DEBUG_ATOMICS
980 #pragma message ("Using MSVC atomics")
982 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
983 #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
984 #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
985 #ifdef __PYX_DEBUG_ATOMICS
986 #warning "Using Intel atomics"
989 #undef CYTHON_ATOMICS
990 #define CYTHON_ATOMICS 0
991 #ifdef __PYX_DEBUG_ATOMICS
992 #warning "Not using atomics"
995 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
997 #define __pyx_add_acquisition_count(memview)\
998 __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
999 #define __pyx_sub_acquisition_count(memview)\
1000 __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1002 #define __pyx_add_acquisition_count(memview)\
1003 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1004 #define __pyx_sub_acquisition_count(memview)\
1005 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1009 #ifndef __PYX_FORCE_INIT_THREADS
1010 #define __PYX_FORCE_INIT_THREADS 0
1014 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1015 #define __Pyx_PyGILState_Release PyGILState_Release
1016 #define __Pyx_FastGIL_Remember()
1017 #define __Pyx_FastGIL_Forget()
1018 #define __Pyx_FastGilFuncInit()
1021 #define IS_UNSIGNED(type) (((type) -1) > 0)
1022 struct __Pyx_StructField_;
1023 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1026 struct __Pyx_StructField_* fields;
1028 size_t arraysize[8];
1034 typedef struct __Pyx_StructField_ {
1035 __Pyx_TypeInfo* type;
1038 } __Pyx_StructField;
1040 __Pyx_StructField* field;
1041 size_t parent_offset;
1042 } __Pyx_BufFmt_StackElem;
1044 __Pyx_StructField root;
1045 __Pyx_BufFmt_StackElem* head;
1047 size_t new_count, enc_count;
1048 size_t struct_alignment;
1053 char is_valid_array;
1054 } __Pyx_BufFmt_Context;
1064 typedef npy_int8 __pyx_t_5numpy_int8_t;
1073 typedef npy_int16 __pyx_t_5numpy_int16_t;
1082 typedef npy_int32 __pyx_t_5numpy_int32_t;
1091 typedef npy_int64 __pyx_t_5numpy_int64_t;
1100 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1109 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1118 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1127 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1136 typedef npy_float32 __pyx_t_5numpy_float32_t;
1145 typedef npy_float64 __pyx_t_5numpy_float64_t;
1154 typedef npy_long __pyx_t_5numpy_int_t;
1163 typedef npy_longlong __pyx_t_5numpy_long_t;
1172 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1181 typedef npy_ulong __pyx_t_5numpy_uint_t;
1190 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1199 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1208 typedef npy_intp __pyx_t_5numpy_intp_t;
1217 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1226 typedef npy_double __pyx_t_5numpy_float_t;
1235 typedef npy_double __pyx_t_5numpy_double_t;
1244 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1253 typedef int __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER;
1257 typedef ::std::complex< float > __pyx_t_float_complex;
1259 typedef float _Complex __pyx_t_float_complex;
1262 typedef struct {
float real, imag; } __pyx_t_float_complex;
1264 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1269 typedef ::std::complex< double > __pyx_t_double_complex;
1271 typedef double _Complex __pyx_t_double_complex;
1274 typedef struct {
double real, imag; } __pyx_t_double_complex;
1276 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1280 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix;
1281 struct __pyx_obj_10csmoothers_cASMFactor;
1282 struct __pyx_obj_10csmoothers_cBASMFactor;
1283 struct __pyx_array_obj;
1284 struct __pyx_MemviewEnum_obj;
1285 struct __pyx_memoryview_obj;
1286 struct __pyx_memoryviewslice_obj;
1295 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1304 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1313 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1322 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1323 struct __pyx_t_7proteus_15superluWrappers__NRformat;
1332 struct __pyx_t_7proteus_15superluWrappers__NRformat {
1333 __pyx_t_5numpy_int32_t
nnz;
1334 __pyx_t_5numpy_float64_t *nzval;
1335 __pyx_t_5numpy_int32_t *colind;
1336 __pyx_t_5numpy_int32_t *rowptr;
1346 typedef __Pyx_memviewslice __pyx_t_10csmoothers_DDATA;
1355 typedef __Pyx_memviewslice __pyx_t_10csmoothers_IDATA;
1364 typedef SuperMatrix __pyx_t_10csmoothers_SuperMatrix;
1373 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix {
1375 __pyx_t_5numpy_int32_t dim[2];
1376 struct __pyx_t_7proteus_15superluWrappers__NRformat A;
1387 struct __pyx_obj_10csmoothers_cASMFactor {
1392 double **subdomain_L;
1393 double **subdomain_R;
1394 double **subdomain_dX;
1395 __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_pivots;
1406 struct __pyx_obj_10csmoothers_cBASMFactor {
1412 double **subdomain_L;
1413 double **subdomain_R;
1414 double **subdomain_dX;
1415 __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_pivots;
1416 __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_col_pivots;
1427 struct __pyx_array_obj {
1429 struct __pyx_vtabstruct_array *__pyx_vtab;
1435 Py_ssize_t *_strides;
1436 Py_ssize_t itemsize;
1439 void (*callback_free_data)(
void *);
1441 int dtype_is_object;
1452 struct __pyx_MemviewEnum_obj {
1465 struct __pyx_memoryview_obj {
1467 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1470 PyObject *_array_interface;
1471 PyThread_type_lock lock;
1472 __pyx_atomic_int acquisition_count[2];
1473 __pyx_atomic_int *acquisition_count_aligned_p;
1476 int dtype_is_object;
1477 __Pyx_TypeInfo *typeinfo;
1488 struct __pyx_memoryviewslice_obj {
1489 struct __pyx_memoryview_obj __pyx_base;
1490 __Pyx_memviewslice from_slice;
1491 PyObject *from_object;
1492 PyObject *(*to_object_func)(
char *);
1493 int (*to_dtype_func)(
char *, PyObject *);
1506 struct __pyx_vtabstruct_array {
1507 PyObject *(*get_memview)(
struct __pyx_array_obj *);
1509 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1520 struct __pyx_vtabstruct_memoryview {
1521 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
1522 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
1523 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1524 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
1525 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1526 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
1527 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
1529 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1540 struct __pyx_vtabstruct__memoryviewslice {
1541 struct __pyx_vtabstruct_memoryview __pyx_base;
1543 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1547 #ifndef CYTHON_REFNANNY
1548 #define CYTHON_REFNANNY 0
1552 void (*INCREF)(
void*, PyObject*, int);
1553 void (*DECREF)(
void*, PyObject*, int);
1554 void (*GOTREF)(
void*, PyObject*, int);
1555 void (*GIVEREF)(
void*, PyObject*, int);
1556 void* (*SetupContext)(
const char*, int,
const char*);
1557 void (*FinishContext)(
void**);
1558 } __Pyx_RefNannyAPIStruct;
1559 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1560 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1561 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1563 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1565 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1566 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1567 PyGILState_Release(__pyx_gilstate_save);\
1569 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1572 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1573 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1575 #define __Pyx_RefNannyFinishContext()\
1576 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1577 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1578 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1579 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1580 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1581 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1582 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1583 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1584 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1586 #define __Pyx_RefNannyDeclarations
1587 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1588 #define __Pyx_RefNannyFinishContext()
1589 #define __Pyx_INCREF(r) Py_INCREF(r)
1590 #define __Pyx_DECREF(r) Py_DECREF(r)
1591 #define __Pyx_GOTREF(r)
1592 #define __Pyx_GIVEREF(r)
1593 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1594 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1595 #define __Pyx_XGOTREF(r)
1596 #define __Pyx_XGIVEREF(r)
1598 #define __Pyx_XDECREF_SET(r, v) do {\
1599 PyObject *tmp = (PyObject *) r;\
1600 r = v; __Pyx_XDECREF(tmp);\
1602 #define __Pyx_DECREF_SET(r, v) do {\
1603 PyObject *tmp = (PyObject *) r;\
1604 r = v; __Pyx_DECREF(tmp);\
1606 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1607 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1610 #if CYTHON_USE_TYPE_SLOTS
1611 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1613 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1617 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1620 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1621 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1624 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1627 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1628 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1629 const char* function_name);
1632 #if CYTHON_USE_TYPE_SLOTS
1633 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1634 static CYTHON_INLINE
int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1636 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1637 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1641 #if CYTHON_FAST_PYCCALL
1642 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1644 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1648 #if CYTHON_FAST_PYCALL
1649 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1650 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1651 #if 1 || PY_VERSION_HEX < 0x030600B1
1652 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1654 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1656 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1657 (sizeof(char [1 - 2*!(cond)]) - 1)
1658 #ifndef Py_MEMBER_SIZE
1659 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1661 #if CYTHON_FAST_PYCALL
1662 static size_t __pyx_pyframe_localsplus_offset = 0;
1663 #include "frameobject.h"
1664 #if PY_VERSION_HEX >= 0x030b00a6
1665 #ifndef Py_BUILD_CORE
1666 #define Py_BUILD_CORE 1
1668 #include "internal/pycore_frame.h"
1670 #define __Pxy_PyFrame_Initialize_Offsets()\
1671 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1672 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1673 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1674 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1675 #endif // CYTHON_FAST_PYCALL
1679 #if CYTHON_COMPILING_IN_CPYTHON
1680 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1682 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1686 #if CYTHON_COMPILING_IN_CPYTHON
1687 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1691 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1694 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1695 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1696 __Pyx__ArgTypeTest(obj, type, name, exact))
1697 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
1700 #if CYTHON_FAST_THREAD_STATE
1701 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1702 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1703 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1705 #define __Pyx_PyThreadState_declare
1706 #define __Pyx_PyThreadState_assign
1707 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1711 #if CYTHON_FAST_THREAD_STATE
1712 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1713 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1714 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1715 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1716 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1717 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1718 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1719 #if CYTHON_COMPILING_IN_CPYTHON
1720 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1722 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1725 #define __Pyx_PyErr_Clear() PyErr_Clear()
1726 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1727 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1728 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1729 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1730 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1731 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1732 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1736 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1739 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1742 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1743 #define __Pyx_MEMVIEW_DIRECT 1
1744 #define __Pyx_MEMVIEW_PTR 2
1745 #define __Pyx_MEMVIEW_FULL 4
1746 #define __Pyx_MEMVIEW_CONTIG 8
1747 #define __Pyx_MEMVIEW_STRIDED 16
1748 #define __Pyx_MEMVIEW_FOLLOW 32
1749 #define __Pyx_IS_C_CONTIG 1
1750 #define __Pyx_IS_F_CONTIG 2
1751 static int __Pyx_init_memviewslice(
1752 struct __pyx_memoryview_obj *memview,
1754 __Pyx_memviewslice *memviewslice,
1755 int memview_is_new_reference);
1756 static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
1757 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1758 static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
1759 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1760 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1761 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1762 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1763 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1764 static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1765 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1768 static void __Pyx_RaiseBufferIndexError(
int axis);
1771 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1772 int lineno,
const char *filename,
1773 int full_traceback,
int nogil);
1776 #if CYTHON_USE_EXC_INFO_STACK
1777 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1781 #if CYTHON_FAST_THREAD_STATE
1782 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1783 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1784 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1785 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1787 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1788 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1792 #if CYTHON_FAST_THREAD_STATE
1793 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1794 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1796 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1800 #if CYTHON_FAST_THREAD_STATE
1801 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1802 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1804 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1808 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1814 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1817 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1820 #if PY_MAJOR_VERSION >= 3
1821 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1823 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1827 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1830 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1831 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1833 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1834 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
1836 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1839 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1840 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1841 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1842 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1843 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1844 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1845 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1846 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1847 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1848 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1849 int wraparound,
int boundscheck);
1850 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1851 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1852 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1853 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1854 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1855 int wraparound,
int boundscheck);
1856 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1857 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1858 int is_list,
int wraparound,
int boundscheck);
1861 #if CYTHON_USE_TYPE_SLOTS
1862 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1864 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1868 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *
s, Py_ssize_t size,
const char *errors) {
1870 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1872 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *
s, Py_ssize_t size,
const char *errors) {
1874 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1876 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *
s, Py_ssize_t size,
const char *errors) {
1878 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1882 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1883 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1884 const char* encoding,
const char* errors,
1885 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors));
1888 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1891 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1892 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1893 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1894 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1895 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1896 (cache_var) = (value);
1897 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1898 static PY_UINT64_T __pyx_dict_version = 0;\
1899 static PyObject *__pyx_dict_cached_value = NULL;\
1900 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1901 (VAR) = __pyx_dict_cached_value;\
1903 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1904 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1907 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1908 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1909 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1911 #define __PYX_GET_DICT_VERSION(dict) (0)
1912 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1913 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1917 #if CYTHON_USE_DICT_VERSIONS
1918 #define __Pyx_GetModuleGlobalName(var, name) {\
1919 static PY_UINT64_T __pyx_dict_version = 0;\
1920 static PyObject *__pyx_dict_cached_value = NULL;\
1921 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1922 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1923 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1925 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1926 PY_UINT64_T __pyx_dict_version;\
1927 PyObject *__pyx_dict_cached_value;\
1928 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1930 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1932 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1933 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1934 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1938 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1941 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1944 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
1947 #if CYTHON_FAST_THREAD_STATE
1948 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1949 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1951 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1955 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1958 #if CYTHON_COMPILING_IN_CPYTHON
1959 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1960 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1961 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1962 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1964 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1965 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1966 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1968 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1970 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1972 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1973 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1974 PyListObject*
L = (PyListObject*) list;
1975 Py_ssize_t len = Py_SIZE(list);
1976 if (likely(
L->allocated > len)) {
1978 PyList_SET_ITEM(list, len, x);
1979 __Pyx_SET_SIZE(list, len + 1);
1982 return PyList_Append(list, x);
1985 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1989 #if !CYTHON_COMPILING_IN_PYPY
1990 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
1992 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1993 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1997 static CYTHON_INLINE
int __Pyx_PyList_Extend(PyObject*
L, PyObject*
v) {
1998 #if CYTHON_COMPILING_IN_CPYTHON
1999 PyObject* none = _PyList_Extend((PyListObject*)
L,
v);
2000 if (unlikely(!none))
2005 return PyList_SetSlice(
L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX,
v);
2010 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2011 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2012 PyListObject*
L = (PyListObject*) list;
2013 Py_ssize_t len = Py_SIZE(list);
2014 if (likely(
L->allocated > len) & likely(len > (
L->allocated >> 1))) {
2016 PyList_SET_ITEM(list, len, x);
2017 __Pyx_SET_SIZE(list, len + 1);
2020 return PyList_Append(list, x);
2023 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2027 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
2030 static CYTHON_INLINE
long __Pyx_div_long(
long,
long);
2033 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
2034 int result = PySequence_Contains(seq, item);
2035 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2039 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2042 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
2045 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2046 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2048 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2052 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2053 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2055 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2059 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2062 static int __Pyx_setup_reduce(PyObject* type_obj);
2065 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
2068 #ifndef __PYX_HAVE_RT_ImportType_proto
2069 #define __PYX_HAVE_RT_ImportType_proto
2070 enum __Pyx_ImportType_CheckSize {
2071 __Pyx_ImportType_CheckSize_Error = 0,
2072 __Pyx_ImportType_CheckSize_Warn = 1,
2073 __Pyx_ImportType_CheckSize_Ignore = 2
2075 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
2079 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
2082 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2085 #define __Pyx_CyFunction_USED 1
2086 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2087 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2088 #define __Pyx_CYFUNCTION_CCLASS 0x04
2089 #define __Pyx_CyFunction_GetClosure(f)\
2090 (((__pyx_CyFunctionObject *) (f))->func_closure)
2091 #define __Pyx_CyFunction_GetClassObj(f)\
2092 (((__pyx_CyFunctionObject *) (f))->func_classobj)
2093 #define __Pyx_CyFunction_Defaults(type, f)\
2094 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2095 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2096 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2098 PyCFunctionObject func;
2099 #if PY_VERSION_HEX < 0x030500A0
2100 PyObject *func_weakreflist;
2102 PyObject *func_dict;
2103 PyObject *func_name;
2104 PyObject *func_qualname;
2106 PyObject *func_globals;
2107 PyObject *func_code;
2108 PyObject *func_closure;
2109 PyObject *func_classobj;
2111 int defaults_pyobjects;
2112 size_t defaults_size;
2114 PyObject *defaults_tuple;
2115 PyObject *defaults_kwdict;
2116 PyObject *(*defaults_getter)(PyObject *);
2117 PyObject *func_annotations;
2118 } __pyx_CyFunctionObject;
2119 static PyTypeObject *__pyx_CyFunctionType = 0;
2120 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2121 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2122 int flags, PyObject* qualname,
2124 PyObject *module, PyObject *globals,
2126 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2129 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2131 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2133 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2135 static int __pyx_CyFunction_init(
void);
2138 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2139 int flags, PyObject* qualname,
2141 PyObject *module, PyObject *globals,
2145 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
2146 #define __Pyx_SetNameInClass(ns, name, value)\
2147 (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
2148 #elif CYTHON_COMPILING_IN_CPYTHON
2149 #define __Pyx_SetNameInClass(ns, name, value)\
2150 (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
2152 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
2156 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
2157 PyObject *mkw, PyObject *modname, PyObject *doc);
2158 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
2159 PyObject *mkw,
int calculate_metaclass,
int allow_py2_metaclass);
2162 #ifdef CYTHON_CLINE_IN_TRACEBACK
2163 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2165 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
2170 PyCodeObject* code_object;
2172 } __Pyx_CodeObjectCacheEntry;
2173 struct __Pyx_CodeObjectCache {
2176 __Pyx_CodeObjectCacheEntry* entries;
2178 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2179 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
2180 static PyCodeObject *__pyx_find_code_object(
int code_line);
2181 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
2184 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
2185 int py_line,
const char *filename);
2187 #if PY_MAJOR_VERSION < 3
2188 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
2189 static void __Pyx_ReleaseBuffer(Py_buffer *view);
2191 #define __Pyx_GetBuffer PyObject_GetBuffer
2192 #define __Pyx_ReleaseBuffer PyBuffer_Release
2198 Py_ssize_t shape, strides, suboffsets;
2199 } __Pyx_Buf_DimInfo;
2205 __Pyx_Buffer *rcbuffer;
2207 __Pyx_Buf_DimInfo diminfo[8];
2208 } __Pyx_LocalBuf_ND;
2211 static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
2214 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2215 __Pyx_memviewslice *slice2,
2216 int ndim,
size_t itemsize);
2219 static CYTHON_INLINE PyObject *__pyx_capsule_create(
void *p,
const char *sig);
2222 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2223 #define __Pyx_HAS_GCC_DIAGNOSTIC
2227 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
2230 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
2231 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2232 __Pyx_BufFmt_StackElem* stack,
2233 __Pyx_TypeInfo* type);
2236 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2239 static int __Pyx_ValidateAndInit_memviewslice(
2244 __Pyx_TypeInfo *dtype,
2245 __Pyx_BufFmt_StackElem stack[],
2246 __Pyx_memviewslice *memviewslice,
2247 PyObject *original_obj);
2250 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *,
int writable_flag);
2253 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *,
int writable_flag);
2258 #define __Pyx_CREAL(z) ((z).real())
2259 #define __Pyx_CIMAG(z) ((z).imag())
2261 #define __Pyx_CREAL(z) (__real__(z))
2262 #define __Pyx_CIMAG(z) (__imag__(z))
2265 #define __Pyx_CREAL(z) ((z).real)
2266 #define __Pyx_CIMAG(z) ((z).imag)
2268 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2269 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2270 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2271 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2273 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2274 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2279 #define __Pyx_c_eq_float(a, b) ((a)==(b))
2280 #define __Pyx_c_sum_float(a, b) ((a)+(b))
2281 #define __Pyx_c_diff_float(a, b) ((a)-(b))
2282 #define __Pyx_c_prod_float(a, b) ((a)*(b))
2283 #define __Pyx_c_quot_float(a, b) ((a)/(b))
2284 #define __Pyx_c_neg_float(a) (-(a))
2286 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2287 #define __Pyx_c_conj_float(z) (::std::conj(z))
2289 #define __Pyx_c_abs_float(z) (::std::abs(z))
2290 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2293 #define __Pyx_c_is_zero_float(z) ((z)==0)
2294 #define __Pyx_c_conj_float(z) (conjf(z))
2296 #define __Pyx_c_abs_float(z) (cabsf(z))
2297 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2301 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2302 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2303 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2304 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2305 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2306 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2307 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2308 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2310 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
2311 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2317 #define __Pyx_c_eq_double(a, b) ((a)==(b))
2318 #define __Pyx_c_sum_double(a, b) ((a)+(b))
2319 #define __Pyx_c_diff_double(a, b) ((a)-(b))
2320 #define __Pyx_c_prod_double(a, b) ((a)*(b))
2321 #define __Pyx_c_quot_double(a, b) ((a)/(b))
2322 #define __Pyx_c_neg_double(a) (-(a))
2324 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2325 #define __Pyx_c_conj_double(z) (::std::conj(z))
2327 #define __Pyx_c_abs_double(z) (::std::abs(z))
2328 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2331 #define __Pyx_c_is_zero_double(z) ((z)==0)
2332 #define __Pyx_c_conj_double(z) (conj(z))
2334 #define __Pyx_c_abs_double(z) (cabs(z))
2335 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2339 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2340 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2341 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2342 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2343 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2344 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2345 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2346 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2348 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
2349 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2354 static __Pyx_memviewslice
2355 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
2356 const char *mode,
int ndim,
2357 size_t sizeof_dtype,
int contig_flag,
2358 int dtype_is_object);
2361 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2364 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2367 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2370 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2373 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *);
2376 static int __Pyx_check_binary_version(
void);
2379 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2381 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
2382 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2383 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
2384 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
2385 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value);
2386 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2387 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
2388 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2389 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
2390 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2403 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2416 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2417 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2418 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2419 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2420 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2421 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2422 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2423 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2424 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2425 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2426 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2427 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2428 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2429 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2430 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2433 static PyTypeObject *__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix = 0;
2440 static PyTypeObject *__pyx_ptype_10csmoothers_cASMFactor = 0;
2441 static PyTypeObject *__pyx_ptype_10csmoothers_cBASMFactor = 0;
2442 static PyTypeObject *__pyx_array_type = 0;
2443 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2444 static PyTypeObject *__pyx_memoryview_type = 0;
2445 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2446 static PyObject *
generic = 0;
2447 static PyObject *strided = 0;
2448 static PyObject *indirect = 0;
2449 static PyObject *contiguous = 0;
2450 static PyObject *indirect_contiguous = 0;
2451 static int __pyx_memoryview_thread_locks_used;
2452 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2453 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
double,
double, __pyx_t_10csmoothers_DDATA);
2454 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA);
2455 static void __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA,
double,
double, __pyx_t_10csmoothers_DDATA);
2456 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
double,
double, __pyx_t_10csmoothers_DDATA);
2457 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA);
2458 static PyObject *__pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA,
double,
double, __pyx_t_10csmoothers_DDATA);
2459 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
struct __pyx_obj_10csmoothers_cASMFactor *);
2460 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
double,
struct __pyx_obj_10csmoothers_cASMFactor *, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA);
2461 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
struct __pyx_obj_10csmoothers_cBASMFactor *);
2462 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *,
double,
struct __pyx_obj_10csmoothers_cBASMFactor *, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA);
2463 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2464 static void *__pyx_align_pointer(
void *,
size_t);
2465 static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo *);
2466 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
2467 static PyObject *_unellipsify(PyObject *,
int);
2468 static PyObject *assert_direct_dimensions(Py_ssize_t *,
int);
2469 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
2470 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int,
int);
2471 static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
2472 static int __pyx_memslice_transpose(__Pyx_memviewslice *);
2473 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *),
int (*)(
char *, PyObject *),
int);
2474 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2475 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2476 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
2477 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2478 static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
2479 static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
2480 static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
2481 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
2482 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
2483 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
2484 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
2485 static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
2486 static int __pyx_memoryview_err_dim(PyObject *,
char *,
int);
2487 static int __pyx_memoryview_err(PyObject *,
char *);
2488 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
2489 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
2490 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
2491 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2492 static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2493 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
2494 static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
2495 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
2496 static __Pyx_TypeInfo __Pyx_TypeInfo_double = {
"double", NULL,
sizeof(double), { 0 }, 0,
'R', 0, 0 };
2497 static __Pyx_TypeInfo __Pyx_TypeInfo_int = {
"int", NULL,
sizeof(int), { 0 }, 0, IS_UNSIGNED(
int) ?
'U' :
'I', IS_UNSIGNED(
int), 0 };
2498 #define __Pyx_MODULE_NAME "csmoothers"
2499 extern int __pyx_module_is_main_csmoothers;
2500 int __pyx_module_is_main_csmoothers = 0;
2503 static PyObject *__pyx_builtin_object;
2504 static PyObject *__pyx_builtin_TypeError;
2505 static PyObject *__pyx_builtin_ImportError;
2506 static PyObject *__pyx_builtin_ValueError;
2507 static PyObject *__pyx_builtin_MemoryError;
2508 static PyObject *__pyx_builtin_enumerate;
2509 static PyObject *__pyx_builtin_range;
2510 static PyObject *__pyx_builtin_Ellipsis;
2511 static PyObject *__pyx_builtin_id;
2512 static PyObject *__pyx_builtin_IndexError;
2513 static const char __pyx_k_A[] =
"A";
2514 static const char __pyx_k_L[] =
"L";
2515 static const char __pyx_k_M[] =
"M";
2516 static const char __pyx_k_O[] =
"O";
2517 static const char __pyx_k_R[] =
"R";
2518 static const char __pyx_k_c[] =
"c";
2519 static const char __pyx_k_w[] =
"w";
2520 static const char __pyx_k_bs[] =
"bs";
2521 static const char __pyx_k_dX[] =
"dX";
2522 static const char __pyx_k_id[] =
"id";
2523 static const char __pyx_k_nc[] =
"nc";
2524 static const char __pyx_k_np[] =
"np";
2525 static const char __pyx_k_nr[] =
"nr";
2526 static const char __pyx_k_doc[] =
"__doc__";
2527 static const char __pyx_k_new[] =
"__new__";
2528 static const char __pyx_k_obj[] =
"obj";
2529 static const char __pyx_k_tol[] =
"tol";
2530 static const char __pyx_k_base[] =
"base";
2531 static const char __pyx_k_dict[] =
"__dict__";
2532 static const char __pyx_k_init[] =
"__init__";
2533 static const char __pyx_k_main[] =
"__main__";
2534 static const char __pyx_k_mode[] =
"mode";
2535 static const char __pyx_k_name[] =
"name";
2536 static const char __pyx_k_ndim[] =
"ndim";
2537 static const char __pyx_k_pack[] =
"pack";
2538 static const char __pyx_k_self[] =
"self";
2539 static const char __pyx_k_size[] =
"size";
2540 static const char __pyx_k_step[] =
"step";
2541 static const char __pyx_k_stop[] =
"stop";
2542 static const char __pyx_k_test[] =
"__test__";
2543 static const char __pyx_k_ASCII[] =
"ASCII";
2544 static const char __pyx_k_class[] =
"__class__";
2545 static const char __pyx_k_error[] =
"error";
2546 static const char __pyx_k_flags[] =
"flags";
2547 static const char __pyx_k_numpy[] =
"numpy";
2548 static const char __pyx_k_range[] =
"range";
2549 static const char __pyx_k_shape[] =
"shape";
2550 static const char __pyx_k_start[] =
"start";
2551 static const char __pyx_k_encode[] =
"encode";
2552 static const char __pyx_k_format[] =
"format";
2553 static const char __pyx_k_import[] =
"__import__";
2554 static const char __pyx_k_module[] =
"__module__";
2555 static const char __pyx_k_name_2[] =
"__name__";
2556 static const char __pyx_k_object[] =
"object";
2557 static const char __pyx_k_pickle[] =
"pickle";
2558 static const char __pyx_k_reduce[] =
"__reduce__";
2559 static const char __pyx_k_struct[] =
"struct";
2560 static const char __pyx_k_unpack[] =
"unpack";
2561 static const char __pyx_k_update[] =
"update";
2562 static const char __pyx_k_fortran[] =
"fortran";
2563 static const char __pyx_k_memview[] =
"memview";
2564 static const char __pyx_k_prepare[] =
"__prepare__";
2565 static const char __pyx_k_Ellipsis[] =
"Ellipsis";
2566 static const char __pyx_k_getstate[] =
"__getstate__";
2567 static const char __pyx_k_itemsize[] =
"itemsize";
2568 static const char __pyx_k_pyx_type[] =
"__pyx_type";
2569 static const char __pyx_k_qualname[] =
"__qualname__";
2570 static const char __pyx_k_setstate[] =
"__setstate__";
2571 static const char __pyx_k_ASMFactor[] =
"ASMFactor";
2572 static const char __pyx_k_TypeError[] =
"TypeError";
2573 static const char __pyx_k_asmFactor[] =
"asmFactor";
2574 static const char __pyx_k_enumerate[] =
"enumerate";
2575 static const char __pyx_k_metaclass[] =
"__metaclass__";
2576 static const char __pyx_k_pyx_state[] =
"__pyx_state";
2577 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
2578 static const char __pyx_k_BASMFactor[] =
"BASMFactor";
2579 static const char __pyx_k_IndexError[] =
"IndexError";
2580 static const char __pyx_k_ValueError[] =
"ValueError";
2581 static const char __pyx_k_basmFactor[] =
"basmFactor";
2582 static const char __pyx_k_cASMFactor[] =
"_cASMFactor";
2583 static const char __pyx_k_csmoothers[] =
"csmoothers";
2584 static const char __pyx_k_node_order[] =
"node_order";
2585 static const char __pyx_k_pyx_result[] =
"__pyx_result";
2586 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
2587 static const char __pyx_k_ImportError[] =
"ImportError";
2588 static const char __pyx_k_MemoryError[] =
"MemoryError";
2589 static const char __pyx_k_PickleError[] =
"PickleError";
2590 static const char __pyx_k_cBASMFactor[] =
"_cBASMFactor";
2591 static const char __pyx_k_asm_NR_solve[] =
"asm_NR_solve";
2592 static const char __pyx_k_cASMFactor_2[] =
"cASMFactor";
2593 static const char __pyx_k_pyx_checksum[] =
"__pyx_checksum";
2594 static const char __pyx_k_stringsource[] =
"stringsource";
2595 static const char __pyx_k_basm_NR_solve[] =
"basm_NR_solve";
2596 static const char __pyx_k_cBASMFactor_2[] =
"cBASMFactor";
2597 static const char __pyx_k_cSparseMatrix[] =
"_cSparseMatrix";
2598 static const char __pyx_k_pyx_getbuffer[] =
"__pyx_getbuffer";
2599 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
2600 static const char __pyx_k_asm_NR_prepare[] =
"asm_NR_prepare";
2601 static const char __pyx_k_View_MemoryView[] =
"View.MemoryView";
2602 static const char __pyx_k_allocate_buffer[] =
"allocate_buffer";
2603 static const char __pyx_k_basm_NR_prepare[] =
"basm_NR_prepare";
2604 static const char __pyx_k_dtype_is_object[] =
"dtype_is_object";
2605 static const char __pyx_k_jacobi_NR_solve[] =
"jacobi_NR_solve";
2606 static const char __pyx_k_pyx_PickleError[] =
"__pyx_PickleError";
2607 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
2608 static const char __pyx_k_ASMFactor___init[] =
"ASMFactor.__init__";
2609 static const char __pyx_k_BASMFactor___init[] =
"BASMFactor.__init__";
2610 static const char __pyx_k_jacobi_NR_prepare[] =
"jacobi_NR_prepare";
2611 static const char __pyx_k_pyx_unpickle_Enum[] =
"__pyx_unpickle_Enum";
2612 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2613 static const char __pyx_k_nl_jacobi_NR_solve[] =
"nl_jacobi_NR_solve";
2614 static const char __pyx_k_strided_and_direct[] =
"<strided and direct>";
2615 static const char __pyx_k_strided_and_indirect[] =
"<strided and indirect>";
2616 static const char __pyx_k_contiguous_and_direct[] =
"<contiguous and direct>";
2617 static const char __pyx_k_gauss_seidel_NR_solve[] =
"gauss_seidel_NR_solve";
2618 static const char __pyx_k_MemoryView_of_r_object[] =
"<MemoryView of %r object>";
2619 static const char __pyx_k_gauss_seidel_NR_preare[] =
"gauss_seidel_NR_preare";
2620 static const char __pyx_k_proteus_csmoothers_pyx[] =
"proteus/csmoothers.pyx";
2621 static const char __pyx_k_MemoryView_of_r_at_0x_x[] =
"<MemoryView of %r at 0x%x>";
2622 static const char __pyx_k_contiguous_and_indirect[] =
"<contiguous and indirect>";
2623 static const char __pyx_k_Cannot_index_with_type_s[] =
"Cannot index with type '%s'";
2624 static const char __pyx_k_nl_gauss_seidel_NR_solve[] =
"nl_gauss_seidel_NR_solve";
2625 static const char __pyx_k_Invalid_shape_in_axis_d_d[] =
"Invalid shape in axis %d: %d.";
2626 static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
2627 static const char __pyx_k_unable_to_allocate_array_data[] =
"unable to allocate array data.";
2628 static const char __pyx_k_strided_and_direct_or_indirect[] =
"<strided and direct or indirect>";
2629 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
2630 static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
2631 static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
2632 static const char __pyx_k_Cannot_assign_to_read_only_memor[] =
"Cannot assign to read-only memoryview";
2633 static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
2634 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
2635 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] =
"Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
2636 static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
2637 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] =
"Invalid mode, expected 'c' or 'fortran', got %s";
2638 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %d)";
2639 static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
2640 static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %d and %d)";
2641 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2642 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
2643 static const char __pyx_k_unable_to_allocate_shape_and_str[] =
"unable to allocate shape and strides.";
2644 static PyObject *__pyx_n_s_A;
2645 static PyObject *__pyx_n_s_ASCII;
2646 static PyObject *__pyx_n_s_ASMFactor;
2647 static PyObject *__pyx_n_s_ASMFactor___init;
2648 static PyObject *__pyx_n_s_BASMFactor;
2649 static PyObject *__pyx_n_s_BASMFactor___init;
2650 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2651 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2652 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2653 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2654 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2655 static PyObject *__pyx_n_s_Ellipsis;
2656 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2657 static PyObject *__pyx_n_s_ImportError;
2658 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
2659 static PyObject *__pyx_n_s_IndexError;
2660 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2661 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2662 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2663 static PyObject *__pyx_n_s_L;
2664 static PyObject *__pyx_n_s_M;
2665 static PyObject *__pyx_n_s_MemoryError;
2666 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2667 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2668 static PyObject *__pyx_n_b_O;
2669 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2670 static PyObject *__pyx_n_s_PickleError;
2671 static PyObject *__pyx_n_s_R;
2672 static PyObject *__pyx_n_s_TypeError;
2673 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2674 static PyObject *__pyx_n_s_ValueError;
2675 static PyObject *__pyx_n_s_View_MemoryView;
2676 static PyObject *__pyx_n_s_allocate_buffer;
2677 static PyObject *__pyx_n_s_asmFactor;
2678 static PyObject *__pyx_n_s_asm_NR_prepare;
2679 static PyObject *__pyx_n_s_asm_NR_solve;
2680 static PyObject *__pyx_n_s_base;
2681 static PyObject *__pyx_n_s_basmFactor;
2682 static PyObject *__pyx_n_s_basm_NR_prepare;
2683 static PyObject *__pyx_n_s_basm_NR_solve;
2684 static PyObject *__pyx_n_s_bs;
2685 static PyObject *__pyx_n_s_c;
2686 static PyObject *__pyx_n_u_c;
2687 static PyObject *__pyx_n_s_cASMFactor;
2688 static PyObject *__pyx_n_s_cASMFactor_2;
2689 static PyObject *__pyx_n_s_cBASMFactor;
2690 static PyObject *__pyx_n_s_cBASMFactor_2;
2691 static PyObject *__pyx_n_s_cSparseMatrix;
2692 static PyObject *__pyx_n_s_class;
2693 static PyObject *__pyx_n_s_cline_in_traceback;
2694 static PyObject *__pyx_kp_s_contiguous_and_direct;
2695 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2696 static PyObject *__pyx_n_s_csmoothers;
2697 static PyObject *__pyx_n_s_dX;
2698 static PyObject *__pyx_n_s_dict;
2699 static PyObject *__pyx_n_s_doc;
2700 static PyObject *__pyx_n_s_dtype_is_object;
2701 static PyObject *__pyx_n_s_encode;
2702 static PyObject *__pyx_n_s_enumerate;
2703 static PyObject *__pyx_n_s_error;
2704 static PyObject *__pyx_n_s_flags;
2705 static PyObject *__pyx_n_s_format;
2706 static PyObject *__pyx_n_s_fortran;
2707 static PyObject *__pyx_n_u_fortran;
2708 static PyObject *__pyx_n_s_gauss_seidel_NR_preare;
2709 static PyObject *__pyx_n_s_gauss_seidel_NR_solve;
2710 static PyObject *__pyx_n_s_getstate;
2711 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2712 static PyObject *__pyx_n_s_id;
2713 static PyObject *__pyx_n_s_import;
2714 static PyObject *__pyx_n_s_init;
2715 static PyObject *__pyx_n_s_itemsize;
2716 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2717 static PyObject *__pyx_n_s_jacobi_NR_prepare;
2718 static PyObject *__pyx_n_s_jacobi_NR_solve;
2719 static PyObject *__pyx_n_s_main;
2720 static PyObject *__pyx_n_s_memview;
2721 static PyObject *__pyx_n_s_metaclass;
2722 static PyObject *__pyx_n_s_mode;
2723 static PyObject *__pyx_n_s_module;
2724 static PyObject *__pyx_n_s_name;
2725 static PyObject *__pyx_n_s_name_2;
2726 static PyObject *__pyx_n_s_nc;
2727 static PyObject *__pyx_n_s_ndim;
2728 static PyObject *__pyx_n_s_new;
2729 static PyObject *__pyx_n_s_nl_gauss_seidel_NR_solve;
2730 static PyObject *__pyx_n_s_nl_jacobi_NR_solve;
2731 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2732 static PyObject *__pyx_n_s_node_order;
2733 static PyObject *__pyx_n_s_np;
2734 static PyObject *__pyx_n_s_nr;
2735 static PyObject *__pyx_n_s_numpy;
2736 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2737 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2738 static PyObject *__pyx_n_s_obj;
2739 static PyObject *__pyx_n_s_object;
2740 static PyObject *__pyx_n_s_pack;
2741 static PyObject *__pyx_n_s_pickle;
2742 static PyObject *__pyx_n_s_prepare;
2743 static PyObject *__pyx_kp_s_proteus_csmoothers_pyx;
2744 static PyObject *__pyx_n_s_pyx_PickleError;
2745 static PyObject *__pyx_n_s_pyx_checksum;
2746 static PyObject *__pyx_n_s_pyx_getbuffer;
2747 static PyObject *__pyx_n_s_pyx_result;
2748 static PyObject *__pyx_n_s_pyx_state;
2749 static PyObject *__pyx_n_s_pyx_type;
2750 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2751 static PyObject *__pyx_n_s_pyx_vtable;
2752 static PyObject *__pyx_n_s_qualname;
2753 static PyObject *__pyx_n_s_range;
2754 static PyObject *__pyx_n_s_reduce;
2755 static PyObject *__pyx_n_s_reduce_cython;
2756 static PyObject *__pyx_n_s_reduce_ex;
2757 static PyObject *__pyx_n_s_self;
2758 static PyObject *__pyx_n_s_setstate;
2759 static PyObject *__pyx_n_s_setstate_cython;
2760 static PyObject *__pyx_n_s_shape;
2761 static PyObject *__pyx_n_s_size;
2762 static PyObject *__pyx_n_s_start;
2763 static PyObject *__pyx_n_s_step;
2764 static PyObject *__pyx_n_s_stop;
2765 static PyObject *__pyx_kp_s_strided_and_direct;
2766 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2767 static PyObject *__pyx_kp_s_strided_and_indirect;
2768 static PyObject *__pyx_kp_s_stringsource;
2769 static PyObject *__pyx_n_s_struct;
2770 static PyObject *__pyx_n_s_test;
2771 static PyObject *__pyx_n_s_tol;
2772 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2773 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2774 static PyObject *__pyx_n_s_unpack;
2775 static PyObject *__pyx_n_s_update;
2776 static PyObject *__pyx_n_s_w;
2777 static PyObject *__pyx_pf_10csmoothers_9ASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L);
2778 static int __pyx_pf_10csmoothers_10cASMFactor___cinit__(
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self,
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L);
2779 static void __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self);
2780 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self);
2781 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2782 static PyObject *__pyx_pf_10csmoothers_10BASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L, PyObject *__pyx_v_bs);
2783 static int __pyx_pf_10csmoothers_11cBASMFactor___cinit__(
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self,
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L,
int __pyx_v_bs);
2784 static void __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self);
2785 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self);
2786 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2787 static PyObject *__pyx_pf_10csmoothers_jacobi_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M);
2788 static PyObject *__pyx_pf_10csmoothers_2jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX);
2789 static PyObject *__pyx_pf_10csmoothers_4nl_jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX);
2790 static PyObject *__pyx_pf_10csmoothers_6gauss_seidel_NR_preare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M);
2791 static PyObject *__pyx_pf_10csmoothers_8gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX);
2792 static PyObject *__pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX);
2793 static PyObject *__pyx_pf_10csmoothers_12asm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_asmFactor);
2794 static PyObject *__pyx_pf_10csmoothers_14asm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_asmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX);
2795 static PyObject *__pyx_pf_10csmoothers_16basm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_basmFactor);
2796 static PyObject *__pyx_pf_10csmoothers_18basm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_basmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX);
2797 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer);
2798 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2799 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
2800 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
2801 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
2802 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
2803 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
2804 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
2805 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
2806 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2807 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
2808 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2809 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2810 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
2811 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object);
2812 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
2813 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2814 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2815 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2816 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2817 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2818 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2819 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2820 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2821 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2822 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2823 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2824 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2825 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
2826 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
2827 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
2828 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2829 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2830 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
2831 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
2832 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
2833 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2834 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2835 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2836 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2837 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2838 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
2839 static PyObject *__pyx_tp_new_10csmoothers_cASMFactor(PyTypeObject *t, PyObject *a, PyObject *k);
2840 static PyObject *__pyx_tp_new_10csmoothers_cBASMFactor(PyTypeObject *t, PyObject *a, PyObject *k);
2841 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
2842 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
2843 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
2844 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
2845 static PyObject *__pyx_int_0;
2846 static PyObject *__pyx_int_1;
2847 static PyObject *__pyx_int_112105877;
2848 static PyObject *__pyx_int_136983863;
2849 static PyObject *__pyx_int_184977713;
2850 static PyObject *__pyx_int_neg_1;
2851 static PyObject *__pyx_tuple_;
2852 static PyObject *__pyx_tuple__2;
2853 static PyObject *__pyx_tuple__3;
2854 static PyObject *__pyx_tuple__4;
2855 static PyObject *__pyx_tuple__5;
2856 static PyObject *__pyx_tuple__6;
2857 static PyObject *__pyx_tuple__7;
2858 static PyObject *__pyx_tuple__8;
2859 static PyObject *__pyx_tuple__9;
2860 static PyObject *__pyx_slice__21;
2861 static PyObject *__pyx_tuple__10;
2862 static PyObject *__pyx_tuple__11;
2863 static PyObject *__pyx_tuple__12;
2864 static PyObject *__pyx_tuple__13;
2865 static PyObject *__pyx_tuple__14;
2866 static PyObject *__pyx_tuple__15;
2867 static PyObject *__pyx_tuple__16;
2868 static PyObject *__pyx_tuple__17;
2869 static PyObject *__pyx_tuple__18;
2870 static PyObject *__pyx_tuple__19;
2871 static PyObject *__pyx_tuple__20;
2872 static PyObject *__pyx_tuple__22;
2873 static PyObject *__pyx_tuple__23;
2874 static PyObject *__pyx_tuple__24;
2875 static PyObject *__pyx_tuple__25;
2876 static PyObject *__pyx_tuple__26;
2877 static PyObject *__pyx_tuple__27;
2878 static PyObject *__pyx_tuple__29;
2879 static PyObject *__pyx_tuple__30;
2880 static PyObject *__pyx_tuple__32;
2881 static PyObject *__pyx_tuple__34;
2882 static PyObject *__pyx_tuple__36;
2883 static PyObject *__pyx_tuple__38;
2884 static PyObject *__pyx_tuple__40;
2885 static PyObject *__pyx_tuple__42;
2886 static PyObject *__pyx_tuple__44;
2887 static PyObject *__pyx_tuple__46;
2888 static PyObject *__pyx_tuple__48;
2889 static PyObject *__pyx_tuple__50;
2890 static PyObject *__pyx_tuple__52;
2891 static PyObject *__pyx_tuple__53;
2892 static PyObject *__pyx_tuple__54;
2893 static PyObject *__pyx_tuple__55;
2894 static PyObject *__pyx_tuple__56;
2895 static PyObject *__pyx_tuple__57;
2896 static PyObject *__pyx_codeobj__28;
2897 static PyObject *__pyx_codeobj__31;
2898 static PyObject *__pyx_codeobj__33;
2899 static PyObject *__pyx_codeobj__35;
2900 static PyObject *__pyx_codeobj__37;
2901 static PyObject *__pyx_codeobj__39;
2902 static PyObject *__pyx_codeobj__41;
2903 static PyObject *__pyx_codeobj__43;
2904 static PyObject *__pyx_codeobj__45;
2905 static PyObject *__pyx_codeobj__47;
2906 static PyObject *__pyx_codeobj__49;
2907 static PyObject *__pyx_codeobj__51;
2908 static PyObject *__pyx_codeobj__58;
2920 static PyObject *__pyx_pw_10csmoothers_9ASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2921 static PyMethodDef __pyx_mdef_10csmoothers_9ASMFactor_1__init__ = {
"__init__", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_9ASMFactor_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
2922 static PyObject *__pyx_pw_10csmoothers_9ASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2923 PyObject *__pyx_v_self = 0;
2924 PyObject *__pyx_v_L = 0;
2925 int __pyx_lineno = 0;
2926 const char *__pyx_filename = NULL;
2927 int __pyx_clineno = 0;
2928 PyObject *__pyx_r = 0;
2929 __Pyx_RefNannyDeclarations
2930 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
2932 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_L,0};
2933 PyObject* values[2] = {0,0};
2934 if (unlikely(__pyx_kwds)) {
2936 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2938 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2940 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2943 default:
goto __pyx_L5_argtuple_error;
2945 kw_args = PyDict_Size(__pyx_kwds);
2948 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
2949 else goto __pyx_L5_argtuple_error;
2952 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
2954 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 2, 2, 1); __PYX_ERR(0, 7, __pyx_L3_error)
2957 if (unlikely(kw_args > 0)) {
2958 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(0, 7, __pyx_L3_error)
2960 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
2961 goto __pyx_L5_argtuple_error;
2963 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2964 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2966 __pyx_v_self = values[0];
2967 __pyx_v_L = values[1];
2969 goto __pyx_L4_argument_unpacking_done;
2970 __pyx_L5_argtuple_error:;
2971 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7, __pyx_L3_error)
2973 __Pyx_AddTraceback(
"csmoothers.ASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2974 __Pyx_RefNannyFinishContext();
2976 __pyx_L4_argument_unpacking_done:;
2977 __pyx_r = __pyx_pf_10csmoothers_9ASMFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_L);
2980 __Pyx_RefNannyFinishContext();
2984 static PyObject *__pyx_pf_10csmoothers_9ASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L) {
2985 PyObject *__pyx_r = NULL;
2986 __Pyx_RefNannyDeclarations
2987 PyObject *__pyx_t_1 = NULL;
2988 PyObject *__pyx_t_2 = NULL;
2989 int __pyx_lineno = 0;
2990 const char *__pyx_filename = NULL;
2991 int __pyx_clineno = 0;
2992 __Pyx_RefNannySetupContext(
"__init__", 0);
3001 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_L, __pyx_v_L) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
3010 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_L);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
3011 __Pyx_GOTREF(__pyx_t_1);
3012 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
3013 __Pyx_GOTREF(__pyx_t_2);
3014 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3015 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_10csmoothers_cASMFactor), __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
3016 __Pyx_GOTREF(__pyx_t_1);
3017 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3018 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cASMFactor, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
3019 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3030 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3033 __Pyx_XDECREF(__pyx_t_1);
3034 __Pyx_XDECREF(__pyx_t_2);
3035 __Pyx_AddTraceback(
"csmoothers.ASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3038 __Pyx_XGIVEREF(__pyx_r);
3039 __Pyx_RefNannyFinishContext();
3052 static int __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3053 static int __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3054 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L = 0;
3055 int __pyx_lineno = 0;
3056 const char *__pyx_filename = NULL;
3057 int __pyx_clineno = 0;
3059 __Pyx_RefNannyDeclarations
3060 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
3062 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_L,0};
3063 PyObject* values[1] = {0};
3064 if (unlikely(__pyx_kwds)) {
3066 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3068 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3071 default:
goto __pyx_L5_argtuple_error;
3073 kw_args = PyDict_Size(__pyx_kwds);
3076 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
3077 else goto __pyx_L5_argtuple_error;
3079 if (unlikely(kw_args > 0)) {
3080 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 13, __pyx_L3_error)
3082 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
3083 goto __pyx_L5_argtuple_error;
3085 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3087 __pyx_v_L = ((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)values[0]);
3089 goto __pyx_L4_argument_unpacking_done;
3090 __pyx_L5_argtuple_error:;
3091 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 13, __pyx_L3_error)
3093 __Pyx_AddTraceback(
"csmoothers.cASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3094 __Pyx_RefNannyFinishContext();
3096 __pyx_L4_argument_unpacking_done:;
3097 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix, 1,
"L", 0))) __PYX_ERR(0, 14, __pyx_L1_error)
3098 __pyx_r = __pyx_pf_10csmoothers_10cASMFactor___cinit__(((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self), __pyx_v_L);
3105 __Pyx_RefNannyFinishContext();
3109 static int __pyx_pf_10csmoothers_10cASMFactor___cinit__(
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self,
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L) {
3111 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
3113 __Pyx_RefNannyDeclarations
3114 PyObject *__pyx_t_1 = NULL;
3116 int __pyx_lineno = 0;
3117 const char *__pyx_filename = NULL;
3118 int __pyx_clineno = 0;
3119 __Pyx_RefNannySetupContext(
"__cinit__", 0);
3137 __pyx_v_AS.Stype = SLU_NR;
3146 __pyx_v_AS.Dtype = SLU_D;
3155 __pyx_v_AS.Mtype = SLU_GE;
3164 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
3165 __Pyx_GOTREF(__pyx_t_1);
3166 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L1_error)
3167 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3168 __pyx_v_AS.nrow = __pyx_t_2;
3177 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
3178 __Pyx_GOTREF(__pyx_t_1);
3179 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 21, __pyx_L1_error)
3180 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3181 __pyx_v_AS.ncol = __pyx_t_2;
3190 __pyx_v_AS.Store = (&__pyx_v_L->A);
3199 __pyx_v_rval =
asm_NR_init((&__pyx_v_AS), (&__pyx_v_self->subdomain_dim), (&__pyx_v_self->l2g_L), (&__pyx_v_self->subdomain_L), (&__pyx_v_self->subdomain_R), (&__pyx_v_self->subdomain_dX), (&__pyx_v_self->subdomain_pivots));
3208 #ifndef CYTHON_WITHOUT_ASSERTIONS
3209 if (unlikely(!Py_OptimizeFlag)) {
3210 if (unlikely(!((__pyx_v_rval == 0) != 0))) {
3211 PyErr_SetNone(PyExc_AssertionError);
3212 __PYX_ERR(0, 30, __pyx_L1_error)
3229 __Pyx_XDECREF(__pyx_t_1);
3230 __Pyx_AddTraceback(
"csmoothers.cASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3233 __Pyx_RefNannyFinishContext();
3246 static void __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(PyObject *__pyx_v_self);
3247 static void __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(PyObject *__pyx_v_self) {
3248 __Pyx_RefNannyDeclarations
3249 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
3250 __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self));
3253 __Pyx_RefNannyFinishContext();
3256 static void __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self) {
3257 __Pyx_RefNannyDeclarations
3258 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
3267 asm_NR_free(__pyx_v_self->N, __pyx_v_self->subdomain_dim, __pyx_v_self->l2g_L, __pyx_v_self->subdomain_L, __pyx_v_self->subdomain_R, __pyx_v_self->subdomain_dX, __pyx_v_self->subdomain_pivots);
3278 __Pyx_RefNannyFinishContext();
3288 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
3289 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3290 PyObject *__pyx_r = 0;
3291 __Pyx_RefNannyDeclarations
3292 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
3293 __pyx_r = __pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self));
3296 __Pyx_RefNannyFinishContext();
3300 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self) {
3301 PyObject *__pyx_r = NULL;
3302 __Pyx_RefNannyDeclarations
3303 PyObject *__pyx_t_1 = NULL;
3304 int __pyx_lineno = 0;
3305 const char *__pyx_filename = NULL;
3306 int __pyx_clineno = 0;
3307 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
3315 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
3316 __Pyx_GOTREF(__pyx_t_1);
3317 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3318 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3319 __PYX_ERR(1, 2, __pyx_L1_error)
3329 __Pyx_XDECREF(__pyx_t_1);
3330 __Pyx_AddTraceback(
"csmoothers.cASMFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3332 __Pyx_XGIVEREF(__pyx_r);
3333 __Pyx_RefNannyFinishContext();
3345 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
3346 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3347 PyObject *__pyx_r = 0;
3348 __Pyx_RefNannyDeclarations
3349 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
3350 __pyx_r = __pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3353 __Pyx_RefNannyFinishContext();
3357 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3358 PyObject *__pyx_r = NULL;
3359 __Pyx_RefNannyDeclarations
3360 PyObject *__pyx_t_1 = NULL;
3361 int __pyx_lineno = 0;
3362 const char *__pyx_filename = NULL;
3363 int __pyx_clineno = 0;
3364 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
3371 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
3372 __Pyx_GOTREF(__pyx_t_1);
3373 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3374 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3375 __PYX_ERR(1, 4, __pyx_L1_error)
3386 __Pyx_XDECREF(__pyx_t_1);
3387 __Pyx_AddTraceback(
"csmoothers.cASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3389 __Pyx_XGIVEREF(__pyx_r);
3390 __Pyx_RefNannyFinishContext();
3403 static PyObject *__pyx_pw_10csmoothers_10BASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3404 static PyMethodDef __pyx_mdef_10csmoothers_10BASMFactor_1__init__ = {
"__init__", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_10BASMFactor_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
3405 static PyObject *__pyx_pw_10csmoothers_10BASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3406 PyObject *__pyx_v_self = 0;
3407 PyObject *__pyx_v_L = 0;
3408 PyObject *__pyx_v_bs = 0;
3409 int __pyx_lineno = 0;
3410 const char *__pyx_filename = NULL;
3411 int __pyx_clineno = 0;
3412 PyObject *__pyx_r = 0;
3413 __Pyx_RefNannyDeclarations
3414 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
3416 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_L,&__pyx_n_s_bs,0};
3417 PyObject* values[3] = {0,0,0};
3418 if (unlikely(__pyx_kwds)) {
3420 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3422 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3424 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3426 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3429 default:
goto __pyx_L5_argtuple_error;
3431 kw_args = PyDict_Size(__pyx_kwds);
3434 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3435 else goto __pyx_L5_argtuple_error;
3438 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
3440 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 3, 3, 1); __PYX_ERR(0, 44, __pyx_L3_error)
3444 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--;
3446 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 3, 3, 2); __PYX_ERR(0, 44, __pyx_L3_error)
3449 if (unlikely(kw_args > 0)) {
3450 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(0, 44, __pyx_L3_error)
3452 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3453 goto __pyx_L5_argtuple_error;
3455 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3456 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3457 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3459 __pyx_v_self = values[0];
3460 __pyx_v_L = values[1];
3461 __pyx_v_bs = values[2];
3463 goto __pyx_L4_argument_unpacking_done;
3464 __pyx_L5_argtuple_error:;
3465 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 44, __pyx_L3_error)
3467 __Pyx_AddTraceback(
"csmoothers.BASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3468 __Pyx_RefNannyFinishContext();
3470 __pyx_L4_argument_unpacking_done:;
3471 __pyx_r = __pyx_pf_10csmoothers_10BASMFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_L, __pyx_v_bs);
3474 __Pyx_RefNannyFinishContext();
3478 static PyObject *__pyx_pf_10csmoothers_10BASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L, PyObject *__pyx_v_bs) {
3479 PyObject *__pyx_r = NULL;
3480 __Pyx_RefNannyDeclarations
3481 PyObject *__pyx_t_1 = NULL;
3482 PyObject *__pyx_t_2 = NULL;
3483 PyObject *__pyx_t_3 = NULL;
3484 int __pyx_lineno = 0;
3485 const char *__pyx_filename = NULL;
3486 int __pyx_clineno = 0;
3487 __Pyx_RefNannySetupContext(
"__init__", 0);
3496 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_L, __pyx_v_L) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
3505 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bs, __pyx_v_bs) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
3514 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_L);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
3515 __Pyx_GOTREF(__pyx_t_1);
3516 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
3517 __Pyx_GOTREF(__pyx_t_2);
3518 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3527 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bs);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
3528 __Pyx_GOTREF(__pyx_t_1);
3537 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L1_error)
3538 __Pyx_GOTREF(__pyx_t_3);
3539 __Pyx_GIVEREF(__pyx_t_2);
3540 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
3541 __Pyx_GIVEREF(__pyx_t_1);
3542 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
3545 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10csmoothers_cBASMFactor), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
3546 __Pyx_GOTREF(__pyx_t_1);
3547 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3548 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cBASMFactor, __pyx_t_1) < 0) __PYX_ERR(0, 47, __pyx_L1_error)
3549 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3560 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3563 __Pyx_XDECREF(__pyx_t_1);
3564 __Pyx_XDECREF(__pyx_t_2);
3565 __Pyx_XDECREF(__pyx_t_3);
3566 __Pyx_AddTraceback(
"csmoothers.BASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3569 __Pyx_XGIVEREF(__pyx_r);
3570 __Pyx_RefNannyFinishContext();
3583 static int __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3584 static int __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3585 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L = 0;
3587 int __pyx_lineno = 0;
3588 const char *__pyx_filename = NULL;
3589 int __pyx_clineno = 0;
3591 __Pyx_RefNannyDeclarations
3592 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
3594 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_L,&__pyx_n_s_bs,0};
3595 PyObject* values[2] = {0,0};
3596 if (unlikely(__pyx_kwds)) {
3598 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3600 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3602 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3605 default:
goto __pyx_L5_argtuple_error;
3607 kw_args = PyDict_Size(__pyx_kwds);
3610 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
3611 else goto __pyx_L5_argtuple_error;
3614 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--;
3616 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 2, 2, 1); __PYX_ERR(0, 52, __pyx_L3_error)
3619 if (unlikely(kw_args > 0)) {
3620 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 52, __pyx_L3_error)
3622 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
3623 goto __pyx_L5_argtuple_error;
3625 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3626 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3628 __pyx_v_L = ((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)values[0]);
3629 __pyx_v_bs = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_bs == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error)
3631 goto __pyx_L4_argument_unpacking_done;
3632 __pyx_L5_argtuple_error:;
3633 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 52, __pyx_L3_error)
3635 __Pyx_AddTraceback(
"csmoothers.cBASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3636 __Pyx_RefNannyFinishContext();
3638 __pyx_L4_argument_unpacking_done:;
3639 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix, 1,
"L", 0))) __PYX_ERR(0, 53, __pyx_L1_error)
3640 __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor___cinit__(((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self), __pyx_v_L, __pyx_v_bs);
3647 __Pyx_RefNannyFinishContext();
3651 static int __pyx_pf_10csmoothers_11cBASMFactor___cinit__(
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self,
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L,
int __pyx_v_bs) {
3653 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
3655 __Pyx_RefNannyDeclarations
3656 PyObject *__pyx_t_1 = NULL;
3658 int __pyx_lineno = 0;
3659 const char *__pyx_filename = NULL;
3660 int __pyx_clineno = 0;
3661 __Pyx_RefNannySetupContext(
"__cinit__", 0);
3679 __pyx_v_AS.Stype = SLU_NR;
3688 __pyx_v_AS.Dtype = SLU_D;
3697 __pyx_v_AS.Mtype = SLU_GE;
3706 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
3707 __Pyx_GOTREF(__pyx_t_1);
3708 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L1_error)
3709 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3710 __pyx_v_AS.nrow = __pyx_t_2;
3719 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
3720 __Pyx_GOTREF(__pyx_t_1);
3721 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error)
3722 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3723 __pyx_v_AS.ncol = __pyx_t_2;
3732 __pyx_v_AS.Store = (&__pyx_v_L->A);
3741 __pyx_v_rval =
basm_NR_init(__pyx_v_bs, (&__pyx_v_AS), (&__pyx_v_self->subdomain_dim), (&__pyx_v_self->l2g_L), (&__pyx_v_self->subdomain_L), (&__pyx_v_self->subdomain_R), (&__pyx_v_self->subdomain_dX), (&__pyx_v_self->subdomain_pivots), (&__pyx_v_self->subdomain_col_pivots));
3750 #ifndef CYTHON_WITHOUT_ASSERTIONS
3751 if (unlikely(!Py_OptimizeFlag)) {
3752 if (unlikely(!((__pyx_v_rval == 0) != 0))) {
3753 PyErr_SetNone(PyExc_AssertionError);
3754 __PYX_ERR(0, 72, __pyx_L1_error)
3771 __Pyx_XDECREF(__pyx_t_1);
3772 __Pyx_AddTraceback(
"csmoothers.cBASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3775 __Pyx_RefNannyFinishContext();
3788 static void __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(PyObject *__pyx_v_self);
3789 static void __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(PyObject *__pyx_v_self) {
3790 __Pyx_RefNannyDeclarations
3791 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
3792 __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self));
3795 __Pyx_RefNannyFinishContext();
3798 static void __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self) {
3799 __Pyx_RefNannyDeclarations
3800 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
3809 basm_NR_free(__pyx_v_self->N, __pyx_v_self->subdomain_dim, __pyx_v_self->l2g_L, __pyx_v_self->subdomain_L, __pyx_v_self->subdomain_R, __pyx_v_self->subdomain_dX, __pyx_v_self->subdomain_pivots, __pyx_v_self->subdomain_col_pivots);
3820 __Pyx_RefNannyFinishContext();
3830 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
3831 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3832 PyObject *__pyx_r = 0;
3833 __Pyx_RefNannyDeclarations
3834 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
3835 __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self));
3838 __Pyx_RefNannyFinishContext();
3842 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self) {
3843 PyObject *__pyx_r = NULL;
3844 __Pyx_RefNannyDeclarations
3845 PyObject *__pyx_t_1 = NULL;
3846 int __pyx_lineno = 0;
3847 const char *__pyx_filename = NULL;
3848 int __pyx_clineno = 0;
3849 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
3857 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
3858 __Pyx_GOTREF(__pyx_t_1);
3859 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3860 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3861 __PYX_ERR(1, 2, __pyx_L1_error)
3871 __Pyx_XDECREF(__pyx_t_1);
3872 __Pyx_AddTraceback(
"csmoothers.cBASMFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3874 __Pyx_XGIVEREF(__pyx_r);
3875 __Pyx_RefNannyFinishContext();
3887 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
3888 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3889 PyObject *__pyx_r = 0;
3890 __Pyx_RefNannyDeclarations
3891 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
3892 __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(((
struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3895 __Pyx_RefNannyFinishContext();
3899 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3900 PyObject *__pyx_r = NULL;
3901 __Pyx_RefNannyDeclarations
3902 PyObject *__pyx_t_1 = NULL;
3903 int __pyx_lineno = 0;
3904 const char *__pyx_filename = NULL;
3905 int __pyx_clineno = 0;
3906 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
3913 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
3914 __Pyx_GOTREF(__pyx_t_1);
3915 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3916 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3917 __PYX_ERR(1, 4, __pyx_L1_error)
3928 __Pyx_XDECREF(__pyx_t_1);
3929 __Pyx_AddTraceback(
"csmoothers.cBASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3931 __Pyx_XGIVEREF(__pyx_r);
3932 __Pyx_RefNannyFinishContext();
3945 static PyObject *__pyx_pw_10csmoothers_1jacobi_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3946 static char __pyx_doc_10csmoothers_jacobi_NR_prepare[] =
"\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n w : double\n tol : double\n M : np.array\n ";
3947 static PyMethodDef __pyx_mdef_10csmoothers_1jacobi_NR_prepare = {
"jacobi_NR_prepare", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_1jacobi_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_jacobi_NR_prepare};
3948 static PyObject *__pyx_pw_10csmoothers_1jacobi_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3949 PyObject *__pyx_v_A = 0;
3950 PyObject *__pyx_v_w = 0;
3951 PyObject *__pyx_v_tol = 0;
3952 PyObject *__pyx_v_M = 0;
3953 int __pyx_lineno = 0;
3954 const char *__pyx_filename = NULL;
3955 int __pyx_clineno = 0;
3956 PyObject *__pyx_r = 0;
3957 __Pyx_RefNannyDeclarations
3958 __Pyx_RefNannySetupContext(
"jacobi_NR_prepare (wrapper)", 0);
3960 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_M,0};
3961 PyObject* values[4] = {0,0,0,0};
3962 if (unlikely(__pyx_kwds)) {
3964 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3966 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3968 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3970 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3972 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3975 default:
goto __pyx_L5_argtuple_error;
3977 kw_args = PyDict_Size(__pyx_kwds);
3980 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
3981 else goto __pyx_L5_argtuple_error;
3984 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
3986 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_prepare", 1, 4, 4, 1); __PYX_ERR(0, 84, __pyx_L3_error)
3990 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
3992 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_prepare", 1, 4, 4, 2); __PYX_ERR(0, 84, __pyx_L3_error)
3996 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
3998 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_prepare", 1, 4, 4, 3); __PYX_ERR(0, 84, __pyx_L3_error)
4001 if (unlikely(kw_args > 0)) {
4002 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"jacobi_NR_prepare") < 0)) __PYX_ERR(0, 84, __pyx_L3_error)
4004 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
4005 goto __pyx_L5_argtuple_error;
4007 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4008 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4009 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4010 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4012 __pyx_v_A = values[0];
4013 __pyx_v_w = values[1];
4014 __pyx_v_tol = values[2];
4015 __pyx_v_M = values[3];
4017 goto __pyx_L4_argument_unpacking_done;
4018 __pyx_L5_argtuple_error:;
4019 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_prepare", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 84, __pyx_L3_error)
4021 __Pyx_AddTraceback(
"csmoothers.jacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4022 __Pyx_RefNannyFinishContext();
4024 __pyx_L4_argument_unpacking_done:;
4025 __pyx_r = __pyx_pf_10csmoothers_jacobi_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_tol, __pyx_v_M);
4028 __Pyx_RefNannyFinishContext();
4032 static PyObject *__pyx_pf_10csmoothers_jacobi_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M) {
4033 PyObject *__pyx_r = NULL;
4034 __Pyx_RefNannyDeclarations
4035 PyObject *__pyx_t_1 = NULL;
4038 __pyx_t_10csmoothers_DDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4039 int __pyx_lineno = 0;
4040 const char *__pyx_filename = NULL;
4041 int __pyx_clineno = 0;
4042 __Pyx_RefNannySetupContext(
"jacobi_NR_prepare", 0);
4051 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
4052 __Pyx_GOTREF(__pyx_t_1);
4053 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 94, __pyx_L1_error)
4054 __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_2 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error)
4055 __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_tol);
if (unlikely((__pyx_t_3 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error)
4056 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 94, __pyx_L1_error)
4057 __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4);
4058 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4059 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4060 __pyx_t_4.memview = NULL;
4061 __pyx_t_4.data = NULL;
4072 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4075 __Pyx_XDECREF(__pyx_t_1);
4076 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4077 __Pyx_AddTraceback(
"csmoothers.jacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4080 __Pyx_XGIVEREF(__pyx_r);
4081 __Pyx_RefNannyFinishContext();
4093 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
double __pyx_v_w,
double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_M) {
4094 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4095 __Pyx_RefNannyDeclarations
4096 PyObject *__pyx_t_1 = NULL;
4098 Py_ssize_t __pyx_t_3;
4099 int __pyx_lineno = 0;
4100 const char *__pyx_filename = NULL;
4101 int __pyx_clineno = 0;
4102 __Pyx_RefNannySetupContext(
"smootherWrappersjacobi_NR_prepare", 0);
4111 __pyx_v_AS.Stype = SLU_NR;
4120 __pyx_v_AS.Dtype = SLU_D;
4129 __pyx_v_AS.Mtype = SLU_GE;
4138 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
4139 __Pyx_GOTREF(__pyx_t_1);
4140 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error)
4141 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4142 __pyx_v_AS.nrow = __pyx_t_2;
4151 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
4152 __Pyx_GOTREF(__pyx_t_1);
4153 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error)
4154 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4155 __pyx_v_AS.ncol = __pyx_t_2;
4164 __pyx_v_AS.Store = (&__pyx_v_sm->A);
4175 if (__pyx_t_3 < 0) {
4176 __pyx_t_3 += __pyx_v_M.shape[0];
4177 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4178 }
else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
4179 if (unlikely(__pyx_t_2 != -1)) {
4180 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4181 __PYX_ERR(0, 107, __pyx_L1_error)
4183 jacobi_NR_prepare((&__pyx_v_AS), __pyx_v_w, __pyx_v_tol, (&(*((
double *) ( (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))));
4196 __Pyx_XDECREF(__pyx_t_1);
4197 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappersjacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4199 __Pyx_RefNannyFinishContext();
4211 static PyObject *__pyx_pw_10csmoothers_3jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4212 static char __pyx_doc_10csmoothers_2jacobi_NR_solve[] =
"\n \n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n M : np.array double\n R : np.array double\n node_order : np.array int\n dX : np.array double\n ";
4213 static PyMethodDef __pyx_mdef_10csmoothers_3jacobi_NR_solve = {
"jacobi_NR_solve", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_3jacobi_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_2jacobi_NR_solve};
4214 static PyObject *__pyx_pw_10csmoothers_3jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4215 PyObject *__pyx_v_A = 0;
4216 PyObject *__pyx_v_M = 0;
4217 PyObject *__pyx_v_R = 0;
4218 PyObject *__pyx_v_node_order = 0;
4219 PyObject *__pyx_v_dX = 0;
4220 int __pyx_lineno = 0;
4221 const char *__pyx_filename = NULL;
4222 int __pyx_clineno = 0;
4223 PyObject *__pyx_r = 0;
4224 __Pyx_RefNannyDeclarations
4225 __Pyx_RefNannySetupContext(
"jacobi_NR_solve (wrapper)", 0);
4227 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_M,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_dX,0};
4228 PyObject* values[5] = {0,0,0,0,0};
4229 if (unlikely(__pyx_kwds)) {
4231 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4233 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4235 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4237 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4239 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4241 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4244 default:
goto __pyx_L5_argtuple_error;
4246 kw_args = PyDict_Size(__pyx_kwds);
4249 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4250 else goto __pyx_L5_argtuple_error;
4253 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
4255 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_solve", 1, 5, 5, 1); __PYX_ERR(0, 109, __pyx_L3_error)
4259 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
4261 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_solve", 1, 5, 5, 2); __PYX_ERR(0, 109, __pyx_L3_error)
4265 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
4267 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_solve", 1, 5, 5, 3); __PYX_ERR(0, 109, __pyx_L3_error)
4271 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
4273 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_solve", 1, 5, 5, 4); __PYX_ERR(0, 109, __pyx_L3_error)
4276 if (unlikely(kw_args > 0)) {
4277 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"jacobi_NR_solve") < 0)) __PYX_ERR(0, 109, __pyx_L3_error)
4279 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4280 goto __pyx_L5_argtuple_error;
4282 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4283 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4284 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4285 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4286 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4288 __pyx_v_A = values[0];
4289 __pyx_v_M = values[1];
4290 __pyx_v_R = values[2];
4291 __pyx_v_node_order = values[3];
4292 __pyx_v_dX = values[4];
4294 goto __pyx_L4_argument_unpacking_done;
4295 __pyx_L5_argtuple_error:;
4296 __Pyx_RaiseArgtupleInvalid(
"jacobi_NR_solve", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 109, __pyx_L3_error)
4298 __Pyx_AddTraceback(
"csmoothers.jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4299 __Pyx_RefNannyFinishContext();
4301 __pyx_L4_argument_unpacking_done:;
4302 __pyx_r = __pyx_pf_10csmoothers_2jacobi_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_M, __pyx_v_R, __pyx_v_node_order, __pyx_v_dX);
4305 __Pyx_RefNannyFinishContext();
4309 static PyObject *__pyx_pf_10csmoothers_2jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX) {
4310 PyObject *__pyx_r = NULL;
4311 __Pyx_RefNannyDeclarations
4312 PyObject *__pyx_t_1 = NULL;
4313 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
4314 __pyx_t_10csmoothers_DDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
4315 __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4316 __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4317 int __pyx_lineno = 0;
4318 const char *__pyx_filename = NULL;
4319 int __pyx_clineno = 0;
4320 __Pyx_RefNannySetupContext(
"jacobi_NR_solve", 0);
4329 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
4330 __Pyx_GOTREF(__pyx_t_1);
4331 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 120, __pyx_L1_error)
4332 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4333 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4334 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4335 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4336 __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5);
4337 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4338 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4339 __pyx_t_2.memview = NULL;
4340 __pyx_t_2.data = NULL;
4341 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4342 __pyx_t_3.memview = NULL;
4343 __pyx_t_3.data = NULL;
4344 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4345 __pyx_t_4.memview = NULL;
4346 __pyx_t_4.data = NULL;
4347 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4348 __pyx_t_5.memview = NULL;
4349 __pyx_t_5.data = NULL;
4360 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4363 __Pyx_XDECREF(__pyx_t_1);
4364 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4365 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4366 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4367 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4368 __Pyx_AddTraceback(
"csmoothers.jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4371 __Pyx_XGIVEREF(__pyx_r);
4372 __Pyx_RefNannyFinishContext();
4384 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_M, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
4385 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4386 __Pyx_RefNannyDeclarations
4387 PyObject *__pyx_t_1 = NULL;
4389 Py_ssize_t __pyx_t_3;
4390 Py_ssize_t __pyx_t_4;
4391 Py_ssize_t __pyx_t_5;
4392 Py_ssize_t __pyx_t_6;
4393 int __pyx_lineno = 0;
4394 const char *__pyx_filename = NULL;
4395 int __pyx_clineno = 0;
4396 __Pyx_RefNannySetupContext(
"smootherWrappersjacobi_NR_solve", 0);
4405 __pyx_v_AS.Stype = SLU_NR;
4414 __pyx_v_AS.Dtype = SLU_D;
4423 __pyx_v_AS.Mtype = SLU_GE;
4432 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
4433 __Pyx_GOTREF(__pyx_t_1);
4434 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L1_error)
4435 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4436 __pyx_v_AS.nrow = __pyx_t_2;
4445 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
4446 __Pyx_GOTREF(__pyx_t_1);
4447 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
4448 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4449 __pyx_v_AS.ncol = __pyx_t_2;
4458 __pyx_v_AS.Store = (&__pyx_v_sm->A);
4469 if (__pyx_t_3 < 0) {
4470 __pyx_t_3 += __pyx_v_M.shape[0];
4471 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4472 }
else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
4473 if (unlikely(__pyx_t_2 != -1)) {
4474 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4475 __PYX_ERR(0, 134, __pyx_L1_error)
4479 if (__pyx_t_4 < 0) {
4480 __pyx_t_4 += __pyx_v_R.shape[0];
4481 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
4482 }
else if (unlikely(__pyx_t_4 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
4483 if (unlikely(__pyx_t_2 != -1)) {
4484 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4485 __PYX_ERR(0, 134, __pyx_L1_error)
4489 if (__pyx_t_5 < 0) {
4490 __pyx_t_5 += __pyx_v_node_order.shape[0];
4491 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
4492 }
else if (unlikely(__pyx_t_5 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
4493 if (unlikely(__pyx_t_2 != -1)) {
4494 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4495 __PYX_ERR(0, 134, __pyx_L1_error)
4499 if (__pyx_t_6 < 0) {
4500 __pyx_t_6 += __pyx_v_dX.shape[0];
4501 if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
4502 }
else if (unlikely(__pyx_t_6 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
4503 if (unlikely(__pyx_t_2 != -1)) {
4504 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4505 __PYX_ERR(0, 134, __pyx_L1_error)
4507 jacobi_NR_solve((&__pyx_v_AS), (&(*((
double *) ( (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))), (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_4 * __pyx_v_R.strides[0]) )))), (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_5 * __pyx_v_node_order.strides[0]) )))), (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_6 * __pyx_v_dX.strides[0]) )))));
4520 __Pyx_XDECREF(__pyx_t_1);
4521 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappersjacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4523 __Pyx_RefNannyFinishContext();
4535 static PyObject *__pyx_pw_10csmoothers_5nl_jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4536 static char __pyx_doc_10csmoothers_4nl_jacobi_NR_solve[] =
"\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n R : np.array double\n node_order : np.array int\n w : np.float\n tol : np.float\n dX : np.array double\n ";
4537 static PyMethodDef __pyx_mdef_10csmoothers_5nl_jacobi_NR_solve = {
"nl_jacobi_NR_solve", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_5nl_jacobi_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_4nl_jacobi_NR_solve};
4538 static PyObject *__pyx_pw_10csmoothers_5nl_jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4539 PyObject *__pyx_v_A = 0;
4540 PyObject *__pyx_v_R = 0;
4541 PyObject *__pyx_v_node_order = 0;
4542 PyObject *__pyx_v_w = 0;
4543 PyObject *__pyx_v_tol = 0;
4544 PyObject *__pyx_v_dX = 0;
4545 int __pyx_lineno = 0;
4546 const char *__pyx_filename = NULL;
4547 int __pyx_clineno = 0;
4548 PyObject *__pyx_r = 0;
4549 __Pyx_RefNannyDeclarations
4550 __Pyx_RefNannySetupContext(
"nl_jacobi_NR_solve (wrapper)", 0);
4552 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_dX,0};
4553 PyObject* values[6] = {0,0,0,0,0,0};
4554 if (unlikely(__pyx_kwds)) {
4556 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4558 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4560 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4562 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4564 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4566 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4568 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4571 default:
goto __pyx_L5_argtuple_error;
4573 kw_args = PyDict_Size(__pyx_kwds);
4576 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4577 else goto __pyx_L5_argtuple_error;
4580 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
4582 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 136, __pyx_L3_error)
4586 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
4588 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 136, __pyx_L3_error)
4592 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
4594 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 136, __pyx_L3_error)
4598 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
4600 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 136, __pyx_L3_error)
4604 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
4606 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 136, __pyx_L3_error)
4609 if (unlikely(kw_args > 0)) {
4610 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"nl_jacobi_NR_solve") < 0)) __PYX_ERR(0, 136, __pyx_L3_error)
4612 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4613 goto __pyx_L5_argtuple_error;
4615 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4616 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4617 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4618 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4619 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4620 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4622 __pyx_v_A = values[0];
4623 __pyx_v_R = values[1];
4624 __pyx_v_node_order = values[2];
4625 __pyx_v_w = values[3];
4626 __pyx_v_tol = values[4];
4627 __pyx_v_dX = values[5];
4629 goto __pyx_L4_argument_unpacking_done;
4630 __pyx_L5_argtuple_error:;
4631 __Pyx_RaiseArgtupleInvalid(
"nl_jacobi_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 136, __pyx_L3_error)
4633 __Pyx_AddTraceback(
"csmoothers.nl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4634 __Pyx_RefNannyFinishContext();
4636 __pyx_L4_argument_unpacking_done:;
4637 __pyx_r = __pyx_pf_10csmoothers_4nl_jacobi_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_R, __pyx_v_node_order, __pyx_v_w, __pyx_v_tol, __pyx_v_dX);
4640 __Pyx_RefNannyFinishContext();
4644 static PyObject *__pyx_pf_10csmoothers_4nl_jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX) {
4645 PyObject *__pyx_r = NULL;
4646 __Pyx_RefNannyDeclarations
4647 PyObject *__pyx_t_1 = NULL;
4648 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
4649 __pyx_t_10csmoothers_IDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
4652 __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
4653 int __pyx_lineno = 0;
4654 const char *__pyx_filename = NULL;
4655 int __pyx_clineno = 0;
4656 __Pyx_RefNannySetupContext(
"nl_jacobi_NR_solve", 0);
4665 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
4666 __Pyx_GOTREF(__pyx_t_1);
4667 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 148, __pyx_L1_error)
4668 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4669 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4670 __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_4 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
4671 __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_tol);
if (unlikely((__pyx_t_5 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
4672 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4673 __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6);
4674 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4675 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4676 __pyx_t_2.memview = NULL;
4677 __pyx_t_2.data = NULL;
4678 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4679 __pyx_t_3.memview = NULL;
4680 __pyx_t_3.data = NULL;
4681 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4682 __pyx_t_6.memview = NULL;
4683 __pyx_t_6.data = NULL;
4694 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4697 __Pyx_XDECREF(__pyx_t_1);
4698 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4699 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4700 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4701 __Pyx_AddTraceback(
"csmoothers.nl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4704 __Pyx_XGIVEREF(__pyx_r);
4705 __Pyx_RefNannyFinishContext();
4717 static void __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order,
double __pyx_v_w,
double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
4718 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4719 __Pyx_RefNannyDeclarations
4720 PyObject *__pyx_t_1 = NULL;
4722 Py_ssize_t __pyx_t_3;
4723 Py_ssize_t __pyx_t_4;
4724 Py_ssize_t __pyx_t_5;
4725 int __pyx_lineno = 0;
4726 const char *__pyx_filename = NULL;
4727 int __pyx_clineno = 0;
4728 __Pyx_RefNannySetupContext(
"smootherWrappersnl_jacobi_NR_solve", 0);
4737 __pyx_v_AS.Stype = SLU_NR;
4746 __pyx_v_AS.Dtype = SLU_D;
4755 __pyx_v_AS.Mtype = SLU_GE;
4764 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
4765 __Pyx_GOTREF(__pyx_t_1);
4766 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error)
4767 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4768 __pyx_v_AS.nrow = __pyx_t_2;
4777 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
4778 __Pyx_GOTREF(__pyx_t_1);
4779 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
4780 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4781 __pyx_v_AS.ncol = __pyx_t_2;
4790 __pyx_v_AS.Store = (&__pyx_v_sm->A);
4801 if (__pyx_t_3 < 0) {
4802 __pyx_t_3 += __pyx_v_R.shape[0];
4803 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4804 }
else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
4805 if (unlikely(__pyx_t_2 != -1)) {
4806 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4807 __PYX_ERR(0, 163, __pyx_L1_error)
4811 if (__pyx_t_4 < 0) {
4812 __pyx_t_4 += __pyx_v_node_order.shape[0];
4813 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
4814 }
else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
4815 if (unlikely(__pyx_t_2 != -1)) {
4816 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4817 __PYX_ERR(0, 163, __pyx_L1_error)
4821 if (__pyx_t_5 < 0) {
4822 __pyx_t_5 += __pyx_v_dX.shape[0];
4823 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
4824 }
else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
4825 if (unlikely(__pyx_t_2 != -1)) {
4826 __Pyx_RaiseBufferIndexError(__pyx_t_2);
4827 __PYX_ERR(0, 163, __pyx_L1_error)
4829 nl_jacobi_NR_solve((&__pyx_v_AS), (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_w, __pyx_v_tol, (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))));
4842 __Pyx_XDECREF(__pyx_t_1);
4843 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappersnl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4845 __Pyx_RefNannyFinishContext();
4857 static PyObject *__pyx_pw_10csmoothers_7gauss_seidel_NR_preare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4858 static char __pyx_doc_10csmoothers_6gauss_seidel_NR_preare[] =
"\n\n Arguments\n ---------\n A :\n w :\n tol :\n M :\n ";
4859 static PyMethodDef __pyx_mdef_10csmoothers_7gauss_seidel_NR_preare = {
"gauss_seidel_NR_preare", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_7gauss_seidel_NR_preare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_6gauss_seidel_NR_preare};
4860 static PyObject *__pyx_pw_10csmoothers_7gauss_seidel_NR_preare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4861 PyObject *__pyx_v_A = 0;
4862 PyObject *__pyx_v_w = 0;
4863 PyObject *__pyx_v_tol = 0;
4864 PyObject *__pyx_v_M = 0;
4865 int __pyx_lineno = 0;
4866 const char *__pyx_filename = NULL;
4867 int __pyx_clineno = 0;
4868 PyObject *__pyx_r = 0;
4869 __Pyx_RefNannyDeclarations
4870 __Pyx_RefNannySetupContext(
"gauss_seidel_NR_preare (wrapper)", 0);
4872 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_M,0};
4873 PyObject* values[4] = {0,0,0,0};
4874 if (unlikely(__pyx_kwds)) {
4876 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4878 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4880 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4882 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4884 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4887 default:
goto __pyx_L5_argtuple_error;
4889 kw_args = PyDict_Size(__pyx_kwds);
4892 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4893 else goto __pyx_L5_argtuple_error;
4896 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
4898 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_preare", 1, 4, 4, 1); __PYX_ERR(0, 165, __pyx_L3_error)
4902 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
4904 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_preare", 1, 4, 4, 2); __PYX_ERR(0, 165, __pyx_L3_error)
4908 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
4910 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_preare", 1, 4, 4, 3); __PYX_ERR(0, 165, __pyx_L3_error)
4913 if (unlikely(kw_args > 0)) {
4914 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"gauss_seidel_NR_preare") < 0)) __PYX_ERR(0, 165, __pyx_L3_error)
4916 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
4917 goto __pyx_L5_argtuple_error;
4919 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4920 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4921 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4922 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4924 __pyx_v_A = values[0];
4925 __pyx_v_w = values[1];
4926 __pyx_v_tol = values[2];
4927 __pyx_v_M = values[3];
4929 goto __pyx_L4_argument_unpacking_done;
4930 __pyx_L5_argtuple_error:;
4931 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_preare", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 165, __pyx_L3_error)
4933 __Pyx_AddTraceback(
"csmoothers.gauss_seidel_NR_preare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4934 __Pyx_RefNannyFinishContext();
4936 __pyx_L4_argument_unpacking_done:;
4937 __pyx_r = __pyx_pf_10csmoothers_6gauss_seidel_NR_preare(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_tol, __pyx_v_M);
4940 __Pyx_RefNannyFinishContext();
4944 static PyObject *__pyx_pf_10csmoothers_6gauss_seidel_NR_preare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M) {
4945 PyObject *__pyx_r = NULL;
4946 __Pyx_RefNannyDeclarations
4947 PyObject *__pyx_t_1 = NULL;
4950 __pyx_t_10csmoothers_DDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4951 int __pyx_lineno = 0;
4952 const char *__pyx_filename = NULL;
4953 int __pyx_clineno = 0;
4954 __Pyx_RefNannySetupContext(
"gauss_seidel_NR_preare", 0);
4963 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
4964 __Pyx_GOTREF(__pyx_t_1);
4965 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 175, __pyx_L1_error)
4966 __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_2 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
4967 __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_tol);
if (unlikely((__pyx_t_3 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
4968 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 175, __pyx_L1_error)
4969 __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4);
4970 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4971 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4972 __pyx_t_4.memview = NULL;
4973 __pyx_t_4.data = NULL;
4984 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4987 __Pyx_XDECREF(__pyx_t_1);
4988 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4989 __Pyx_AddTraceback(
"csmoothers.gauss_seidel_NR_preare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4992 __Pyx_XGIVEREF(__pyx_r);
4993 __Pyx_RefNannyFinishContext();
5005 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
double __pyx_v_w,
double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_M) {
5006 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5007 __Pyx_RefNannyDeclarations
5008 PyObject *__pyx_t_1 = NULL;
5010 Py_ssize_t __pyx_t_3;
5011 int __pyx_lineno = 0;
5012 const char *__pyx_filename = NULL;
5013 int __pyx_clineno = 0;
5014 __Pyx_RefNannySetupContext(
"smootherWrappersgauss_seidel_NR_prepare", 0);
5023 __pyx_v_AS.Stype = SLU_NR;
5032 __pyx_v_AS.Dtype = SLU_D;
5041 __pyx_v_AS.Mtype = SLU_GE;
5050 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error)
5051 __Pyx_GOTREF(__pyx_t_1);
5052 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
5053 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5054 __pyx_v_AS.nrow = __pyx_t_2;
5063 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error)
5064 __Pyx_GOTREF(__pyx_t_1);
5065 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error)
5066 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5067 __pyx_v_AS.ncol = __pyx_t_2;
5076 __pyx_v_AS.Store = (&__pyx_v_sm->A);
5087 if (__pyx_t_3 < 0) {
5088 __pyx_t_3 += __pyx_v_M.shape[0];
5089 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
5090 }
else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
5091 if (unlikely(__pyx_t_2 != -1)) {
5092 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5093 __PYX_ERR(0, 188, __pyx_L1_error)
5095 gauss_seidel_NR_prepare((&__pyx_v_AS), __pyx_v_w, __pyx_v_tol, (&(*((
double *) ( (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))));
5108 __Pyx_XDECREF(__pyx_t_1);
5109 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappersgauss_seidel_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5111 __Pyx_RefNannyFinishContext();
5123 static PyObject *__pyx_pw_10csmoothers_9gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5124 static char __pyx_doc_10csmoothers_8gauss_seidel_NR_solve[] =
"\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n M : np.array double\n R : np.array double\n node_order : np.array int\n dX : np.array double\n ";
5125 static PyMethodDef __pyx_mdef_10csmoothers_9gauss_seidel_NR_solve = {
"gauss_seidel_NR_solve", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_9gauss_seidel_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_8gauss_seidel_NR_solve};
5126 static PyObject *__pyx_pw_10csmoothers_9gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5127 PyObject *__pyx_v_A = 0;
5128 PyObject *__pyx_v_M = 0;
5129 PyObject *__pyx_v_R = 0;
5130 PyObject *__pyx_v_node_order = 0;
5131 PyObject *__pyx_v_dX = 0;
5132 int __pyx_lineno = 0;
5133 const char *__pyx_filename = NULL;
5134 int __pyx_clineno = 0;
5135 PyObject *__pyx_r = 0;
5136 __Pyx_RefNannyDeclarations
5137 __Pyx_RefNannySetupContext(
"gauss_seidel_NR_solve (wrapper)", 0);
5139 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_M,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_dX,0};
5140 PyObject* values[5] = {0,0,0,0,0};
5141 if (unlikely(__pyx_kwds)) {
5143 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5145 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5147 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5149 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5151 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5153 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5156 default:
goto __pyx_L5_argtuple_error;
5158 kw_args = PyDict_Size(__pyx_kwds);
5161 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5162 else goto __pyx_L5_argtuple_error;
5165 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
5167 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_solve", 1, 5, 5, 1); __PYX_ERR(0, 190, __pyx_L3_error)
5171 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
5173 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_solve", 1, 5, 5, 2); __PYX_ERR(0, 190, __pyx_L3_error)
5177 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
5179 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_solve", 1, 5, 5, 3); __PYX_ERR(0, 190, __pyx_L3_error)
5183 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
5185 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_solve", 1, 5, 5, 4); __PYX_ERR(0, 190, __pyx_L3_error)
5188 if (unlikely(kw_args > 0)) {
5189 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"gauss_seidel_NR_solve") < 0)) __PYX_ERR(0, 190, __pyx_L3_error)
5191 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
5192 goto __pyx_L5_argtuple_error;
5194 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5195 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5196 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5197 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5198 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5200 __pyx_v_A = values[0];
5201 __pyx_v_M = values[1];
5202 __pyx_v_R = values[2];
5203 __pyx_v_node_order = values[3];
5204 __pyx_v_dX = values[4];
5206 goto __pyx_L4_argument_unpacking_done;
5207 __pyx_L5_argtuple_error:;
5208 __Pyx_RaiseArgtupleInvalid(
"gauss_seidel_NR_solve", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 190, __pyx_L3_error)
5210 __Pyx_AddTraceback(
"csmoothers.gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5211 __Pyx_RefNannyFinishContext();
5213 __pyx_L4_argument_unpacking_done:;
5214 __pyx_r = __pyx_pf_10csmoothers_8gauss_seidel_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_M, __pyx_v_R, __pyx_v_node_order, __pyx_v_dX);
5217 __Pyx_RefNannyFinishContext();
5221 static PyObject *__pyx_pf_10csmoothers_8gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX) {
5222 PyObject *__pyx_r = NULL;
5223 __Pyx_RefNannyDeclarations
5224 PyObject *__pyx_t_1 = NULL;
5225 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
5226 __pyx_t_10csmoothers_DDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
5227 __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
5228 __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
5229 int __pyx_lineno = 0;
5230 const char *__pyx_filename = NULL;
5231 int __pyx_clineno = 0;
5232 __Pyx_RefNannySetupContext(
"gauss_seidel_NR_solve", 0);
5241 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
5242 __Pyx_GOTREF(__pyx_t_1);
5243 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 201, __pyx_L1_error)
5244 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5245 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5246 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5247 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5248 __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5);
5249 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5250 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5251 __pyx_t_2.memview = NULL;
5252 __pyx_t_2.data = NULL;
5253 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5254 __pyx_t_3.memview = NULL;
5255 __pyx_t_3.data = NULL;
5256 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
5257 __pyx_t_4.memview = NULL;
5258 __pyx_t_4.data = NULL;
5259 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
5260 __pyx_t_5.memview = NULL;
5261 __pyx_t_5.data = NULL;
5272 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5275 __Pyx_XDECREF(__pyx_t_1);
5276 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5277 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5278 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
5279 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
5280 __Pyx_AddTraceback(
"csmoothers.gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5283 __Pyx_XGIVEREF(__pyx_r);
5284 __Pyx_RefNannyFinishContext();
5296 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_M, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
5297 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5298 __Pyx_RefNannyDeclarations
5299 PyObject *__pyx_t_1 = NULL;
5301 Py_ssize_t __pyx_t_3;
5302 Py_ssize_t __pyx_t_4;
5303 Py_ssize_t __pyx_t_5;
5304 Py_ssize_t __pyx_t_6;
5305 int __pyx_lineno = 0;
5306 const char *__pyx_filename = NULL;
5307 int __pyx_clineno = 0;
5308 __Pyx_RefNannySetupContext(
"smootherWrappersgauss_seidel_NR_solve", 0);
5317 __pyx_v_AS.Stype = SLU_NR;
5326 __pyx_v_AS.Dtype = SLU_D;
5335 __pyx_v_AS.Mtype = SLU_GE;
5344 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error)
5345 __Pyx_GOTREF(__pyx_t_1);
5346 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L1_error)
5347 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5348 __pyx_v_AS.nrow = __pyx_t_2;
5357 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
5358 __Pyx_GOTREF(__pyx_t_1);
5359 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 213, __pyx_L1_error)
5360 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5361 __pyx_v_AS.ncol = __pyx_t_2;
5370 __pyx_v_AS.Store = (&__pyx_v_sm->A);
5381 if (__pyx_t_3 < 0) {
5382 __pyx_t_3 += __pyx_v_M.shape[0];
5383 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
5384 }
else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
5385 if (unlikely(__pyx_t_2 != -1)) {
5386 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5387 __PYX_ERR(0, 215, __pyx_L1_error)
5391 if (__pyx_t_4 < 0) {
5392 __pyx_t_4 += __pyx_v_R.shape[0];
5393 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
5394 }
else if (unlikely(__pyx_t_4 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
5395 if (unlikely(__pyx_t_2 != -1)) {
5396 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5397 __PYX_ERR(0, 215, __pyx_L1_error)
5401 if (__pyx_t_5 < 0) {
5402 __pyx_t_5 += __pyx_v_node_order.shape[0];
5403 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
5404 }
else if (unlikely(__pyx_t_5 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
5405 if (unlikely(__pyx_t_2 != -1)) {
5406 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5407 __PYX_ERR(0, 215, __pyx_L1_error)
5411 if (__pyx_t_6 < 0) {
5412 __pyx_t_6 += __pyx_v_dX.shape[0];
5413 if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
5414 }
else if (unlikely(__pyx_t_6 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
5415 if (unlikely(__pyx_t_2 != -1)) {
5416 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5417 __PYX_ERR(0, 215, __pyx_L1_error)
5419 gauss_seidel_NR_solve((&__pyx_v_AS), (&(*((
double *) ( (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))), (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_4 * __pyx_v_R.strides[0]) )))), (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_5 * __pyx_v_node_order.strides[0]) )))), (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_6 * __pyx_v_dX.strides[0]) )))));
5432 __Pyx_XDECREF(__pyx_t_1);
5433 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappersgauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5435 __Pyx_RefNannyFinishContext();
5447 static PyObject *__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5448 static char __pyx_doc_10csmoothers_10nl_gauss_seidel_NR_solve[] =
"\n \n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n R : np.array double\n node_order : np.array int\n w : double\n tol : double\n dX : np.array double\n ";
5449 static PyMethodDef __pyx_mdef_10csmoothers_11nl_gauss_seidel_NR_solve = {
"nl_gauss_seidel_NR_solve", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_10nl_gauss_seidel_NR_solve};
5450 static PyObject *__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5451 PyObject *__pyx_v_A = 0;
5452 PyObject *__pyx_v_R = 0;
5453 PyObject *__pyx_v_node_order = 0;
5454 PyObject *__pyx_v_w = 0;
5455 PyObject *__pyx_v_tol = 0;
5456 PyObject *__pyx_v_dX = 0;
5457 int __pyx_lineno = 0;
5458 const char *__pyx_filename = NULL;
5459 int __pyx_clineno = 0;
5460 PyObject *__pyx_r = 0;
5461 __Pyx_RefNannyDeclarations
5462 __Pyx_RefNannySetupContext(
"nl_gauss_seidel_NR_solve (wrapper)", 0);
5464 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_dX,0};
5465 PyObject* values[6] = {0,0,0,0,0,0};
5466 if (unlikely(__pyx_kwds)) {
5468 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5470 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5472 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5474 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5476 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5478 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5480 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5483 default:
goto __pyx_L5_argtuple_error;
5485 kw_args = PyDict_Size(__pyx_kwds);
5488 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5489 else goto __pyx_L5_argtuple_error;
5492 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
5494 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 217, __pyx_L3_error)
5498 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
5500 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 217, __pyx_L3_error)
5504 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
5506 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 217, __pyx_L3_error)
5510 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
5512 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 217, __pyx_L3_error)
5516 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
5518 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 217, __pyx_L3_error)
5521 if (unlikely(kw_args > 0)) {
5522 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"nl_gauss_seidel_NR_solve") < 0)) __PYX_ERR(0, 217, __pyx_L3_error)
5524 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
5525 goto __pyx_L5_argtuple_error;
5527 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5528 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5529 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5530 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5531 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5532 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5534 __pyx_v_A = values[0];
5535 __pyx_v_R = values[1];
5536 __pyx_v_node_order = values[2];
5537 __pyx_v_w = values[3];
5538 __pyx_v_tol = values[4];
5539 __pyx_v_dX = values[5];
5541 goto __pyx_L4_argument_unpacking_done;
5542 __pyx_L5_argtuple_error:;
5543 __Pyx_RaiseArgtupleInvalid(
"nl_gauss_seidel_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 217, __pyx_L3_error)
5545 __Pyx_AddTraceback(
"csmoothers.nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5546 __Pyx_RefNannyFinishContext();
5548 __pyx_L4_argument_unpacking_done:;
5549 __pyx_r = __pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_R, __pyx_v_node_order, __pyx_v_w, __pyx_v_tol, __pyx_v_dX);
5552 __Pyx_RefNannyFinishContext();
5556 static PyObject *__pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX) {
5557 PyObject *__pyx_r = NULL;
5558 __Pyx_RefNannyDeclarations
5559 PyObject *__pyx_t_1 = NULL;
5560 __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
5561 __pyx_t_10csmoothers_IDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
5564 __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5565 PyObject *__pyx_t_7 = NULL;
5566 int __pyx_lineno = 0;
5567 const char *__pyx_filename = NULL;
5568 int __pyx_clineno = 0;
5569 __Pyx_RefNannySetupContext(
"nl_gauss_seidel_NR_solve", 0);
5578 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
5579 __Pyx_GOTREF(__pyx_t_1);
5580 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 229, __pyx_L1_error)
5589 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 230, __pyx_L1_error)
5598 __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 231, __pyx_L1_error)
5607 __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_4 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 232, __pyx_L1_error)
5616 __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_tol);
if (unlikely((__pyx_t_5 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L1_error)
5625 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 234, __pyx_L1_error)
5634 __pyx_t_7 = __pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 229, __pyx_L1_error)
5635 __Pyx_GOTREF(__pyx_t_7);
5636 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5637 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5638 __pyx_t_2.memview = NULL;
5639 __pyx_t_2.data = NULL;
5640 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5641 __pyx_t_3.memview = NULL;
5642 __pyx_t_3.data = NULL;
5643 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5644 __pyx_t_6.memview = NULL;
5645 __pyx_t_6.data = NULL;
5646 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5657 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5660 __Pyx_XDECREF(__pyx_t_1);
5661 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5662 __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5663 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5664 __Pyx_XDECREF(__pyx_t_7);
5665 __Pyx_AddTraceback(
"csmoothers.nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5668 __Pyx_XGIVEREF(__pyx_r);
5669 __Pyx_RefNannyFinishContext();
5681 static PyObject *__pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order,
double __pyx_v_w,
double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
5682 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5683 PyObject *__pyx_r = NULL;
5684 __Pyx_RefNannyDeclarations
5685 PyObject *__pyx_t_1 = NULL;
5687 Py_ssize_t __pyx_t_3;
5688 Py_ssize_t __pyx_t_4;
5689 Py_ssize_t __pyx_t_5;
5690 int __pyx_lineno = 0;
5691 const char *__pyx_filename = NULL;
5692 int __pyx_clineno = 0;
5693 __Pyx_RefNannySetupContext(
"smootherWrappers_nl_gauss_seidel_NR_solve", 0);
5702 __pyx_v_AS.Stype = SLU_NR;
5711 __pyx_v_AS.Dtype = SLU_D;
5720 __pyx_v_AS.Mtype = SLU_GE;
5729 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
5730 __Pyx_GOTREF(__pyx_t_1);
5731 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 246, __pyx_L1_error)
5732 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5733 __pyx_v_AS.nrow = __pyx_t_2;
5742 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
5743 __Pyx_GOTREF(__pyx_t_1);
5744 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 247, __pyx_L1_error)
5745 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5746 __pyx_v_AS.ncol = __pyx_t_2;
5755 __pyx_v_AS.Store = (&__pyx_v_sm->A);
5766 if (__pyx_t_3 < 0) {
5767 __pyx_t_3 += __pyx_v_R.shape[0];
5768 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
5769 }
else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
5770 if (unlikely(__pyx_t_2 != -1)) {
5771 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5772 __PYX_ERR(0, 249, __pyx_L1_error)
5776 if (__pyx_t_4 < 0) {
5777 __pyx_t_4 += __pyx_v_node_order.shape[0];
5778 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
5779 }
else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
5780 if (unlikely(__pyx_t_2 != -1)) {
5781 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5782 __PYX_ERR(0, 249, __pyx_L1_error)
5786 if (__pyx_t_5 < 0) {
5787 __pyx_t_5 += __pyx_v_dX.shape[0];
5788 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
5789 }
else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
5790 if (unlikely(__pyx_t_2 != -1)) {
5791 __Pyx_RaiseBufferIndexError(__pyx_t_2);
5792 __PYX_ERR(0, 249, __pyx_L1_error)
5794 nl_gauss_seidel_NR_solve((&__pyx_v_AS), (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_w, __pyx_v_tol, (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))));
5805 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5808 __Pyx_XDECREF(__pyx_t_1);
5809 __Pyx_AddTraceback(
"csmoothers.smootherWrappers_nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5812 __Pyx_XGIVEREF(__pyx_r);
5813 __Pyx_RefNannyFinishContext();
5826 static PyObject *__pyx_pw_10csmoothers_13asm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5827 static char __pyx_doc_10csmoothers_12asm_NR_prepare[] =
"\n\n Arguments\n ---------\n A :\n asmFactor :\n ";
5828 static PyMethodDef __pyx_mdef_10csmoothers_13asm_NR_prepare = {
"asm_NR_prepare", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_13asm_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_12asm_NR_prepare};
5829 static PyObject *__pyx_pw_10csmoothers_13asm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5830 PyObject *__pyx_v_A = 0;
5831 PyObject *__pyx_v_asmFactor = 0;
5832 int __pyx_lineno = 0;
5833 const char *__pyx_filename = NULL;
5834 int __pyx_clineno = 0;
5835 PyObject *__pyx_r = 0;
5836 __Pyx_RefNannyDeclarations
5837 __Pyx_RefNannySetupContext(
"asm_NR_prepare (wrapper)", 0);
5839 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_asmFactor,0};
5840 PyObject* values[2] = {0,0};
5841 if (unlikely(__pyx_kwds)) {
5843 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5845 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5847 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5850 default:
goto __pyx_L5_argtuple_error;
5852 kw_args = PyDict_Size(__pyx_kwds);
5855 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5856 else goto __pyx_L5_argtuple_error;
5859 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asmFactor)) != 0)) kw_args--;
5861 __Pyx_RaiseArgtupleInvalid(
"asm_NR_prepare", 1, 2, 2, 1); __PYX_ERR(0, 251, __pyx_L3_error)
5864 if (unlikely(kw_args > 0)) {
5865 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asm_NR_prepare") < 0)) __PYX_ERR(0, 251, __pyx_L3_error)
5867 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5868 goto __pyx_L5_argtuple_error;
5870 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5871 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5873 __pyx_v_A = values[0];
5874 __pyx_v_asmFactor = values[1];
5876 goto __pyx_L4_argument_unpacking_done;
5877 __pyx_L5_argtuple_error:;
5878 __Pyx_RaiseArgtupleInvalid(
"asm_NR_prepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 251, __pyx_L3_error)
5880 __Pyx_AddTraceback(
"csmoothers.asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5881 __Pyx_RefNannyFinishContext();
5883 __pyx_L4_argument_unpacking_done:;
5884 __pyx_r = __pyx_pf_10csmoothers_12asm_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_asmFactor);
5887 __Pyx_RefNannyFinishContext();
5891 static PyObject *__pyx_pf_10csmoothers_12asm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_asmFactor) {
5892 PyObject *__pyx_r = NULL;
5893 __Pyx_RefNannyDeclarations
5894 PyObject *__pyx_t_1 = NULL;
5895 PyObject *__pyx_t_2 = NULL;
5896 int __pyx_lineno = 0;
5897 const char *__pyx_filename = NULL;
5898 int __pyx_clineno = 0;
5899 __Pyx_RefNannySetupContext(
"asm_NR_prepare", 0);
5908 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
5909 __Pyx_GOTREF(__pyx_t_1);
5910 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 259, __pyx_L1_error)
5919 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_asmFactor, __pyx_n_s_cASMFactor);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
5920 __Pyx_GOTREF(__pyx_t_2);
5921 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10csmoothers_cASMFactor))))) __PYX_ERR(0, 260, __pyx_L1_error)
5930 __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_t_2));
5931 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5932 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5943 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5946 __Pyx_XDECREF(__pyx_t_1);
5947 __Pyx_XDECREF(__pyx_t_2);
5948 __Pyx_AddTraceback(
"csmoothers.asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5951 __Pyx_XGIVEREF(__pyx_r);
5952 __Pyx_RefNannyFinishContext();
5964 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_asmFactor) {
5965 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5966 __Pyx_RefNannyDeclarations
5967 PyObject *__pyx_t_1 = NULL;
5969 int __pyx_lineno = 0;
5970 const char *__pyx_filename = NULL;
5971 int __pyx_clineno = 0;
5972 __Pyx_RefNannySetupContext(
"smootherWrappers_asm_NR_prepare", 0);
5981 __pyx_v_AS.Stype = SLU_NR;
5990 __pyx_v_AS.Dtype = SLU_D;
5999 __pyx_v_AS.Mtype = SLU_GE;
6008 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
6009 __Pyx_GOTREF(__pyx_t_1);
6010 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L1_error)
6011 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6012 __pyx_v_AS.nrow = __pyx_t_2;
6021 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
6022 __Pyx_GOTREF(__pyx_t_1);
6023 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
6024 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6025 __pyx_v_AS.ncol = __pyx_t_2;
6034 __pyx_v_AS.Store = (&__pyx_v_sm->A);
6043 asm_NR_prepare((&__pyx_v_AS), __pyx_v_asmFactor->subdomain_dim, __pyx_v_asmFactor->l2g_L, __pyx_v_asmFactor->subdomain_L, __pyx_v_asmFactor->subdomain_pivots);
6056 __Pyx_XDECREF(__pyx_t_1);
6057 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappers_asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6059 __Pyx_RefNannyFinishContext();
6071 static PyObject *__pyx_pw_10csmoothers_15asm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6072 static char __pyx_doc_10csmoothers_14asm_NR_solve[] =
"\n \n Arguments\n ---------\n A : superluWrappers.sparseMatrix\n w : double\n asmFactor : csmoothers.asmFactor\n node_order : np.array int\n R : np.array double\n dX : np.array double\n ";
6073 static PyMethodDef __pyx_mdef_10csmoothers_15asm_NR_solve = {
"asm_NR_solve", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_15asm_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_14asm_NR_solve};
6074 static PyObject *__pyx_pw_10csmoothers_15asm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6075 PyObject *__pyx_v_A = 0;
6076 PyObject *__pyx_v_w = 0;
6077 PyObject *__pyx_v_asmFactor = 0;
6078 PyObject *__pyx_v_node_order = 0;
6079 PyObject *__pyx_v_R = 0;
6080 PyObject *__pyx_v_dX = 0;
6081 int __pyx_lineno = 0;
6082 const char *__pyx_filename = NULL;
6083 int __pyx_clineno = 0;
6084 PyObject *__pyx_r = 0;
6085 __Pyx_RefNannyDeclarations
6086 __Pyx_RefNannySetupContext(
"asm_NR_solve (wrapper)", 0);
6088 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_asmFactor,&__pyx_n_s_node_order,&__pyx_n_s_R,&__pyx_n_s_dX,0};
6089 PyObject* values[6] = {0,0,0,0,0,0};
6090 if (unlikely(__pyx_kwds)) {
6092 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6094 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6096 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6098 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6100 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6102 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6104 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6107 default:
goto __pyx_L5_argtuple_error;
6109 kw_args = PyDict_Size(__pyx_kwds);
6112 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6113 else goto __pyx_L5_argtuple_error;
6116 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
6118 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 277, __pyx_L3_error)
6122 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asmFactor)) != 0)) kw_args--;
6124 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 277, __pyx_L3_error)
6128 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
6130 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 277, __pyx_L3_error)
6134 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
6136 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 277, __pyx_L3_error)
6140 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
6142 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 277, __pyx_L3_error)
6145 if (unlikely(kw_args > 0)) {
6146 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"asm_NR_solve") < 0)) __PYX_ERR(0, 277, __pyx_L3_error)
6148 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
6149 goto __pyx_L5_argtuple_error;
6151 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6152 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6153 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6154 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6155 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6156 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6158 __pyx_v_A = values[0];
6159 __pyx_v_w = values[1];
6160 __pyx_v_asmFactor = values[2];
6161 __pyx_v_node_order = values[3];
6162 __pyx_v_R = values[4];
6163 __pyx_v_dX = values[5];
6165 goto __pyx_L4_argument_unpacking_done;
6166 __pyx_L5_argtuple_error:;
6167 __Pyx_RaiseArgtupleInvalid(
"asm_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 277, __pyx_L3_error)
6169 __Pyx_AddTraceback(
"csmoothers.asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6170 __Pyx_RefNannyFinishContext();
6172 __pyx_L4_argument_unpacking_done:;
6173 __pyx_r = __pyx_pf_10csmoothers_14asm_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_asmFactor, __pyx_v_node_order, __pyx_v_R, __pyx_v_dX);
6176 __Pyx_RefNannyFinishContext();
6180 static PyObject *__pyx_pf_10csmoothers_14asm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_asmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX) {
6181 PyObject *__pyx_r = NULL;
6182 __Pyx_RefNannyDeclarations
6183 PyObject *__pyx_t_1 = NULL;
6185 PyObject *__pyx_t_3 = NULL;
6186 __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
6187 __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
6188 __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6189 int __pyx_lineno = 0;
6190 const char *__pyx_filename = NULL;
6191 int __pyx_clineno = 0;
6192 __Pyx_RefNannySetupContext(
"asm_NR_solve", 0);
6201 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
6202 __Pyx_GOTREF(__pyx_t_1);
6203 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 289, __pyx_L1_error)
6212 __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w);
if (unlikely((__pyx_t_2 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L1_error)
6221 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_asmFactor, __pyx_n_s_cASMFactor);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error)
6222 __Pyx_GOTREF(__pyx_t_3);
6223 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10csmoothers_cASMFactor))))) __PYX_ERR(0, 291, __pyx_L1_error)
6232 __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 292, __pyx_L1_error)
6241 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 293, __pyx_L1_error)
6250 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 294, __pyx_L1_error)
6259 __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(((
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, ((
struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_t_3), __pyx_t_4, __pyx_t_5, __pyx_t_6);
6260 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6261 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6262 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6263 __pyx_t_4.memview = NULL;
6264 __pyx_t_4.data = NULL;
6265 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6266 __pyx_t_5.memview = NULL;
6267 __pyx_t_5.data = NULL;
6268 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6269 __pyx_t_6.memview = NULL;
6270 __pyx_t_6.data = NULL;
6281 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6284 __Pyx_XDECREF(__pyx_t_1);
6285 __Pyx_XDECREF(__pyx_t_3);
6286 __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6287 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6288 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6289 __Pyx_AddTraceback(
"csmoothers.asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6292 __Pyx_XGIVEREF(__pyx_r);
6293 __Pyx_RefNannyFinishContext();
6305 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(
struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm,
double __pyx_v_w,
struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_asmFactor, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
6306 __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
6307 __Pyx_RefNannyDeclarations
6308 PyObject *__pyx_t_1 = NULL;
6310 Py_ssize_t __pyx_t_3;
6311 Py_ssize_t __pyx_t_4;
6312 Py_ssize_t __pyx_t_5;
6313 int __pyx_lineno = 0;
6314 const char *__pyx_filename = NULL;
6315 int __pyx_clineno = 0;
6316 __Pyx_RefNannySetupContext(
"smootherWrappers_asm_NR_solve", 0);
6325 __pyx_v_AS.Stype = SLU_NR;
6334 __pyx_v_AS.Dtype = SLU_D;
6343 __pyx_v_AS.Mtype = SLU_GE;
6352 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error)
6353 __Pyx_GOTREF(__pyx_t_1);
6354 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 306, __pyx_L1_error)
6355 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6356 __pyx_v_AS.nrow = __pyx_t_2;
6365 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
6366 __Pyx_GOTREF(__pyx_t_1);
6367 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L1_error)
6368 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6369 __pyx_v_AS.ncol = __pyx_t_2;
6378 __pyx_v_AS.Store = (&__pyx_v_sm->A);
6389 if (__pyx_t_3 < 0) {
6390 __pyx_t_3 += __pyx_v_R.shape[0];
6391 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
6392 }
else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
6393 if (unlikely(__pyx_t_2 != -1)) {
6394 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6395 __PYX_ERR(0, 314, __pyx_L1_error)
6407 if (__pyx_t_4 < 0) {
6408 __pyx_t_4 += __pyx_v_node_order.shape[0];
6409 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
6410 }
else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
6411 if (unlikely(__pyx_t_2 != -1)) {
6412 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6413 __PYX_ERR(0, 316, __pyx_L1_error)
6425 if (__pyx_t_5 < 0) {
6426 __pyx_t_5 += __pyx_v_dX.shape[0];
6427 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
6428 }
else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
6429 if (unlikely(__pyx_t_2 != -1)) {
6430 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6431 __PYX_ERR(0, 318, __pyx_L1_error)
6441 asm_NR_solve((&__pyx_v_AS), __pyx_v_w, __pyx_v_asmFactor->subdomain_L, __pyx_v_asmFactor->subdomain_dim, __pyx_v_asmFactor->l2g_L, (&(*((
double *) ( (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), __pyx_v_asmFactor->subdomain_R, (&(*((
int *) ( (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_asmFactor->subdomain_dX, (&(*((
double *) ( (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))), __pyx_v_asmFactor->subdomain_pivots);
6454 __Pyx_XDECREF(__pyx_t_1);
6455 __Pyx_WriteUnraisable(
"csmoothers.smootherWrappers_asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6457 __Pyx_RefNannyFinishContext();
6469 static PyObject *__pyx_pw_10csmoothers_17basm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6470 static char __pyx_doc_10csmoothers_16basm_NR_prepare[] =
"\n\n Arguments\n ---------\n A :\n basmFactor :\n ";
6471 static PyMethodDef __pyx_mdef_10csmoothers_17basm_NR_prepare = {
"basm_NR_prepare", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_17basm_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_16basm_NR_prepare};
6472 static PyObject *__pyx_pw_10csmoothers_17basm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6473 PyObject *__pyx_v_A = 0;
6474 PyObject *__pyx_v_basmFactor = 0;
6475 int __pyx_lineno = 0;
6476 const char *__pyx_filename = NULL;
6477 int __pyx_clineno = 0;
6478 PyObject *__pyx_r = 0;
6479 __Pyx_RefNannyDeclarations
6480 __Pyx_RefNannySetupContext(
"basm_NR_prepare (wrapper)", 0);
6482 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_basmFactor,0};
6483 PyObject* values[2] = {0,0};
6484 if (unlikely(__pyx_kwds)) {
6486 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6488 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6490 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6493 default:
goto __pyx_L5_argtuple_error;
6495 kw_args = PyDict_Size(__pyx_kwds);
6498 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6499 else goto __pyx_L5_argtuple_error;
6502 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_basmFactor)) != 0)) kw_args--;
6504 __Pyx_RaiseArgtupleInvalid(
"basm_NR_prepare", 1, 2, 2, 1); __PYX_ERR(0, 321, __pyx_L3_error)
6507 if (unlikely(kw_args > 0)) {
6508 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"basm_NR_prepare") < 0)) __PYX_ERR(0, 321, __pyx_L3_error)
6510 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
6511 goto __pyx_L5_argtuple_error;
6513 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6514 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6516 __pyx_v_A = values[0];
6517 __pyx_v_basmFactor = values[1];
6519 goto __pyx_L4_argument_unpacking_done;
6520 __pyx_L5_argtuple_error:;
6521 __Pyx_RaiseArgtupleInvalid(
"basm_NR_prepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 321, __pyx_L3_error)
6523 __Pyx_AddTraceback(
"csmoothers.basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
6524 __Pyx_RefNannyFinishContext();
6526 __pyx_L4_argument_unpacking_done:;
6527 __pyx_r = __pyx_pf_10csmoothers_16basm_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_basmFactor);
6530 __Pyx_RefNannyFinishContext();
6534 static PyObject *__pyx_pf_10csmoothers_16basm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_basmFactor) {
6535 PyObject *__pyx_r = NULL;
6536 __Pyx_RefNannyDeclarations
6537 PyObject *__pyx_t_1 = NULL;
6538 PyObject *__pyx_t_2 = NULL;
6539 int __pyx_lineno = 0;
6540 const char *__pyx_filename = NULL;
6541 int __pyx_clineno = 0;
6542 __Pyx_RefNannySetupContext(
"basm_NR_prepare", 0);
6551 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
6552 __Pyx_GOTREF(__pyx_t_1);
6553 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 329, __pyx_L1_error)