proteus  1.8.1
C/C++/Fortran libraries
csmoothers.c
Go to the documentation of this file.
1 /* Generated by Cython 0.29.30 */
2 
3 #ifndef PY_SSIZE_T_CLEAN
4 #define PY_SSIZE_T_CLEAN
5 #endif /* PY_SSIZE_T_CLEAN */
6 #include "Python.h"
7 #ifndef Py_PYTHON_H
8  #error Python headers needed to compile C extensions, please install development version of Python.
9 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
10  #error Cython requires Python 2.6+ or Python 3.3+.
11 #else
12 #define CYTHON_ABI "0_29_30"
13 #define CYTHON_HEX_VERSION 0x001D1EF0
14 #define CYTHON_FUTURE_DIVISION 0
15 #include <stddef.h>
16 #ifndef offsetof
17  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
18 #endif
19 #if !defined(WIN32) && !defined(MS_WINDOWS)
20  #ifndef __stdcall
21  #define __stdcall
22  #endif
23  #ifndef __cdecl
24  #define __cdecl
25  #endif
26  #ifndef __fastcall
27  #define __fastcall
28  #endif
29 #endif
30 #ifndef DL_IMPORT
31  #define DL_IMPORT(t) t
32 #endif
33 #ifndef DL_EXPORT
34  #define DL_EXPORT(t) t
35 #endif
36 #define __PYX_COMMA ,
37 #ifndef HAVE_LONG_LONG
38  #if PY_VERSION_HEX >= 0x02070000
39  #define HAVE_LONG_LONG
40  #endif
41 #endif
42 #ifndef PY_LONG_LONG
43  #define PY_LONG_LONG LONG_LONG
44 #endif
45 #ifndef Py_HUGE_VAL
46  #define Py_HUGE_VAL HUGE_VAL
47 #endif
48 #ifdef PYPY_VERSION
49  #define CYTHON_COMPILING_IN_PYPY 1
50  #define CYTHON_COMPILING_IN_PYSTON 0
51  #define CYTHON_COMPILING_IN_CPYTHON 0
52  #undef CYTHON_USE_TYPE_SLOTS
53  #define CYTHON_USE_TYPE_SLOTS 0
54  #undef CYTHON_USE_PYTYPE_LOOKUP
55  #define CYTHON_USE_PYTYPE_LOOKUP 0
56  #if PY_VERSION_HEX < 0x03050000
57  #undef CYTHON_USE_ASYNC_SLOTS
58  #define CYTHON_USE_ASYNC_SLOTS 0
59  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
60  #define CYTHON_USE_ASYNC_SLOTS 1
61  #endif
62  #undef CYTHON_USE_PYLIST_INTERNALS
63  #define CYTHON_USE_PYLIST_INTERNALS 0
64  #undef CYTHON_USE_UNICODE_INTERNALS
65  #define CYTHON_USE_UNICODE_INTERNALS 0
66  #undef CYTHON_USE_UNICODE_WRITER
67  #define CYTHON_USE_UNICODE_WRITER 0
68  #undef CYTHON_USE_PYLONG_INTERNALS
69  #define CYTHON_USE_PYLONG_INTERNALS 0
70  #undef CYTHON_AVOID_BORROWED_REFS
71  #define CYTHON_AVOID_BORROWED_REFS 1
72  #undef CYTHON_ASSUME_SAFE_MACROS
73  #define CYTHON_ASSUME_SAFE_MACROS 0
74  #undef CYTHON_UNPACK_METHODS
75  #define CYTHON_UNPACK_METHODS 0
76  #undef CYTHON_FAST_THREAD_STATE
77  #define CYTHON_FAST_THREAD_STATE 0
78  #undef CYTHON_FAST_PYCALL
79  #define CYTHON_FAST_PYCALL 0
80  #undef CYTHON_PEP489_MULTI_PHASE_INIT
81  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
82  #undef CYTHON_USE_TP_FINALIZE
83  #define CYTHON_USE_TP_FINALIZE 0
84  #undef CYTHON_USE_DICT_VERSIONS
85  #define CYTHON_USE_DICT_VERSIONS 0
86  #undef CYTHON_USE_EXC_INFO_STACK
87  #define CYTHON_USE_EXC_INFO_STACK 0
88  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
89  #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)
90  #endif
91 #elif defined(PYSTON_VERSION)
92  #define CYTHON_COMPILING_IN_PYPY 0
93  #define CYTHON_COMPILING_IN_PYSTON 1
94  #define CYTHON_COMPILING_IN_CPYTHON 0
95  #ifndef CYTHON_USE_TYPE_SLOTS
96  #define CYTHON_USE_TYPE_SLOTS 1
97  #endif
98  #undef CYTHON_USE_PYTYPE_LOOKUP
99  #define CYTHON_USE_PYTYPE_LOOKUP 0
100  #undef CYTHON_USE_ASYNC_SLOTS
101  #define CYTHON_USE_ASYNC_SLOTS 0
102  #undef CYTHON_USE_PYLIST_INTERNALS
103  #define CYTHON_USE_PYLIST_INTERNALS 0
104  #ifndef CYTHON_USE_UNICODE_INTERNALS
105  #define CYTHON_USE_UNICODE_INTERNALS 1
106  #endif
107  #undef CYTHON_USE_UNICODE_WRITER
108  #define CYTHON_USE_UNICODE_WRITER 0
109  #undef CYTHON_USE_PYLONG_INTERNALS
110  #define CYTHON_USE_PYLONG_INTERNALS 0
111  #ifndef CYTHON_AVOID_BORROWED_REFS
112  #define CYTHON_AVOID_BORROWED_REFS 0
113  #endif
114  #ifndef CYTHON_ASSUME_SAFE_MACROS
115  #define CYTHON_ASSUME_SAFE_MACROS 1
116  #endif
117  #ifndef CYTHON_UNPACK_METHODS
118  #define CYTHON_UNPACK_METHODS 1
119  #endif
120  #undef CYTHON_FAST_THREAD_STATE
121  #define CYTHON_FAST_THREAD_STATE 0
122  #undef CYTHON_FAST_PYCALL
123  #define CYTHON_FAST_PYCALL 0
124  #undef CYTHON_PEP489_MULTI_PHASE_INIT
125  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
126  #undef CYTHON_USE_TP_FINALIZE
127  #define CYTHON_USE_TP_FINALIZE 0
128  #undef CYTHON_USE_DICT_VERSIONS
129  #define CYTHON_USE_DICT_VERSIONS 0
130  #undef CYTHON_USE_EXC_INFO_STACK
131  #define CYTHON_USE_EXC_INFO_STACK 0
132  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
133  #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
134  #endif
135 #else
136  #define CYTHON_COMPILING_IN_PYPY 0
137  #define CYTHON_COMPILING_IN_PYSTON 0
138  #define CYTHON_COMPILING_IN_CPYTHON 1
139  #ifndef CYTHON_USE_TYPE_SLOTS
140  #define CYTHON_USE_TYPE_SLOTS 1
141  #endif
142  #if PY_VERSION_HEX < 0x02070000
143  #undef CYTHON_USE_PYTYPE_LOOKUP
144  #define CYTHON_USE_PYTYPE_LOOKUP 0
145  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
146  #define CYTHON_USE_PYTYPE_LOOKUP 1
147  #endif
148  #if PY_MAJOR_VERSION < 3
149  #undef CYTHON_USE_ASYNC_SLOTS
150  #define CYTHON_USE_ASYNC_SLOTS 0
151  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
152  #define CYTHON_USE_ASYNC_SLOTS 1
153  #endif
154  #if PY_VERSION_HEX < 0x02070000
155  #undef CYTHON_USE_PYLONG_INTERNALS
156  #define CYTHON_USE_PYLONG_INTERNALS 0
157  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
158  #define CYTHON_USE_PYLONG_INTERNALS 1
159  #endif
160  #ifndef CYTHON_USE_PYLIST_INTERNALS
161  #define CYTHON_USE_PYLIST_INTERNALS 1
162  #endif
163  #ifndef CYTHON_USE_UNICODE_INTERNALS
164  #define CYTHON_USE_UNICODE_INTERNALS 1
165  #endif
166  #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
167  #undef CYTHON_USE_UNICODE_WRITER
168  #define CYTHON_USE_UNICODE_WRITER 0
169  #elif !defined(CYTHON_USE_UNICODE_WRITER)
170  #define CYTHON_USE_UNICODE_WRITER 1
171  #endif
172  #ifndef CYTHON_AVOID_BORROWED_REFS
173  #define CYTHON_AVOID_BORROWED_REFS 0
174  #endif
175  #ifndef CYTHON_ASSUME_SAFE_MACROS
176  #define CYTHON_ASSUME_SAFE_MACROS 1
177  #endif
178  #ifndef CYTHON_UNPACK_METHODS
179  #define CYTHON_UNPACK_METHODS 1
180  #endif
181  #if PY_VERSION_HEX >= 0x030B00A4
182  #undef CYTHON_FAST_THREAD_STATE
183  #define CYTHON_FAST_THREAD_STATE 0
184  #elif !defined(CYTHON_FAST_THREAD_STATE)
185  #define CYTHON_FAST_THREAD_STATE 1
186  #endif
187  #ifndef CYTHON_FAST_PYCALL
188  #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
189  #endif
190  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
191  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
192  #endif
193  #ifndef CYTHON_USE_TP_FINALIZE
194  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
195  #endif
196  #ifndef CYTHON_USE_DICT_VERSIONS
197  #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
198  #endif
199  #if PY_VERSION_HEX >= 0x030B00A4
200  #undef CYTHON_USE_EXC_INFO_STACK
201  #define CYTHON_USE_EXC_INFO_STACK 0
202  #elif !defined(CYTHON_USE_EXC_INFO_STACK)
203  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
204  #endif
205  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
206  #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
207  #endif
208 #endif
209 #if !defined(CYTHON_FAST_PYCCALL)
210 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
211 #endif
212 #if CYTHON_USE_PYLONG_INTERNALS
213  #if PY_MAJOR_VERSION < 3
214  #include "longintrepr.h"
215  #endif
216  #undef SHIFT
217  #undef BASE
218  #undef MASK
219  #ifdef SIZEOF_VOID_P
220  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
221  #endif
222 #endif
223 #ifndef __has_attribute
224  #define __has_attribute(x) 0
225 #endif
226 #ifndef __has_cpp_attribute
227  #define __has_cpp_attribute(x) 0
228 #endif
229 #ifndef CYTHON_RESTRICT
230  #if defined(__GNUC__)
231  #define CYTHON_RESTRICT __restrict__
232  #elif defined(_MSC_VER) && _MSC_VER >= 1400
233  #define CYTHON_RESTRICT __restrict
234  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
235  #define CYTHON_RESTRICT restrict
236  #else
237  #define CYTHON_RESTRICT
238  #endif
239 #endif
240 #ifndef CYTHON_UNUSED
241 # if defined(__GNUC__)
242 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
243 # define CYTHON_UNUSED __attribute__ ((__unused__))
244 # else
245 # define CYTHON_UNUSED
246 # endif
247 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
248 # define CYTHON_UNUSED __attribute__ ((__unused__))
249 # else
250 # define CYTHON_UNUSED
251 # endif
252 #endif
253 #ifndef CYTHON_MAYBE_UNUSED_VAR
254 # if defined(__cplusplus)
255  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
256 # else
257 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
258 # endif
259 #endif
260 #ifndef CYTHON_NCP_UNUSED
261 # if CYTHON_COMPILING_IN_CPYTHON
262 # define CYTHON_NCP_UNUSED
263 # else
264 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
265 # endif
266 #endif
267 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
268 #ifdef _MSC_VER
269  #ifndef _MSC_STDINT_H_
270  #if _MSC_VER < 1300
271  typedef unsigned char uint8_t;
272  typedef unsigned int uint32_t;
273  #else
274  typedef unsigned __int8 uint8_t;
275  typedef unsigned __int32 uint32_t;
276  #endif
277  #endif
278 #else
279  #include <stdint.h>
280 #endif
281 #ifndef CYTHON_FALLTHROUGH
282  #if defined(__cplusplus) && __cplusplus >= 201103L
283  #if __has_cpp_attribute(fallthrough)
284  #define CYTHON_FALLTHROUGH [[fallthrough]]
285  #elif __has_cpp_attribute(clang::fallthrough)
286  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
287  #elif __has_cpp_attribute(gnu::fallthrough)
288  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
289  #endif
290  #endif
291  #ifndef CYTHON_FALLTHROUGH
292  #if __has_attribute(fallthrough)
293  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
294  #else
295  #define CYTHON_FALLTHROUGH
296  #endif
297  #endif
298  #if defined(__clang__ ) && defined(__apple_build_version__)
299  #if __apple_build_version__ < 7000000
300  #undef CYTHON_FALLTHROUGH
301  #define CYTHON_FALLTHROUGH
302  #endif
303  #endif
304 #endif
305 
306 #ifndef CYTHON_INLINE
307  #if defined(__clang__)
308  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
309  #elif defined(__GNUC__)
310  #define CYTHON_INLINE __inline__
311  #elif defined(_MSC_VER)
312  #define CYTHON_INLINE __inline
313  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
314  #define CYTHON_INLINE inline
315  #else
316  #define CYTHON_INLINE
317  #endif
318 #endif
319 
320 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
321  #define Py_OptimizeFlag 0
322 #endif
323 #define __PYX_BUILD_PY_SSIZE_T "n"
324 #define CYTHON_FORMAT_SSIZE_T "z"
325 #if PY_MAJOR_VERSION < 3
326  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
327  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
328  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
329  #define __Pyx_DefaultClassType PyClass_Type
330 #else
331  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
332  #define __Pyx_DefaultClassType PyType_Type
333 #if PY_VERSION_HEX >= 0x030B00A1
334  static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
335  PyObject *code, PyObject *c, PyObject* n, PyObject *v,
336  PyObject *fv, PyObject *cell, PyObject* fn,
337  PyObject *name, int fline, PyObject *lnos) {
338  PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
339  PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
340  const char *fn_cstr=NULL;
341  const char *name_cstr=NULL;
342  PyCodeObject* co=NULL;
343  PyObject *type, *value, *traceback;
344  PyErr_Fetch(&type, &value, &traceback);
345  if (!(kwds=PyDict_New())) goto end;
346  if (!(argcount=PyLong_FromLong(a))) goto end;
347  if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
348  if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
349  if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
350  if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
351  if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
352  if (!(nlocals=PyLong_FromLong(l))) goto end;
353  if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
354  if (!(stacksize=PyLong_FromLong(s))) goto end;
355  if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
356  if (!(flags=PyLong_FromLong(f))) goto end;
357  if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
358  if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
359  if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
360  if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
361  if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
362  if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
363  if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
364  if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
365  if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
366  if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
367  if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
368  if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
369  if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
370  if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
371  Py_XDECREF((PyObject*)co);
372  co = (PyCodeObject*)call_result;
373  call_result = NULL;
374  if (0) {
375  cleanup_code_too:
376  Py_XDECREF((PyObject*)co);
377  co = NULL;
378  }
379  end:
380  Py_XDECREF(kwds);
381  Py_XDECREF(argcount);
382  Py_XDECREF(posonlyargcount);
383  Py_XDECREF(kwonlyargcount);
384  Py_XDECREF(nlocals);
385  Py_XDECREF(stacksize);
386  Py_XDECREF(replace);
387  Py_XDECREF(call_result);
388  Py_XDECREF(empty);
389  if (type) {
390  PyErr_Restore(type, value, traceback);
391  }
392  return co;
393  }
394 #else
395  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
396  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
397 #endif
398  #define __Pyx_DefaultClassType PyType_Type
399 #endif
400 #ifndef Py_TPFLAGS_CHECKTYPES
401  #define Py_TPFLAGS_CHECKTYPES 0
402 #endif
403 #ifndef Py_TPFLAGS_HAVE_INDEX
404  #define Py_TPFLAGS_HAVE_INDEX 0
405 #endif
406 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
407  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
408 #endif
409 #ifndef Py_TPFLAGS_HAVE_FINALIZE
410  #define Py_TPFLAGS_HAVE_FINALIZE 0
411 #endif
412 #ifndef METH_STACKLESS
413  #define METH_STACKLESS 0
414 #endif
415 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
416  #ifndef METH_FASTCALL
417  #define METH_FASTCALL 0x80
418  #endif
419  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
420  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
421  Py_ssize_t nargs, PyObject *kwnames);
422 #else
423  #define __Pyx_PyCFunctionFast _PyCFunctionFast
424  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
425 #endif
426 #if CYTHON_FAST_PYCCALL
427 #define __Pyx_PyFastCFunction_Check(func)\
428  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
429 #else
430 #define __Pyx_PyFastCFunction_Check(func) 0
431 #endif
432 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
433  #define PyObject_Malloc(s) PyMem_Malloc(s)
434  #define PyObject_Free(p) PyMem_Free(p)
435  #define PyObject_Realloc(p) PyMem_Realloc(p)
436 #endif
437 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
438  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
439  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
440  #define PyMem_RawFree(p) PyMem_Free(p)
441 #endif
442 #if CYTHON_COMPILING_IN_PYSTON
443  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
444  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
445 #else
446  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
447  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
448 #endif
449 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
450  #define __Pyx_PyThreadState_Current PyThreadState_GET()
451 #elif PY_VERSION_HEX >= 0x03060000
452  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
453 #elif PY_VERSION_HEX >= 0x03000000
454  #define __Pyx_PyThreadState_Current PyThreadState_GET()
455 #else
456  #define __Pyx_PyThreadState_Current _PyThreadState_Current
457 #endif
458 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
459 #include "pythread.h"
460 #define Py_tss_NEEDS_INIT 0
461 typedef int Py_tss_t;
462 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
463  *key = PyThread_create_key();
464  return 0;
465 }
466 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
467  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
468  *key = Py_tss_NEEDS_INIT;
469  return key;
470 }
471 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
472  PyObject_Free(key);
473 }
474 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
475  return *key != Py_tss_NEEDS_INIT;
476 }
477 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
478  PyThread_delete_key(*key);
479  *key = Py_tss_NEEDS_INIT;
480 }
481 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
482  return PyThread_set_key_value(*key, value);
483 }
484 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
485  return PyThread_get_key_value(*key);
486 }
487 #endif
488 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
489 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
490 #else
491 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
492 #endif
493 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
494  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
495  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
496 #else
497  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
498  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
499 #endif
500 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
501 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
502 #else
503 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
504 #endif
505 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
506  #define CYTHON_PEP393_ENABLED 1
507  #if defined(PyUnicode_IS_READY)
508  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
509  0 : _PyUnicode_Ready((PyObject *)(op)))
510  #else
511  #define __Pyx_PyUnicode_READY(op) (0)
512  #endif
513  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
514  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
515  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
516  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
517  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
518  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
519  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
520  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
521  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
522  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
523  #else
524  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
525  #endif
526  #else
527  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
528  #endif
529 #else
530  #define CYTHON_PEP393_ENABLED 0
531  #define PyUnicode_1BYTE_KIND 1
532  #define PyUnicode_2BYTE_KIND 2
533  #define PyUnicode_4BYTE_KIND 4
534  #define __Pyx_PyUnicode_READY(op) (0)
535  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
536  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
537  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
538  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
539  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
540  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
541  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
542  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
543 #endif
544 #if CYTHON_COMPILING_IN_PYPY
545  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
546  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
547 #else
548  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
549  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
550  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
551 #endif
552 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
553  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
554 #endif
555 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
556  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
557 #endif
558 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
559  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
560 #endif
561 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
562 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
563 #if PY_MAJOR_VERSION >= 3
564  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
565 #else
566  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
567 #endif
568 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
569  #define PyObject_ASCII(o) PyObject_Repr(o)
570 #endif
571 #if PY_MAJOR_VERSION >= 3
572  #define PyBaseString_Type PyUnicode_Type
573  #define PyStringObject PyUnicodeObject
574  #define PyString_Type PyUnicode_Type
575  #define PyString_Check PyUnicode_Check
576  #define PyString_CheckExact PyUnicode_CheckExact
577 #ifndef PyObject_Unicode
578  #define PyObject_Unicode PyObject_Str
579 #endif
580 #endif
581 #if PY_MAJOR_VERSION >= 3
582  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
583  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
584 #else
585  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
586  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
587 #endif
588 #ifndef PySet_CheckExact
589  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
590 #endif
591 #if PY_VERSION_HEX >= 0x030900A4
592  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
593  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
594 #else
595  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
596  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
597 #endif
598 #if CYTHON_ASSUME_SAFE_MACROS
599  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
600 #else
601  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
602 #endif
603 #if PY_MAJOR_VERSION >= 3
604  #define PyIntObject PyLongObject
605  #define PyInt_Type PyLong_Type
606  #define PyInt_Check(op) PyLong_Check(op)
607  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
608  #define PyInt_FromString PyLong_FromString
609  #define PyInt_FromUnicode PyLong_FromUnicode
610  #define PyInt_FromLong PyLong_FromLong
611  #define PyInt_FromSize_t PyLong_FromSize_t
612  #define PyInt_FromSsize_t PyLong_FromSsize_t
613  #define PyInt_AsLong PyLong_AsLong
614  #define PyInt_AS_LONG PyLong_AS_LONG
615  #define PyInt_AsSsize_t PyLong_AsSsize_t
616  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
617  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
618  #define PyNumber_Int PyNumber_Long
619 #endif
620 #if PY_MAJOR_VERSION >= 3
621  #define PyBoolObject PyLongObject
622 #endif
623 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
624  #ifndef PyUnicode_InternFromString
625  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
626  #endif
627 #endif
628 #if PY_VERSION_HEX < 0x030200A4
629  typedef long Py_hash_t;
630  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
631  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
632 #else
633  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
634  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
635 #endif
636 #if PY_MAJOR_VERSION >= 3
637  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
638 #else
639  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
640 #endif
641 #if CYTHON_USE_ASYNC_SLOTS
642  #if PY_VERSION_HEX >= 0x030500B1
643  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
644  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
645  #else
646  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
647  #endif
648 #else
649  #define __Pyx_PyType_AsAsync(obj) NULL
650 #endif
651 #ifndef __Pyx_PyAsyncMethodsStruct
652  typedef struct {
653  unaryfunc am_await;
654  unaryfunc am_aiter;
655  unaryfunc am_anext;
656  } __Pyx_PyAsyncMethodsStruct;
657 #endif
658 
659 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
660  #if !defined(_USE_MATH_DEFINES)
661  #define _USE_MATH_DEFINES
662  #endif
663 #endif
664 #include <math.h>
665 #ifdef NAN
666 #define __PYX_NAN() ((float) NAN)
667 #else
668 static CYTHON_INLINE float __PYX_NAN() {
669  float value;
670  memset(&value, 0xFF, sizeof(value));
671  return value;
672 }
673 #endif
674 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
675 #define __Pyx_truncl trunc
676 #else
677 #define __Pyx_truncl truncl
678 #endif
679 
680 #define __PYX_MARK_ERR_POS(f_index, lineno) \
681  { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
682 #define __PYX_ERR(f_index, lineno, Ln_error) \
683  { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
684 
685 #ifndef __PYX_EXTERN_C
686  #ifdef __cplusplus
687  #define __PYX_EXTERN_C extern "C"
688  #else
689  #define __PYX_EXTERN_C extern
690  #endif
691 #endif
692 
693 #define __PYX_HAVE__csmoothers
694 #define __PYX_HAVE_API__csmoothers
695 /* Early includes */
696 #include <string.h>
697 #include <stdio.h>
698 #include "numpy/arrayobject.h"
699 #include "numpy/ndarrayobject.h"
700 #include "numpy/ndarraytypes.h"
701 #include "numpy/arrayscalars.h"
702 #include "numpy/ufuncobject.h"
703 
704  /* NumPy API declarations from "numpy/__init__.pxd" */
705 
706 #include "proteus_superlu.h"
707 #include "smoothers.h"
708 #include "pythread.h"
709 #include <stdlib.h>
710 #include "pystate.h"
711 #ifdef _OPENMP
712 #include <omp.h>
713 #endif /* _OPENMP */
714 
715 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
716 #define CYTHON_WITHOUT_ASSERTIONS
717 #endif
718 
719 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
720  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
721 
722 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
723 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
724 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
725 #define __PYX_DEFAULT_STRING_ENCODING ""
726 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
727 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
728 #define __Pyx_uchar_cast(c) ((unsigned char)c)
729 #define __Pyx_long_cast(x) ((long)x)
730 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
731  (sizeof(type) < sizeof(Py_ssize_t)) ||\
732  (sizeof(type) > sizeof(Py_ssize_t) &&\
733  likely(v < (type)PY_SSIZE_T_MAX ||\
734  v == (type)PY_SSIZE_T_MAX) &&\
735  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
736  v == (type)PY_SSIZE_T_MIN))) ||\
737  (sizeof(type) == sizeof(Py_ssize_t) &&\
738  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
739  v == (type)PY_SSIZE_T_MAX))) )
740 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
741  return (size_t) i < (size_t) limit;
742 }
743 #if defined (__cplusplus) && __cplusplus >= 201103L
744  #include <cstdlib>
745  #define __Pyx_sst_abs(value) std::abs(value)
746 #elif SIZEOF_INT >= SIZEOF_SIZE_T
747  #define __Pyx_sst_abs(value) abs(value)
748 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
749  #define __Pyx_sst_abs(value) labs(value)
750 #elif defined (_MSC_VER)
751  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
752 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
753  #define __Pyx_sst_abs(value) llabs(value)
754 #elif defined (__GNUC__)
755  #define __Pyx_sst_abs(value) __builtin_llabs(value)
756 #else
757  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
758 #endif
759 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
760 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
761 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
762 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
763 #define __Pyx_PyBytes_FromString PyBytes_FromString
764 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
765 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
766 #if PY_MAJOR_VERSION < 3
767  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
768  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
769 #else
770  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
771  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
772 #endif
773 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
774 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
775 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
776 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
777 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
778 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
779 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
780 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
781 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
782 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
783 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
784 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
785 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
786 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
787 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
788 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
789 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
790  const Py_UNICODE *u_end = u;
791  while (*u_end++) ;
792  return (size_t)(u_end - u - 1);
793 }
794 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
795 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
796 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
797 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
798 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
799 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
800 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
801 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
802 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
803 #define __Pyx_PySequence_Tuple(obj)\
804  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
805 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
806 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
807 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
808 #if CYTHON_ASSUME_SAFE_MACROS
809 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
810 #else
811 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
812 #endif
813 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
814 #if PY_MAJOR_VERSION >= 3
815 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
816 #else
817 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
818 #endif
819 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
820 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
821 static int __Pyx_sys_getdefaultencoding_not_ascii;
822 static int __Pyx_init_sys_getdefaultencoding_params(void) {
823  PyObject* sys;
824  PyObject* default_encoding = NULL;
825  PyObject* ascii_chars_u = NULL;
826  PyObject* ascii_chars_b = NULL;
827  const char* default_encoding_c;
828  sys = PyImport_ImportModule("sys");
829  if (!sys) goto bad;
830  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
831  Py_DECREF(sys);
832  if (!default_encoding) goto bad;
833  default_encoding_c = PyBytes_AsString(default_encoding);
834  if (!default_encoding_c) goto bad;
835  if (strcmp(default_encoding_c, "ascii") == 0) {
836  __Pyx_sys_getdefaultencoding_not_ascii = 0;
837  } else {
838  char ascii_chars[128];
839  int c;
840  for (c = 0; c < 128; c++) {
841  ascii_chars[c] = c;
842  }
843  __Pyx_sys_getdefaultencoding_not_ascii = 1;
844  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
845  if (!ascii_chars_u) goto bad;
846  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
847  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
848  PyErr_Format(
849  PyExc_ValueError,
850  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
851  default_encoding_c);
852  goto bad;
853  }
854  Py_DECREF(ascii_chars_u);
855  Py_DECREF(ascii_chars_b);
856  }
857  Py_DECREF(default_encoding);
858  return 0;
859 bad:
860  Py_XDECREF(default_encoding);
861  Py_XDECREF(ascii_chars_u);
862  Py_XDECREF(ascii_chars_b);
863  return -1;
864 }
865 #endif
866 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
867 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
868 #else
869 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
870 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
871 static char* __PYX_DEFAULT_STRING_ENCODING;
872 static int __Pyx_init_sys_getdefaultencoding_params(void) {
873  PyObject* sys;
874  PyObject* default_encoding = NULL;
875  char* default_encoding_c;
876  sys = PyImport_ImportModule("sys");
877  if (!sys) goto bad;
878  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
879  Py_DECREF(sys);
880  if (!default_encoding) goto bad;
881  default_encoding_c = PyBytes_AsString(default_encoding);
882  if (!default_encoding_c) goto bad;
883  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
884  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
885  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
886  Py_DECREF(default_encoding);
887  return 0;
888 bad:
889  Py_XDECREF(default_encoding);
890  return -1;
891 }
892 #endif
893 #endif
894 
895 
896 /* Test for GCC > 2.95 */
897 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
898  #define likely(x) __builtin_expect(!!(x), 1)
899  #define unlikely(x) __builtin_expect(!!(x), 0)
900 #else /* !__GNUC__ or GCC < 2.95 */
901  #define likely(x) (x)
902  #define unlikely(x) (x)
903 #endif /* __GNUC__ */
904 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
905 
906 static PyObject *__pyx_m = NULL;
907 static PyObject *__pyx_d;
908 static PyObject *__pyx_b;
909 static PyObject *__pyx_cython_runtime = NULL;
910 static PyObject *__pyx_empty_tuple;
911 static PyObject *__pyx_empty_bytes;
912 static PyObject *__pyx_empty_unicode;
913 static int __pyx_lineno;
914 static int __pyx_clineno = 0;
915 static const char * __pyx_cfilenm= __FILE__;
916 static const char *__pyx_filename;
917 
918 /* Header.proto */
919 #if !defined(CYTHON_CCOMPLEX)
920  #if defined(__cplusplus)
921  #define CYTHON_CCOMPLEX 1
922  #elif defined(_Complex_I)
923  #define CYTHON_CCOMPLEX 1
924  #else
925  #define CYTHON_CCOMPLEX 0
926  #endif
927 #endif
928 #if CYTHON_CCOMPLEX
929  #ifdef __cplusplus
930  #include <complex>
931  #else
932  #include <complex.h>
933  #endif
934 #endif
935 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
936  #undef _Complex_I
937  #define _Complex_I 1.0fj
938 #endif
939 
940 
941 static const char *__pyx_f[] = {
942  "proteus/csmoothers.pyx",
943  "stringsource",
944  "__init__.pxd",
945  "type.pxd",
946  "proteus/superluWrappers.pxd",
947 };
948 /* MemviewSliceStruct.proto */
949 struct __pyx_memoryview_obj;
950 typedef struct {
951  struct __pyx_memoryview_obj *memview;
952  char *data;
953  Py_ssize_t shape[8];
954  Py_ssize_t strides[8];
955  Py_ssize_t suboffsets[8];
956 } __Pyx_memviewslice;
957 #define __Pyx_MemoryView_Len(m) (m.shape[0])
958 
959 /* Atomics.proto */
960 #include <pythread.h>
961 #ifndef CYTHON_ATOMICS
962  #define CYTHON_ATOMICS 1
963 #endif
964 #define __pyx_atomic_int_type int
965 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
966  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
967  !defined(__i386__)
968  #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
969  #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
970  #ifdef __PYX_DEBUG_ATOMICS
971  #warning "Using GNU atomics"
972  #endif
973 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
974  #include <Windows.h>
975  #undef __pyx_atomic_int_type
976  #define __pyx_atomic_int_type LONG
977  #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
978  #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
979  #ifdef __PYX_DEBUG_ATOMICS
980  #pragma message ("Using MSVC atomics")
981  #endif
982 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
983  #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
984  #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
985  #ifdef __PYX_DEBUG_ATOMICS
986  #warning "Using Intel atomics"
987  #endif
988 #else
989  #undef CYTHON_ATOMICS
990  #define CYTHON_ATOMICS 0
991  #ifdef __PYX_DEBUG_ATOMICS
992  #warning "Not using atomics"
993  #endif
994 #endif
995 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
996 #if CYTHON_ATOMICS
997  #define __pyx_add_acquisition_count(memview)\
998  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
999  #define __pyx_sub_acquisition_count(memview)\
1000  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
1001 #else
1002  #define __pyx_add_acquisition_count(memview)\
1003  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1004  #define __pyx_sub_acquisition_count(memview)\
1005  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1006 #endif
1007 
1008 /* ForceInitThreads.proto */
1009 #ifndef __PYX_FORCE_INIT_THREADS
1010  #define __PYX_FORCE_INIT_THREADS 0
1011 #endif
1012 
1013 /* NoFastGil.proto */
1014 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1015 #define __Pyx_PyGILState_Release PyGILState_Release
1016 #define __Pyx_FastGIL_Remember()
1017 #define __Pyx_FastGIL_Forget()
1018 #define __Pyx_FastGilFuncInit()
1019 
1020 /* BufferFormatStructs.proto */
1021 #define IS_UNSIGNED(type) (((type) -1) > 0)
1022 struct __Pyx_StructField_;
1023 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1024 typedef struct {
1025  const char* name;
1026  struct __Pyx_StructField_* fields;
1027  size_t size;
1028  size_t arraysize[8];
1029  int ndim;
1030  char typegroup;
1031  char is_unsigned;
1032  int flags;
1033 } __Pyx_TypeInfo;
1034 typedef struct __Pyx_StructField_ {
1035  __Pyx_TypeInfo* type;
1036  const char* name;
1037  size_t offset;
1038 } __Pyx_StructField;
1039 typedef struct {
1040  __Pyx_StructField* field;
1041  size_t parent_offset;
1042 } __Pyx_BufFmt_StackElem;
1043 typedef struct {
1044  __Pyx_StructField root;
1045  __Pyx_BufFmt_StackElem* head;
1046  size_t fmt_offset;
1047  size_t new_count, enc_count;
1048  size_t struct_alignment;
1049  int is_complex;
1050  char enc_type;
1051  char new_packmode;
1052  char enc_packmode;
1053  char is_valid_array;
1054 } __Pyx_BufFmt_Context;
1055 
1056 
1057 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":690
1058  * # in Cython to enable them only on the right systems.
1059  *
1060  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1061  * ctypedef npy_int16 int16_t
1062  * ctypedef npy_int32 int32_t
1063  */
1064 typedef npy_int8 __pyx_t_5numpy_int8_t;
1065 
1066 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":691
1067  *
1068  * ctypedef npy_int8 int8_t
1069  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1070  * ctypedef npy_int32 int32_t
1071  * ctypedef npy_int64 int64_t
1072  */
1073 typedef npy_int16 __pyx_t_5numpy_int16_t;
1074 
1075 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":692
1076  * ctypedef npy_int8 int8_t
1077  * ctypedef npy_int16 int16_t
1078  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1079  * ctypedef npy_int64 int64_t
1080  * #ctypedef npy_int96 int96_t
1081  */
1082 typedef npy_int32 __pyx_t_5numpy_int32_t;
1083 
1084 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":693
1085  * ctypedef npy_int16 int16_t
1086  * ctypedef npy_int32 int32_t
1087  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1088  * #ctypedef npy_int96 int96_t
1089  * #ctypedef npy_int128 int128_t
1090  */
1091 typedef npy_int64 __pyx_t_5numpy_int64_t;
1092 
1093 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":697
1094  * #ctypedef npy_int128 int128_t
1095  *
1096  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1097  * ctypedef npy_uint16 uint16_t
1098  * ctypedef npy_uint32 uint32_t
1099  */
1100 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1101 
1102 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":698
1103  *
1104  * ctypedef npy_uint8 uint8_t
1105  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1106  * ctypedef npy_uint32 uint32_t
1107  * ctypedef npy_uint64 uint64_t
1108  */
1109 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1110 
1111 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":699
1112  * ctypedef npy_uint8 uint8_t
1113  * ctypedef npy_uint16 uint16_t
1114  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1115  * ctypedef npy_uint64 uint64_t
1116  * #ctypedef npy_uint96 uint96_t
1117  */
1118 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1119 
1120 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":700
1121  * ctypedef npy_uint16 uint16_t
1122  * ctypedef npy_uint32 uint32_t
1123  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1124  * #ctypedef npy_uint96 uint96_t
1125  * #ctypedef npy_uint128 uint128_t
1126  */
1127 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1128 
1129 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":704
1130  * #ctypedef npy_uint128 uint128_t
1131  *
1132  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1133  * ctypedef npy_float64 float64_t
1134  * #ctypedef npy_float80 float80_t
1135  */
1136 typedef npy_float32 __pyx_t_5numpy_float32_t;
1137 
1138 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":705
1139  *
1140  * ctypedef npy_float32 float32_t
1141  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1142  * #ctypedef npy_float80 float80_t
1143  * #ctypedef npy_float128 float128_t
1144  */
1145 typedef npy_float64 __pyx_t_5numpy_float64_t;
1146 
1147 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":714
1148  * # The int types are mapped a bit surprising --
1149  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1150  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1151  * ctypedef npy_longlong long_t
1152  * ctypedef npy_longlong longlong_t
1153  */
1154 typedef npy_long __pyx_t_5numpy_int_t;
1155 
1156 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":715
1157  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1158  * ctypedef npy_long int_t
1159  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1160  * ctypedef npy_longlong longlong_t
1161  *
1162  */
1163 typedef npy_longlong __pyx_t_5numpy_long_t;
1164 
1165 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":716
1166  * ctypedef npy_long int_t
1167  * ctypedef npy_longlong long_t
1168  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1169  *
1170  * ctypedef npy_ulong uint_t
1171  */
1172 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1173 
1174 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":718
1175  * ctypedef npy_longlong longlong_t
1176  *
1177  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1178  * ctypedef npy_ulonglong ulong_t
1179  * ctypedef npy_ulonglong ulonglong_t
1180  */
1181 typedef npy_ulong __pyx_t_5numpy_uint_t;
1182 
1183 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":719
1184  *
1185  * ctypedef npy_ulong uint_t
1186  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1187  * ctypedef npy_ulonglong ulonglong_t
1188  *
1189  */
1190 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1191 
1192 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":720
1193  * ctypedef npy_ulong uint_t
1194  * ctypedef npy_ulonglong ulong_t
1195  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1196  *
1197  * ctypedef npy_intp intp_t
1198  */
1199 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1200 
1201 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":722
1202  * ctypedef npy_ulonglong ulonglong_t
1203  *
1204  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1205  * ctypedef npy_uintp uintp_t
1206  *
1207  */
1208 typedef npy_intp __pyx_t_5numpy_intp_t;
1209 
1210 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":723
1211  *
1212  * ctypedef npy_intp intp_t
1213  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1214  *
1215  * ctypedef npy_double float_t
1216  */
1217 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1218 
1219 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":725
1220  * ctypedef npy_uintp uintp_t
1221  *
1222  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1223  * ctypedef npy_double double_t
1224  * ctypedef npy_longdouble longdouble_t
1225  */
1226 typedef npy_double __pyx_t_5numpy_float_t;
1227 
1228 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":726
1229  *
1230  * ctypedef npy_double float_t
1231  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1232  * ctypedef npy_longdouble longdouble_t
1233  *
1234  */
1235 typedef npy_double __pyx_t_5numpy_double_t;
1236 
1237 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":727
1238  * ctypedef npy_double float_t
1239  * ctypedef npy_double double_t
1240  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1241  *
1242  * ctypedef npy_cfloat cfloat_t
1243  */
1244 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1245 
1246 /* "csmoothers.pxd":3
1247  * from proteus cimport superluWrappers
1248  *
1249  * ctypedef int PROTEUS_LAPACK_INTEGER # <<<<<<<<<<<<<<
1250  * # ARB - the compiler macro does not seem to be picking this up...
1251  * ctypedef double [:] DDATA
1252  */
1253 typedef int __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER;
1254 /* Declarations.proto */
1255 #if CYTHON_CCOMPLEX
1256  #ifdef __cplusplus
1257  typedef ::std::complex< float > __pyx_t_float_complex;
1258  #else
1259  typedef float _Complex __pyx_t_float_complex;
1260  #endif
1261 #else
1262  typedef struct { float real, imag; } __pyx_t_float_complex;
1263 #endif
1264 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1265 
1266 /* Declarations.proto */
1267 #if CYTHON_CCOMPLEX
1268  #ifdef __cplusplus
1269  typedef ::std::complex< double > __pyx_t_double_complex;
1270  #else
1271  typedef double _Complex __pyx_t_double_complex;
1272  #endif
1273 #else
1274  typedef struct { double real, imag; } __pyx_t_double_complex;
1275 #endif
1276 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1277 
1278 
1279 /*--- Type declarations ---*/
1280 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix;
1281 struct __pyx_obj_10csmoothers_cASMFactor;
1282 struct __pyx_obj_10csmoothers_cBASMFactor;
1283 struct __pyx_array_obj;
1284 struct __pyx_MemviewEnum_obj;
1285 struct __pyx_memoryview_obj;
1286 struct __pyx_memoryviewslice_obj;
1287 
1288 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":729
1289  * ctypedef npy_longdouble longdouble_t
1290  *
1291  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1292  * ctypedef npy_cdouble cdouble_t
1293  * ctypedef npy_clongdouble clongdouble_t
1294  */
1295 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1296 
1297 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":730
1298  *
1299  * ctypedef npy_cfloat cfloat_t
1300  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1301  * ctypedef npy_clongdouble clongdouble_t
1302  *
1303  */
1304 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1305 
1306 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":731
1307  * ctypedef npy_cfloat cfloat_t
1308  * ctypedef npy_cdouble cdouble_t
1309  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1310  *
1311  * ctypedef npy_cdouble complex_t
1312  */
1313 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1314 
1315 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":733
1316  * ctypedef npy_clongdouble clongdouble_t
1317  *
1318  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1319  *
1320  * cdef inline object PyArray_MultiIterNew1(a):
1321  */
1322 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1323 struct __pyx_t_7proteus_15superluWrappers__NRformat;
1324 
1325 /* "superluWrappers.pxd":61
1326  * void csp_preorder "sp_preorder"(_superlu_options_t *, _SuperMatrix *, int *, int *, _SuperMatrix *)
1327  *
1328  * cdef struct _NRformat: # <<<<<<<<<<<<<<
1329  * np.int32_t nnz
1330  * np.float64_t * nzval
1331  */
1332 struct __pyx_t_7proteus_15superluWrappers__NRformat {
1333  __pyx_t_5numpy_int32_t nnz;
1334  __pyx_t_5numpy_float64_t *nzval;
1335  __pyx_t_5numpy_int32_t *colind;
1336  __pyx_t_5numpy_int32_t *rowptr;
1337 };
1338 
1339 /* "csmoothers.pxd":5
1340  * ctypedef int PROTEUS_LAPACK_INTEGER
1341  * # ARB - the compiler macro does not seem to be picking this up...
1342  * ctypedef double [:] DDATA # <<<<<<<<<<<<<<
1343  * ctypedef int [:] IDATA
1344  * ctypedef superluWrappers._SuperMatrix SuperMatrix
1345  */
1346 typedef __Pyx_memviewslice __pyx_t_10csmoothers_DDATA;
1347 
1348 /* "csmoothers.pxd":6
1349  * # ARB - the compiler macro does not seem to be picking this up...
1350  * ctypedef double [:] DDATA
1351  * ctypedef int [:] IDATA # <<<<<<<<<<<<<<
1352  * ctypedef superluWrappers._SuperMatrix SuperMatrix
1353  *
1354  */
1355 typedef __Pyx_memviewslice __pyx_t_10csmoothers_IDATA;
1356 
1357 /* "csmoothers.pxd":7
1358  * ctypedef double [:] DDATA
1359  * ctypedef int [:] IDATA
1360  * ctypedef superluWrappers._SuperMatrix SuperMatrix # <<<<<<<<<<<<<<
1361  *
1362  * cdef extern from "smoothers.h":
1363  */
1364 typedef SuperMatrix __pyx_t_10csmoothers_SuperMatrix;
1365 
1366 /* "superluWrappers.pxd":67
1367  * np.int32_t * rowptr
1368  *
1369  * cdef class cSparseMatrix(object): # <<<<<<<<<<<<<<
1370  * cdef np.int32_t dim[2]
1371  * cdef _NRformat A
1372  */
1373 struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix {
1374  PyObject_HEAD
1375  __pyx_t_5numpy_int32_t dim[2];
1376  struct __pyx_t_7proteus_15superluWrappers__NRformat A;
1377 };
1378 
1379 
1380 /* "csmoothers.pxd":25
1381  * void cbasm_NR_solve "basm_NR_solve"(int rowBlocks, int N, superluWrappers._SuperMatrix *A, double w, double** subdomainL, int* subdomain_dim, int** l2g_L, double* R, double** subdomainR, int* node_order, double** subdomain_dX, double* dX, PROTEUS_LAPACK_INTEGER** subdomainPivots, PROTEUS_LAPACK_INTEGER** subdomainColPivots)
1382  *
1383  * cdef class cASMFactor(object): # <<<<<<<<<<<<<<
1384  * cdef int N
1385  * cdef int *subdomain_dim
1386  */
1387 struct __pyx_obj_10csmoothers_cASMFactor {
1388  PyObject_HEAD
1389  int N;
1390  int *subdomain_dim;
1391  int **l2g_L;
1392  double **subdomain_L;
1393  double **subdomain_R;
1394  double **subdomain_dX;
1395  __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_pivots;
1396 };
1397 
1398 
1399 /* "csmoothers.pxd":34
1400  * cdef PROTEUS_LAPACK_INTEGER **subdomain_pivots
1401  *
1402  * cdef class cBASMFactor(object): # <<<<<<<<<<<<<<
1403  * cdef int N
1404  * cdef int bs
1405  */
1406 struct __pyx_obj_10csmoothers_cBASMFactor {
1407  PyObject_HEAD
1408  int N;
1409  int bs;
1410  int *subdomain_dim;
1411  int **l2g_L;
1412  double **subdomain_L;
1413  double **subdomain_R;
1414  double **subdomain_dX;
1415  __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_pivots;
1416  __pyx_t_10csmoothers_PROTEUS_LAPACK_INTEGER **subdomain_col_pivots;
1417 };
1418 
1419 
1420 /* "View.MemoryView":105
1421  *
1422  * @cname("__pyx_array")
1423  * cdef class array: # <<<<<<<<<<<<<<
1424  *
1425  * cdef:
1426  */
1427 struct __pyx_array_obj {
1428  PyObject_HEAD
1429  struct __pyx_vtabstruct_array *__pyx_vtab;
1430  char *data;
1431  Py_ssize_t len;
1432  char *format;
1433  int ndim;
1434  Py_ssize_t *_shape;
1435  Py_ssize_t *_strides;
1436  Py_ssize_t itemsize;
1437  PyObject *mode;
1438  PyObject *_format;
1439  void (*callback_free_data)(void *);
1440  int free_data;
1441  int dtype_is_object;
1442 };
1443 
1444 
1445 /* "View.MemoryView":279
1446  *
1447  * @cname('__pyx_MemviewEnum')
1448  * cdef class Enum(object): # <<<<<<<<<<<<<<
1449  * cdef object name
1450  * def __init__(self, name):
1451  */
1452 struct __pyx_MemviewEnum_obj {
1453  PyObject_HEAD
1454  PyObject *name;
1455 };
1456 
1457 
1458 /* "View.MemoryView":330
1459  *
1460  * @cname('__pyx_memoryview')
1461  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1462  *
1463  * cdef object obj
1464  */
1465 struct __pyx_memoryview_obj {
1466  PyObject_HEAD
1467  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1468  PyObject *obj;
1469  PyObject *_size;
1470  PyObject *_array_interface;
1471  PyThread_type_lock lock;
1472  __pyx_atomic_int acquisition_count[2];
1473  __pyx_atomic_int *acquisition_count_aligned_p;
1474  Py_buffer view;
1475  int flags;
1476  int dtype_is_object;
1477  __Pyx_TypeInfo *typeinfo;
1478 };
1479 
1480 
1481 /* "View.MemoryView":965
1482  *
1483  * @cname('__pyx_memoryviewslice')
1484  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1485  * "Internal class for passing memoryview slices to Python"
1486  *
1487  */
1488 struct __pyx_memoryviewslice_obj {
1489  struct __pyx_memoryview_obj __pyx_base;
1490  __Pyx_memviewslice from_slice;
1491  PyObject *from_object;
1492  PyObject *(*to_object_func)(char *);
1493  int (*to_dtype_func)(char *, PyObject *);
1494 };
1495 
1496 
1497 
1498 /* "View.MemoryView":105
1499  *
1500  * @cname("__pyx_array")
1501  * cdef class array: # <<<<<<<<<<<<<<
1502  *
1503  * cdef:
1504  */
1505 
1506 struct __pyx_vtabstruct_array {
1507  PyObject *(*get_memview)(struct __pyx_array_obj *);
1508 };
1509 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1510 
1511 
1512 /* "View.MemoryView":330
1513  *
1514  * @cname('__pyx_memoryview')
1515  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1516  *
1517  * cdef object obj
1518  */
1519 
1520 struct __pyx_vtabstruct_memoryview {
1521  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1522  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1523  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1524  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1525  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1526  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1527  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1528 };
1529 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1530 
1531 
1532 /* "View.MemoryView":965
1533  *
1534  * @cname('__pyx_memoryviewslice')
1535  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1536  * "Internal class for passing memoryview slices to Python"
1537  *
1538  */
1539 
1540 struct __pyx_vtabstruct__memoryviewslice {
1541  struct __pyx_vtabstruct_memoryview __pyx_base;
1542 };
1543 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1544 
1545 /* --- Runtime support code (head) --- */
1546 /* Refnanny.proto */
1547 #ifndef CYTHON_REFNANNY
1548  #define CYTHON_REFNANNY 0
1549 #endif
1550 #if CYTHON_REFNANNY
1551  typedef struct {
1552  void (*INCREF)(void*, PyObject*, int);
1553  void (*DECREF)(void*, PyObject*, int);
1554  void (*GOTREF)(void*, PyObject*, int);
1555  void (*GIVEREF)(void*, PyObject*, int);
1556  void* (*SetupContext)(const char*, int, const char*);
1557  void (*FinishContext)(void**);
1558  } __Pyx_RefNannyAPIStruct;
1559  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1560  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1561  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1562 #ifdef WITH_THREAD
1563  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1564  if (acquire_gil) {\
1565  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1566  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1567  PyGILState_Release(__pyx_gilstate_save);\
1568  } else {\
1569  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1570  }
1571 #else
1572  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1573  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1574 #endif
1575  #define __Pyx_RefNannyFinishContext()\
1576  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1577  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1578  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1579  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1580  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1581  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1582  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1583  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1584  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1585 #else
1586  #define __Pyx_RefNannyDeclarations
1587  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1588  #define __Pyx_RefNannyFinishContext()
1589  #define __Pyx_INCREF(r) Py_INCREF(r)
1590  #define __Pyx_DECREF(r) Py_DECREF(r)
1591  #define __Pyx_GOTREF(r)
1592  #define __Pyx_GIVEREF(r)
1593  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1594  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1595  #define __Pyx_XGOTREF(r)
1596  #define __Pyx_XGIVEREF(r)
1597 #endif
1598 #define __Pyx_XDECREF_SET(r, v) do {\
1599  PyObject *tmp = (PyObject *) r;\
1600  r = v; __Pyx_XDECREF(tmp);\
1601  } while (0)
1602 #define __Pyx_DECREF_SET(r, v) do {\
1603  PyObject *tmp = (PyObject *) r;\
1604  r = v; __Pyx_DECREF(tmp);\
1605  } while (0)
1606 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1607 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1608 
1609 /* PyObjectGetAttrStr.proto */
1610 #if CYTHON_USE_TYPE_SLOTS
1611 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1612 #else
1613 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1614 #endif
1615 
1616 /* GetBuiltinName.proto */
1617 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1618 
1619 /* RaiseArgTupleInvalid.proto */
1620 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1621  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1622 
1623 /* RaiseDoubleKeywords.proto */
1624 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1625 
1626 /* ParseKeywords.proto */
1627 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1628  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1629  const char* function_name);
1630 
1631 /* PyObjectSetAttrStr.proto */
1632 #if CYTHON_USE_TYPE_SLOTS
1633 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1634 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1635 #else
1636 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1637 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1638 #endif
1639 
1640 /* PyCFunctionFastCall.proto */
1641 #if CYTHON_FAST_PYCCALL
1642 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1643 #else
1644 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1645 #endif
1646 
1647 /* PyFunctionFastCall.proto */
1648 #if CYTHON_FAST_PYCALL
1649 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1650  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1651 #if 1 || PY_VERSION_HEX < 0x030600B1
1652 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1653 #else
1654 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1655 #endif
1656 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1657  (sizeof(char [1 - 2*!(cond)]) - 1)
1658 #ifndef Py_MEMBER_SIZE
1659 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1660 #endif
1661 #if CYTHON_FAST_PYCALL
1662  static size_t __pyx_pyframe_localsplus_offset = 0;
1663  #include "frameobject.h"
1664 #if PY_VERSION_HEX >= 0x030b00a6
1665  #ifndef Py_BUILD_CORE
1666  #define Py_BUILD_CORE 1
1667  #endif
1668  #include "internal/pycore_frame.h"
1669 #endif
1670  #define __Pxy_PyFrame_Initialize_Offsets()\
1671  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1672  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1673  #define __Pyx_PyFrame_GetLocalsplus(frame)\
1674  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1675 #endif // CYTHON_FAST_PYCALL
1676 #endif
1677 
1678 /* PyObjectCall.proto */
1679 #if CYTHON_COMPILING_IN_CPYTHON
1680 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1681 #else
1682 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1683 #endif
1684 
1685 /* PyObjectCallMethO.proto */
1686 #if CYTHON_COMPILING_IN_CPYTHON
1687 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1688 #endif
1689 
1690 /* PyObjectCallOneArg.proto */
1691 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1692 
1693 /* ArgTypeTest.proto */
1694 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1695  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1696  __Pyx__ArgTypeTest(obj, type, name, exact))
1697 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1698 
1699 /* PyThreadStateGet.proto */
1700 #if CYTHON_FAST_THREAD_STATE
1701 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1702 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1703 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1704 #else
1705 #define __Pyx_PyThreadState_declare
1706 #define __Pyx_PyThreadState_assign
1707 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1708 #endif
1709 
1710 /* PyErrFetchRestore.proto */
1711 #if CYTHON_FAST_THREAD_STATE
1712 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1713 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1714 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1715 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1716 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1717 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1718 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1719 #if CYTHON_COMPILING_IN_CPYTHON
1720 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1721 #else
1722 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1723 #endif
1724 #else
1725 #define __Pyx_PyErr_Clear() PyErr_Clear()
1726 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1727 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1728 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1729 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1730 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1731 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1732 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1733 #endif
1734 
1735 /* RaiseException.proto */
1736 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1737 
1738 /* ExtTypeTest.proto */
1739 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1740 
1741 /* MemviewSliceInit.proto */
1742 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1743 #define __Pyx_MEMVIEW_DIRECT 1
1744 #define __Pyx_MEMVIEW_PTR 2
1745 #define __Pyx_MEMVIEW_FULL 4
1746 #define __Pyx_MEMVIEW_CONTIG 8
1747 #define __Pyx_MEMVIEW_STRIDED 16
1748 #define __Pyx_MEMVIEW_FOLLOW 32
1749 #define __Pyx_IS_C_CONTIG 1
1750 #define __Pyx_IS_F_CONTIG 2
1751 static int __Pyx_init_memviewslice(
1752  struct __pyx_memoryview_obj *memview,
1753  int ndim,
1754  __Pyx_memviewslice *memviewslice,
1755  int memview_is_new_reference);
1756 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
1757  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1758 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
1759  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1760 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1761 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1762 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1763 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1764 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
1765 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
1766 
1767 /* BufferIndexError.proto */
1768 static void __Pyx_RaiseBufferIndexError(int axis);
1769 
1770 /* WriteUnraisableException.proto */
1771 static void __Pyx_WriteUnraisable(const char *name, int clineno,
1772  int lineno, const char *filename,
1773  int full_traceback, int nogil);
1774 
1775 /* GetTopmostException.proto */
1776 #if CYTHON_USE_EXC_INFO_STACK
1777 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1778 #endif
1779 
1780 /* SaveResetException.proto */
1781 #if CYTHON_FAST_THREAD_STATE
1782 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1783 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1784 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1785 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1786 #else
1787 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1788 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1789 #endif
1790 
1791 /* PyErrExceptionMatches.proto */
1792 #if CYTHON_FAST_THREAD_STATE
1793 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1794 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1795 #else
1796 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1797 #endif
1798 
1799 /* GetException.proto */
1800 #if CYTHON_FAST_THREAD_STATE
1801 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1802 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1803 #else
1804 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1805 #endif
1806 
1807 /* PyObjectCall2Args.proto */
1808 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1809 
1810 /* IncludeStringH.proto */
1811 #include <string.h>
1812 
1813 /* BytesEquals.proto */
1814 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1815 
1816 /* UnicodeEquals.proto */
1817 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1818 
1819 /* StrEquals.proto */
1820 #if PY_MAJOR_VERSION >= 3
1821 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1822 #else
1823 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1824 #endif
1825 
1826 /* DivInt[Py_ssize_t].proto */
1827 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1828 
1829 /* UnaryNegOverflows.proto */
1830 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1831  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1832 
1833 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1834 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
1835 /* GetAttr.proto */
1836 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1837 
1838 /* GetItemInt.proto */
1839 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1840  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1841  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1842  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1843  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1844 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1845  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1846  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1847  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1848 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1849  int wraparound, int boundscheck);
1850 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1851  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1852  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1853  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1854 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1855  int wraparound, int boundscheck);
1856 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1857 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1858  int is_list, int wraparound, int boundscheck);
1859 
1860 /* ObjectGetItem.proto */
1861 #if CYTHON_USE_TYPE_SLOTS
1862 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1863 #else
1864 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1865 #endif
1866 
1867 /* decode_c_string_utf16.proto */
1868 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
1869  int byteorder = 0;
1870  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1871 }
1872 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
1873  int byteorder = -1;
1874  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1875 }
1876 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
1877  int byteorder = 1;
1878  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1879 }
1880 
1881 /* decode_c_string.proto */
1882 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1883  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1884  const char* encoding, const char* errors,
1885  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
1886 
1887 /* GetAttr3.proto */
1888 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1889 
1890 /* PyDictVersioning.proto */
1891 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1892 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1893 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1894 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1895  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1896  (cache_var) = (value);
1897 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1898  static PY_UINT64_T __pyx_dict_version = 0;\
1899  static PyObject *__pyx_dict_cached_value = NULL;\
1900  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1901  (VAR) = __pyx_dict_cached_value;\
1902  } else {\
1903  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1904  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1905  }\
1906 }
1907 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1908 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1909 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1910 #else
1911 #define __PYX_GET_DICT_VERSION(dict) (0)
1912 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1913 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1914 #endif
1915 
1916 /* GetModuleGlobalName.proto */
1917 #if CYTHON_USE_DICT_VERSIONS
1918 #define __Pyx_GetModuleGlobalName(var, name) {\
1919  static PY_UINT64_T __pyx_dict_version = 0;\
1920  static PyObject *__pyx_dict_cached_value = NULL;\
1921  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1922  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1923  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1924 }
1925 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1926  PY_UINT64_T __pyx_dict_version;\
1927  PyObject *__pyx_dict_cached_value;\
1928  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1929 }
1930 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1931 #else
1932 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1933 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1934 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1935 #endif
1936 
1937 /* RaiseTooManyValuesToUnpack.proto */
1938 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1939 
1940 /* RaiseNeedMoreValuesToUnpack.proto */
1941 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1942 
1943 /* RaiseNoneIterError.proto */
1944 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1945 
1946 /* SwapException.proto */
1947 #if CYTHON_FAST_THREAD_STATE
1948 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1949 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1950 #else
1951 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1952 #endif
1953 
1954 /* Import.proto */
1955 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1956 
1957 /* FastTypeChecks.proto */
1958 #if CYTHON_COMPILING_IN_CPYTHON
1959 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1960 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1961 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1962 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1963 #else
1964 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1965 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1966 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1967 #endif
1968 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1969 
1970 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1971 /* ListCompAppend.proto */
1972 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1973 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1974  PyListObject* L = (PyListObject*) list;
1975  Py_ssize_t len = Py_SIZE(list);
1976  if (likely(L->allocated > len)) {
1977  Py_INCREF(x);
1978  PyList_SET_ITEM(list, len, x);
1979  __Pyx_SET_SIZE(list, len + 1);
1980  return 0;
1981  }
1982  return PyList_Append(list, x);
1983 }
1984 #else
1985 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1986 #endif
1987 
1988 /* PyIntBinop.proto */
1989 #if !CYTHON_COMPILING_IN_PYPY
1990 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1991 #else
1992 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1993  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1994 #endif
1995 
1996 /* ListExtend.proto */
1997 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
1998 #if CYTHON_COMPILING_IN_CPYTHON
1999  PyObject* none = _PyList_Extend((PyListObject*)L, v);
2000  if (unlikely(!none))
2001  return -1;
2002  Py_DECREF(none);
2003  return 0;
2004 #else
2005  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2006 #endif
2007 }
2008 
2009 /* ListAppend.proto */
2010 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2011 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2012  PyListObject* L = (PyListObject*) list;
2013  Py_ssize_t len = Py_SIZE(list);
2014  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2015  Py_INCREF(x);
2016  PyList_SET_ITEM(list, len, x);
2017  __Pyx_SET_SIZE(list, len + 1);
2018  return 0;
2019  }
2020  return PyList_Append(list, x);
2021 }
2022 #else
2023 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2024 #endif
2025 
2026 /* None.proto */
2027 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2028 
2029 /* DivInt[long].proto */
2030 static CYTHON_INLINE long __Pyx_div_long(long, long);
2031 
2032 /* PySequenceContains.proto */
2033 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
2034  int result = PySequence_Contains(seq, item);
2035  return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2036 }
2037 
2038 /* ImportFrom.proto */
2039 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2040 
2041 /* HasAttr.proto */
2042 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2043 
2044 /* PyObject_GenericGetAttrNoDict.proto */
2045 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2046 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2047 #else
2048 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2049 #endif
2050 
2051 /* PyObject_GenericGetAttr.proto */
2052 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2053 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2054 #else
2055 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2056 #endif
2057 
2058 /* PyObjectGetAttrStrNoError.proto */
2059 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2060 
2061 /* SetupReduce.proto */
2062 static int __Pyx_setup_reduce(PyObject* type_obj);
2063 
2064 /* SetVTable.proto */
2065 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2066 
2067 /* TypeImport.proto */
2068 #ifndef __PYX_HAVE_RT_ImportType_proto
2069 #define __PYX_HAVE_RT_ImportType_proto
2070 enum __Pyx_ImportType_CheckSize {
2071  __Pyx_ImportType_CheckSize_Error = 0,
2072  __Pyx_ImportType_CheckSize_Warn = 1,
2073  __Pyx_ImportType_CheckSize_Ignore = 2
2074 };
2075 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2076 #endif
2077 
2078 /* CalculateMetaclass.proto */
2079 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
2080 
2081 /* FetchCommonType.proto */
2082 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2083 
2084 /* CythonFunctionShared.proto */
2085 #define __Pyx_CyFunction_USED 1
2086 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2087 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2088 #define __Pyx_CYFUNCTION_CCLASS 0x04
2089 #define __Pyx_CyFunction_GetClosure(f)\
2090  (((__pyx_CyFunctionObject *) (f))->func_closure)
2091 #define __Pyx_CyFunction_GetClassObj(f)\
2092  (((__pyx_CyFunctionObject *) (f))->func_classobj)
2093 #define __Pyx_CyFunction_Defaults(type, f)\
2094  ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2095 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2096  ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2097 typedef struct {
2098  PyCFunctionObject func;
2099 #if PY_VERSION_HEX < 0x030500A0
2100  PyObject *func_weakreflist;
2101 #endif
2102  PyObject *func_dict;
2103  PyObject *func_name;
2104  PyObject *func_qualname;
2105  PyObject *func_doc;
2106  PyObject *func_globals;
2107  PyObject *func_code;
2108  PyObject *func_closure;
2109  PyObject *func_classobj;
2110  void *defaults;
2111  int defaults_pyobjects;
2112  size_t defaults_size; // used by FusedFunction for copying defaults
2113  int flags;
2114  PyObject *defaults_tuple;
2115  PyObject *defaults_kwdict;
2116  PyObject *(*defaults_getter)(PyObject *);
2117  PyObject *func_annotations;
2118 } __pyx_CyFunctionObject;
2119 static PyTypeObject *__pyx_CyFunctionType = 0;
2120 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2121 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2122  int flags, PyObject* qualname,
2123  PyObject *self,
2124  PyObject *module, PyObject *globals,
2125  PyObject* code);
2126 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2127  size_t size,
2128  int pyobjects);
2129 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2130  PyObject *tuple);
2131 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2132  PyObject *dict);
2133 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2134  PyObject *dict);
2135 static int __pyx_CyFunction_init(void);
2136 
2137 /* CythonFunction.proto */
2138 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2139  int flags, PyObject* qualname,
2140  PyObject *closure,
2141  PyObject *module, PyObject *globals,
2142  PyObject* code);
2143 
2144 /* SetNameInClass.proto */
2145 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
2146 #define __Pyx_SetNameInClass(ns, name, value)\
2147  (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
2148 #elif CYTHON_COMPILING_IN_CPYTHON
2149 #define __Pyx_SetNameInClass(ns, name, value)\
2150  (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
2151 #else
2152 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
2153 #endif
2154 
2155 /* Py3ClassCreate.proto */
2156 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
2157  PyObject *mkw, PyObject *modname, PyObject *doc);
2158 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
2159  PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
2160 
2161 /* CLineInTraceback.proto */
2162 #ifdef CYTHON_CLINE_IN_TRACEBACK
2163 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2164 #else
2165 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2166 #endif
2167 
2168 /* CodeObjectCache.proto */
2169 typedef struct {
2170  PyCodeObject* code_object;
2171  int code_line;
2172 } __Pyx_CodeObjectCacheEntry;
2173 struct __Pyx_CodeObjectCache {
2174  int count;
2175  int max_count;
2176  __Pyx_CodeObjectCacheEntry* entries;
2177 };
2178 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2179 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2180 static PyCodeObject *__pyx_find_code_object(int code_line);
2181 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2182 
2183 /* AddTraceback.proto */
2184 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2185  int py_line, const char *filename);
2186 
2187 #if PY_MAJOR_VERSION < 3
2188  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2189  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2190 #else
2191  #define __Pyx_GetBuffer PyObject_GetBuffer
2192  #define __Pyx_ReleaseBuffer PyBuffer_Release
2193 #endif
2194 
2195 
2196 /* BufferStructDeclare.proto */
2197 typedef struct {
2198  Py_ssize_t shape, strides, suboffsets;
2199 } __Pyx_Buf_DimInfo;
2200 typedef struct {
2201  size_t refcount;
2202  Py_buffer pybuffer;
2203 } __Pyx_Buffer;
2204 typedef struct {
2205  __Pyx_Buffer *rcbuffer;
2206  char *data;
2207  __Pyx_Buf_DimInfo diminfo[8];
2208 } __Pyx_LocalBuf_ND;
2209 
2210 /* MemviewSliceIsContig.proto */
2211 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2212 
2213 /* OverlappingSlices.proto */
2214 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2215  __Pyx_memviewslice *slice2,
2216  int ndim, size_t itemsize);
2217 
2218 /* Capsule.proto */
2219 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2220 
2221 /* GCCDiagnostics.proto */
2222 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2223 #define __Pyx_HAS_GCC_DIAGNOSTIC
2224 #endif
2225 
2226 /* IsLittleEndian.proto */
2227 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2228 
2229 /* BufferFormatCheck.proto */
2230 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2231 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2232  __Pyx_BufFmt_StackElem* stack,
2233  __Pyx_TypeInfo* type);
2234 
2235 /* TypeInfoCompare.proto */
2236 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2237 
2238 /* MemviewSliceValidateAndInit.proto */
2239 static int __Pyx_ValidateAndInit_memviewslice(
2240  int *axes_specs,
2241  int c_or_f_flag,
2242  int buf_flags,
2243  int ndim,
2244  __Pyx_TypeInfo *dtype,
2245  __Pyx_BufFmt_StackElem stack[],
2246  __Pyx_memviewslice *memviewslice,
2247  PyObject *original_obj);
2248 
2249 /* ObjectToMemviewSlice.proto */
2250 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *, int writable_flag);
2251 
2252 /* ObjectToMemviewSlice.proto */
2253 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *, int writable_flag);
2254 
2255 /* RealImag.proto */
2256 #if CYTHON_CCOMPLEX
2257  #ifdef __cplusplus
2258  #define __Pyx_CREAL(z) ((z).real())
2259  #define __Pyx_CIMAG(z) ((z).imag())
2260  #else
2261  #define __Pyx_CREAL(z) (__real__(z))
2262  #define __Pyx_CIMAG(z) (__imag__(z))
2263  #endif
2264 #else
2265  #define __Pyx_CREAL(z) ((z).real)
2266  #define __Pyx_CIMAG(z) ((z).imag)
2267 #endif
2268 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2269  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2270  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2271  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2272 #else
2273  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2274  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2275 #endif
2276 
2277 /* Arithmetic.proto */
2278 #if CYTHON_CCOMPLEX
2279  #define __Pyx_c_eq_float(a, b) ((a)==(b))
2280  #define __Pyx_c_sum_float(a, b) ((a)+(b))
2281  #define __Pyx_c_diff_float(a, b) ((a)-(b))
2282  #define __Pyx_c_prod_float(a, b) ((a)*(b))
2283  #define __Pyx_c_quot_float(a, b) ((a)/(b))
2284  #define __Pyx_c_neg_float(a) (-(a))
2285  #ifdef __cplusplus
2286  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2287  #define __Pyx_c_conj_float(z) (::std::conj(z))
2288  #if 1
2289  #define __Pyx_c_abs_float(z) (::std::abs(z))
2290  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2291  #endif
2292  #else
2293  #define __Pyx_c_is_zero_float(z) ((z)==0)
2294  #define __Pyx_c_conj_float(z) (conjf(z))
2295  #if 1
2296  #define __Pyx_c_abs_float(z) (cabsf(z))
2297  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2298  #endif
2299  #endif
2300 #else
2301  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2302  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2303  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2304  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2305  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2306  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2307  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2308  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2309  #if 1
2310  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2311  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2312  #endif
2313 #endif
2314 
2315 /* Arithmetic.proto */
2316 #if CYTHON_CCOMPLEX
2317  #define __Pyx_c_eq_double(a, b) ((a)==(b))
2318  #define __Pyx_c_sum_double(a, b) ((a)+(b))
2319  #define __Pyx_c_diff_double(a, b) ((a)-(b))
2320  #define __Pyx_c_prod_double(a, b) ((a)*(b))
2321  #define __Pyx_c_quot_double(a, b) ((a)/(b))
2322  #define __Pyx_c_neg_double(a) (-(a))
2323  #ifdef __cplusplus
2324  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2325  #define __Pyx_c_conj_double(z) (::std::conj(z))
2326  #if 1
2327  #define __Pyx_c_abs_double(z) (::std::abs(z))
2328  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2329  #endif
2330  #else
2331  #define __Pyx_c_is_zero_double(z) ((z)==0)
2332  #define __Pyx_c_conj_double(z) (conj(z))
2333  #if 1
2334  #define __Pyx_c_abs_double(z) (cabs(z))
2335  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2336  #endif
2337  #endif
2338 #else
2339  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2340  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2341  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2342  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2343  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2344  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2345  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2346  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2347  #if 1
2348  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2349  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2350  #endif
2351 #endif
2352 
2353 /* MemviewSliceCopyTemplate.proto */
2354 static __Pyx_memviewslice
2355 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2356  const char *mode, int ndim,
2357  size_t sizeof_dtype, int contig_flag,
2358  int dtype_is_object);
2359 
2360 /* CIntFromPy.proto */
2361 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2362 
2363 /* CIntFromPy.proto */
2364 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2365 
2366 /* CIntToPy.proto */
2367 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2368 
2369 /* CIntToPy.proto */
2370 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2371 
2372 /* CIntFromPy.proto */
2373 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2374 
2375 /* CheckBinaryVersion.proto */
2376 static int __Pyx_check_binary_version(void);
2377 
2378 /* InitStrings.proto */
2379 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2380 
2381 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2382 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2383 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2384 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2385 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2386 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2387 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2388 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2389 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2390 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2391 
2392 /* Module declarations from 'proteus' */
2393 
2394 /* Module declarations from 'cpython.buffer' */
2395 
2396 /* Module declarations from 'libc.string' */
2397 
2398 /* Module declarations from 'libc.stdio' */
2399 
2400 /* Module declarations from '__builtin__' */
2401 
2402 /* Module declarations from 'cpython.type' */
2403 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2404 
2405 /* Module declarations from 'cpython' */
2406 
2407 /* Module declarations from 'cpython.object' */
2408 
2409 /* Module declarations from 'cpython.ref' */
2410 
2411 /* Module declarations from 'cpython.mem' */
2412 
2413 /* Module declarations from 'numpy' */
2414 
2415 /* Module declarations from 'numpy' */
2416 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2417 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2418 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2419 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2420 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2421 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2422 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2423 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2424 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2425 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2426 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2427 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2428 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2429 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2430 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2431 
2432 /* Module declarations from 'proteus.superluWrappers' */
2433 static PyTypeObject *__pyx_ptype_7proteus_15superluWrappers_cSparseMatrix = 0;
2434 
2435 /* Module declarations from 'cython.view' */
2436 
2437 /* Module declarations from 'cython' */
2438 
2439 /* Module declarations from 'csmoothers' */
2440 static PyTypeObject *__pyx_ptype_10csmoothers_cASMFactor = 0;
2441 static PyTypeObject *__pyx_ptype_10csmoothers_cBASMFactor = 0;
2442 static PyTypeObject *__pyx_array_type = 0;
2443 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2444 static PyTypeObject *__pyx_memoryview_type = 0;
2445 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2446 static PyObject *generic = 0;
2447 static PyObject *strided = 0;
2448 static PyObject *indirect = 0;
2449 static PyObject *contiguous = 0;
2450 static PyObject *indirect_contiguous = 0;
2451 static int __pyx_memoryview_thread_locks_used;
2452 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2453 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
2454 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
2455 static void __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
2456 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
2457 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
2458 static PyObject *__pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_IDATA, double, double, __pyx_t_10csmoothers_DDATA); /*proto*/
2459 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, struct __pyx_obj_10csmoothers_cASMFactor *); /*proto*/
2460 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, struct __pyx_obj_10csmoothers_cASMFactor *, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
2461 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, struct __pyx_obj_10csmoothers_cBASMFactor *); /*proto*/
2462 static void __pyx_f_10csmoothers_smootherWrappers_basm_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *, double, struct __pyx_obj_10csmoothers_cBASMFactor *, __pyx_t_10csmoothers_IDATA, __pyx_t_10csmoothers_DDATA, __pyx_t_10csmoothers_DDATA); /*proto*/
2463 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2464 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2465 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2466 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2467 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2468 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2469 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2470 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2471 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2472 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2473 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2474 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2475 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2476 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2477 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2478 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2479 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2480 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2481 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2482 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2483 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2484 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2485 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2486 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2487 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2488 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2489 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2490 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2491 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2492 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2493 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2494 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2495 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2496 static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
2497 static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
2498 #define __Pyx_MODULE_NAME "csmoothers"
2499 extern int __pyx_module_is_main_csmoothers;
2500 int __pyx_module_is_main_csmoothers = 0;
2501 
2502 /* Implementation of 'csmoothers' */
2503 static PyObject *__pyx_builtin_object;
2504 static PyObject *__pyx_builtin_TypeError;
2505 static PyObject *__pyx_builtin_ImportError;
2506 static PyObject *__pyx_builtin_ValueError;
2507 static PyObject *__pyx_builtin_MemoryError;
2508 static PyObject *__pyx_builtin_enumerate;
2509 static PyObject *__pyx_builtin_range;
2510 static PyObject *__pyx_builtin_Ellipsis;
2511 static PyObject *__pyx_builtin_id;
2512 static PyObject *__pyx_builtin_IndexError;
2513 static const char __pyx_k_A[] = "A";
2514 static const char __pyx_k_L[] = "L";
2515 static const char __pyx_k_M[] = "M";
2516 static const char __pyx_k_O[] = "O";
2517 static const char __pyx_k_R[] = "R";
2518 static const char __pyx_k_c[] = "c";
2519 static const char __pyx_k_w[] = "w";
2520 static const char __pyx_k_bs[] = "bs";
2521 static const char __pyx_k_dX[] = "dX";
2522 static const char __pyx_k_id[] = "id";
2523 static const char __pyx_k_nc[] = "nc";
2524 static const char __pyx_k_np[] = "np";
2525 static const char __pyx_k_nr[] = "nr";
2526 static const char __pyx_k_doc[] = "__doc__";
2527 static const char __pyx_k_new[] = "__new__";
2528 static const char __pyx_k_obj[] = "obj";
2529 static const char __pyx_k_tol[] = "tol";
2530 static const char __pyx_k_base[] = "base";
2531 static const char __pyx_k_dict[] = "__dict__";
2532 static const char __pyx_k_init[] = "__init__";
2533 static const char __pyx_k_main[] = "__main__";
2534 static const char __pyx_k_mode[] = "mode";
2535 static const char __pyx_k_name[] = "name";
2536 static const char __pyx_k_ndim[] = "ndim";
2537 static const char __pyx_k_pack[] = "pack";
2538 static const char __pyx_k_self[] = "self";
2539 static const char __pyx_k_size[] = "size";
2540 static const char __pyx_k_step[] = "step";
2541 static const char __pyx_k_stop[] = "stop";
2542 static const char __pyx_k_test[] = "__test__";
2543 static const char __pyx_k_ASCII[] = "ASCII";
2544 static const char __pyx_k_class[] = "__class__";
2545 static const char __pyx_k_error[] = "error";
2546 static const char __pyx_k_flags[] = "flags";
2547 static const char __pyx_k_numpy[] = "numpy";
2548 static const char __pyx_k_range[] = "range";
2549 static const char __pyx_k_shape[] = "shape";
2550 static const char __pyx_k_start[] = "start";
2551 static const char __pyx_k_encode[] = "encode";
2552 static const char __pyx_k_format[] = "format";
2553 static const char __pyx_k_import[] = "__import__";
2554 static const char __pyx_k_module[] = "__module__";
2555 static const char __pyx_k_name_2[] = "__name__";
2556 static const char __pyx_k_object[] = "object";
2557 static const char __pyx_k_pickle[] = "pickle";
2558 static const char __pyx_k_reduce[] = "__reduce__";
2559 static const char __pyx_k_struct[] = "struct";
2560 static const char __pyx_k_unpack[] = "unpack";
2561 static const char __pyx_k_update[] = "update";
2562 static const char __pyx_k_fortran[] = "fortran";
2563 static const char __pyx_k_memview[] = "memview";
2564 static const char __pyx_k_prepare[] = "__prepare__";
2565 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2566 static const char __pyx_k_getstate[] = "__getstate__";
2567 static const char __pyx_k_itemsize[] = "itemsize";
2568 static const char __pyx_k_pyx_type[] = "__pyx_type";
2569 static const char __pyx_k_qualname[] = "__qualname__";
2570 static const char __pyx_k_setstate[] = "__setstate__";
2571 static const char __pyx_k_ASMFactor[] = "ASMFactor";
2572 static const char __pyx_k_TypeError[] = "TypeError";
2573 static const char __pyx_k_asmFactor[] = "asmFactor";
2574 static const char __pyx_k_enumerate[] = "enumerate";
2575 static const char __pyx_k_metaclass[] = "__metaclass__";
2576 static const char __pyx_k_pyx_state[] = "__pyx_state";
2577 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2578 static const char __pyx_k_BASMFactor[] = "BASMFactor";
2579 static const char __pyx_k_IndexError[] = "IndexError";
2580 static const char __pyx_k_ValueError[] = "ValueError";
2581 static const char __pyx_k_basmFactor[] = "basmFactor";
2582 static const char __pyx_k_cASMFactor[] = "_cASMFactor";
2583 static const char __pyx_k_csmoothers[] = "csmoothers";
2584 static const char __pyx_k_node_order[] = "node_order";
2585 static const char __pyx_k_pyx_result[] = "__pyx_result";
2586 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2587 static const char __pyx_k_ImportError[] = "ImportError";
2588 static const char __pyx_k_MemoryError[] = "MemoryError";
2589 static const char __pyx_k_PickleError[] = "PickleError";
2590 static const char __pyx_k_cBASMFactor[] = "_cBASMFactor";
2591 static const char __pyx_k_asm_NR_solve[] = "asm_NR_solve";
2592 static const char __pyx_k_cASMFactor_2[] = "cASMFactor";
2593 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2594 static const char __pyx_k_stringsource[] = "stringsource";
2595 static const char __pyx_k_basm_NR_solve[] = "basm_NR_solve";
2596 static const char __pyx_k_cBASMFactor_2[] = "cBASMFactor";
2597 static const char __pyx_k_cSparseMatrix[] = "_cSparseMatrix";
2598 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2599 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2600 static const char __pyx_k_asm_NR_prepare[] = "asm_NR_prepare";
2601 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2602 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2603 static const char __pyx_k_basm_NR_prepare[] = "basm_NR_prepare";
2604 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2605 static const char __pyx_k_jacobi_NR_solve[] = "jacobi_NR_solve";
2606 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2607 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2608 static const char __pyx_k_ASMFactor___init[] = "ASMFactor.__init__";
2609 static const char __pyx_k_BASMFactor___init[] = "BASMFactor.__init__";
2610 static const char __pyx_k_jacobi_NR_prepare[] = "jacobi_NR_prepare";
2611 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2612 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2613 static const char __pyx_k_nl_jacobi_NR_solve[] = "nl_jacobi_NR_solve";
2614 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2615 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2616 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2617 static const char __pyx_k_gauss_seidel_NR_solve[] = "gauss_seidel_NR_solve";
2618 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2619 static const char __pyx_k_gauss_seidel_NR_preare[] = "gauss_seidel_NR_preare";
2620 static const char __pyx_k_proteus_csmoothers_pyx[] = "proteus/csmoothers.pyx";
2621 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2622 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2623 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2624 static const char __pyx_k_nl_gauss_seidel_NR_solve[] = "nl_gauss_seidel_NR_solve";
2625 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2626 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2627 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2628 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2629 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2630 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2631 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2632 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2633 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2634 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2635 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
2636 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2637 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2638 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2639 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2640 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2641 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2642 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2643 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2644 static PyObject *__pyx_n_s_A;
2645 static PyObject *__pyx_n_s_ASCII;
2646 static PyObject *__pyx_n_s_ASMFactor;
2647 static PyObject *__pyx_n_s_ASMFactor___init;
2648 static PyObject *__pyx_n_s_BASMFactor;
2649 static PyObject *__pyx_n_s_BASMFactor___init;
2650 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2651 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2652 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2653 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2654 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2655 static PyObject *__pyx_n_s_Ellipsis;
2656 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2657 static PyObject *__pyx_n_s_ImportError;
2658 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
2659 static PyObject *__pyx_n_s_IndexError;
2660 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2661 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2662 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2663 static PyObject *__pyx_n_s_L;
2664 static PyObject *__pyx_n_s_M;
2665 static PyObject *__pyx_n_s_MemoryError;
2666 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2667 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2668 static PyObject *__pyx_n_b_O;
2669 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2670 static PyObject *__pyx_n_s_PickleError;
2671 static PyObject *__pyx_n_s_R;
2672 static PyObject *__pyx_n_s_TypeError;
2673 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2674 static PyObject *__pyx_n_s_ValueError;
2675 static PyObject *__pyx_n_s_View_MemoryView;
2676 static PyObject *__pyx_n_s_allocate_buffer;
2677 static PyObject *__pyx_n_s_asmFactor;
2678 static PyObject *__pyx_n_s_asm_NR_prepare;
2679 static PyObject *__pyx_n_s_asm_NR_solve;
2680 static PyObject *__pyx_n_s_base;
2681 static PyObject *__pyx_n_s_basmFactor;
2682 static PyObject *__pyx_n_s_basm_NR_prepare;
2683 static PyObject *__pyx_n_s_basm_NR_solve;
2684 static PyObject *__pyx_n_s_bs;
2685 static PyObject *__pyx_n_s_c;
2686 static PyObject *__pyx_n_u_c;
2687 static PyObject *__pyx_n_s_cASMFactor;
2688 static PyObject *__pyx_n_s_cASMFactor_2;
2689 static PyObject *__pyx_n_s_cBASMFactor;
2690 static PyObject *__pyx_n_s_cBASMFactor_2;
2691 static PyObject *__pyx_n_s_cSparseMatrix;
2692 static PyObject *__pyx_n_s_class;
2693 static PyObject *__pyx_n_s_cline_in_traceback;
2694 static PyObject *__pyx_kp_s_contiguous_and_direct;
2695 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2696 static PyObject *__pyx_n_s_csmoothers;
2697 static PyObject *__pyx_n_s_dX;
2698 static PyObject *__pyx_n_s_dict;
2699 static PyObject *__pyx_n_s_doc;
2700 static PyObject *__pyx_n_s_dtype_is_object;
2701 static PyObject *__pyx_n_s_encode;
2702 static PyObject *__pyx_n_s_enumerate;
2703 static PyObject *__pyx_n_s_error;
2704 static PyObject *__pyx_n_s_flags;
2705 static PyObject *__pyx_n_s_format;
2706 static PyObject *__pyx_n_s_fortran;
2707 static PyObject *__pyx_n_u_fortran;
2708 static PyObject *__pyx_n_s_gauss_seidel_NR_preare;
2709 static PyObject *__pyx_n_s_gauss_seidel_NR_solve;
2710 static PyObject *__pyx_n_s_getstate;
2711 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2712 static PyObject *__pyx_n_s_id;
2713 static PyObject *__pyx_n_s_import;
2714 static PyObject *__pyx_n_s_init;
2715 static PyObject *__pyx_n_s_itemsize;
2716 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2717 static PyObject *__pyx_n_s_jacobi_NR_prepare;
2718 static PyObject *__pyx_n_s_jacobi_NR_solve;
2719 static PyObject *__pyx_n_s_main;
2720 static PyObject *__pyx_n_s_memview;
2721 static PyObject *__pyx_n_s_metaclass;
2722 static PyObject *__pyx_n_s_mode;
2723 static PyObject *__pyx_n_s_module;
2724 static PyObject *__pyx_n_s_name;
2725 static PyObject *__pyx_n_s_name_2;
2726 static PyObject *__pyx_n_s_nc;
2727 static PyObject *__pyx_n_s_ndim;
2728 static PyObject *__pyx_n_s_new;
2729 static PyObject *__pyx_n_s_nl_gauss_seidel_NR_solve;
2730 static PyObject *__pyx_n_s_nl_jacobi_NR_solve;
2731 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2732 static PyObject *__pyx_n_s_node_order;
2733 static PyObject *__pyx_n_s_np;
2734 static PyObject *__pyx_n_s_nr;
2735 static PyObject *__pyx_n_s_numpy;
2736 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2737 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2738 static PyObject *__pyx_n_s_obj;
2739 static PyObject *__pyx_n_s_object;
2740 static PyObject *__pyx_n_s_pack;
2741 static PyObject *__pyx_n_s_pickle;
2742 static PyObject *__pyx_n_s_prepare;
2743 static PyObject *__pyx_kp_s_proteus_csmoothers_pyx;
2744 static PyObject *__pyx_n_s_pyx_PickleError;
2745 static PyObject *__pyx_n_s_pyx_checksum;
2746 static PyObject *__pyx_n_s_pyx_getbuffer;
2747 static PyObject *__pyx_n_s_pyx_result;
2748 static PyObject *__pyx_n_s_pyx_state;
2749 static PyObject *__pyx_n_s_pyx_type;
2750 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2751 static PyObject *__pyx_n_s_pyx_vtable;
2752 static PyObject *__pyx_n_s_qualname;
2753 static PyObject *__pyx_n_s_range;
2754 static PyObject *__pyx_n_s_reduce;
2755 static PyObject *__pyx_n_s_reduce_cython;
2756 static PyObject *__pyx_n_s_reduce_ex;
2757 static PyObject *__pyx_n_s_self;
2758 static PyObject *__pyx_n_s_setstate;
2759 static PyObject *__pyx_n_s_setstate_cython;
2760 static PyObject *__pyx_n_s_shape;
2761 static PyObject *__pyx_n_s_size;
2762 static PyObject *__pyx_n_s_start;
2763 static PyObject *__pyx_n_s_step;
2764 static PyObject *__pyx_n_s_stop;
2765 static PyObject *__pyx_kp_s_strided_and_direct;
2766 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2767 static PyObject *__pyx_kp_s_strided_and_indirect;
2768 static PyObject *__pyx_kp_s_stringsource;
2769 static PyObject *__pyx_n_s_struct;
2770 static PyObject *__pyx_n_s_test;
2771 static PyObject *__pyx_n_s_tol;
2772 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2773 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2774 static PyObject *__pyx_n_s_unpack;
2775 static PyObject *__pyx_n_s_update;
2776 static PyObject *__pyx_n_s_w;
2777 static PyObject *__pyx_pf_10csmoothers_9ASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L); /* proto */
2778 static int __pyx_pf_10csmoothers_10cASMFactor___cinit__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L); /* proto */
2779 static void __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self); /* proto */
2780 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self); /* proto */
2781 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2782 static PyObject *__pyx_pf_10csmoothers_10BASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L, PyObject *__pyx_v_bs); /* proto */
2783 static int __pyx_pf_10csmoothers_11cBASMFactor___cinit__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L, int __pyx_v_bs); /* proto */
2784 static void __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self); /* proto */
2785 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self); /* proto */
2786 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2787 static PyObject *__pyx_pf_10csmoothers_jacobi_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M); /* proto */
2788 static PyObject *__pyx_pf_10csmoothers_2jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX); /* proto */
2789 static PyObject *__pyx_pf_10csmoothers_4nl_jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX); /* proto */
2790 static PyObject *__pyx_pf_10csmoothers_6gauss_seidel_NR_preare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M); /* proto */
2791 static PyObject *__pyx_pf_10csmoothers_8gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX); /* proto */
2792 static PyObject *__pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX); /* proto */
2793 static PyObject *__pyx_pf_10csmoothers_12asm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_asmFactor); /* proto */
2794 static PyObject *__pyx_pf_10csmoothers_14asm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_asmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX); /* proto */
2795 static PyObject *__pyx_pf_10csmoothers_16basm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_basmFactor); /* proto */
2796 static PyObject *__pyx_pf_10csmoothers_18basm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_basmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX); /* proto */
2797 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
2798 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2799 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2800 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2801 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2802 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2803 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2804 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
2805 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2806 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2807 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2808 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2809 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2810 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2811 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
2812 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2813 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2814 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
2815 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2816 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2817 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2818 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2819 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2820 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2821 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2822 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2823 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2824 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2825 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2826 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2827 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2828 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2829 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2830 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2831 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2832 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2833 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2834 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2835 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2836 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2837 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2838 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2839 static PyObject *__pyx_tp_new_10csmoothers_cASMFactor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2840 static PyObject *__pyx_tp_new_10csmoothers_cBASMFactor(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2841 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2842 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2843 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2844 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2845 static PyObject *__pyx_int_0;
2846 static PyObject *__pyx_int_1;
2847 static PyObject *__pyx_int_112105877;
2848 static PyObject *__pyx_int_136983863;
2849 static PyObject *__pyx_int_184977713;
2850 static PyObject *__pyx_int_neg_1;
2851 static PyObject *__pyx_tuple_;
2852 static PyObject *__pyx_tuple__2;
2853 static PyObject *__pyx_tuple__3;
2854 static PyObject *__pyx_tuple__4;
2855 static PyObject *__pyx_tuple__5;
2856 static PyObject *__pyx_tuple__6;
2857 static PyObject *__pyx_tuple__7;
2858 static PyObject *__pyx_tuple__8;
2859 static PyObject *__pyx_tuple__9;
2860 static PyObject *__pyx_slice__21;
2861 static PyObject *__pyx_tuple__10;
2862 static PyObject *__pyx_tuple__11;
2863 static PyObject *__pyx_tuple__12;
2864 static PyObject *__pyx_tuple__13;
2865 static PyObject *__pyx_tuple__14;
2866 static PyObject *__pyx_tuple__15;
2867 static PyObject *__pyx_tuple__16;
2868 static PyObject *__pyx_tuple__17;
2869 static PyObject *__pyx_tuple__18;
2870 static PyObject *__pyx_tuple__19;
2871 static PyObject *__pyx_tuple__20;
2872 static PyObject *__pyx_tuple__22;
2873 static PyObject *__pyx_tuple__23;
2874 static PyObject *__pyx_tuple__24;
2875 static PyObject *__pyx_tuple__25;
2876 static PyObject *__pyx_tuple__26;
2877 static PyObject *__pyx_tuple__27;
2878 static PyObject *__pyx_tuple__29;
2879 static PyObject *__pyx_tuple__30;
2880 static PyObject *__pyx_tuple__32;
2881 static PyObject *__pyx_tuple__34;
2882 static PyObject *__pyx_tuple__36;
2883 static PyObject *__pyx_tuple__38;
2884 static PyObject *__pyx_tuple__40;
2885 static PyObject *__pyx_tuple__42;
2886 static PyObject *__pyx_tuple__44;
2887 static PyObject *__pyx_tuple__46;
2888 static PyObject *__pyx_tuple__48;
2889 static PyObject *__pyx_tuple__50;
2890 static PyObject *__pyx_tuple__52;
2891 static PyObject *__pyx_tuple__53;
2892 static PyObject *__pyx_tuple__54;
2893 static PyObject *__pyx_tuple__55;
2894 static PyObject *__pyx_tuple__56;
2895 static PyObject *__pyx_tuple__57;
2896 static PyObject *__pyx_codeobj__28;
2897 static PyObject *__pyx_codeobj__31;
2898 static PyObject *__pyx_codeobj__33;
2899 static PyObject *__pyx_codeobj__35;
2900 static PyObject *__pyx_codeobj__37;
2901 static PyObject *__pyx_codeobj__39;
2902 static PyObject *__pyx_codeobj__41;
2903 static PyObject *__pyx_codeobj__43;
2904 static PyObject *__pyx_codeobj__45;
2905 static PyObject *__pyx_codeobj__47;
2906 static PyObject *__pyx_codeobj__49;
2907 static PyObject *__pyx_codeobj__51;
2908 static PyObject *__pyx_codeobj__58;
2909 /* Late includes */
2910 
2911 /* "csmoothers.pyx":7
2912  * class ASMFactor(object):
2913  *
2914  * def __init__(self, L): # <<<<<<<<<<<<<<
2915  * self.L = L
2916  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
2917  */
2918 
2919 /* Python wrapper */
2920 static PyObject *__pyx_pw_10csmoothers_9ASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2921 static PyMethodDef __pyx_mdef_10csmoothers_9ASMFactor_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_9ASMFactor_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
2922 static PyObject *__pyx_pw_10csmoothers_9ASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2923  PyObject *__pyx_v_self = 0;
2924  PyObject *__pyx_v_L = 0;
2925  int __pyx_lineno = 0;
2926  const char *__pyx_filename = NULL;
2927  int __pyx_clineno = 0;
2928  PyObject *__pyx_r = 0;
2929  __Pyx_RefNannyDeclarations
2930  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
2931  {
2932  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_L,0};
2933  PyObject* values[2] = {0,0};
2934  if (unlikely(__pyx_kwds)) {
2935  Py_ssize_t kw_args;
2936  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2937  switch (pos_args) {
2938  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2939  CYTHON_FALLTHROUGH;
2940  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2941  CYTHON_FALLTHROUGH;
2942  case 0: break;
2943  default: goto __pyx_L5_argtuple_error;
2944  }
2945  kw_args = PyDict_Size(__pyx_kwds);
2946  switch (pos_args) {
2947  case 0:
2948  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
2949  else goto __pyx_L5_argtuple_error;
2950  CYTHON_FALLTHROUGH;
2951  case 1:
2952  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
2953  else {
2954  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 7, __pyx_L3_error)
2955  }
2956  }
2957  if (unlikely(kw_args > 0)) {
2958  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 7, __pyx_L3_error)
2959  }
2960  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
2961  goto __pyx_L5_argtuple_error;
2962  } else {
2963  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2964  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2965  }
2966  __pyx_v_self = values[0];
2967  __pyx_v_L = values[1];
2968  }
2969  goto __pyx_L4_argument_unpacking_done;
2970  __pyx_L5_argtuple_error:;
2971  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 7, __pyx_L3_error)
2972  __pyx_L3_error:;
2973  __Pyx_AddTraceback("csmoothers.ASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2974  __Pyx_RefNannyFinishContext();
2975  return NULL;
2976  __pyx_L4_argument_unpacking_done:;
2977  __pyx_r = __pyx_pf_10csmoothers_9ASMFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_L);
2978 
2979  /* function exit code */
2980  __Pyx_RefNannyFinishContext();
2981  return __pyx_r;
2982 }
2983 
2984 static PyObject *__pyx_pf_10csmoothers_9ASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L) {
2985  PyObject *__pyx_r = NULL;
2986  __Pyx_RefNannyDeclarations
2987  PyObject *__pyx_t_1 = NULL;
2988  PyObject *__pyx_t_2 = NULL;
2989  int __pyx_lineno = 0;
2990  const char *__pyx_filename = NULL;
2991  int __pyx_clineno = 0;
2992  __Pyx_RefNannySetupContext("__init__", 0);
2993 
2994  /* "csmoothers.pyx":8
2995  *
2996  * def __init__(self, L):
2997  * self.L = L # <<<<<<<<<<<<<<
2998  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
2999  *
3000  */
3001  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_L, __pyx_v_L) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
3002 
3003  /* "csmoothers.pyx":9
3004  * def __init__(self, L):
3005  * self.L = L
3006  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix) # <<<<<<<<<<<<<<
3007  *
3008  * cdef class cASMFactor(object):
3009  */
3010  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
3011  __Pyx_GOTREF(__pyx_t_1);
3012  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
3013  __Pyx_GOTREF(__pyx_t_2);
3014  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3015  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_10csmoothers_cASMFactor), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
3016  __Pyx_GOTREF(__pyx_t_1);
3017  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3018  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cASMFactor, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
3019  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3020 
3021  /* "csmoothers.pyx":7
3022  * class ASMFactor(object):
3023  *
3024  * def __init__(self, L): # <<<<<<<<<<<<<<
3025  * self.L = L
3026  * self._cASMFactor = cASMFactor(self.L._cSparseMatrix)
3027  */
3028 
3029  /* function exit code */
3030  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3031  goto __pyx_L0;
3032  __pyx_L1_error:;
3033  __Pyx_XDECREF(__pyx_t_1);
3034  __Pyx_XDECREF(__pyx_t_2);
3035  __Pyx_AddTraceback("csmoothers.ASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3036  __pyx_r = NULL;
3037  __pyx_L0:;
3038  __Pyx_XGIVEREF(__pyx_r);
3039  __Pyx_RefNannyFinishContext();
3040  return __pyx_r;
3041 }
3042 
3043 /* "csmoothers.pyx":13
3044  * cdef class cASMFactor(object):
3045  *
3046  * def __cinit__(self, # <<<<<<<<<<<<<<
3047  * superluWrappers.cSparseMatrix L):
3048  * cdef int rval = 0
3049  */
3050 
3051 /* Python wrapper */
3052 static int __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3053 static int __pyx_pw_10csmoothers_10cASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3054  struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L = 0;
3055  int __pyx_lineno = 0;
3056  const char *__pyx_filename = NULL;
3057  int __pyx_clineno = 0;
3058  int __pyx_r;
3059  __Pyx_RefNannyDeclarations
3060  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
3061  {
3062  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_L,0};
3063  PyObject* values[1] = {0};
3064  if (unlikely(__pyx_kwds)) {
3065  Py_ssize_t kw_args;
3066  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3067  switch (pos_args) {
3068  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3069  CYTHON_FALLTHROUGH;
3070  case 0: break;
3071  default: goto __pyx_L5_argtuple_error;
3072  }
3073  kw_args = PyDict_Size(__pyx_kwds);
3074  switch (pos_args) {
3075  case 0:
3076  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
3077  else goto __pyx_L5_argtuple_error;
3078  }
3079  if (unlikely(kw_args > 0)) {
3080  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 13, __pyx_L3_error)
3081  }
3082  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
3083  goto __pyx_L5_argtuple_error;
3084  } else {
3085  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3086  }
3087  __pyx_v_L = ((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)values[0]);
3088  }
3089  goto __pyx_L4_argument_unpacking_done;
3090  __pyx_L5_argtuple_error:;
3091  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 13, __pyx_L3_error)
3092  __pyx_L3_error:;
3093  __Pyx_AddTraceback("csmoothers.cASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3094  __Pyx_RefNannyFinishContext();
3095  return -1;
3096  __pyx_L4_argument_unpacking_done:;
3097  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix, 1, "L", 0))) __PYX_ERR(0, 14, __pyx_L1_error)
3098  __pyx_r = __pyx_pf_10csmoothers_10cASMFactor___cinit__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self), __pyx_v_L);
3099 
3100  /* function exit code */
3101  goto __pyx_L0;
3102  __pyx_L1_error:;
3103  __pyx_r = -1;
3104  __pyx_L0:;
3105  __Pyx_RefNannyFinishContext();
3106  return __pyx_r;
3107 }
3108 
3109 static int __pyx_pf_10csmoothers_10cASMFactor___cinit__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L) {
3110  int __pyx_v_rval;
3111  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
3112  int __pyx_r;
3113  __Pyx_RefNannyDeclarations
3114  PyObject *__pyx_t_1 = NULL;
3115  int __pyx_t_2;
3116  int __pyx_lineno = 0;
3117  const char *__pyx_filename = NULL;
3118  int __pyx_clineno = 0;
3119  __Pyx_RefNannySetupContext("__cinit__", 0);
3120 
3121  /* "csmoothers.pyx":15
3122  * def __cinit__(self,
3123  * superluWrappers.cSparseMatrix L):
3124  * cdef int rval = 0 # <<<<<<<<<<<<<<
3125  * cdef SuperMatrix AS
3126  * AS.Stype = superluWrappers._SLU_NR
3127  */
3128  __pyx_v_rval = 0;
3129 
3130  /* "csmoothers.pyx":17
3131  * cdef int rval = 0
3132  * cdef SuperMatrix AS
3133  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
3134  * AS.Dtype = superluWrappers._SLU_D
3135  * AS.Mtype = superluWrappers._SLU_GE
3136  */
3137  __pyx_v_AS.Stype = SLU_NR;
3138 
3139  /* "csmoothers.pyx":18
3140  * cdef SuperMatrix AS
3141  * AS.Stype = superluWrappers._SLU_NR
3142  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
3143  * AS.Mtype = superluWrappers._SLU_GE
3144  * AS.nrow = L.nr
3145  */
3146  __pyx_v_AS.Dtype = SLU_D;
3147 
3148  /* "csmoothers.pyx":19
3149  * AS.Stype = superluWrappers._SLU_NR
3150  * AS.Dtype = superluWrappers._SLU_D
3151  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
3152  * AS.nrow = L.nr
3153  * AS.ncol = L.nc
3154  */
3155  __pyx_v_AS.Mtype = SLU_GE;
3156 
3157  /* "csmoothers.pyx":20
3158  * AS.Dtype = superluWrappers._SLU_D
3159  * AS.Mtype = superluWrappers._SLU_GE
3160  * AS.nrow = L.nr # <<<<<<<<<<<<<<
3161  * AS.ncol = L.nc
3162  * AS.Store = &L.A
3163  */
3164  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
3165  __Pyx_GOTREF(__pyx_t_1);
3166  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L1_error)
3167  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3168  __pyx_v_AS.nrow = __pyx_t_2;
3169 
3170  /* "csmoothers.pyx":21
3171  * AS.Mtype = superluWrappers._SLU_GE
3172  * AS.nrow = L.nr
3173  * AS.ncol = L.nc # <<<<<<<<<<<<<<
3174  * AS.Store = &L.A
3175  * rval = casm_NR_init(&AS,
3176  */
3177  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
3178  __Pyx_GOTREF(__pyx_t_1);
3179  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 21, __pyx_L1_error)
3180  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3181  __pyx_v_AS.ncol = __pyx_t_2;
3182 
3183  /* "csmoothers.pyx":22
3184  * AS.nrow = L.nr
3185  * AS.ncol = L.nc
3186  * AS.Store = &L.A # <<<<<<<<<<<<<<
3187  * rval = casm_NR_init(&AS,
3188  * &self.subdomain_dim,
3189  */
3190  __pyx_v_AS.Store = (&__pyx_v_L->A);
3191 
3192  /* "csmoothers.pyx":23
3193  * AS.ncol = L.nc
3194  * AS.Store = &L.A
3195  * rval = casm_NR_init(&AS, # <<<<<<<<<<<<<<
3196  * &self.subdomain_dim,
3197  * &self.l2g_L,
3198  */
3199  __pyx_v_rval = asm_NR_init((&__pyx_v_AS), (&__pyx_v_self->subdomain_dim), (&__pyx_v_self->l2g_L), (&__pyx_v_self->subdomain_L), (&__pyx_v_self->subdomain_R), (&__pyx_v_self->subdomain_dX), (&__pyx_v_self->subdomain_pivots));
3200 
3201  /* "csmoothers.pyx":30
3202  * &self.subdomain_dX,
3203  * &self.subdomain_pivots)
3204  * assert rval == 0 # <<<<<<<<<<<<<<
3205  *
3206  * def __dealloc__(self):
3207  */
3208  #ifndef CYTHON_WITHOUT_ASSERTIONS
3209  if (unlikely(!Py_OptimizeFlag)) {
3210  if (unlikely(!((__pyx_v_rval == 0) != 0))) {
3211  PyErr_SetNone(PyExc_AssertionError);
3212  __PYX_ERR(0, 30, __pyx_L1_error)
3213  }
3214  }
3215  #endif
3216 
3217  /* "csmoothers.pyx":13
3218  * cdef class cASMFactor(object):
3219  *
3220  * def __cinit__(self, # <<<<<<<<<<<<<<
3221  * superluWrappers.cSparseMatrix L):
3222  * cdef int rval = 0
3223  */
3224 
3225  /* function exit code */
3226  __pyx_r = 0;
3227  goto __pyx_L0;
3228  __pyx_L1_error:;
3229  __Pyx_XDECREF(__pyx_t_1);
3230  __Pyx_AddTraceback("csmoothers.cASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3231  __pyx_r = -1;
3232  __pyx_L0:;
3233  __Pyx_RefNannyFinishContext();
3234  return __pyx_r;
3235 }
3236 
3237 /* "csmoothers.pyx":32
3238  * assert rval == 0
3239  *
3240  * def __dealloc__(self): # <<<<<<<<<<<<<<
3241  * casm_NR_free(self.N,
3242  * self.subdomain_dim,
3243  */
3244 
3245 /* Python wrapper */
3246 static void __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
3247 static void __pyx_pw_10csmoothers_10cASMFactor_3__dealloc__(PyObject *__pyx_v_self) {
3248  __Pyx_RefNannyDeclarations
3249  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
3250  __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self));
3251 
3252  /* function exit code */
3253  __Pyx_RefNannyFinishContext();
3254 }
3255 
3256 static void __pyx_pf_10csmoothers_10cASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self) {
3257  __Pyx_RefNannyDeclarations
3258  __Pyx_RefNannySetupContext("__dealloc__", 0);
3259 
3260  /* "csmoothers.pyx":33
3261  *
3262  * def __dealloc__(self):
3263  * casm_NR_free(self.N, # <<<<<<<<<<<<<<
3264  * self.subdomain_dim,
3265  * self.l2g_L,
3266  */
3267  asm_NR_free(__pyx_v_self->N, __pyx_v_self->subdomain_dim, __pyx_v_self->l2g_L, __pyx_v_self->subdomain_L, __pyx_v_self->subdomain_R, __pyx_v_self->subdomain_dX, __pyx_v_self->subdomain_pivots);
3268 
3269  /* "csmoothers.pyx":32
3270  * assert rval == 0
3271  *
3272  * def __dealloc__(self): # <<<<<<<<<<<<<<
3273  * casm_NR_free(self.N,
3274  * self.subdomain_dim,
3275  */
3276 
3277  /* function exit code */
3278  __Pyx_RefNannyFinishContext();
3279 }
3280 
3281 /* "(tree fragment)":1
3282  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3283  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3284  * def __setstate_cython__(self, __pyx_state):
3285  */
3286 
3287 /* Python wrapper */
3288 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3289 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3290  PyObject *__pyx_r = 0;
3291  __Pyx_RefNannyDeclarations
3292  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3293  __pyx_r = __pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self));
3294 
3295  /* function exit code */
3296  __Pyx_RefNannyFinishContext();
3297  return __pyx_r;
3298 }
3299 
3300 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self) {
3301  PyObject *__pyx_r = NULL;
3302  __Pyx_RefNannyDeclarations
3303  PyObject *__pyx_t_1 = NULL;
3304  int __pyx_lineno = 0;
3305  const char *__pyx_filename = NULL;
3306  int __pyx_clineno = 0;
3307  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
3308 
3309  /* "(tree fragment)":2
3310  * def __reduce_cython__(self):
3311  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3312  * def __setstate_cython__(self, __pyx_state):
3313  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3314  */
3315  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
3316  __Pyx_GOTREF(__pyx_t_1);
3317  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3318  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3319  __PYX_ERR(1, 2, __pyx_L1_error)
3320 
3321  /* "(tree fragment)":1
3322  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3323  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3324  * def __setstate_cython__(self, __pyx_state):
3325  */
3326 
3327  /* function exit code */
3328  __pyx_L1_error:;
3329  __Pyx_XDECREF(__pyx_t_1);
3330  __Pyx_AddTraceback("csmoothers.cASMFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3331  __pyx_r = NULL;
3332  __Pyx_XGIVEREF(__pyx_r);
3333  __Pyx_RefNannyFinishContext();
3334  return __pyx_r;
3335 }
3336 
3337 /* "(tree fragment)":3
3338  * def __reduce_cython__(self):
3339  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3340  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3341  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3342  */
3343 
3344 /* Python wrapper */
3345 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
3346 static PyObject *__pyx_pw_10csmoothers_10cASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3347  PyObject *__pyx_r = 0;
3348  __Pyx_RefNannyDeclarations
3349  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3350  __pyx_r = __pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3351 
3352  /* function exit code */
3353  __Pyx_RefNannyFinishContext();
3354  return __pyx_r;
3355 }
3356 
3357 static PyObject *__pyx_pf_10csmoothers_10cASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3358  PyObject *__pyx_r = NULL;
3359  __Pyx_RefNannyDeclarations
3360  PyObject *__pyx_t_1 = NULL;
3361  int __pyx_lineno = 0;
3362  const char *__pyx_filename = NULL;
3363  int __pyx_clineno = 0;
3364  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3365 
3366  /* "(tree fragment)":4
3367  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3368  * def __setstate_cython__(self, __pyx_state):
3369  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3370  */
3371  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
3372  __Pyx_GOTREF(__pyx_t_1);
3373  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3374  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3375  __PYX_ERR(1, 4, __pyx_L1_error)
3376 
3377  /* "(tree fragment)":3
3378  * def __reduce_cython__(self):
3379  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3380  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3381  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3382  */
3383 
3384  /* function exit code */
3385  __pyx_L1_error:;
3386  __Pyx_XDECREF(__pyx_t_1);
3387  __Pyx_AddTraceback("csmoothers.cASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3388  __pyx_r = NULL;
3389  __Pyx_XGIVEREF(__pyx_r);
3390  __Pyx_RefNannyFinishContext();
3391  return __pyx_r;
3392 }
3393 
3394 /* "csmoothers.pyx":44
3395  * class BASMFactor(object):
3396  *
3397  * def __init__(self, L, bs): # <<<<<<<<<<<<<<
3398  * self.L = L
3399  * self.bs = bs
3400  */
3401 
3402 /* Python wrapper */
3403 static PyObject *__pyx_pw_10csmoothers_10BASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3404 static PyMethodDef __pyx_mdef_10csmoothers_10BASMFactor_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_10BASMFactor_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
3405 static PyObject *__pyx_pw_10csmoothers_10BASMFactor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3406  PyObject *__pyx_v_self = 0;
3407  PyObject *__pyx_v_L = 0;
3408  PyObject *__pyx_v_bs = 0;
3409  int __pyx_lineno = 0;
3410  const char *__pyx_filename = NULL;
3411  int __pyx_clineno = 0;
3412  PyObject *__pyx_r = 0;
3413  __Pyx_RefNannyDeclarations
3414  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
3415  {
3416  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_L,&__pyx_n_s_bs,0};
3417  PyObject* values[3] = {0,0,0};
3418  if (unlikely(__pyx_kwds)) {
3419  Py_ssize_t kw_args;
3420  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3421  switch (pos_args) {
3422  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3423  CYTHON_FALLTHROUGH;
3424  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3425  CYTHON_FALLTHROUGH;
3426  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3427  CYTHON_FALLTHROUGH;
3428  case 0: break;
3429  default: goto __pyx_L5_argtuple_error;
3430  }
3431  kw_args = PyDict_Size(__pyx_kwds);
3432  switch (pos_args) {
3433  case 0:
3434  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3435  else goto __pyx_L5_argtuple_error;
3436  CYTHON_FALLTHROUGH;
3437  case 1:
3438  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
3439  else {
3440  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 44, __pyx_L3_error)
3441  }
3442  CYTHON_FALLTHROUGH;
3443  case 2:
3444  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--;
3445  else {
3446  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 44, __pyx_L3_error)
3447  }
3448  }
3449  if (unlikely(kw_args > 0)) {
3450  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 44, __pyx_L3_error)
3451  }
3452  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3453  goto __pyx_L5_argtuple_error;
3454  } else {
3455  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3456  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3457  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3458  }
3459  __pyx_v_self = values[0];
3460  __pyx_v_L = values[1];
3461  __pyx_v_bs = values[2];
3462  }
3463  goto __pyx_L4_argument_unpacking_done;
3464  __pyx_L5_argtuple_error:;
3465  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 44, __pyx_L3_error)
3466  __pyx_L3_error:;
3467  __Pyx_AddTraceback("csmoothers.BASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3468  __Pyx_RefNannyFinishContext();
3469  return NULL;
3470  __pyx_L4_argument_unpacking_done:;
3471  __pyx_r = __pyx_pf_10csmoothers_10BASMFactor___init__(__pyx_self, __pyx_v_self, __pyx_v_L, __pyx_v_bs);
3472 
3473  /* function exit code */
3474  __Pyx_RefNannyFinishContext();
3475  return __pyx_r;
3476 }
3477 
3478 static PyObject *__pyx_pf_10csmoothers_10BASMFactor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_L, PyObject *__pyx_v_bs) {
3479  PyObject *__pyx_r = NULL;
3480  __Pyx_RefNannyDeclarations
3481  PyObject *__pyx_t_1 = NULL;
3482  PyObject *__pyx_t_2 = NULL;
3483  PyObject *__pyx_t_3 = NULL;
3484  int __pyx_lineno = 0;
3485  const char *__pyx_filename = NULL;
3486  int __pyx_clineno = 0;
3487  __Pyx_RefNannySetupContext("__init__", 0);
3488 
3489  /* "csmoothers.pyx":45
3490  *
3491  * def __init__(self, L, bs):
3492  * self.L = L # <<<<<<<<<<<<<<
3493  * self.bs = bs
3494  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix,
3495  */
3496  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_L, __pyx_v_L) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
3497 
3498  /* "csmoothers.pyx":46
3499  * def __init__(self, L, bs):
3500  * self.L = L
3501  * self.bs = bs # <<<<<<<<<<<<<<
3502  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix,
3503  * self.bs)
3504  */
3505  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bs, __pyx_v_bs) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
3506 
3507  /* "csmoothers.pyx":47
3508  * self.L = L
3509  * self.bs = bs
3510  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix, # <<<<<<<<<<<<<<
3511  * self.bs)
3512  *
3513  */
3514  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
3515  __Pyx_GOTREF(__pyx_t_1);
3516  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
3517  __Pyx_GOTREF(__pyx_t_2);
3518  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3519 
3520  /* "csmoothers.pyx":48
3521  * self.bs = bs
3522  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix,
3523  * self.bs) # <<<<<<<<<<<<<<
3524  *
3525  * cdef class cBASMFactor(object):
3526  */
3527  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
3528  __Pyx_GOTREF(__pyx_t_1);
3529 
3530  /* "csmoothers.pyx":47
3531  * self.L = L
3532  * self.bs = bs
3533  * self._cBASMFactor = cBASMFactor(self.L._cSparseMatrix, # <<<<<<<<<<<<<<
3534  * self.bs)
3535  *
3536  */
3537  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L1_error)
3538  __Pyx_GOTREF(__pyx_t_3);
3539  __Pyx_GIVEREF(__pyx_t_2);
3540  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
3541  __Pyx_GIVEREF(__pyx_t_1);
3542  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
3543  __pyx_t_2 = 0;
3544  __pyx_t_1 = 0;
3545  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10csmoothers_cBASMFactor), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
3546  __Pyx_GOTREF(__pyx_t_1);
3547  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3548  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cBASMFactor, __pyx_t_1) < 0) __PYX_ERR(0, 47, __pyx_L1_error)
3549  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3550 
3551  /* "csmoothers.pyx":44
3552  * class BASMFactor(object):
3553  *
3554  * def __init__(self, L, bs): # <<<<<<<<<<<<<<
3555  * self.L = L
3556  * self.bs = bs
3557  */
3558 
3559  /* function exit code */
3560  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3561  goto __pyx_L0;
3562  __pyx_L1_error:;
3563  __Pyx_XDECREF(__pyx_t_1);
3564  __Pyx_XDECREF(__pyx_t_2);
3565  __Pyx_XDECREF(__pyx_t_3);
3566  __Pyx_AddTraceback("csmoothers.BASMFactor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3567  __pyx_r = NULL;
3568  __pyx_L0:;
3569  __Pyx_XGIVEREF(__pyx_r);
3570  __Pyx_RefNannyFinishContext();
3571  return __pyx_r;
3572 }
3573 
3574 /* "csmoothers.pyx":52
3575  * cdef class cBASMFactor(object):
3576  *
3577  * def __cinit__(self, # <<<<<<<<<<<<<<
3578  * superluWrappers.cSparseMatrix L,
3579  * int bs):
3580  */
3581 
3582 /* Python wrapper */
3583 static int __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3584 static int __pyx_pw_10csmoothers_11cBASMFactor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3585  struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L = 0;
3586  int __pyx_v_bs;
3587  int __pyx_lineno = 0;
3588  const char *__pyx_filename = NULL;
3589  int __pyx_clineno = 0;
3590  int __pyx_r;
3591  __Pyx_RefNannyDeclarations
3592  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
3593  {
3594  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_L,&__pyx_n_s_bs,0};
3595  PyObject* values[2] = {0,0};
3596  if (unlikely(__pyx_kwds)) {
3597  Py_ssize_t kw_args;
3598  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3599  switch (pos_args) {
3600  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3601  CYTHON_FALLTHROUGH;
3602  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3603  CYTHON_FALLTHROUGH;
3604  case 0: break;
3605  default: goto __pyx_L5_argtuple_error;
3606  }
3607  kw_args = PyDict_Size(__pyx_kwds);
3608  switch (pos_args) {
3609  case 0:
3610  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_L)) != 0)) kw_args--;
3611  else goto __pyx_L5_argtuple_error;
3612  CYTHON_FALLTHROUGH;
3613  case 1:
3614  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bs)) != 0)) kw_args--;
3615  else {
3616  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(0, 52, __pyx_L3_error)
3617  }
3618  }
3619  if (unlikely(kw_args > 0)) {
3620  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 52, __pyx_L3_error)
3621  }
3622  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
3623  goto __pyx_L5_argtuple_error;
3624  } else {
3625  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3626  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3627  }
3628  __pyx_v_L = ((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)values[0]);
3629  __pyx_v_bs = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_bs == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error)
3630  }
3631  goto __pyx_L4_argument_unpacking_done;
3632  __pyx_L5_argtuple_error:;
3633  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 52, __pyx_L3_error)
3634  __pyx_L3_error:;
3635  __Pyx_AddTraceback("csmoothers.cBASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3636  __Pyx_RefNannyFinishContext();
3637  return -1;
3638  __pyx_L4_argument_unpacking_done:;
3639  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_L), __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix, 1, "L", 0))) __PYX_ERR(0, 53, __pyx_L1_error)
3640  __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor___cinit__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self), __pyx_v_L, __pyx_v_bs);
3641 
3642  /* function exit code */
3643  goto __pyx_L0;
3644  __pyx_L1_error:;
3645  __pyx_r = -1;
3646  __pyx_L0:;
3647  __Pyx_RefNannyFinishContext();
3648  return __pyx_r;
3649 }
3650 
3651 static int __pyx_pf_10csmoothers_11cBASMFactor___cinit__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_L, int __pyx_v_bs) {
3652  int __pyx_v_rval;
3653  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
3654  int __pyx_r;
3655  __Pyx_RefNannyDeclarations
3656  PyObject *__pyx_t_1 = NULL;
3657  int __pyx_t_2;
3658  int __pyx_lineno = 0;
3659  const char *__pyx_filename = NULL;
3660  int __pyx_clineno = 0;
3661  __Pyx_RefNannySetupContext("__cinit__", 0);
3662 
3663  /* "csmoothers.pyx":55
3664  * superluWrappers.cSparseMatrix L,
3665  * int bs):
3666  * cdef int rval = 0 # <<<<<<<<<<<<<<
3667  * cdef SuperMatrix AS
3668  * AS.Stype = superluWrappers._SLU_NR
3669  */
3670  __pyx_v_rval = 0;
3671 
3672  /* "csmoothers.pyx":57
3673  * cdef int rval = 0
3674  * cdef SuperMatrix AS
3675  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
3676  * AS.Dtype = superluWrappers._SLU_D
3677  * AS.Mtype = superluWrappers._SLU_GE
3678  */
3679  __pyx_v_AS.Stype = SLU_NR;
3680 
3681  /* "csmoothers.pyx":58
3682  * cdef SuperMatrix AS
3683  * AS.Stype = superluWrappers._SLU_NR
3684  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
3685  * AS.Mtype = superluWrappers._SLU_GE
3686  * AS.nrow = L.nr
3687  */
3688  __pyx_v_AS.Dtype = SLU_D;
3689 
3690  /* "csmoothers.pyx":59
3691  * AS.Stype = superluWrappers._SLU_NR
3692  * AS.Dtype = superluWrappers._SLU_D
3693  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
3694  * AS.nrow = L.nr
3695  * AS.ncol = L.nc
3696  */
3697  __pyx_v_AS.Mtype = SLU_GE;
3698 
3699  /* "csmoothers.pyx":60
3700  * AS.Dtype = superluWrappers._SLU_D
3701  * AS.Mtype = superluWrappers._SLU_GE
3702  * AS.nrow = L.nr # <<<<<<<<<<<<<<
3703  * AS.ncol = L.nc
3704  * AS.Store = &L.A
3705  */
3706  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
3707  __Pyx_GOTREF(__pyx_t_1);
3708  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L1_error)
3709  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3710  __pyx_v_AS.nrow = __pyx_t_2;
3711 
3712  /* "csmoothers.pyx":61
3713  * AS.Mtype = superluWrappers._SLU_GE
3714  * AS.nrow = L.nr
3715  * AS.ncol = L.nc # <<<<<<<<<<<<<<
3716  * AS.Store = &L.A
3717  * rval = cbasm_NR_init(bs,
3718  */
3719  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_L), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
3720  __Pyx_GOTREF(__pyx_t_1);
3721  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error)
3722  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3723  __pyx_v_AS.ncol = __pyx_t_2;
3724 
3725  /* "csmoothers.pyx":62
3726  * AS.nrow = L.nr
3727  * AS.ncol = L.nc
3728  * AS.Store = &L.A # <<<<<<<<<<<<<<
3729  * rval = cbasm_NR_init(bs,
3730  * &AS,
3731  */
3732  __pyx_v_AS.Store = (&__pyx_v_L->A);
3733 
3734  /* "csmoothers.pyx":63
3735  * AS.ncol = L.nc
3736  * AS.Store = &L.A
3737  * rval = cbasm_NR_init(bs, # <<<<<<<<<<<<<<
3738  * &AS,
3739  * &self.subdomain_dim,
3740  */
3741  __pyx_v_rval = basm_NR_init(__pyx_v_bs, (&__pyx_v_AS), (&__pyx_v_self->subdomain_dim), (&__pyx_v_self->l2g_L), (&__pyx_v_self->subdomain_L), (&__pyx_v_self->subdomain_R), (&__pyx_v_self->subdomain_dX), (&__pyx_v_self->subdomain_pivots), (&__pyx_v_self->subdomain_col_pivots));
3742 
3743  /* "csmoothers.pyx":72
3744  * &self.subdomain_pivots,
3745  * &self.subdomain_col_pivots)
3746  * assert rval == 0 # <<<<<<<<<<<<<<
3747  *
3748  * def __dealloc__(self):
3749  */
3750  #ifndef CYTHON_WITHOUT_ASSERTIONS
3751  if (unlikely(!Py_OptimizeFlag)) {
3752  if (unlikely(!((__pyx_v_rval == 0) != 0))) {
3753  PyErr_SetNone(PyExc_AssertionError);
3754  __PYX_ERR(0, 72, __pyx_L1_error)
3755  }
3756  }
3757  #endif
3758 
3759  /* "csmoothers.pyx":52
3760  * cdef class cBASMFactor(object):
3761  *
3762  * def __cinit__(self, # <<<<<<<<<<<<<<
3763  * superluWrappers.cSparseMatrix L,
3764  * int bs):
3765  */
3766 
3767  /* function exit code */
3768  __pyx_r = 0;
3769  goto __pyx_L0;
3770  __pyx_L1_error:;
3771  __Pyx_XDECREF(__pyx_t_1);
3772  __Pyx_AddTraceback("csmoothers.cBASMFactor.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3773  __pyx_r = -1;
3774  __pyx_L0:;
3775  __Pyx_RefNannyFinishContext();
3776  return __pyx_r;
3777 }
3778 
3779 /* "csmoothers.pyx":74
3780  * assert rval == 0
3781  *
3782  * def __dealloc__(self): # <<<<<<<<<<<<<<
3783  * cbasm_NR_free(self.N,
3784  * self.subdomain_dim,
3785  */
3786 
3787 /* Python wrapper */
3788 static void __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
3789 static void __pyx_pw_10csmoothers_11cBASMFactor_3__dealloc__(PyObject *__pyx_v_self) {
3790  __Pyx_RefNannyDeclarations
3791  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
3792  __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self));
3793 
3794  /* function exit code */
3795  __Pyx_RefNannyFinishContext();
3796 }
3797 
3798 static void __pyx_pf_10csmoothers_11cBASMFactor_2__dealloc__(struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self) {
3799  __Pyx_RefNannyDeclarations
3800  __Pyx_RefNannySetupContext("__dealloc__", 0);
3801 
3802  /* "csmoothers.pyx":75
3803  *
3804  * def __dealloc__(self):
3805  * cbasm_NR_free(self.N, # <<<<<<<<<<<<<<
3806  * self.subdomain_dim,
3807  * self.l2g_L,
3808  */
3809  basm_NR_free(__pyx_v_self->N, __pyx_v_self->subdomain_dim, __pyx_v_self->l2g_L, __pyx_v_self->subdomain_L, __pyx_v_self->subdomain_R, __pyx_v_self->subdomain_dX, __pyx_v_self->subdomain_pivots, __pyx_v_self->subdomain_col_pivots);
3810 
3811  /* "csmoothers.pyx":74
3812  * assert rval == 0
3813  *
3814  * def __dealloc__(self): # <<<<<<<<<<<<<<
3815  * cbasm_NR_free(self.N,
3816  * self.subdomain_dim,
3817  */
3818 
3819  /* function exit code */
3820  __Pyx_RefNannyFinishContext();
3821 }
3822 
3823 /* "(tree fragment)":1
3824  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3825  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3826  * def __setstate_cython__(self, __pyx_state):
3827  */
3828 
3829 /* Python wrapper */
3830 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3831 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3832  PyObject *__pyx_r = 0;
3833  __Pyx_RefNannyDeclarations
3834  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3835  __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self));
3836 
3837  /* function exit code */
3838  __Pyx_RefNannyFinishContext();
3839  return __pyx_r;
3840 }
3841 
3842 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self) {
3843  PyObject *__pyx_r = NULL;
3844  __Pyx_RefNannyDeclarations
3845  PyObject *__pyx_t_1 = NULL;
3846  int __pyx_lineno = 0;
3847  const char *__pyx_filename = NULL;
3848  int __pyx_clineno = 0;
3849  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
3850 
3851  /* "(tree fragment)":2
3852  * def __reduce_cython__(self):
3853  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3854  * def __setstate_cython__(self, __pyx_state):
3855  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3856  */
3857  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
3858  __Pyx_GOTREF(__pyx_t_1);
3859  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3860  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3861  __PYX_ERR(1, 2, __pyx_L1_error)
3862 
3863  /* "(tree fragment)":1
3864  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3865  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3866  * def __setstate_cython__(self, __pyx_state):
3867  */
3868 
3869  /* function exit code */
3870  __pyx_L1_error:;
3871  __Pyx_XDECREF(__pyx_t_1);
3872  __Pyx_AddTraceback("csmoothers.cBASMFactor.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3873  __pyx_r = NULL;
3874  __Pyx_XGIVEREF(__pyx_r);
3875  __Pyx_RefNannyFinishContext();
3876  return __pyx_r;
3877 }
3878 
3879 /* "(tree fragment)":3
3880  * def __reduce_cython__(self):
3881  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3882  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3883  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3884  */
3885 
3886 /* Python wrapper */
3887 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
3888 static PyObject *__pyx_pw_10csmoothers_11cBASMFactor_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3889  PyObject *__pyx_r = 0;
3890  __Pyx_RefNannyDeclarations
3891  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3892  __pyx_r = __pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(((struct __pyx_obj_10csmoothers_cBASMFactor *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3893 
3894  /* function exit code */
3895  __Pyx_RefNannyFinishContext();
3896  return __pyx_r;
3897 }
3898 
3899 static PyObject *__pyx_pf_10csmoothers_11cBASMFactor_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10csmoothers_cBASMFactor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3900  PyObject *__pyx_r = NULL;
3901  __Pyx_RefNannyDeclarations
3902  PyObject *__pyx_t_1 = NULL;
3903  int __pyx_lineno = 0;
3904  const char *__pyx_filename = NULL;
3905  int __pyx_clineno = 0;
3906  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3907 
3908  /* "(tree fragment)":4
3909  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3910  * def __setstate_cython__(self, __pyx_state):
3911  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3912  */
3913  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
3914  __Pyx_GOTREF(__pyx_t_1);
3915  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3916  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3917  __PYX_ERR(1, 4, __pyx_L1_error)
3918 
3919  /* "(tree fragment)":3
3920  * def __reduce_cython__(self):
3921  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3922  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3923  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3924  */
3925 
3926  /* function exit code */
3927  __pyx_L1_error:;
3928  __Pyx_XDECREF(__pyx_t_1);
3929  __Pyx_AddTraceback("csmoothers.cBASMFactor.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3930  __pyx_r = NULL;
3931  __Pyx_XGIVEREF(__pyx_r);
3932  __Pyx_RefNannyFinishContext();
3933  return __pyx_r;
3934 }
3935 
3936 /* "csmoothers.pyx":84
3937  * self.subdomain_col_pivots)
3938  *
3939  * def jacobi_NR_prepare(A, w, tol, M): # <<<<<<<<<<<<<<
3940  * """
3941  *
3942  */
3943 
3944 /* Python wrapper */
3945 static PyObject *__pyx_pw_10csmoothers_1jacobi_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3946 static char __pyx_doc_10csmoothers_jacobi_NR_prepare[] = "\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n w : double\n tol : double\n M : np.array\n ";
3947 static PyMethodDef __pyx_mdef_10csmoothers_1jacobi_NR_prepare = {"jacobi_NR_prepare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_1jacobi_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_jacobi_NR_prepare};
3948 static PyObject *__pyx_pw_10csmoothers_1jacobi_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3949  PyObject *__pyx_v_A = 0;
3950  PyObject *__pyx_v_w = 0;
3951  PyObject *__pyx_v_tol = 0;
3952  PyObject *__pyx_v_M = 0;
3953  int __pyx_lineno = 0;
3954  const char *__pyx_filename = NULL;
3955  int __pyx_clineno = 0;
3956  PyObject *__pyx_r = 0;
3957  __Pyx_RefNannyDeclarations
3958  __Pyx_RefNannySetupContext("jacobi_NR_prepare (wrapper)", 0);
3959  {
3960  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_M,0};
3961  PyObject* values[4] = {0,0,0,0};
3962  if (unlikely(__pyx_kwds)) {
3963  Py_ssize_t kw_args;
3964  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3965  switch (pos_args) {
3966  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3967  CYTHON_FALLTHROUGH;
3968  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3969  CYTHON_FALLTHROUGH;
3970  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3971  CYTHON_FALLTHROUGH;
3972  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3973  CYTHON_FALLTHROUGH;
3974  case 0: break;
3975  default: goto __pyx_L5_argtuple_error;
3976  }
3977  kw_args = PyDict_Size(__pyx_kwds);
3978  switch (pos_args) {
3979  case 0:
3980  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
3981  else goto __pyx_L5_argtuple_error;
3982  CYTHON_FALLTHROUGH;
3983  case 1:
3984  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
3985  else {
3986  __Pyx_RaiseArgtupleInvalid("jacobi_NR_prepare", 1, 4, 4, 1); __PYX_ERR(0, 84, __pyx_L3_error)
3987  }
3988  CYTHON_FALLTHROUGH;
3989  case 2:
3990  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
3991  else {
3992  __Pyx_RaiseArgtupleInvalid("jacobi_NR_prepare", 1, 4, 4, 2); __PYX_ERR(0, 84, __pyx_L3_error)
3993  }
3994  CYTHON_FALLTHROUGH;
3995  case 3:
3996  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
3997  else {
3998  __Pyx_RaiseArgtupleInvalid("jacobi_NR_prepare", 1, 4, 4, 3); __PYX_ERR(0, 84, __pyx_L3_error)
3999  }
4000  }
4001  if (unlikely(kw_args > 0)) {
4002  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "jacobi_NR_prepare") < 0)) __PYX_ERR(0, 84, __pyx_L3_error)
4003  }
4004  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
4005  goto __pyx_L5_argtuple_error;
4006  } else {
4007  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4008  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4009  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4010  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4011  }
4012  __pyx_v_A = values[0];
4013  __pyx_v_w = values[1];
4014  __pyx_v_tol = values[2];
4015  __pyx_v_M = values[3];
4016  }
4017  goto __pyx_L4_argument_unpacking_done;
4018  __pyx_L5_argtuple_error:;
4019  __Pyx_RaiseArgtupleInvalid("jacobi_NR_prepare", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 84, __pyx_L3_error)
4020  __pyx_L3_error:;
4021  __Pyx_AddTraceback("csmoothers.jacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4022  __Pyx_RefNannyFinishContext();
4023  return NULL;
4024  __pyx_L4_argument_unpacking_done:;
4025  __pyx_r = __pyx_pf_10csmoothers_jacobi_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_tol, __pyx_v_M);
4026 
4027  /* function exit code */
4028  __Pyx_RefNannyFinishContext();
4029  return __pyx_r;
4030 }
4031 
4032 static PyObject *__pyx_pf_10csmoothers_jacobi_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M) {
4033  PyObject *__pyx_r = NULL;
4034  __Pyx_RefNannyDeclarations
4035  PyObject *__pyx_t_1 = NULL;
4036  double __pyx_t_2;
4037  double __pyx_t_3;
4038  __pyx_t_10csmoothers_DDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4039  int __pyx_lineno = 0;
4040  const char *__pyx_filename = NULL;
4041  int __pyx_clineno = 0;
4042  __Pyx_RefNannySetupContext("jacobi_NR_prepare", 0);
4043 
4044  /* "csmoothers.pyx":94
4045  * M : np.array
4046  * """
4047  * smootherWrappersjacobi_NR_prepare(A._cSparseMatrix, w, tol, M) # <<<<<<<<<<<<<<
4048  *
4049  * cdef void smootherWrappersjacobi_NR_prepare(superluWrappers.cSparseMatrix sm,
4050  */
4051  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
4052  __Pyx_GOTREF(__pyx_t_1);
4053  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 94, __pyx_L1_error)
4054  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error)
4055  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error)
4056  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 94, __pyx_L1_error)
4057  __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4);
4058  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4059  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4060  __pyx_t_4.memview = NULL;
4061  __pyx_t_4.data = NULL;
4062 
4063  /* "csmoothers.pyx":84
4064  * self.subdomain_col_pivots)
4065  *
4066  * def jacobi_NR_prepare(A, w, tol, M): # <<<<<<<<<<<<<<
4067  * """
4068  *
4069  */
4070 
4071  /* function exit code */
4072  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4073  goto __pyx_L0;
4074  __pyx_L1_error:;
4075  __Pyx_XDECREF(__pyx_t_1);
4076  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4077  __Pyx_AddTraceback("csmoothers.jacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4078  __pyx_r = NULL;
4079  __pyx_L0:;
4080  __Pyx_XGIVEREF(__pyx_r);
4081  __Pyx_RefNannyFinishContext();
4082  return __pyx_r;
4083 }
4084 
4085 /* "csmoothers.pyx":96
4086  * smootherWrappersjacobi_NR_prepare(A._cSparseMatrix, w, tol, M)
4087  *
4088  * cdef void smootherWrappersjacobi_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4089  * double w,
4090  * double tol,
4091  */
4092 
4093 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_M) {
4094  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4095  __Pyx_RefNannyDeclarations
4096  PyObject *__pyx_t_1 = NULL;
4097  int __pyx_t_2;
4098  Py_ssize_t __pyx_t_3;
4099  int __pyx_lineno = 0;
4100  const char *__pyx_filename = NULL;
4101  int __pyx_clineno = 0;
4102  __Pyx_RefNannySetupContext("smootherWrappersjacobi_NR_prepare", 0);
4103 
4104  /* "csmoothers.pyx":101
4105  * DDATA M):
4106  * cdef SuperMatrix AS
4107  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
4108  * AS.Dtype = superluWrappers._SLU_D
4109  * AS.Mtype = superluWrappers._SLU_GE
4110  */
4111  __pyx_v_AS.Stype = SLU_NR;
4112 
4113  /* "csmoothers.pyx":102
4114  * cdef SuperMatrix AS
4115  * AS.Stype = superluWrappers._SLU_NR
4116  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
4117  * AS.Mtype = superluWrappers._SLU_GE
4118  * AS.nrow = sm.nr
4119  */
4120  __pyx_v_AS.Dtype = SLU_D;
4121 
4122  /* "csmoothers.pyx":103
4123  * AS.Stype = superluWrappers._SLU_NR
4124  * AS.Dtype = superluWrappers._SLU_D
4125  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
4126  * AS.nrow = sm.nr
4127  * AS.ncol = sm.nc
4128  */
4129  __pyx_v_AS.Mtype = SLU_GE;
4130 
4131  /* "csmoothers.pyx":104
4132  * AS.Dtype = superluWrappers._SLU_D
4133  * AS.Mtype = superluWrappers._SLU_GE
4134  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
4135  * AS.ncol = sm.nc
4136  * AS.Store = &sm.A
4137  */
4138  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
4139  __Pyx_GOTREF(__pyx_t_1);
4140  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error)
4141  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4142  __pyx_v_AS.nrow = __pyx_t_2;
4143 
4144  /* "csmoothers.pyx":105
4145  * AS.Mtype = superluWrappers._SLU_GE
4146  * AS.nrow = sm.nr
4147  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
4148  * AS.Store = &sm.A
4149  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
4150  */
4151  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
4152  __Pyx_GOTREF(__pyx_t_1);
4153  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error)
4154  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4155  __pyx_v_AS.ncol = __pyx_t_2;
4156 
4157  /* "csmoothers.pyx":106
4158  * AS.nrow = sm.nr
4159  * AS.ncol = sm.nc
4160  * AS.Store = &sm.A # <<<<<<<<<<<<<<
4161  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
4162  *
4163  */
4164  __pyx_v_AS.Store = (&__pyx_v_sm->A);
4165 
4166  /* "csmoothers.pyx":107
4167  * AS.ncol = sm.nc
4168  * AS.Store = &sm.A
4169  * cjacobi_NR_prepare(&AS, w, tol, &M[0]) # <<<<<<<<<<<<<<
4170  *
4171  * def jacobi_NR_solve(A, M, R, node_order, dX):
4172  */
4173  __pyx_t_3 = 0;
4174  __pyx_t_2 = -1;
4175  if (__pyx_t_3 < 0) {
4176  __pyx_t_3 += __pyx_v_M.shape[0];
4177  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4178  } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
4179  if (unlikely(__pyx_t_2 != -1)) {
4180  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4181  __PYX_ERR(0, 107, __pyx_L1_error)
4182  }
4183  jacobi_NR_prepare((&__pyx_v_AS), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))));
4184 
4185  /* "csmoothers.pyx":96
4186  * smootherWrappersjacobi_NR_prepare(A._cSparseMatrix, w, tol, M)
4187  *
4188  * cdef void smootherWrappersjacobi_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4189  * double w,
4190  * double tol,
4191  */
4192 
4193  /* function exit code */
4194  goto __pyx_L0;
4195  __pyx_L1_error:;
4196  __Pyx_XDECREF(__pyx_t_1);
4197  __Pyx_WriteUnraisable("csmoothers.smootherWrappersjacobi_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4198  __pyx_L0:;
4199  __Pyx_RefNannyFinishContext();
4200 }
4201 
4202 /* "csmoothers.pyx":109
4203  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
4204  *
4205  * def jacobi_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
4206  * """
4207  *
4208  */
4209 
4210 /* Python wrapper */
4211 static PyObject *__pyx_pw_10csmoothers_3jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4212 static char __pyx_doc_10csmoothers_2jacobi_NR_solve[] = "\n \n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n M : np.array double\n R : np.array double\n node_order : np.array int\n dX : np.array double\n ";
4213 static PyMethodDef __pyx_mdef_10csmoothers_3jacobi_NR_solve = {"jacobi_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_3jacobi_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_2jacobi_NR_solve};
4214 static PyObject *__pyx_pw_10csmoothers_3jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4215  PyObject *__pyx_v_A = 0;
4216  PyObject *__pyx_v_M = 0;
4217  PyObject *__pyx_v_R = 0;
4218  PyObject *__pyx_v_node_order = 0;
4219  PyObject *__pyx_v_dX = 0;
4220  int __pyx_lineno = 0;
4221  const char *__pyx_filename = NULL;
4222  int __pyx_clineno = 0;
4223  PyObject *__pyx_r = 0;
4224  __Pyx_RefNannyDeclarations
4225  __Pyx_RefNannySetupContext("jacobi_NR_solve (wrapper)", 0);
4226  {
4227  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_M,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_dX,0};
4228  PyObject* values[5] = {0,0,0,0,0};
4229  if (unlikely(__pyx_kwds)) {
4230  Py_ssize_t kw_args;
4231  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4232  switch (pos_args) {
4233  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4234  CYTHON_FALLTHROUGH;
4235  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4236  CYTHON_FALLTHROUGH;
4237  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4238  CYTHON_FALLTHROUGH;
4239  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4240  CYTHON_FALLTHROUGH;
4241  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4242  CYTHON_FALLTHROUGH;
4243  case 0: break;
4244  default: goto __pyx_L5_argtuple_error;
4245  }
4246  kw_args = PyDict_Size(__pyx_kwds);
4247  switch (pos_args) {
4248  case 0:
4249  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4250  else goto __pyx_L5_argtuple_error;
4251  CYTHON_FALLTHROUGH;
4252  case 1:
4253  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
4254  else {
4255  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, 1); __PYX_ERR(0, 109, __pyx_L3_error)
4256  }
4257  CYTHON_FALLTHROUGH;
4258  case 2:
4259  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
4260  else {
4261  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, 2); __PYX_ERR(0, 109, __pyx_L3_error)
4262  }
4263  CYTHON_FALLTHROUGH;
4264  case 3:
4265  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
4266  else {
4267  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, 3); __PYX_ERR(0, 109, __pyx_L3_error)
4268  }
4269  CYTHON_FALLTHROUGH;
4270  case 4:
4271  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
4272  else {
4273  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, 4); __PYX_ERR(0, 109, __pyx_L3_error)
4274  }
4275  }
4276  if (unlikely(kw_args > 0)) {
4277  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "jacobi_NR_solve") < 0)) __PYX_ERR(0, 109, __pyx_L3_error)
4278  }
4279  } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4280  goto __pyx_L5_argtuple_error;
4281  } else {
4282  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4283  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4284  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4285  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4286  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4287  }
4288  __pyx_v_A = values[0];
4289  __pyx_v_M = values[1];
4290  __pyx_v_R = values[2];
4291  __pyx_v_node_order = values[3];
4292  __pyx_v_dX = values[4];
4293  }
4294  goto __pyx_L4_argument_unpacking_done;
4295  __pyx_L5_argtuple_error:;
4296  __Pyx_RaiseArgtupleInvalid("jacobi_NR_solve", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 109, __pyx_L3_error)
4297  __pyx_L3_error:;
4298  __Pyx_AddTraceback("csmoothers.jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4299  __Pyx_RefNannyFinishContext();
4300  return NULL;
4301  __pyx_L4_argument_unpacking_done:;
4302  __pyx_r = __pyx_pf_10csmoothers_2jacobi_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_M, __pyx_v_R, __pyx_v_node_order, __pyx_v_dX);
4303 
4304  /* function exit code */
4305  __Pyx_RefNannyFinishContext();
4306  return __pyx_r;
4307 }
4308 
4309 static PyObject *__pyx_pf_10csmoothers_2jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX) {
4310  PyObject *__pyx_r = NULL;
4311  __Pyx_RefNannyDeclarations
4312  PyObject *__pyx_t_1 = NULL;
4313  __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
4314  __pyx_t_10csmoothers_DDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
4315  __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4316  __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4317  int __pyx_lineno = 0;
4318  const char *__pyx_filename = NULL;
4319  int __pyx_clineno = 0;
4320  __Pyx_RefNannySetupContext("jacobi_NR_solve", 0);
4321 
4322  /* "csmoothers.pyx":120
4323  * dX : np.array double
4324  * """
4325  * smootherWrappersjacobi_NR_solve(A._cSparseMatrix, M, R, node_order, dX) # <<<<<<<<<<<<<<
4326  *
4327  * cdef void smootherWrappersjacobi_NR_solve(superluWrappers.cSparseMatrix sm,
4328  */
4329  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
4330  __Pyx_GOTREF(__pyx_t_1);
4331  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 120, __pyx_L1_error)
4332  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4333  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4334  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4335  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
4336  __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5);
4337  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4338  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4339  __pyx_t_2.memview = NULL;
4340  __pyx_t_2.data = NULL;
4341  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4342  __pyx_t_3.memview = NULL;
4343  __pyx_t_3.data = NULL;
4344  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4345  __pyx_t_4.memview = NULL;
4346  __pyx_t_4.data = NULL;
4347  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4348  __pyx_t_5.memview = NULL;
4349  __pyx_t_5.data = NULL;
4350 
4351  /* "csmoothers.pyx":109
4352  * cjacobi_NR_prepare(&AS, w, tol, &M[0])
4353  *
4354  * def jacobi_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
4355  * """
4356  *
4357  */
4358 
4359  /* function exit code */
4360  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4361  goto __pyx_L0;
4362  __pyx_L1_error:;
4363  __Pyx_XDECREF(__pyx_t_1);
4364  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4365  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4366  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4367  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4368  __Pyx_AddTraceback("csmoothers.jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4369  __pyx_r = NULL;
4370  __pyx_L0:;
4371  __Pyx_XGIVEREF(__pyx_r);
4372  __Pyx_RefNannyFinishContext();
4373  return __pyx_r;
4374 }
4375 
4376 /* "csmoothers.pyx":122
4377  * smootherWrappersjacobi_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
4378  *
4379  * cdef void smootherWrappersjacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4380  * DDATA M,
4381  * DDATA R,
4382  */
4383 
4384 static void __pyx_f_10csmoothers_smootherWrappersjacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_M, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
4385  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4386  __Pyx_RefNannyDeclarations
4387  PyObject *__pyx_t_1 = NULL;
4388  int __pyx_t_2;
4389  Py_ssize_t __pyx_t_3;
4390  Py_ssize_t __pyx_t_4;
4391  Py_ssize_t __pyx_t_5;
4392  Py_ssize_t __pyx_t_6;
4393  int __pyx_lineno = 0;
4394  const char *__pyx_filename = NULL;
4395  int __pyx_clineno = 0;
4396  __Pyx_RefNannySetupContext("smootherWrappersjacobi_NR_solve", 0);
4397 
4398  /* "csmoothers.pyx":128
4399  * DDATA dX):
4400  * cdef SuperMatrix AS
4401  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
4402  * AS.Dtype = superluWrappers._SLU_D
4403  * AS.Mtype = superluWrappers._SLU_GE
4404  */
4405  __pyx_v_AS.Stype = SLU_NR;
4406 
4407  /* "csmoothers.pyx":129
4408  * cdef SuperMatrix AS
4409  * AS.Stype = superluWrappers._SLU_NR
4410  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
4411  * AS.Mtype = superluWrappers._SLU_GE
4412  * AS.nrow = sm.nr
4413  */
4414  __pyx_v_AS.Dtype = SLU_D;
4415 
4416  /* "csmoothers.pyx":130
4417  * AS.Stype = superluWrappers._SLU_NR
4418  * AS.Dtype = superluWrappers._SLU_D
4419  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
4420  * AS.nrow = sm.nr
4421  * AS.ncol = sm.nc
4422  */
4423  __pyx_v_AS.Mtype = SLU_GE;
4424 
4425  /* "csmoothers.pyx":131
4426  * AS.Dtype = superluWrappers._SLU_D
4427  * AS.Mtype = superluWrappers._SLU_GE
4428  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
4429  * AS.ncol = sm.nc
4430  * AS.Store = &sm.A
4431  */
4432  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
4433  __Pyx_GOTREF(__pyx_t_1);
4434  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L1_error)
4435  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4436  __pyx_v_AS.nrow = __pyx_t_2;
4437 
4438  /* "csmoothers.pyx":132
4439  * AS.Mtype = superluWrappers._SLU_GE
4440  * AS.nrow = sm.nr
4441  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
4442  * AS.Store = &sm.A
4443  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
4444  */
4445  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
4446  __Pyx_GOTREF(__pyx_t_1);
4447  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
4448  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4449  __pyx_v_AS.ncol = __pyx_t_2;
4450 
4451  /* "csmoothers.pyx":133
4452  * AS.nrow = sm.nr
4453  * AS.ncol = sm.nc
4454  * AS.Store = &sm.A # <<<<<<<<<<<<<<
4455  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
4456  *
4457  */
4458  __pyx_v_AS.Store = (&__pyx_v_sm->A);
4459 
4460  /* "csmoothers.pyx":134
4461  * AS.ncol = sm.nc
4462  * AS.Store = &sm.A
4463  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0]) # <<<<<<<<<<<<<<
4464  *
4465  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX):
4466  */
4467  __pyx_t_3 = 0;
4468  __pyx_t_2 = -1;
4469  if (__pyx_t_3 < 0) {
4470  __pyx_t_3 += __pyx_v_M.shape[0];
4471  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4472  } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
4473  if (unlikely(__pyx_t_2 != -1)) {
4474  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4475  __PYX_ERR(0, 134, __pyx_L1_error)
4476  }
4477  __pyx_t_4 = 0;
4478  __pyx_t_2 = -1;
4479  if (__pyx_t_4 < 0) {
4480  __pyx_t_4 += __pyx_v_R.shape[0];
4481  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
4482  } else if (unlikely(__pyx_t_4 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
4483  if (unlikely(__pyx_t_2 != -1)) {
4484  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4485  __PYX_ERR(0, 134, __pyx_L1_error)
4486  }
4487  __pyx_t_5 = 0;
4488  __pyx_t_2 = -1;
4489  if (__pyx_t_5 < 0) {
4490  __pyx_t_5 += __pyx_v_node_order.shape[0];
4491  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
4492  } else if (unlikely(__pyx_t_5 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
4493  if (unlikely(__pyx_t_2 != -1)) {
4494  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4495  __PYX_ERR(0, 134, __pyx_L1_error)
4496  }
4497  __pyx_t_6 = 0;
4498  __pyx_t_2 = -1;
4499  if (__pyx_t_6 < 0) {
4500  __pyx_t_6 += __pyx_v_dX.shape[0];
4501  if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
4502  } else if (unlikely(__pyx_t_6 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
4503  if (unlikely(__pyx_t_2 != -1)) {
4504  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4505  __PYX_ERR(0, 134, __pyx_L1_error)
4506  }
4507  jacobi_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_4 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_5 * __pyx_v_node_order.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_6 * __pyx_v_dX.strides[0]) )))));
4508 
4509  /* "csmoothers.pyx":122
4510  * smootherWrappersjacobi_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
4511  *
4512  * cdef void smootherWrappersjacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4513  * DDATA M,
4514  * DDATA R,
4515  */
4516 
4517  /* function exit code */
4518  goto __pyx_L0;
4519  __pyx_L1_error:;
4520  __Pyx_XDECREF(__pyx_t_1);
4521  __Pyx_WriteUnraisable("csmoothers.smootherWrappersjacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4522  __pyx_L0:;
4523  __Pyx_RefNannyFinishContext();
4524 }
4525 
4526 /* "csmoothers.pyx":136
4527  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
4528  *
4529  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
4530  * """
4531  *
4532  */
4533 
4534 /* Python wrapper */
4535 static PyObject *__pyx_pw_10csmoothers_5nl_jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4536 static char __pyx_doc_10csmoothers_4nl_jacobi_NR_solve[] = "\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n R : np.array double\n node_order : np.array int\n w : np.float\n tol : np.float\n dX : np.array double\n ";
4537 static PyMethodDef __pyx_mdef_10csmoothers_5nl_jacobi_NR_solve = {"nl_jacobi_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_5nl_jacobi_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_4nl_jacobi_NR_solve};
4538 static PyObject *__pyx_pw_10csmoothers_5nl_jacobi_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4539  PyObject *__pyx_v_A = 0;
4540  PyObject *__pyx_v_R = 0;
4541  PyObject *__pyx_v_node_order = 0;
4542  PyObject *__pyx_v_w = 0;
4543  PyObject *__pyx_v_tol = 0;
4544  PyObject *__pyx_v_dX = 0;
4545  int __pyx_lineno = 0;
4546  const char *__pyx_filename = NULL;
4547  int __pyx_clineno = 0;
4548  PyObject *__pyx_r = 0;
4549  __Pyx_RefNannyDeclarations
4550  __Pyx_RefNannySetupContext("nl_jacobi_NR_solve (wrapper)", 0);
4551  {
4552  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_dX,0};
4553  PyObject* values[6] = {0,0,0,0,0,0};
4554  if (unlikely(__pyx_kwds)) {
4555  Py_ssize_t kw_args;
4556  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4557  switch (pos_args) {
4558  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4559  CYTHON_FALLTHROUGH;
4560  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4561  CYTHON_FALLTHROUGH;
4562  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4563  CYTHON_FALLTHROUGH;
4564  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4565  CYTHON_FALLTHROUGH;
4566  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4567  CYTHON_FALLTHROUGH;
4568  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4569  CYTHON_FALLTHROUGH;
4570  case 0: break;
4571  default: goto __pyx_L5_argtuple_error;
4572  }
4573  kw_args = PyDict_Size(__pyx_kwds);
4574  switch (pos_args) {
4575  case 0:
4576  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4577  else goto __pyx_L5_argtuple_error;
4578  CYTHON_FALLTHROUGH;
4579  case 1:
4580  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
4581  else {
4582  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 136, __pyx_L3_error)
4583  }
4584  CYTHON_FALLTHROUGH;
4585  case 2:
4586  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
4587  else {
4588  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 136, __pyx_L3_error)
4589  }
4590  CYTHON_FALLTHROUGH;
4591  case 3:
4592  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
4593  else {
4594  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 136, __pyx_L3_error)
4595  }
4596  CYTHON_FALLTHROUGH;
4597  case 4:
4598  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
4599  else {
4600  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 136, __pyx_L3_error)
4601  }
4602  CYTHON_FALLTHROUGH;
4603  case 5:
4604  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
4605  else {
4606  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 136, __pyx_L3_error)
4607  }
4608  }
4609  if (unlikely(kw_args > 0)) {
4610  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nl_jacobi_NR_solve") < 0)) __PYX_ERR(0, 136, __pyx_L3_error)
4611  }
4612  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
4613  goto __pyx_L5_argtuple_error;
4614  } else {
4615  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4616  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4617  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4618  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4619  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4620  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4621  }
4622  __pyx_v_A = values[0];
4623  __pyx_v_R = values[1];
4624  __pyx_v_node_order = values[2];
4625  __pyx_v_w = values[3];
4626  __pyx_v_tol = values[4];
4627  __pyx_v_dX = values[5];
4628  }
4629  goto __pyx_L4_argument_unpacking_done;
4630  __pyx_L5_argtuple_error:;
4631  __Pyx_RaiseArgtupleInvalid("nl_jacobi_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 136, __pyx_L3_error)
4632  __pyx_L3_error:;
4633  __Pyx_AddTraceback("csmoothers.nl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4634  __Pyx_RefNannyFinishContext();
4635  return NULL;
4636  __pyx_L4_argument_unpacking_done:;
4637  __pyx_r = __pyx_pf_10csmoothers_4nl_jacobi_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_R, __pyx_v_node_order, __pyx_v_w, __pyx_v_tol, __pyx_v_dX);
4638 
4639  /* function exit code */
4640  __Pyx_RefNannyFinishContext();
4641  return __pyx_r;
4642 }
4643 
4644 static PyObject *__pyx_pf_10csmoothers_4nl_jacobi_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX) {
4645  PyObject *__pyx_r = NULL;
4646  __Pyx_RefNannyDeclarations
4647  PyObject *__pyx_t_1 = NULL;
4648  __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
4649  __pyx_t_10csmoothers_IDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
4650  double __pyx_t_4;
4651  double __pyx_t_5;
4652  __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
4653  int __pyx_lineno = 0;
4654  const char *__pyx_filename = NULL;
4655  int __pyx_clineno = 0;
4656  __Pyx_RefNannySetupContext("nl_jacobi_NR_solve", 0);
4657 
4658  /* "csmoothers.pyx":148
4659  * dX : np.array double
4660  * """
4661  * smootherWrappersnl_jacobi_NR_solve(A._cSparseMatrix, R, node_order, w, tol, dX) # <<<<<<<<<<<<<<
4662  *
4663  * cdef void smootherWrappersnl_jacobi_NR_solve(superluWrappers.cSparseMatrix sm,
4664  */
4665  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
4666  __Pyx_GOTREF(__pyx_t_1);
4667  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 148, __pyx_L1_error)
4668  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4669  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4670  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
4671  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
4672  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 148, __pyx_L1_error)
4673  __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6);
4674  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4675  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4676  __pyx_t_2.memview = NULL;
4677  __pyx_t_2.data = NULL;
4678  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4679  __pyx_t_3.memview = NULL;
4680  __pyx_t_3.data = NULL;
4681  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4682  __pyx_t_6.memview = NULL;
4683  __pyx_t_6.data = NULL;
4684 
4685  /* "csmoothers.pyx":136
4686  * cjacobi_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
4687  *
4688  * def nl_jacobi_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
4689  * """
4690  *
4691  */
4692 
4693  /* function exit code */
4694  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4695  goto __pyx_L0;
4696  __pyx_L1_error:;
4697  __Pyx_XDECREF(__pyx_t_1);
4698  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
4699  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
4700  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
4701  __Pyx_AddTraceback("csmoothers.nl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
4702  __pyx_r = NULL;
4703  __pyx_L0:;
4704  __Pyx_XGIVEREF(__pyx_r);
4705  __Pyx_RefNannyFinishContext();
4706  return __pyx_r;
4707 }
4708 
4709 /* "csmoothers.pyx":150
4710  * smootherWrappersnl_jacobi_NR_solve(A._cSparseMatrix, R, node_order, w, tol, dX)
4711  *
4712  * cdef void smootherWrappersnl_jacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4713  * DDATA R,
4714  * IDATA node_order,
4715  */
4716 
4717 static void __pyx_f_10csmoothers_smootherWrappersnl_jacobi_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
4718  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
4719  __Pyx_RefNannyDeclarations
4720  PyObject *__pyx_t_1 = NULL;
4721  int __pyx_t_2;
4722  Py_ssize_t __pyx_t_3;
4723  Py_ssize_t __pyx_t_4;
4724  Py_ssize_t __pyx_t_5;
4725  int __pyx_lineno = 0;
4726  const char *__pyx_filename = NULL;
4727  int __pyx_clineno = 0;
4728  __Pyx_RefNannySetupContext("smootherWrappersnl_jacobi_NR_solve", 0);
4729 
4730  /* "csmoothers.pyx":157
4731  * DDATA dX):
4732  * cdef SuperMatrix AS
4733  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
4734  * AS.Dtype = superluWrappers._SLU_D
4735  * AS.Mtype = superluWrappers._SLU_GE
4736  */
4737  __pyx_v_AS.Stype = SLU_NR;
4738 
4739  /* "csmoothers.pyx":158
4740  * cdef SuperMatrix AS
4741  * AS.Stype = superluWrappers._SLU_NR
4742  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
4743  * AS.Mtype = superluWrappers._SLU_GE
4744  * AS.nrow = sm.nr
4745  */
4746  __pyx_v_AS.Dtype = SLU_D;
4747 
4748  /* "csmoothers.pyx":159
4749  * AS.Stype = superluWrappers._SLU_NR
4750  * AS.Dtype = superluWrappers._SLU_D
4751  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
4752  * AS.nrow = sm.nr
4753  * AS.ncol = sm.nc
4754  */
4755  __pyx_v_AS.Mtype = SLU_GE;
4756 
4757  /* "csmoothers.pyx":160
4758  * AS.Dtype = superluWrappers._SLU_D
4759  * AS.Mtype = superluWrappers._SLU_GE
4760  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
4761  * AS.ncol = sm.nc
4762  * AS.Store = &sm.A
4763  */
4764  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
4765  __Pyx_GOTREF(__pyx_t_1);
4766  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error)
4767  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4768  __pyx_v_AS.nrow = __pyx_t_2;
4769 
4770  /* "csmoothers.pyx":161
4771  * AS.Mtype = superluWrappers._SLU_GE
4772  * AS.nrow = sm.nr
4773  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
4774  * AS.Store = &sm.A
4775  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
4776  */
4777  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
4778  __Pyx_GOTREF(__pyx_t_1);
4779  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
4780  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4781  __pyx_v_AS.ncol = __pyx_t_2;
4782 
4783  /* "csmoothers.pyx":162
4784  * AS.nrow = sm.nr
4785  * AS.ncol = sm.nc
4786  * AS.Store = &sm.A # <<<<<<<<<<<<<<
4787  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
4788  *
4789  */
4790  __pyx_v_AS.Store = (&__pyx_v_sm->A);
4791 
4792  /* "csmoothers.pyx":163
4793  * AS.ncol = sm.nc
4794  * AS.Store = &sm.A
4795  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0]) # <<<<<<<<<<<<<<
4796  *
4797  * def gauss_seidel_NR_preare(A, w, tol, M):
4798  */
4799  __pyx_t_3 = 0;
4800  __pyx_t_2 = -1;
4801  if (__pyx_t_3 < 0) {
4802  __pyx_t_3 += __pyx_v_R.shape[0];
4803  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
4804  } else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
4805  if (unlikely(__pyx_t_2 != -1)) {
4806  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4807  __PYX_ERR(0, 163, __pyx_L1_error)
4808  }
4809  __pyx_t_4 = 0;
4810  __pyx_t_2 = -1;
4811  if (__pyx_t_4 < 0) {
4812  __pyx_t_4 += __pyx_v_node_order.shape[0];
4813  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
4814  } else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
4815  if (unlikely(__pyx_t_2 != -1)) {
4816  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4817  __PYX_ERR(0, 163, __pyx_L1_error)
4818  }
4819  __pyx_t_5 = 0;
4820  __pyx_t_2 = -1;
4821  if (__pyx_t_5 < 0) {
4822  __pyx_t_5 += __pyx_v_dX.shape[0];
4823  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
4824  } else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
4825  if (unlikely(__pyx_t_2 != -1)) {
4826  __Pyx_RaiseBufferIndexError(__pyx_t_2);
4827  __PYX_ERR(0, 163, __pyx_L1_error)
4828  }
4829  nl_jacobi_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))));
4830 
4831  /* "csmoothers.pyx":150
4832  * smootherWrappersnl_jacobi_NR_solve(A._cSparseMatrix, R, node_order, w, tol, dX)
4833  *
4834  * cdef void smootherWrappersnl_jacobi_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
4835  * DDATA R,
4836  * IDATA node_order,
4837  */
4838 
4839  /* function exit code */
4840  goto __pyx_L0;
4841  __pyx_L1_error:;
4842  __Pyx_XDECREF(__pyx_t_1);
4843  __Pyx_WriteUnraisable("csmoothers.smootherWrappersnl_jacobi_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4844  __pyx_L0:;
4845  __Pyx_RefNannyFinishContext();
4846 }
4847 
4848 /* "csmoothers.pyx":165
4849  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
4850  *
4851  * def gauss_seidel_NR_preare(A, w, tol, M): # <<<<<<<<<<<<<<
4852  * """
4853  *
4854  */
4855 
4856 /* Python wrapper */
4857 static PyObject *__pyx_pw_10csmoothers_7gauss_seidel_NR_preare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4858 static char __pyx_doc_10csmoothers_6gauss_seidel_NR_preare[] = "\n\n Arguments\n ---------\n A :\n w :\n tol :\n M :\n ";
4859 static PyMethodDef __pyx_mdef_10csmoothers_7gauss_seidel_NR_preare = {"gauss_seidel_NR_preare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_7gauss_seidel_NR_preare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_6gauss_seidel_NR_preare};
4860 static PyObject *__pyx_pw_10csmoothers_7gauss_seidel_NR_preare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4861  PyObject *__pyx_v_A = 0;
4862  PyObject *__pyx_v_w = 0;
4863  PyObject *__pyx_v_tol = 0;
4864  PyObject *__pyx_v_M = 0;
4865  int __pyx_lineno = 0;
4866  const char *__pyx_filename = NULL;
4867  int __pyx_clineno = 0;
4868  PyObject *__pyx_r = 0;
4869  __Pyx_RefNannyDeclarations
4870  __Pyx_RefNannySetupContext("gauss_seidel_NR_preare (wrapper)", 0);
4871  {
4872  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_M,0};
4873  PyObject* values[4] = {0,0,0,0};
4874  if (unlikely(__pyx_kwds)) {
4875  Py_ssize_t kw_args;
4876  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4877  switch (pos_args) {
4878  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4879  CYTHON_FALLTHROUGH;
4880  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4881  CYTHON_FALLTHROUGH;
4882  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4883  CYTHON_FALLTHROUGH;
4884  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4885  CYTHON_FALLTHROUGH;
4886  case 0: break;
4887  default: goto __pyx_L5_argtuple_error;
4888  }
4889  kw_args = PyDict_Size(__pyx_kwds);
4890  switch (pos_args) {
4891  case 0:
4892  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
4893  else goto __pyx_L5_argtuple_error;
4894  CYTHON_FALLTHROUGH;
4895  case 1:
4896  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
4897  else {
4898  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_preare", 1, 4, 4, 1); __PYX_ERR(0, 165, __pyx_L3_error)
4899  }
4900  CYTHON_FALLTHROUGH;
4901  case 2:
4902  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
4903  else {
4904  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_preare", 1, 4, 4, 2); __PYX_ERR(0, 165, __pyx_L3_error)
4905  }
4906  CYTHON_FALLTHROUGH;
4907  case 3:
4908  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
4909  else {
4910  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_preare", 1, 4, 4, 3); __PYX_ERR(0, 165, __pyx_L3_error)
4911  }
4912  }
4913  if (unlikely(kw_args > 0)) {
4914  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gauss_seidel_NR_preare") < 0)) __PYX_ERR(0, 165, __pyx_L3_error)
4915  }
4916  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
4917  goto __pyx_L5_argtuple_error;
4918  } else {
4919  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4920  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4921  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4922  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4923  }
4924  __pyx_v_A = values[0];
4925  __pyx_v_w = values[1];
4926  __pyx_v_tol = values[2];
4927  __pyx_v_M = values[3];
4928  }
4929  goto __pyx_L4_argument_unpacking_done;
4930  __pyx_L5_argtuple_error:;
4931  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_preare", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 165, __pyx_L3_error)
4932  __pyx_L3_error:;
4933  __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_preare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4934  __Pyx_RefNannyFinishContext();
4935  return NULL;
4936  __pyx_L4_argument_unpacking_done:;
4937  __pyx_r = __pyx_pf_10csmoothers_6gauss_seidel_NR_preare(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_tol, __pyx_v_M);
4938 
4939  /* function exit code */
4940  __Pyx_RefNannyFinishContext();
4941  return __pyx_r;
4942 }
4943 
4944 static PyObject *__pyx_pf_10csmoothers_6gauss_seidel_NR_preare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_M) {
4945  PyObject *__pyx_r = NULL;
4946  __Pyx_RefNannyDeclarations
4947  PyObject *__pyx_t_1 = NULL;
4948  double __pyx_t_2;
4949  double __pyx_t_3;
4950  __pyx_t_10csmoothers_DDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
4951  int __pyx_lineno = 0;
4952  const char *__pyx_filename = NULL;
4953  int __pyx_clineno = 0;
4954  __Pyx_RefNannySetupContext("gauss_seidel_NR_preare", 0);
4955 
4956  /* "csmoothers.pyx":175
4957  * M :
4958  * """
4959  * smootherWrappersgauss_seidel_NR_prepare(A._cSparseMatrix, w, tol, M) # <<<<<<<<<<<<<<
4960  *
4961  * cdef void smootherWrappersgauss_seidel_NR_prepare(superluWrappers.cSparseMatrix sm,
4962  */
4963  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
4964  __Pyx_GOTREF(__pyx_t_1);
4965  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 175, __pyx_L1_error)
4966  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
4967  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
4968  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 175, __pyx_L1_error)
4969  __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4);
4970  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4971  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4972  __pyx_t_4.memview = NULL;
4973  __pyx_t_4.data = NULL;
4974 
4975  /* "csmoothers.pyx":165
4976  * cnl_jacobi_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
4977  *
4978  * def gauss_seidel_NR_preare(A, w, tol, M): # <<<<<<<<<<<<<<
4979  * """
4980  *
4981  */
4982 
4983  /* function exit code */
4984  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4985  goto __pyx_L0;
4986  __pyx_L1_error:;
4987  __Pyx_XDECREF(__pyx_t_1);
4988  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
4989  __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_preare", __pyx_clineno, __pyx_lineno, __pyx_filename);
4990  __pyx_r = NULL;
4991  __pyx_L0:;
4992  __Pyx_XGIVEREF(__pyx_r);
4993  __Pyx_RefNannyFinishContext();
4994  return __pyx_r;
4995 }
4996 
4997 /* "csmoothers.pyx":177
4998  * smootherWrappersgauss_seidel_NR_prepare(A._cSparseMatrix, w, tol, M)
4999  *
5000  * cdef void smootherWrappersgauss_seidel_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5001  * double w,
5002  * double tol,
5003  */
5004 
5005 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_M) {
5006  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5007  __Pyx_RefNannyDeclarations
5008  PyObject *__pyx_t_1 = NULL;
5009  int __pyx_t_2;
5010  Py_ssize_t __pyx_t_3;
5011  int __pyx_lineno = 0;
5012  const char *__pyx_filename = NULL;
5013  int __pyx_clineno = 0;
5014  __Pyx_RefNannySetupContext("smootherWrappersgauss_seidel_NR_prepare", 0);
5015 
5016  /* "csmoothers.pyx":182
5017  * DDATA M):
5018  * cdef SuperMatrix AS
5019  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
5020  * AS.Dtype = superluWrappers._SLU_D
5021  * AS.Mtype = superluWrappers._SLU_GE
5022  */
5023  __pyx_v_AS.Stype = SLU_NR;
5024 
5025  /* "csmoothers.pyx":183
5026  * cdef SuperMatrix AS
5027  * AS.Stype = superluWrappers._SLU_NR
5028  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
5029  * AS.Mtype = superluWrappers._SLU_GE
5030  * AS.nrow = sm.nr
5031  */
5032  __pyx_v_AS.Dtype = SLU_D;
5033 
5034  /* "csmoothers.pyx":184
5035  * AS.Stype = superluWrappers._SLU_NR
5036  * AS.Dtype = superluWrappers._SLU_D
5037  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
5038  * AS.nrow = sm.nr
5039  * AS.ncol = sm.nc
5040  */
5041  __pyx_v_AS.Mtype = SLU_GE;
5042 
5043  /* "csmoothers.pyx":185
5044  * AS.Dtype = superluWrappers._SLU_D
5045  * AS.Mtype = superluWrappers._SLU_GE
5046  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
5047  * AS.ncol = sm.nc
5048  * AS.Store = &sm.A
5049  */
5050  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error)
5051  __Pyx_GOTREF(__pyx_t_1);
5052  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
5053  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5054  __pyx_v_AS.nrow = __pyx_t_2;
5055 
5056  /* "csmoothers.pyx":186
5057  * AS.Mtype = superluWrappers._SLU_GE
5058  * AS.nrow = sm.nr
5059  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
5060  * AS.Store = &sm.A
5061  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
5062  */
5063  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error)
5064  __Pyx_GOTREF(__pyx_t_1);
5065  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error)
5066  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5067  __pyx_v_AS.ncol = __pyx_t_2;
5068 
5069  /* "csmoothers.pyx":187
5070  * AS.nrow = sm.nr
5071  * AS.ncol = sm.nc
5072  * AS.Store = &sm.A # <<<<<<<<<<<<<<
5073  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
5074  *
5075  */
5076  __pyx_v_AS.Store = (&__pyx_v_sm->A);
5077 
5078  /* "csmoothers.pyx":188
5079  * AS.ncol = sm.nc
5080  * AS.Store = &sm.A
5081  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0]) # <<<<<<<<<<<<<<
5082  *
5083  * def gauss_seidel_NR_solve(A, M, R, node_order, dX):
5084  */
5085  __pyx_t_3 = 0;
5086  __pyx_t_2 = -1;
5087  if (__pyx_t_3 < 0) {
5088  __pyx_t_3 += __pyx_v_M.shape[0];
5089  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
5090  } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
5091  if (unlikely(__pyx_t_2 != -1)) {
5092  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5093  __PYX_ERR(0, 188, __pyx_L1_error)
5094  }
5095  gauss_seidel_NR_prepare((&__pyx_v_AS), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))));
5096 
5097  /* "csmoothers.pyx":177
5098  * smootherWrappersgauss_seidel_NR_prepare(A._cSparseMatrix, w, tol, M)
5099  *
5100  * cdef void smootherWrappersgauss_seidel_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5101  * double w,
5102  * double tol,
5103  */
5104 
5105  /* function exit code */
5106  goto __pyx_L0;
5107  __pyx_L1_error:;
5108  __Pyx_XDECREF(__pyx_t_1);
5109  __Pyx_WriteUnraisable("csmoothers.smootherWrappersgauss_seidel_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5110  __pyx_L0:;
5111  __Pyx_RefNannyFinishContext();
5112 }
5113 
5114 /* "csmoothers.pyx":190
5115  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
5116  *
5117  * def gauss_seidel_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
5118  * """
5119  *
5120  */
5121 
5122 /* Python wrapper */
5123 static PyObject *__pyx_pw_10csmoothers_9gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5124 static char __pyx_doc_10csmoothers_8gauss_seidel_NR_solve[] = "\n\n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n M : np.array double\n R : np.array double\n node_order : np.array int\n dX : np.array double\n ";
5125 static PyMethodDef __pyx_mdef_10csmoothers_9gauss_seidel_NR_solve = {"gauss_seidel_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_9gauss_seidel_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_8gauss_seidel_NR_solve};
5126 static PyObject *__pyx_pw_10csmoothers_9gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5127  PyObject *__pyx_v_A = 0;
5128  PyObject *__pyx_v_M = 0;
5129  PyObject *__pyx_v_R = 0;
5130  PyObject *__pyx_v_node_order = 0;
5131  PyObject *__pyx_v_dX = 0;
5132  int __pyx_lineno = 0;
5133  const char *__pyx_filename = NULL;
5134  int __pyx_clineno = 0;
5135  PyObject *__pyx_r = 0;
5136  __Pyx_RefNannyDeclarations
5137  __Pyx_RefNannySetupContext("gauss_seidel_NR_solve (wrapper)", 0);
5138  {
5139  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_M,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_dX,0};
5140  PyObject* values[5] = {0,0,0,0,0};
5141  if (unlikely(__pyx_kwds)) {
5142  Py_ssize_t kw_args;
5143  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5144  switch (pos_args) {
5145  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5146  CYTHON_FALLTHROUGH;
5147  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5148  CYTHON_FALLTHROUGH;
5149  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5150  CYTHON_FALLTHROUGH;
5151  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5152  CYTHON_FALLTHROUGH;
5153  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5154  CYTHON_FALLTHROUGH;
5155  case 0: break;
5156  default: goto __pyx_L5_argtuple_error;
5157  }
5158  kw_args = PyDict_Size(__pyx_kwds);
5159  switch (pos_args) {
5160  case 0:
5161  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5162  else goto __pyx_L5_argtuple_error;
5163  CYTHON_FALLTHROUGH;
5164  case 1:
5165  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
5166  else {
5167  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, 1); __PYX_ERR(0, 190, __pyx_L3_error)
5168  }
5169  CYTHON_FALLTHROUGH;
5170  case 2:
5171  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
5172  else {
5173  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, 2); __PYX_ERR(0, 190, __pyx_L3_error)
5174  }
5175  CYTHON_FALLTHROUGH;
5176  case 3:
5177  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
5178  else {
5179  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, 3); __PYX_ERR(0, 190, __pyx_L3_error)
5180  }
5181  CYTHON_FALLTHROUGH;
5182  case 4:
5183  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
5184  else {
5185  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, 4); __PYX_ERR(0, 190, __pyx_L3_error)
5186  }
5187  }
5188  if (unlikely(kw_args > 0)) {
5189  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gauss_seidel_NR_solve") < 0)) __PYX_ERR(0, 190, __pyx_L3_error)
5190  }
5191  } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
5192  goto __pyx_L5_argtuple_error;
5193  } else {
5194  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5195  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5196  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5197  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5198  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5199  }
5200  __pyx_v_A = values[0];
5201  __pyx_v_M = values[1];
5202  __pyx_v_R = values[2];
5203  __pyx_v_node_order = values[3];
5204  __pyx_v_dX = values[4];
5205  }
5206  goto __pyx_L4_argument_unpacking_done;
5207  __pyx_L5_argtuple_error:;
5208  __Pyx_RaiseArgtupleInvalid("gauss_seidel_NR_solve", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 190, __pyx_L3_error)
5209  __pyx_L3_error:;
5210  __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5211  __Pyx_RefNannyFinishContext();
5212  return NULL;
5213  __pyx_L4_argument_unpacking_done:;
5214  __pyx_r = __pyx_pf_10csmoothers_8gauss_seidel_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_M, __pyx_v_R, __pyx_v_node_order, __pyx_v_dX);
5215 
5216  /* function exit code */
5217  __Pyx_RefNannyFinishContext();
5218  return __pyx_r;
5219 }
5220 
5221 static PyObject *__pyx_pf_10csmoothers_8gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_M, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_dX) {
5222  PyObject *__pyx_r = NULL;
5223  __Pyx_RefNannyDeclarations
5224  PyObject *__pyx_t_1 = NULL;
5225  __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
5226  __pyx_t_10csmoothers_DDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
5227  __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
5228  __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
5229  int __pyx_lineno = 0;
5230  const char *__pyx_filename = NULL;
5231  int __pyx_clineno = 0;
5232  __Pyx_RefNannySetupContext("gauss_seidel_NR_solve", 0);
5233 
5234  /* "csmoothers.pyx":201
5235  * dX : np.array double
5236  * """
5237  * smootherWrappersgauss_seidel_NR_solve(A._cSparseMatrix, M, R, node_order, dX) # <<<<<<<<<<<<<<
5238  *
5239  * cdef void smootherWrappersgauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm,
5240  */
5241  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
5242  __Pyx_GOTREF(__pyx_t_1);
5243  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 201, __pyx_L1_error)
5244  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_M, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5245  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5246  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5247  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 201, __pyx_L1_error)
5248  __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5);
5249  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5250  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5251  __pyx_t_2.memview = NULL;
5252  __pyx_t_2.data = NULL;
5253  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5254  __pyx_t_3.memview = NULL;
5255  __pyx_t_3.data = NULL;
5256  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
5257  __pyx_t_4.memview = NULL;
5258  __pyx_t_4.data = NULL;
5259  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
5260  __pyx_t_5.memview = NULL;
5261  __pyx_t_5.data = NULL;
5262 
5263  /* "csmoothers.pyx":190
5264  * cgauss_seidel_NR_prepare(&AS, w, tol, &M[0])
5265  *
5266  * def gauss_seidel_NR_solve(A, M, R, node_order, dX): # <<<<<<<<<<<<<<
5267  * """
5268  *
5269  */
5270 
5271  /* function exit code */
5272  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5273  goto __pyx_L0;
5274  __pyx_L1_error:;
5275  __Pyx_XDECREF(__pyx_t_1);
5276  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5277  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5278  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
5279  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
5280  __Pyx_AddTraceback("csmoothers.gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5281  __pyx_r = NULL;
5282  __pyx_L0:;
5283  __Pyx_XGIVEREF(__pyx_r);
5284  __Pyx_RefNannyFinishContext();
5285  return __pyx_r;
5286 }
5287 
5288 /* "csmoothers.pyx":203
5289  * smootherWrappersgauss_seidel_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
5290  *
5291  * cdef void smootherWrappersgauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5292  * DDATA M,
5293  * DDATA R,
5294  */
5295 
5296 static void __pyx_f_10csmoothers_smootherWrappersgauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_M, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
5297  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5298  __Pyx_RefNannyDeclarations
5299  PyObject *__pyx_t_1 = NULL;
5300  int __pyx_t_2;
5301  Py_ssize_t __pyx_t_3;
5302  Py_ssize_t __pyx_t_4;
5303  Py_ssize_t __pyx_t_5;
5304  Py_ssize_t __pyx_t_6;
5305  int __pyx_lineno = 0;
5306  const char *__pyx_filename = NULL;
5307  int __pyx_clineno = 0;
5308  __Pyx_RefNannySetupContext("smootherWrappersgauss_seidel_NR_solve", 0);
5309 
5310  /* "csmoothers.pyx":209
5311  * DDATA dX):
5312  * cdef SuperMatrix AS
5313  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
5314  * AS.Dtype = superluWrappers._SLU_D
5315  * AS.Mtype = superluWrappers._SLU_GE
5316  */
5317  __pyx_v_AS.Stype = SLU_NR;
5318 
5319  /* "csmoothers.pyx":210
5320  * cdef SuperMatrix AS
5321  * AS.Stype = superluWrappers._SLU_NR
5322  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
5323  * AS.Mtype = superluWrappers._SLU_GE
5324  * AS.nrow = sm.nr
5325  */
5326  __pyx_v_AS.Dtype = SLU_D;
5327 
5328  /* "csmoothers.pyx":211
5329  * AS.Stype = superluWrappers._SLU_NR
5330  * AS.Dtype = superluWrappers._SLU_D
5331  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
5332  * AS.nrow = sm.nr
5333  * AS.ncol = sm.nc
5334  */
5335  __pyx_v_AS.Mtype = SLU_GE;
5336 
5337  /* "csmoothers.pyx":212
5338  * AS.Dtype = superluWrappers._SLU_D
5339  * AS.Mtype = superluWrappers._SLU_GE
5340  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
5341  * AS.ncol = sm.nc
5342  * AS.Store = &sm.A
5343  */
5344  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error)
5345  __Pyx_GOTREF(__pyx_t_1);
5346  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L1_error)
5347  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5348  __pyx_v_AS.nrow = __pyx_t_2;
5349 
5350  /* "csmoothers.pyx":213
5351  * AS.Mtype = superluWrappers._SLU_GE
5352  * AS.nrow = sm.nr
5353  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
5354  * AS.Store = &sm.A
5355  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
5356  */
5357  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
5358  __Pyx_GOTREF(__pyx_t_1);
5359  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 213, __pyx_L1_error)
5360  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5361  __pyx_v_AS.ncol = __pyx_t_2;
5362 
5363  /* "csmoothers.pyx":214
5364  * AS.nrow = sm.nr
5365  * AS.ncol = sm.nc
5366  * AS.Store = &sm.A # <<<<<<<<<<<<<<
5367  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
5368  *
5369  */
5370  __pyx_v_AS.Store = (&__pyx_v_sm->A);
5371 
5372  /* "csmoothers.pyx":215
5373  * AS.ncol = sm.nc
5374  * AS.Store = &sm.A
5375  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0]) # <<<<<<<<<<<<<<
5376  *
5377  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX):
5378  */
5379  __pyx_t_3 = 0;
5380  __pyx_t_2 = -1;
5381  if (__pyx_t_3 < 0) {
5382  __pyx_t_3 += __pyx_v_M.shape[0];
5383  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
5384  } else if (unlikely(__pyx_t_3 >= __pyx_v_M.shape[0])) __pyx_t_2 = 0;
5385  if (unlikely(__pyx_t_2 != -1)) {
5386  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5387  __PYX_ERR(0, 215, __pyx_L1_error)
5388  }
5389  __pyx_t_4 = 0;
5390  __pyx_t_2 = -1;
5391  if (__pyx_t_4 < 0) {
5392  __pyx_t_4 += __pyx_v_R.shape[0];
5393  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
5394  } else if (unlikely(__pyx_t_4 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
5395  if (unlikely(__pyx_t_2 != -1)) {
5396  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5397  __PYX_ERR(0, 215, __pyx_L1_error)
5398  }
5399  __pyx_t_5 = 0;
5400  __pyx_t_2 = -1;
5401  if (__pyx_t_5 < 0) {
5402  __pyx_t_5 += __pyx_v_node_order.shape[0];
5403  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
5404  } else if (unlikely(__pyx_t_5 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
5405  if (unlikely(__pyx_t_2 != -1)) {
5406  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5407  __PYX_ERR(0, 215, __pyx_L1_error)
5408  }
5409  __pyx_t_6 = 0;
5410  __pyx_t_2 = -1;
5411  if (__pyx_t_6 < 0) {
5412  __pyx_t_6 += __pyx_v_dX.shape[0];
5413  if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
5414  } else if (unlikely(__pyx_t_6 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
5415  if (unlikely(__pyx_t_2 != -1)) {
5416  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5417  __PYX_ERR(0, 215, __pyx_L1_error)
5418  }
5419  gauss_seidel_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_M.data + __pyx_t_3 * __pyx_v_M.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_4 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_5 * __pyx_v_node_order.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_6 * __pyx_v_dX.strides[0]) )))));
5420 
5421  /* "csmoothers.pyx":203
5422  * smootherWrappersgauss_seidel_NR_solve(A._cSparseMatrix, M, R, node_order, dX)
5423  *
5424  * cdef void smootherWrappersgauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5425  * DDATA M,
5426  * DDATA R,
5427  */
5428 
5429  /* function exit code */
5430  goto __pyx_L0;
5431  __pyx_L1_error:;
5432  __Pyx_XDECREF(__pyx_t_1);
5433  __Pyx_WriteUnraisable("csmoothers.smootherWrappersgauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
5434  __pyx_L0:;
5435  __Pyx_RefNannyFinishContext();
5436 }
5437 
5438 /* "csmoothers.pyx":217
5439  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
5440  *
5441  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
5442  * """
5443  *
5444  */
5445 
5446 /* Python wrapper */
5447 static PyObject *__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5448 static char __pyx_doc_10csmoothers_10nl_gauss_seidel_NR_solve[] = "\n \n Arguments\n ---------\n A : superluWrappers.SparseMatrix\n R : np.array double\n node_order : np.array int\n w : double\n tol : double\n dX : np.array double\n ";
5449 static PyMethodDef __pyx_mdef_10csmoothers_11nl_gauss_seidel_NR_solve = {"nl_gauss_seidel_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_10nl_gauss_seidel_NR_solve};
5450 static PyObject *__pyx_pw_10csmoothers_11nl_gauss_seidel_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5451  PyObject *__pyx_v_A = 0;
5452  PyObject *__pyx_v_R = 0;
5453  PyObject *__pyx_v_node_order = 0;
5454  PyObject *__pyx_v_w = 0;
5455  PyObject *__pyx_v_tol = 0;
5456  PyObject *__pyx_v_dX = 0;
5457  int __pyx_lineno = 0;
5458  const char *__pyx_filename = NULL;
5459  int __pyx_clineno = 0;
5460  PyObject *__pyx_r = 0;
5461  __Pyx_RefNannyDeclarations
5462  __Pyx_RefNannySetupContext("nl_gauss_seidel_NR_solve (wrapper)", 0);
5463  {
5464  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_R,&__pyx_n_s_node_order,&__pyx_n_s_w,&__pyx_n_s_tol,&__pyx_n_s_dX,0};
5465  PyObject* values[6] = {0,0,0,0,0,0};
5466  if (unlikely(__pyx_kwds)) {
5467  Py_ssize_t kw_args;
5468  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5469  switch (pos_args) {
5470  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5471  CYTHON_FALLTHROUGH;
5472  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5473  CYTHON_FALLTHROUGH;
5474  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5475  CYTHON_FALLTHROUGH;
5476  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5477  CYTHON_FALLTHROUGH;
5478  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5479  CYTHON_FALLTHROUGH;
5480  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5481  CYTHON_FALLTHROUGH;
5482  case 0: break;
5483  default: goto __pyx_L5_argtuple_error;
5484  }
5485  kw_args = PyDict_Size(__pyx_kwds);
5486  switch (pos_args) {
5487  case 0:
5488  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5489  else goto __pyx_L5_argtuple_error;
5490  CYTHON_FALLTHROUGH;
5491  case 1:
5492  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
5493  else {
5494  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 217, __pyx_L3_error)
5495  }
5496  CYTHON_FALLTHROUGH;
5497  case 2:
5498  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
5499  else {
5500  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 217, __pyx_L3_error)
5501  }
5502  CYTHON_FALLTHROUGH;
5503  case 3:
5504  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
5505  else {
5506  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 217, __pyx_L3_error)
5507  }
5508  CYTHON_FALLTHROUGH;
5509  case 4:
5510  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tol)) != 0)) kw_args--;
5511  else {
5512  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 217, __pyx_L3_error)
5513  }
5514  CYTHON_FALLTHROUGH;
5515  case 5:
5516  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
5517  else {
5518  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 217, __pyx_L3_error)
5519  }
5520  }
5521  if (unlikely(kw_args > 0)) {
5522  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nl_gauss_seidel_NR_solve") < 0)) __PYX_ERR(0, 217, __pyx_L3_error)
5523  }
5524  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
5525  goto __pyx_L5_argtuple_error;
5526  } else {
5527  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5528  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5529  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5530  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5531  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5532  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5533  }
5534  __pyx_v_A = values[0];
5535  __pyx_v_R = values[1];
5536  __pyx_v_node_order = values[2];
5537  __pyx_v_w = values[3];
5538  __pyx_v_tol = values[4];
5539  __pyx_v_dX = values[5];
5540  }
5541  goto __pyx_L4_argument_unpacking_done;
5542  __pyx_L5_argtuple_error:;
5543  __Pyx_RaiseArgtupleInvalid("nl_gauss_seidel_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 217, __pyx_L3_error)
5544  __pyx_L3_error:;
5545  __Pyx_AddTraceback("csmoothers.nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5546  __Pyx_RefNannyFinishContext();
5547  return NULL;
5548  __pyx_L4_argument_unpacking_done:;
5549  __pyx_r = __pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_R, __pyx_v_node_order, __pyx_v_w, __pyx_v_tol, __pyx_v_dX);
5550 
5551  /* function exit code */
5552  __Pyx_RefNannyFinishContext();
5553  return __pyx_r;
5554 }
5555 
5556 static PyObject *__pyx_pf_10csmoothers_10nl_gauss_seidel_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_R, PyObject *__pyx_v_node_order, PyObject *__pyx_v_w, PyObject *__pyx_v_tol, PyObject *__pyx_v_dX) {
5557  PyObject *__pyx_r = NULL;
5558  __Pyx_RefNannyDeclarations
5559  PyObject *__pyx_t_1 = NULL;
5560  __pyx_t_10csmoothers_DDATA __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
5561  __pyx_t_10csmoothers_IDATA __pyx_t_3 = { 0, 0, { 0 }, { 0 }, { 0 } };
5562  double __pyx_t_4;
5563  double __pyx_t_5;
5564  __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5565  PyObject *__pyx_t_7 = NULL;
5566  int __pyx_lineno = 0;
5567  const char *__pyx_filename = NULL;
5568  int __pyx_clineno = 0;
5569  __Pyx_RefNannySetupContext("nl_gauss_seidel_NR_solve", 0);
5570 
5571  /* "csmoothers.pyx":229
5572  * dX : np.array double
5573  * """
5574  * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
5575  * R,
5576  * node_order,
5577  */
5578  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
5579  __Pyx_GOTREF(__pyx_t_1);
5580  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 229, __pyx_L1_error)
5581 
5582  /* "csmoothers.pyx":230
5583  * """
5584  * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix,
5585  * R, # <<<<<<<<<<<<<<
5586  * node_order,
5587  * w,
5588  */
5589  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 230, __pyx_L1_error)
5590 
5591  /* "csmoothers.pyx":231
5592  * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix,
5593  * R,
5594  * node_order, # <<<<<<<<<<<<<<
5595  * w,
5596  * tol,
5597  */
5598  __pyx_t_3 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_3.memview)) __PYX_ERR(0, 231, __pyx_L1_error)
5599 
5600  /* "csmoothers.pyx":232
5601  * R,
5602  * node_order,
5603  * w, # <<<<<<<<<<<<<<
5604  * tol,
5605  * dX)
5606  */
5607  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 232, __pyx_L1_error)
5608 
5609  /* "csmoothers.pyx":233
5610  * node_order,
5611  * w,
5612  * tol, # <<<<<<<<<<<<<<
5613  * dX)
5614  *
5615  */
5616  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L1_error)
5617 
5618  /* "csmoothers.pyx":234
5619  * w,
5620  * tol,
5621  * dX) # <<<<<<<<<<<<<<
5622  *
5623  * cdef smootherWrappers_nl_gauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm,
5624  */
5625  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 234, __pyx_L1_error)
5626 
5627  /* "csmoothers.pyx":229
5628  * dX : np.array double
5629  * """
5630  * smootherWrappers_nl_gauss_seidel_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
5631  * R,
5632  * node_order,
5633  */
5634  __pyx_t_7 = __pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 229, __pyx_L1_error)
5635  __Pyx_GOTREF(__pyx_t_7);
5636  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5637  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5638  __pyx_t_2.memview = NULL;
5639  __pyx_t_2.data = NULL;
5640  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5641  __pyx_t_3.memview = NULL;
5642  __pyx_t_3.data = NULL;
5643  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5644  __pyx_t_6.memview = NULL;
5645  __pyx_t_6.data = NULL;
5646  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5647 
5648  /* "csmoothers.pyx":217
5649  * cgauss_seidel_NR_solve(&AS, &M[0], &R[0], &node_order[0], &dX[0])
5650  *
5651  * def nl_gauss_seidel_NR_solve(A, R, node_order, w, tol, dX): # <<<<<<<<<<<<<<
5652  * """
5653  *
5654  */
5655 
5656  /* function exit code */
5657  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5658  goto __pyx_L0;
5659  __pyx_L1_error:;
5660  __Pyx_XDECREF(__pyx_t_1);
5661  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5662  __PYX_XDEC_MEMVIEW(&__pyx_t_3, 1);
5663  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5664  __Pyx_XDECREF(__pyx_t_7);
5665  __Pyx_AddTraceback("csmoothers.nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5666  __pyx_r = NULL;
5667  __pyx_L0:;
5668  __Pyx_XGIVEREF(__pyx_r);
5669  __Pyx_RefNannyFinishContext();
5670  return __pyx_r;
5671 }
5672 
5673 /* "csmoothers.pyx":236
5674  * dX)
5675  *
5676  * cdef smootherWrappers_nl_gauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5677  * DDATA R,
5678  * IDATA node_order,
5679  */
5680 
5681 static PyObject *__pyx_f_10csmoothers_smootherWrappers_nl_gauss_seidel_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, double __pyx_v_w, double __pyx_v_tol, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
5682  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5683  PyObject *__pyx_r = NULL;
5684  __Pyx_RefNannyDeclarations
5685  PyObject *__pyx_t_1 = NULL;
5686  int __pyx_t_2;
5687  Py_ssize_t __pyx_t_3;
5688  Py_ssize_t __pyx_t_4;
5689  Py_ssize_t __pyx_t_5;
5690  int __pyx_lineno = 0;
5691  const char *__pyx_filename = NULL;
5692  int __pyx_clineno = 0;
5693  __Pyx_RefNannySetupContext("smootherWrappers_nl_gauss_seidel_NR_solve", 0);
5694 
5695  /* "csmoothers.pyx":243
5696  * DDATA dX):
5697  * cdef SuperMatrix AS
5698  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
5699  * AS.Dtype = superluWrappers._SLU_D
5700  * AS.Mtype = superluWrappers._SLU_GE
5701  */
5702  __pyx_v_AS.Stype = SLU_NR;
5703 
5704  /* "csmoothers.pyx":244
5705  * cdef SuperMatrix AS
5706  * AS.Stype = superluWrappers._SLU_NR
5707  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
5708  * AS.Mtype = superluWrappers._SLU_GE
5709  * AS.nrow = sm.nr
5710  */
5711  __pyx_v_AS.Dtype = SLU_D;
5712 
5713  /* "csmoothers.pyx":245
5714  * AS.Stype = superluWrappers._SLU_NR
5715  * AS.Dtype = superluWrappers._SLU_D
5716  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
5717  * AS.nrow = sm.nr
5718  * AS.ncol = sm.nc
5719  */
5720  __pyx_v_AS.Mtype = SLU_GE;
5721 
5722  /* "csmoothers.pyx":246
5723  * AS.Dtype = superluWrappers._SLU_D
5724  * AS.Mtype = superluWrappers._SLU_GE
5725  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
5726  * AS.ncol = sm.nc
5727  * AS.Store = &sm.A
5728  */
5729  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
5730  __Pyx_GOTREF(__pyx_t_1);
5731  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 246, __pyx_L1_error)
5732  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5733  __pyx_v_AS.nrow = __pyx_t_2;
5734 
5735  /* "csmoothers.pyx":247
5736  * AS.Mtype = superluWrappers._SLU_GE
5737  * AS.nrow = sm.nr
5738  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
5739  * AS.Store = &sm.A
5740  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
5741  */
5742  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
5743  __Pyx_GOTREF(__pyx_t_1);
5744  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 247, __pyx_L1_error)
5745  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5746  __pyx_v_AS.ncol = __pyx_t_2;
5747 
5748  /* "csmoothers.pyx":248
5749  * AS.nrow = sm.nr
5750  * AS.ncol = sm.nc
5751  * AS.Store = &sm.A # <<<<<<<<<<<<<<
5752  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
5753  *
5754  */
5755  __pyx_v_AS.Store = (&__pyx_v_sm->A);
5756 
5757  /* "csmoothers.pyx":249
5758  * AS.ncol = sm.nc
5759  * AS.Store = &sm.A
5760  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0]) # <<<<<<<<<<<<<<
5761  *
5762  * def asm_NR_prepare(A, asmFactor):
5763  */
5764  __pyx_t_3 = 0;
5765  __pyx_t_2 = -1;
5766  if (__pyx_t_3 < 0) {
5767  __pyx_t_3 += __pyx_v_R.shape[0];
5768  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
5769  } else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
5770  if (unlikely(__pyx_t_2 != -1)) {
5771  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5772  __PYX_ERR(0, 249, __pyx_L1_error)
5773  }
5774  __pyx_t_4 = 0;
5775  __pyx_t_2 = -1;
5776  if (__pyx_t_4 < 0) {
5777  __pyx_t_4 += __pyx_v_node_order.shape[0];
5778  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
5779  } else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
5780  if (unlikely(__pyx_t_2 != -1)) {
5781  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5782  __PYX_ERR(0, 249, __pyx_L1_error)
5783  }
5784  __pyx_t_5 = 0;
5785  __pyx_t_2 = -1;
5786  if (__pyx_t_5 < 0) {
5787  __pyx_t_5 += __pyx_v_dX.shape[0];
5788  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
5789  } else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
5790  if (unlikely(__pyx_t_2 != -1)) {
5791  __Pyx_RaiseBufferIndexError(__pyx_t_2);
5792  __PYX_ERR(0, 249, __pyx_L1_error)
5793  }
5794  nl_gauss_seidel_NR_solve((&__pyx_v_AS), (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_w, __pyx_v_tol, (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))));
5795 
5796  /* "csmoothers.pyx":236
5797  * dX)
5798  *
5799  * cdef smootherWrappers_nl_gauss_seidel_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5800  * DDATA R,
5801  * IDATA node_order,
5802  */
5803 
5804  /* function exit code */
5805  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5806  goto __pyx_L0;
5807  __pyx_L1_error:;
5808  __Pyx_XDECREF(__pyx_t_1);
5809  __Pyx_AddTraceback("csmoothers.smootherWrappers_nl_gauss_seidel_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
5810  __pyx_r = 0;
5811  __pyx_L0:;
5812  __Pyx_XGIVEREF(__pyx_r);
5813  __Pyx_RefNannyFinishContext();
5814  return __pyx_r;
5815 }
5816 
5817 /* "csmoothers.pyx":251
5818  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
5819  *
5820  * def asm_NR_prepare(A, asmFactor): # <<<<<<<<<<<<<<
5821  * """
5822  *
5823  */
5824 
5825 /* Python wrapper */
5826 static PyObject *__pyx_pw_10csmoothers_13asm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5827 static char __pyx_doc_10csmoothers_12asm_NR_prepare[] = "\n\n Arguments\n ---------\n A :\n asmFactor :\n ";
5828 static PyMethodDef __pyx_mdef_10csmoothers_13asm_NR_prepare = {"asm_NR_prepare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_13asm_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_12asm_NR_prepare};
5829 static PyObject *__pyx_pw_10csmoothers_13asm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5830  PyObject *__pyx_v_A = 0;
5831  PyObject *__pyx_v_asmFactor = 0;
5832  int __pyx_lineno = 0;
5833  const char *__pyx_filename = NULL;
5834  int __pyx_clineno = 0;
5835  PyObject *__pyx_r = 0;
5836  __Pyx_RefNannyDeclarations
5837  __Pyx_RefNannySetupContext("asm_NR_prepare (wrapper)", 0);
5838  {
5839  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_asmFactor,0};
5840  PyObject* values[2] = {0,0};
5841  if (unlikely(__pyx_kwds)) {
5842  Py_ssize_t kw_args;
5843  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5844  switch (pos_args) {
5845  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5846  CYTHON_FALLTHROUGH;
5847  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5848  CYTHON_FALLTHROUGH;
5849  case 0: break;
5850  default: goto __pyx_L5_argtuple_error;
5851  }
5852  kw_args = PyDict_Size(__pyx_kwds);
5853  switch (pos_args) {
5854  case 0:
5855  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5856  else goto __pyx_L5_argtuple_error;
5857  CYTHON_FALLTHROUGH;
5858  case 1:
5859  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asmFactor)) != 0)) kw_args--;
5860  else {
5861  __Pyx_RaiseArgtupleInvalid("asm_NR_prepare", 1, 2, 2, 1); __PYX_ERR(0, 251, __pyx_L3_error)
5862  }
5863  }
5864  if (unlikely(kw_args > 0)) {
5865  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "asm_NR_prepare") < 0)) __PYX_ERR(0, 251, __pyx_L3_error)
5866  }
5867  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5868  goto __pyx_L5_argtuple_error;
5869  } else {
5870  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5871  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5872  }
5873  __pyx_v_A = values[0];
5874  __pyx_v_asmFactor = values[1];
5875  }
5876  goto __pyx_L4_argument_unpacking_done;
5877  __pyx_L5_argtuple_error:;
5878  __Pyx_RaiseArgtupleInvalid("asm_NR_prepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 251, __pyx_L3_error)
5879  __pyx_L3_error:;
5880  __Pyx_AddTraceback("csmoothers.asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5881  __Pyx_RefNannyFinishContext();
5882  return NULL;
5883  __pyx_L4_argument_unpacking_done:;
5884  __pyx_r = __pyx_pf_10csmoothers_12asm_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_asmFactor);
5885 
5886  /* function exit code */
5887  __Pyx_RefNannyFinishContext();
5888  return __pyx_r;
5889 }
5890 
5891 static PyObject *__pyx_pf_10csmoothers_12asm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_asmFactor) {
5892  PyObject *__pyx_r = NULL;
5893  __Pyx_RefNannyDeclarations
5894  PyObject *__pyx_t_1 = NULL;
5895  PyObject *__pyx_t_2 = NULL;
5896  int __pyx_lineno = 0;
5897  const char *__pyx_filename = NULL;
5898  int __pyx_clineno = 0;
5899  __Pyx_RefNannySetupContext("asm_NR_prepare", 0);
5900 
5901  /* "csmoothers.pyx":259
5902  * asmFactor :
5903  * """
5904  * smootherWrappers_asm_NR_prepare(A._cSparseMatrix, # <<<<<<<<<<<<<<
5905  * asmFactor._cASMFactor)
5906  *
5907  */
5908  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
5909  __Pyx_GOTREF(__pyx_t_1);
5910  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 259, __pyx_L1_error)
5911 
5912  /* "csmoothers.pyx":260
5913  * """
5914  * smootherWrappers_asm_NR_prepare(A._cSparseMatrix,
5915  * asmFactor._cASMFactor) # <<<<<<<<<<<<<<
5916  *
5917  * cdef void smootherWrappers_asm_NR_prepare(superluWrappers.cSparseMatrix sm,
5918  */
5919  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_asmFactor, __pyx_n_s_cASMFactor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
5920  __Pyx_GOTREF(__pyx_t_2);
5921  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10csmoothers_cASMFactor))))) __PYX_ERR(0, 260, __pyx_L1_error)
5922 
5923  /* "csmoothers.pyx":259
5924  * asmFactor :
5925  * """
5926  * smootherWrappers_asm_NR_prepare(A._cSparseMatrix, # <<<<<<<<<<<<<<
5927  * asmFactor._cASMFactor)
5928  *
5929  */
5930  __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), ((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_t_2));
5931  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5932  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5933 
5934  /* "csmoothers.pyx":251
5935  * cnl_gauss_seidel_NR_solve(&AS, &R[0], &node_order[0], w, tol, &dX[0])
5936  *
5937  * def asm_NR_prepare(A, asmFactor): # <<<<<<<<<<<<<<
5938  * """
5939  *
5940  */
5941 
5942  /* function exit code */
5943  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5944  goto __pyx_L0;
5945  __pyx_L1_error:;
5946  __Pyx_XDECREF(__pyx_t_1);
5947  __Pyx_XDECREF(__pyx_t_2);
5948  __Pyx_AddTraceback("csmoothers.asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
5949  __pyx_r = NULL;
5950  __pyx_L0:;
5951  __Pyx_XGIVEREF(__pyx_r);
5952  __Pyx_RefNannyFinishContext();
5953  return __pyx_r;
5954 }
5955 
5956 /* "csmoothers.pyx":262
5957  * asmFactor._cASMFactor)
5958  *
5959  * cdef void smootherWrappers_asm_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
5960  * cASMFactor asmFactor):
5961  * cdef SuperMatrix AS
5962  */
5963 
5964 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_prepare(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_asmFactor) {
5965  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
5966  __Pyx_RefNannyDeclarations
5967  PyObject *__pyx_t_1 = NULL;
5968  int __pyx_t_2;
5969  int __pyx_lineno = 0;
5970  const char *__pyx_filename = NULL;
5971  int __pyx_clineno = 0;
5972  __Pyx_RefNannySetupContext("smootherWrappers_asm_NR_prepare", 0);
5973 
5974  /* "csmoothers.pyx":265
5975  * cASMFactor asmFactor):
5976  * cdef SuperMatrix AS
5977  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
5978  * AS.Dtype = superluWrappers._SLU_D
5979  * AS.Mtype = superluWrappers._SLU_GE
5980  */
5981  __pyx_v_AS.Stype = SLU_NR;
5982 
5983  /* "csmoothers.pyx":266
5984  * cdef SuperMatrix AS
5985  * AS.Stype = superluWrappers._SLU_NR
5986  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
5987  * AS.Mtype = superluWrappers._SLU_GE
5988  * AS.nrow = sm.nr
5989  */
5990  __pyx_v_AS.Dtype = SLU_D;
5991 
5992  /* "csmoothers.pyx":267
5993  * AS.Stype = superluWrappers._SLU_NR
5994  * AS.Dtype = superluWrappers._SLU_D
5995  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
5996  * AS.nrow = sm.nr
5997  * AS.ncol = sm.nc
5998  */
5999  __pyx_v_AS.Mtype = SLU_GE;
6000 
6001  /* "csmoothers.pyx":268
6002  * AS.Dtype = superluWrappers._SLU_D
6003  * AS.Mtype = superluWrappers._SLU_GE
6004  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
6005  * AS.ncol = sm.nc
6006  * AS.Store = &sm.A
6007  */
6008  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
6009  __Pyx_GOTREF(__pyx_t_1);
6010  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L1_error)
6011  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6012  __pyx_v_AS.nrow = __pyx_t_2;
6013 
6014  /* "csmoothers.pyx":269
6015  * AS.Mtype = superluWrappers._SLU_GE
6016  * AS.nrow = sm.nr
6017  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
6018  * AS.Store = &sm.A
6019  * casm_NR_prepare(&AS,
6020  */
6021  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
6022  __Pyx_GOTREF(__pyx_t_1);
6023  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
6024  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6025  __pyx_v_AS.ncol = __pyx_t_2;
6026 
6027  /* "csmoothers.pyx":270
6028  * AS.nrow = sm.nr
6029  * AS.ncol = sm.nc
6030  * AS.Store = &sm.A # <<<<<<<<<<<<<<
6031  * casm_NR_prepare(&AS,
6032  * asmFactor.subdomain_dim,
6033  */
6034  __pyx_v_AS.Store = (&__pyx_v_sm->A);
6035 
6036  /* "csmoothers.pyx":271
6037  * AS.ncol = sm.nc
6038  * AS.Store = &sm.A
6039  * casm_NR_prepare(&AS, # <<<<<<<<<<<<<<
6040  * asmFactor.subdomain_dim,
6041  * asmFactor.l2g_L,
6042  */
6043  asm_NR_prepare((&__pyx_v_AS), __pyx_v_asmFactor->subdomain_dim, __pyx_v_asmFactor->l2g_L, __pyx_v_asmFactor->subdomain_L, __pyx_v_asmFactor->subdomain_pivots);
6044 
6045  /* "csmoothers.pyx":262
6046  * asmFactor._cASMFactor)
6047  *
6048  * cdef void smootherWrappers_asm_NR_prepare(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6049  * cASMFactor asmFactor):
6050  * cdef SuperMatrix AS
6051  */
6052 
6053  /* function exit code */
6054  goto __pyx_L0;
6055  __pyx_L1_error:;
6056  __Pyx_XDECREF(__pyx_t_1);
6057  __Pyx_WriteUnraisable("csmoothers.smootherWrappers_asm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6058  __pyx_L0:;
6059  __Pyx_RefNannyFinishContext();
6060 }
6061 
6062 /* "csmoothers.pyx":277
6063  * asmFactor.subdomain_pivots)
6064  *
6065  * def asm_NR_solve(A, w, asmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
6066  * """
6067  *
6068  */
6069 
6070 /* Python wrapper */
6071 static PyObject *__pyx_pw_10csmoothers_15asm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6072 static char __pyx_doc_10csmoothers_14asm_NR_solve[] = "\n \n Arguments\n ---------\n A : superluWrappers.sparseMatrix\n w : double\n asmFactor : csmoothers.asmFactor\n node_order : np.array int\n R : np.array double\n dX : np.array double\n ";
6073 static PyMethodDef __pyx_mdef_10csmoothers_15asm_NR_solve = {"asm_NR_solve", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_15asm_NR_solve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_14asm_NR_solve};
6074 static PyObject *__pyx_pw_10csmoothers_15asm_NR_solve(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6075  PyObject *__pyx_v_A = 0;
6076  PyObject *__pyx_v_w = 0;
6077  PyObject *__pyx_v_asmFactor = 0;
6078  PyObject *__pyx_v_node_order = 0;
6079  PyObject *__pyx_v_R = 0;
6080  PyObject *__pyx_v_dX = 0;
6081  int __pyx_lineno = 0;
6082  const char *__pyx_filename = NULL;
6083  int __pyx_clineno = 0;
6084  PyObject *__pyx_r = 0;
6085  __Pyx_RefNannyDeclarations
6086  __Pyx_RefNannySetupContext("asm_NR_solve (wrapper)", 0);
6087  {
6088  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_w,&__pyx_n_s_asmFactor,&__pyx_n_s_node_order,&__pyx_n_s_R,&__pyx_n_s_dX,0};
6089  PyObject* values[6] = {0,0,0,0,0,0};
6090  if (unlikely(__pyx_kwds)) {
6091  Py_ssize_t kw_args;
6092  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6093  switch (pos_args) {
6094  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6095  CYTHON_FALLTHROUGH;
6096  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6097  CYTHON_FALLTHROUGH;
6098  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6099  CYTHON_FALLTHROUGH;
6100  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6101  CYTHON_FALLTHROUGH;
6102  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6103  CYTHON_FALLTHROUGH;
6104  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6105  CYTHON_FALLTHROUGH;
6106  case 0: break;
6107  default: goto __pyx_L5_argtuple_error;
6108  }
6109  kw_args = PyDict_Size(__pyx_kwds);
6110  switch (pos_args) {
6111  case 0:
6112  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6113  else goto __pyx_L5_argtuple_error;
6114  CYTHON_FALLTHROUGH;
6115  case 1:
6116  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
6117  else {
6118  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 1); __PYX_ERR(0, 277, __pyx_L3_error)
6119  }
6120  CYTHON_FALLTHROUGH;
6121  case 2:
6122  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_asmFactor)) != 0)) kw_args--;
6123  else {
6124  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 2); __PYX_ERR(0, 277, __pyx_L3_error)
6125  }
6126  CYTHON_FALLTHROUGH;
6127  case 3:
6128  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_order)) != 0)) kw_args--;
6129  else {
6130  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 3); __PYX_ERR(0, 277, __pyx_L3_error)
6131  }
6132  CYTHON_FALLTHROUGH;
6133  case 4:
6134  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
6135  else {
6136  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 4); __PYX_ERR(0, 277, __pyx_L3_error)
6137  }
6138  CYTHON_FALLTHROUGH;
6139  case 5:
6140  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dX)) != 0)) kw_args--;
6141  else {
6142  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, 5); __PYX_ERR(0, 277, __pyx_L3_error)
6143  }
6144  }
6145  if (unlikely(kw_args > 0)) {
6146  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "asm_NR_solve") < 0)) __PYX_ERR(0, 277, __pyx_L3_error)
6147  }
6148  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
6149  goto __pyx_L5_argtuple_error;
6150  } else {
6151  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6152  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6153  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6154  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6155  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6156  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6157  }
6158  __pyx_v_A = values[0];
6159  __pyx_v_w = values[1];
6160  __pyx_v_asmFactor = values[2];
6161  __pyx_v_node_order = values[3];
6162  __pyx_v_R = values[4];
6163  __pyx_v_dX = values[5];
6164  }
6165  goto __pyx_L4_argument_unpacking_done;
6166  __pyx_L5_argtuple_error:;
6167  __Pyx_RaiseArgtupleInvalid("asm_NR_solve", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 277, __pyx_L3_error)
6168  __pyx_L3_error:;
6169  __Pyx_AddTraceback("csmoothers.asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6170  __Pyx_RefNannyFinishContext();
6171  return NULL;
6172  __pyx_L4_argument_unpacking_done:;
6173  __pyx_r = __pyx_pf_10csmoothers_14asm_NR_solve(__pyx_self, __pyx_v_A, __pyx_v_w, __pyx_v_asmFactor, __pyx_v_node_order, __pyx_v_R, __pyx_v_dX);
6174 
6175  /* function exit code */
6176  __Pyx_RefNannyFinishContext();
6177  return __pyx_r;
6178 }
6179 
6180 static PyObject *__pyx_pf_10csmoothers_14asm_NR_solve(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_w, PyObject *__pyx_v_asmFactor, PyObject *__pyx_v_node_order, PyObject *__pyx_v_R, PyObject *__pyx_v_dX) {
6181  PyObject *__pyx_r = NULL;
6182  __Pyx_RefNannyDeclarations
6183  PyObject *__pyx_t_1 = NULL;
6184  double __pyx_t_2;
6185  PyObject *__pyx_t_3 = NULL;
6186  __pyx_t_10csmoothers_IDATA __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
6187  __pyx_t_10csmoothers_DDATA __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
6188  __pyx_t_10csmoothers_DDATA __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6189  int __pyx_lineno = 0;
6190  const char *__pyx_filename = NULL;
6191  int __pyx_clineno = 0;
6192  __Pyx_RefNannySetupContext("asm_NR_solve", 0);
6193 
6194  /* "csmoothers.pyx":289
6195  * dX : np.array double
6196  * """
6197  * smootherWrappers_asm_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
6198  * w,
6199  * asmFactor._cASMFactor,
6200  */
6201  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
6202  __Pyx_GOTREF(__pyx_t_1);
6203  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 289, __pyx_L1_error)
6204 
6205  /* "csmoothers.pyx":290
6206  * """
6207  * smootherWrappers_asm_NR_solve(A._cSparseMatrix,
6208  * w, # <<<<<<<<<<<<<<
6209  * asmFactor._cASMFactor,
6210  * node_order,
6211  */
6212  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_w); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L1_error)
6213 
6214  /* "csmoothers.pyx":291
6215  * smootherWrappers_asm_NR_solve(A._cSparseMatrix,
6216  * w,
6217  * asmFactor._cASMFactor, # <<<<<<<<<<<<<<
6218  * node_order,
6219  * R,
6220  */
6221  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_asmFactor, __pyx_n_s_cASMFactor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error)
6222  __Pyx_GOTREF(__pyx_t_3);
6223  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10csmoothers_cASMFactor))))) __PYX_ERR(0, 291, __pyx_L1_error)
6224 
6225  /* "csmoothers.pyx":292
6226  * w,
6227  * asmFactor._cASMFactor,
6228  * node_order, # <<<<<<<<<<<<<<
6229  * R,
6230  * dX)
6231  */
6232  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_node_order, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(0, 292, __pyx_L1_error)
6233 
6234  /* "csmoothers.pyx":293
6235  * asmFactor._cASMFactor,
6236  * node_order,
6237  * R, # <<<<<<<<<<<<<<
6238  * dX)
6239  *
6240  */
6241  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_R, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 293, __pyx_L1_error)
6242 
6243  /* "csmoothers.pyx":294
6244  * node_order,
6245  * R,
6246  * dX) # <<<<<<<<<<<<<<
6247  *
6248  * cdef void smootherWrappers_asm_NR_solve(superluWrappers.cSparseMatrix sm,
6249  */
6250  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_dX, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 294, __pyx_L1_error)
6251 
6252  /* "csmoothers.pyx":289
6253  * dX : np.array double
6254  * """
6255  * smootherWrappers_asm_NR_solve(A._cSparseMatrix, # <<<<<<<<<<<<<<
6256  * w,
6257  * asmFactor._cASMFactor,
6258  */
6259  __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(((struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *)__pyx_t_1), __pyx_t_2, ((struct __pyx_obj_10csmoothers_cASMFactor *)__pyx_t_3), __pyx_t_4, __pyx_t_5, __pyx_t_6);
6260  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6261  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6262  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6263  __pyx_t_4.memview = NULL;
6264  __pyx_t_4.data = NULL;
6265  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6266  __pyx_t_5.memview = NULL;
6267  __pyx_t_5.data = NULL;
6268  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6269  __pyx_t_6.memview = NULL;
6270  __pyx_t_6.data = NULL;
6271 
6272  /* "csmoothers.pyx":277
6273  * asmFactor.subdomain_pivots)
6274  *
6275  * def asm_NR_solve(A, w, asmFactor, node_order, R, dX): # <<<<<<<<<<<<<<
6276  * """
6277  *
6278  */
6279 
6280  /* function exit code */
6281  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6282  goto __pyx_L0;
6283  __pyx_L1_error:;
6284  __Pyx_XDECREF(__pyx_t_1);
6285  __Pyx_XDECREF(__pyx_t_3);
6286  __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1);
6287  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
6288  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6289  __Pyx_AddTraceback("csmoothers.asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename);
6290  __pyx_r = NULL;
6291  __pyx_L0:;
6292  __Pyx_XGIVEREF(__pyx_r);
6293  __Pyx_RefNannyFinishContext();
6294  return __pyx_r;
6295 }
6296 
6297 /* "csmoothers.pyx":296
6298  * dX)
6299  *
6300  * cdef void smootherWrappers_asm_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6301  * double w,
6302  * cASMFactor asmFactor,
6303  */
6304 
6305 static void __pyx_f_10csmoothers_smootherWrappers_asm_NR_solve(struct __pyx_obj_7proteus_15superluWrappers_cSparseMatrix *__pyx_v_sm, double __pyx_v_w, struct __pyx_obj_10csmoothers_cASMFactor *__pyx_v_asmFactor, __pyx_t_10csmoothers_IDATA __pyx_v_node_order, __pyx_t_10csmoothers_DDATA __pyx_v_R, __pyx_t_10csmoothers_DDATA __pyx_v_dX) {
6306  __pyx_t_10csmoothers_SuperMatrix __pyx_v_AS;
6307  __Pyx_RefNannyDeclarations
6308  PyObject *__pyx_t_1 = NULL;
6309  int __pyx_t_2;
6310  Py_ssize_t __pyx_t_3;
6311  Py_ssize_t __pyx_t_4;
6312  Py_ssize_t __pyx_t_5;
6313  int __pyx_lineno = 0;
6314  const char *__pyx_filename = NULL;
6315  int __pyx_clineno = 0;
6316  __Pyx_RefNannySetupContext("smootherWrappers_asm_NR_solve", 0);
6317 
6318  /* "csmoothers.pyx":303
6319  * DDATA dX):
6320  * cdef SuperMatrix AS
6321  * AS.Stype = superluWrappers._SLU_NR # <<<<<<<<<<<<<<
6322  * AS.Dtype = superluWrappers._SLU_D
6323  * AS.Mtype = superluWrappers._SLU_GE
6324  */
6325  __pyx_v_AS.Stype = SLU_NR;
6326 
6327  /* "csmoothers.pyx":304
6328  * cdef SuperMatrix AS
6329  * AS.Stype = superluWrappers._SLU_NR
6330  * AS.Dtype = superluWrappers._SLU_D # <<<<<<<<<<<<<<
6331  * AS.Mtype = superluWrappers._SLU_GE
6332  * AS.nrow = sm.nr
6333  */
6334  __pyx_v_AS.Dtype = SLU_D;
6335 
6336  /* "csmoothers.pyx":305
6337  * AS.Stype = superluWrappers._SLU_NR
6338  * AS.Dtype = superluWrappers._SLU_D
6339  * AS.Mtype = superluWrappers._SLU_GE # <<<<<<<<<<<<<<
6340  * AS.nrow = sm.nr
6341  * AS.ncol = sm.nc
6342  */
6343  __pyx_v_AS.Mtype = SLU_GE;
6344 
6345  /* "csmoothers.pyx":306
6346  * AS.Dtype = superluWrappers._SLU_D
6347  * AS.Mtype = superluWrappers._SLU_GE
6348  * AS.nrow = sm.nr # <<<<<<<<<<<<<<
6349  * AS.ncol = sm.nc
6350  * AS.Store = &sm.A
6351  */
6352  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error)
6353  __Pyx_GOTREF(__pyx_t_1);
6354  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 306, __pyx_L1_error)
6355  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6356  __pyx_v_AS.nrow = __pyx_t_2;
6357 
6358  /* "csmoothers.pyx":307
6359  * AS.Mtype = superluWrappers._SLU_GE
6360  * AS.nrow = sm.nr
6361  * AS.ncol = sm.nc # <<<<<<<<<<<<<<
6362  * AS.Store = &sm.A
6363  * casm_NR_solve(&AS,
6364  */
6365  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_sm), __pyx_n_s_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
6366  __Pyx_GOTREF(__pyx_t_1);
6367  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L1_error)
6368  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6369  __pyx_v_AS.ncol = __pyx_t_2;
6370 
6371  /* "csmoothers.pyx":308
6372  * AS.nrow = sm.nr
6373  * AS.ncol = sm.nc
6374  * AS.Store = &sm.A # <<<<<<<<<<<<<<
6375  * casm_NR_solve(&AS,
6376  * w,
6377  */
6378  __pyx_v_AS.Store = (&__pyx_v_sm->A);
6379 
6380  /* "csmoothers.pyx":314
6381  * asmFactor.subdomain_dim,
6382  * asmFactor.l2g_L,
6383  * &R[0], # <<<<<<<<<<<<<<
6384  * asmFactor.subdomain_R,
6385  * &node_order[0],
6386  */
6387  __pyx_t_3 = 0;
6388  __pyx_t_2 = -1;
6389  if (__pyx_t_3 < 0) {
6390  __pyx_t_3 += __pyx_v_R.shape[0];
6391  if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
6392  } else if (unlikely(__pyx_t_3 >= __pyx_v_R.shape[0])) __pyx_t_2 = 0;
6393  if (unlikely(__pyx_t_2 != -1)) {
6394  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6395  __PYX_ERR(0, 314, __pyx_L1_error)
6396  }
6397 
6398  /* "csmoothers.pyx":316
6399  * &R[0],
6400  * asmFactor.subdomain_R,
6401  * &node_order[0], # <<<<<<<<<<<<<<
6402  * asmFactor.subdomain_dX,
6403  * &dX[0],
6404  */
6405  __pyx_t_4 = 0;
6406  __pyx_t_2 = -1;
6407  if (__pyx_t_4 < 0) {
6408  __pyx_t_4 += __pyx_v_node_order.shape[0];
6409  if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
6410  } else if (unlikely(__pyx_t_4 >= __pyx_v_node_order.shape[0])) __pyx_t_2 = 0;
6411  if (unlikely(__pyx_t_2 != -1)) {
6412  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6413  __PYX_ERR(0, 316, __pyx_L1_error)
6414  }
6415 
6416  /* "csmoothers.pyx":318
6417  * &node_order[0],
6418  * asmFactor.subdomain_dX,
6419  * &dX[0], # <<<<<<<<<<<<<<
6420  * asmFactor.subdomain_pivots)
6421  *
6422  */
6423  __pyx_t_5 = 0;
6424  __pyx_t_2 = -1;
6425  if (__pyx_t_5 < 0) {
6426  __pyx_t_5 += __pyx_v_dX.shape[0];
6427  if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
6428  } else if (unlikely(__pyx_t_5 >= __pyx_v_dX.shape[0])) __pyx_t_2 = 0;
6429  if (unlikely(__pyx_t_2 != -1)) {
6430  __Pyx_RaiseBufferIndexError(__pyx_t_2);
6431  __PYX_ERR(0, 318, __pyx_L1_error)
6432  }
6433 
6434  /* "csmoothers.pyx":309
6435  * AS.ncol = sm.nc
6436  * AS.Store = &sm.A
6437  * casm_NR_solve(&AS, # <<<<<<<<<<<<<<
6438  * w,
6439  * asmFactor.subdomain_L,
6440  */
6441  asm_NR_solve((&__pyx_v_AS), __pyx_v_w, __pyx_v_asmFactor->subdomain_L, __pyx_v_asmFactor->subdomain_dim, __pyx_v_asmFactor->l2g_L, (&(*((double *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_3 * __pyx_v_R.strides[0]) )))), __pyx_v_asmFactor->subdomain_R, (&(*((int *) ( /* dim=0 */ (__pyx_v_node_order.data + __pyx_t_4 * __pyx_v_node_order.strides[0]) )))), __pyx_v_asmFactor->subdomain_dX, (&(*((double *) ( /* dim=0 */ (__pyx_v_dX.data + __pyx_t_5 * __pyx_v_dX.strides[0]) )))), __pyx_v_asmFactor->subdomain_pivots);
6442 
6443  /* "csmoothers.pyx":296
6444  * dX)
6445  *
6446  * cdef void smootherWrappers_asm_NR_solve(superluWrappers.cSparseMatrix sm, # <<<<<<<<<<<<<<
6447  * double w,
6448  * cASMFactor asmFactor,
6449  */
6450 
6451  /* function exit code */
6452  goto __pyx_L0;
6453  __pyx_L1_error:;
6454  __Pyx_XDECREF(__pyx_t_1);
6455  __Pyx_WriteUnraisable("csmoothers.smootherWrappers_asm_NR_solve", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
6456  __pyx_L0:;
6457  __Pyx_RefNannyFinishContext();
6458 }
6459 
6460 /* "csmoothers.pyx":321
6461  * asmFactor.subdomain_pivots)
6462  *
6463  * def basm_NR_prepare(A, basmFactor): # <<<<<<<<<<<<<<
6464  * """
6465  *
6466  */
6467 
6468 /* Python wrapper */
6469 static PyObject *__pyx_pw_10csmoothers_17basm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6470 static char __pyx_doc_10csmoothers_16basm_NR_prepare[] = "\n\n Arguments\n ---------\n A :\n basmFactor :\n ";
6471 static PyMethodDef __pyx_mdef_10csmoothers_17basm_NR_prepare = {"basm_NR_prepare", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_10csmoothers_17basm_NR_prepare, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10csmoothers_16basm_NR_prepare};
6472 static PyObject *__pyx_pw_10csmoothers_17basm_NR_prepare(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6473  PyObject *__pyx_v_A = 0;
6474  PyObject *__pyx_v_basmFactor = 0;
6475  int __pyx_lineno = 0;
6476  const char *__pyx_filename = NULL;
6477  int __pyx_clineno = 0;
6478  PyObject *__pyx_r = 0;
6479  __Pyx_RefNannyDeclarations
6480  __Pyx_RefNannySetupContext("basm_NR_prepare (wrapper)", 0);
6481  {
6482  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_basmFactor,0};
6483  PyObject* values[2] = {0,0};
6484  if (unlikely(__pyx_kwds)) {
6485  Py_ssize_t kw_args;
6486  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6487  switch (pos_args) {
6488  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6489  CYTHON_FALLTHROUGH;
6490  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6491  CYTHON_FALLTHROUGH;
6492  case 0: break;
6493  default: goto __pyx_L5_argtuple_error;
6494  }
6495  kw_args = PyDict_Size(__pyx_kwds);
6496  switch (pos_args) {
6497  case 0:
6498  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6499  else goto __pyx_L5_argtuple_error;
6500  CYTHON_FALLTHROUGH;
6501  case 1:
6502  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_basmFactor)) != 0)) kw_args--;
6503  else {
6504  __Pyx_RaiseArgtupleInvalid("basm_NR_prepare", 1, 2, 2, 1); __PYX_ERR(0, 321, __pyx_L3_error)
6505  }
6506  }
6507  if (unlikely(kw_args > 0)) {
6508  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "basm_NR_prepare") < 0)) __PYX_ERR(0, 321, __pyx_L3_error)
6509  }
6510  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
6511  goto __pyx_L5_argtuple_error;
6512  } else {
6513  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6514  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6515  }
6516  __pyx_v_A = values[0];
6517  __pyx_v_basmFactor = values[1];
6518  }
6519  goto __pyx_L4_argument_unpacking_done;
6520  __pyx_L5_argtuple_error:;
6521  __Pyx_RaiseArgtupleInvalid("basm_NR_prepare", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 321, __pyx_L3_error)
6522  __pyx_L3_error:;
6523  __Pyx_AddTraceback("csmoothers.basm_NR_prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
6524  __Pyx_RefNannyFinishContext();
6525  return NULL;
6526  __pyx_L4_argument_unpacking_done:;
6527  __pyx_r = __pyx_pf_10csmoothers_16basm_NR_prepare(__pyx_self, __pyx_v_A, __pyx_v_basmFactor);
6528 
6529  /* function exit code */
6530  __Pyx_RefNannyFinishContext();
6531  return __pyx_r;
6532 }
6533 
6534 static PyObject *__pyx_pf_10csmoothers_16basm_NR_prepare(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_basmFactor) {
6535  PyObject *__pyx_r = NULL;
6536  __Pyx_RefNannyDeclarations
6537  PyObject *__pyx_t_1 = NULL;
6538  PyObject *__pyx_t_2 = NULL;
6539  int __pyx_lineno = 0;
6540  const char *__pyx_filename = NULL;
6541  int __pyx_clineno = 0;
6542  __Pyx_RefNannySetupContext("basm_NR_prepare", 0);
6543 
6544  /* "csmoothers.pyx":329
6545  * basmFactor :
6546  * """
6547  * smootherWrappers_basm_NR_prepare(A._cSparseMatrix, # <<<<<<<<<<<<<<
6548  * basmFactor._cBASMFactor)
6549  *
6550  */
6551  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_cSparseMatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
6552  __Pyx_GOTREF(__pyx_t_1);
6553  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7proteus_15superluWrappers_cSparseMatrix))))) __PYX_ERR(0, 329, __pyx_L1_error)
6554 
6555