proteus  1.8.1
C/C++/Fortran libraries
cpskRelations.cpp
Go to the documentation of this file.
1 /* Generated by Cython 0.29.30 */
2 
3 #ifndef PY_SSIZE_T_CLEAN
4 #define PY_SSIZE_T_CLEAN
5 #endif /* PY_SSIZE_T_CLEAN */
6 #include "Python.h"
7 #ifndef Py_PYTHON_H
8  #error Python headers needed to compile C extensions, please install development version of Python.
9 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
10  #error Cython requires Python 2.6+ or Python 3.3+.
11 #else
12 #define CYTHON_ABI "0_29_30"
13 #define CYTHON_HEX_VERSION 0x001D1EF0
14 #define CYTHON_FUTURE_DIVISION 0
15 #include <stddef.h>
16 #ifndef offsetof
17  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
18 #endif
19 #if !defined(WIN32) && !defined(MS_WINDOWS)
20  #ifndef __stdcall
21  #define __stdcall
22  #endif
23  #ifndef __cdecl
24  #define __cdecl
25  #endif
26  #ifndef __fastcall
27  #define __fastcall
28  #endif
29 #endif
30 #ifndef DL_IMPORT
31  #define DL_IMPORT(t) t
32 #endif
33 #ifndef DL_EXPORT
34  #define DL_EXPORT(t) t
35 #endif
36 #define __PYX_COMMA ,
37 #ifndef HAVE_LONG_LONG
38  #if PY_VERSION_HEX >= 0x02070000
39  #define HAVE_LONG_LONG
40  #endif
41 #endif
42 #ifndef PY_LONG_LONG
43  #define PY_LONG_LONG LONG_LONG
44 #endif
45 #ifndef Py_HUGE_VAL
46  #define Py_HUGE_VAL HUGE_VAL
47 #endif
48 #ifdef PYPY_VERSION
49  #define CYTHON_COMPILING_IN_PYPY 1
50  #define CYTHON_COMPILING_IN_PYSTON 0
51  #define CYTHON_COMPILING_IN_CPYTHON 0
52  #undef CYTHON_USE_TYPE_SLOTS
53  #define CYTHON_USE_TYPE_SLOTS 0
54  #undef CYTHON_USE_PYTYPE_LOOKUP
55  #define CYTHON_USE_PYTYPE_LOOKUP 0
56  #if PY_VERSION_HEX < 0x03050000
57  #undef CYTHON_USE_ASYNC_SLOTS
58  #define CYTHON_USE_ASYNC_SLOTS 0
59  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
60  #define CYTHON_USE_ASYNC_SLOTS 1
61  #endif
62  #undef CYTHON_USE_PYLIST_INTERNALS
63  #define CYTHON_USE_PYLIST_INTERNALS 0
64  #undef CYTHON_USE_UNICODE_INTERNALS
65  #define CYTHON_USE_UNICODE_INTERNALS 0
66  #undef CYTHON_USE_UNICODE_WRITER
67  #define CYTHON_USE_UNICODE_WRITER 0
68  #undef CYTHON_USE_PYLONG_INTERNALS
69  #define CYTHON_USE_PYLONG_INTERNALS 0
70  #undef CYTHON_AVOID_BORROWED_REFS
71  #define CYTHON_AVOID_BORROWED_REFS 1
72  #undef CYTHON_ASSUME_SAFE_MACROS
73  #define CYTHON_ASSUME_SAFE_MACROS 0
74  #undef CYTHON_UNPACK_METHODS
75  #define CYTHON_UNPACK_METHODS 0
76  #undef CYTHON_FAST_THREAD_STATE
77  #define CYTHON_FAST_THREAD_STATE 0
78  #undef CYTHON_FAST_PYCALL
79  #define CYTHON_FAST_PYCALL 0
80  #undef CYTHON_PEP489_MULTI_PHASE_INIT
81  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
82  #undef CYTHON_USE_TP_FINALIZE
83  #define CYTHON_USE_TP_FINALIZE 0
84  #undef CYTHON_USE_DICT_VERSIONS
85  #define CYTHON_USE_DICT_VERSIONS 0
86  #undef CYTHON_USE_EXC_INFO_STACK
87  #define CYTHON_USE_EXC_INFO_STACK 0
88  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
89  #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)
90  #endif
91 #elif defined(PYSTON_VERSION)
92  #define CYTHON_COMPILING_IN_PYPY 0
93  #define CYTHON_COMPILING_IN_PYSTON 1
94  #define CYTHON_COMPILING_IN_CPYTHON 0
95  #ifndef CYTHON_USE_TYPE_SLOTS
96  #define CYTHON_USE_TYPE_SLOTS 1
97  #endif
98  #undef CYTHON_USE_PYTYPE_LOOKUP
99  #define CYTHON_USE_PYTYPE_LOOKUP 0
100  #undef CYTHON_USE_ASYNC_SLOTS
101  #define CYTHON_USE_ASYNC_SLOTS 0
102  #undef CYTHON_USE_PYLIST_INTERNALS
103  #define CYTHON_USE_PYLIST_INTERNALS 0
104  #ifndef CYTHON_USE_UNICODE_INTERNALS
105  #define CYTHON_USE_UNICODE_INTERNALS 1
106  #endif
107  #undef CYTHON_USE_UNICODE_WRITER
108  #define CYTHON_USE_UNICODE_WRITER 0
109  #undef CYTHON_USE_PYLONG_INTERNALS
110  #define CYTHON_USE_PYLONG_INTERNALS 0
111  #ifndef CYTHON_AVOID_BORROWED_REFS
112  #define CYTHON_AVOID_BORROWED_REFS 0
113  #endif
114  #ifndef CYTHON_ASSUME_SAFE_MACROS
115  #define CYTHON_ASSUME_SAFE_MACROS 1
116  #endif
117  #ifndef CYTHON_UNPACK_METHODS
118  #define CYTHON_UNPACK_METHODS 1
119  #endif
120  #undef CYTHON_FAST_THREAD_STATE
121  #define CYTHON_FAST_THREAD_STATE 0
122  #undef CYTHON_FAST_PYCALL
123  #define CYTHON_FAST_PYCALL 0
124  #undef CYTHON_PEP489_MULTI_PHASE_INIT
125  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
126  #undef CYTHON_USE_TP_FINALIZE
127  #define CYTHON_USE_TP_FINALIZE 0
128  #undef CYTHON_USE_DICT_VERSIONS
129  #define CYTHON_USE_DICT_VERSIONS 0
130  #undef CYTHON_USE_EXC_INFO_STACK
131  #define CYTHON_USE_EXC_INFO_STACK 0
132  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
133  #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
134  #endif
135 #else
136  #define CYTHON_COMPILING_IN_PYPY 0
137  #define CYTHON_COMPILING_IN_PYSTON 0
138  #define CYTHON_COMPILING_IN_CPYTHON 1
139  #ifndef CYTHON_USE_TYPE_SLOTS
140  #define CYTHON_USE_TYPE_SLOTS 1
141  #endif
142  #if PY_VERSION_HEX < 0x02070000
143  #undef CYTHON_USE_PYTYPE_LOOKUP
144  #define CYTHON_USE_PYTYPE_LOOKUP 0
145  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
146  #define CYTHON_USE_PYTYPE_LOOKUP 1
147  #endif
148  #if PY_MAJOR_VERSION < 3
149  #undef CYTHON_USE_ASYNC_SLOTS
150  #define CYTHON_USE_ASYNC_SLOTS 0
151  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
152  #define CYTHON_USE_ASYNC_SLOTS 1
153  #endif
154  #if PY_VERSION_HEX < 0x02070000
155  #undef CYTHON_USE_PYLONG_INTERNALS
156  #define CYTHON_USE_PYLONG_INTERNALS 0
157  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
158  #define CYTHON_USE_PYLONG_INTERNALS 1
159  #endif
160  #ifndef CYTHON_USE_PYLIST_INTERNALS
161  #define CYTHON_USE_PYLIST_INTERNALS 1
162  #endif
163  #ifndef CYTHON_USE_UNICODE_INTERNALS
164  #define CYTHON_USE_UNICODE_INTERNALS 1
165  #endif
166  #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
167  #undef CYTHON_USE_UNICODE_WRITER
168  #define CYTHON_USE_UNICODE_WRITER 0
169  #elif !defined(CYTHON_USE_UNICODE_WRITER)
170  #define CYTHON_USE_UNICODE_WRITER 1
171  #endif
172  #ifndef CYTHON_AVOID_BORROWED_REFS
173  #define CYTHON_AVOID_BORROWED_REFS 0
174  #endif
175  #ifndef CYTHON_ASSUME_SAFE_MACROS
176  #define CYTHON_ASSUME_SAFE_MACROS 1
177  #endif
178  #ifndef CYTHON_UNPACK_METHODS
179  #define CYTHON_UNPACK_METHODS 1
180  #endif
181  #if PY_VERSION_HEX >= 0x030B00A4
182  #undef CYTHON_FAST_THREAD_STATE
183  #define CYTHON_FAST_THREAD_STATE 0
184  #elif !defined(CYTHON_FAST_THREAD_STATE)
185  #define CYTHON_FAST_THREAD_STATE 1
186  #endif
187  #ifndef CYTHON_FAST_PYCALL
188  #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
189  #endif
190  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
191  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
192  #endif
193  #ifndef CYTHON_USE_TP_FINALIZE
194  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
195  #endif
196  #ifndef CYTHON_USE_DICT_VERSIONS
197  #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
198  #endif
199  #if PY_VERSION_HEX >= 0x030B00A4
200  #undef CYTHON_USE_EXC_INFO_STACK
201  #define CYTHON_USE_EXC_INFO_STACK 0
202  #elif !defined(CYTHON_USE_EXC_INFO_STACK)
203  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
204  #endif
205  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
206  #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
207  #endif
208 #endif
209 #if !defined(CYTHON_FAST_PYCCALL)
210 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
211 #endif
212 #if CYTHON_USE_PYLONG_INTERNALS
213  #if PY_MAJOR_VERSION < 3
214  #include "longintrepr.h"
215  #endif
216  #undef SHIFT
217  #undef BASE
218  #undef MASK
219  #ifdef SIZEOF_VOID_P
220  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
221  #endif
222 #endif
223 #ifndef __has_attribute
224  #define __has_attribute(x) 0
225 #endif
226 #ifndef __has_cpp_attribute
227  #define __has_cpp_attribute(x) 0
228 #endif
229 #ifndef CYTHON_RESTRICT
230  #if defined(__GNUC__)
231  #define CYTHON_RESTRICT __restrict__
232  #elif defined(_MSC_VER) && _MSC_VER >= 1400
233  #define CYTHON_RESTRICT __restrict
234  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
235  #define CYTHON_RESTRICT restrict
236  #else
237  #define CYTHON_RESTRICT
238  #endif
239 #endif
240 #ifndef CYTHON_UNUSED
241 # if defined(__GNUC__)
242 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
243 # define CYTHON_UNUSED __attribute__ ((__unused__))
244 # else
245 # define CYTHON_UNUSED
246 # endif
247 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
248 # define CYTHON_UNUSED __attribute__ ((__unused__))
249 # else
250 # define CYTHON_UNUSED
251 # endif
252 #endif
253 #ifndef CYTHON_MAYBE_UNUSED_VAR
254 # if defined(__cplusplus)
255  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
256 # else
257 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
258 # endif
259 #endif
260 #ifndef CYTHON_NCP_UNUSED
261 # if CYTHON_COMPILING_IN_CPYTHON
262 # define CYTHON_NCP_UNUSED
263 # else
264 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
265 # endif
266 #endif
267 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
268 #ifdef _MSC_VER
269  #ifndef _MSC_STDINT_H_
270  #if _MSC_VER < 1300
271  typedef unsigned char uint8_t;
272  typedef unsigned int uint32_t;
273  #else
274  typedef unsigned __int8 uint8_t;
275  typedef unsigned __int32 uint32_t;
276  #endif
277  #endif
278 #else
279  #include <stdint.h>
280 #endif
281 #ifndef CYTHON_FALLTHROUGH
282  #if defined(__cplusplus) && __cplusplus >= 201103L
283  #if __has_cpp_attribute(fallthrough)
284  #define CYTHON_FALLTHROUGH [[fallthrough]]
285  #elif __has_cpp_attribute(clang::fallthrough)
286  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
287  #elif __has_cpp_attribute(gnu::fallthrough)
288  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
289  #endif
290  #endif
291  #ifndef CYTHON_FALLTHROUGH
292  #if __has_attribute(fallthrough)
293  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
294  #else
295  #define CYTHON_FALLTHROUGH
296  #endif
297  #endif
298  #if defined(__clang__ ) && defined(__apple_build_version__)
299  #if __apple_build_version__ < 7000000
300  #undef CYTHON_FALLTHROUGH
301  #define CYTHON_FALLTHROUGH
302  #endif
303  #endif
304 #endif
305 
306 #ifndef __cplusplus
307  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
308 #endif
309 #ifndef CYTHON_INLINE
310  #if defined(__clang__)
311  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
312  #else
313  #define CYTHON_INLINE inline
314  #endif
315 #endif
316 template<typename T>
317 void __Pyx_call_destructor(T& x) {
318  x.~T();
319 }
320 template<typename T>
321 class __Pyx_FakeReference {
322  public:
323  __Pyx_FakeReference() : ptr(NULL) { }
324  __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
325  T *operator->() { return ptr; }
326  T *operator&() { return ptr; }
327  operator T&() { return *ptr; }
328  template<typename U> bool operator ==(U other) { return *ptr == other; }
329  template<typename U> bool operator !=(U other) { return *ptr != other; }
330  private:
331  T *ptr;
332 };
333 
334 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
335  #define Py_OptimizeFlag 0
336 #endif
337 #define __PYX_BUILD_PY_SSIZE_T "n"
338 #define CYTHON_FORMAT_SSIZE_T "z"
339 #if PY_MAJOR_VERSION < 3
340  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
341  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
342  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
343  #define __Pyx_DefaultClassType PyClass_Type
344 #else
345  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
346  #define __Pyx_DefaultClassType PyType_Type
347 #if PY_VERSION_HEX >= 0x030B00A1
348  static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
349  PyObject *code, PyObject *c, PyObject* n, PyObject *v,
350  PyObject *fv, PyObject *cell, PyObject* fn,
351  PyObject *name, int fline, PyObject *lnos) {
352  PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
353  PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
354  const char *fn_cstr=NULL;
355  const char *name_cstr=NULL;
356  PyCodeObject* co=NULL;
357  PyObject *type, *value, *traceback;
358  PyErr_Fetch(&type, &value, &traceback);
359  if (!(kwds=PyDict_New())) goto end;
360  if (!(argcount=PyLong_FromLong(a))) goto end;
361  if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
362  if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
363  if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
364  if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
365  if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
366  if (!(nlocals=PyLong_FromLong(l))) goto end;
367  if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
368  if (!(stacksize=PyLong_FromLong(s))) goto end;
369  if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
370  if (!(flags=PyLong_FromLong(f))) goto end;
371  if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
372  if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
373  if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
374  if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
375  if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
376  if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
377  if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
378  if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
379  if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
380  if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
381  if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
382  if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
383  if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
384  if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
385  Py_XDECREF((PyObject*)co);
386  co = (PyCodeObject*)call_result;
387  call_result = NULL;
388  if (0) {
389  cleanup_code_too:
390  Py_XDECREF((PyObject*)co);
391  co = NULL;
392  }
393  end:
394  Py_XDECREF(kwds);
395  Py_XDECREF(argcount);
396  Py_XDECREF(posonlyargcount);
397  Py_XDECREF(kwonlyargcount);
398  Py_XDECREF(nlocals);
399  Py_XDECREF(stacksize);
400  Py_XDECREF(replace);
401  Py_XDECREF(call_result);
402  Py_XDECREF(empty);
403  if (type) {
404  PyErr_Restore(type, value, traceback);
405  }
406  return co;
407  }
408 #else
409  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
410  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
411 #endif
412  #define __Pyx_DefaultClassType PyType_Type
413 #endif
414 #ifndef Py_TPFLAGS_CHECKTYPES
415  #define Py_TPFLAGS_CHECKTYPES 0
416 #endif
417 #ifndef Py_TPFLAGS_HAVE_INDEX
418  #define Py_TPFLAGS_HAVE_INDEX 0
419 #endif
420 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
421  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
422 #endif
423 #ifndef Py_TPFLAGS_HAVE_FINALIZE
424  #define Py_TPFLAGS_HAVE_FINALIZE 0
425 #endif
426 #ifndef METH_STACKLESS
427  #define METH_STACKLESS 0
428 #endif
429 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
430  #ifndef METH_FASTCALL
431  #define METH_FASTCALL 0x80
432  #endif
433  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
434  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
435  Py_ssize_t nargs, PyObject *kwnames);
436 #else
437  #define __Pyx_PyCFunctionFast _PyCFunctionFast
438  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
439 #endif
440 #if CYTHON_FAST_PYCCALL
441 #define __Pyx_PyFastCFunction_Check(func)\
442  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
443 #else
444 #define __Pyx_PyFastCFunction_Check(func) 0
445 #endif
446 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
447  #define PyObject_Malloc(s) PyMem_Malloc(s)
448  #define PyObject_Free(p) PyMem_Free(p)
449  #define PyObject_Realloc(p) PyMem_Realloc(p)
450 #endif
451 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
452  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
453  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
454  #define PyMem_RawFree(p) PyMem_Free(p)
455 #endif
456 #if CYTHON_COMPILING_IN_PYSTON
457  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
458  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
459 #else
460  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
461  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
462 #endif
463 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
464  #define __Pyx_PyThreadState_Current PyThreadState_GET()
465 #elif PY_VERSION_HEX >= 0x03060000
466  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
467 #elif PY_VERSION_HEX >= 0x03000000
468  #define __Pyx_PyThreadState_Current PyThreadState_GET()
469 #else
470  #define __Pyx_PyThreadState_Current _PyThreadState_Current
471 #endif
472 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
473 #include "pythread.h"
474 #define Py_tss_NEEDS_INIT 0
475 typedef int Py_tss_t;
476 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
477  *key = PyThread_create_key();
478  return 0;
479 }
480 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
481  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
482  *key = Py_tss_NEEDS_INIT;
483  return key;
484 }
485 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
486  PyObject_Free(key);
487 }
488 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
489  return *key != Py_tss_NEEDS_INIT;
490 }
491 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
492  PyThread_delete_key(*key);
493  *key = Py_tss_NEEDS_INIT;
494 }
495 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
496  return PyThread_set_key_value(*key, value);
497 }
498 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
499  return PyThread_get_key_value(*key);
500 }
501 #endif
502 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
503 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
504 #else
505 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
506 #endif
507 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
508  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
509  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
510 #else
511  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
512  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
513 #endif
514 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
515 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
516 #else
517 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
518 #endif
519 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
520  #define CYTHON_PEP393_ENABLED 1
521  #if defined(PyUnicode_IS_READY)
522  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
523  0 : _PyUnicode_Ready((PyObject *)(op)))
524  #else
525  #define __Pyx_PyUnicode_READY(op) (0)
526  #endif
527  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
528  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
529  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
530  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
531  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
532  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
533  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
534  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
535  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
536  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
537  #else
538  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
539  #endif
540  #else
541  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
542  #endif
543 #else
544  #define CYTHON_PEP393_ENABLED 0
545  #define PyUnicode_1BYTE_KIND 1
546  #define PyUnicode_2BYTE_KIND 2
547  #define PyUnicode_4BYTE_KIND 4
548  #define __Pyx_PyUnicode_READY(op) (0)
549  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
550  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
551  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
552  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
553  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
554  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
555  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
556  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
557 #endif
558 #if CYTHON_COMPILING_IN_PYPY
559  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
560  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
561 #else
562  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
563  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
564  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
565 #endif
566 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
567  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
568 #endif
569 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
570  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
571 #endif
572 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
573  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
574 #endif
575 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
576 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
577 #if PY_MAJOR_VERSION >= 3
578  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
579 #else
580  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
581 #endif
582 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
583  #define PyObject_ASCII(o) PyObject_Repr(o)
584 #endif
585 #if PY_MAJOR_VERSION >= 3
586  #define PyBaseString_Type PyUnicode_Type
587  #define PyStringObject PyUnicodeObject
588  #define PyString_Type PyUnicode_Type
589  #define PyString_Check PyUnicode_Check
590  #define PyString_CheckExact PyUnicode_CheckExact
591 #ifndef PyObject_Unicode
592  #define PyObject_Unicode PyObject_Str
593 #endif
594 #endif
595 #if PY_MAJOR_VERSION >= 3
596  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
597  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
598 #else
599  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
600  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
601 #endif
602 #ifndef PySet_CheckExact
603  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
604 #endif
605 #if PY_VERSION_HEX >= 0x030900A4
606  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
607  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
608 #else
609  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
610  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
611 #endif
612 #if CYTHON_ASSUME_SAFE_MACROS
613  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
614 #else
615  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
616 #endif
617 #if PY_MAJOR_VERSION >= 3
618  #define PyIntObject PyLongObject
619  #define PyInt_Type PyLong_Type
620  #define PyInt_Check(op) PyLong_Check(op)
621  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
622  #define PyInt_FromString PyLong_FromString
623  #define PyInt_FromUnicode PyLong_FromUnicode
624  #define PyInt_FromLong PyLong_FromLong
625  #define PyInt_FromSize_t PyLong_FromSize_t
626  #define PyInt_FromSsize_t PyLong_FromSsize_t
627  #define PyInt_AsLong PyLong_AsLong
628  #define PyInt_AS_LONG PyLong_AS_LONG
629  #define PyInt_AsSsize_t PyLong_AsSsize_t
630  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
631  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
632  #define PyNumber_Int PyNumber_Long
633 #endif
634 #if PY_MAJOR_VERSION >= 3
635  #define PyBoolObject PyLongObject
636 #endif
637 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
638  #ifndef PyUnicode_InternFromString
639  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
640  #endif
641 #endif
642 #if PY_VERSION_HEX < 0x030200A4
643  typedef long Py_hash_t;
644  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
645  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
646 #else
647  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
648  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
649 #endif
650 #if PY_MAJOR_VERSION >= 3
651  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
652 #else
653  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
654 #endif
655 #if CYTHON_USE_ASYNC_SLOTS
656  #if PY_VERSION_HEX >= 0x030500B1
657  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
658  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
659  #else
660  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
661  #endif
662 #else
663  #define __Pyx_PyType_AsAsync(obj) NULL
664 #endif
665 #ifndef __Pyx_PyAsyncMethodsStruct
666  typedef struct {
667  unaryfunc am_await;
668  unaryfunc am_aiter;
669  unaryfunc am_anext;
670  } __Pyx_PyAsyncMethodsStruct;
671 #endif
672 
673 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
674  #if !defined(_USE_MATH_DEFINES)
675  #define _USE_MATH_DEFINES
676  #endif
677 #endif
678 #include <math.h>
679 #ifdef NAN
680 #define __PYX_NAN() ((float) NAN)
681 #else
682 static CYTHON_INLINE float __PYX_NAN() {
683  float value;
684  memset(&value, 0xFF, sizeof(value));
685  return value;
686 }
687 #endif
688 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
689 #define __Pyx_truncl trunc
690 #else
691 #define __Pyx_truncl truncl
692 #endif
693 
694 #define __PYX_MARK_ERR_POS(f_index, lineno) \
695  { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
696 #define __PYX_ERR(f_index, lineno, Ln_error) \
697  { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
698 
699 #ifndef __PYX_EXTERN_C
700  #ifdef __cplusplus
701  #define __PYX_EXTERN_C extern "C"
702  #else
703  #define __PYX_EXTERN_C extern
704  #endif
705 #endif
706 
707 #define __PYX_HAVE__cpskRelations
708 #define __PYX_HAVE_API__cpskRelations
709 /* Early includes */
710 #include <string.h>
711 #include <stdio.h>
712 #include "numpy/arrayobject.h"
713 #include "numpy/ndarrayobject.h"
714 #include "numpy/ndarraytypes.h"
715 #include "numpy/arrayscalars.h"
716 #include "numpy/ufuncobject.h"
717 
718  /* NumPy API declarations from "numpy/__init__.pxd" */
719 
720 #include "pskRelations.h"
721 #ifdef _OPENMP
722 #include <omp.h>
723 #endif /* _OPENMP */
724 
725 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
726 #define CYTHON_WITHOUT_ASSERTIONS
727 #endif
728 
729 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
730  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
731 
732 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
733 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
734 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
735 #define __PYX_DEFAULT_STRING_ENCODING ""
736 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
737 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
738 #define __Pyx_uchar_cast(c) ((unsigned char)c)
739 #define __Pyx_long_cast(x) ((long)x)
740 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
741  (sizeof(type) < sizeof(Py_ssize_t)) ||\
742  (sizeof(type) > sizeof(Py_ssize_t) &&\
743  likely(v < (type)PY_SSIZE_T_MAX ||\
744  v == (type)PY_SSIZE_T_MAX) &&\
745  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
746  v == (type)PY_SSIZE_T_MIN))) ||\
747  (sizeof(type) == sizeof(Py_ssize_t) &&\
748  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
749  v == (type)PY_SSIZE_T_MAX))) )
750 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
751  return (size_t) i < (size_t) limit;
752 }
753 #if defined (__cplusplus) && __cplusplus >= 201103L
754  #include <cstdlib>
755  #define __Pyx_sst_abs(value) std::abs(value)
756 #elif SIZEOF_INT >= SIZEOF_SIZE_T
757  #define __Pyx_sst_abs(value) abs(value)
758 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
759  #define __Pyx_sst_abs(value) labs(value)
760 #elif defined (_MSC_VER)
761  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
762 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
763  #define __Pyx_sst_abs(value) llabs(value)
764 #elif defined (__GNUC__)
765  #define __Pyx_sst_abs(value) __builtin_llabs(value)
766 #else
767  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
768 #endif
769 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
770 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
771 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
772 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
773 #define __Pyx_PyBytes_FromString PyBytes_FromString
774 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
775 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
776 #if PY_MAJOR_VERSION < 3
777  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
778  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
779 #else
780  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
781  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
782 #endif
783 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
784 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
785 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
786 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
787 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
788 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
789 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
790 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
791 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
792 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
793 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
794 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
795 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
796 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
797 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
798 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
799 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
800  const Py_UNICODE *u_end = u;
801  while (*u_end++) ;
802  return (size_t)(u_end - u - 1);
803 }
804 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
805 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
806 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
807 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
808 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
809 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
810 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
811 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
812 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
813 #define __Pyx_PySequence_Tuple(obj)\
814  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
815 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
816 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
817 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
818 #if CYTHON_ASSUME_SAFE_MACROS
819 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
820 #else
821 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
822 #endif
823 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
824 #if PY_MAJOR_VERSION >= 3
825 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
826 #else
827 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
828 #endif
829 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
830 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
831 static int __Pyx_sys_getdefaultencoding_not_ascii;
832 static int __Pyx_init_sys_getdefaultencoding_params(void) {
833  PyObject* sys;
834  PyObject* default_encoding = NULL;
835  PyObject* ascii_chars_u = NULL;
836  PyObject* ascii_chars_b = NULL;
837  const char* default_encoding_c;
838  sys = PyImport_ImportModule("sys");
839  if (!sys) goto bad;
840  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
841  Py_DECREF(sys);
842  if (!default_encoding) goto bad;
843  default_encoding_c = PyBytes_AsString(default_encoding);
844  if (!default_encoding_c) goto bad;
845  if (strcmp(default_encoding_c, "ascii") == 0) {
846  __Pyx_sys_getdefaultencoding_not_ascii = 0;
847  } else {
848  char ascii_chars[128];
849  int c;
850  for (c = 0; c < 128; c++) {
851  ascii_chars[c] = c;
852  }
853  __Pyx_sys_getdefaultencoding_not_ascii = 1;
854  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
855  if (!ascii_chars_u) goto bad;
856  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
857  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
858  PyErr_Format(
859  PyExc_ValueError,
860  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
861  default_encoding_c);
862  goto bad;
863  }
864  Py_DECREF(ascii_chars_u);
865  Py_DECREF(ascii_chars_b);
866  }
867  Py_DECREF(default_encoding);
868  return 0;
869 bad:
870  Py_XDECREF(default_encoding);
871  Py_XDECREF(ascii_chars_u);
872  Py_XDECREF(ascii_chars_b);
873  return -1;
874 }
875 #endif
876 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
877 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
878 #else
879 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
880 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
881 static char* __PYX_DEFAULT_STRING_ENCODING;
882 static int __Pyx_init_sys_getdefaultencoding_params(void) {
883  PyObject* sys;
884  PyObject* default_encoding = NULL;
885  char* default_encoding_c;
886  sys = PyImport_ImportModule("sys");
887  if (!sys) goto bad;
888  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
889  Py_DECREF(sys);
890  if (!default_encoding) goto bad;
891  default_encoding_c = PyBytes_AsString(default_encoding);
892  if (!default_encoding_c) goto bad;
893  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
894  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
895  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
896  Py_DECREF(default_encoding);
897  return 0;
898 bad:
899  Py_XDECREF(default_encoding);
900  return -1;
901 }
902 #endif
903 #endif
904 
905 
906 /* Test for GCC > 2.95 */
907 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
908  #define likely(x) __builtin_expect(!!(x), 1)
909  #define unlikely(x) __builtin_expect(!!(x), 0)
910 #else /* !__GNUC__ or GCC < 2.95 */
911  #define likely(x) (x)
912  #define unlikely(x) (x)
913 #endif /* __GNUC__ */
914 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
915 
916 static PyObject *__pyx_m = NULL;
917 static PyObject *__pyx_d;
918 static PyObject *__pyx_b;
919 static PyObject *__pyx_cython_runtime = NULL;
920 static PyObject *__pyx_empty_tuple;
921 static PyObject *__pyx_empty_bytes;
922 static PyObject *__pyx_empty_unicode;
923 static int __pyx_lineno;
924 static int __pyx_clineno = 0;
925 static const char * __pyx_cfilenm= __FILE__;
926 static const char *__pyx_filename;
927 
928 /* Header.proto */
929 #if !defined(CYTHON_CCOMPLEX)
930  #if defined(__cplusplus)
931  #define CYTHON_CCOMPLEX 1
932  #elif defined(_Complex_I)
933  #define CYTHON_CCOMPLEX 1
934  #else
935  #define CYTHON_CCOMPLEX 0
936  #endif
937 #endif
938 #if CYTHON_CCOMPLEX
939  #ifdef __cplusplus
940  #include <complex>
941  #else
942  #include <complex.h>
943  #endif
944 #endif
945 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
946  #undef _Complex_I
947  #define _Complex_I 1.0fj
948 #endif
949 
950 
951 static const char *__pyx_f[] = {
952  "proteus/cpskRelations.pyx",
953  "__init__.pxd",
954  "type.pxd",
955 };
956 
957 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":690
958  * # in Cython to enable them only on the right systems.
959  *
960  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
961  * ctypedef npy_int16 int16_t
962  * ctypedef npy_int32 int32_t
963  */
964 typedef npy_int8 __pyx_t_5numpy_int8_t;
965 
966 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":691
967  *
968  * ctypedef npy_int8 int8_t
969  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
970  * ctypedef npy_int32 int32_t
971  * ctypedef npy_int64 int64_t
972  */
973 typedef npy_int16 __pyx_t_5numpy_int16_t;
974 
975 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":692
976  * ctypedef npy_int8 int8_t
977  * ctypedef npy_int16 int16_t
978  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
979  * ctypedef npy_int64 int64_t
980  * #ctypedef npy_int96 int96_t
981  */
982 typedef npy_int32 __pyx_t_5numpy_int32_t;
983 
984 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":693
985  * ctypedef npy_int16 int16_t
986  * ctypedef npy_int32 int32_t
987  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
988  * #ctypedef npy_int96 int96_t
989  * #ctypedef npy_int128 int128_t
990  */
991 typedef npy_int64 __pyx_t_5numpy_int64_t;
992 
993 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":697
994  * #ctypedef npy_int128 int128_t
995  *
996  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
997  * ctypedef npy_uint16 uint16_t
998  * ctypedef npy_uint32 uint32_t
999  */
1000 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1001 
1002 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":698
1003  *
1004  * ctypedef npy_uint8 uint8_t
1005  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1006  * ctypedef npy_uint32 uint32_t
1007  * ctypedef npy_uint64 uint64_t
1008  */
1009 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1010 
1011 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":699
1012  * ctypedef npy_uint8 uint8_t
1013  * ctypedef npy_uint16 uint16_t
1014  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1015  * ctypedef npy_uint64 uint64_t
1016  * #ctypedef npy_uint96 uint96_t
1017  */
1018 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1019 
1020 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":700
1021  * ctypedef npy_uint16 uint16_t
1022  * ctypedef npy_uint32 uint32_t
1023  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1024  * #ctypedef npy_uint96 uint96_t
1025  * #ctypedef npy_uint128 uint128_t
1026  */
1027 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1028 
1029 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":704
1030  * #ctypedef npy_uint128 uint128_t
1031  *
1032  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1033  * ctypedef npy_float64 float64_t
1034  * #ctypedef npy_float80 float80_t
1035  */
1036 typedef npy_float32 __pyx_t_5numpy_float32_t;
1037 
1038 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":705
1039  *
1040  * ctypedef npy_float32 float32_t
1041  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1042  * #ctypedef npy_float80 float80_t
1043  * #ctypedef npy_float128 float128_t
1044  */
1045 typedef npy_float64 __pyx_t_5numpy_float64_t;
1046 
1047 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":714
1048  * # The int types are mapped a bit surprising --
1049  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1050  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1051  * ctypedef npy_longlong long_t
1052  * ctypedef npy_longlong longlong_t
1053  */
1054 typedef npy_long __pyx_t_5numpy_int_t;
1055 
1056 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":715
1057  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1058  * ctypedef npy_long int_t
1059  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1060  * ctypedef npy_longlong longlong_t
1061  *
1062  */
1063 typedef npy_longlong __pyx_t_5numpy_long_t;
1064 
1065 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":716
1066  * ctypedef npy_long int_t
1067  * ctypedef npy_longlong long_t
1068  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1069  *
1070  * ctypedef npy_ulong uint_t
1071  */
1072 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1073 
1074 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":718
1075  * ctypedef npy_longlong longlong_t
1076  *
1077  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1078  * ctypedef npy_ulonglong ulong_t
1079  * ctypedef npy_ulonglong ulonglong_t
1080  */
1081 typedef npy_ulong __pyx_t_5numpy_uint_t;
1082 
1083 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":719
1084  *
1085  * ctypedef npy_ulong uint_t
1086  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1087  * ctypedef npy_ulonglong ulonglong_t
1088  *
1089  */
1090 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1091 
1092 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":720
1093  * ctypedef npy_ulong uint_t
1094  * ctypedef npy_ulonglong ulong_t
1095  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1096  *
1097  * ctypedef npy_intp intp_t
1098  */
1099 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1100 
1101 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":722
1102  * ctypedef npy_ulonglong ulonglong_t
1103  *
1104  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1105  * ctypedef npy_uintp uintp_t
1106  *
1107  */
1108 typedef npy_intp __pyx_t_5numpy_intp_t;
1109 
1110 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":723
1111  *
1112  * ctypedef npy_intp intp_t
1113  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1114  *
1115  * ctypedef npy_double float_t
1116  */
1117 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1118 
1119 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":725
1120  * ctypedef npy_uintp uintp_t
1121  *
1122  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1123  * ctypedef npy_double double_t
1124  * ctypedef npy_longdouble longdouble_t
1125  */
1126 typedef npy_double __pyx_t_5numpy_float_t;
1127 
1128 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":726
1129  *
1130  * ctypedef npy_double float_t
1131  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1132  * ctypedef npy_longdouble longdouble_t
1133  *
1134  */
1135 typedef npy_double __pyx_t_5numpy_double_t;
1136 
1137 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":727
1138  * ctypedef npy_double float_t
1139  * ctypedef npy_double double_t
1140  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1141  *
1142  * ctypedef npy_cfloat cfloat_t
1143  */
1144 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1145 /* Declarations.proto */
1146 #if CYTHON_CCOMPLEX
1147  #ifdef __cplusplus
1148  typedef ::std::complex< float > __pyx_t_float_complex;
1149  #else
1150  typedef float _Complex __pyx_t_float_complex;
1151  #endif
1152 #else
1153  typedef struct { float real, imag; } __pyx_t_float_complex;
1154 #endif
1155 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1156 
1157 /* Declarations.proto */
1158 #if CYTHON_CCOMPLEX
1159  #ifdef __cplusplus
1160  typedef ::std::complex< double > __pyx_t_double_complex;
1161  #else
1162  typedef double _Complex __pyx_t_double_complex;
1163  #endif
1164 #else
1165  typedef struct { double real, imag; } __pyx_t_double_complex;
1166 #endif
1167 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1168 
1169 
1170 /*--- Type declarations ---*/
1171 
1172 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":729
1173  * ctypedef npy_longdouble longdouble_t
1174  *
1175  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1176  * ctypedef npy_cdouble cdouble_t
1177  * ctypedef npy_clongdouble clongdouble_t
1178  */
1179 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1180 
1181 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":730
1182  *
1183  * ctypedef npy_cfloat cfloat_t
1184  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1185  * ctypedef npy_clongdouble clongdouble_t
1186  *
1187  */
1188 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1189 
1190 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":731
1191  * ctypedef npy_cfloat cfloat_t
1192  * ctypedef npy_cdouble cdouble_t
1193  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1194  *
1195  * ctypedef npy_cdouble complex_t
1196  */
1197 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1198 
1199 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":733
1200  * ctypedef npy_clongdouble clongdouble_t
1201  *
1202  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1203  *
1204  * cdef inline object PyArray_MultiIterNew1(a):
1205  */
1206 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1207 
1208 /* --- Runtime support code (head) --- */
1209 /* Refnanny.proto */
1210 #ifndef CYTHON_REFNANNY
1211  #define CYTHON_REFNANNY 0
1212 #endif
1213 #if CYTHON_REFNANNY
1214  typedef struct {
1215  void (*INCREF)(void*, PyObject*, int);
1216  void (*DECREF)(void*, PyObject*, int);
1217  void (*GOTREF)(void*, PyObject*, int);
1218  void (*GIVEREF)(void*, PyObject*, int);
1219  void* (*SetupContext)(const char*, int, const char*);
1220  void (*FinishContext)(void**);
1221  } __Pyx_RefNannyAPIStruct;
1222  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1223  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1224  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1225 #ifdef WITH_THREAD
1226  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1227  if (acquire_gil) {\
1228  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1229  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1230  PyGILState_Release(__pyx_gilstate_save);\
1231  } else {\
1232  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1233  }
1234 #else
1235  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1236  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1237 #endif
1238  #define __Pyx_RefNannyFinishContext()\
1239  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1240  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1241  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1242  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1243  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1244  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1245  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1246  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1247  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1248 #else
1249  #define __Pyx_RefNannyDeclarations
1250  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1251  #define __Pyx_RefNannyFinishContext()
1252  #define __Pyx_INCREF(r) Py_INCREF(r)
1253  #define __Pyx_DECREF(r) Py_DECREF(r)
1254  #define __Pyx_GOTREF(r)
1255  #define __Pyx_GIVEREF(r)
1256  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1257  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1258  #define __Pyx_XGOTREF(r)
1259  #define __Pyx_XGIVEREF(r)
1260 #endif
1261 #define __Pyx_XDECREF_SET(r, v) do {\
1262  PyObject *tmp = (PyObject *) r;\
1263  r = v; __Pyx_XDECREF(tmp);\
1264  } while (0)
1265 #define __Pyx_DECREF_SET(r, v) do {\
1266  PyObject *tmp = (PyObject *) r;\
1267  r = v; __Pyx_DECREF(tmp);\
1268  } while (0)
1269 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1270 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1271 
1272 /* RaiseArgTupleInvalid.proto */
1273 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1274  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1275 
1276 /* RaiseDoubleKeywords.proto */
1277 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1278 
1279 /* ParseKeywords.proto */
1280 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1281  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1282  const char* function_name);
1283 
1284 /* PyObjectGetAttrStr.proto */
1285 #if CYTHON_USE_TYPE_SLOTS
1286 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1287 #else
1288 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1289 #endif
1290 
1291 /* GetBuiltinName.proto */
1292 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1293 
1294 /* GetTopmostException.proto */
1295 #if CYTHON_USE_EXC_INFO_STACK
1296 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1297 #endif
1298 
1299 /* PyThreadStateGet.proto */
1300 #if CYTHON_FAST_THREAD_STATE
1301 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1302 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1303 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1304 #else
1305 #define __Pyx_PyThreadState_declare
1306 #define __Pyx_PyThreadState_assign
1307 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1308 #endif
1309 
1310 /* SaveResetException.proto */
1311 #if CYTHON_FAST_THREAD_STATE
1312 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1313 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1314 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1315 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1316 #else
1317 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1318 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1319 #endif
1320 
1321 /* PyErrExceptionMatches.proto */
1322 #if CYTHON_FAST_THREAD_STATE
1323 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1324 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1325 #else
1326 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1327 #endif
1328 
1329 /* GetException.proto */
1330 #if CYTHON_FAST_THREAD_STATE
1331 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1332 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1333 #else
1334 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1335 #endif
1336 
1337 /* PyObjectCall.proto */
1338 #if CYTHON_COMPILING_IN_CPYTHON
1339 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1340 #else
1341 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1342 #endif
1343 
1344 /* PyErrFetchRestore.proto */
1345 #if CYTHON_FAST_THREAD_STATE
1346 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1347 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1348 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1349 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1350 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1351 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1352 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1353 #if CYTHON_COMPILING_IN_CPYTHON
1354 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1355 #else
1356 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1357 #endif
1358 #else
1359 #define __Pyx_PyErr_Clear() PyErr_Clear()
1360 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1361 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1362 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1363 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1364 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1365 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1366 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1367 #endif
1368 
1369 /* RaiseException.proto */
1370 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1371 
1372 /* TypeImport.proto */
1373 #ifndef __PYX_HAVE_RT_ImportType_proto
1374 #define __PYX_HAVE_RT_ImportType_proto
1375 enum __Pyx_ImportType_CheckSize {
1376  __Pyx_ImportType_CheckSize_Error = 0,
1377  __Pyx_ImportType_CheckSize_Warn = 1,
1378  __Pyx_ImportType_CheckSize_Ignore = 2
1379 };
1380 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1381 #endif
1382 
1383 /* Import.proto */
1384 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1385 
1386 /* PyDictVersioning.proto */
1387 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1388 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1389 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1390 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1391  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1392  (cache_var) = (value);
1393 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1394  static PY_UINT64_T __pyx_dict_version = 0;\
1395  static PyObject *__pyx_dict_cached_value = NULL;\
1396  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1397  (VAR) = __pyx_dict_cached_value;\
1398  } else {\
1399  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1400  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1401  }\
1402 }
1403 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1404 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1405 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1406 #else
1407 #define __PYX_GET_DICT_VERSION(dict) (0)
1408 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1409 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1410 #endif
1411 
1412 /* CLineInTraceback.proto */
1413 #ifdef CYTHON_CLINE_IN_TRACEBACK
1414 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1415 #else
1416 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1417 #endif
1418 
1419 /* CodeObjectCache.proto */
1420 typedef struct {
1421  PyCodeObject* code_object;
1422  int code_line;
1423 } __Pyx_CodeObjectCacheEntry;
1424 struct __Pyx_CodeObjectCache {
1425  int count;
1426  int max_count;
1427  __Pyx_CodeObjectCacheEntry* entries;
1428 };
1429 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1430 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1431 static PyCodeObject *__pyx_find_code_object(int code_line);
1432 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1433 
1434 /* AddTraceback.proto */
1435 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1436  int py_line, const char *filename);
1437 
1438 /* RealImag.proto */
1439 #if CYTHON_CCOMPLEX
1440  #ifdef __cplusplus
1441  #define __Pyx_CREAL(z) ((z).real())
1442  #define __Pyx_CIMAG(z) ((z).imag())
1443  #else
1444  #define __Pyx_CREAL(z) (__real__(z))
1445  #define __Pyx_CIMAG(z) (__imag__(z))
1446  #endif
1447 #else
1448  #define __Pyx_CREAL(z) ((z).real)
1449  #define __Pyx_CIMAG(z) ((z).imag)
1450 #endif
1451 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
1452  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
1453  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1454  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1455 #else
1456  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1457  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1458 #endif
1459 
1460 /* Arithmetic.proto */
1461 #if CYTHON_CCOMPLEX
1462  #define __Pyx_c_eq_float(a, b) ((a)==(b))
1463  #define __Pyx_c_sum_float(a, b) ((a)+(b))
1464  #define __Pyx_c_diff_float(a, b) ((a)-(b))
1465  #define __Pyx_c_prod_float(a, b) ((a)*(b))
1466  #define __Pyx_c_quot_float(a, b) ((a)/(b))
1467  #define __Pyx_c_neg_float(a) (-(a))
1468  #ifdef __cplusplus
1469  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
1470  #define __Pyx_c_conj_float(z) (::std::conj(z))
1471  #if 1
1472  #define __Pyx_c_abs_float(z) (::std::abs(z))
1473  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
1474  #endif
1475  #else
1476  #define __Pyx_c_is_zero_float(z) ((z)==0)
1477  #define __Pyx_c_conj_float(z) (conjf(z))
1478  #if 1
1479  #define __Pyx_c_abs_float(z) (cabsf(z))
1480  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
1481  #endif
1482  #endif
1483 #else
1484  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
1485  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
1486  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
1487  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
1488  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
1489  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
1490  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
1491  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
1492  #if 1
1493  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
1494  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
1495  #endif
1496 #endif
1497 
1498 /* Arithmetic.proto */
1499 #if CYTHON_CCOMPLEX
1500  #define __Pyx_c_eq_double(a, b) ((a)==(b))
1501  #define __Pyx_c_sum_double(a, b) ((a)+(b))
1502  #define __Pyx_c_diff_double(a, b) ((a)-(b))
1503  #define __Pyx_c_prod_double(a, b) ((a)*(b))
1504  #define __Pyx_c_quot_double(a, b) ((a)/(b))
1505  #define __Pyx_c_neg_double(a) (-(a))
1506  #ifdef __cplusplus
1507  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
1508  #define __Pyx_c_conj_double(z) (::std::conj(z))
1509  #if 1
1510  #define __Pyx_c_abs_double(z) (::std::abs(z))
1511  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
1512  #endif
1513  #else
1514  #define __Pyx_c_is_zero_double(z) ((z)==0)
1515  #define __Pyx_c_conj_double(z) (conj(z))
1516  #if 1
1517  #define __Pyx_c_abs_double(z) (cabs(z))
1518  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
1519  #endif
1520  #endif
1521 #else
1522  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
1523  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
1524  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
1525  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
1526  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
1527  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
1528  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
1529  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
1530  #if 1
1531  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
1532  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
1533  #endif
1534 #endif
1535 
1536 /* GCCDiagnostics.proto */
1537 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
1538 #define __Pyx_HAS_GCC_DIAGNOSTIC
1539 #endif
1540 
1541 /* CIntToPy.proto */
1542 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1543 
1544 /* CIntFromPy.proto */
1545 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1546 
1547 /* CIntFromPy.proto */
1548 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1549 
1550 /* FastTypeChecks.proto */
1551 #if CYTHON_COMPILING_IN_CPYTHON
1552 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1553 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1554 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1555 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1556 #else
1557 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1558 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1559 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1560 #endif
1561 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1562 
1563 /* CheckBinaryVersion.proto */
1564 static int __Pyx_check_binary_version(void);
1565 
1566 /* InitStrings.proto */
1567 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1568 
1569 
1570 /* Module declarations from 'cpython.buffer' */
1571 
1572 /* Module declarations from 'libc.string' */
1573 
1574 /* Module declarations from 'libc.stdio' */
1575 
1576 /* Module declarations from '__builtin__' */
1577 
1578 /* Module declarations from 'cpython.type' */
1579 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
1580 
1581 /* Module declarations from 'cpython' */
1582 
1583 /* Module declarations from 'cpython.object' */
1584 
1585 /* Module declarations from 'cpython.ref' */
1586 
1587 /* Module declarations from 'cpython.mem' */
1588 
1589 /* Module declarations from 'numpy' */
1590 
1591 /* Module declarations from 'numpy' */
1592 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
1593 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
1594 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
1595 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
1596 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
1597 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
1598 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
1599 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
1600 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
1601 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
1602 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
1603 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
1604 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
1605 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
1606 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
1607 
1608 /* Module declarations from 'pskRelations' */
1609 
1610 /* Module declarations from 'cpskRelations' */
1611 #define __Pyx_MODULE_NAME "cpskRelations"
1612 extern int __pyx_module_is_main_cpskRelations;
1613 int __pyx_module_is_main_cpskRelations = 0;
1614 
1615 /* Implementation of 'cpskRelations' */
1616 static PyObject *__pyx_builtin_ImportError;
1617 static const char __pyx_k_m[] = "m";
1618 static const char __pyx_k_Sw[] = "Sw";
1619 static const char __pyx_k_np[] = "np";
1620 static const char __pyx_k_psk[] = "psk";
1621 static const char __pyx_k_main[] = "__main__";
1622 static const char __pyx_k_name[] = "__name__";
1623 static const char __pyx_k_psic[] = "psic";
1624 static const char __pyx_k_test[] = "__test__";
1625 static const char __pyx_k_alpha[] = "alpha";
1626 static const char __pyx_k_numpy[] = "numpy";
1627 static const char __pyx_k_rwork[] = "rwork";
1628 static const char __pyx_k_import[] = "__import__";
1629 static const char __pyx_k_ns_del[] = "ns_del";
1630 static const char __pyx_k_sw_max[] = "sw_max";
1631 static const char __pyx_k_sw_min[] = "sw_min";
1632 static const char __pyx_k_eps_small[] = "eps_small";
1633 static const char __pyx_k_rwork_tol[] = "rwork_tol";
1634 static const char __pyx_k_ImportError[] = "ImportError";
1635 static const char __pyx_k_cpskRelations[] = "cpskRelations";
1636 static const char __pyx_k_vgm_cal_from_sw[] = "vgm_cal_from_sw";
1637 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
1638 static const char __pyx_k_vgm_calc_from_psic[] = "vgm_calc_from_psic";
1639 static const char __pyx_k_proteus_cpskRelations_pyx[] = "proteus/cpskRelations.pyx";
1640 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
1641 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
1642 static PyObject *__pyx_n_s_ImportError;
1643 static PyObject *__pyx_n_s_Sw;
1644 static PyObject *__pyx_n_s_alpha;
1645 static PyObject *__pyx_n_s_cline_in_traceback;
1646 static PyObject *__pyx_n_s_cpskRelations;
1647 static PyObject *__pyx_n_s_eps_small;
1648 static PyObject *__pyx_n_s_import;
1649 static PyObject *__pyx_n_s_m;
1650 static PyObject *__pyx_n_s_main;
1651 static PyObject *__pyx_n_s_name;
1652 static PyObject *__pyx_n_s_np;
1653 static PyObject *__pyx_n_s_ns_del;
1654 static PyObject *__pyx_n_s_numpy;
1655 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
1656 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
1657 static PyObject *__pyx_kp_s_proteus_cpskRelations_pyx;
1658 static PyObject *__pyx_n_s_psic;
1659 static PyObject *__pyx_n_s_psk;
1660 static PyObject *__pyx_n_s_rwork;
1661 static PyObject *__pyx_n_s_rwork_tol;
1662 static PyObject *__pyx_n_s_sw_max;
1663 static PyObject *__pyx_n_s_sw_min;
1664 static PyObject *__pyx_n_s_test;
1665 static PyObject *__pyx_n_s_vgm_cal_from_sw;
1666 static PyObject *__pyx_n_s_vgm_calc_from_psic;
1667 static PyObject *__pyx_pf_13cpskRelations_vgm_cal_from_sw(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_Sw, double __pyx_v_sw_min, double __pyx_v_sw_max, double __pyx_v_alpha, double __pyx_v_m, double __pyx_v_eps_small, double __pyx_v_ns_del); /* proto */
1668 static PyObject *__pyx_pf_13cpskRelations_2vgm_calc_from_psic(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_psic, double __pyx_v_sw_min, double __pyx_v_sw_max, double __pyx_v_alpha, double __pyx_v_m, double __pyx_v_eps_small, double __pyx_v_ns_del); /* proto */
1669 static PyObject *__pyx_tuple_;
1670 static PyObject *__pyx_tuple__2;
1671 static PyObject *__pyx_tuple__3;
1672 static PyObject *__pyx_tuple__5;
1673 static PyObject *__pyx_codeobj__4;
1674 static PyObject *__pyx_codeobj__6;
1675 /* Late includes */
1676 
1677 /* "cpskRelations.pyx":6
1678  * cimport pskRelations
1679  *
1680  * def vgm_cal_from_sw(double Sw, # <<<<<<<<<<<<<<
1681  * double sw_min,
1682  * double sw_max,
1683  */
1684 
1685 /* Python wrapper */
1686 static PyObject *__pyx_pw_13cpskRelations_1vgm_cal_from_sw(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1687 static PyMethodDef __pyx_mdef_13cpskRelations_1vgm_cal_from_sw = {"vgm_cal_from_sw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpskRelations_1vgm_cal_from_sw, METH_VARARGS|METH_KEYWORDS, 0};
1688 static PyObject *__pyx_pw_13cpskRelations_1vgm_cal_from_sw(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1689  double __pyx_v_Sw;
1690  double __pyx_v_sw_min;
1691  double __pyx_v_sw_max;
1692  double __pyx_v_alpha;
1693  double __pyx_v_m;
1694  double __pyx_v_eps_small;
1695  double __pyx_v_ns_del;
1696  int __pyx_lineno = 0;
1697  const char *__pyx_filename = NULL;
1698  int __pyx_clineno = 0;
1699  PyObject *__pyx_r = 0;
1700  __Pyx_RefNannyDeclarations
1701  __Pyx_RefNannySetupContext("vgm_cal_from_sw (wrapper)", 0);
1702  {
1703  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_Sw,&__pyx_n_s_sw_min,&__pyx_n_s_sw_max,&__pyx_n_s_alpha,&__pyx_n_s_m,&__pyx_n_s_eps_small,&__pyx_n_s_ns_del,0};
1704  PyObject* values[7] = {0,0,0,0,0,0,0};
1705  if (unlikely(__pyx_kwds)) {
1706  Py_ssize_t kw_args;
1707  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1708  switch (pos_args) {
1709  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
1710  CYTHON_FALLTHROUGH;
1711  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
1712  CYTHON_FALLTHROUGH;
1713  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
1714  CYTHON_FALLTHROUGH;
1715  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1716  CYTHON_FALLTHROUGH;
1717  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1718  CYTHON_FALLTHROUGH;
1719  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1720  CYTHON_FALLTHROUGH;
1721  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1722  CYTHON_FALLTHROUGH;
1723  case 0: break;
1724  default: goto __pyx_L5_argtuple_error;
1725  }
1726  kw_args = PyDict_Size(__pyx_kwds);
1727  switch (pos_args) {
1728  case 0:
1729  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Sw)) != 0)) kw_args--;
1730  else goto __pyx_L5_argtuple_error;
1731  CYTHON_FALLTHROUGH;
1732  case 1:
1733  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sw_min)) != 0)) kw_args--;
1734  else {
1735  __Pyx_RaiseArgtupleInvalid("vgm_cal_from_sw", 1, 7, 7, 1); __PYX_ERR(0, 6, __pyx_L3_error)
1736  }
1737  CYTHON_FALLTHROUGH;
1738  case 2:
1739  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sw_max)) != 0)) kw_args--;
1740  else {
1741  __Pyx_RaiseArgtupleInvalid("vgm_cal_from_sw", 1, 7, 7, 2); __PYX_ERR(0, 6, __pyx_L3_error)
1742  }
1743  CYTHON_FALLTHROUGH;
1744  case 3:
1745  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
1746  else {
1747  __Pyx_RaiseArgtupleInvalid("vgm_cal_from_sw", 1, 7, 7, 3); __PYX_ERR(0, 6, __pyx_L3_error)
1748  }
1749  CYTHON_FALLTHROUGH;
1750  case 4:
1751  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
1752  else {
1753  __Pyx_RaiseArgtupleInvalid("vgm_cal_from_sw", 1, 7, 7, 4); __PYX_ERR(0, 6, __pyx_L3_error)
1754  }
1755  CYTHON_FALLTHROUGH;
1756  case 5:
1757  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_eps_small)) != 0)) kw_args--;
1758  else {
1759  __Pyx_RaiseArgtupleInvalid("vgm_cal_from_sw", 1, 7, 7, 5); __PYX_ERR(0, 6, __pyx_L3_error)
1760  }
1761  CYTHON_FALLTHROUGH;
1762  case 6:
1763  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ns_del)) != 0)) kw_args--;
1764  else {
1765  __Pyx_RaiseArgtupleInvalid("vgm_cal_from_sw", 1, 7, 7, 6); __PYX_ERR(0, 6, __pyx_L3_error)
1766  }
1767  }
1768  if (unlikely(kw_args > 0)) {
1769  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "vgm_cal_from_sw") < 0)) __PYX_ERR(0, 6, __pyx_L3_error)
1770  }
1771  } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
1772  goto __pyx_L5_argtuple_error;
1773  } else {
1774  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1775  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1776  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1777  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1778  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
1779  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
1780  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
1781  }
1782  __pyx_v_Sw = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_Sw == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 6, __pyx_L3_error)
1783  __pyx_v_sw_min = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_sw_min == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 7, __pyx_L3_error)
1784  __pyx_v_sw_max = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_sw_max == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 8, __pyx_L3_error)
1785  __pyx_v_alpha = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_alpha == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 9, __pyx_L3_error)
1786  __pyx_v_m = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_m == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 10, __pyx_L3_error)
1787  __pyx_v_eps_small = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_eps_small == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 11, __pyx_L3_error)
1788  __pyx_v_ns_del = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_ns_del == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 12, __pyx_L3_error)
1789  }
1790  goto __pyx_L4_argument_unpacking_done;
1791  __pyx_L5_argtuple_error:;
1792  __Pyx_RaiseArgtupleInvalid("vgm_cal_from_sw", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 6, __pyx_L3_error)
1793  __pyx_L3_error:;
1794  __Pyx_AddTraceback("cpskRelations.vgm_cal_from_sw", __pyx_clineno, __pyx_lineno, __pyx_filename);
1795  __Pyx_RefNannyFinishContext();
1796  return NULL;
1797  __pyx_L4_argument_unpacking_done:;
1798  __pyx_r = __pyx_pf_13cpskRelations_vgm_cal_from_sw(__pyx_self, __pyx_v_Sw, __pyx_v_sw_min, __pyx_v_sw_max, __pyx_v_alpha, __pyx_v_m, __pyx_v_eps_small, __pyx_v_ns_del);
1799 
1800  /* function exit code */
1801  __Pyx_RefNannyFinishContext();
1802  return __pyx_r;
1803 }
1804 
1805 static PyObject *__pyx_pf_13cpskRelations_vgm_cal_from_sw(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_Sw, double __pyx_v_sw_min, double __pyx_v_sw_max, double __pyx_v_alpha, double __pyx_v_m, double __pyx_v_eps_small, double __pyx_v_ns_del) {
1806  double __pyx_v_rwork[4];
1807  double __pyx_v_rwork_tol[2];
1808  VGM __pyx_v_psk;
1809  PyObject *__pyx_r = NULL;
1810  __Pyx_RefNannyDeclarations
1811  PyObject *__pyx_t_1 = NULL;
1812  PyObject *__pyx_t_2 = NULL;
1813  PyObject *__pyx_t_3 = NULL;
1814  PyObject *__pyx_t_4 = NULL;
1815  PyObject *__pyx_t_5 = NULL;
1816  PyObject *__pyx_t_6 = NULL;
1817  PyObject *__pyx_t_7 = NULL;
1818  int __pyx_lineno = 0;
1819  const char *__pyx_filename = NULL;
1820  int __pyx_clineno = 0;
1821  __Pyx_RefNannySetupContext("vgm_cal_from_sw", 0);
1822 
1823  /* "cpskRelations.pyx":14
1824  * double ns_del):
1825  * cdef double rwork[4], rwork_tol[2]
1826  * rwork[0]=sw_min # <<<<<<<<<<<<<<
1827  * rwork[1]=sw_max
1828  * rwork[2]=alpha
1829  */
1830  (__pyx_v_rwork[0]) = __pyx_v_sw_min;
1831 
1832  /* "cpskRelations.pyx":15
1833  * cdef double rwork[4], rwork_tol[2]
1834  * rwork[0]=sw_min
1835  * rwork[1]=sw_max # <<<<<<<<<<<<<<
1836  * rwork[2]=alpha
1837  * rwork[3]=m;
1838  */
1839  (__pyx_v_rwork[1]) = __pyx_v_sw_max;
1840 
1841  /* "cpskRelations.pyx":16
1842  * rwork[0]=sw_min
1843  * rwork[1]=sw_max
1844  * rwork[2]=alpha # <<<<<<<<<<<<<<
1845  * rwork[3]=m;
1846  * rwork_tol[0]=eps_small
1847  */
1848  (__pyx_v_rwork[2]) = __pyx_v_alpha;
1849 
1850  /* "cpskRelations.pyx":17
1851  * rwork[1]=sw_max
1852  * rwork[2]=alpha
1853  * rwork[3]=m; # <<<<<<<<<<<<<<
1854  * rwork_tol[0]=eps_small
1855  * rwork_tol[1]=ns_del
1856  */
1857  (__pyx_v_rwork[3]) = __pyx_v_m;
1858 
1859  /* "cpskRelations.pyx":18
1860  * rwork[2]=alpha
1861  * rwork[3]=m;
1862  * rwork_tol[0]=eps_small # <<<<<<<<<<<<<<
1863  * rwork_tol[1]=ns_del
1864  * cdef pskRelations.VGM psk = pskRelations.VGM(rwork)
1865  */
1866  (__pyx_v_rwork_tol[0]) = __pyx_v_eps_small;
1867 
1868  /* "cpskRelations.pyx":19
1869  * rwork[3]=m;
1870  * rwork_tol[0]=eps_small
1871  * rwork_tol[1]=ns_del # <<<<<<<<<<<<<<
1872  * cdef pskRelations.VGM psk = pskRelations.VGM(rwork)
1873  * psk.setTolerances(rwork_tol)
1874  */
1875  (__pyx_v_rwork_tol[1]) = __pyx_v_ns_del;
1876 
1877  /* "cpskRelations.pyx":20
1878  * rwork_tol[0]=eps_small
1879  * rwork_tol[1]=ns_del
1880  * cdef pskRelations.VGM psk = pskRelations.VGM(rwork) # <<<<<<<<<<<<<<
1881  * psk.setTolerances(rwork_tol)
1882  * psk.calc(Sw);
1883  */
1884  __pyx_v_psk = VGM(__pyx_v_rwork);
1885 
1886  /* "cpskRelations.pyx":21
1887  * rwork_tol[1]=ns_del
1888  * cdef pskRelations.VGM psk = pskRelations.VGM(rwork)
1889  * psk.setTolerances(rwork_tol) # <<<<<<<<<<<<<<
1890  * psk.calc(Sw);
1891  * return (psk.psic,psk.krw,psk.krn,psk.dpsic,psk.dkrw,psk.dkrn)
1892  */
1893  __pyx_v_psk.setTolerances(__pyx_v_rwork_tol);
1894 
1895  /* "cpskRelations.pyx":22
1896  * cdef pskRelations.VGM psk = pskRelations.VGM(rwork)
1897  * psk.setTolerances(rwork_tol)
1898  * psk.calc(Sw); # <<<<<<<<<<<<<<
1899  * return (psk.psic,psk.krw,psk.krn,psk.dpsic,psk.dkrw,psk.dkrn)
1900  *
1901  */
1902  __pyx_v_psk.calc(__pyx_v_Sw);
1903 
1904  /* "cpskRelations.pyx":23
1905  * psk.setTolerances(rwork_tol)
1906  * psk.calc(Sw);
1907  * return (psk.psic,psk.krw,psk.krn,psk.dpsic,psk.dkrw,psk.dkrn) # <<<<<<<<<<<<<<
1908  *
1909  * def vgm_calc_from_psic(double psic,
1910  */
1911  __Pyx_XDECREF(__pyx_r);
1912  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_psk.psic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
1913  __Pyx_GOTREF(__pyx_t_1);
1914  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_psk.krw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
1915  __Pyx_GOTREF(__pyx_t_2);
1916  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_psk.krn); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error)
1917  __Pyx_GOTREF(__pyx_t_3);
1918  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_psk.dpsic); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 23, __pyx_L1_error)
1919  __Pyx_GOTREF(__pyx_t_4);
1920  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_psk.dkrw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 23, __pyx_L1_error)
1921  __Pyx_GOTREF(__pyx_t_5);
1922  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_psk.dkrn); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 23, __pyx_L1_error)
1923  __Pyx_GOTREF(__pyx_t_6);
1924  __pyx_t_7 = PyTuple_New(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 23, __pyx_L1_error)
1925  __Pyx_GOTREF(__pyx_t_7);
1926  __Pyx_GIVEREF(__pyx_t_1);
1927  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
1928  __Pyx_GIVEREF(__pyx_t_2);
1929  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
1930  __Pyx_GIVEREF(__pyx_t_3);
1931  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3);
1932  __Pyx_GIVEREF(__pyx_t_4);
1933  PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_4);
1934  __Pyx_GIVEREF(__pyx_t_5);
1935  PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_5);
1936  __Pyx_GIVEREF(__pyx_t_6);
1937  PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_t_6);
1938  __pyx_t_1 = 0;
1939  __pyx_t_2 = 0;
1940  __pyx_t_3 = 0;
1941  __pyx_t_4 = 0;
1942  __pyx_t_5 = 0;
1943  __pyx_t_6 = 0;
1944  __pyx_r = __pyx_t_7;
1945  __pyx_t_7 = 0;
1946  goto __pyx_L0;
1947 
1948  /* "cpskRelations.pyx":6
1949  * cimport pskRelations
1950  *
1951  * def vgm_cal_from_sw(double Sw, # <<<<<<<<<<<<<<
1952  * double sw_min,
1953  * double sw_max,
1954  */
1955 
1956  /* function exit code */
1957  __pyx_L1_error:;
1958  __Pyx_XDECREF(__pyx_t_1);
1959  __Pyx_XDECREF(__pyx_t_2);
1960  __Pyx_XDECREF(__pyx_t_3);
1961  __Pyx_XDECREF(__pyx_t_4);
1962  __Pyx_XDECREF(__pyx_t_5);
1963  __Pyx_XDECREF(__pyx_t_6);
1964  __Pyx_XDECREF(__pyx_t_7);
1965  __Pyx_AddTraceback("cpskRelations.vgm_cal_from_sw", __pyx_clineno, __pyx_lineno, __pyx_filename);
1966  __pyx_r = NULL;
1967  __pyx_L0:;
1968  __Pyx_XGIVEREF(__pyx_r);
1969  __Pyx_RefNannyFinishContext();
1970  return __pyx_r;
1971 }
1972 
1973 /* "cpskRelations.pyx":25
1974  * return (psk.psic,psk.krw,psk.krn,psk.dpsic,psk.dkrw,psk.dkrn)
1975  *
1976  * def vgm_calc_from_psic(double psic, # <<<<<<<<<<<<<<
1977  * double sw_min,
1978  * double sw_max,
1979  */
1980 
1981 /* Python wrapper */
1982 static PyObject *__pyx_pw_13cpskRelations_3vgm_calc_from_psic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1983 static PyMethodDef __pyx_mdef_13cpskRelations_3vgm_calc_from_psic = {"vgm_calc_from_psic", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_13cpskRelations_3vgm_calc_from_psic, METH_VARARGS|METH_KEYWORDS, 0};
1984 static PyObject *__pyx_pw_13cpskRelations_3vgm_calc_from_psic(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1985  double __pyx_v_psic;
1986  double __pyx_v_sw_min;
1987  double __pyx_v_sw_max;
1988  double __pyx_v_alpha;
1989  double __pyx_v_m;
1990  double __pyx_v_eps_small;
1991  double __pyx_v_ns_del;
1992  int __pyx_lineno = 0;
1993  const char *__pyx_filename = NULL;
1994  int __pyx_clineno = 0;
1995  PyObject *__pyx_r = 0;
1996  __Pyx_RefNannyDeclarations
1997  __Pyx_RefNannySetupContext("vgm_calc_from_psic (wrapper)", 0);
1998  {
1999  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_psic,&__pyx_n_s_sw_min,&__pyx_n_s_sw_max,&__pyx_n_s_alpha,&__pyx_n_s_m,&__pyx_n_s_eps_small,&__pyx_n_s_ns_del,0};
2000  PyObject* values[7] = {0,0,0,0,0,0,0};
2001  if (unlikely(__pyx_kwds)) {
2002  Py_ssize_t kw_args;
2003  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2004  switch (pos_args) {
2005  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2006  CYTHON_FALLTHROUGH;
2007  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2008  CYTHON_FALLTHROUGH;
2009  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2010  CYTHON_FALLTHROUGH;
2011  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2012  CYTHON_FALLTHROUGH;
2013  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2014  CYTHON_FALLTHROUGH;
2015  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2016  CYTHON_FALLTHROUGH;
2017  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2018  CYTHON_FALLTHROUGH;
2019  case 0: break;
2020  default: goto __pyx_L5_argtuple_error;
2021  }
2022  kw_args = PyDict_Size(__pyx_kwds);
2023  switch (pos_args) {
2024  case 0:
2025  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_psic)) != 0)) kw_args--;
2026  else goto __pyx_L5_argtuple_error;
2027  CYTHON_FALLTHROUGH;
2028  case 1:
2029  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sw_min)) != 0)) kw_args--;
2030  else {
2031  __Pyx_RaiseArgtupleInvalid("vgm_calc_from_psic", 1, 7, 7, 1); __PYX_ERR(0, 25, __pyx_L3_error)
2032  }
2033  CYTHON_FALLTHROUGH;
2034  case 2:
2035  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sw_max)) != 0)) kw_args--;
2036  else {
2037  __Pyx_RaiseArgtupleInvalid("vgm_calc_from_psic", 1, 7, 7, 2); __PYX_ERR(0, 25, __pyx_L3_error)
2038  }
2039  CYTHON_FALLTHROUGH;
2040  case 3:
2041  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
2042  else {
2043  __Pyx_RaiseArgtupleInvalid("vgm_calc_from_psic", 1, 7, 7, 3); __PYX_ERR(0, 25, __pyx_L3_error)
2044  }
2045  CYTHON_FALLTHROUGH;
2046  case 4:
2047  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
2048  else {
2049  __Pyx_RaiseArgtupleInvalid("vgm_calc_from_psic", 1, 7, 7, 4); __PYX_ERR(0, 25, __pyx_L3_error)
2050  }
2051  CYTHON_FALLTHROUGH;
2052  case 5:
2053  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_eps_small)) != 0)) kw_args--;
2054  else {
2055  __Pyx_RaiseArgtupleInvalid("vgm_calc_from_psic", 1, 7, 7, 5); __PYX_ERR(0, 25, __pyx_L3_error)
2056  }
2057  CYTHON_FALLTHROUGH;
2058  case 6:
2059  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ns_del)) != 0)) kw_args--;
2060  else {
2061  __Pyx_RaiseArgtupleInvalid("vgm_calc_from_psic", 1, 7, 7, 6); __PYX_ERR(0, 25, __pyx_L3_error)
2062  }
2063  }
2064  if (unlikely(kw_args > 0)) {
2065  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "vgm_calc_from_psic") < 0)) __PYX_ERR(0, 25, __pyx_L3_error)
2066  }
2067  } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
2068  goto __pyx_L5_argtuple_error;
2069  } else {
2070  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2071  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2072  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2073  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2074  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2075  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2076  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2077  }
2078  __pyx_v_psic = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_psic == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 25, __pyx_L3_error)
2079  __pyx_v_sw_min = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_sw_min == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 26, __pyx_L3_error)
2080  __pyx_v_sw_max = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_sw_max == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 27, __pyx_L3_error)
2081  __pyx_v_alpha = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_alpha == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L3_error)
2082  __pyx_v_m = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_m == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L3_error)
2083  __pyx_v_eps_small = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_eps_small == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 30, __pyx_L3_error)
2084  __pyx_v_ns_del = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_ns_del == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L3_error)
2085  }
2086  goto __pyx_L4_argument_unpacking_done;
2087  __pyx_L5_argtuple_error:;
2088  __Pyx_RaiseArgtupleInvalid("vgm_calc_from_psic", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 25, __pyx_L3_error)
2089  __pyx_L3_error:;
2090  __Pyx_AddTraceback("cpskRelations.vgm_calc_from_psic", __pyx_clineno, __pyx_lineno, __pyx_filename);
2091  __Pyx_RefNannyFinishContext();
2092  return NULL;
2093  __pyx_L4_argument_unpacking_done:;
2094  __pyx_r = __pyx_pf_13cpskRelations_2vgm_calc_from_psic(__pyx_self, __pyx_v_psic, __pyx_v_sw_min, __pyx_v_sw_max, __pyx_v_alpha, __pyx_v_m, __pyx_v_eps_small, __pyx_v_ns_del);
2095 
2096  /* function exit code */
2097  __Pyx_RefNannyFinishContext();
2098  return __pyx_r;
2099 }
2100 
2101 static PyObject *__pyx_pf_13cpskRelations_2vgm_calc_from_psic(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_psic, double __pyx_v_sw_min, double __pyx_v_sw_max, double __pyx_v_alpha, double __pyx_v_m, double __pyx_v_eps_small, double __pyx_v_ns_del) {
2102  double __pyx_v_rwork[4];
2103  double __pyx_v_rwork_tol[2];
2104  VGM __pyx_v_psk;
2105  PyObject *__pyx_r = NULL;
2106  __Pyx_RefNannyDeclarations
2107  PyObject *__pyx_t_1 = NULL;
2108  PyObject *__pyx_t_2 = NULL;
2109  PyObject *__pyx_t_3 = NULL;
2110  PyObject *__pyx_t_4 = NULL;
2111  PyObject *__pyx_t_5 = NULL;
2112  PyObject *__pyx_t_6 = NULL;
2113  PyObject *__pyx_t_7 = NULL;
2114  int __pyx_lineno = 0;
2115  const char *__pyx_filename = NULL;
2116  int __pyx_clineno = 0;
2117  __Pyx_RefNannySetupContext("vgm_calc_from_psic", 0);
2118 
2119  /* "cpskRelations.pyx":33
2120  * double ns_del):
2121  * cdef double rwork[4],rwork_tol[2];
2122  * rwork[0]=sw_min # <<<<<<<<<<<<<<
2123  * rwork[1]=sw_max
2124  * rwork[2]=alpha
2125  */
2126  (__pyx_v_rwork[0]) = __pyx_v_sw_min;
2127 
2128  /* "cpskRelations.pyx":34
2129  * cdef double rwork[4],rwork_tol[2];
2130  * rwork[0]=sw_min
2131  * rwork[1]=sw_max # <<<<<<<<<<<<<<
2132  * rwork[2]=alpha
2133  * rwork[3]=m;
2134  */
2135  (__pyx_v_rwork[1]) = __pyx_v_sw_max;
2136 
2137  /* "cpskRelations.pyx":35
2138  * rwork[0]=sw_min
2139  * rwork[1]=sw_max
2140  * rwork[2]=alpha # <<<<<<<<<<<<<<
2141  * rwork[3]=m;
2142  * rwork_tol[0]=eps_small
2143  */
2144  (__pyx_v_rwork[2]) = __pyx_v_alpha;
2145 
2146  /* "cpskRelations.pyx":36
2147  * rwork[1]=sw_max
2148  * rwork[2]=alpha
2149  * rwork[3]=m; # <<<<<<<<<<<<<<
2150  * rwork_tol[0]=eps_small
2151  * rwork_tol[1]=ns_del
2152  */
2153  (__pyx_v_rwork[3]) = __pyx_v_m;
2154 
2155  /* "cpskRelations.pyx":37
2156  * rwork[2]=alpha
2157  * rwork[3]=m;
2158  * rwork_tol[0]=eps_small # <<<<<<<<<<<<<<
2159  * rwork_tol[1]=ns_del
2160  * cdef pskRelations.VGM psk = pskRelations.VGM(rwork)
2161  */
2162  (__pyx_v_rwork_tol[0]) = __pyx_v_eps_small;
2163 
2164  /* "cpskRelations.pyx":38
2165  * rwork[3]=m;
2166  * rwork_tol[0]=eps_small
2167  * rwork_tol[1]=ns_del # <<<<<<<<<<<<<<
2168  * cdef pskRelations.VGM psk = pskRelations.VGM(rwork)
2169  * psk.setTolerances(rwork_tol)
2170  */
2171  (__pyx_v_rwork_tol[1]) = __pyx_v_ns_del;
2172 
2173  /* "cpskRelations.pyx":39
2174  * rwork_tol[0]=eps_small
2175  * rwork_tol[1]=ns_del
2176  * cdef pskRelations.VGM psk = pskRelations.VGM(rwork) # <<<<<<<<<<<<<<
2177  * psk.setTolerances(rwork_tol)
2178  * psk.calc_from_psic(psic)
2179  */
2180  __pyx_v_psk = VGM(__pyx_v_rwork);
2181 
2182  /* "cpskRelations.pyx":40
2183  * rwork_tol[1]=ns_del
2184  * cdef pskRelations.VGM psk = pskRelations.VGM(rwork)
2185  * psk.setTolerances(rwork_tol) # <<<<<<<<<<<<<<
2186  * psk.calc_from_psic(psic)
2187  * return (psk.Se,psk.krw,psk.krn,psk.dSe_dpsic,psk.dkrw,psk.dkrn)
2188  */
2189  __pyx_v_psk.setTolerances(__pyx_v_rwork_tol);
2190 
2191  /* "cpskRelations.pyx":41
2192  * cdef pskRelations.VGM psk = pskRelations.VGM(rwork)
2193  * psk.setTolerances(rwork_tol)
2194  * psk.calc_from_psic(psic) # <<<<<<<<<<<<<<
2195  * return (psk.Se,psk.krw,psk.krn,psk.dSe_dpsic,psk.dkrw,psk.dkrn)
2196  */
2197  __pyx_v_psk.calc_from_psic(__pyx_v_psic);
2198 
2199  /* "cpskRelations.pyx":42
2200  * psk.setTolerances(rwork_tol)
2201  * psk.calc_from_psic(psic)
2202  * return (psk.Se,psk.krw,psk.krn,psk.dSe_dpsic,psk.dkrw,psk.dkrn) # <<<<<<<<<<<<<<
2203  */
2204  __Pyx_XDECREF(__pyx_r);
2205  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_psk.Se); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
2206  __Pyx_GOTREF(__pyx_t_1);
2207  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_psk.krw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
2208  __Pyx_GOTREF(__pyx_t_2);
2209  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_psk.krn); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
2210  __Pyx_GOTREF(__pyx_t_3);
2211  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_psk.dSe_dpsic); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 42, __pyx_L1_error)
2212  __Pyx_GOTREF(__pyx_t_4);
2213  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_psk.dkrw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error)
2214  __Pyx_GOTREF(__pyx_t_5);
2215  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_psk.dkrn); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 42, __pyx_L1_error)
2216  __Pyx_GOTREF(__pyx_t_6);
2217  __pyx_t_7 = PyTuple_New(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 42, __pyx_L1_error)
2218  __Pyx_GOTREF(__pyx_t_7);
2219  __Pyx_GIVEREF(__pyx_t_1);
2220  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
2221  __Pyx_GIVEREF(__pyx_t_2);
2222  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
2223  __Pyx_GIVEREF(__pyx_t_3);
2224  PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3);
2225  __Pyx_GIVEREF(__pyx_t_4);
2226  PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_4);
2227  __Pyx_GIVEREF(__pyx_t_5);
2228  PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_5);
2229  __Pyx_GIVEREF(__pyx_t_6);
2230  PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_t_6);
2231  __pyx_t_1 = 0;
2232  __pyx_t_2 = 0;
2233  __pyx_t_3 = 0;
2234  __pyx_t_4 = 0;
2235  __pyx_t_5 = 0;
2236  __pyx_t_6 = 0;
2237  __pyx_r = __pyx_t_7;
2238  __pyx_t_7 = 0;
2239  goto __pyx_L0;
2240 
2241  /* "cpskRelations.pyx":25
2242  * return (psk.psic,psk.krw,psk.krn,psk.dpsic,psk.dkrw,psk.dkrn)
2243  *
2244  * def vgm_calc_from_psic(double psic, # <<<<<<<<<<<<<<
2245  * double sw_min,
2246  * double sw_max,
2247  */
2248 
2249  /* function exit code */
2250  __pyx_L1_error:;
2251  __Pyx_XDECREF(__pyx_t_1);
2252  __Pyx_XDECREF(__pyx_t_2);
2253  __Pyx_XDECREF(__pyx_t_3);
2254  __Pyx_XDECREF(__pyx_t_4);
2255  __Pyx_XDECREF(__pyx_t_5);
2256  __Pyx_XDECREF(__pyx_t_6);
2257  __Pyx_XDECREF(__pyx_t_7);
2258  __Pyx_AddTraceback("cpskRelations.vgm_calc_from_psic", __pyx_clineno, __pyx_lineno, __pyx_filename);
2259  __pyx_r = NULL;
2260  __pyx_L0:;
2261  __Pyx_XGIVEREF(__pyx_r);
2262  __Pyx_RefNannyFinishContext();
2263  return __pyx_r;
2264 }
2265 
2266 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":735
2267  * ctypedef npy_cdouble complex_t
2268  *
2269  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
2270  * return PyArray_MultiIterNew(1, <void*>a)
2271  *
2272  */
2273 
2274 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
2275  PyObject *__pyx_r = NULL;
2276  __Pyx_RefNannyDeclarations
2277  PyObject *__pyx_t_1 = NULL;
2278  int __pyx_lineno = 0;
2279  const char *__pyx_filename = NULL;
2280  int __pyx_clineno = 0;
2281  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
2282 
2283  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":736
2284  *
2285  * cdef inline object PyArray_MultiIterNew1(a):
2286  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
2287  *
2288  * cdef inline object PyArray_MultiIterNew2(a, b):
2289  */
2290  __Pyx_XDECREF(__pyx_r);
2291  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 736, __pyx_L1_error)
2292  __Pyx_GOTREF(__pyx_t_1);
2293  __pyx_r = __pyx_t_1;
2294  __pyx_t_1 = 0;
2295  goto __pyx_L0;
2296 
2297  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":735
2298  * ctypedef npy_cdouble complex_t
2299  *
2300  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
2301  * return PyArray_MultiIterNew(1, <void*>a)
2302  *
2303  */
2304 
2305  /* function exit code */
2306  __pyx_L1_error:;
2307  __Pyx_XDECREF(__pyx_t_1);
2308  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
2309  __pyx_r = 0;
2310  __pyx_L0:;
2311  __Pyx_XGIVEREF(__pyx_r);
2312  __Pyx_RefNannyFinishContext();
2313  return __pyx_r;
2314 }
2315 
2316 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":738
2317  * return PyArray_MultiIterNew(1, <void*>a)
2318  *
2319  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
2320  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
2321  *
2322  */
2323 
2324 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
2325  PyObject *__pyx_r = NULL;
2326  __Pyx_RefNannyDeclarations
2327  PyObject *__pyx_t_1 = NULL;
2328  int __pyx_lineno = 0;
2329  const char *__pyx_filename = NULL;
2330  int __pyx_clineno = 0;
2331  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
2332 
2333  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":739
2334  *
2335  * cdef inline object PyArray_MultiIterNew2(a, b):
2336  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
2337  *
2338  * cdef inline object PyArray_MultiIterNew3(a, b, c):
2339  */
2340  __Pyx_XDECREF(__pyx_r);
2341  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 739, __pyx_L1_error)
2342  __Pyx_GOTREF(__pyx_t_1);
2343  __pyx_r = __pyx_t_1;
2344  __pyx_t_1 = 0;
2345  goto __pyx_L0;
2346 
2347  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":738
2348  * return PyArray_MultiIterNew(1, <void*>a)
2349  *
2350  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
2351  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
2352  *
2353  */
2354 
2355  /* function exit code */
2356  __pyx_L1_error:;
2357  __Pyx_XDECREF(__pyx_t_1);
2358  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
2359  __pyx_r = 0;
2360  __pyx_L0:;
2361  __Pyx_XGIVEREF(__pyx_r);
2362  __Pyx_RefNannyFinishContext();
2363  return __pyx_r;
2364 }
2365 
2366 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":741
2367  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
2368  *
2369  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
2370  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
2371  *
2372  */
2373 
2374 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
2375  PyObject *__pyx_r = NULL;
2376  __Pyx_RefNannyDeclarations
2377  PyObject *__pyx_t_1 = NULL;
2378  int __pyx_lineno = 0;
2379  const char *__pyx_filename = NULL;
2380  int __pyx_clineno = 0;
2381  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
2382 
2383  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":742
2384  *
2385  * cdef inline object PyArray_MultiIterNew3(a, b, c):
2386  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
2387  *
2388  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
2389  */
2390  __Pyx_XDECREF(__pyx_r);
2391  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 742, __pyx_L1_error)
2392  __Pyx_GOTREF(__pyx_t_1);
2393  __pyx_r = __pyx_t_1;
2394  __pyx_t_1 = 0;
2395  goto __pyx_L0;
2396 
2397  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":741
2398  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
2399  *
2400  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
2401  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
2402  *
2403  */
2404 
2405  /* function exit code */
2406  __pyx_L1_error:;
2407  __Pyx_XDECREF(__pyx_t_1);
2408  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
2409  __pyx_r = 0;
2410  __pyx_L0:;
2411  __Pyx_XGIVEREF(__pyx_r);
2412  __Pyx_RefNannyFinishContext();
2413  return __pyx_r;
2414 }
2415 
2416 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":744
2417  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
2418  *
2419  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
2420  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
2421  *
2422  */
2423 
2424 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
2425  PyObject *__pyx_r = NULL;
2426  __Pyx_RefNannyDeclarations
2427  PyObject *__pyx_t_1 = NULL;
2428  int __pyx_lineno = 0;
2429  const char *__pyx_filename = NULL;
2430  int __pyx_clineno = 0;
2431  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
2432 
2433  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":745
2434  *
2435  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
2436  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
2437  *
2438  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
2439  */
2440  __Pyx_XDECREF(__pyx_r);
2441  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 745, __pyx_L1_error)
2442  __Pyx_GOTREF(__pyx_t_1);
2443  __pyx_r = __pyx_t_1;
2444  __pyx_t_1 = 0;
2445  goto __pyx_L0;
2446 
2447  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":744
2448  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
2449  *
2450  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
2451  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
2452  *
2453  */
2454 
2455  /* function exit code */
2456  __pyx_L1_error:;
2457  __Pyx_XDECREF(__pyx_t_1);
2458  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
2459  __pyx_r = 0;
2460  __pyx_L0:;
2461  __Pyx_XGIVEREF(__pyx_r);
2462  __Pyx_RefNannyFinishContext();
2463  return __pyx_r;
2464 }
2465 
2466 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":747
2467  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
2468  *
2469  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
2470  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
2471  *
2472  */
2473 
2474 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
2475  PyObject *__pyx_r = NULL;
2476  __Pyx_RefNannyDeclarations
2477  PyObject *__pyx_t_1 = NULL;
2478  int __pyx_lineno = 0;
2479  const char *__pyx_filename = NULL;
2480  int __pyx_clineno = 0;
2481  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
2482 
2483  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":748
2484  *
2485  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
2486  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
2487  *
2488  * cdef inline tuple PyDataType_SHAPE(dtype d):
2489  */
2490  __Pyx_XDECREF(__pyx_r);
2491  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 748, __pyx_L1_error)
2492  __Pyx_GOTREF(__pyx_t_1);
2493  __pyx_r = __pyx_t_1;
2494  __pyx_t_1 = 0;
2495  goto __pyx_L0;
2496 
2497  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":747
2498  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
2499  *
2500  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
2501  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
2502  *
2503  */
2504 
2505  /* function exit code */
2506  __pyx_L1_error:;
2507  __Pyx_XDECREF(__pyx_t_1);
2508  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
2509  __pyx_r = 0;
2510  __pyx_L0:;
2511  __Pyx_XGIVEREF(__pyx_r);
2512  __Pyx_RefNannyFinishContext();
2513  return __pyx_r;
2514 }
2515 
2516 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":750
2517  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
2518  *
2519  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
2520  * if PyDataType_HASSUBARRAY(d):
2521  * return <tuple>d.subarray.shape
2522  */
2523 
2524 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
2525  PyObject *__pyx_r = NULL;
2526  __Pyx_RefNannyDeclarations
2527  int __pyx_t_1;
2528  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
2529 
2530  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":751
2531  *
2532  * cdef inline tuple PyDataType_SHAPE(dtype d):
2533  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
2534  * return <tuple>d.subarray.shape
2535  * else:
2536  */
2537  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
2538  if (__pyx_t_1) {
2539 
2540  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":752
2541  * cdef inline tuple PyDataType_SHAPE(dtype d):
2542  * if PyDataType_HASSUBARRAY(d):
2543  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
2544  * else:
2545  * return ()
2546  */
2547  __Pyx_XDECREF(__pyx_r);
2548  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
2549  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
2550  goto __pyx_L0;
2551 
2552  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":751
2553  *
2554  * cdef inline tuple PyDataType_SHAPE(dtype d):
2555  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
2556  * return <tuple>d.subarray.shape
2557  * else:
2558  */
2559  }
2560 
2561  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":754
2562  * return <tuple>d.subarray.shape
2563  * else:
2564  * return () # <<<<<<<<<<<<<<
2565  *
2566  *
2567  */
2568  /*else*/ {
2569  __Pyx_XDECREF(__pyx_r);
2570  __Pyx_INCREF(__pyx_empty_tuple);
2571  __pyx_r = __pyx_empty_tuple;
2572  goto __pyx_L0;
2573  }
2574 
2575  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":750
2576  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
2577  *
2578  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
2579  * if PyDataType_HASSUBARRAY(d):
2580  * return <tuple>d.subarray.shape
2581  */
2582 
2583  /* function exit code */
2584  __pyx_L0:;
2585  __Pyx_XGIVEREF(__pyx_r);
2586  __Pyx_RefNannyFinishContext();
2587  return __pyx_r;
2588 }
2589 
2590 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":929
2591  * int _import_umath() except -1
2592  *
2593  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
2594  * Py_INCREF(base) # important to do this before stealing the reference below!
2595  * PyArray_SetBaseObject(arr, base)
2596  */
2597 
2598 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
2599  __Pyx_RefNannyDeclarations
2600  __Pyx_RefNannySetupContext("set_array_base", 0);
2601 
2602  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":930
2603  *
2604  * cdef inline void set_array_base(ndarray arr, object base):
2605  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
2606  * PyArray_SetBaseObject(arr, base)
2607  *
2608  */
2609  Py_INCREF(__pyx_v_base);
2610 
2611  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":931
2612  * cdef inline void set_array_base(ndarray arr, object base):
2613  * Py_INCREF(base) # important to do this before stealing the reference below!
2614  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
2615  *
2616  * cdef inline object get_array_base(ndarray arr):
2617  */
2618  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
2619 
2620  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":929
2621  * int _import_umath() except -1
2622  *
2623  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
2624  * Py_INCREF(base) # important to do this before stealing the reference below!
2625  * PyArray_SetBaseObject(arr, base)
2626  */
2627 
2628  /* function exit code */
2629  __Pyx_RefNannyFinishContext();
2630 }
2631 
2632 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":933
2633  * PyArray_SetBaseObject(arr, base)
2634  *
2635  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
2636  * base = PyArray_BASE(arr)
2637  * if base is NULL:
2638  */
2639 
2640 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
2641  PyObject *__pyx_v_base;
2642  PyObject *__pyx_r = NULL;
2643  __Pyx_RefNannyDeclarations
2644  int __pyx_t_1;
2645  __Pyx_RefNannySetupContext("get_array_base", 0);
2646 
2647  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":934
2648  *
2649  * cdef inline object get_array_base(ndarray arr):
2650  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
2651  * if base is NULL:
2652  * return None
2653  */
2654  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
2655 
2656  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":935
2657  * cdef inline object get_array_base(ndarray arr):
2658  * base = PyArray_BASE(arr)
2659  * if base is NULL: # <<<<<<<<<<<<<<
2660  * return None
2661  * return <object>base
2662  */
2663  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
2664  if (__pyx_t_1) {
2665 
2666  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":936
2667  * base = PyArray_BASE(arr)
2668  * if base is NULL:
2669  * return None # <<<<<<<<<<<<<<
2670  * return <object>base
2671  *
2672  */
2673  __Pyx_XDECREF(__pyx_r);
2674  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2675  goto __pyx_L0;
2676 
2677  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":935
2678  * cdef inline object get_array_base(ndarray arr):
2679  * base = PyArray_BASE(arr)
2680  * if base is NULL: # <<<<<<<<<<<<<<
2681  * return None
2682  * return <object>base
2683  */
2684  }
2685 
2686  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":937
2687  * if base is NULL:
2688  * return None
2689  * return <object>base # <<<<<<<<<<<<<<
2690  *
2691  * # Versions of the import_* functions which are more suitable for
2692  */
2693  __Pyx_XDECREF(__pyx_r);
2694  __Pyx_INCREF(((PyObject *)__pyx_v_base));
2695  __pyx_r = ((PyObject *)__pyx_v_base);
2696  goto __pyx_L0;
2697 
2698  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":933
2699  * PyArray_SetBaseObject(arr, base)
2700  *
2701  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
2702  * base = PyArray_BASE(arr)
2703  * if base is NULL:
2704  */
2705 
2706  /* function exit code */
2707  __pyx_L0:;
2708  __Pyx_XGIVEREF(__pyx_r);
2709  __Pyx_RefNannyFinishContext();
2710  return __pyx_r;
2711 }
2712 
2713 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":941
2714  * # Versions of the import_* functions which are more suitable for
2715  * # Cython code.
2716  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
2717  * try:
2718  * __pyx_import_array()
2719  */
2720 
2721 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
2722  int __pyx_r;
2723  __Pyx_RefNannyDeclarations
2724  PyObject *__pyx_t_1 = NULL;
2725  PyObject *__pyx_t_2 = NULL;
2726  PyObject *__pyx_t_3 = NULL;
2727  int __pyx_t_4;
2728  PyObject *__pyx_t_5 = NULL;
2729  PyObject *__pyx_t_6 = NULL;
2730  PyObject *__pyx_t_7 = NULL;
2731  PyObject *__pyx_t_8 = NULL;
2732  int __pyx_lineno = 0;
2733  const char *__pyx_filename = NULL;
2734  int __pyx_clineno = 0;
2735  __Pyx_RefNannySetupContext("import_array", 0);
2736 
2737  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
2738  * # Cython code.
2739  * cdef inline int import_array() except -1:
2740  * try: # <<<<<<<<<<<<<<
2741  * __pyx_import_array()
2742  * except Exception:
2743  */
2744  {
2745  __Pyx_PyThreadState_declare
2746  __Pyx_PyThreadState_assign
2747  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
2748  __Pyx_XGOTREF(__pyx_t_1);
2749  __Pyx_XGOTREF(__pyx_t_2);
2750  __Pyx_XGOTREF(__pyx_t_3);
2751  /*try:*/ {
2752 
2753  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":943
2754  * cdef inline int import_array() except -1:
2755  * try:
2756  * __pyx_import_array() # <<<<<<<<<<<<<<
2757  * except Exception:
2758  * raise ImportError("numpy.core.multiarray failed to import")
2759  */
2760  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 943, __pyx_L3_error)
2761 
2762  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
2763  * # Cython code.
2764  * cdef inline int import_array() except -1:
2765  * try: # <<<<<<<<<<<<<<
2766  * __pyx_import_array()
2767  * except Exception:
2768  */
2769  }
2770  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
2771  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
2772  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
2773  goto __pyx_L8_try_end;
2774  __pyx_L3_error:;
2775 
2776  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":944
2777  * try:
2778  * __pyx_import_array()
2779  * except Exception: # <<<<<<<<<<<<<<
2780  * raise ImportError("numpy.core.multiarray failed to import")
2781  *
2782  */
2783  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
2784  if (__pyx_t_4) {
2785  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
2786  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 944, __pyx_L5_except_error)
2787  __Pyx_GOTREF(__pyx_t_5);
2788  __Pyx_GOTREF(__pyx_t_6);
2789  __Pyx_GOTREF(__pyx_t_7);
2790 
2791  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":945
2792  * __pyx_import_array()
2793  * except Exception:
2794  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
2795  *
2796  * cdef inline int import_umath() except -1:
2797  */
2798  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 945, __pyx_L5_except_error)
2799  __Pyx_GOTREF(__pyx_t_8);
2800  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
2801  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2802  __PYX_ERR(1, 945, __pyx_L5_except_error)
2803  }
2804  goto __pyx_L5_except_error;
2805  __pyx_L5_except_error:;
2806 
2807  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":942
2808  * # Cython code.
2809  * cdef inline int import_array() except -1:
2810  * try: # <<<<<<<<<<<<<<
2811  * __pyx_import_array()
2812  * except Exception:
2813  */
2814  __Pyx_XGIVEREF(__pyx_t_1);
2815  __Pyx_XGIVEREF(__pyx_t_2);
2816  __Pyx_XGIVEREF(__pyx_t_3);
2817  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
2818  goto __pyx_L1_error;
2819  __pyx_L8_try_end:;
2820  }
2821 
2822  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":941
2823  * # Versions of the import_* functions which are more suitable for
2824  * # Cython code.
2825  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
2826  * try:
2827  * __pyx_import_array()
2828  */
2829 
2830  /* function exit code */
2831  __pyx_r = 0;
2832  goto __pyx_L0;
2833  __pyx_L1_error:;
2834  __Pyx_XDECREF(__pyx_t_5);
2835  __Pyx_XDECREF(__pyx_t_6);
2836  __Pyx_XDECREF(__pyx_t_7);
2837  __Pyx_XDECREF(__pyx_t_8);
2838  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
2839  __pyx_r = -1;
2840  __pyx_L0:;
2841  __Pyx_RefNannyFinishContext();
2842  return __pyx_r;
2843 }
2844 
2845 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":947
2846  * raise ImportError("numpy.core.multiarray failed to import")
2847  *
2848  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
2849  * try:
2850  * _import_umath()
2851  */
2852 
2853 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
2854  int __pyx_r;
2855  __Pyx_RefNannyDeclarations
2856  PyObject *__pyx_t_1 = NULL;
2857  PyObject *__pyx_t_2 = NULL;
2858  PyObject *__pyx_t_3 = NULL;
2859  int __pyx_t_4;
2860  PyObject *__pyx_t_5 = NULL;
2861  PyObject *__pyx_t_6 = NULL;
2862  PyObject *__pyx_t_7 = NULL;
2863  PyObject *__pyx_t_8 = NULL;
2864  int __pyx_lineno = 0;
2865  const char *__pyx_filename = NULL;
2866  int __pyx_clineno = 0;
2867  __Pyx_RefNannySetupContext("import_umath", 0);
2868 
2869  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
2870  *
2871  * cdef inline int import_umath() except -1:
2872  * try: # <<<<<<<<<<<<<<
2873  * _import_umath()
2874  * except Exception:
2875  */
2876  {
2877  __Pyx_PyThreadState_declare
2878  __Pyx_PyThreadState_assign
2879  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
2880  __Pyx_XGOTREF(__pyx_t_1);
2881  __Pyx_XGOTREF(__pyx_t_2);
2882  __Pyx_XGOTREF(__pyx_t_3);
2883  /*try:*/ {
2884 
2885  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":949
2886  * cdef inline int import_umath() except -1:
2887  * try:
2888  * _import_umath() # <<<<<<<<<<<<<<
2889  * except Exception:
2890  * raise ImportError("numpy.core.umath failed to import")
2891  */
2892  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 949, __pyx_L3_error)
2893 
2894  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
2895  *
2896  * cdef inline int import_umath() except -1:
2897  * try: # <<<<<<<<<<<<<<
2898  * _import_umath()
2899  * except Exception:
2900  */
2901  }
2902  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
2903  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
2904  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
2905  goto __pyx_L8_try_end;
2906  __pyx_L3_error:;
2907 
2908  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":950
2909  * try:
2910  * _import_umath()
2911  * except Exception: # <<<<<<<<<<<<<<
2912  * raise ImportError("numpy.core.umath failed to import")
2913  *
2914  */
2915  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
2916  if (__pyx_t_4) {
2917  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
2918  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 950, __pyx_L5_except_error)
2919  __Pyx_GOTREF(__pyx_t_5);
2920  __Pyx_GOTREF(__pyx_t_6);
2921  __Pyx_GOTREF(__pyx_t_7);
2922 
2923  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":951
2924  * _import_umath()
2925  * except Exception:
2926  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
2927  *
2928  * cdef inline int import_ufunc() except -1:
2929  */
2930  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 951, __pyx_L5_except_error)
2931  __Pyx_GOTREF(__pyx_t_8);
2932  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
2933  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2934  __PYX_ERR(1, 951, __pyx_L5_except_error)
2935  }
2936  goto __pyx_L5_except_error;
2937  __pyx_L5_except_error:;
2938 
2939  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":948
2940  *
2941  * cdef inline int import_umath() except -1:
2942  * try: # <<<<<<<<<<<<<<
2943  * _import_umath()
2944  * except Exception:
2945  */
2946  __Pyx_XGIVEREF(__pyx_t_1);
2947  __Pyx_XGIVEREF(__pyx_t_2);
2948  __Pyx_XGIVEREF(__pyx_t_3);
2949  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
2950  goto __pyx_L1_error;
2951  __pyx_L8_try_end:;
2952  }
2953 
2954  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":947
2955  * raise ImportError("numpy.core.multiarray failed to import")
2956  *
2957  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
2958  * try:
2959  * _import_umath()
2960  */
2961 
2962  /* function exit code */
2963  __pyx_r = 0;
2964  goto __pyx_L0;
2965  __pyx_L1_error:;
2966  __Pyx_XDECREF(__pyx_t_5);
2967  __Pyx_XDECREF(__pyx_t_6);
2968  __Pyx_XDECREF(__pyx_t_7);
2969  __Pyx_XDECREF(__pyx_t_8);
2970  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
2971  __pyx_r = -1;
2972  __pyx_L0:;
2973  __Pyx_RefNannyFinishContext();
2974  return __pyx_r;
2975 }
2976 
2977 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":953
2978  * raise ImportError("numpy.core.umath failed to import")
2979  *
2980  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
2981  * try:
2982  * _import_umath()
2983  */
2984 
2985 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
2986  int __pyx_r;
2987  __Pyx_RefNannyDeclarations
2988  PyObject *__pyx_t_1 = NULL;
2989  PyObject *__pyx_t_2 = NULL;
2990  PyObject *__pyx_t_3 = NULL;
2991  int __pyx_t_4;
2992  PyObject *__pyx_t_5 = NULL;
2993  PyObject *__pyx_t_6 = NULL;
2994  PyObject *__pyx_t_7 = NULL;
2995  PyObject *__pyx_t_8 = NULL;
2996  int __pyx_lineno = 0;
2997  const char *__pyx_filename = NULL;
2998  int __pyx_clineno = 0;
2999  __Pyx_RefNannySetupContext("import_ufunc", 0);
3000 
3001  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
3002  *
3003  * cdef inline int import_ufunc() except -1:
3004  * try: # <<<<<<<<<<<<<<
3005  * _import_umath()
3006  * except Exception:
3007  */
3008  {
3009  __Pyx_PyThreadState_declare
3010  __Pyx_PyThreadState_assign
3011  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
3012  __Pyx_XGOTREF(__pyx_t_1);
3013  __Pyx_XGOTREF(__pyx_t_2);
3014  __Pyx_XGOTREF(__pyx_t_3);
3015  /*try:*/ {
3016 
3017  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":955
3018  * cdef inline int import_ufunc() except -1:
3019  * try:
3020  * _import_umath() # <<<<<<<<<<<<<<
3021  * except Exception:
3022  * raise ImportError("numpy.core.umath failed to import")
3023  */
3024  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 955, __pyx_L3_error)
3025 
3026  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
3027  *
3028  * cdef inline int import_ufunc() except -1:
3029  * try: # <<<<<<<<<<<<<<
3030  * _import_umath()
3031  * except Exception:
3032  */
3033  }
3034  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3035  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3036  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3037  goto __pyx_L8_try_end;
3038  __pyx_L3_error:;
3039 
3040  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":956
3041  * try:
3042  * _import_umath()
3043  * except Exception: # <<<<<<<<<<<<<<
3044  * raise ImportError("numpy.core.umath failed to import")
3045  *
3046  */
3047  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
3048  if (__pyx_t_4) {
3049  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
3050  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 956, __pyx_L5_except_error)
3051  __Pyx_GOTREF(__pyx_t_5);
3052  __Pyx_GOTREF(__pyx_t_6);
3053  __Pyx_GOTREF(__pyx_t_7);
3054 
3055  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":957
3056  * _import_umath()
3057  * except Exception:
3058  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
3059  *
3060  * cdef extern from *:
3061  */
3062  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 957, __pyx_L5_except_error)
3063  __Pyx_GOTREF(__pyx_t_8);
3064  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
3065  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3066  __PYX_ERR(1, 957, __pyx_L5_except_error)
3067  }
3068  goto __pyx_L5_except_error;
3069  __pyx_L5_except_error:;
3070 
3071  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":954
3072  *
3073  * cdef inline int import_ufunc() except -1:
3074  * try: # <<<<<<<<<<<<<<
3075  * _import_umath()
3076  * except Exception:
3077  */
3078  __Pyx_XGIVEREF(__pyx_t_1);
3079  __Pyx_XGIVEREF(__pyx_t_2);
3080  __Pyx_XGIVEREF(__pyx_t_3);
3081  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
3082  goto __pyx_L1_error;
3083  __pyx_L8_try_end:;
3084  }
3085 
3086  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":953
3087  * raise ImportError("numpy.core.umath failed to import")
3088  *
3089  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
3090  * try:
3091  * _import_umath()
3092  */
3093 
3094  /* function exit code */
3095  __pyx_r = 0;
3096  goto __pyx_L0;
3097  __pyx_L1_error:;
3098  __Pyx_XDECREF(__pyx_t_5);
3099  __Pyx_XDECREF(__pyx_t_6);
3100  __Pyx_XDECREF(__pyx_t_7);
3101  __Pyx_XDECREF(__pyx_t_8);
3102  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
3103  __pyx_r = -1;
3104  __pyx_L0:;
3105  __Pyx_RefNannyFinishContext();
3106  return __pyx_r;
3107 }
3108 
3109 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":967
3110  *
3111  *
3112  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
3113  * """
3114  * Cython equivalent of `isinstance(obj, np.timedelta64)`
3115  */
3116 
3117 static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
3118  int __pyx_r;
3119  __Pyx_RefNannyDeclarations
3120  __Pyx_RefNannySetupContext("is_timedelta64_object", 0);
3121 
3122  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":979
3123  * bool
3124  * """
3125  * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
3126  *
3127  *
3128  */
3129  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
3130  goto __pyx_L0;
3131 
3132  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":967
3133  *
3134  *
3135  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
3136  * """
3137  * Cython equivalent of `isinstance(obj, np.timedelta64)`
3138  */
3139 
3140  /* function exit code */
3141  __pyx_L0:;
3142  __Pyx_RefNannyFinishContext();
3143  return __pyx_r;
3144 }
3145 
3146 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":982
3147  *
3148  *
3149  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
3150  * """
3151  * Cython equivalent of `isinstance(obj, np.datetime64)`
3152  */
3153 
3154 static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
3155  int __pyx_r;
3156  __Pyx_RefNannyDeclarations
3157  __Pyx_RefNannySetupContext("is_datetime64_object", 0);
3158 
3159  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":994
3160  * bool
3161  * """
3162  * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
3163  *
3164  *
3165  */
3166  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
3167  goto __pyx_L0;
3168 
3169  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":982
3170  *
3171  *
3172  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
3173  * """
3174  * Cython equivalent of `isinstance(obj, np.datetime64)`
3175  */
3176 
3177  /* function exit code */
3178  __pyx_L0:;
3179  __Pyx_RefNannyFinishContext();
3180  return __pyx_r;
3181 }
3182 
3183 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":997
3184  *
3185  *
3186  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
3187  * """
3188  * returns the int64 value underlying scalar numpy datetime64 object
3189  */
3190 
3191 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
3192  npy_datetime __pyx_r;
3193 
3194  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1004
3195  * also needed. That can be found using `get_datetime64_unit`.
3196  * """
3197  * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
3198  *
3199  *
3200  */
3201  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
3202  goto __pyx_L0;
3203 
3204  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":997
3205  *
3206  *
3207  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
3208  * """
3209  * returns the int64 value underlying scalar numpy datetime64 object
3210  */
3211 
3212  /* function exit code */
3213  __pyx_L0:;
3214  return __pyx_r;
3215 }
3216 
3217 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1007
3218  *
3219  *
3220  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
3221  * """
3222  * returns the int64 value underlying scalar numpy timedelta64 object
3223  */
3224 
3225 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
3226  npy_timedelta __pyx_r;
3227 
3228  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1011
3229  * returns the int64 value underlying scalar numpy timedelta64 object
3230  * """
3231  * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
3232  *
3233  *
3234  */
3235  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
3236  goto __pyx_L0;
3237 
3238  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1007
3239  *
3240  *
3241  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
3242  * """
3243  * returns the int64 value underlying scalar numpy timedelta64 object
3244  */
3245 
3246  /* function exit code */
3247  __pyx_L0:;
3248  return __pyx_r;
3249 }
3250 
3251 /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
3252  *
3253  *
3254  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
3255  * """
3256  * returns the unit part of the dtype for a numpy datetime64 object.
3257  */
3258 
3259 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
3260  NPY_DATETIMEUNIT __pyx_r;
3261 
3262  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1018
3263  * returns the unit part of the dtype for a numpy datetime64 object.
3264  * """
3265  * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
3266  */
3267  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
3268  goto __pyx_L0;
3269 
3270  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
3271  *
3272  *
3273  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
3274  * """
3275  * returns the unit part of the dtype for a numpy datetime64 object.
3276  */
3277 
3278  /* function exit code */
3279  __pyx_L0:;
3280  return __pyx_r;
3281 }
3282 
3283 static PyMethodDef __pyx_methods[] = {
3284  {0, 0, 0, 0}
3285 };
3286 
3287 #if PY_MAJOR_VERSION >= 3
3288 #if CYTHON_PEP489_MULTI_PHASE_INIT
3289 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
3290 static int __pyx_pymod_exec_cpskRelations(PyObject* module); /*proto*/
3291 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
3292  {Py_mod_create, (void*)__pyx_pymod_create},
3293  {Py_mod_exec, (void*)__pyx_pymod_exec_cpskRelations},
3294  {0, NULL}
3295 };
3296 #endif
3297 
3298 static struct PyModuleDef __pyx_moduledef = {
3299  PyModuleDef_HEAD_INIT,
3300  "cpskRelations",
3301  0, /* m_doc */
3302  #if CYTHON_PEP489_MULTI_PHASE_INIT
3303  0, /* m_size */
3304  #else
3305  -1, /* m_size */
3306  #endif
3307  __pyx_methods /* m_methods */,
3308  #if CYTHON_PEP489_MULTI_PHASE_INIT
3309  __pyx_moduledef_slots, /* m_slots */
3310  #else
3311  NULL, /* m_reload */
3312  #endif
3313  NULL, /* m_traverse */
3314  NULL, /* m_clear */
3315  NULL /* m_free */
3316 };
3317 #endif
3318 #ifndef CYTHON_SMALL_CODE
3319 #if defined(__clang__)
3320  #define CYTHON_SMALL_CODE
3321 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
3322  #define CYTHON_SMALL_CODE __attribute__((cold))
3323 #else
3324  #define CYTHON_SMALL_CODE
3325 #endif
3326 #endif
3327 
3328 static __Pyx_StringTabEntry __pyx_string_tab[] = {
3329  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
3330  {&__pyx_n_s_Sw, __pyx_k_Sw, sizeof(__pyx_k_Sw), 0, 0, 1, 1},
3331  {&__pyx_n_s_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 0, 1, 1},
3332  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
3333  {&__pyx_n_s_cpskRelations, __pyx_k_cpskRelations, sizeof(__pyx_k_cpskRelations), 0, 0, 1, 1},
3334  {&__pyx_n_s_eps_small, __pyx_k_eps_small, sizeof(__pyx_k_eps_small), 0, 0, 1, 1},
3335  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
3336  {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
3337  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
3338  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
3339  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
3340  {&__pyx_n_s_ns_del, __pyx_k_ns_del, sizeof(__pyx_k_ns_del), 0, 0, 1, 1},
3341  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
3342  {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
3343  {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
3344  {&__pyx_kp_s_proteus_cpskRelations_pyx, __pyx_k_proteus_cpskRelations_pyx, sizeof(__pyx_k_proteus_cpskRelations_pyx), 0, 0, 1, 0},
3345  {&__pyx_n_s_psic, __pyx_k_psic, sizeof(__pyx_k_psic), 0, 0, 1, 1},
3346  {&__pyx_n_s_psk, __pyx_k_psk, sizeof(__pyx_k_psk), 0, 0, 1, 1},
3347  {&__pyx_n_s_rwork, __pyx_k_rwork, sizeof(__pyx_k_rwork), 0, 0, 1, 1},
3348  {&__pyx_n_s_rwork_tol, __pyx_k_rwork_tol, sizeof(__pyx_k_rwork_tol), 0, 0, 1, 1},
3349  {&__pyx_n_s_sw_max, __pyx_k_sw_max, sizeof(__pyx_k_sw_max), 0, 0, 1, 1},
3350  {&__pyx_n_s_sw_min, __pyx_k_sw_min, sizeof(__pyx_k_sw_min), 0, 0, 1, 1},
3351  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
3352  {&__pyx_n_s_vgm_cal_from_sw, __pyx_k_vgm_cal_from_sw, sizeof(__pyx_k_vgm_cal_from_sw), 0, 0, 1, 1},
3353  {&__pyx_n_s_vgm_calc_from_psic, __pyx_k_vgm_calc_from_psic, sizeof(__pyx_k_vgm_calc_from_psic), 0, 0, 1, 1},
3354  {0, 0, 0, 0, 0, 0, 0}
3355 };
3356 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
3357  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 945, __pyx_L1_error)
3358  return 0;
3359  __pyx_L1_error:;
3360  return -1;
3361 }
3362 
3363 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
3364  __Pyx_RefNannyDeclarations
3365  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
3366 
3367  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":945
3368  * __pyx_import_array()
3369  * except Exception:
3370  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
3371  *
3372  * cdef inline int import_umath() except -1:
3373  */
3374  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 945, __pyx_L1_error)
3375  __Pyx_GOTREF(__pyx_tuple_);
3376  __Pyx_GIVEREF(__pyx_tuple_);
3377 
3378  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":951
3379  * _import_umath()
3380  * except Exception:
3381  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
3382  *
3383  * cdef inline int import_ufunc() except -1:
3384  */
3385  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 951, __pyx_L1_error)
3386  __Pyx_GOTREF(__pyx_tuple__2);
3387  __Pyx_GIVEREF(__pyx_tuple__2);
3388 
3389  /* "cpskRelations.pyx":6
3390  * cimport pskRelations
3391  *
3392  * def vgm_cal_from_sw(double Sw, # <<<<<<<<<<<<<<
3393  * double sw_min,
3394  * double sw_max,
3395  */
3396  __pyx_tuple__3 = PyTuple_Pack(10, __pyx_n_s_Sw, __pyx_n_s_sw_min, __pyx_n_s_sw_max, __pyx_n_s_alpha, __pyx_n_s_m, __pyx_n_s_eps_small, __pyx_n_s_ns_del, __pyx_n_s_rwork, __pyx_n_s_rwork_tol, __pyx_n_s_psk); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 6, __pyx_L1_error)
3397  __Pyx_GOTREF(__pyx_tuple__3);
3398  __Pyx_GIVEREF(__pyx_tuple__3);
3399  __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(7, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpskRelations_pyx, __pyx_n_s_vgm_cal_from_sw, 6, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 6, __pyx_L1_error)
3400 
3401  /* "cpskRelations.pyx":25
3402  * return (psk.psic,psk.krw,psk.krn,psk.dpsic,psk.dkrw,psk.dkrn)
3403  *
3404  * def vgm_calc_from_psic(double psic, # <<<<<<<<<<<<<<
3405  * double sw_min,
3406  * double sw_max,
3407  */
3408  __pyx_tuple__5 = PyTuple_Pack(10, __pyx_n_s_psic, __pyx_n_s_sw_min, __pyx_n_s_sw_max, __pyx_n_s_alpha, __pyx_n_s_m, __pyx_n_s_eps_small, __pyx_n_s_ns_del, __pyx_n_s_rwork, __pyx_n_s_rwork_tol, __pyx_n_s_psk); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 25, __pyx_L1_error)
3409  __Pyx_GOTREF(__pyx_tuple__5);
3410  __Pyx_GIVEREF(__pyx_tuple__5);
3411  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(7, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_cpskRelations_pyx, __pyx_n_s_vgm_calc_from_psic, 25, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 25, __pyx_L1_error)
3412  __Pyx_RefNannyFinishContext();
3413  return 0;
3414  __pyx_L1_error:;
3415  __Pyx_RefNannyFinishContext();
3416  return -1;
3417 }
3418 
3419 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
3420  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
3421  return 0;
3422  __pyx_L1_error:;
3423  return -1;
3424 }
3425 
3426 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
3427 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
3428 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
3429 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
3430 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
3431 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
3432 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
3433 
3434 static int __Pyx_modinit_global_init_code(void) {
3435  __Pyx_RefNannyDeclarations
3436  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
3437  /*--- Global init code ---*/
3438  __Pyx_RefNannyFinishContext();
3439  return 0;
3440 }
3441 
3442 static int __Pyx_modinit_variable_export_code(void) {
3443  __Pyx_RefNannyDeclarations
3444  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
3445  /*--- Variable export code ---*/
3446  __Pyx_RefNannyFinishContext();
3447  return 0;
3448 }
3449 
3450 static int __Pyx_modinit_function_export_code(void) {
3451  __Pyx_RefNannyDeclarations
3452  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
3453  /*--- Function export code ---*/
3454  __Pyx_RefNannyFinishContext();
3455  return 0;
3456 }
3457 
3458 static int __Pyx_modinit_type_init_code(void) {
3459  __Pyx_RefNannyDeclarations
3460  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
3461  /*--- Type init code ---*/
3462  __Pyx_RefNannyFinishContext();
3463  return 0;
3464 }
3465 
3466 static int __Pyx_modinit_type_import_code(void) {
3467  __Pyx_RefNannyDeclarations
3468  PyObject *__pyx_t_1 = NULL;
3469  int __pyx_lineno = 0;
3470  const char *__pyx_filename = NULL;
3471  int __pyx_clineno = 0;
3472  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
3473  /*--- Type import code ---*/
3474  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
3475  __Pyx_GOTREF(__pyx_t_1);
3476  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
3477  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
3478  sizeof(PyTypeObject),
3479  #else
3480  sizeof(PyHeapTypeObject),
3481  #endif
3482  __Pyx_ImportType_CheckSize_Warn);
3483  if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
3484  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3485  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 200, __pyx_L1_error)
3486  __Pyx_GOTREF(__pyx_t_1);
3487  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
3488  if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 200, __pyx_L1_error)
3489  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
3490  if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 223, __pyx_L1_error)
3491  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
3492  if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 227, __pyx_L1_error)
3493  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
3494  if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 239, __pyx_L1_error)
3495  __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3496  if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 771, __pyx_L1_error)
3497  __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3498  if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 773, __pyx_L1_error)
3499  __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3500  if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 775, __pyx_L1_error)
3501  __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3502  if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 777, __pyx_L1_error)
3503  __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3504  if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 779, __pyx_L1_error)
3505  __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3506  if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 781, __pyx_L1_error)
3507  __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3508  if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 783, __pyx_L1_error)
3509  __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3510  if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 785, __pyx_L1_error)
3511  __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3512  if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 787, __pyx_L1_error)
3513  __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
3514  if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 789, __pyx_L1_error)
3515  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
3516  if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 827, __pyx_L1_error)
3517  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3518  __Pyx_RefNannyFinishContext();
3519  return 0;
3520  __pyx_L1_error:;
3521  __Pyx_XDECREF(__pyx_t_1);
3522  __Pyx_RefNannyFinishContext();
3523  return -1;
3524 }
3525 
3526 static int __Pyx_modinit_variable_import_code(void) {
3527  __Pyx_RefNannyDeclarations
3528  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
3529  /*--- Variable import code ---*/
3530  __Pyx_RefNannyFinishContext();
3531  return 0;
3532 }
3533 
3534 static int __Pyx_modinit_function_import_code(void) {
3535  __Pyx_RefNannyDeclarations
3536  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
3537  /*--- Function import code ---*/
3538  __Pyx_RefNannyFinishContext();
3539  return 0;
3540 }
3541 
3542 
3543 #ifndef CYTHON_NO_PYINIT_EXPORT
3544 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
3545 #elif PY_MAJOR_VERSION < 3
3546 #ifdef __cplusplus
3547 #define __Pyx_PyMODINIT_FUNC extern "C" void
3548 #else
3549 #define __Pyx_PyMODINIT_FUNC void
3550 #endif
3551 #else
3552 #ifdef __cplusplus
3553 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
3554 #else
3555 #define __Pyx_PyMODINIT_FUNC PyObject *
3556 #endif
3557 #endif
3558 
3559 
3560 #if PY_MAJOR_VERSION < 3
3561 __Pyx_PyMODINIT_FUNC initcpskRelations(void) CYTHON_SMALL_CODE; /*proto*/
3562 __Pyx_PyMODINIT_FUNC initcpskRelations(void)
3563 #else
3564 __Pyx_PyMODINIT_FUNC PyInit_cpskRelations(void) CYTHON_SMALL_CODE; /*proto*/
3565 __Pyx_PyMODINIT_FUNC PyInit_cpskRelations(void)
3566 #if CYTHON_PEP489_MULTI_PHASE_INIT
3567 {
3568  return PyModuleDef_Init(&__pyx_moduledef);
3569 }
3570 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
3571  #if PY_VERSION_HEX >= 0x030700A1
3572  static PY_INT64_T main_interpreter_id = -1;
3573  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
3574  if (main_interpreter_id == -1) {
3575  main_interpreter_id = current_id;
3576  return (unlikely(current_id == -1)) ? -1 : 0;
3577  } else if (unlikely(main_interpreter_id != current_id))
3578  #else
3579  static PyInterpreterState *main_interpreter = NULL;
3580  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
3581  if (!main_interpreter) {
3582  main_interpreter = current_interpreter;
3583  } else if (unlikely(main_interpreter != current_interpreter))
3584  #endif
3585  {
3586  PyErr_SetString(
3587  PyExc_ImportError,
3588  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
3589  return -1;
3590  }
3591  return 0;
3592 }
3593 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
3594  PyObject *value = PyObject_GetAttrString(spec, from_name);
3595  int result = 0;
3596  if (likely(value)) {
3597  if (allow_none || value != Py_None) {
3598  result = PyDict_SetItemString(moddict, to_name, value);
3599  }
3600  Py_DECREF(value);
3601  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
3602  PyErr_Clear();
3603  } else {
3604  result = -1;
3605  }
3606  return result;
3607 }
3608 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
3609  PyObject *module = NULL, *moddict, *modname;
3610  if (__Pyx_check_single_interpreter())
3611  return NULL;
3612  if (__pyx_m)
3613  return __Pyx_NewRef(__pyx_m);
3614  modname = PyObject_GetAttrString(spec, "name");
3615  if (unlikely(!modname)) goto bad;
3616  module = PyModule_NewObject(modname);
3617  Py_DECREF(modname);
3618  if (unlikely(!module)) goto bad;
3619  moddict = PyModule_GetDict(module);
3620  if (unlikely(!moddict)) goto bad;
3621  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
3622  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
3623  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
3624  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
3625  return module;
3626 bad:
3627  Py_XDECREF(module);
3628  return NULL;
3629 }
3630 
3631 
3632 static CYTHON_SMALL_CODE int __pyx_pymod_exec_cpskRelations(PyObject *__pyx_pyinit_module)
3633 #endif
3634 #endif
3635 {
3636  PyObject *__pyx_t_1 = NULL;
3637  int __pyx_lineno = 0;
3638  const char *__pyx_filename = NULL;
3639  int __pyx_clineno = 0;
3640  __Pyx_RefNannyDeclarations
3641  #if CYTHON_PEP489_MULTI_PHASE_INIT
3642  if (__pyx_m) {
3643  if (__pyx_m == __pyx_pyinit_module) return 0;
3644  PyErr_SetString(PyExc_RuntimeError, "Module 'cpskRelations' has already been imported. Re-initialisation is not supported.");
3645  return -1;
3646  }
3647  #elif PY_MAJOR_VERSION >= 3
3648  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
3649  #endif
3650  #if CYTHON_REFNANNY
3651 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
3652 if (!__Pyx_RefNanny) {
3653  PyErr_Clear();
3654  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
3655  if (!__Pyx_RefNanny)
3656  Py_FatalError("failed to import 'refnanny' module");
3657 }
3658 #endif
3659  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_cpskRelations(void)", 0);
3660  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3661  #ifdef __Pxy_PyFrame_Initialize_Offsets
3662  __Pxy_PyFrame_Initialize_Offsets();
3663  #endif
3664  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
3665  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
3666  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
3667  #ifdef __Pyx_CyFunction_USED
3668  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3669  #endif
3670  #ifdef __Pyx_FusedFunction_USED
3671  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3672  #endif
3673  #ifdef __Pyx_Coroutine_USED
3674  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3675  #endif
3676  #ifdef __Pyx_Generator_USED
3677  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3678  #endif
3679  #ifdef __Pyx_AsyncGen_USED
3680  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3681  #endif
3682  #ifdef __Pyx_StopAsyncIteration_USED
3683  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3684  #endif
3685  /*--- Library function declarations ---*/
3686  /*--- Threads initialization code ---*/
3687  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
3688  PyEval_InitThreads();
3689  #endif
3690  /*--- Module creation code ---*/
3691  #if CYTHON_PEP489_MULTI_PHASE_INIT
3692  __pyx_m = __pyx_pyinit_module;
3693  Py_INCREF(__pyx_m);
3694  #else
3695  #if PY_MAJOR_VERSION < 3
3696  __pyx_m = Py_InitModule4("cpskRelations", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
3697  #else
3698  __pyx_m = PyModule_Create(&__pyx_moduledef);
3699  #endif
3700  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
3701  #endif
3702  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
3703  Py_INCREF(__pyx_d);
3704  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
3705  Py_INCREF(__pyx_b);
3706  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
3707  Py_INCREF(__pyx_cython_runtime);
3708  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
3709  /*--- Initialize various global constants etc. ---*/
3710  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3711  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
3712  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3713  #endif
3714  if (__pyx_module_is_main_cpskRelations) {
3715  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3716  }
3717  #if PY_MAJOR_VERSION >= 3
3718  {
3719  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
3720  if (!PyDict_GetItemString(modules, "cpskRelations")) {
3721  if (unlikely(PyDict_SetItemString(modules, "cpskRelations", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
3722  }
3723  }
3724  #endif
3725  /*--- Builtin init code ---*/
3726  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3727  /*--- Constants init code ---*/
3728  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3729  /*--- Global type/function init code ---*/
3730  (void)__Pyx_modinit_global_init_code();
3731  (void)__Pyx_modinit_variable_export_code();
3732  (void)__Pyx_modinit_function_export_code();
3733  (void)__Pyx_modinit_type_init_code();
3734  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
3735  (void)__Pyx_modinit_variable_import_code();
3736  (void)__Pyx_modinit_function_import_code();
3737  /*--- Execution code ---*/
3738  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
3739  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3740  #endif
3741 
3742  /* "cpskRelations.pyx":2
3743  * # A type of -*- python -*- file
3744  * import numpy as np # <<<<<<<<<<<<<<
3745  * cimport numpy as np
3746  * cimport pskRelations
3747  */
3748  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
3749  __Pyx_GOTREF(__pyx_t_1);
3750  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
3751  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3752 
3753  /* "cpskRelations.pyx":6
3754  * cimport pskRelations
3755  *
3756  * def vgm_cal_from_sw(double Sw, # <<<<<<<<<<<<<<
3757  * double sw_min,
3758  * double sw_max,
3759  */
3760  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13cpskRelations_1vgm_cal_from_sw, NULL, __pyx_n_s_cpskRelations); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
3761  __Pyx_GOTREF(__pyx_t_1);
3762  if (PyDict_SetItem(__pyx_d, __pyx_n_s_vgm_cal_from_sw, __pyx_t_1) < 0) __PYX_ERR(0, 6, __pyx_L1_error)
3763  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3764 
3765  /* "cpskRelations.pyx":25
3766  * return (psk.psic,psk.krw,psk.krn,psk.dpsic,psk.dkrw,psk.dkrn)
3767  *
3768  * def vgm_calc_from_psic(double psic, # <<<<<<<<<<<<<<
3769  * double sw_min,
3770  * double sw_max,
3771  */
3772  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13cpskRelations_3vgm_calc_from_psic, NULL, __pyx_n_s_cpskRelations); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
3773  __Pyx_GOTREF(__pyx_t_1);
3774  if (PyDict_SetItem(__pyx_d, __pyx_n_s_vgm_calc_from_psic, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
3775  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3776 
3777  /* "cpskRelations.pyx":1
3778  * # A type of -*- python -*- file # <<<<<<<<<<<<<<
3779  * import numpy as np
3780  * cimport numpy as np
3781  */
3782  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
3783  __Pyx_GOTREF(__pyx_t_1);
3784  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3785  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3786 
3787  /* "../miniconda3/envs/proteus-dev-up/lib/python3.10/site-packages/numpy/__init__.pxd":1014
3788  *
3789  *
3790  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
3791  * """
3792  * returns the unit part of the dtype for a numpy datetime64 object.
3793  */
3794 
3795  /*--- Wrapped vars code ---*/
3796 
3797  goto __pyx_L0;
3798  __pyx_L1_error:;
3799  __Pyx_XDECREF(__pyx_t_1);
3800  if (__pyx_m) {
3801  if (__pyx_d) {
3802  __Pyx_AddTraceback("init cpskRelations", __pyx_clineno, __pyx_lineno, __pyx_filename);
3803  }
3804  Py_CLEAR(__pyx_m);
3805  } else if (!PyErr_Occurred()) {
3806  PyErr_SetString(PyExc_ImportError, "init cpskRelations");
3807  }
3808  __pyx_L0:;
3809  __Pyx_RefNannyFinishContext();
3810  #if CYTHON_PEP489_MULTI_PHASE_INIT
3811  return (__pyx_m != NULL) ? 0 : -1;
3812  #elif PY_MAJOR_VERSION >= 3
3813  return __pyx_m;
3814  #else
3815  return;
3816  #endif
3817 }
3818 
3819 /* --- Runtime support code --- */
3820 /* Refnanny */
3821 #if CYTHON_REFNANNY
3822 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
3823  PyObject *m = NULL, *p = NULL;
3824  void *r = NULL;
3825  m = PyImport_ImportModule(modname);
3826  if (!m) goto end;
3827  p = PyObject_GetAttrString(m, "RefNannyAPI");
3828  if (!p) goto end;
3829  r = PyLong_AsVoidPtr(p);
3830 end:
3831  Py_XDECREF(p);
3832  Py_XDECREF(m);
3833  return (__Pyx_RefNannyAPIStruct *)r;
3834 }
3835 #endif
3836 
3837 /* RaiseArgTupleInvalid */
3838 static void __Pyx_RaiseArgtupleInvalid(
3839  const char* func_name,
3840  int exact,
3841  Py_ssize_t num_min,
3842  Py_ssize_t num_max,
3843  Py_ssize_t num_found)
3844 {
3845  Py_ssize_t num_expected;
3846  const char *more_or_less;
3847  if (num_found < num_min) {
3848  num_expected = num_min;
3849  more_or_less = "at least";
3850  } else {
3851  num_expected = num_max;
3852  more_or_less = "at most";
3853  }
3854  if (exact) {
3855  more_or_less = "exactly";
3856  }
3857  PyErr_Format(PyExc_TypeError,
3858  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
3859  func_name, more_or_less, num_expected,
3860  (num_expected == 1) ? "" : "s", num_found);
3861 }
3862 
3863 /* RaiseDoubleKeywords */
3864 static void __Pyx_RaiseDoubleKeywordsError(
3865  const char* func_name,
3866  PyObject* kw_name)
3867 {
3868  PyErr_Format(PyExc_TypeError,
3869  #if PY_MAJOR_VERSION >= 3
3870  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
3871  #else
3872  "%s() got multiple values for keyword argument '%s'", func_name,
3873  PyString_AsString(kw_name));
3874  #endif
3875 }
3876 
3877 /* ParseKeywords */
3878 static int __Pyx_ParseOptionalKeywords(
3879  PyObject *kwds,
3880  PyObject **argnames[],
3881  PyObject *kwds2,
3882  PyObject *values[],
3883  Py_ssize_t num_pos_args,
3884  const char* function_name)
3885 {
3886  PyObject *key = 0, *value = 0;
3887  Py_ssize_t pos = 0;
3888  PyObject*** name;
3889  PyObject*** first_kw_arg = argnames + num_pos_args;
3890  while (PyDict_Next(kwds, &pos, &key, &value)) {
3891  name = first_kw_arg;
3892  while (*name && (**name != key)) name++;
3893  if (*name) {
3894  values[name-argnames] = value;
3895  continue;
3896  }
3897  name = first_kw_arg;
3898  #if PY_MAJOR_VERSION < 3
3899  if (likely(PyString_Check(key))) {
3900  while (*name) {
3901  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
3902  && _PyString_Eq(**name, key)) {
3903  values[name-argnames] = value;
3904  break;
3905  }
3906  name++;
3907  }
3908  if (*name) continue;
3909  else {
3910  PyObject*** argname = argnames;
3911  while (argname != first_kw_arg) {
3912  if ((**argname == key) || (
3913  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
3914  && _PyString_Eq(**argname, key))) {
3915  goto arg_passed_twice;
3916  }
3917  argname++;
3918  }
3919  }
3920  } else
3921  #endif
3922  if (likely(PyUnicode_Check(key))) {
3923  while (*name) {
3924  int cmp = (**name == key) ? 0 :
3925  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
3926  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
3927  #endif
3928  PyUnicode_Compare(**name, key);
3929  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
3930  if (cmp == 0) {
3931  values[name-argnames] = value;
3932  break;
3933  }
3934  name++;
3935  }
3936  if (*name) continue;
3937  else {
3938  PyObject*** argname = argnames;
3939  while (argname != first_kw_arg) {
3940  int cmp = (**argname == key) ? 0 :
3941  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
3942  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
3943  #endif
3944  PyUnicode_Compare(**argname, key);
3945  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
3946  if (cmp == 0) goto arg_passed_twice;
3947  argname++;
3948  }
3949  }
3950  } else
3951  goto invalid_keyword_type;
3952  if (kwds2) {
3953  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
3954  } else {
3955  goto invalid_keyword;
3956  }
3957  }
3958  return 0;
3959 arg_passed_twice:
3960  __Pyx_RaiseDoubleKeywordsError(function_name, key);
3961  goto bad;
3962 invalid_keyword_type:
3963  PyErr_Format(PyExc_TypeError,
3964  "%.200s() keywords must be strings", function_name);
3965  goto bad;
3966 invalid_keyword:
3967  PyErr_Format(PyExc_TypeError,
3968  #if PY_MAJOR_VERSION < 3
3969  "%.200s() got an unexpected keyword argument '%.200s'",
3970  function_name, PyString_AsString(key));
3971  #else
3972  "%s() got an unexpected keyword argument '%U'",
3973  function_name, key);
3974  #endif
3975 bad:
3976  return -1;
3977 }
3978 
3979 /* PyObjectGetAttrStr */
3980 #if CYTHON_USE_TYPE_SLOTS
3981 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
3982  PyTypeObject* tp = Py_TYPE(obj);
3983  if (likely(tp->tp_getattro))
3984  return tp->tp_getattro(obj, attr_name);
3985 #if PY_MAJOR_VERSION < 3
3986  if (likely(tp->tp_getattr))
3987  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
3988 #endif
3989  return PyObject_GetAttr(obj, attr_name);
3990 }
3991 #endif
3992 
3993 /* GetBuiltinName */
3994 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
3995  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
3996  if (unlikely(!result)) {
3997  PyErr_Format(PyExc_NameError,
3998 #if PY_MAJOR_VERSION >= 3
3999  "name '%U' is not defined", name);
4000 #else
4001  "name '%.200s' is not defined", PyString_AS_STRING(name));
4002 #endif
4003  }
4004  return result;
4005 }
4006 
4007 /* GetTopmostException */
4008 #if CYTHON_USE_EXC_INFO_STACK
4009 static _PyErr_StackItem *
4010 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
4011 {
4012  _PyErr_StackItem *exc_info = tstate->exc_info;
4013  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
4014  exc_info->previous_item != NULL)
4015  {
4016  exc_info = exc_info->previous_item;
4017  }
4018  return exc_info;
4019 }
4020 #endif
4021 
4022 /* SaveResetException */
4023 #if CYTHON_FAST_THREAD_STATE
4024 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
4025  #if CYTHON_USE_EXC_INFO_STACK
4026  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
4027  *type = exc_info->exc_type;
4028  *value = exc_info->exc_value;
4029  *tb = exc_info->exc_traceback;
4030  #else
4031  *type = tstate->exc_type;
4032  *value = tstate->exc_value;
4033  *tb = tstate->exc_traceback;
4034  #endif
4035  Py_XINCREF(*type);
4036  Py_XINCREF(*value);
4037  Py_XINCREF(*tb);
4038 }
4039 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
4040  PyObject *tmp_type, *tmp_value, *tmp_tb;
4041  #if CYTHON_USE_EXC_INFO_STACK
4042  _PyErr_StackItem *exc_info = tstate->exc_info;
4043  tmp_type = exc_info->exc_type;
4044  tmp_value = exc_info->exc_value;
4045  tmp_tb = exc_info->exc_traceback;
4046  exc_info->exc_type = type;
4047  exc_info->exc_value = value;
4048  exc_info->exc_traceback = tb;
4049  #else
4050  tmp_type = tstate->exc_type;
4051  tmp_value = tstate->exc_value;
4052  tmp_tb = tstate->exc_traceback;
4053  tstate->exc_type = type;
4054  tstate->exc_value = value;
4055  tstate->exc_traceback = tb;
4056  #endif
4057  Py_XDECREF(tmp_type);
4058  Py_XDECREF(tmp_value);
4059  Py_XDECREF(tmp_tb);
4060 }
4061 #endif
4062 
4063 /* PyErrExceptionMatches */
4064 #if CYTHON_FAST_THREAD_STATE
4065 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
4066  Py_ssize_t i, n;
4067  n = PyTuple_GET_SIZE(tuple);
4068 #if PY_MAJOR_VERSION >= 3
4069  for (i=0; i<n; i++) {
4070  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
4071  }
4072 #endif
4073  for (i=0; i<n; i++) {
4074  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
4075  }
4076  return 0;
4077 }
4078 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
4079  PyObject *exc_type = tstate->curexc_type;
4080  if (exc_type == err) return 1;
4081  if (unlikely(!exc_type)) return 0;
4082  if (unlikely(PyTuple_Check(err)))
4083  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
4084  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
4085 }
4086 #endif
4087 
4088 /* GetException */
4089 #if CYTHON_FAST_THREAD_STATE
4090 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
4091 #else
4092 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
4093 #endif
4094 {
4095  PyObject *local_type, *local_value, *local_tb;
4096 #if CYTHON_FAST_THREAD_STATE
4097  PyObject *tmp_type, *tmp_value, *tmp_tb;
4098  local_type = tstate->curexc_type;
4099  local_value = tstate->curexc_value;
4100  local_tb = tstate->curexc_traceback;
4101  tstate->curexc_type = 0;
4102  tstate->curexc_value = 0;
4103  tstate->curexc_traceback = 0;
4104 #else
4105  PyErr_Fetch(&local_type, &local_value, &local_tb);
4106 #endif
4107  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
4108 #if CYTHON_FAST_THREAD_STATE
4109  if (unlikely(tstate->curexc_type))
4110 #else
4111  if (unlikely(PyErr_Occurred()))
4112 #endif
4113  goto bad;
4114  #if PY_MAJOR_VERSION >= 3
4115  if (local_tb) {
4116  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
4117  goto bad;
4118  }
4119  #endif
4120  Py_XINCREF(local_tb);
4121  Py_XINCREF(local_type);
4122  Py_XINCREF(local_value);
4123  *type = local_type;
4124  *value = local_value;
4125  *tb = local_tb;
4126 #if CYTHON_FAST_THREAD_STATE
4127  #if CYTHON_USE_EXC_INFO_STACK
4128  {
4129  _PyErr_StackItem *exc_info = tstate->exc_info;
4130  tmp_type = exc_info->exc_type;
4131  tmp_value = exc_info->exc_value;
4132  tmp_tb = exc_info->exc_traceback;
4133  exc_info->exc_type = local_type;
4134  exc_info->exc_value = local_value;
4135  exc_info->exc_traceback = local_tb;
4136  }
4137  #else
4138  tmp_type = tstate->exc_type;
4139  tmp_value = tstate->exc_value;
4140  tmp_tb = tstate->exc_traceback;
4141  tstate->exc_type = local_type;
4142  tstate->exc_value = local_value;
4143  tstate->exc_traceback = local_tb;
4144  #endif
4145  Py_XDECREF(tmp_type);
4146  Py_XDECREF(tmp_value);
4147  Py_XDECREF(tmp_tb);
4148 #else
4149  PyErr_SetExcInfo(local_type, local_value, local_tb);
4150 #endif
4151  return 0;
4152 bad:
4153  *type = 0;
4154  *value = 0;
4155  *tb = 0;
4156  Py_XDECREF(local_type);
4157  Py_XDECREF(local_value);
4158  Py_XDECREF(local_tb);
4159  return -1;
4160 }
4161 
4162 /* PyObjectCall */
4163 #if CYTHON_COMPILING_IN_CPYTHON
4164 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
4165  PyObject *result;
4166  ternaryfunc call = Py_TYPE(func)->tp_call;
4167  if (unlikely(!call))
4168  return PyObject_Call(func, arg, kw);
4169  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
4170  return NULL;
4171  result = (*call)(func, arg, kw);
4172  Py_LeaveRecursiveCall();
4173  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
4174  PyErr_SetString(
4175  PyExc_SystemError,
4176  "NULL result without error in PyObject_Call");
4177  }
4178  return result;
4179 }
4180 #endif
4181 
4182 /* PyErrFetchRestore */
4183 #if CYTHON_FAST_THREAD_STATE
4184 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
4185  PyObject *tmp_type, *tmp_value, *tmp_tb;
4186  tmp_type = tstate->curexc_type;
4187  tmp_value = tstate->curexc_value;
4188  tmp_tb = tstate->curexc_traceback;
4189  tstate->curexc_type = type;
4190  tstate->curexc_value = value;
4191  tstate->curexc_traceback = tb;
4192  Py_XDECREF(tmp_type);
4193  Py_XDECREF(tmp_value);
4194  Py_XDECREF(tmp_tb);
4195 }
4196 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
4197  *type = tstate->curexc_type;
4198  *value = tstate->curexc_value;
4199  *tb = tstate->curexc_traceback;
4200  tstate->curexc_type = 0;
4201  tstate->curexc_value = 0;
4202  tstate->curexc_traceback = 0;
4203 }
4204 #endif
4205 
4206 /* RaiseException */
4207 #if PY_MAJOR_VERSION < 3
4208 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
4209  CYTHON_UNUSED PyObject *cause) {
4210  __Pyx_PyThreadState_declare
4211  Py_XINCREF(type);
4212  if (!value || value == Py_None)
4213  value = NULL;
4214  else
4215  Py_INCREF(value);
4216  if (!tb || tb == Py_None)
4217  tb = NULL;
4218  else {
4219  Py_INCREF(tb);
4220  if (!PyTraceBack_Check(tb)) {
4221  PyErr_SetString(PyExc_TypeError,
4222  "raise: arg 3 must be a traceback or None");
4223  goto raise_error;
4224  }
4225  }
4226  if (PyType_Check(type)) {
4227 #if CYTHON_COMPILING_IN_PYPY
4228  if (!value) {
4229  Py_INCREF(Py_None);
4230  value = Py_None;
4231  }
4232 #endif
4233  PyErr_NormalizeException(&type, &value, &tb);
4234  } else {
4235  if (value) {
4236  PyErr_SetString(PyExc_TypeError,
4237  "instance exception may not have a separate value");
4238  goto raise_error;
4239  }
4240  value = type;
4241  type = (PyObject*) Py_TYPE(type);
4242  Py_INCREF(type);
4243  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
4244  PyErr_SetString(PyExc_TypeError,
4245  "raise: exception class must be a subclass of BaseException");
4246  goto raise_error;
4247  }
4248  }
4249  __Pyx_PyThreadState_assign
4250  __Pyx_ErrRestore(type, value, tb);
4251  return;
4252 raise_error:
4253  Py_XDECREF(value);
4254  Py_XDECREF(type);
4255  Py_XDECREF(tb);
4256  return;
4257 }
4258 #else
4259 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
4260  PyObject* owned_instance = NULL;
4261  if (tb == Py_None) {
4262  tb = 0;
4263  } else if (tb && !PyTraceBack_Check(tb)) {
4264  PyErr_SetString(PyExc_TypeError,
4265  "raise: arg 3 must be a traceback or None");
4266  goto bad;
4267  }
4268  if (value == Py_None)
4269  value = 0;
4270  if (PyExceptionInstance_Check(type)) {
4271  if (value) {
4272  PyErr_SetString(PyExc_TypeError,
4273  "instance exception may not have a separate value");
4274  goto bad;
4275  }
4276  value = type;
4277  type = (PyObject*) Py_TYPE(value);
4278  } else if (PyExceptionClass_Check(type)) {
4279  PyObject *instance_class = NULL;
4280  if (value && PyExceptionInstance_Check(value)) {
4281  instance_class = (PyObject*) Py_TYPE(value);
4282  if (instance_class != type) {
4283  int is_subclass = PyObject_IsSubclass(instance_class, type);
4284  if (!is_subclass) {
4285  instance_class = NULL;
4286  } else if (unlikely(is_subclass == -1)) {
4287  goto bad;
4288  } else {
4289  type = instance_class;
4290  }
4291  }
4292  }
4293  if (!instance_class) {
4294  PyObject *args;
4295  if (!value)
4296  args = PyTuple_New(0);
4297  else if (PyTuple_Check(value)) {
4298  Py_INCREF(value);
4299  args = value;
4300  } else
4301  args = PyTuple_Pack(1, value);
4302  if (!args)
4303  goto bad;
4304  owned_instance = PyObject_Call(type, args, NULL);
4305  Py_DECREF(args);
4306  if (!owned_instance)
4307  goto bad;
4308  value = owned_instance;
4309  if (!PyExceptionInstance_Check(value)) {
4310  PyErr_Format(PyExc_TypeError,
4311  "calling %R should have returned an instance of "
4312  "BaseException, not %R",
4313  type, Py_TYPE(value));
4314  goto bad;
4315  }
4316  }
4317  } else {
4318  PyErr_SetString(PyExc_TypeError,
4319  "raise: exception class must be a subclass of BaseException");
4320  goto bad;
4321  }
4322  if (cause) {
4323  PyObject *fixed_cause;
4324  if (cause == Py_None) {
4325  fixed_cause = NULL;
4326  } else if (PyExceptionClass_Check(cause)) {
4327  fixed_cause = PyObject_CallObject(cause, NULL);
4328  if (fixed_cause == NULL)
4329  goto bad;
4330  } else if (PyExceptionInstance_Check(cause)) {
4331  fixed_cause = cause;
4332  Py_INCREF(fixed_cause);
4333  } else {
4334  PyErr_SetString(PyExc_TypeError,
4335  "exception causes must derive from "
4336  "BaseException");
4337  goto bad;
4338  }
4339  PyException_SetCause(value, fixed_cause);
4340  }
4341  PyErr_SetObject(type, value);
4342  if (tb) {
4343 #if CYTHON_COMPILING_IN_PYPY
4344  PyObject *tmp_type, *tmp_value, *tmp_tb;
4345  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
4346  Py_INCREF(tb);
4347  PyErr_Restore(tmp_type, tmp_value, tb);
4348  Py_XDECREF(tmp_tb);
4349 #else
4350  PyThreadState *tstate = __Pyx_PyThreadState_Current;
4351  PyObject* tmp_tb = tstate->curexc_traceback;
4352  if (tb != tmp_tb) {
4353  Py_INCREF(tb);
4354  tstate->curexc_traceback = tb;
4355  Py_XDECREF(tmp_tb);
4356  }
4357 #endif
4358  }
4359 bad:
4360  Py_XDECREF(owned_instance);
4361  return;
4362 }
4363 #endif
4364 
4365 /* TypeImport */
4366 #ifndef __PYX_HAVE_RT_ImportType
4367 #define __PYX_HAVE_RT_ImportType
4368 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
4369  size_t size, enum __Pyx_ImportType_CheckSize check_size)
4370 {
4371  PyObject *result = 0;
4372  char warning[200];
4373  Py_ssize_t basicsize;
4374 #ifdef Py_LIMITED_API
4375  PyObject *py_basicsize;
4376 #endif
4377  result = PyObject_GetAttrString(module, class_name);
4378  if (!result)
4379  goto bad;
4380  if (!PyType_Check(result)) {
4381  PyErr_Format(PyExc_TypeError,
4382  "%.200s.%.200s is not a type object",
4383  module_name, class_name);
4384  goto bad;
4385  }
4386 #ifndef Py_LIMITED_API
4387  basicsize = ((PyTypeObject *)result)->tp_basicsize;
4388 #else
4389  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
4390  if (!py_basicsize)
4391  goto bad;
4392  basicsize = PyLong_AsSsize_t(py_basicsize);
4393  Py_DECREF(py_basicsize);
4394  py_basicsize = 0;
4395  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
4396  goto bad;
4397 #endif
4398  if ((size_t)basicsize < size) {
4399  PyErr_Format(PyExc_ValueError,
4400  "%.200s.%.200s size changed, may indicate binary incompatibility. "
4401  "Expected %zd from C header, got %zd from PyObject",
4402  module_name, class_name, size, basicsize);
4403  goto bad;
4404  }
4405  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
4406  PyErr_Format(PyExc_ValueError,
4407  "%.200s.%.200s size changed, may indicate binary incompatibility. "
4408  "Expected %zd from C header, got %zd from PyObject",
4409  module_name, class_name, size, basicsize);
4410  goto bad;
4411  }
4412  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
4413  PyOS_snprintf(warning, sizeof(warning),
4414  "%s.%s size changed, may indicate binary incompatibility. "
4415  "Expected %zd from C header, got %zd from PyObject",
4416  module_name, class_name, size, basicsize);
4417  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
4418  }
4419  return (PyTypeObject *)result;
4420 bad:
4421  Py_XDECREF(result);
4422  return NULL;
4423 }
4424 #endif
4425 
4426 /* Import */
4427 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
4428  PyObject *empty_list = 0;
4429  PyObject *module = 0;
4430  PyObject *global_dict = 0;
4431  PyObject *empty_dict = 0;
4432  PyObject *list;
4433  #if PY_MAJOR_VERSION < 3
4434  PyObject *py_import;
4435  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
4436  if (!py_import)
4437  goto bad;
4438  #endif
4439  if (from_list)
4440  list = from_list;
4441  else {
4442  empty_list = PyList_New(0);
4443  if (!empty_list)
4444  goto bad;
4445  list = empty_list;
4446  }
4447  global_dict = PyModule_GetDict(__pyx_m);
4448  if (!global_dict)
4449  goto bad;
4450  empty_dict = PyDict_New();
4451  if (!empty_dict)
4452  goto bad;
4453  {
4454  #if PY_MAJOR_VERSION >= 3
4455  if (level == -1) {
4456  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
4457  module = PyImport_ImportModuleLevelObject(
4458  name, global_dict, empty_dict, list, 1);
4459  if (!module) {
4460  if (!PyErr_ExceptionMatches(PyExc_ImportError))
4461  goto bad;
4462  PyErr_Clear();
4463  }
4464  }
4465  level = 0;
4466  }
4467  #endif
4468  if (!module) {
4469  #if PY_MAJOR_VERSION < 3
4470  PyObject *py_level = PyInt_FromLong(level);
4471  if (!py_level)
4472  goto bad;
4473  module = PyObject_CallFunctionObjArgs(py_import,
4474  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
4475  Py_DECREF(py_level);
4476  #else
4477  module = PyImport_ImportModuleLevelObject(
4478  name, global_dict, empty_dict, list, level);
4479  #endif
4480  }
4481  }
4482 bad:
4483  #if PY_MAJOR_VERSION < 3
4484  Py_XDECREF(py_import);
4485  #endif
4486  Py_XDECREF(empty_list);
4487  Py_XDECREF(empty_dict);
4488  return module;
4489 }
4490 
4491 /* PyDictVersioning */
4492 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
4493 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
4494  PyObject *dict = Py_TYPE(obj)->tp_dict;
4495  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
4496 }
4497 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
4498  PyObject **dictptr = NULL;
4499  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
4500  if (offset) {
4501 #if CYTHON_COMPILING_IN_CPYTHON
4502  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
4503 #else
4504  dictptr = _PyObject_GetDictPtr(obj);
4505 #endif
4506  }
4507  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
4508 }
4509 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
4510  PyObject *dict = Py_TYPE(obj)->tp_dict;
4511  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
4512  return 0;
4513  return obj_dict_version == __Pyx_get_object_dict_version(obj);
4514 }
4515 #endif
4516 
4517 /* CLineInTraceback */
4518 #ifndef CYTHON_CLINE_IN_TRACEBACK
4519 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
4520  PyObject *use_cline;
4521  PyObject *ptype, *pvalue, *ptraceback;
4522 #if CYTHON_COMPILING_IN_CPYTHON
4523  PyObject **cython_runtime_dict;
4524 #endif
4525  if (unlikely(!__pyx_cython_runtime)) {
4526  return c_line;
4527  }
4528  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
4529 #if CYTHON_COMPILING_IN_CPYTHON
4530  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
4531  if (likely(cython_runtime_dict)) {
4532  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
4533  use_cline, *cython_runtime_dict,
4534  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
4535  } else
4536 #endif
4537  {
4538  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
4539  if (use_cline_obj) {
4540  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
4541  Py_DECREF(use_cline_obj);
4542  } else {
4543  PyErr_Clear();
4544  use_cline = NULL;
4545  }
4546  }
4547  if (!use_cline) {
4548  c_line = 0;
4549  (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
4550  }
4551  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
4552  c_line = 0;
4553  }
4554  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
4555  return c_line;
4556 }
4557 #endif
4558 
4559 /* CodeObjectCache */
4560 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
4561  int start = 0, mid = 0, end = count - 1;
4562  if (end >= 0 && code_line > entries[end].code_line) {
4563  return count;
4564  }
4565  while (start < end) {
4566  mid = start + (end - start) / 2;
4567  if (code_line < entries[mid].code_line) {
4568  end = mid;
4569  } else if (code_line > entries[mid].code_line) {
4570  start = mid + 1;
4571  } else {
4572  return mid;
4573  }
4574  }
4575  if (code_line <= entries[mid].code_line) {
4576  return mid;
4577  } else {
4578  return mid + 1;
4579  }
4580 }
4581 static PyCodeObject *__pyx_find_code_object(int code_line) {
4582  PyCodeObject* code_object;
4583  int pos;
4584  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
4585  return NULL;
4586  }
4587  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
4588  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
4589  return NULL;
4590  }
4591  code_object = __pyx_code_cache.entries[pos].code_object;
4592  Py_INCREF(code_object);
4593  return code_object;
4594 }
4595 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
4596  int pos, i;
4597  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
4598  if (unlikely(!code_line)) {
4599  return;
4600  }
4601  if (unlikely(!entries)) {
4602  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
4603  if (likely(entries)) {
4604  __pyx_code_cache.entries = entries;
4605  __pyx_code_cache.max_count = 64;
4606  __pyx_code_cache.count = 1;
4607  entries[0].code_line = code_line;
4608  entries[0].code_object = code_object;
4609  Py_INCREF(code_object);
4610  }
4611  return;
4612  }
4613  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
4614  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
4615  PyCodeObject* tmp = entries[pos].code_object;
4616  entries[pos].code_object = code_object;
4617  Py_DECREF(tmp);
4618  return;
4619  }
4620  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
4621  int new_max = __pyx_code_cache.max_count + 64;
4622  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
4623  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
4624  if (unlikely(!entries)) {
4625  return;
4626  }
4627  __pyx_code_cache.entries = entries;
4628  __pyx_code_cache.max_count = new_max;
4629  }
4630  for (i=__pyx_code_cache.count; i>pos; i--) {
4631  entries[i] = entries[i-1];
4632  }
4633  entries[pos].code_line = code_line;
4634  entries[pos].code_object = code_object;
4635  __pyx_code_cache.count++;
4636  Py_INCREF(code_object);
4637 }
4638 
4639 /* AddTraceback */
4640 #include "compile.h"
4641 #include "frameobject.h"
4642 #include "traceback.h"
4643 #if PY_VERSION_HEX >= 0x030b00a6
4644  #ifndef Py_BUILD_CORE
4645  #define Py_BUILD_CORE 1
4646  #endif
4647  #include "internal/pycore_frame.h"
4648 #endif
4649 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
4650  const char *funcname, int c_line,
4651  int py_line, const char *filename) {
4652  PyCodeObject *py_code = NULL;
4653  PyObject *py_funcname = NULL;
4654  #if PY_MAJOR_VERSION < 3
4655  PyObject *py_srcfile = NULL;
4656  py_srcfile = PyString_FromString(filename);
4657  if (!py_srcfile) goto bad;
4658  #endif
4659  if (c_line) {
4660  #if PY_MAJOR_VERSION < 3
4661  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
4662  if (!py_funcname) goto bad;
4663  #else
4664  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
4665  if (!py_funcname) goto bad;
4666  funcname = PyUnicode_AsUTF8(py_funcname);
4667  if (!funcname) goto bad;
4668  #endif
4669  }
4670  else {
4671  #if PY_MAJOR_VERSION < 3
4672  py_funcname = PyString_FromString(funcname);
4673  if (!py_funcname) goto bad;
4674  #endif
4675  }
4676  #if PY_MAJOR_VERSION < 3
4677  py_code = __Pyx_PyCode_New(
4678  0,
4679  0,
4680  0,
4681  0,
4682  0,
4683  __pyx_empty_bytes, /*PyObject *code,*/
4684  __pyx_empty_tuple, /*PyObject *consts,*/
4685  __pyx_empty_tuple, /*PyObject *names,*/
4686  __pyx_empty_tuple, /*PyObject *varnames,*/
4687  __pyx_empty_tuple, /*PyObject *freevars,*/
4688  __pyx_empty_tuple, /*PyObject *cellvars,*/
4689  py_srcfile, /*PyObject *filename,*/
4690  py_funcname, /*PyObject *name,*/
4691  py_line,
4692  __pyx_empty_bytes /*PyObject *lnotab*/
4693  );
4694  Py_DECREF(py_srcfile);
4695  #else
4696  py_code = PyCode_NewEmpty(filename, funcname, py_line);
4697  #endif
4698  Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
4699  return py_code;
4700 bad:
4701  Py_XDECREF(py_funcname);
4702  #if PY_MAJOR_VERSION < 3
4703  Py_XDECREF(py_srcfile);
4704  #endif
4705  return NULL;
4706 }
4707 static void __Pyx_AddTraceback(const char *funcname, int c_line,
4708  int py_line, const char *filename) {
4709  PyCodeObject *py_code = 0;
4710  PyFrameObject *py_frame = 0;
4711  PyThreadState *tstate = __Pyx_PyThreadState_Current;
4712  PyObject *ptype, *pvalue, *ptraceback;
4713  if (c_line) {
4714  c_line = __Pyx_CLineForTraceback(tstate, c_line);
4715  }
4716  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
4717  if (!py_code) {
4718  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
4719  py_code = __Pyx_CreateCodeObjectForTraceback(
4720  funcname, c_line, py_line, filename);
4721  if (!py_code) {
4722  /* If the code object creation fails, then we should clear the
4723  fetched exception references and propagate the new exception */
4724  Py_XDECREF(ptype);
4725  Py_XDECREF(pvalue);
4726  Py_XDECREF(ptraceback);
4727  goto bad;
4728  }
4729  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
4730  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
4731  }
4732  py_frame = PyFrame_New(
4733  tstate, /*PyThreadState *tstate,*/
4734  py_code, /*PyCodeObject *code,*/
4735  __pyx_d, /*PyObject *globals,*/
4736  0 /*PyObject *locals*/
4737  );
4738  if (!py_frame) goto bad;
4739  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
4740  PyTraceBack_Here(py_frame);
4741 bad:
4742  Py_XDECREF(py_code);
4743  Py_XDECREF(py_frame);
4744 }
4745 
4746 /* Declarations */
4747 #if CYTHON_CCOMPLEX
4748  #ifdef __cplusplus
4749  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
4750  return ::std::complex< float >(x, y);
4751  }
4752  #else
4753  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
4754  return x + y*(__pyx_t_float_complex)_Complex_I;
4755  }
4756  #endif
4757 #else
4758  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
4759  __pyx_t_float_complex z;
4760  z.real = x;
4761  z.imag = y;
4762  return z;
4763  }
4764 #endif
4765 
4766 /* Arithmetic */
4767 #if CYTHON_CCOMPLEX
4768 #else
4769  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
4770  return (a.real == b.real) && (a.imag == b.imag);
4771  }
4772  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
4773  __pyx_t_float_complex z;
4774  z.real = a.real + b.real;
4775  z.imag = a.imag + b.imag;
4776  return z;
4777  }
4778  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
4779  __pyx_t_float_complex z;
4780  z.real = a.real - b.real;
4781  z.imag = a.imag - b.imag;
4782  return z;
4783  }
4784  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
4785  __pyx_t_float_complex z;
4786  z.real = a.real * b.real - a.imag * b.imag;
4787  z.imag = a.real * b.imag + a.imag * b.real;
4788  return z;
4789  }
4790  #if 1
4791  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
4792  if (b.imag == 0) {
4793  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
4794  } else if (fabsf(b.real) >= fabsf(b.imag)) {
4795  if (b.real == 0 && b.imag == 0) {
4796  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
4797  } else {
4798  float r = b.imag / b.real;
4799  float s = (float)(1.0) / (b.real + b.imag * r);
4800  return __pyx_t_float_complex_from_parts(
4801  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
4802  }
4803  } else {
4804  float r = b.real / b.imag;
4805  float s = (float)(1.0) / (b.imag + b.real * r);
4806  return __pyx_t_float_complex_from_parts(
4807  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
4808  }
4809  }
4810  #else
4811  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
4812  if (b.imag == 0) {
4813  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
4814  } else {
4815  float denom = b.real * b.real + b.imag * b.imag;
4816  return __pyx_t_float_complex_from_parts(
4817  (a.real * b.real + a.imag * b.imag) / denom,
4818  (a.imag * b.real - a.real * b.imag) / denom);
4819  }
4820  }
4821  #endif
4822  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
4823  __pyx_t_float_complex z;
4824  z.real = -a.real;
4825  z.imag = -a.imag;
4826  return z;
4827  }
4828  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
4829  return (a.real == 0) && (a.imag == 0);
4830  }
4831  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
4832  __pyx_t_float_complex z;
4833  z.real = a.real;
4834  z.imag = -a.imag;
4835  return z;
4836  }
4837  #if 1
4838  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
4839  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
4840  return sqrtf(z.real*z.real + z.imag*z.imag);
4841  #else
4842  return hypotf(z.real, z.imag);
4843  #endif
4844  }
4845  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
4846  __pyx_t_float_complex z;
4847  float r, lnr, theta, z_r, z_theta;
4848  if (b.imag == 0 && b.real == (int)b.real) {
4849  if (b.real < 0) {
4850  float denom = a.real * a.real + a.imag * a.imag;
4851  a.real = a.real / denom;
4852  a.imag = -a.imag / denom;
4853  b.real = -b.real;
4854  }
4855  switch ((int)b.real) {
4856  case 0:
4857  z.real = 1;
4858  z.imag = 0;
4859  return z;
4860  case 1:
4861  return a;
4862  case 2:
4863  return __Pyx_c_prod_float(a, a);
4864  case 3:
4865  z = __Pyx_c_prod_float(a, a);
4866  return __Pyx_c_prod_float(z, a);
4867  case 4:
4868  z = __Pyx_c_prod_float(a, a);
4869  return __Pyx_c_prod_float(z, z);
4870  }
4871  }
4872  if (a.imag == 0) {
4873  if (a.real == 0) {
4874  return a;
4875  } else if (b.imag == 0) {
4876  z.real = powf(a.real, b.real);
4877  z.imag = 0;
4878  return z;
4879  } else if (a.real > 0) {
4880  r = a.real;
4881  theta = 0;
4882  } else {
4883  r = -a.real;
4884  theta = atan2f(0.0, -1.0);
4885  }
4886  } else {
4887  r = __Pyx_c_abs_float(a);
4888  theta = atan2f(a.imag, a.real);
4889  }
4890  lnr = logf(r);
4891  z_r = expf(lnr * b.real - theta * b.imag);
4892  z_theta = theta * b.real + lnr * b.imag;
4893  z.real = z_r * cosf(z_theta);
4894  z.imag = z_r * sinf(z_theta);
4895  return z;
4896  }
4897  #endif
4898 #endif
4899 
4900 /* Declarations */
4901 #if CYTHON_CCOMPLEX
4902  #ifdef __cplusplus
4903  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
4904  return ::std::complex< double >(x, y);
4905  }
4906  #else
4907  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
4908  return x + y*(__pyx_t_double_complex)_Complex_I;
4909  }
4910  #endif
4911 #else
4912  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
4913  __pyx_t_double_complex z;
4914  z.real = x;
4915  z.imag = y;
4916  return z;
4917  }
4918 #endif
4919 
4920 /* Arithmetic */
4921 #if CYTHON_CCOMPLEX
4922 #else
4923  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
4924  return (a.real == b.real) && (a.imag == b.imag);
4925  }
4926  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
4927  __pyx_t_double_complex z;
4928  z.real = a.real + b.real;
4929  z.imag = a.imag + b.imag;
4930  return z;
4931  }
4932  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
4933  __pyx_t_double_complex z;
4934  z.real = a.real - b.real;
4935  z.imag = a.imag - b.imag;
4936  return z;
4937  }
4938  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
4939  __pyx_t_double_complex z;
4940  z.real = a.real * b.real - a.imag * b.imag;
4941  z.imag = a.real * b.imag + a.imag * b.real;
4942  return z;
4943  }
4944  #if 1
4945  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
4946  if (b.imag == 0) {
4947  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
4948  } else if (fabs(b.real) >= fabs(b.imag)) {
4949  if (b.real == 0 && b.imag == 0) {
4950  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
4951  } else {
4952  double r = b.imag / b.real;
4953  double s = (double)(1.0) / (b.real + b.imag * r);
4954  return __pyx_t_double_complex_from_parts(
4955  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
4956  }
4957  } else {
4958  double r = b.real / b.imag;
4959  double s = (double)(1.0) / (b.imag + b.real * r);
4960  return __pyx_t_double_complex_from_parts(
4961  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
4962  }
4963  }
4964  #else
4965  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
4966  if (b.imag == 0) {
4967  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
4968  } else {
4969  double denom = b.real * b.real + b.imag * b.imag;
4970  return __pyx_t_double_complex_from_parts(
4971  (a.real * b.real + a.imag * b.imag) / denom,
4972  (a.imag * b.real - a.real * b.imag) / denom);
4973  }
4974  }
4975  #endif
4976  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
4977  __pyx_t_double_complex z;
4978  z.real = -a.real;
4979  z.imag = -a.imag;
4980  return z;
4981  }
4982  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
4983  return (a.real == 0) && (a.imag == 0);
4984  }
4985  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
4986  __pyx_t_double_complex z;
4987  z.real = a.real;
4988  z.imag = -a.imag;
4989  return z;
4990  }
4991  #if 1
4992  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
4993  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
4994  return sqrt(z.real*z.real + z.imag*z.imag);
4995  #else
4996  return hypot(z.real, z.imag);
4997  #endif
4998  }
4999  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
5000  __pyx_t_double_complex z;
5001  double r, lnr, theta, z_r, z_theta;
5002  if (b.imag == 0 && b.real == (int)b.real) {
5003  if (b.real < 0) {
5004  double denom = a.real * a.real + a.imag * a.imag;
5005  a.real = a.real / denom;
5006  a.imag = -a.imag / denom;
5007  b.real = -b.real;
5008  }
5009  switch ((int)b.real) {
5010  case 0:
5011  z.real = 1;
5012  z.imag = 0;
5013  return z;
5014  case 1:
5015  return a;
5016  case 2:
5017  return __Pyx_c_prod_double(a, a);
5018  case 3:
5019  z = __Pyx_c_prod_double(a, a);
5020  return __Pyx_c_prod_double(z, a);
5021  case 4:
5022  z = __Pyx_c_prod_double(a, a);
5023  return __Pyx_c_prod_double(z, z);
5024  }
5025  }
5026  if (a.imag == 0) {
5027  if (a.real == 0) {
5028  return a;
5029  } else if (b.imag == 0) {
5030  z.real = pow(a.real, b.real);
5031  z.imag = 0;
5032  return z;
5033  } else if (a.real > 0) {
5034  r = a.real;
5035  theta = 0;
5036  } else {
5037  r = -a.real;
5038  theta = atan2(0.0, -1.0);
5039  }
5040  } else {
5041  r = __Pyx_c_abs_double(a);
5042  theta = atan2(a.imag, a.real);
5043  }
5044  lnr = log(r);
5045  z_r = exp(lnr * b.real - theta * b.imag);
5046  z_theta = theta * b.real + lnr * b.imag;
5047  z.real = z_r * cos(z_theta);
5048  z.imag = z_r * sin(z_theta);
5049  return z;
5050  }
5051  #endif
5052 #endif
5053 
5054 /* CIntToPy */
5055 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
5056 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
5057 #pragma GCC diagnostic push
5058 #pragma GCC diagnostic ignored "-Wconversion"
5059 #endif
5060  const long neg_one = (long) -1, const_zero = (long) 0;
5061 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
5062 #pragma GCC diagnostic pop
5063 #endif
5064  const int is_unsigned = neg_one > const_zero;
5065  if (is_unsigned) {
5066  if (sizeof(long) < sizeof(long)) {
5067  return PyInt_FromLong((long) value);
5068  } else if (sizeof(long) <= sizeof(unsigned long)) {
5069  return PyLong_FromUnsignedLong((unsigned long) value);
5070 #ifdef HAVE_LONG_LONG
5071  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
5072  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
5073 #endif
5074  }
5075  } else {
5076  if (sizeof(long) <= sizeof(long)) {
5077  return PyInt_FromLong((long) value);
5078 #ifdef HAVE_LONG_LONG
5079  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
5080  return PyLong_FromLongLong((PY_LONG_LONG) value);
5081 #endif
5082  }
5083  }
5084  {
5085  int one = 1; int little = (int)*(unsigned char *)&one;
5086  unsigned char *bytes = (unsigned char *)&value;
5087  return _PyLong_FromByteArray(bytes, sizeof(long),
5088  little, !is_unsigned);
5089  }
5090 }
5091 
5092 /* CIntFromPyVerify */
5093 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
5094  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
5095 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
5096  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
5097 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
5098  {\
5099  func_type value = func_value;\
5100  if (sizeof(target_type) < sizeof(func_type)) {\
5101  if (unlikely(value != (func_type) (target_type) value)) {\
5102  func_type zero = 0;\
5103  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
5104  return (target_type) -1;\
5105  if (is_unsigned && unlikely(value < zero))\
5106  goto raise_neg_overflow;\
5107  else\
5108  goto raise_overflow;\
5109  }\
5110  }\
5111  return (target_type) value;\
5112  }
5113 
5114 /* CIntFromPy */
5115 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
5116 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
5117 #pragma GCC diagnostic push
5118 #pragma GCC diagnostic ignored "-Wconversion"
5119 #endif
5120  const long neg_one = (long) -1, const_zero = (long) 0;
5121 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
5122 #pragma GCC diagnostic pop
5123 #endif
5124  const int is_unsigned = neg_one > const_zero;
5125 #if PY_MAJOR_VERSION < 3
5126  if (likely(PyInt_Check(x))) {
5127  if (sizeof(long) < sizeof(long)) {
5128  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
5129  } else {
5130  long val = PyInt_AS_LONG(x);
5131  if (is_unsigned && unlikely(val < 0)) {
5132  goto raise_neg_overflow;
5133  }
5134  return (long) val;
5135  }
5136  } else
5137 #endif
5138  if (likely(PyLong_Check(x))) {
5139  if (is_unsigned) {
5140 #if CYTHON_USE_PYLONG_INTERNALS
5141  const digit* digits = ((PyLongObject*)x)->ob_digit;
5142  switch (Py_SIZE(x)) {
5143  case 0: return (long) 0;
5144  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
5145  case 2:
5146  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
5147  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
5148  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5149  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
5150  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
5151  }
5152  }
5153  break;
5154  case 3:
5155  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
5156  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
5157  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5158  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
5159  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
5160  }
5161  }
5162  break;
5163  case 4:
5164  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
5165  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
5166  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5167  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
5168  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
5169  }
5170  }
5171  break;
5172  }
5173 #endif
5174 #if CYTHON_COMPILING_IN_CPYTHON
5175  if (unlikely(Py_SIZE(x) < 0)) {
5176  goto raise_neg_overflow;
5177  }
5178 #else
5179  {
5180  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
5181  if (unlikely(result < 0))
5182  return (long) -1;
5183  if (unlikely(result == 1))
5184  goto raise_neg_overflow;
5185  }
5186 #endif
5187  if (sizeof(long) <= sizeof(unsigned long)) {
5188  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
5189 #ifdef HAVE_LONG_LONG
5190  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
5191  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
5192 #endif
5193  }
5194  } else {
5195 #if CYTHON_USE_PYLONG_INTERNALS
5196  const digit* digits = ((PyLongObject*)x)->ob_digit;
5197  switch (Py_SIZE(x)) {
5198  case 0: return (long) 0;
5199  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
5200  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
5201  case -2:
5202  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
5203  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
5204  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5205  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
5206  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
5207  }
5208  }
5209  break;
5210  case 2:
5211  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
5212  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
5213  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5214  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
5215  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
5216  }
5217  }
5218  break;
5219  case -3:
5220  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
5221  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
5222  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5223  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
5224  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
5225  }
5226  }
5227  break;
5228  case 3:
5229  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
5230  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
5231  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5232  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
5233  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
5234  }
5235  }
5236  break;
5237  case -4:
5238  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
5239  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
5240  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5241  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
5242  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
5243  }
5244  }
5245  break;
5246  case 4:
5247  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
5248  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
5249  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5250  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
5251  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
5252  }
5253  }
5254  break;
5255  }
5256 #endif
5257  if (sizeof(long) <= sizeof(long)) {
5258  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
5259 #ifdef HAVE_LONG_LONG
5260  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
5261  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
5262 #endif
5263  }
5264  }
5265  {
5266 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
5267  PyErr_SetString(PyExc_RuntimeError,
5268  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
5269 #else
5270  long val;
5271  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
5272  #if PY_MAJOR_VERSION < 3
5273  if (likely(v) && !PyLong_Check(v)) {
5274  PyObject *tmp = v;
5275  v = PyNumber_Long(tmp);
5276  Py_DECREF(tmp);
5277  }
5278  #endif
5279  if (likely(v)) {
5280  int one = 1; int is_little = (int)*(unsigned char *)&one;
5281  unsigned char *bytes = (unsigned char *)&val;
5282  int ret = _PyLong_AsByteArray((PyLongObject *)v,
5283  bytes, sizeof(val),
5284  is_little, !is_unsigned);
5285  Py_DECREF(v);
5286  if (likely(!ret))
5287  return val;
5288  }
5289 #endif
5290  return (long) -1;
5291  }
5292  } else {
5293  long val;
5294  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
5295  if (!tmp) return (long) -1;
5296  val = __Pyx_PyInt_As_long(tmp);
5297  Py_DECREF(tmp);
5298  return val;
5299  }
5300 raise_overflow:
5301  PyErr_SetString(PyExc_OverflowError,
5302  "value too large to convert to long");
5303  return (long) -1;
5304 raise_neg_overflow:
5305  PyErr_SetString(PyExc_OverflowError,
5306  "can't convert negative value to long");
5307  return (long) -1;
5308 }
5309 
5310 /* CIntFromPy */
5311 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
5312 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
5313 #pragma GCC diagnostic push
5314 #pragma GCC diagnostic ignored "-Wconversion"
5315 #endif
5316  const int neg_one = (int) -1, const_zero = (int) 0;
5317 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
5318 #pragma GCC diagnostic pop
5319 #endif
5320  const int is_unsigned = neg_one > const_zero;
5321 #if PY_MAJOR_VERSION < 3
5322  if (likely(PyInt_Check(x))) {
5323  if (sizeof(int) < sizeof(long)) {
5324  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
5325  } else {
5326  long val = PyInt_AS_LONG(x);
5327  if (is_unsigned && unlikely(val < 0)) {
5328  goto raise_neg_overflow;
5329  }
5330  return (int) val;
5331  }
5332  } else
5333 #endif
5334  if (likely(PyLong_Check(x))) {
5335  if (is_unsigned) {
5336 #if CYTHON_USE_PYLONG_INTERNALS
5337  const digit* digits = ((PyLongObject*)x)->ob_digit;
5338  switch (Py_SIZE(x)) {
5339  case 0: return (int) 0;
5340  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
5341  case 2:
5342  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
5343  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
5344  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5345  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
5346  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
5347  }
5348  }
5349  break;
5350  case 3:
5351  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
5352  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
5353  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5354  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
5355  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
5356  }
5357  }
5358  break;
5359  case 4:
5360  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
5361  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
5362  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5363  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
5364  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
5365  }
5366  }
5367  break;
5368  }
5369 #endif
5370 #if CYTHON_COMPILING_IN_CPYTHON
5371  if (unlikely(Py_SIZE(x) < 0)) {
5372  goto raise_neg_overflow;
5373  }
5374 #else
5375  {
5376  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
5377  if (unlikely(result < 0))
5378  return (int) -1;
5379  if (unlikely(result == 1))
5380  goto raise_neg_overflow;
5381  }
5382 #endif
5383  if (sizeof(int) <= sizeof(unsigned long)) {
5384  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
5385 #ifdef HAVE_LONG_LONG
5386  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
5387  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
5388 #endif
5389  }
5390  } else {
5391 #if CYTHON_USE_PYLONG_INTERNALS
5392  const digit* digits = ((PyLongObject*)x)->ob_digit;
5393  switch (Py_SIZE(x)) {
5394  case 0: return (int) 0;
5395  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
5396  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
5397  case -2:
5398  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
5399  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
5400  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5401  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
5402  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
5403  }
5404  }
5405  break;
5406  case 2:
5407  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
5408  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
5409  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5410  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
5411  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
5412  }
5413  }
5414  break;
5415  case -3:
5416  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
5417  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
5418  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5419  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
5420  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
5421  }
5422  }
5423  break;
5424  case 3:
5425  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
5426  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
5427  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5428  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
5429  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
5430  }
5431  }
5432  break;
5433  case -4:
5434  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
5435  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
5436  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5437  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
5438  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
5439  }
5440  }
5441  break;
5442  case 4:
5443  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
5444  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
5445  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
5446  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
5447  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
5448  }
5449  }
5450  break;
5451  }
5452 #endif
5453  if (sizeof(int) <= sizeof(long)) {
5454  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
5455 #ifdef HAVE_LONG_LONG
5456  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
5457  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
5458 #endif
5459  }
5460  }
5461  {
5462 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
5463  PyErr_SetString(PyExc_RuntimeError,
5464  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
5465 #else
5466  int val;
5467  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
5468  #if PY_MAJOR_VERSION < 3
5469  if (likely(v) && !PyLong_Check(v)) {
5470  PyObject *tmp = v;
5471  v = PyNumber_Long(tmp);
5472  Py_DECREF(tmp);
5473  }
5474  #endif
5475  if (likely(v)) {
5476  int one = 1; int is_little = (int)*(unsigned char *)&one;
5477  unsigned char *bytes = (unsigned char *)&val;
5478  int ret = _PyLong_AsByteArray((PyLongObject *)v,
5479  bytes, sizeof(val),
5480  is_little, !is_unsigned);
5481  Py_DECREF(v);
5482  if (likely(!ret))
5483  return val;
5484  }
5485 #endif
5486  return (int) -1;
5487  }
5488  } else {
5489  int val;
5490  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
5491  if (!tmp) return (int) -1;
5492  val = __Pyx_PyInt_As_int(tmp);
5493  Py_DECREF(tmp);
5494  return val;
5495  }
5496 raise_overflow:
5497  PyErr_SetString(PyExc_OverflowError,
5498  "value too large to convert to int");
5499  return (int) -1;
5500 raise_neg_overflow:
5501  PyErr_SetString(PyExc_OverflowError,
5502  "can't convert negative value to int");
5503  return (int) -1;
5504 }
5505 
5506 /* FastTypeChecks */
5507 #if CYTHON_COMPILING_IN_CPYTHON
5508 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
5509  while (a) {
5510  a = a->tp_base;
5511  if (a == b)
5512  return 1;
5513  }
5514  return b == &PyBaseObject_Type;
5515 }
5516 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
5517  PyObject *mro;
5518  if (a == b) return 1;
5519  mro = a->tp_mro;
5520  if (likely(mro)) {
5521  Py_ssize_t i, n;
5522  n = PyTuple_GET_SIZE(mro);
5523  for (i = 0; i < n; i++) {
5524  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
5525  return 1;
5526  }
5527  return 0;
5528  }
5529  return __Pyx_InBases(a, b);
5530 }
5531 #if PY_MAJOR_VERSION == 2
5532 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
5533  PyObject *exception, *value, *tb;
5534  int res;
5535  __Pyx_PyThreadState_declare
5536  __Pyx_PyThreadState_assign
5537  __Pyx_ErrFetch(&exception, &value, &tb);
5538  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
5539  if (unlikely(res == -1)) {
5540  PyErr_WriteUnraisable(err);
5541  res = 0;
5542  }
5543  if (!res) {
5544  res = PyObject_IsSubclass(err, exc_type2);
5545  if (unlikely(res == -1)) {
5546  PyErr_WriteUnraisable(err);
5547  res = 0;
5548  }
5549  }
5550  __Pyx_ErrRestore(exception, value, tb);
5551  return res;
5552 }
5553 #else
5554 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
5555  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
5556  if (!res) {
5557  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
5558  }
5559  return res;
5560 }
5561 #endif
5562 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
5563  Py_ssize_t i, n;
5564  assert(PyExceptionClass_Check(exc_type));
5565  n = PyTuple_GET_SIZE(tuple);
5566 #if PY_MAJOR_VERSION >= 3
5567  for (i=0; i<n; i++) {
5568  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
5569  }
5570 #endif
5571  for (i=0; i<n; i++) {
5572  PyObject *t = PyTuple_GET_ITEM(tuple, i);
5573  #if PY_MAJOR_VERSION < 3
5574  if (likely(exc_type == t)) return 1;
5575  #endif
5576  if (likely(PyExceptionClass_Check(t))) {
5577  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
5578  } else {
5579  }
5580  }
5581  return 0;
5582 }
5583 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
5584  if (likely(err == exc_type)) return 1;
5585  if (likely(PyExceptionClass_Check(err))) {
5586  if (likely(PyExceptionClass_Check(exc_type))) {
5587  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
5588  } else if (likely(PyTuple_Check(exc_type))) {
5589  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
5590  } else {
5591  }
5592  }
5593  return PyErr_GivenExceptionMatches(err, exc_type);
5594 }
5595 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
5596  assert(PyExceptionClass_Check(exc_type1));
5597  assert(PyExceptionClass_Check(exc_type2));
5598  if (likely(err == exc_type1 || err == exc_type2)) return 1;
5599  if (likely(PyExceptionClass_Check(err))) {
5600  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
5601  }
5602  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
5603 }
5604 #endif
5605 
5606 /* CheckBinaryVersion */
5607 static int __Pyx_check_binary_version(void) {
5608  char ctversion[5];
5609  int same=1, i, found_dot;
5610  const char* rt_from_call = Py_GetVersion();
5611  PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
5612  found_dot = 0;
5613  for (i = 0; i < 4; i++) {
5614  if (!ctversion[i]) {
5615  same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
5616  break;
5617  }
5618  if (rt_from_call[i] != ctversion[i]) {
5619  same = 0;
5620  break;
5621  }
5622  }
5623  if (!same) {
5624  char rtversion[5] = {'\0'};
5625  char message[200];
5626  for (i=0; i<4; ++i) {
5627  if (rt_from_call[i] == '.') {
5628  if (found_dot) break;
5629  found_dot = 1;
5630  } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
5631  break;
5632  }
5633  rtversion[i] = rt_from_call[i];
5634  }
5635  PyOS_snprintf(message, sizeof(message),
5636  "compiletime version %s of module '%.100s' "
5637  "does not match runtime version %s",
5638  ctversion, __Pyx_MODULE_NAME, rtversion);
5639  return PyErr_WarnEx(NULL, message, 1);
5640  }
5641  return 0;
5642 }
5643 
5644 /* InitStrings */
5645 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
5646  while (t->p) {
5647  #if PY_MAJOR_VERSION < 3
5648  if (t->is_unicode) {
5649  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
5650  } else if (t->intern) {
5651  *t->p = PyString_InternFromString(t->s);
5652  } else {
5653  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
5654  }
5655  #else
5656  if (t->is_unicode | t->is_str) {
5657  if (t->intern) {
5658  *t->p = PyUnicode_InternFromString(t->s);
5659  } else if (t->encoding) {
5660  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
5661  } else {
5662  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
5663  }
5664  } else {
5665  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
5666  }
5667  #endif
5668  if (!*t->p)
5669  return -1;
5670  if (PyObject_Hash(*t->p) == -1)
5671  return -1;
5672  ++t;
5673  }
5674  return 0;
5675 }
5676 
5677 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
5678  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
5679 }
5680 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
5681  Py_ssize_t ignore;
5682  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
5683 }
5684 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
5685 #if !CYTHON_PEP393_ENABLED
5686 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
5687  char* defenc_c;
5688  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
5689  if (!defenc) return NULL;
5690  defenc_c = PyBytes_AS_STRING(defenc);
5691 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
5692  {
5693  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
5694  char* c;
5695  for (c = defenc_c; c < end; c++) {
5696  if ((unsigned char) (*c) >= 128) {
5697  PyUnicode_AsASCIIString(o);
5698  return NULL;
5699  }
5700  }
5701  }
5702 #endif
5703  *length = PyBytes_GET_SIZE(defenc);
5704  return defenc_c;
5705 }
5706 #else
5707 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
5708  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
5709 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
5710  if (likely(PyUnicode_IS_ASCII(o))) {
5711  *length = PyUnicode_GET_LENGTH(o);
5712  return PyUnicode_AsUTF8(o);
5713  } else {
5714  PyUnicode_AsASCIIString(o);
5715  return NULL;
5716  }
5717 #else
5718  return PyUnicode_AsUTF8AndSize(o, length);
5719 #endif
5720 }
5721 #endif
5722 #endif
5723 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
5724 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
5725  if (
5726 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
5727  __Pyx_sys_getdefaultencoding_not_ascii &&
5728 #endif
5729  PyUnicode_Check(o)) {
5730  return __Pyx_PyUnicode_AsStringAndSize(o, length);
5731  } else
5732 #endif
5733 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
5734  if (PyByteArray_Check(o)) {
5735  *length = PyByteArray_GET_SIZE(o);
5736  return PyByteArray_AS_STRING(o);
5737  } else
5738 #endif
5739  {
5740  char* result;
5741  int r = PyBytes_AsStringAndSize(o, &result, length);
5742  if (unlikely(r < 0)) {
5743  return NULL;
5744  } else {
5745  return result;
5746  }
5747  }
5748 }
5749 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
5750  int is_true = x == Py_True;
5751  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
5752  else return PyObject_IsTrue(x);
5753 }
5754 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
5755  int retval;
5756  if (unlikely(!x)) return -1;
5757  retval = __Pyx_PyObject_IsTrue(x);
5758  Py_DECREF(x);
5759  return retval;
5760 }
5761 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
5762 #if PY_MAJOR_VERSION >= 3
5763  if (PyLong_Check(result)) {
5764  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
5765  "__int__ returned non-int (type %.200s). "
5766  "The ability to return an instance of a strict subclass of int "
5767  "is deprecated, and may be removed in a future version of Python.",
5768  Py_TYPE(result)->tp_name)) {
5769  Py_DECREF(result);
5770  return NULL;
5771  }
5772  return result;
5773  }
5774 #endif
5775  PyErr_Format(PyExc_TypeError,
5776  "__%.4s__ returned non-%.4s (type %.200s)",
5777  type_name, type_name, Py_TYPE(result)->tp_name);
5778  Py_DECREF(result);
5779  return NULL;
5780 }
5781 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
5782 #if CYTHON_USE_TYPE_SLOTS
5783  PyNumberMethods *m;
5784 #endif
5785  const char *name = NULL;
5786  PyObject *res = NULL;
5787 #if PY_MAJOR_VERSION < 3
5788  if (likely(PyInt_Check(x) || PyLong_Check(x)))
5789 #else
5790  if (likely(PyLong_Check(x)))
5791 #endif
5792  return __Pyx_NewRef(x);
5793 #if CYTHON_USE_TYPE_SLOTS
5794  m = Py_TYPE(x)->tp_as_number;
5795  #if PY_MAJOR_VERSION < 3
5796  if (m && m->nb_int) {
5797  name = "int";
5798  res = m->nb_int(x);
5799  }
5800  else if (m && m->nb_long) {
5801  name = "long";
5802  res = m->nb_long(x);
5803  }
5804  #else
5805  if (likely(m && m->nb_int)) {
5806  name = "int";
5807  res = m->nb_int(x);
5808  }
5809  #endif
5810 #else
5811  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
5812  res = PyNumber_Int(x);
5813  }
5814 #endif
5815  if (likely(res)) {
5816 #if PY_MAJOR_VERSION < 3
5817  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
5818 #else
5819  if (unlikely(!PyLong_CheckExact(res))) {
5820 #endif
5821  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
5822  }
5823  }
5824  else if (!PyErr_Occurred()) {
5825  PyErr_SetString(PyExc_TypeError,
5826  "an integer is required");
5827  }
5828  return res;
5829 }
5830 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
5831  Py_ssize_t ival;
5832  PyObject *x;
5833 #if PY_MAJOR_VERSION < 3
5834  if (likely(PyInt_CheckExact(b))) {
5835  if (sizeof(Py_ssize_t) >= sizeof(long))
5836  return PyInt_AS_LONG(b);
5837  else
5838  return PyInt_AsSsize_t(b);
5839  }
5840 #endif
5841  if (likely(PyLong_CheckExact(b))) {
5842  #if CYTHON_USE_PYLONG_INTERNALS
5843  const digit* digits = ((PyLongObject*)b)->ob_digit;
5844  const Py_ssize_t size = Py_SIZE(b);
5845  if (likely(__Pyx_sst_abs(size) <= 1)) {
5846  ival = likely(size) ? digits[0] : 0;
5847  if (size == -1) ival = -ival;
5848  return ival;
5849  } else {
5850  switch (size) {
5851  case 2:
5852  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
5853  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
5854  }
5855  break;
5856  case -2:
5857  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
5858  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
5859  }
5860  break;
5861  case 3:
5862  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
5863  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
5864  }
5865  break;
5866  case -3:
5867  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
5868  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
5869  }
5870  break;
5871  case 4:
5872  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
5873  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
5874  }
5875  break;
5876  case -4:
5877  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
5878  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
5879  }
5880  break;
5881  }
5882  }
5883  #endif
5884  return PyLong_AsSsize_t(b);
5885  }
5886  x = PyNumber_Index(b);
5887  if (!x) return -1;
5888  ival = PyInt_AsSsize_t(x);
5889  Py_DECREF(x);
5890  return ival;
5891 }
5892 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
5893  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
5894  return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
5895 #if PY_MAJOR_VERSION < 3
5896  } else if (likely(PyInt_CheckExact(o))) {
5897  return PyInt_AS_LONG(o);
5898 #endif
5899  } else {
5900  Py_ssize_t ival;
5901  PyObject *x;
5902  x = PyNumber_Index(o);
5903  if (!x) return -1;
5904  ival = PyInt_AsLong(x);
5905  Py_DECREF(x);
5906  return ival;
5907  }
5908 }
5909 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
5910  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
5911 }
5912 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
5913  return PyInt_FromSize_t(ival);
5914 }
5915 
5916 
5917 #endif /* Py_PYTHON_H */
PskRelation::dpsic
double dpsic
Definition: pskRelations.h:31
PskRelation::dSe_dpsic
double dSe_dpsic
Definition: pskRelations.h:33
PskRelation::dkrn
double dkrn
Definition: pskRelations.h:29
PskRelation::krn
double krn
Definition: pskRelations.h:28
VGM::setTolerances
virtual void setTolerances(const double *rwork_tol)
Definition: pskRelations.h:253
f
Double f
Definition: Headers.h:64
s
Double s
Definition: Headers.h:84
PskRelation::dkrw
double dkrw
Definition: pskRelations.h:27
n
Int n
Definition: Headers.h:28
VGM::calc
void calc(const double &Sw)
Definition: pskRelations.h:266
U
Double U
Definition: Headers.h:88
v
Double v
Definition: Headers.h:95
T
Double T
Definition: Headers.h:87
VGM::calc_from_psic
virtual void calc_from_psic(const double &psicIn)
Definition: pskRelations.h:372
z
Double * z
Definition: Headers.h:49
u
Double u
Definition: Headers.h:89
c
Double c
Definition: Headers.h:54
PskRelation::Se
double Se
Definition: pskRelations.h:22
PskRelation::psic
double psic
Definition: pskRelations.h:30
pskRelations.h
r
Double r
Definition: Headers.h:83
VGM
Definition: pskRelations.h:220
pos
double pos(double a)
Definition: testFMMandFSW.cpp:8
PskRelation::krw
double krw
Definition: pskRelations.h:26