3 #ifndef PY_SSIZE_T_CLEAN
4 #define PY_SSIZE_T_CLEAN
8 #error Python headers needed to compile C extensions, please install development version of Python.
9 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
10 #error Cython requires Python 2.6+ or Python 3.3+.
12 #define CYTHON_ABI "0_29_30"
13 #define CYTHON_HEX_VERSION 0x001D1EF0
14 #define CYTHON_FUTURE_DIVISION 0
17 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
19 #if !defined(WIN32) && !defined(MS_WINDOWS)
31 #define DL_IMPORT(t) t
34 #define DL_EXPORT(t) t
37 #ifndef HAVE_LONG_LONG
38 #if PY_VERSION_HEX >= 0x02070000
39 #define HAVE_LONG_LONG
43 #define PY_LONG_LONG LONG_LONG
46 #define Py_HUGE_VAL HUGE_VAL
49 #define CYTHON_COMPILING_IN_PYPY 1
50 #define CYTHON_COMPILING_IN_PYSTON 0
51 #define CYTHON_COMPILING_IN_CPYTHON 0
52 #undef CYTHON_USE_TYPE_SLOTS
53 #define CYTHON_USE_TYPE_SLOTS 0
54 #undef CYTHON_USE_PYTYPE_LOOKUP
55 #define CYTHON_USE_PYTYPE_LOOKUP 0
56 #if PY_VERSION_HEX < 0x03050000
57 #undef CYTHON_USE_ASYNC_SLOTS
58 #define CYTHON_USE_ASYNC_SLOTS 0
59 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
60 #define CYTHON_USE_ASYNC_SLOTS 1
62 #undef CYTHON_USE_PYLIST_INTERNALS
63 #define CYTHON_USE_PYLIST_INTERNALS 0
64 #undef CYTHON_USE_UNICODE_INTERNALS
65 #define CYTHON_USE_UNICODE_INTERNALS 0
66 #undef CYTHON_USE_UNICODE_WRITER
67 #define CYTHON_USE_UNICODE_WRITER 0
68 #undef CYTHON_USE_PYLONG_INTERNALS
69 #define CYTHON_USE_PYLONG_INTERNALS 0
70 #undef CYTHON_AVOID_BORROWED_REFS
71 #define CYTHON_AVOID_BORROWED_REFS 1
72 #undef CYTHON_ASSUME_SAFE_MACROS
73 #define CYTHON_ASSUME_SAFE_MACROS 0
74 #undef CYTHON_UNPACK_METHODS
75 #define CYTHON_UNPACK_METHODS 0
76 #undef CYTHON_FAST_THREAD_STATE
77 #define CYTHON_FAST_THREAD_STATE 0
78 #undef CYTHON_FAST_PYCALL
79 #define CYTHON_FAST_PYCALL 0
80 #undef CYTHON_PEP489_MULTI_PHASE_INIT
81 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
82 #undef CYTHON_USE_TP_FINALIZE
83 #define CYTHON_USE_TP_FINALIZE 0
84 #undef CYTHON_USE_DICT_VERSIONS
85 #define CYTHON_USE_DICT_VERSIONS 0
86 #undef CYTHON_USE_EXC_INFO_STACK
87 #define CYTHON_USE_EXC_INFO_STACK 0
88 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
89 #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)
91 #elif defined(PYSTON_VERSION)
92 #define CYTHON_COMPILING_IN_PYPY 0
93 #define CYTHON_COMPILING_IN_PYSTON 1
94 #define CYTHON_COMPILING_IN_CPYTHON 0
95 #ifndef CYTHON_USE_TYPE_SLOTS
96 #define CYTHON_USE_TYPE_SLOTS 1
98 #undef CYTHON_USE_PYTYPE_LOOKUP
99 #define CYTHON_USE_PYTYPE_LOOKUP 0
100 #undef CYTHON_USE_ASYNC_SLOTS
101 #define CYTHON_USE_ASYNC_SLOTS 0
102 #undef CYTHON_USE_PYLIST_INTERNALS
103 #define CYTHON_USE_PYLIST_INTERNALS 0
104 #ifndef CYTHON_USE_UNICODE_INTERNALS
105 #define CYTHON_USE_UNICODE_INTERNALS 1
107 #undef CYTHON_USE_UNICODE_WRITER
108 #define CYTHON_USE_UNICODE_WRITER 0
109 #undef CYTHON_USE_PYLONG_INTERNALS
110 #define CYTHON_USE_PYLONG_INTERNALS 0
111 #ifndef CYTHON_AVOID_BORROWED_REFS
112 #define CYTHON_AVOID_BORROWED_REFS 0
114 #ifndef CYTHON_ASSUME_SAFE_MACROS
115 #define CYTHON_ASSUME_SAFE_MACROS 1
117 #ifndef CYTHON_UNPACK_METHODS
118 #define CYTHON_UNPACK_METHODS 1
120 #undef CYTHON_FAST_THREAD_STATE
121 #define CYTHON_FAST_THREAD_STATE 0
122 #undef CYTHON_FAST_PYCALL
123 #define CYTHON_FAST_PYCALL 0
124 #undef CYTHON_PEP489_MULTI_PHASE_INIT
125 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
126 #undef CYTHON_USE_TP_FINALIZE
127 #define CYTHON_USE_TP_FINALIZE 0
128 #undef CYTHON_USE_DICT_VERSIONS
129 #define CYTHON_USE_DICT_VERSIONS 0
130 #undef CYTHON_USE_EXC_INFO_STACK
131 #define CYTHON_USE_EXC_INFO_STACK 0
132 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
133 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
136 #define CYTHON_COMPILING_IN_PYPY 0
137 #define CYTHON_COMPILING_IN_PYSTON 0
138 #define CYTHON_COMPILING_IN_CPYTHON 1
139 #ifndef CYTHON_USE_TYPE_SLOTS
140 #define CYTHON_USE_TYPE_SLOTS 1
142 #if PY_VERSION_HEX < 0x02070000
143 #undef CYTHON_USE_PYTYPE_LOOKUP
144 #define CYTHON_USE_PYTYPE_LOOKUP 0
145 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
146 #define CYTHON_USE_PYTYPE_LOOKUP 1
148 #if PY_MAJOR_VERSION < 3
149 #undef CYTHON_USE_ASYNC_SLOTS
150 #define CYTHON_USE_ASYNC_SLOTS 0
151 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
152 #define CYTHON_USE_ASYNC_SLOTS 1
154 #if PY_VERSION_HEX < 0x02070000
155 #undef CYTHON_USE_PYLONG_INTERNALS
156 #define CYTHON_USE_PYLONG_INTERNALS 0
157 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
158 #define CYTHON_USE_PYLONG_INTERNALS 1
160 #ifndef CYTHON_USE_PYLIST_INTERNALS
161 #define CYTHON_USE_PYLIST_INTERNALS 1
163 #ifndef CYTHON_USE_UNICODE_INTERNALS
164 #define CYTHON_USE_UNICODE_INTERNALS 1
166 #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
167 #undef CYTHON_USE_UNICODE_WRITER
168 #define CYTHON_USE_UNICODE_WRITER 0
169 #elif !defined(CYTHON_USE_UNICODE_WRITER)
170 #define CYTHON_USE_UNICODE_WRITER 1
172 #ifndef CYTHON_AVOID_BORROWED_REFS
173 #define CYTHON_AVOID_BORROWED_REFS 0
175 #ifndef CYTHON_ASSUME_SAFE_MACROS
176 #define CYTHON_ASSUME_SAFE_MACROS 1
178 #ifndef CYTHON_UNPACK_METHODS
179 #define CYTHON_UNPACK_METHODS 1
181 #if PY_VERSION_HEX >= 0x030B00A4
182 #undef CYTHON_FAST_THREAD_STATE
183 #define CYTHON_FAST_THREAD_STATE 0
184 #elif !defined(CYTHON_FAST_THREAD_STATE)
185 #define CYTHON_FAST_THREAD_STATE 1
187 #ifndef CYTHON_FAST_PYCALL
188 #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
190 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
191 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
193 #ifndef CYTHON_USE_TP_FINALIZE
194 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
196 #ifndef CYTHON_USE_DICT_VERSIONS
197 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
199 #if PY_VERSION_HEX >= 0x030B00A4
200 #undef CYTHON_USE_EXC_INFO_STACK
201 #define CYTHON_USE_EXC_INFO_STACK 0
202 #elif !defined(CYTHON_USE_EXC_INFO_STACK)
203 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
205 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
206 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
209 #if !defined(CYTHON_FAST_PYCCALL)
210 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
212 #if CYTHON_USE_PYLONG_INTERNALS
213 #if PY_MAJOR_VERSION < 3
214 #include "longintrepr.h"
220 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
223 #ifndef __has_attribute
224 #define __has_attribute(x) 0
226 #ifndef __has_cpp_attribute
227 #define __has_cpp_attribute(x) 0
229 #ifndef CYTHON_RESTRICT
230 #if defined(__GNUC__)
231 #define CYTHON_RESTRICT __restrict__
232 #elif defined(_MSC_VER) && _MSC_VER >= 1400
233 #define CYTHON_RESTRICT __restrict
234 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
235 #define CYTHON_RESTRICT restrict
237 #define CYTHON_RESTRICT
240 #ifndef CYTHON_UNUSED
241 # if defined(__GNUC__)
242 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
243 # define CYTHON_UNUSED __attribute__ ((__unused__))
245 # define CYTHON_UNUSED
247 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
248 # define CYTHON_UNUSED __attribute__ ((__unused__))
250 # define CYTHON_UNUSED
253 #ifndef CYTHON_MAYBE_UNUSED_VAR
254 # if defined(__cplusplus)
255 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
257 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
260 #ifndef CYTHON_NCP_UNUSED
261 # if CYTHON_COMPILING_IN_CPYTHON
262 # define CYTHON_NCP_UNUSED
264 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
267 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
269 #ifndef _MSC_STDINT_H_
271 typedef unsigned char uint8_t;
272 typedef unsigned int uint32_t;
274 typedef unsigned __int8 uint8_t;
275 typedef unsigned __int32 uint32_t;
281 #ifndef CYTHON_FALLTHROUGH
282 #if defined(__cplusplus) && __cplusplus >= 201103L
283 #if __has_cpp_attribute(fallthrough)
284 #define CYTHON_FALLTHROUGH [[fallthrough]]
285 #elif __has_cpp_attribute(clang::fallthrough)
286 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
287 #elif __has_cpp_attribute(gnu::fallthrough)
288 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
291 #ifndef CYTHON_FALLTHROUGH
292 #if __has_attribute(fallthrough)
293 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
295 #define CYTHON_FALLTHROUGH
298 #if defined(__clang__ ) && defined(__apple_build_version__)
299 #if __apple_build_version__ < 7000000
300 #undef CYTHON_FALLTHROUGH
301 #define CYTHON_FALLTHROUGH
307 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
309 #ifndef CYTHON_INLINE
310 #if defined(__clang__)
311 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
313 #define CYTHON_INLINE inline
317 void __Pyx_call_destructor(
T& x) {
321 class __Pyx_FakeReference {
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; }
334 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
335 #define Py_OptimizeFlag 0
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
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;
384 if (!(call_result = PyObject_Call(replace, empty, kwds)))
goto cleanup_code_too;
385 Py_XDECREF((PyObject*)co);
386 co = (PyCodeObject*)call_result;
390 Py_XDECREF((PyObject*)co);
395 Py_XDECREF(argcount);
396 Py_XDECREF(posonlyargcount);
397 Py_XDECREF(kwonlyargcount);
399 Py_XDECREF(stacksize);
401 Py_XDECREF(call_result);
404 PyErr_Restore(type, value, traceback);
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)
412 #define __Pyx_DefaultClassType PyType_Type
414 #ifndef Py_TPFLAGS_CHECKTYPES
415 #define Py_TPFLAGS_CHECKTYPES 0
417 #ifndef Py_TPFLAGS_HAVE_INDEX
418 #define Py_TPFLAGS_HAVE_INDEX 0
420 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
421 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
423 #ifndef Py_TPFLAGS_HAVE_FINALIZE
424 #define Py_TPFLAGS_HAVE_FINALIZE 0
426 #ifndef METH_STACKLESS
427 #define METH_STACKLESS 0
429 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
430 #ifndef METH_FASTCALL
431 #define METH_FASTCALL 0x80
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);
437 #define __Pyx_PyCFunctionFast _PyCFunctionFast
438 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
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)))))
444 #define __Pyx_PyFastCFunction_Check(func) 0
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)
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)
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)
460 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
461 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
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()
470 #define __Pyx_PyThreadState_Current _PyThreadState_Current
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();
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;
485 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
488 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
489 return *key != Py_tss_NEEDS_INIT;
491 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
492 PyThread_delete_key(*key);
493 *key = Py_tss_NEEDS_INIT;
495 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
496 return PyThread_set_key_value(*key, value);
498 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
499 return PyThread_get_key_value(*key);
502 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
503 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
505 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
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)
511 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
512 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
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)
517 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
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)))
525 #define __Pyx_PyUnicode_READY(op) (0)
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))
538 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
541 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
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))
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)
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))
566 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
567 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
569 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
570 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
572 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
573 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
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)
580 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
582 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
583 #define PyObject_ASCII(o) PyObject_Repr(o)
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
595 #if PY_MAJOR_VERSION >= 3
596 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
597 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
599 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
600 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
602 #ifndef PySet_CheckExact
603 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
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)
609 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
610 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
612 #if CYTHON_ASSUME_SAFE_MACROS
613 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
615 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
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
634 #if PY_MAJOR_VERSION >= 3
635 #define PyBoolObject PyLongObject
637 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
638 #ifndef PyUnicode_InternFromString
639 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
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
647 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
648 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
650 #if PY_MAJOR_VERSION >= 3
651 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
653 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
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)
660 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
663 #define __Pyx_PyType_AsAsync(obj) NULL
665 #ifndef __Pyx_PyAsyncMethodsStruct
670 } __Pyx_PyAsyncMethodsStruct;
673 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
674 #if !defined(_USE_MATH_DEFINES)
675 #define _USE_MATH_DEFINES
680 #define __PYX_NAN() ((float) NAN)
682 static CYTHON_INLINE
float __PYX_NAN() {
684 memset(&value, 0xFF,
sizeof(value));
688 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
689 #define __Pyx_truncl trunc
691 #define __Pyx_truncl truncl
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; }
699 #ifndef __PYX_EXTERN_C
701 #define __PYX_EXTERN_C extern "C"
703 #define __PYX_EXTERN_C extern
707 #define __PYX_HAVE__fenton__Fenton
708 #define __PYX_HAVE_API__fenton__Fenton
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"
725 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
726 #define CYTHON_WITHOUT_ASSERTIONS
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;
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;
753 #if defined (__cplusplus) && __cplusplus >= 201103L
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)
767 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
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
780 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
781 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
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;
802 return (
size_t)(u_end -
u - 1);
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))
821 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
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))
827 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
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) {
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");
840 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
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;
848 char ascii_chars[128];
850 for (
c = 0;
c < 128;
c++) {
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) {
860 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
864 Py_DECREF(ascii_chars_u);
865 Py_DECREF(ascii_chars_b);
867 Py_DECREF(default_encoding);
870 Py_XDECREF(default_encoding);
871 Py_XDECREF(ascii_chars_u);
872 Py_XDECREF(ascii_chars_b);
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)
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) {
884 PyObject* default_encoding = NULL;
885 char* default_encoding_c;
886 sys = PyImport_ImportModule(
"sys");
888 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
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);
899 Py_XDECREF(default_encoding);
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)
911 #define likely(x) (x)
912 #define unlikely(x) (x)
914 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
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;
929 #if !defined(CYTHON_CCOMPLEX)
930 #if defined(__cplusplus)
931 #define CYTHON_CCOMPLEX 1
932 #elif defined(_Complex_I)
933 #define CYTHON_CCOMPLEX 1
935 #define CYTHON_CCOMPLEX 0
945 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
947 #define _Complex_I 1.0fj
951 static const char *__pyx_f[] = {
952 "proteus/fenton/Fenton.pyx",
964 typedef npy_int8 __pyx_t_5numpy_int8_t;
973 typedef npy_int16 __pyx_t_5numpy_int16_t;
982 typedef npy_int32 __pyx_t_5numpy_int32_t;
991 typedef npy_int64 __pyx_t_5numpy_int64_t;
1000 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1009 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1018 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1027 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1036 typedef npy_float32 __pyx_t_5numpy_float32_t;
1045 typedef npy_float64 __pyx_t_5numpy_float64_t;
1054 typedef npy_long __pyx_t_5numpy_int_t;
1063 typedef npy_longlong __pyx_t_5numpy_long_t;
1072 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1081 typedef npy_ulong __pyx_t_5numpy_uint_t;
1090 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1099 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1108 typedef npy_intp __pyx_t_5numpy_intp_t;
1117 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1126 typedef npy_double __pyx_t_5numpy_float_t;
1135 typedef npy_double __pyx_t_5numpy_double_t;
1144 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1148 typedef ::std::complex< float > __pyx_t_float_complex;
1150 typedef float _Complex __pyx_t_float_complex;
1153 typedef struct {
float real, imag; } __pyx_t_float_complex;
1155 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1160 typedef ::std::complex< double > __pyx_t_double_complex;
1162 typedef double _Complex __pyx_t_double_complex;
1165 typedef struct {
double real, imag; } __pyx_t_double_complex;
1167 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1179 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1188 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1197 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1206 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1210 #ifndef CYTHON_REFNANNY
1211 #define CYTHON_REFNANNY 0
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;
1226 #define __Pyx_RefNannySetupContext(name, 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);\
1232 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1235 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1236 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
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)
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)
1261 #define __Pyx_XDECREF_SET(r, v) do {\
1262 PyObject *tmp = (PyObject *) r;\
1263 r = v; __Pyx_XDECREF(tmp);\
1265 #define __Pyx_DECREF_SET(r, v) do {\
1266 PyObject *tmp = (PyObject *) r;\
1267 r = v; __Pyx_DECREF(tmp);\
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)
1273 #if CYTHON_USE_TYPE_SLOTS
1274 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1276 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1280 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1283 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1284 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1287 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1290 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1291 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1292 const char* function_name);
1295 #if CYTHON_COMPILING_IN_CPYTHON
1296 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1298 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1302 #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
1303 static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) {
1305 PyTypeObject *tp = Py_TYPE(obj);
1306 #if PY_MAJOR_VERSION < 3
1307 if (unlikely(PyInstance_Check(obj)))
1308 return __Pyx_PyObject_GetAttrStr(obj, attr_name);
1310 res = _PyType_Lookup(tp, attr_name);
1312 descrgetfunc
f = Py_TYPE(res)->tp_descr_get;
1316 res =
f(res, obj, (PyObject *)tp);
1319 PyErr_SetObject(PyExc_AttributeError, attr_name);
1324 #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
1328 #if CYTHON_FAST_PYCALL
1329 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1330 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1331 #if 1 || PY_VERSION_HEX < 0x030600B1
1332 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1334 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1336 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1337 (sizeof(char [1 - 2*!(cond)]) - 1)
1338 #ifndef Py_MEMBER_SIZE
1339 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1341 #if CYTHON_FAST_PYCALL
1342 static size_t __pyx_pyframe_localsplus_offset = 0;
1343 #include "frameobject.h"
1344 #if PY_VERSION_HEX >= 0x030b00a6
1345 #ifndef Py_BUILD_CORE
1346 #define Py_BUILD_CORE 1
1348 #include "internal/pycore_frame.h"
1350 #define __Pxy_PyFrame_Initialize_Offsets()\
1351 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1352 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1353 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1354 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1355 #endif // CYTHON_FAST_PYCALL
1359 #if CYTHON_COMPILING_IN_CPYTHON
1360 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1364 #if CYTHON_COMPILING_IN_CPYTHON
1365 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1367 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1371 #if CYTHON_FAST_PYCCALL
1372 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1374 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1378 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1384 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1387 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1390 #if PY_MAJOR_VERSION >= 3
1391 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1393 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1397 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1398 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1399 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1400 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1401 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1402 (cache_var) = (value);
1403 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1404 static PY_UINT64_T __pyx_dict_version = 0;\
1405 static PyObject *__pyx_dict_cached_value = NULL;\
1406 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1407 (VAR) = __pyx_dict_cached_value;\
1409 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1410 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1413 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1414 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1415 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1417 #define __PYX_GET_DICT_VERSION(dict) (0)
1418 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1419 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1423 #if CYTHON_USE_DICT_VERSIONS
1424 #define __Pyx_GetModuleGlobalName(var, name) {\
1425 static PY_UINT64_T __pyx_dict_version = 0;\
1426 static PyObject *__pyx_dict_cached_value = NULL;\
1427 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1428 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1429 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1431 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1432 PY_UINT64_T __pyx_dict_version;\
1433 PyObject *__pyx_dict_cached_value;\
1434 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1436 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1438 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1439 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1440 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1444 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1447 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
1450 #if CYTHON_USE_EXC_INFO_STACK
1451 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1455 #if CYTHON_FAST_THREAD_STATE
1456 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1457 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1458 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1460 #define __Pyx_PyThreadState_declare
1461 #define __Pyx_PyThreadState_assign
1462 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1466 #if CYTHON_FAST_THREAD_STATE
1467 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1468 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1469 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1470 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1472 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1473 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1477 #if CYTHON_FAST_THREAD_STATE
1478 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1479 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1481 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1485 #if CYTHON_FAST_THREAD_STATE
1486 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1487 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1488 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1489 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1490 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1491 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1492 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1493 #if CYTHON_COMPILING_IN_CPYTHON
1494 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1496 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1499 #define __Pyx_PyErr_Clear() PyErr_Clear()
1500 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1501 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1502 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1503 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1504 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1505 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1506 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1510 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1511 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1512 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1513 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1514 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1515 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1516 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1517 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1518 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1519 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1520 int wraparound,
int boundscheck);
1521 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1522 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1523 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1524 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1525 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1526 int wraparound,
int boundscheck);
1527 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1528 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1529 int is_list,
int wraparound,
int boundscheck);
1532 #if CYTHON_USE_TYPE_SLOTS
1533 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1535 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1539 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
1540 int result = PySequence_Contains(seq, item);
1541 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1545 #if CYTHON_FAST_THREAD_STATE
1546 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1547 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1549 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1553 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1556 #ifndef __PYX_HAVE_RT_ImportType_proto
1557 #define __PYX_HAVE_RT_ImportType_proto
1558 enum __Pyx_ImportType_CheckSize {
1559 __Pyx_ImportType_CheckSize_Error = 0,
1560 __Pyx_ImportType_CheckSize_Warn = 1,
1561 __Pyx_ImportType_CheckSize_Ignore = 2
1563 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
1567 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1570 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1573 #ifdef CYTHON_CLINE_IN_TRACEBACK
1574 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1576 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1581 PyCodeObject* code_object;
1583 } __Pyx_CodeObjectCacheEntry;
1584 struct __Pyx_CodeObjectCache {
1587 __Pyx_CodeObjectCacheEntry* entries;
1589 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1590 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1591 static PyCodeObject *__pyx_find_code_object(
int code_line);
1592 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1595 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1596 int py_line,
const char *filename);
1599 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
1600 #define __Pyx_HAS_GCC_DIAGNOSTIC
1606 #define __Pyx_CREAL(z) ((z).real())
1607 #define __Pyx_CIMAG(z) ((z).imag())
1609 #define __Pyx_CREAL(z) (__real__(z))
1610 #define __Pyx_CIMAG(z) (__imag__(z))
1613 #define __Pyx_CREAL(z) ((z).real)
1614 #define __Pyx_CIMAG(z) ((z).imag)
1616 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
1617 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
1618 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1619 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1621 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1622 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1627 #define __Pyx_c_eq_float(a, b) ((a)==(b))
1628 #define __Pyx_c_sum_float(a, b) ((a)+(b))
1629 #define __Pyx_c_diff_float(a, b) ((a)-(b))
1630 #define __Pyx_c_prod_float(a, b) ((a)*(b))
1631 #define __Pyx_c_quot_float(a, b) ((a)/(b))
1632 #define __Pyx_c_neg_float(a) (-(a))
1634 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
1635 #define __Pyx_c_conj_float(z) (::std::conj(z))
1637 #define __Pyx_c_abs_float(z) (::std::abs(z))
1638 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
1641 #define __Pyx_c_is_zero_float(z) ((z)==0)
1642 #define __Pyx_c_conj_float(z) (conjf(z))
1644 #define __Pyx_c_abs_float(z) (cabsf(z))
1645 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
1649 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
1650 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
1651 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
1652 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
1653 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
1654 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
1655 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
1656 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
1658 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
1659 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
1665 #define __Pyx_c_eq_double(a, b) ((a)==(b))
1666 #define __Pyx_c_sum_double(a, b) ((a)+(b))
1667 #define __Pyx_c_diff_double(a, b) ((a)-(b))
1668 #define __Pyx_c_prod_double(a, b) ((a)*(b))
1669 #define __Pyx_c_quot_double(a, b) ((a)/(b))
1670 #define __Pyx_c_neg_double(a) (-(a))
1672 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
1673 #define __Pyx_c_conj_double(z) (::std::conj(z))
1675 #define __Pyx_c_abs_double(z) (::std::abs(z))
1676 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
1679 #define __Pyx_c_is_zero_double(z) ((z)==0)
1680 #define __Pyx_c_conj_double(z) (conj(z))
1682 #define __Pyx_c_abs_double(z) (cabs(z))
1683 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
1687 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
1688 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
1689 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
1690 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
1691 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
1692 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
1693 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
1694 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
1696 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
1697 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
1702 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1705 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
1708 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
1711 #if CYTHON_COMPILING_IN_CPYTHON
1712 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1713 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1714 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1715 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1717 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1718 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1719 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1721 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1724 static int __Pyx_check_binary_version(
void);
1727 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1739 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
1752 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
1753 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
1754 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
1755 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
1756 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
1757 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
1758 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
1759 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
1760 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
1761 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
1762 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
1763 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
1764 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
1765 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
1766 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
1769 #define __Pyx_MODULE_NAME "fenton.Fenton"
1770 extern int __pyx_module_is_main_fenton__Fenton;
1771 int __pyx_module_is_main_fenton__Fenton = 0;
1774 static PyObject *__pyx_builtin_open;
1775 static PyObject *__pyx_builtin_ImportError;
1776 static const char __pyx_k_f[] =
"f";
1777 static const char __pyx_k_g[] =
"g";
1778 static const char __pyx_k_l[] =
"l";
1779 static const char __pyx_k_r[] =
"r";
1780 static const char __pyx_k_w[] =
"w";
1781 static const char __pyx_k__3[] =
"#";
1782 static const char __pyx_k__8[] =
".";
1783 static const char __pyx_k_np[] =
"np";
1784 static const char __pyx_k_os[] =
"os";
1785 static const char __pyx_k_FFT[] =
"FFT";
1786 static const char __pyx_k_Wave[] =
"Wave";
1787 static const char __pyx_k_copy[] =
"copy";
1788 static const char __pyx_k_exit[] =
"__exit__";
1789 static const char __pyx_k_file[] =
"__file__";
1790 static const char __pyx_k_line[] =
"line";
1791 static const char __pyx_k_main[] =
"__main__";
1792 static const char __pyx_k_mode[] =
"mode";
1793 static const char __pyx_k_name[] =
"__name__";
1794 static const char __pyx_k_open[] =
"open";
1795 static const char __pyx_k_path[] =
"path";
1796 static const char __pyx_k_sqrt[] =
"sqrt";
1797 static const char __pyx_k_test[] =
"__test__";
1798 static const char __pyx_k_depth[] =
"depth";
1799 static const char __pyx_k_enter[] =
"__enter__";
1800 static const char __pyx_k_niter[] =
"niter";
1801 static const char __pyx_k_numpy[] =
"numpy";
1802 static const char __pyx_k_split[] =
"split";
1803 static const char __pyx_k_write[] =
"write";
1804 static const char __pyx_k_Period[] =
"Period";
1805 static const char __pyx_k_format[] =
"format";
1806 static const char __pyx_k_import[] =
"__import__";
1807 static const char __pyx_k_length[] =
"length";
1808 static const char __pyx_k_logDir[] =
"logDir";
1809 static const char __pyx_k_period[] =
"period";
1810 static const char __pyx_k_shutil[] =
"shutil";
1811 static const char __pyx_k_BCoeffs[] =
"BCoeffs";
1812 static const char __pyx_k_YCoeffs[] =
"YCoeffs";
1813 static const char __pyx_k_dirname[] =
"dirname";
1814 static const char __pyx_k_get_dir[] =
"__get_dir";
1815 static const char __pyx_k_ncoeffs[] =
"ncoeffs";
1816 static const char __pyx_k_proteus[] =
"proteus";
1817 static const char __pyx_k_Data_dat[] =
"Data.dat";
1818 static const char __pyx_k_comments[] =
"comments";
1819 static const char __pyx_k_filename[] =
"filename";
1820 static const char __pyx_k_Profiling[] =
"Profiling";
1821 static const char __pyx_k_conv_crit[] =
"conv_crit";
1822 static const char __pyx_k_copyFiles[] =
"copyFiles";
1823 static const char __pyx_k_delimiter[] =
"delimiter";
1824 static const char __pyx_k_Points_dat[] =
"Points.dat";
1825 static const char __pyx_k_Wavelength[] =
"Wavelength";
1826 static const char __pyx_k_check_call[] =
"check_call";
1827 static const char __pyx_k_genfromtxt[] =
"genfromtxt";
1828 static const char __pyx_k_runFourier[] =
"runFourier";
1829 static const char __pyx_k_subprocess[] =
"subprocess";
1830 static const char __pyx_k_waveheight[] =
"waveheight";
1831 static const char __pyx_k_wavelength[] =
"wavelength";
1832 static const char __pyx_k_writeInput[] =
"writeInput";
1833 static const char __pyx_k_ImportError[] =
"ImportError";
1834 static const char __pyx_k_Surface_res[] =
"Surface.res";
1835 static const char __pyx_k_getBYCoeffs[] =
"getBYCoeffs";
1836 static const char __pyx_k_Solution_res[] =
"Solution.res";
1837 static const char __pyx_k_height_steps[] =
"height_steps";
1838 static const char __pyx_k_Flowfield_res[] =
"Flowfield.res";
1839 static const char __pyx_k_fenton_Fenton[] =
"fenton.Fenton";
1840 static const char __pyx_k_getWavelength[] =
"getWavelength";
1841 static const char __pyx_k_length_dimless[] =
"length_dimless";
1842 static const char __pyx_k_Convergence_dat[] =
"Convergence.dat";
1843 static const char __pyx_k_points_velocity[] =
"points_velocity";
1844 static const char __pyx_k_points_vertical[] =
"points_vertical";
1845 static const char __pyx_k_current_criterion[] =
"current_criterion";
1846 static const char __pyx_k_current_magnitude[] =
"current_magnitude";
1847 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
1848 static const char __pyx_k_points_freesurface[] =
"points_freesurface";
1849 static const char __pyx_k_waveheight_dimless[] =
"waveheight_dimless";
1850 static const char __pyx_k_current_magnitude_dimless[] =
"current_magnitude_dimless";
1851 static const char __pyx_k_proteus_fenton_Fenton_pyx[] =
"proteus/fenton/Fenton.pyx";
1852 static const char __pyx_k_Scripts_for_creating_Fenton_wav[] =
"\nScripts for creating Fenton waves.\nModified from johndfenton.com/Steady-waves/Fourier.html to work with python and Proteus\nUsed in proteus.WaveTools\n";
1853 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
1854 static const char __pyx_k_Control_file_to_control_converge[] =
"Control file to control convergence and output of results\n{niter}\t\tMaximum number of iterations for each height step; 10 OK for ordinary waves, 40 for highest\n{conv_crit}\tCriterion for convergence, typically 1.e-4, or 1.e-5 for highest waves\n";
1855 static const char __pyx_k_Period_or_wavelength_must_be_set[] =
"Period or wavelength must be set for Fenton wave";
1856 static const char __pyx_k_Wave_waveheight_mode_length_curr[] =
"Wave\n{waveheight}\n{mode}\n{length}\n{current_criterion}\n{current_magnitude}\n{ncoeffs}\n{height_steps}\n";
1857 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
1858 static PyObject *__pyx_n_s_BCoeffs;
1859 static PyObject *__pyx_kp_s_Control_file_to_control_converge;
1860 static PyObject *__pyx_kp_s_Convergence_dat;
1861 static PyObject *__pyx_kp_s_Data_dat;
1862 static PyObject *__pyx_n_s_FFT;
1863 static PyObject *__pyx_kp_s_Flowfield_res;
1864 static PyObject *__pyx_n_s_ImportError;
1865 static PyObject *__pyx_n_s_Period;
1866 static PyObject *__pyx_kp_s_Period_or_wavelength_must_be_set;
1867 static PyObject *__pyx_kp_s_Points_dat;
1868 static PyObject *__pyx_n_s_Profiling;
1869 static PyObject *__pyx_kp_s_Solution_res;
1870 static PyObject *__pyx_kp_s_Surface_res;
1871 static PyObject *__pyx_n_s_Wave;
1872 static PyObject *__pyx_kp_s_Wave_waveheight_mode_length_curr;
1873 static PyObject *__pyx_n_s_Wavelength;
1874 static PyObject *__pyx_n_s_YCoeffs;
1875 static PyObject *__pyx_kp_s__3;
1876 static PyObject *__pyx_kp_s__8;
1877 static PyObject *__pyx_n_s_check_call;
1878 static PyObject *__pyx_n_s_cline_in_traceback;
1879 static PyObject *__pyx_n_s_comments;
1880 static PyObject *__pyx_n_s_conv_crit;
1881 static PyObject *__pyx_n_s_copy;
1882 static PyObject *__pyx_n_s_copyFiles;
1883 static PyObject *__pyx_n_s_current_criterion;
1884 static PyObject *__pyx_n_s_current_magnitude;
1885 static PyObject *__pyx_n_s_current_magnitude_dimless;
1886 static PyObject *__pyx_n_s_delimiter;
1887 static PyObject *__pyx_n_s_depth;
1888 static PyObject *__pyx_n_s_dirname;
1889 static PyObject *__pyx_n_s_enter;
1890 static PyObject *__pyx_n_s_exit;
1891 static PyObject *__pyx_n_s_f;
1892 static PyObject *__pyx_n_s_fenton_Fenton;
1893 static PyObject *__pyx_n_s_file;
1894 static PyObject *__pyx_n_s_filename;
1895 static PyObject *__pyx_n_s_format;
1896 static PyObject *__pyx_n_s_g;
1897 static PyObject *__pyx_n_s_genfromtxt;
1898 static PyObject *__pyx_n_s_getBYCoeffs;
1899 static PyObject *__pyx_n_s_getWavelength;
1900 static PyObject *__pyx_n_s_get_dir;
1901 static PyObject *__pyx_n_s_height_steps;
1902 static PyObject *__pyx_n_s_import;
1903 static PyObject *__pyx_n_s_l;
1904 static PyObject *__pyx_n_s_length;
1905 static PyObject *__pyx_n_s_length_dimless;
1906 static PyObject *__pyx_n_s_line;
1907 static PyObject *__pyx_n_s_logDir;
1908 static PyObject *__pyx_n_s_main;
1909 static PyObject *__pyx_n_s_mode;
1910 static PyObject *__pyx_n_s_name;
1911 static PyObject *__pyx_n_s_ncoeffs;
1912 static PyObject *__pyx_n_s_niter;
1913 static PyObject *__pyx_n_s_np;
1914 static PyObject *__pyx_n_s_numpy;
1915 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
1916 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
1917 static PyObject *__pyx_n_s_open;
1918 static PyObject *__pyx_n_s_os;
1919 static PyObject *__pyx_n_s_path;
1920 static PyObject *__pyx_n_s_period;
1921 static PyObject *__pyx_n_s_points_freesurface;
1922 static PyObject *__pyx_n_s_points_velocity;
1923 static PyObject *__pyx_n_s_points_vertical;
1924 static PyObject *__pyx_n_s_proteus;
1925 static PyObject *__pyx_kp_s_proteus_fenton_Fenton_pyx;
1926 static PyObject *__pyx_n_s_r;
1927 static PyObject *__pyx_n_s_runFourier;
1928 static PyObject *__pyx_n_s_shutil;
1929 static PyObject *__pyx_n_s_split;
1930 static PyObject *__pyx_n_s_sqrt;
1931 static PyObject *__pyx_n_s_subprocess;
1932 static PyObject *__pyx_n_s_test;
1933 static PyObject *__pyx_n_s_w;
1934 static PyObject *__pyx_n_s_waveheight;
1935 static PyObject *__pyx_n_s_waveheight_dimless;
1936 static PyObject *__pyx_n_s_wavelength;
1937 static PyObject *__pyx_n_s_write;
1938 static PyObject *__pyx_n_s_writeInput;
1939 static PyObject *__pyx_pf_6fenton_6Fenton_writeInput(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_waveheight, PyObject *__pyx_v_depth, PyObject *__pyx_v_period, PyObject *__pyx_v_wavelength, PyObject *__pyx_v_mode, PyObject *__pyx_v_current_criterion, PyObject *__pyx_v_current_magnitude, PyObject *__pyx_v_ncoeffs, PyObject *__pyx_v_height_steps, PyObject *__pyx_v_g, PyObject *__pyx_v_niter, PyObject *__pyx_v_conv_crit, CYTHON_UNUSED PyObject *__pyx_v_points_freesurface, CYTHON_UNUSED PyObject *__pyx_v_points_velocity, CYTHON_UNUSED PyObject *__pyx_v_points_vertical);
1940 static PyObject *__pyx_pf_6fenton_6Fenton_2runFourier(CYTHON_UNUSED PyObject *__pyx_self);
1941 static PyObject *__pyx_pf_6fenton_6Fenton_4getBYCoeffs(CYTHON_UNUSED PyObject *__pyx_self);
1942 static PyObject *__pyx_pf_6fenton_6Fenton_6getWavelength(CYTHON_UNUSED PyObject *__pyx_self);
1943 static PyObject *__pyx_pf_6fenton_6Fenton_8copyFiles(CYTHON_UNUSED PyObject *__pyx_self);
1944 static PyObject *__pyx_pf_6fenton_6Fenton_10__get_dir(CYTHON_UNUSED PyObject *__pyx_self);
1945 static PyObject *__pyx_float_9_81;
1946 static PyObject *__pyx_float_1_eneg_05;
1947 static PyObject *__pyx_int_0;
1948 static PyObject *__pyx_int_1;
1949 static PyObject *__pyx_int_2;
1950 static PyObject *__pyx_int_8;
1951 static PyObject *__pyx_int_16;
1952 static PyObject *__pyx_int_20;
1953 static PyObject *__pyx_int_40;
1954 static PyObject *__pyx_int_50;
1955 static PyObject *__pyx_tuple_;
1956 static PyObject *__pyx_slice__4;
1957 static PyObject *__pyx_tuple__2;
1958 static PyObject *__pyx_tuple__5;
1959 static PyObject *__pyx_tuple__6;
1960 static PyObject *__pyx_tuple__7;
1961 static PyObject *__pyx_tuple__9;
1962 static PyObject *__pyx_tuple__10;
1963 static PyObject *__pyx_tuple__11;
1964 static PyObject *__pyx_tuple__14;
1965 static PyObject *__pyx_tuple__16;
1966 static PyObject *__pyx_codeobj__12;
1967 static PyObject *__pyx_codeobj__13;
1968 static PyObject *__pyx_codeobj__15;
1969 static PyObject *__pyx_codeobj__17;
1970 static PyObject *__pyx_codeobj__18;
1971 static PyObject *__pyx_codeobj__19;
1983 static PyObject *__pyx_pw_6fenton_6Fenton_1writeInput(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
1984 static char __pyx_doc_6fenton_6Fenton_writeInput[] =
"\n Creates input files for Fourier script\n\n Parameters\n ----------\n waveheight: double\n Height of wave\n depth: double\n Water depth\n period: double\n Wave period\n mode: string\n 'Period' or 'Wavelength'\n current_criterion: int\n 1: Euler, 2: Stokes\n current_magnitude: double\n Magnitude of current\n ncoeffs: int\n Number of Fourier coefficients\n height_steps: int\n Number of height steps to reach H/d\n g: double\n Gravity\n niter: int\n Max number of iterations \n conv_crit: double\n Criterion for convergence\n points_freesurface: int\n Number of points on free surface\n points_velocity: int\n Number of velocity/acceleration profiles to print out\n points_vertical: int\n Number of vertical points in each profile\n ";
1985 static PyMethodDef __pyx_mdef_6fenton_6Fenton_1writeInput = {
"writeInput", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_6fenton_6Fenton_1writeInput, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6fenton_6Fenton_writeInput};
1986 static PyObject *__pyx_pw_6fenton_6Fenton_1writeInput(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1987 PyObject *__pyx_v_waveheight = 0;
1988 PyObject *__pyx_v_depth = 0;
1989 PyObject *__pyx_v_period = 0;
1990 PyObject *__pyx_v_wavelength = 0;
1991 PyObject *__pyx_v_mode = 0;
1992 PyObject *__pyx_v_current_criterion = 0;
1993 PyObject *__pyx_v_current_magnitude = 0;
1994 PyObject *__pyx_v_ncoeffs = 0;
1995 PyObject *__pyx_v_height_steps = 0;
1996 PyObject *__pyx_v_g = 0;
1997 PyObject *__pyx_v_niter = 0;
1998 PyObject *__pyx_v_conv_crit = 0;
1999 CYTHON_UNUSED PyObject *__pyx_v_points_freesurface = 0;
2000 CYTHON_UNUSED PyObject *__pyx_v_points_velocity = 0;
2001 CYTHON_UNUSED PyObject *__pyx_v_points_vertical = 0;
2002 int __pyx_lineno = 0;
2003 const char *__pyx_filename = NULL;
2004 int __pyx_clineno = 0;
2005 PyObject *__pyx_r = 0;
2006 __Pyx_RefNannyDeclarations
2007 __Pyx_RefNannySetupContext(
"writeInput (wrapper)", 0);
2009 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_waveheight,&__pyx_n_s_depth,&__pyx_n_s_period,&__pyx_n_s_wavelength,&__pyx_n_s_mode,&__pyx_n_s_current_criterion,&__pyx_n_s_current_magnitude,&__pyx_n_s_ncoeffs,&__pyx_n_s_height_steps,&__pyx_n_s_g,&__pyx_n_s_niter,&__pyx_n_s_conv_crit,&__pyx_n_s_points_freesurface,&__pyx_n_s_points_velocity,&__pyx_n_s_points_vertical,0};
2010 PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
2019 values[2] = ((PyObject *)Py_None);
2028 values[3] = ((PyObject *)Py_None);
2029 values[4] = ((PyObject *)__pyx_n_s_Period);
2030 values[5] = ((PyObject *)__pyx_int_1);
2031 values[6] = ((PyObject *)__pyx_int_0);
2032 values[7] = ((PyObject *)__pyx_int_8);
2033 values[8] = ((PyObject *)__pyx_int_1);
2034 values[9] = ((PyObject *)__pyx_float_9_81);
2035 values[10] = ((PyObject *)__pyx_int_40);
2036 values[11] = ((PyObject *)__pyx_float_1_eneg_05);
2037 values[12] = ((PyObject *)__pyx_int_50);
2038 values[13] = ((PyObject *)__pyx_int_16);
2039 values[14] = ((PyObject *)__pyx_int_20);
2040 if (unlikely(__pyx_kwds)) {
2042 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2044 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
2046 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
2048 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
2050 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
2052 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
2054 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
2056 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
2058 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
2060 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2062 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2064 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2066 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2068 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2070 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2072 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2075 default:
goto __pyx_L5_argtuple_error;
2077 kw_args = PyDict_Size(__pyx_kwds);
2080 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_waveheight)) != 0)) kw_args--;
2081 else goto __pyx_L5_argtuple_error;
2084 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_depth)) != 0)) kw_args--;
2086 __Pyx_RaiseArgtupleInvalid(
"writeInput", 0, 2, 15, 1); __PYX_ERR(0, 16, __pyx_L3_error)
2091 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_period);
2092 if (value) { values[2] = value; kw_args--; }
2097 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_wavelength);
2098 if (value) { values[3] = value; kw_args--; }
2103 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
2104 if (value) { values[4] = value; kw_args--; }
2109 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_current_criterion);
2110 if (value) { values[5] = value; kw_args--; }
2115 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_current_magnitude);
2116 if (value) { values[6] = value; kw_args--; }
2121 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ncoeffs);
2122 if (value) { values[7] = value; kw_args--; }
2127 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_height_steps);
2128 if (value) { values[8] = value; kw_args--; }
2133 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g);
2134 if (value) { values[9] = value; kw_args--; }
2139 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_niter);
2140 if (value) { values[10] = value; kw_args--; }
2145 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_conv_crit);
2146 if (value) { values[11] = value; kw_args--; }
2151 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_points_freesurface);
2152 if (value) { values[12] = value; kw_args--; }
2157 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_points_velocity);
2158 if (value) { values[13] = value; kw_args--; }
2163 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_points_vertical);
2164 if (value) { values[14] = value; kw_args--; }
2167 if (unlikely(kw_args > 0)) {
2168 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"writeInput") < 0)) __PYX_ERR(0, 16, __pyx_L3_error)
2171 switch (PyTuple_GET_SIZE(__pyx_args)) {
2172 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
2174 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
2176 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
2178 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
2180 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
2182 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
2184 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
2186 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
2188 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
2190 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2192 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2194 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2196 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2198 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2199 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2201 default:
goto __pyx_L5_argtuple_error;
2204 __pyx_v_waveheight = values[0];
2205 __pyx_v_depth = values[1];
2206 __pyx_v_period = values[2];
2207 __pyx_v_wavelength = values[3];
2208 __pyx_v_mode = values[4];
2209 __pyx_v_current_criterion = values[5];
2210 __pyx_v_current_magnitude = values[6];
2211 __pyx_v_ncoeffs = values[7];
2212 __pyx_v_height_steps = values[8];
2213 __pyx_v_g = values[9];
2214 __pyx_v_niter = values[10];
2215 __pyx_v_conv_crit = values[11];
2216 __pyx_v_points_freesurface = values[12];
2217 __pyx_v_points_velocity = values[13];
2218 __pyx_v_points_vertical = values[14];
2220 goto __pyx_L4_argument_unpacking_done;
2221 __pyx_L5_argtuple_error:;
2222 __Pyx_RaiseArgtupleInvalid(
"writeInput", 0, 2, 15, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 16, __pyx_L3_error)
2224 __Pyx_AddTraceback(
"fenton.Fenton.writeInput", __pyx_clineno, __pyx_lineno, __pyx_filename);
2225 __Pyx_RefNannyFinishContext();
2227 __pyx_L4_argument_unpacking_done:;
2228 __pyx_r = __pyx_pf_6fenton_6Fenton_writeInput(__pyx_self, __pyx_v_waveheight, __pyx_v_depth, __pyx_v_period, __pyx_v_wavelength, __pyx_v_mode, __pyx_v_current_criterion, __pyx_v_current_magnitude, __pyx_v_ncoeffs, __pyx_v_height_steps, __pyx_v_g, __pyx_v_niter, __pyx_v_conv_crit, __pyx_v_points_freesurface, __pyx_v_points_velocity, __pyx_v_points_vertical);
2239 __Pyx_RefNannyFinishContext();
2243 static PyObject *__pyx_pf_6fenton_6Fenton_writeInput(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_waveheight, PyObject *__pyx_v_depth, PyObject *__pyx_v_period, PyObject *__pyx_v_wavelength, PyObject *__pyx_v_mode, PyObject *__pyx_v_current_criterion, PyObject *__pyx_v_current_magnitude, PyObject *__pyx_v_ncoeffs, PyObject *__pyx_v_height_steps, PyObject *__pyx_v_g, PyObject *__pyx_v_niter, PyObject *__pyx_v_conv_crit, CYTHON_UNUSED PyObject *__pyx_v_points_freesurface, CYTHON_UNUSED PyObject *__pyx_v_points_velocity, CYTHON_UNUSED PyObject *__pyx_v_points_vertical) {
2244 PyObject *__pyx_v_filename = NULL;
2245 PyObject *__pyx_v_f = NULL;
2246 PyObject *__pyx_v_waveheight_dimless = NULL;
2247 PyObject *__pyx_v_length_dimless = NULL;
2248 PyObject *__pyx_v_current_magnitude_dimless = NULL;
2249 PyObject *__pyx_r = NULL;
2250 __Pyx_RefNannyDeclarations
2254 PyObject *__pyx_t_4 = NULL;
2255 PyObject *__pyx_t_5 = NULL;
2256 PyObject *__pyx_t_6 = NULL;
2257 PyObject *__pyx_t_7 = NULL;
2258 PyObject *__pyx_t_8 = NULL;
2259 PyObject *__pyx_t_9 = NULL;
2260 PyObject *__pyx_t_10 = NULL;
2261 PyObject *__pyx_t_11 = NULL;
2262 PyObject *__pyx_t_12 = NULL;
2263 PyObject *__pyx_t_13 = NULL;
2264 int __pyx_lineno = 0;
2265 const char *__pyx_filename = NULL;
2266 int __pyx_clineno = 0;
2267 __Pyx_RefNannySetupContext(
"writeInput", 0);
2268 __Pyx_INCREF(__pyx_v_mode);
2277 #ifndef CYTHON_WITHOUT_ASSERTIONS
2278 if (unlikely(!Py_OptimizeFlag)) {
2279 __pyx_t_2 = (__pyx_v_period != Py_None);
2280 __pyx_t_3 = (__pyx_t_2 != 0);
2283 __pyx_t_1 = __pyx_t_3;
2284 goto __pyx_L3_bool_binop_done;
2286 __pyx_t_3 = (__pyx_v_wavelength != Py_None);
2287 __pyx_t_2 = (__pyx_t_3 != 0);
2288 __pyx_t_1 = __pyx_t_2;
2289 __pyx_L3_bool_binop_done:;
2290 if (unlikely(!__pyx_t_1)) {
2291 PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_Period_or_wavelength_must_be_set);
2292 __PYX_ERR(0, 66, __pyx_L1_error)
2304 __pyx_t_2 = (__pyx_v_period == Py_None);
2305 __pyx_t_3 = (__pyx_t_2 != 0);
2308 __pyx_t_1 = __pyx_t_3;
2309 goto __pyx_L6_bool_binop_done;
2311 __pyx_t_3 = (__pyx_v_wavelength != Py_None);
2312 __pyx_t_2 = (__pyx_t_3 != 0);
2313 __pyx_t_1 = __pyx_t_2;
2314 __pyx_L6_bool_binop_done:;
2324 __Pyx_INCREF(__pyx_n_s_Wavelength);
2325 __Pyx_DECREF_SET(__pyx_v_mode, __pyx_n_s_Wavelength);
2343 __pyx_t_2 = (__pyx_v_period != Py_None);
2344 __pyx_t_3 = (__pyx_t_2 != 0);
2347 __pyx_t_1 = __pyx_t_3;
2348 goto __pyx_L9_bool_binop_done;
2350 __pyx_t_3 = (__pyx_v_wavelength == Py_None);
2351 __pyx_t_2 = (__pyx_t_3 != 0);
2352 __pyx_t_1 = __pyx_t_2;
2353 __pyx_L9_bool_binop_done:;
2363 __Pyx_INCREF(__pyx_n_s_Period);
2364 __Pyx_DECREF_SET(__pyx_v_mode, __pyx_n_s_Period);
2382 __Pyx_INCREF(__pyx_kp_s_Data_dat);
2383 __pyx_v_filename = __pyx_kp_s_Data_dat;
2393 __pyx_t_4 = PyTuple_New(2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error)
2394 __Pyx_GOTREF(__pyx_t_4);
2395 __Pyx_INCREF(__pyx_v_filename);
2396 __Pyx_GIVEREF(__pyx_v_filename);
2397 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_filename);
2398 __Pyx_INCREF(__pyx_n_s_w);
2399 __Pyx_GIVEREF(__pyx_n_s_w);
2400 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_w);
2401 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error)
2402 __Pyx_GOTREF(__pyx_t_5);
2403 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2404 __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_n_s_exit);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 72, __pyx_L1_error)
2405 __Pyx_GOTREF(__pyx_t_6);
2406 __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_n_s_enter);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 72, __pyx_L11_error)
2407 __Pyx_GOTREF(__pyx_t_7);
2409 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
2410 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
2411 if (likely(__pyx_t_8)) {
2412 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
2413 __Pyx_INCREF(__pyx_t_8);
2414 __Pyx_INCREF(
function);
2415 __Pyx_DECREF_SET(__pyx_t_7,
function);
2418 __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
2419 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
2420 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L11_error)
2421 __Pyx_GOTREF(__pyx_t_4);
2422 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2423 __pyx_t_7 = __pyx_t_4;
2425 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2428 __Pyx_PyThreadState_declare
2429 __Pyx_PyThreadState_assign
2430 __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
2431 __Pyx_XGOTREF(__pyx_t_9);
2432 __Pyx_XGOTREF(__pyx_t_10);
2433 __Pyx_XGOTREF(__pyx_t_11);
2435 __pyx_v_f = __pyx_t_7;
2445 __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_v_waveheight, __pyx_v_depth);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 73, __pyx_L15_error)
2446 __Pyx_GOTREF(__pyx_t_7);
2447 __pyx_v_waveheight_dimless = __pyx_t_7;
2457 __Pyx_INCREF(__pyx_v_mode);
2458 __Pyx_DECREF_SET(__pyx_v_mode, __pyx_v_mode);
2467 __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_Period, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 75, __pyx_L15_error)
2477 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L15_error)
2478 __Pyx_GOTREF(__pyx_t_5);
2479 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sqrt);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L15_error)
2480 __Pyx_GOTREF(__pyx_t_4);
2481 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2482 __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_v_g, __pyx_v_depth);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 76, __pyx_L15_error)
2483 __Pyx_GOTREF(__pyx_t_5);
2485 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
2486 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
2487 if (likely(__pyx_t_8)) {
2488 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
2489 __Pyx_INCREF(__pyx_t_8);
2490 __Pyx_INCREF(
function);
2491 __Pyx_DECREF_SET(__pyx_t_4,
function);
2494 __pyx_t_7 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
2495 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
2496 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2497 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 76, __pyx_L15_error)
2498 __Pyx_GOTREF(__pyx_t_7);
2499 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2500 __pyx_t_4 = PyNumber_Multiply(__pyx_v_period, __pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 76, __pyx_L15_error)
2501 __Pyx_GOTREF(__pyx_t_4);
2502 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2503 __pyx_v_length_dimless = __pyx_t_4;
2523 __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_Wavelength, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 77, __pyx_L15_error)
2533 __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_v_wavelength, __pyx_v_depth);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L15_error)
2534 __Pyx_GOTREF(__pyx_t_4);
2535 __pyx_v_length_dimless = __pyx_t_4;
2555 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 79, __pyx_L15_error)
2556 __Pyx_GOTREF(__pyx_t_7);
2557 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_sqrt);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L15_error)
2558 __Pyx_GOTREF(__pyx_t_5);
2559 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2560 __pyx_t_7 = PyNumber_Multiply(__pyx_v_g, __pyx_v_depth);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 79, __pyx_L15_error)
2561 __Pyx_GOTREF(__pyx_t_7);
2563 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
2564 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
2565 if (likely(__pyx_t_8)) {
2566 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
2567 __Pyx_INCREF(__pyx_t_8);
2568 __Pyx_INCREF(
function);
2569 __Pyx_DECREF_SET(__pyx_t_5,
function);
2572 __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7);
2573 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
2574 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2575 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L15_error)
2576 __Pyx_GOTREF(__pyx_t_4);
2577 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2578 __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_v_current_magnitude, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L15_error)
2579 __Pyx_GOTREF(__pyx_t_5);
2580 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2581 __pyx_v_current_magnitude_dimless = __pyx_t_5;
2591 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L15_error)
2592 __Pyx_GOTREF(__pyx_t_4);
2601 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Wave_waveheight_mode_length_curr, __pyx_n_s_format);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 88, __pyx_L15_error)
2602 __Pyx_GOTREF(__pyx_t_7);
2603 __pyx_t_8 = __Pyx_PyDict_NewPresized(7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 88, __pyx_L15_error)
2604 __Pyx_GOTREF(__pyx_t_8);
2605 if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_waveheight, __pyx_v_waveheight_dimless) < 0) __PYX_ERR(0, 88, __pyx_L15_error)
2606 if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_mode, __pyx_v_mode) < 0) __PYX_ERR(0, 88, __pyx_L15_error)
2607 if (unlikely(!__pyx_v_length_dimless)) { __Pyx_RaiseUnboundLocalError(
"length_dimless"); __PYX_ERR(0, 88, __pyx_L15_error) }
2608 if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_length, __pyx_v_length_dimless) < 0) __PYX_ERR(0, 88, __pyx_L15_error)
2609 if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_current_criterion, __pyx_v_current_criterion) < 0) __PYX_ERR(0, 88, __pyx_L15_error)
2618 if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_current_magnitude, __pyx_v_current_magnitude_dimless) < 0) __PYX_ERR(0, 88, __pyx_L15_error)
2619 if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_ncoeffs, __pyx_v_ncoeffs) < 0) __PYX_ERR(0, 88, __pyx_L15_error)
2620 if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_height_steps, __pyx_v_height_steps) < 0) __PYX_ERR(0, 88, __pyx_L15_error)
2629 __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_8);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 88, __pyx_L15_error)
2630 __Pyx_GOTREF(__pyx_t_12);
2631 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2632 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2634 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
2635 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
2636 if (likely(__pyx_t_8)) {
2637 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
2638 __Pyx_INCREF(__pyx_t_8);
2639 __Pyx_INCREF(
function);
2640 __Pyx_DECREF_SET(__pyx_t_4,
function);
2643 __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_12);
2644 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
2645 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
2646 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 80, __pyx_L15_error)
2647 __Pyx_GOTREF(__pyx_t_5);
2648 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2649 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2659 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
2660 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
2661 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
2662 goto __pyx_L20_try_end;
2664 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
2665 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2666 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2667 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
2668 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
2670 __Pyx_AddTraceback(
"fenton.Fenton.writeInput", __pyx_clineno, __pyx_lineno, __pyx_filename);
2671 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_12) < 0) __PYX_ERR(0, 72, __pyx_L17_except_error)
2672 __Pyx_GOTREF(__pyx_t_5);
2673 __Pyx_GOTREF(__pyx_t_4);
2674 __Pyx_GOTREF(__pyx_t_12);
2675 __pyx_t_8 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_4, __pyx_t_12);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 72, __pyx_L17_except_error)
2676 __Pyx_GOTREF(__pyx_t_8);
2677 __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
2678 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2679 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2680 if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 72, __pyx_L17_except_error)
2681 __Pyx_GOTREF(__pyx_t_13);
2682 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_13);
2683 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
2684 if (__pyx_t_1 < 0) __PYX_ERR(0, 72, __pyx_L17_except_error)
2685 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
2687 __Pyx_GIVEREF(__pyx_t_5);
2688 __Pyx_GIVEREF(__pyx_t_4);
2689 __Pyx_XGIVEREF(__pyx_t_12);
2690 __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_4, __pyx_t_12);
2691 __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_12 = 0;
2692 __PYX_ERR(0, 72, __pyx_L17_except_error)
2694 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2695 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2696 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
2697 goto __pyx_L16_exception_handled;
2699 __pyx_L17_except_error:;
2700 __Pyx_XGIVEREF(__pyx_t_9);
2701 __Pyx_XGIVEREF(__pyx_t_10);
2702 __Pyx_XGIVEREF(__pyx_t_11);
2703 __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
2704 goto __pyx_L1_error;
2705 __pyx_L16_exception_handled:;
2706 __Pyx_XGIVEREF(__pyx_t_9);
2707 __Pyx_XGIVEREF(__pyx_t_10);
2708 __Pyx_XGIVEREF(__pyx_t_11);
2709 __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
2716 __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple_, NULL);
2717 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2718 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 72, __pyx_L1_error)
2719 __Pyx_GOTREF(__pyx_t_11);
2720 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
2728 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2729 goto __pyx_L1_error;
2740 __Pyx_INCREF(__pyx_kp_s_Convergence_dat);
2741 __Pyx_DECREF_SET(__pyx_v_filename, __pyx_kp_s_Convergence_dat);
2751 __pyx_t_12 = PyTuple_New(2);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 92, __pyx_L1_error)
2752 __Pyx_GOTREF(__pyx_t_12);
2753 __Pyx_INCREF(__pyx_v_filename);
2754 __Pyx_GIVEREF(__pyx_v_filename);
2755 PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_filename);
2756 __Pyx_INCREF(__pyx_n_s_w);
2757 __Pyx_GIVEREF(__pyx_n_s_w);
2758 PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_n_s_w);
2759 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_12, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error)
2760 __Pyx_GOTREF(__pyx_t_4);
2761 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
2762 __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_exit);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 92, __pyx_L1_error)
2763 __Pyx_GOTREF(__pyx_t_6);
2764 __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_enter);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 92, __pyx_L26_error)
2765 __Pyx_GOTREF(__pyx_t_5);
2767 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
2768 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
2769 if (likely(__pyx_t_8)) {
2770 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
2771 __Pyx_INCREF(__pyx_t_8);
2772 __Pyx_INCREF(
function);
2773 __Pyx_DECREF_SET(__pyx_t_5,
function);
2776 __pyx_t_12 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
2777 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
2778 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 92, __pyx_L26_error)
2779 __Pyx_GOTREF(__pyx_t_12);
2780 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2781 __pyx_t_5 = __pyx_t_12;
2783 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2786 __Pyx_PyThreadState_declare
2787 __Pyx_PyThreadState_assign
2788 __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
2789 __Pyx_XGOTREF(__pyx_t_11);
2790 __Pyx_XGOTREF(__pyx_t_10);
2791 __Pyx_XGOTREF(__pyx_t_9);
2793 __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_5);
2803 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 93, __pyx_L30_error)
2804 __Pyx_GOTREF(__pyx_t_4);
2813 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Control_file_to_control_converge, __pyx_n_s_format);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 96, __pyx_L30_error)
2814 __Pyx_GOTREF(__pyx_t_12);
2815 __pyx_t_8 = __Pyx_PyDict_NewPresized(2);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 96, __pyx_L30_error)
2816 __Pyx_GOTREF(__pyx_t_8);
2817 if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_niter, __pyx_v_niter) < 0) __PYX_ERR(0, 96, __pyx_L30_error)
2818 if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_conv_crit, __pyx_v_conv_crit) < 0) __PYX_ERR(0, 96, __pyx_L30_error)
2819 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_empty_tuple, __pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 96, __pyx_L30_error)
2820 __Pyx_GOTREF(__pyx_t_7);
2821 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
2822 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2824 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
2825 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
2826 if (likely(__pyx_t_8)) {
2827 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
2828 __Pyx_INCREF(__pyx_t_8);
2829 __Pyx_INCREF(
function);
2830 __Pyx_DECREF_SET(__pyx_t_4,
function);
2833 __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7);
2834 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
2835 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2836 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 93, __pyx_L30_error)
2837 __Pyx_GOTREF(__pyx_t_5);
2838 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2839 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2849 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
2850 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
2851 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
2852 goto __pyx_L35_try_end;
2854 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
2855 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2856 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2857 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
2858 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
2860 __Pyx_AddTraceback(
"fenton.Fenton.writeInput", __pyx_clineno, __pyx_lineno, __pyx_filename);
2861 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(0, 92, __pyx_L32_except_error)
2862 __Pyx_GOTREF(__pyx_t_5);
2863 __Pyx_GOTREF(__pyx_t_4);
2864 __Pyx_GOTREF(__pyx_t_7);
2865 __pyx_t_8 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_4, __pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 92, __pyx_L32_except_error)
2866 __Pyx_GOTREF(__pyx_t_8);
2867 __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
2868 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2869 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2870 if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 92, __pyx_L32_except_error)
2871 __Pyx_GOTREF(__pyx_t_13);
2872 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13);
2873 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
2874 if (__pyx_t_2 < 0) __PYX_ERR(0, 92, __pyx_L32_except_error)
2875 __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
2877 __Pyx_GIVEREF(__pyx_t_5);
2878 __Pyx_GIVEREF(__pyx_t_4);
2879 __Pyx_XGIVEREF(__pyx_t_7);
2880 __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_4, __pyx_t_7);
2881 __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_7 = 0;
2882 __PYX_ERR(0, 92, __pyx_L32_except_error)
2884 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2885 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2886 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
2887 goto __pyx_L31_exception_handled;
2889 __pyx_L32_except_error:;
2890 __Pyx_XGIVEREF(__pyx_t_11);
2891 __Pyx_XGIVEREF(__pyx_t_10);
2892 __Pyx_XGIVEREF(__pyx_t_9);
2893 __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
2894 goto __pyx_L1_error;
2895 __pyx_L31_exception_handled:;
2896 __Pyx_XGIVEREF(__pyx_t_11);
2897 __Pyx_XGIVEREF(__pyx_t_10);
2898 __Pyx_XGIVEREF(__pyx_t_9);
2899 __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
2906 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple_, NULL);
2907 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2908 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 92, __pyx_L1_error)
2909 __Pyx_GOTREF(__pyx_t_9);
2910 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
2918 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2919 goto __pyx_L1_error;
2930 __Pyx_INCREF(__pyx_kp_s_Points_dat);
2931 __Pyx_DECREF_SET(__pyx_v_filename, __pyx_kp_s_Points_dat);
2941 __pyx_t_7 = PyTuple_New(2);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 99, __pyx_L1_error)
2942 __Pyx_GOTREF(__pyx_t_7);
2943 __Pyx_INCREF(__pyx_v_filename);
2944 __Pyx_GIVEREF(__pyx_v_filename);
2945 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_filename);
2946 __Pyx_INCREF(__pyx_n_s_w);
2947 __Pyx_GIVEREF(__pyx_n_s_w);
2948 PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_w);
2949 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error)
2950 __Pyx_GOTREF(__pyx_t_4);
2951 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2952 __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_exit);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 99, __pyx_L1_error)
2953 __Pyx_GOTREF(__pyx_t_6);
2954 __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_enter);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 99, __pyx_L40_error)
2955 __Pyx_GOTREF(__pyx_t_5);
2957 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
2958 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
2959 if (likely(__pyx_t_8)) {
2960 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
2961 __Pyx_INCREF(__pyx_t_8);
2962 __Pyx_INCREF(
function);
2963 __Pyx_DECREF_SET(__pyx_t_5,
function);
2966 __pyx_t_7 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
2967 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
2968 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 99, __pyx_L40_error)
2969 __Pyx_GOTREF(__pyx_t_7);
2970 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2971 __pyx_t_5 = __pyx_t_7;
2973 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2976 __Pyx_PyThreadState_declare
2977 __Pyx_PyThreadState_assign
2978 __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
2979 __Pyx_XGOTREF(__pyx_t_9);
2980 __Pyx_XGOTREF(__pyx_t_10);
2981 __Pyx_XGOTREF(__pyx_t_11);
2983 __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_5);
2993 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 100, __pyx_L44_error)
2994 __Pyx_GOTREF(__pyx_t_4);
3003 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Control_file_to_control_converge, __pyx_n_s_format);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 103, __pyx_L44_error)
3004 __Pyx_GOTREF(__pyx_t_7);
3005 __pyx_t_8 = __Pyx_PyDict_NewPresized(2);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 103, __pyx_L44_error)
3006 __Pyx_GOTREF(__pyx_t_8);
3007 if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_niter, __pyx_v_niter) < 0) __PYX_ERR(0, 103, __pyx_L44_error)
3008 if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_conv_crit, __pyx_v_conv_crit) < 0) __PYX_ERR(0, 103, __pyx_L44_error)
3009 __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_8);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 103, __pyx_L44_error)
3010 __Pyx_GOTREF(__pyx_t_12);
3011 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3012 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3014 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
3015 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
3016 if (likely(__pyx_t_8)) {
3017 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
3018 __Pyx_INCREF(__pyx_t_8);
3019 __Pyx_INCREF(
function);
3020 __Pyx_DECREF_SET(__pyx_t_4,
function);
3023 __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_12);
3024 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3025 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3026 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 100, __pyx_L44_error)
3027 __Pyx_GOTREF(__pyx_t_5);
3028 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3029 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3039 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3040 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3041 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
3042 goto __pyx_L49_try_end;
3044 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
3045 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3046 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3047 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3048 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3050 __Pyx_AddTraceback(
"fenton.Fenton.writeInput", __pyx_clineno, __pyx_lineno, __pyx_filename);
3051 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_12) < 0) __PYX_ERR(0, 99, __pyx_L46_except_error)
3052 __Pyx_GOTREF(__pyx_t_5);
3053 __Pyx_GOTREF(__pyx_t_4);
3054 __Pyx_GOTREF(__pyx_t_12);
3055 __pyx_t_8 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_4, __pyx_t_12);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 99, __pyx_L46_except_error)
3056 __Pyx_GOTREF(__pyx_t_8);
3057 __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
3058 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3059 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3060 if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 99, __pyx_L46_except_error)
3061 __Pyx_GOTREF(__pyx_t_13);
3062 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_13);
3063 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3064 if (__pyx_t_1 < 0) __PYX_ERR(0, 99, __pyx_L46_except_error)
3065 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
3067 __Pyx_GIVEREF(__pyx_t_5);
3068 __Pyx_GIVEREF(__pyx_t_4);
3069 __Pyx_XGIVEREF(__pyx_t_12);
3070 __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_4, __pyx_t_12);
3071 __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_12 = 0;
3072 __PYX_ERR(0, 99, __pyx_L46_except_error)
3074 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3075 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3076 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
3077 goto __pyx_L45_exception_handled;
3079 __pyx_L46_except_error:;
3080 __Pyx_XGIVEREF(__pyx_t_9);
3081 __Pyx_XGIVEREF(__pyx_t_10);
3082 __Pyx_XGIVEREF(__pyx_t_11);
3083 __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
3084 goto __pyx_L1_error;
3085 __pyx_L45_exception_handled:;
3086 __Pyx_XGIVEREF(__pyx_t_9);
3087 __Pyx_XGIVEREF(__pyx_t_10);
3088 __Pyx_XGIVEREF(__pyx_t_11);
3089 __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
3096 __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple_, NULL);
3097 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3098 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 99, __pyx_L1_error)
3099 __Pyx_GOTREF(__pyx_t_11);
3100 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3108 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3109 goto __pyx_L1_error;
3122 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3125 __Pyx_XDECREF(__pyx_t_4);
3126 __Pyx_XDECREF(__pyx_t_5);
3127 __Pyx_XDECREF(__pyx_t_7);
3128 __Pyx_XDECREF(__pyx_t_8);
3129 __Pyx_XDECREF(__pyx_t_12);
3130 __Pyx_AddTraceback(
"fenton.Fenton.writeInput", __pyx_clineno, __pyx_lineno, __pyx_filename);
3133 __Pyx_XDECREF(__pyx_v_filename);
3134 __Pyx_XDECREF(__pyx_v_f);
3135 __Pyx_XDECREF(__pyx_v_waveheight_dimless);
3136 __Pyx_XDECREF(__pyx_v_length_dimless);
3137 __Pyx_XDECREF(__pyx_v_current_magnitude_dimless);
3138 __Pyx_XDECREF(__pyx_v_mode);
3139 __Pyx_XGIVEREF(__pyx_r);
3140 __Pyx_RefNannyFinishContext();
3153 static PyObject *__pyx_pw_6fenton_6Fenton_3runFourier(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
3154 static char __pyx_doc_6fenton_6Fenton_2runFourier[] =
"\n Runs Fourier.cpp script to get Fenton wave solution\n (!) must be called after writeInput(...)\n ";
3155 static PyMethodDef __pyx_mdef_6fenton_6Fenton_3runFourier = {
"runFourier", (PyCFunction)__pyx_pw_6fenton_6Fenton_3runFourier, METH_NOARGS, __pyx_doc_6fenton_6Fenton_2runFourier};
3156 static PyObject *__pyx_pw_6fenton_6Fenton_3runFourier(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
3157 PyObject *__pyx_r = 0;
3158 __Pyx_RefNannyDeclarations
3159 __Pyx_RefNannySetupContext(
"runFourier (wrapper)", 0);
3160 __pyx_r = __pyx_pf_6fenton_6Fenton_2runFourier(__pyx_self);
3163 __Pyx_RefNannyFinishContext();
3167 static PyObject *__pyx_pf_6fenton_6Fenton_2runFourier(CYTHON_UNUSED PyObject *__pyx_self) {
3168 PyObject *__pyx_r = NULL;
3169 __Pyx_RefNannyDeclarations
3170 __Pyx_RefNannySetupContext(
"runFourier", 0);
3190 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3191 __Pyx_XGIVEREF(__pyx_r);
3192 __Pyx_RefNannyFinishContext();
3205 static PyObject *__pyx_pw_6fenton_6Fenton_5getBYCoeffs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
3206 static char __pyx_doc_6fenton_6Fenton_4getBYCoeffs[] =
"\n Get B and Y coeffs of solution\n (!) must be called after runFourier()\n\n Returns\n -------\n BCoeffs: array_like\n B coeffs of solution\n YCoeffs: array_like\n Y coeffs of solution\n ";
3207 static PyMethodDef __pyx_mdef_6fenton_6Fenton_5getBYCoeffs = {
"getBYCoeffs", (PyCFunction)__pyx_pw_6fenton_6Fenton_5getBYCoeffs, METH_NOARGS, __pyx_doc_6fenton_6Fenton_4getBYCoeffs};
3208 static PyObject *__pyx_pw_6fenton_6Fenton_5getBYCoeffs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
3209 PyObject *__pyx_r = 0;
3210 __Pyx_RefNannyDeclarations
3211 __Pyx_RefNannySetupContext(
"getBYCoeffs (wrapper)", 0);
3212 __pyx_r = __pyx_pf_6fenton_6Fenton_4getBYCoeffs(__pyx_self);
3215 __Pyx_RefNannyFinishContext();
3219 static PyObject *__pyx_pf_6fenton_6Fenton_4getBYCoeffs(CYTHON_UNUSED PyObject *__pyx_self) {
3220 PyObject *__pyx_v_FFT = NULL;
3221 PyObject *__pyx_v_BCoeffs = NULL;
3222 PyObject *__pyx_v_YCoeffs = NULL;
3223 PyObject *__pyx_r = NULL;
3224 __Pyx_RefNannyDeclarations
3225 PyObject *__pyx_t_1 = NULL;
3226 PyObject *__pyx_t_2 = NULL;
3227 PyObject *__pyx_t_3 = NULL;
3228 int __pyx_lineno = 0;
3229 const char *__pyx_filename = NULL;
3230 int __pyx_clineno = 0;
3231 __Pyx_RefNannySetupContext(
"getBYCoeffs", 0);
3240 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
3241 __Pyx_GOTREF(__pyx_t_1);
3242 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_genfromtxt);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
3243 __Pyx_GOTREF(__pyx_t_2);
3244 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3245 __pyx_t_1 = __Pyx_PyDict_NewPresized(2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
3246 __Pyx_GOTREF(__pyx_t_1);
3247 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_delimiter, Py_None) < 0) __PYX_ERR(0, 124, __pyx_L1_error)
3248 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_comments, __pyx_kp_s__3) < 0) __PYX_ERR(0, 124, __pyx_L1_error)
3249 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, __pyx_t_1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error)
3250 __Pyx_GOTREF(__pyx_t_3);
3251 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3252 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3253 __pyx_v_FFT = __pyx_t_3;
3263 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_FFT, __pyx_tuple__5);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
3264 __Pyx_GOTREF(__pyx_t_3);
3265 __pyx_v_BCoeffs = __pyx_t_3;
3275 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_FFT, __pyx_tuple__6);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
3276 __Pyx_GOTREF(__pyx_t_3);
3277 __pyx_v_YCoeffs = __pyx_t_3;
3287 __Pyx_XDECREF(__pyx_r);
3288 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error)
3289 __Pyx_GOTREF(__pyx_t_3);
3290 __Pyx_INCREF(__pyx_v_BCoeffs);
3291 __Pyx_GIVEREF(__pyx_v_BCoeffs);
3292 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_BCoeffs);
3293 __Pyx_INCREF(__pyx_v_YCoeffs);
3294 __Pyx_GIVEREF(__pyx_v_YCoeffs);
3295 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_YCoeffs);
3296 __pyx_r = __pyx_t_3;
3310 __Pyx_XDECREF(__pyx_t_1);
3311 __Pyx_XDECREF(__pyx_t_2);
3312 __Pyx_XDECREF(__pyx_t_3);
3313 __Pyx_AddTraceback(
"fenton.Fenton.getBYCoeffs", __pyx_clineno, __pyx_lineno, __pyx_filename);
3316 __Pyx_XDECREF(__pyx_v_FFT);
3317 __Pyx_XDECREF(__pyx_v_BCoeffs);
3318 __Pyx_XDECREF(__pyx_v_YCoeffs);
3319 __Pyx_XGIVEREF(__pyx_r);
3320 __Pyx_RefNannyFinishContext();
3333 static PyObject *__pyx_pw_6fenton_6Fenton_7getWavelength(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
3334 static char __pyx_doc_6fenton_6Fenton_6getWavelength[] =
"\n Get wavelength/depth (dimensionless)\n (!) must be called after runFourier()\n\n Parameters\n ----------\n depth: double\n water depth used to compute solution\n\n Returns\n -------\n wavelength: double\n wavelength\n ";
3335 static PyMethodDef __pyx_mdef_6fenton_6Fenton_7getWavelength = {
"getWavelength", (PyCFunction)__pyx_pw_6fenton_6Fenton_7getWavelength, METH_NOARGS, __pyx_doc_6fenton_6Fenton_6getWavelength};
3336 static PyObject *__pyx_pw_6fenton_6Fenton_7getWavelength(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
3337 PyObject *__pyx_r = 0;
3338 __Pyx_RefNannyDeclarations
3339 __Pyx_RefNannySetupContext(
"getWavelength (wrapper)", 0);
3340 __pyx_r = __pyx_pf_6fenton_6Fenton_6getWavelength(__pyx_self);
3343 __Pyx_RefNannyFinishContext();
3347 static PyObject *__pyx_pf_6fenton_6Fenton_6getWavelength(CYTHON_UNUSED PyObject *__pyx_self) {
3348 PyObject *__pyx_v_wavelength = NULL;
3349 PyObject *__pyx_v_f = NULL;
3350 PyObject *__pyx_v_line = NULL;
3351 PyObject *__pyx_v_l = NULL;
3352 PyObject *__pyx_r = NULL;
3353 __Pyx_RefNannyDeclarations
3354 PyObject *__pyx_t_1 = NULL;
3355 PyObject *__pyx_t_2 = NULL;
3356 PyObject *__pyx_t_3 = NULL;
3357 PyObject *__pyx_t_4 = NULL;
3358 PyObject *__pyx_t_5 = NULL;
3359 PyObject *__pyx_t_6 = NULL;
3360 PyObject *__pyx_t_7 = NULL;
3361 PyObject *__pyx_t_8 = NULL;
3362 Py_ssize_t __pyx_t_9;
3363 PyObject *(*__pyx_t_10)(PyObject *);
3367 PyObject *__pyx_t_14 = NULL;
3368 int __pyx_lineno = 0;
3369 const char *__pyx_filename = NULL;
3370 int __pyx_clineno = 0;
3371 __Pyx_RefNannySetupContext(
"getWavelength", 0);
3380 __Pyx_INCREF(Py_None);
3381 __pyx_v_wavelength = Py_None;
3391 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_tuple__7, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
3392 __Pyx_GOTREF(__pyx_t_1);
3393 __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
3394 __Pyx_GOTREF(__pyx_t_2);
3395 __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L3_error)
3396 __Pyx_GOTREF(__pyx_t_4);
3398 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
3399 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
3400 if (likely(__pyx_t_5)) {
3401 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
3402 __Pyx_INCREF(__pyx_t_5);
3403 __Pyx_INCREF(
function);
3404 __Pyx_DECREF_SET(__pyx_t_4,
function);
3407 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
3408 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3409 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L3_error)
3410 __Pyx_GOTREF(__pyx_t_3);
3411 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3412 __pyx_t_4 = __pyx_t_3;
3414 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3417 __Pyx_PyThreadState_declare
3418 __Pyx_PyThreadState_assign
3419 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
3420 __Pyx_XGOTREF(__pyx_t_6);
3421 __Pyx_XGOTREF(__pyx_t_7);
3422 __Pyx_XGOTREF(__pyx_t_8);
3424 __pyx_v_f = __pyx_t_4;
3434 if (likely(PyList_CheckExact(__pyx_v_f)) || PyTuple_CheckExact(__pyx_v_f)) {
3435 __pyx_t_4 = __pyx_v_f; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0;
3438 __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_f);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L7_error)
3439 __Pyx_GOTREF(__pyx_t_4);
3440 __pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 146, __pyx_L7_error)
3443 if (likely(!__pyx_t_10)) {
3444 if (likely(PyList_CheckExact(__pyx_t_4))) {
3445 if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4))
break;
3446 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3447 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 146, __pyx_L7_error)
3449 __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L7_error)
3450 __Pyx_GOTREF(__pyx_t_1);
3453 if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
3454 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3455 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 146, __pyx_L7_error)
3457 __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L7_error)
3458 __Pyx_GOTREF(__pyx_t_1);
3462 __pyx_t_1 = __pyx_t_10(__pyx_t_4);
3463 if (unlikely(!__pyx_t_1)) {
3464 PyObject* exc_type = PyErr_Occurred();
3466 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3467 else __PYX_ERR(0, 146, __pyx_L7_error)
3471 __Pyx_GOTREF(__pyx_t_1);
3473 __Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_1);
3483 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_split);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L7_error)
3484 __Pyx_GOTREF(__pyx_t_3);
3486 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3487 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3488 if (likely(__pyx_t_5)) {
3489 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3490 __Pyx_INCREF(__pyx_t_5);
3491 __Pyx_INCREF(
function);
3492 __Pyx_DECREF_SET(__pyx_t_3,
function);
3495 __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3496 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3497 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L7_error)
3498 __Pyx_GOTREF(__pyx_t_1);
3499 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3500 __Pyx_XDECREF_SET(__pyx_v_l, __pyx_t_1);
3510 __pyx_t_12 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_Wave, __pyx_v_l, Py_EQ));
if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 148, __pyx_L7_error)
3511 __pyx_t_13 = (__pyx_t_12 != 0);
3514 __pyx_t_11 = __pyx_t_13;
3515 goto __pyx_L16_bool_binop_done;
3517 __pyx_t_13 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_length, __pyx_v_l, Py_EQ));
if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 148, __pyx_L7_error)
3518 __pyx_t_12 = (__pyx_t_13 != 0);
3519 __pyx_t_11 = __pyx_t_12;
3520 __pyx_L16_bool_binop_done:;
3530 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_l, 5,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L7_error)
3531 __Pyx_GOTREF(__pyx_t_1);
3532 __Pyx_DECREF_SET(__pyx_v_wavelength, __pyx_t_1);
3552 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3562 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3563 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3564 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3565 goto __pyx_L12_try_end;
3567 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3568 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3569 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3570 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3572 __Pyx_AddTraceback(
"fenton.Fenton.getWavelength", __pyx_clineno, __pyx_lineno, __pyx_filename);
3573 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 145, __pyx_L9_except_error)
3574 __Pyx_GOTREF(__pyx_t_4);
3575 __Pyx_GOTREF(__pyx_t_1);
3576 __Pyx_GOTREF(__pyx_t_3);
3577 __pyx_t_5 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_1, __pyx_t_3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 145, __pyx_L9_except_error)
3578 __Pyx_GOTREF(__pyx_t_5);
3579 __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL);
3580 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3581 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3582 if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 145, __pyx_L9_except_error)
3583 __Pyx_GOTREF(__pyx_t_14);
3584 __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_14);
3585 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3586 if (__pyx_t_11 < 0) __PYX_ERR(0, 145, __pyx_L9_except_error)
3587 __pyx_t_12 = ((!(__pyx_t_11 != 0)) != 0);
3589 __Pyx_GIVEREF(__pyx_t_4);
3590 __Pyx_GIVEREF(__pyx_t_1);
3591 __Pyx_XGIVEREF(__pyx_t_3);
3592 __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_1, __pyx_t_3);
3593 __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_t_3 = 0;
3594 __PYX_ERR(0, 145, __pyx_L9_except_error)
3596 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3597 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3598 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3599 goto __pyx_L8_exception_handled;
3601 __pyx_L9_except_error:;
3602 __Pyx_XGIVEREF(__pyx_t_6);
3603 __Pyx_XGIVEREF(__pyx_t_7);
3604 __Pyx_XGIVEREF(__pyx_t_8);
3605 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
3606 goto __pyx_L1_error;
3607 __pyx_L8_exception_handled:;
3608 __Pyx_XGIVEREF(__pyx_t_6);
3609 __Pyx_XGIVEREF(__pyx_t_7);
3610 __Pyx_XGIVEREF(__pyx_t_8);
3611 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
3618 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL);
3619 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3620 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 145, __pyx_L1_error)
3621 __Pyx_GOTREF(__pyx_t_8);
3622 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3630 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3631 goto __pyx_L1_error;
3642 __Pyx_XDECREF(__pyx_r);
3643 __pyx_t_3 = __Pyx_PyNumber_Float(__pyx_v_wavelength);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error)
3644 __Pyx_GOTREF(__pyx_t_3);
3645 __pyx_r = __pyx_t_3;
3659 __Pyx_XDECREF(__pyx_t_1);
3660 __Pyx_XDECREF(__pyx_t_3);
3661 __Pyx_XDECREF(__pyx_t_4);
3662 __Pyx_XDECREF(__pyx_t_5);
3663 __Pyx_AddTraceback(
"fenton.Fenton.getWavelength", __pyx_clineno, __pyx_lineno, __pyx_filename);
3666 __Pyx_XDECREF(__pyx_v_wavelength);
3667 __Pyx_XDECREF(__pyx_v_f);
3668 __Pyx_XDECREF(__pyx_v_line);
3669 __Pyx_XDECREF(__pyx_v_l);
3670 __Pyx_XGIVEREF(__pyx_r);
3671 __Pyx_RefNannyFinishContext();
3684 static PyObject *__pyx_pw_6fenton_6Fenton_9copyFiles(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
3685 static char __pyx_doc_6fenton_6Fenton_8copyFiles[] =
"\n Copy the files to log directory\n ";
3686 static PyMethodDef __pyx_mdef_6fenton_6Fenton_9copyFiles = {
"copyFiles", (PyCFunction)__pyx_pw_6fenton_6Fenton_9copyFiles, METH_NOARGS, __pyx_doc_6fenton_6Fenton_8copyFiles};
3687 static PyObject *__pyx_pw_6fenton_6Fenton_9copyFiles(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
3688 PyObject *__pyx_r = 0;
3689 __Pyx_RefNannyDeclarations
3690 __Pyx_RefNannySetupContext(
"copyFiles (wrapper)", 0);
3691 __pyx_r = __pyx_pf_6fenton_6Fenton_8copyFiles(__pyx_self);
3694 __Pyx_RefNannyFinishContext();
3698 static PyObject *__pyx_pf_6fenton_6Fenton_8copyFiles(CYTHON_UNUSED PyObject *__pyx_self) {
3699 PyObject *__pyx_r = NULL;
3700 __Pyx_RefNannyDeclarations
3701 PyObject *__pyx_t_1 = NULL;
3702 PyObject *__pyx_t_2 = NULL;
3704 PyObject *__pyx_t_4 = NULL;
3705 PyObject *__pyx_t_5 = NULL;
3707 PyObject *__pyx_t_7 = NULL;
3708 int __pyx_lineno = 0;
3709 const char *__pyx_filename = NULL;
3710 int __pyx_clineno = 0;
3711 __Pyx_RefNannySetupContext(
"copyFiles", 0);
3720 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Profiling);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
3721 __Pyx_GOTREF(__pyx_t_1);
3722 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_logDir);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error)
3723 __Pyx_GOTREF(__pyx_t_2);
3724 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3725 __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_kp_s__8, Py_NE));
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 157, __pyx_L1_error)
3726 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3736 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_copy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
3737 __Pyx_GOTREF(__pyx_t_1);
3738 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Profiling);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
3739 __Pyx_GOTREF(__pyx_t_4);
3740 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_logDir);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 158, __pyx_L1_error)
3741 __Pyx_GOTREF(__pyx_t_5);
3742 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3745 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
3746 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
3747 if (likely(__pyx_t_4)) {
3748 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
3749 __Pyx_INCREF(__pyx_t_4);
3750 __Pyx_INCREF(
function);
3751 __Pyx_DECREF_SET(__pyx_t_1,
function);
3755 #if CYTHON_FAST_PYCALL
3756 if (PyFunction_Check(__pyx_t_1)) {
3757 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_s_Data_dat, __pyx_t_5};
3758 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
3759 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3760 __Pyx_GOTREF(__pyx_t_2);
3761 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3764 #if CYTHON_FAST_PYCCALL
3765 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
3766 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_s_Data_dat, __pyx_t_5};
3767 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
3768 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3769 __Pyx_GOTREF(__pyx_t_2);
3770 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3774 __pyx_t_7 = PyTuple_New(2+__pyx_t_6);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 158, __pyx_L1_error)
3775 __Pyx_GOTREF(__pyx_t_7);
3777 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
3779 __Pyx_INCREF(__pyx_kp_s_Data_dat);
3780 __Pyx_GIVEREF(__pyx_kp_s_Data_dat);
3781 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_kp_s_Data_dat);
3782 __Pyx_GIVEREF(__pyx_t_5);
3783 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
3785 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
3786 __Pyx_GOTREF(__pyx_t_2);
3787 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3789 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3790 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3799 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_copy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
3800 __Pyx_GOTREF(__pyx_t_1);
3801 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Profiling);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 159, __pyx_L1_error)
3802 __Pyx_GOTREF(__pyx_t_7);
3803 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logDir);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error)
3804 __Pyx_GOTREF(__pyx_t_5);
3805 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3808 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
3809 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
3810 if (likely(__pyx_t_7)) {
3811 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
3812 __Pyx_INCREF(__pyx_t_7);
3813 __Pyx_INCREF(
function);
3814 __Pyx_DECREF_SET(__pyx_t_1,
function);
3818 #if CYTHON_FAST_PYCALL
3819 if (PyFunction_Check(__pyx_t_1)) {
3820 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_Convergence_dat, __pyx_t_5};
3821 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
3822 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3823 __Pyx_GOTREF(__pyx_t_2);
3824 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3827 #if CYTHON_FAST_PYCCALL
3828 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
3829 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_Convergence_dat, __pyx_t_5};
3830 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
3831 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3832 __Pyx_GOTREF(__pyx_t_2);
3833 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3837 __pyx_t_4 = PyTuple_New(2+__pyx_t_6);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
3838 __Pyx_GOTREF(__pyx_t_4);
3840 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
3842 __Pyx_INCREF(__pyx_kp_s_Convergence_dat);
3843 __Pyx_GIVEREF(__pyx_kp_s_Convergence_dat);
3844 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_kp_s_Convergence_dat);
3845 __Pyx_GIVEREF(__pyx_t_5);
3846 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_t_5);
3848 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
3849 __Pyx_GOTREF(__pyx_t_2);
3850 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3852 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3853 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3862 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_copy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
3863 __Pyx_GOTREF(__pyx_t_1);
3864 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Profiling);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error)
3865 __Pyx_GOTREF(__pyx_t_4);
3866 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_logDir);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 160, __pyx_L1_error)
3867 __Pyx_GOTREF(__pyx_t_5);
3868 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3871 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
3872 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
3873 if (likely(__pyx_t_4)) {
3874 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
3875 __Pyx_INCREF(__pyx_t_4);
3876 __Pyx_INCREF(
function);
3877 __Pyx_DECREF_SET(__pyx_t_1,
function);
3881 #if CYTHON_FAST_PYCALL
3882 if (PyFunction_Check(__pyx_t_1)) {
3883 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_s_Points_dat, __pyx_t_5};
3884 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
3885 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3886 __Pyx_GOTREF(__pyx_t_2);
3887 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3890 #if CYTHON_FAST_PYCCALL
3891 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
3892 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_s_Points_dat, __pyx_t_5};
3893 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
3894 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3895 __Pyx_GOTREF(__pyx_t_2);
3896 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3900 __pyx_t_7 = PyTuple_New(2+__pyx_t_6);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 160, __pyx_L1_error)
3901 __Pyx_GOTREF(__pyx_t_7);
3903 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
3905 __Pyx_INCREF(__pyx_kp_s_Points_dat);
3906 __Pyx_GIVEREF(__pyx_kp_s_Points_dat);
3907 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_kp_s_Points_dat);
3908 __Pyx_GIVEREF(__pyx_t_5);
3909 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
3911 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
3912 __Pyx_GOTREF(__pyx_t_2);
3913 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3915 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3916 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3925 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_copy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
3926 __Pyx_GOTREF(__pyx_t_1);
3927 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Profiling);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 161, __pyx_L1_error)
3928 __Pyx_GOTREF(__pyx_t_7);
3929 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logDir);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 161, __pyx_L1_error)
3930 __Pyx_GOTREF(__pyx_t_5);
3931 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3934 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
3935 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
3936 if (likely(__pyx_t_7)) {
3937 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
3938 __Pyx_INCREF(__pyx_t_7);
3939 __Pyx_INCREF(
function);
3940 __Pyx_DECREF_SET(__pyx_t_1,
function);
3944 #if CYTHON_FAST_PYCALL
3945 if (PyFunction_Check(__pyx_t_1)) {
3946 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_Solution_res, __pyx_t_5};
3947 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error)
3948 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3949 __Pyx_GOTREF(__pyx_t_2);
3950 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3953 #if CYTHON_FAST_PYCCALL
3954 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
3955 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_Solution_res, __pyx_t_5};
3956 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error)
3957 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3958 __Pyx_GOTREF(__pyx_t_2);
3959 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3963 __pyx_t_4 = PyTuple_New(2+__pyx_t_6);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error)
3964 __Pyx_GOTREF(__pyx_t_4);
3966 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
3968 __Pyx_INCREF(__pyx_kp_s_Solution_res);
3969 __Pyx_GIVEREF(__pyx_kp_s_Solution_res);
3970 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_kp_s_Solution_res);
3971 __Pyx_GIVEREF(__pyx_t_5);
3972 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_t_5);
3974 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error)
3975 __Pyx_GOTREF(__pyx_t_2);
3976 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3978 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3979 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3988 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_copy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
3989 __Pyx_GOTREF(__pyx_t_1);
3990 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Profiling);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error)
3991 __Pyx_GOTREF(__pyx_t_4);
3992 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_logDir);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 162, __pyx_L1_error)
3993 __Pyx_GOTREF(__pyx_t_5);
3994 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3997 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
3998 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
3999 if (likely(__pyx_t_4)) {
4000 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
4001 __Pyx_INCREF(__pyx_t_4);
4002 __Pyx_INCREF(
function);
4003 __Pyx_DECREF_SET(__pyx_t_1,
function);
4007 #if CYTHON_FAST_PYCALL
4008 if (PyFunction_Check(__pyx_t_1)) {
4009 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_s_Surface_res, __pyx_t_5};
4010 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error)
4011 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4012 __Pyx_GOTREF(__pyx_t_2);
4013 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4016 #if CYTHON_FAST_PYCCALL
4017 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
4018 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_s_Surface_res, __pyx_t_5};
4019 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error)
4020 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4021 __Pyx_GOTREF(__pyx_t_2);
4022 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4026 __pyx_t_7 = PyTuple_New(2+__pyx_t_6);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 162, __pyx_L1_error)
4027 __Pyx_GOTREF(__pyx_t_7);
4029 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
4031 __Pyx_INCREF(__pyx_kp_s_Surface_res);
4032 __Pyx_GIVEREF(__pyx_kp_s_Surface_res);
4033 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_kp_s_Surface_res);
4034 __Pyx_GIVEREF(__pyx_t_5);
4035 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
4037 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error)
4038 __Pyx_GOTREF(__pyx_t_2);
4039 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4041 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4042 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4051 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_copy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
4052 __Pyx_GOTREF(__pyx_t_1);
4053 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Profiling);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 163, __pyx_L1_error)
4054 __Pyx_GOTREF(__pyx_t_7);
4055 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_logDir);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error)
4056 __Pyx_GOTREF(__pyx_t_5);
4057 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4060 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
4061 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
4062 if (likely(__pyx_t_7)) {
4063 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
4064 __Pyx_INCREF(__pyx_t_7);
4065 __Pyx_INCREF(
function);
4066 __Pyx_DECREF_SET(__pyx_t_1,
function);
4070 #if CYTHON_FAST_PYCALL
4071 if (PyFunction_Check(__pyx_t_1)) {
4072 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_Flowfield_res, __pyx_t_5};
4073 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
4074 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4075 __Pyx_GOTREF(__pyx_t_2);
4076 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4079 #if CYTHON_FAST_PYCCALL
4080 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
4081 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_Flowfield_res, __pyx_t_5};
4082 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
4083 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4084 __Pyx_GOTREF(__pyx_t_2);
4085 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4089 __pyx_t_4 = PyTuple_New(2+__pyx_t_6);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
4090 __Pyx_GOTREF(__pyx_t_4);
4092 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
4094 __Pyx_INCREF(__pyx_kp_s_Flowfield_res);
4095 __Pyx_GIVEREF(__pyx_kp_s_Flowfield_res);
4096 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_kp_s_Flowfield_res);
4097 __Pyx_GIVEREF(__pyx_t_5);
4098 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_t_5);
4100 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
4101 __Pyx_GOTREF(__pyx_t_2);
4102 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4104 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4105 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4125 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4128 __Pyx_XDECREF(__pyx_t_1);
4129 __Pyx_XDECREF(__pyx_t_2);
4130 __Pyx_XDECREF(__pyx_t_4);
4131 __Pyx_XDECREF(__pyx_t_5);
4132 __Pyx_XDECREF(__pyx_t_7);
4133 __Pyx_AddTraceback(
"fenton.Fenton.copyFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
4136 __Pyx_XGIVEREF(__pyx_r);
4137 __Pyx_RefNannyFinishContext();
4149 static PyObject *__pyx_pw_6fenton_6Fenton_11__get_dir(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
4150 static PyMethodDef __pyx_mdef_6fenton_6Fenton_11__get_dir = {
"__get_dir", (PyCFunction)__pyx_pw_6fenton_6Fenton_11__get_dir, METH_NOARGS, 0};
4151 static PyObject *__pyx_pw_6fenton_6Fenton_11__get_dir(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
4152 PyObject *__pyx_r = 0;
4153 __Pyx_RefNannyDeclarations
4154 __Pyx_RefNannySetupContext(
"__get_dir (wrapper)", 0);
4155 __pyx_r = __pyx_pf_6fenton_6Fenton_10__get_dir(__pyx_self);
4158 __Pyx_RefNannyFinishContext();
4162 static PyObject *__pyx_pf_6fenton_6Fenton_10__get_dir(CYTHON_UNUSED PyObject *__pyx_self) {
4163 PyObject *__pyx_r = NULL;
4164 __Pyx_RefNannyDeclarations
4165 PyObject *__pyx_t_1 = NULL;
4166 PyObject *__pyx_t_2 = NULL;
4167 PyObject *__pyx_t_3 = NULL;
4168 PyObject *__pyx_t_4 = NULL;
4169 int __pyx_lineno = 0;
4170 const char *__pyx_filename = NULL;
4171 int __pyx_clineno = 0;
4172 __Pyx_RefNannySetupContext(
"__get_dir", 0);
4179 __Pyx_XDECREF(__pyx_r);
4180 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error)
4181 __Pyx_GOTREF(__pyx_t_2);
4182 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error)
4183 __Pyx_GOTREF(__pyx_t_3);
4184 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4185 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dirname);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error)
4186 __Pyx_GOTREF(__pyx_t_2);
4187 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4188 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_file);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error)
4189 __Pyx_GOTREF(__pyx_t_3);
4191 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4192 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
4193 if (likely(__pyx_t_4)) {
4194 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4195 __Pyx_INCREF(__pyx_t_4);
4196 __Pyx_INCREF(
function);
4197 __Pyx_DECREF_SET(__pyx_t_2,
function);
4200 __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
4201 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4202 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4203 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error)
4204 __Pyx_GOTREF(__pyx_t_1);
4205 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4206 __pyx_r = __pyx_t_1;
4219 __Pyx_XDECREF(__pyx_t_1);
4220 __Pyx_XDECREF(__pyx_t_2);
4221 __Pyx_XDECREF(__pyx_t_3);
4222 __Pyx_XDECREF(__pyx_t_4);
4223 __Pyx_AddTraceback(
"fenton.Fenton.__get_dir", __pyx_clineno, __pyx_lineno, __pyx_filename);
4226 __Pyx_XGIVEREF(__pyx_r);
4227 __Pyx_RefNannyFinishContext();
4239 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
4240 PyObject *__pyx_r = NULL;
4241 __Pyx_RefNannyDeclarations
4242 PyObject *__pyx_t_1 = NULL;
4243 int __pyx_lineno = 0;
4244 const char *__pyx_filename = NULL;
4245 int __pyx_clineno = 0;
4246 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
4255 __Pyx_XDECREF(__pyx_r);
4256 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 736, __pyx_L1_error)
4257 __Pyx_GOTREF(__pyx_t_1);
4258 __pyx_r = __pyx_t_1;
4272 __Pyx_XDECREF(__pyx_t_1);
4273 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
4276 __Pyx_XGIVEREF(__pyx_r);
4277 __Pyx_RefNannyFinishContext();
4289 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
4290 PyObject *__pyx_r = NULL;
4291 __Pyx_RefNannyDeclarations
4292 PyObject *__pyx_t_1 = NULL;
4293 int __pyx_lineno = 0;
4294 const char *__pyx_filename = NULL;
4295 int __pyx_clineno = 0;
4296 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
4305 __Pyx_XDECREF(__pyx_r);
4306 __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)
4307 __Pyx_GOTREF(__pyx_t_1);
4308 __pyx_r = __pyx_t_1;
4322 __Pyx_XDECREF(__pyx_t_1);
4323 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
4326 __Pyx_XGIVEREF(__pyx_r);
4327 __Pyx_RefNannyFinishContext();
4339 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
4340 PyObject *__pyx_r = NULL;
4341 __Pyx_RefNannyDeclarations
4342 PyObject *__pyx_t_1 = NULL;
4343 int __pyx_lineno = 0;
4344 const char *__pyx_filename = NULL;
4345 int __pyx_clineno = 0;
4346 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
4355 __Pyx_XDECREF(__pyx_r);
4356 __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)
4357 __Pyx_GOTREF(__pyx_t_1);
4358 __pyx_r = __pyx_t_1;
4372 __Pyx_XDECREF(__pyx_t_1);
4373 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
4376 __Pyx_XGIVEREF(__pyx_r);
4377 __Pyx_RefNannyFinishContext();
4389 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) {
4390 PyObject *__pyx_r = NULL;
4391 __Pyx_RefNannyDeclarations
4392 PyObject *__pyx_t_1 = NULL;
4393 int __pyx_lineno = 0;
4394 const char *__pyx_filename = NULL;
4395 int __pyx_clineno = 0;
4396 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
4405 __Pyx_XDECREF(__pyx_r);
4406 __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)
4407 __Pyx_GOTREF(__pyx_t_1);
4408 __pyx_r = __pyx_t_1;
4422 __Pyx_XDECREF(__pyx_t_1);
4423 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
4426 __Pyx_XGIVEREF(__pyx_r);
4427 __Pyx_RefNannyFinishContext();
4439 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) {
4440 PyObject *__pyx_r = NULL;
4441 __Pyx_RefNannyDeclarations
4442 PyObject *__pyx_t_1 = NULL;
4443 int __pyx_lineno = 0;
4444 const char *__pyx_filename = NULL;
4445 int __pyx_clineno = 0;
4446 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
4455 __Pyx_XDECREF(__pyx_r);
4456 __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)
4457 __Pyx_GOTREF(__pyx_t_1);
4458 __pyx_r = __pyx_t_1;
4472 __Pyx_XDECREF(__pyx_t_1);
4473 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
4476 __Pyx_XGIVEREF(__pyx_r);
4477 __Pyx_RefNannyFinishContext();
4489 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
4490 PyObject *__pyx_r = NULL;
4491 __Pyx_RefNannyDeclarations
4493 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
4502 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
4512 __Pyx_XDECREF(__pyx_r);
4513 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
4514 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
4534 __Pyx_XDECREF(__pyx_r);
4535 __Pyx_INCREF(__pyx_empty_tuple);
4536 __pyx_r = __pyx_empty_tuple;
4550 __Pyx_XGIVEREF(__pyx_r);
4551 __Pyx_RefNannyFinishContext();
4563 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
4564 __Pyx_RefNannyDeclarations
4565 __Pyx_RefNannySetupContext(
"set_array_base", 0);
4574 Py_INCREF(__pyx_v_base);
4583 (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
4594 __Pyx_RefNannyFinishContext();
4605 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
4606 PyObject *__pyx_v_base;
4607 PyObject *__pyx_r = NULL;
4608 __Pyx_RefNannyDeclarations
4610 __Pyx_RefNannySetupContext(
"get_array_base", 0);
4619 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
4628 __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
4638 __Pyx_XDECREF(__pyx_r);
4639 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4658 __Pyx_XDECREF(__pyx_r);
4659 __Pyx_INCREF(((PyObject *)__pyx_v_base));
4660 __pyx_r = ((PyObject *)__pyx_v_base);
4673 __Pyx_XGIVEREF(__pyx_r);
4674 __Pyx_RefNannyFinishContext();
4686 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
4688 __Pyx_RefNannyDeclarations
4689 PyObject *__pyx_t_1 = NULL;
4690 PyObject *__pyx_t_2 = NULL;
4691 PyObject *__pyx_t_3 = NULL;
4693 PyObject *__pyx_t_5 = NULL;
4694 PyObject *__pyx_t_6 = NULL;
4695 PyObject *__pyx_t_7 = NULL;
4696 PyObject *__pyx_t_8 = NULL;
4697 int __pyx_lineno = 0;
4698 const char *__pyx_filename = NULL;
4699 int __pyx_clineno = 0;
4700 __Pyx_RefNannySetupContext(
"import_array", 0);
4710 __Pyx_PyThreadState_declare
4711 __Pyx_PyThreadState_assign
4712 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
4713 __Pyx_XGOTREF(__pyx_t_1);
4714 __Pyx_XGOTREF(__pyx_t_2);
4715 __Pyx_XGOTREF(__pyx_t_3);
4725 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 943, __pyx_L3_error)
4735 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4736 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4737 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4738 goto __pyx_L8_try_end;
4748 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
4750 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
4751 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 944, __pyx_L5_except_error)
4752 __Pyx_GOTREF(__pyx_t_5);
4753 __Pyx_GOTREF(__pyx_t_6);
4754 __Pyx_GOTREF(__pyx_t_7);
4763 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 945, __pyx_L5_except_error)
4764 __Pyx_GOTREF(__pyx_t_8);
4765 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
4766 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4767 __PYX_ERR(1, 945, __pyx_L5_except_error)
4769 goto __pyx_L5_except_error;
4770 __pyx_L5_except_error:;
4779 __Pyx_XGIVEREF(__pyx_t_1);
4780 __Pyx_XGIVEREF(__pyx_t_2);
4781 __Pyx_XGIVEREF(__pyx_t_3);
4782 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
4783 goto __pyx_L1_error;
4799 __Pyx_XDECREF(__pyx_t_5);
4800 __Pyx_XDECREF(__pyx_t_6);
4801 __Pyx_XDECREF(__pyx_t_7);
4802 __Pyx_XDECREF(__pyx_t_8);
4803 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
4806 __Pyx_RefNannyFinishContext();
4818 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
4820 __Pyx_RefNannyDeclarations
4821 PyObject *__pyx_t_1 = NULL;
4822 PyObject *__pyx_t_2 = NULL;
4823 PyObject *__pyx_t_3 = NULL;
4825 PyObject *__pyx_t_5 = NULL;
4826 PyObject *__pyx_t_6 = NULL;
4827 PyObject *__pyx_t_7 = NULL;
4828 PyObject *__pyx_t_8 = NULL;
4829 int __pyx_lineno = 0;
4830 const char *__pyx_filename = NULL;
4831 int __pyx_clineno = 0;
4832 __Pyx_RefNannySetupContext(
"import_umath", 0);
4842 __Pyx_PyThreadState_declare
4843 __Pyx_PyThreadState_assign
4844 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
4845 __Pyx_XGOTREF(__pyx_t_1);
4846 __Pyx_XGOTREF(__pyx_t_2);
4847 __Pyx_XGOTREF(__pyx_t_3);
4857 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 949, __pyx_L3_error)
4867 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4868 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4869 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4870 goto __pyx_L8_try_end;
4880 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
4882 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
4883 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 950, __pyx_L5_except_error)
4884 __Pyx_GOTREF(__pyx_t_5);
4885 __Pyx_GOTREF(__pyx_t_6);
4886 __Pyx_GOTREF(__pyx_t_7);
4895 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 951, __pyx_L5_except_error)
4896 __Pyx_GOTREF(__pyx_t_8);
4897 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
4898 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4899 __PYX_ERR(1, 951, __pyx_L5_except_error)
4901 goto __pyx_L5_except_error;
4902 __pyx_L5_except_error:;
4911 __Pyx_XGIVEREF(__pyx_t_1);
4912 __Pyx_XGIVEREF(__pyx_t_2);
4913 __Pyx_XGIVEREF(__pyx_t_3);
4914 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
4915 goto __pyx_L1_error;
4931 __Pyx_XDECREF(__pyx_t_5);
4932 __Pyx_XDECREF(__pyx_t_6);
4933 __Pyx_XDECREF(__pyx_t_7);
4934 __Pyx_XDECREF(__pyx_t_8);
4935 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
4938 __Pyx_RefNannyFinishContext();
4950 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
4952 __Pyx_RefNannyDeclarations
4953 PyObject *__pyx_t_1 = NULL;
4954 PyObject *__pyx_t_2 = NULL;
4955 PyObject *__pyx_t_3 = NULL;
4957 PyObject *__pyx_t_5 = NULL;
4958 PyObject *__pyx_t_6 = NULL;
4959 PyObject *__pyx_t_7 = NULL;
4960 PyObject *__pyx_t_8 = NULL;
4961 int __pyx_lineno = 0;
4962 const char *__pyx_filename = NULL;
4963 int __pyx_clineno = 0;
4964 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
4974 __Pyx_PyThreadState_declare
4975 __Pyx_PyThreadState_assign
4976 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
4977 __Pyx_XGOTREF(__pyx_t_1);
4978 __Pyx_XGOTREF(__pyx_t_2);
4979 __Pyx_XGOTREF(__pyx_t_3);
4989 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 955, __pyx_L3_error)
4999 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5000 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5001 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5002 goto __pyx_L8_try_end;
5012 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
5014 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
5015 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 956, __pyx_L5_except_error)
5016 __Pyx_GOTREF(__pyx_t_5);
5017 __Pyx_GOTREF(__pyx_t_6);
5018 __Pyx_GOTREF(__pyx_t_7);
5027 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 957, __pyx_L5_except_error)
5028 __Pyx_GOTREF(__pyx_t_8);
5029 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5030 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5031 __PYX_ERR(1, 957, __pyx_L5_except_error)
5033 goto __pyx_L5_except_error;
5034 __pyx_L5_except_error:;
5043 __Pyx_XGIVEREF(__pyx_t_1);
5044 __Pyx_XGIVEREF(__pyx_t_2);
5045 __Pyx_XGIVEREF(__pyx_t_3);
5046 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5047 goto __pyx_L1_error;
5063 __Pyx_XDECREF(__pyx_t_5);
5064 __Pyx_XDECREF(__pyx_t_6);
5065 __Pyx_XDECREF(__pyx_t_7);
5066 __Pyx_XDECREF(__pyx_t_8);
5067 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
5070 __Pyx_RefNannyFinishContext();
5082 static CYTHON_INLINE
int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
5084 __Pyx_RefNannyDeclarations
5085 __Pyx_RefNannySetupContext(
"is_timedelta64_object", 0);
5094 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
5107 __Pyx_RefNannyFinishContext();
5119 static CYTHON_INLINE
int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
5121 __Pyx_RefNannyDeclarations
5122 __Pyx_RefNannySetupContext(
"is_datetime64_object", 0);
5131 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
5144 __Pyx_RefNannyFinishContext();
5156 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
5157 npy_datetime __pyx_r;
5166 __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
5190 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
5191 npy_timedelta __pyx_r;
5200 __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
5224 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
5225 NPY_DATETIMEUNIT __pyx_r;
5232 __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
5248 static PyMethodDef __pyx_methods[] = {
5252 #if PY_MAJOR_VERSION >= 3
5253 #if CYTHON_PEP489_MULTI_PHASE_INIT
5254 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
5255 static int __pyx_pymod_exec_Fenton(PyObject* module);
5256 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
5257 {Py_mod_create, (
void*)__pyx_pymod_create},
5258 {Py_mod_exec, (
void*)__pyx_pymod_exec_Fenton},
5263 static struct PyModuleDef __pyx_moduledef = {
5264 PyModuleDef_HEAD_INIT,
5266 __pyx_k_Scripts_for_creating_Fenton_wav,
5267 #if CYTHON_PEP489_MULTI_PHASE_INIT
5273 #if CYTHON_PEP489_MULTI_PHASE_INIT
5274 __pyx_moduledef_slots,
5283 #ifndef CYTHON_SMALL_CODE
5284 #if defined(__clang__)
5285 #define CYTHON_SMALL_CODE
5286 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
5287 #define CYTHON_SMALL_CODE __attribute__((cold))
5289 #define CYTHON_SMALL_CODE
5293 static __Pyx_StringTabEntry __pyx_string_tab[] = {
5294 {&__pyx_n_s_BCoeffs, __pyx_k_BCoeffs,
sizeof(__pyx_k_BCoeffs), 0, 0, 1, 1},
5295 {&__pyx_kp_s_Control_file_to_control_converge, __pyx_k_Control_file_to_control_converge,
sizeof(__pyx_k_Control_file_to_control_converge), 0, 0, 1, 0},
5296 {&__pyx_kp_s_Convergence_dat, __pyx_k_Convergence_dat,
sizeof(__pyx_k_Convergence_dat), 0, 0, 1, 0},
5297 {&__pyx_kp_s_Data_dat, __pyx_k_Data_dat,
sizeof(__pyx_k_Data_dat), 0, 0, 1, 0},
5298 {&__pyx_n_s_FFT, __pyx_k_FFT,
sizeof(__pyx_k_FFT), 0, 0, 1, 1},
5299 {&__pyx_kp_s_Flowfield_res, __pyx_k_Flowfield_res,
sizeof(__pyx_k_Flowfield_res), 0, 0, 1, 0},
5300 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
5301 {&__pyx_n_s_Period, __pyx_k_Period,
sizeof(__pyx_k_Period), 0, 0, 1, 1},
5302 {&__pyx_kp_s_Period_or_wavelength_must_be_set, __pyx_k_Period_or_wavelength_must_be_set,
sizeof(__pyx_k_Period_or_wavelength_must_be_set), 0, 0, 1, 0},
5303 {&__pyx_kp_s_Points_dat, __pyx_k_Points_dat,
sizeof(__pyx_k_Points_dat), 0, 0, 1, 0},
5304 {&__pyx_n_s_Profiling, __pyx_k_Profiling,
sizeof(__pyx_k_Profiling), 0, 0, 1, 1},
5305 {&__pyx_kp_s_Solution_res, __pyx_k_Solution_res,
sizeof(__pyx_k_Solution_res), 0, 0, 1, 0},
5306 {&__pyx_kp_s_Surface_res, __pyx_k_Surface_res,
sizeof(__pyx_k_Surface_res), 0, 0, 1, 0},
5307 {&__pyx_n_s_Wave, __pyx_k_Wave,
sizeof(__pyx_k_Wave), 0, 0, 1, 1},
5308 {&__pyx_kp_s_Wave_waveheight_mode_length_curr, __pyx_k_Wave_waveheight_mode_length_curr,
sizeof(__pyx_k_Wave_waveheight_mode_length_curr), 0, 0, 1, 0},
5309 {&__pyx_n_s_Wavelength, __pyx_k_Wavelength,
sizeof(__pyx_k_Wavelength), 0, 0, 1, 1},
5310 {&__pyx_n_s_YCoeffs, __pyx_k_YCoeffs,
sizeof(__pyx_k_YCoeffs), 0, 0, 1, 1},
5311 {&__pyx_kp_s__3, __pyx_k__3,
sizeof(__pyx_k__3), 0, 0, 1, 0},
5312 {&__pyx_kp_s__8, __pyx_k__8,
sizeof(__pyx_k__8), 0, 0, 1, 0},
5313 {&__pyx_n_s_check_call, __pyx_k_check_call,
sizeof(__pyx_k_check_call), 0, 0, 1, 1},
5314 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
5315 {&__pyx_n_s_comments, __pyx_k_comments,
sizeof(__pyx_k_comments), 0, 0, 1, 1},
5316 {&__pyx_n_s_conv_crit, __pyx_k_conv_crit,
sizeof(__pyx_k_conv_crit), 0, 0, 1, 1},
5317 {&__pyx_n_s_copy, __pyx_k_copy,
sizeof(__pyx_k_copy), 0, 0, 1, 1},
5318 {&__pyx_n_s_copyFiles, __pyx_k_copyFiles,
sizeof(__pyx_k_copyFiles), 0, 0, 1, 1},
5319 {&__pyx_n_s_current_criterion, __pyx_k_current_criterion,
sizeof(__pyx_k_current_criterion), 0, 0, 1, 1},
5320 {&__pyx_n_s_current_magnitude, __pyx_k_current_magnitude,
sizeof(__pyx_k_current_magnitude), 0, 0, 1, 1},
5321 {&__pyx_n_s_current_magnitude_dimless, __pyx_k_current_magnitude_dimless,
sizeof(__pyx_k_current_magnitude_dimless), 0, 0, 1, 1},
5322 {&__pyx_n_s_delimiter, __pyx_k_delimiter,
sizeof(__pyx_k_delimiter), 0, 0, 1, 1},
5323 {&__pyx_n_s_depth, __pyx_k_depth,
sizeof(__pyx_k_depth), 0, 0, 1, 1},
5324 {&__pyx_n_s_dirname, __pyx_k_dirname,
sizeof(__pyx_k_dirname), 0, 0, 1, 1},
5325 {&__pyx_n_s_enter, __pyx_k_enter,
sizeof(__pyx_k_enter), 0, 0, 1, 1},
5326 {&__pyx_n_s_exit, __pyx_k_exit,
sizeof(__pyx_k_exit), 0, 0, 1, 1},
5327 {&__pyx_n_s_f, __pyx_k_f,
sizeof(__pyx_k_f), 0, 0, 1, 1},
5328 {&__pyx_n_s_fenton_Fenton, __pyx_k_fenton_Fenton,
sizeof(__pyx_k_fenton_Fenton), 0, 0, 1, 1},
5329 {&__pyx_n_s_file, __pyx_k_file,
sizeof(__pyx_k_file), 0, 0, 1, 1},
5330 {&__pyx_n_s_filename, __pyx_k_filename,
sizeof(__pyx_k_filename), 0, 0, 1, 1},
5331 {&__pyx_n_s_format, __pyx_k_format,
sizeof(__pyx_k_format), 0, 0, 1, 1},
5332 {&__pyx_n_s_g, __pyx_k_g,
sizeof(__pyx_k_g), 0, 0, 1, 1},
5333 {&__pyx_n_s_genfromtxt, __pyx_k_genfromtxt,
sizeof(__pyx_k_genfromtxt), 0, 0, 1, 1},
5334 {&__pyx_n_s_getBYCoeffs, __pyx_k_getBYCoeffs,
sizeof(__pyx_k_getBYCoeffs), 0, 0, 1, 1},
5335 {&__pyx_n_s_getWavelength, __pyx_k_getWavelength,
sizeof(__pyx_k_getWavelength), 0, 0, 1, 1},
5336 {&__pyx_n_s_get_dir, __pyx_k_get_dir,
sizeof(__pyx_k_get_dir), 0, 0, 1, 1},
5337 {&__pyx_n_s_height_steps, __pyx_k_height_steps,
sizeof(__pyx_k_height_steps), 0, 0, 1, 1},
5338 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
5339 {&__pyx_n_s_l, __pyx_k_l,
sizeof(__pyx_k_l), 0, 0, 1, 1},
5340 {&__pyx_n_s_length, __pyx_k_length,
sizeof(__pyx_k_length), 0, 0, 1, 1},
5341 {&__pyx_n_s_length_dimless, __pyx_k_length_dimless,
sizeof(__pyx_k_length_dimless), 0, 0, 1, 1},
5342 {&__pyx_n_s_line, __pyx_k_line,
sizeof(__pyx_k_line), 0, 0, 1, 1},
5343 {&__pyx_n_s_logDir, __pyx_k_logDir,
sizeof(__pyx_k_logDir), 0, 0, 1, 1},
5344 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
5345 {&__pyx_n_s_mode, __pyx_k_mode,
sizeof(__pyx_k_mode), 0, 0, 1, 1},
5346 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
5347 {&__pyx_n_s_ncoeffs, __pyx_k_ncoeffs,
sizeof(__pyx_k_ncoeffs), 0, 0, 1, 1},
5348 {&__pyx_n_s_niter, __pyx_k_niter,
sizeof(__pyx_k_niter), 0, 0, 1, 1},
5349 {&__pyx_n_s_np, __pyx_k_np,
sizeof(__pyx_k_np), 0, 0, 1, 1},
5350 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
5351 {&__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},
5352 {&__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},
5353 {&__pyx_n_s_open, __pyx_k_open,
sizeof(__pyx_k_open), 0, 0, 1, 1},
5354 {&__pyx_n_s_os, __pyx_k_os,
sizeof(__pyx_k_os), 0, 0, 1, 1},
5355 {&__pyx_n_s_path, __pyx_k_path,
sizeof(__pyx_k_path), 0, 0, 1, 1},
5356 {&__pyx_n_s_period, __pyx_k_period,
sizeof(__pyx_k_period), 0, 0, 1, 1},
5357 {&__pyx_n_s_points_freesurface, __pyx_k_points_freesurface,
sizeof(__pyx_k_points_freesurface), 0, 0, 1, 1},
5358 {&__pyx_n_s_points_velocity, __pyx_k_points_velocity,
sizeof(__pyx_k_points_velocity), 0, 0, 1, 1},
5359 {&__pyx_n_s_points_vertical, __pyx_k_points_vertical,
sizeof(__pyx_k_points_vertical), 0, 0, 1, 1},
5360 {&__pyx_n_s_proteus, __pyx_k_proteus,
sizeof(__pyx_k_proteus), 0, 0, 1, 1},
5361 {&__pyx_kp_s_proteus_fenton_Fenton_pyx, __pyx_k_proteus_fenton_Fenton_pyx,
sizeof(__pyx_k_proteus_fenton_Fenton_pyx), 0, 0, 1, 0},
5362 {&__pyx_n_s_r, __pyx_k_r,
sizeof(__pyx_k_r), 0, 0, 1, 1},
5363 {&__pyx_n_s_runFourier, __pyx_k_runFourier,
sizeof(__pyx_k_runFourier), 0, 0, 1, 1},
5364 {&__pyx_n_s_shutil, __pyx_k_shutil,
sizeof(__pyx_k_shutil), 0, 0, 1, 1},
5365 {&__pyx_n_s_split, __pyx_k_split,
sizeof(__pyx_k_split), 0, 0, 1, 1},
5366 {&__pyx_n_s_sqrt, __pyx_k_sqrt,
sizeof(__pyx_k_sqrt), 0, 0, 1, 1},
5367 {&__pyx_n_s_subprocess, __pyx_k_subprocess,
sizeof(__pyx_k_subprocess), 0, 0, 1, 1},
5368 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
5369 {&__pyx_n_s_w, __pyx_k_w,
sizeof(__pyx_k_w), 0, 0, 1, 1},
5370 {&__pyx_n_s_waveheight, __pyx_k_waveheight,
sizeof(__pyx_k_waveheight), 0, 0, 1, 1},
5371 {&__pyx_n_s_waveheight_dimless, __pyx_k_waveheight_dimless,
sizeof(__pyx_k_waveheight_dimless), 0, 0, 1, 1},
5372 {&__pyx_n_s_wavelength, __pyx_k_wavelength,
sizeof(__pyx_k_wavelength), 0, 0, 1, 1},
5373 {&__pyx_n_s_write, __pyx_k_write,
sizeof(__pyx_k_write), 0, 0, 1, 1},
5374 {&__pyx_n_s_writeInput, __pyx_k_writeInput,
sizeof(__pyx_k_writeInput), 0, 0, 1, 1},
5375 {0, 0, 0, 0, 0, 0, 0}
5377 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
5378 __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open);
if (!__pyx_builtin_open) __PYX_ERR(0, 72, __pyx_L1_error)
5379 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(1, 945, __pyx_L1_error)
5385 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
5386 __Pyx_RefNannyDeclarations
5387 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
5396 __pyx_tuple_ = PyTuple_Pack(3, Py_None, Py_None, Py_None);
if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 72, __pyx_L1_error)
5397 __Pyx_GOTREF(__pyx_tuple_);
5398 __Pyx_GIVEREF(__pyx_tuple_);
5407 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Solution_res);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 124, __pyx_L1_error)
5408 __Pyx_GOTREF(__pyx_tuple__2);
5409 __Pyx_GIVEREF(__pyx_tuple__2);
5418 __pyx_slice__4 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__4)) __PYX_ERR(0, 125, __pyx_L1_error)
5419 __Pyx_GOTREF(__pyx_slice__4);
5420 __Pyx_GIVEREF(__pyx_slice__4);
5421 __pyx_tuple__5 = PyTuple_Pack(2, __pyx_slice__4, __pyx_int_1);
if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 125, __pyx_L1_error)
5422 __Pyx_GOTREF(__pyx_tuple__5);
5423 __Pyx_GIVEREF(__pyx_tuple__5);
5432 __pyx_tuple__6 = PyTuple_Pack(2, __pyx_slice__4, __pyx_int_2);
if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 126, __pyx_L1_error)
5433 __Pyx_GOTREF(__pyx_tuple__6);
5434 __Pyx_GIVEREF(__pyx_tuple__6);
5443 __pyx_tuple__7 = PyTuple_Pack(2, __pyx_kp_s_Solution_res, __pyx_n_s_r);
if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 145, __pyx_L1_error)
5444 __Pyx_GOTREF(__pyx_tuple__7);
5445 __Pyx_GIVEREF(__pyx_tuple__7);
5454 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to);
if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 945, __pyx_L1_error)
5455 __Pyx_GOTREF(__pyx_tuple__9);
5456 __Pyx_GIVEREF(__pyx_tuple__9);
5465 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 951, __pyx_L1_error)
5466 __Pyx_GOTREF(__pyx_tuple__10);
5467 __Pyx_GIVEREF(__pyx_tuple__10);
5476 __pyx_tuple__11 = PyTuple_Pack(20, __pyx_n_s_waveheight, __pyx_n_s_depth, __pyx_n_s_period, __pyx_n_s_wavelength, __pyx_n_s_mode, __pyx_n_s_current_criterion, __pyx_n_s_current_magnitude, __pyx_n_s_ncoeffs, __pyx_n_s_height_steps, __pyx_n_s_g, __pyx_n_s_niter, __pyx_n_s_conv_crit, __pyx_n_s_points_freesurface, __pyx_n_s_points_velocity, __pyx_n_s_points_vertical, __pyx_n_s_filename, __pyx_n_s_f, __pyx_n_s_waveheight_dimless, __pyx_n_s_length_dimless, __pyx_n_s_current_magnitude_dimless);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 16, __pyx_L1_error)
5477 __Pyx_GOTREF(__pyx_tuple__11);
5478 __Pyx_GIVEREF(__pyx_tuple__11);
5479 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(15, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_fenton_Fenton_pyx, __pyx_n_s_writeInput, 16, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 16, __pyx_L1_error)
5488 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_fenton_Fenton_pyx, __pyx_n_s_runFourier, 105, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 105, __pyx_L1_error)
5497 __pyx_tuple__14 = PyTuple_Pack(3, __pyx_n_s_FFT, __pyx_n_s_BCoeffs, __pyx_n_s_YCoeffs);
if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 112, __pyx_L1_error)
5498 __Pyx_GOTREF(__pyx_tuple__14);
5499 __Pyx_GIVEREF(__pyx_tuple__14);
5500 __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_fenton_Fenton_pyx, __pyx_n_s_getBYCoeffs, 112, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 112, __pyx_L1_error)
5509 __pyx_tuple__16 = PyTuple_Pack(4, __pyx_n_s_wavelength, __pyx_n_s_f, __pyx_n_s_line, __pyx_n_s_l);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 129, __pyx_L1_error)
5510 __Pyx_GOTREF(__pyx_tuple__16);
5511 __Pyx_GIVEREF(__pyx_tuple__16);
5512 __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_fenton_Fenton_pyx, __pyx_n_s_getWavelength, 129, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 129, __pyx_L1_error)
5521 __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_fenton_Fenton_pyx, __pyx_n_s_copyFiles, 153, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 153, __pyx_L1_error)
5529 __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_fenton_Fenton_pyx, __pyx_n_s_get_dir, 165, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 165, __pyx_L1_error)
5530 __Pyx_RefNannyFinishContext();
5533 __Pyx_RefNannyFinishContext();
5537 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
5538 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
5539 __pyx_float_9_81 = PyFloat_FromDouble(9.81);
if (unlikely(!__pyx_float_9_81)) __PYX_ERR(0, 1, __pyx_L1_error)
5540 __pyx_float_1_eneg_05 = PyFloat_FromDouble(1.e-05);
if (unlikely(!__pyx_float_1_eneg_05)) __PYX_ERR(0, 1, __pyx_L1_error)
5541 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
5542 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
5543 __pyx_int_2 = PyInt_FromLong(2);
if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
5544 __pyx_int_8 = PyInt_FromLong(8);
if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error)
5545 __pyx_int_16 = PyInt_FromLong(16);
if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error)
5546 __pyx_int_20 = PyInt_FromLong(20);
if (unlikely(!__pyx_int_20)) __PYX_ERR(0, 1, __pyx_L1_error)
5547 __pyx_int_40 = PyInt_FromLong(40);
if (unlikely(!__pyx_int_40)) __PYX_ERR(0, 1, __pyx_L1_error)
5548 __pyx_int_50 = PyInt_FromLong(50);
if (unlikely(!__pyx_int_50)) __PYX_ERR(0, 1, __pyx_L1_error)
5554 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
5555 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
5556 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
5557 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
5558 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
5559 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
5560 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
5562 static int __Pyx_modinit_global_init_code(
void) {
5563 __Pyx_RefNannyDeclarations
5564 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
5566 __Pyx_RefNannyFinishContext();
5570 static int __Pyx_modinit_variable_export_code(
void) {
5571 __Pyx_RefNannyDeclarations
5572 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
5574 __Pyx_RefNannyFinishContext();
5578 static int __Pyx_modinit_function_export_code(
void) {
5579 __Pyx_RefNannyDeclarations
5580 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
5582 __Pyx_RefNannyFinishContext();
5586 static int __Pyx_modinit_type_init_code(
void) {
5587 __Pyx_RefNannyDeclarations
5588 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
5590 __Pyx_RefNannyFinishContext();
5594 static int __Pyx_modinit_type_import_code(
void) {
5595 __Pyx_RefNannyDeclarations
5596 PyObject *__pyx_t_1 = NULL;
5597 int __pyx_lineno = 0;
5598 const char *__pyx_filename = NULL;
5599 int __pyx_clineno = 0;
5600 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
5602 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
5603 __Pyx_GOTREF(__pyx_t_1);
5604 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
5605 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
5606 sizeof(PyTypeObject),
5608 sizeof(PyHeapTypeObject),
5610 __Pyx_ImportType_CheckSize_Warn);
5611 if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
5612 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5613 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 200, __pyx_L1_error)
5614 __Pyx_GOTREF(__pyx_t_1);
5615 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1,
"numpy",
"dtype",
sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
5616 if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 200, __pyx_L1_error)
5617 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flatiter",
sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
5618 if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 223, __pyx_L1_error)
5619 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1,
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
5620 if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 227, __pyx_L1_error)
5621 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ndarray",
sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
5622 if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 239, __pyx_L1_error)
5623 __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1,
"numpy",
"generic",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
5624 if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 771, __pyx_L1_error)
5625 __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1,
"numpy",
"number",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
5626 if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 773, __pyx_L1_error)
5627 __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1,
"numpy",
"integer",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
5628 if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 775, __pyx_L1_error)
5629 __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"signedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
5630 if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 777, __pyx_L1_error)
5631 __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"unsignedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
5632 if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 779, __pyx_L1_error)
5633 __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1,
"numpy",
"inexact",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
5634 if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 781, __pyx_L1_error)
5635 __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"floating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
5636 if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 783, __pyx_L1_error)
5637 __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"complexfloating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
5638 if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 785, __pyx_L1_error)
5639 __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flexible",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
5640 if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 787, __pyx_L1_error)
5641 __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1,
"numpy",
"character",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
5642 if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 789, __pyx_L1_error)
5643 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ufunc",
sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
5644 if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 827, __pyx_L1_error)
5645 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5646 __Pyx_RefNannyFinishContext();
5649 __Pyx_XDECREF(__pyx_t_1);
5650 __Pyx_RefNannyFinishContext();
5654 static int __Pyx_modinit_variable_import_code(
void) {
5655 __Pyx_RefNannyDeclarations
5656 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
5658 __Pyx_RefNannyFinishContext();
5662 static int __Pyx_modinit_function_import_code(
void) {
5663 __Pyx_RefNannyDeclarations
5664 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
5666 __Pyx_RefNannyFinishContext();
5671 #ifndef CYTHON_NO_PYINIT_EXPORT
5672 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
5673 #elif PY_MAJOR_VERSION < 3
5675 #define __Pyx_PyMODINIT_FUNC extern "C" void
5677 #define __Pyx_PyMODINIT_FUNC void
5681 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
5683 #define __Pyx_PyMODINIT_FUNC PyObject *
5688 #if PY_MAJOR_VERSION < 3
5689 __Pyx_PyMODINIT_FUNC initFenton(
void) CYTHON_SMALL_CODE;
5690 __Pyx_PyMODINIT_FUNC initFenton(
void)
5692 __Pyx_PyMODINIT_FUNC PyInit_Fenton(
void) CYTHON_SMALL_CODE;
5693 __Pyx_PyMODINIT_FUNC PyInit_Fenton(
void)
5694 #if CYTHON_PEP489_MULTI_PHASE_INIT
5696 return PyModuleDef_Init(&__pyx_moduledef);
5698 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
5699 #if PY_VERSION_HEX >= 0x030700A1
5700 static PY_INT64_T main_interpreter_id = -1;
5701 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
5702 if (main_interpreter_id == -1) {
5703 main_interpreter_id = current_id;
5704 return (unlikely(current_id == -1)) ? -1 : 0;
5705 }
else if (unlikely(main_interpreter_id != current_id))
5707 static PyInterpreterState *main_interpreter = NULL;
5708 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
5709 if (!main_interpreter) {
5710 main_interpreter = current_interpreter;
5711 }
else if (unlikely(main_interpreter != current_interpreter))
5716 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
5721 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) {
5722 PyObject *value = PyObject_GetAttrString(spec, from_name);
5724 if (likely(value)) {
5725 if (allow_none || value != Py_None) {
5726 result = PyDict_SetItemString(moddict, to_name, value);
5729 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
5736 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
5737 PyObject *module = NULL, *moddict, *modname;
5738 if (__Pyx_check_single_interpreter())
5741 return __Pyx_NewRef(__pyx_m);
5742 modname = PyObject_GetAttrString(spec,
"name");
5743 if (unlikely(!modname))
goto bad;
5744 module = PyModule_NewObject(modname);
5746 if (unlikely(!module))
goto bad;
5747 moddict = PyModule_GetDict(module);
5748 if (unlikely(!moddict))
goto bad;
5749 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
5750 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
5751 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
5752 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
5760 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_Fenton(PyObject *__pyx_pyinit_module)
5764 PyObject *__pyx_t_1 = NULL;
5765 PyObject *__pyx_t_2 = NULL;
5766 int __pyx_lineno = 0;
5767 const char *__pyx_filename = NULL;
5768 int __pyx_clineno = 0;
5769 __Pyx_RefNannyDeclarations
5770 #if CYTHON_PEP489_MULTI_PHASE_INIT
5772 if (__pyx_m == __pyx_pyinit_module)
return 0;
5773 PyErr_SetString(PyExc_RuntimeError,
"Module 'Fenton' has already been imported. Re-initialisation is not supported.");
5776 #elif PY_MAJOR_VERSION >= 3
5777 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
5780 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
5781 if (!__Pyx_RefNanny) {
5783 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
5784 if (!__Pyx_RefNanny)
5785 Py_FatalError(
"failed to import 'refnanny' module");
5788 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_Fenton(void)", 0);
5789 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5790 #ifdef __Pxy_PyFrame_Initialize_Offsets
5791 __Pxy_PyFrame_Initialize_Offsets();
5793 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
5794 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
5795 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
5796 #ifdef __Pyx_CyFunction_USED
5797 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5799 #ifdef __Pyx_FusedFunction_USED
5800 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5802 #ifdef __Pyx_Coroutine_USED
5803 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5805 #ifdef __Pyx_Generator_USED
5806 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5808 #ifdef __Pyx_AsyncGen_USED
5809 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5811 #ifdef __Pyx_StopAsyncIteration_USED
5812 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5816 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
5817 PyEval_InitThreads();
5820 #if CYTHON_PEP489_MULTI_PHASE_INIT
5821 __pyx_m = __pyx_pyinit_module;
5824 #if PY_MAJOR_VERSION < 3
5825 __pyx_m = Py_InitModule4(
"Fenton", __pyx_methods, __pyx_k_Scripts_for_creating_Fenton_wav, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
5827 __pyx_m = PyModule_Create(&__pyx_moduledef);
5829 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
5831 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
5833 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
5835 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
5836 Py_INCREF(__pyx_cython_runtime);
5837 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
5839 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5840 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
5841 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5843 if (__pyx_module_is_main_fenton__Fenton) {
5844 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5846 #if PY_MAJOR_VERSION >= 3
5848 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
5849 if (!PyDict_GetItemString(modules,
"fenton.Fenton")) {
5850 if (unlikely(PyDict_SetItemString(modules,
"fenton.Fenton", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
5855 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5857 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5859 (void)__Pyx_modinit_global_init_code();
5860 (void)__Pyx_modinit_variable_export_code();
5861 (void)__Pyx_modinit_function_export_code();
5862 (void)__Pyx_modinit_type_init_code();
5863 if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
5864 (void)__Pyx_modinit_variable_import_code();
5865 (void)__Pyx_modinit_function_import_code();
5867 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
5868 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5878 __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
5879 __Pyx_GOTREF(__pyx_t_1);
5880 if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 6, __pyx_L1_error)
5881 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5890 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
5891 __Pyx_GOTREF(__pyx_t_1);
5892 __Pyx_INCREF(__pyx_n_s_check_call);
5893 __Pyx_GIVEREF(__pyx_n_s_check_call);
5894 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_check_call);
5895 __pyx_t_2 = __Pyx_Import(__pyx_n_s_subprocess, __pyx_t_1, -1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error)
5896 __Pyx_GOTREF(__pyx_t_2);
5897 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5898 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_check_call);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
5899 __Pyx_GOTREF(__pyx_t_1);
5900 if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_call, __pyx_t_1) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
5901 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5902 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5911 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
5912 __Pyx_GOTREF(__pyx_t_2);
5913 __Pyx_INCREF(__pyx_n_s_copy);
5914 __Pyx_GIVEREF(__pyx_n_s_copy);
5915 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_copy);
5916 __pyx_t_1 = __Pyx_Import(__pyx_n_s_shutil, __pyx_t_2, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
5917 __Pyx_GOTREF(__pyx_t_1);
5918 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5919 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_copy);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
5920 __Pyx_GOTREF(__pyx_t_2);
5921 if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
5922 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5923 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5932 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
5933 __Pyx_GOTREF(__pyx_t_1);
5934 if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
5935 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5944 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
5945 __Pyx_GOTREF(__pyx_t_1);
5946 __Pyx_INCREF(__pyx_n_s_Profiling);
5947 __Pyx_GIVEREF(__pyx_n_s_Profiling);
5948 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Profiling);
5949 __pyx_t_2 = __Pyx_Import(__pyx_n_s_proteus, __pyx_t_1, -1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
5950 __Pyx_GOTREF(__pyx_t_2);
5951 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5952 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Profiling);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
5953 __Pyx_GOTREF(__pyx_t_1);
5954 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Profiling, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
5955 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5956 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5965 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6fenton_6Fenton_1writeInput, NULL, __pyx_n_s_fenton_Fenton);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
5966 __Pyx_GOTREF(__pyx_t_2);
5967 if (PyDict_SetItem(__pyx_d, __pyx_n_s_writeInput, __pyx_t_2) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
5968 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5977 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6fenton_6Fenton_3runFourier, NULL, __pyx_n_s_fenton_Fenton);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
5978 __Pyx_GOTREF(__pyx_t_2);
5979 if (PyDict_SetItem(__pyx_d, __pyx_n_s_runFourier, __pyx_t_2) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
5980 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5989 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6fenton_6Fenton_5getBYCoeffs, NULL, __pyx_n_s_fenton_Fenton);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error)
5990 __Pyx_GOTREF(__pyx_t_2);
5991 if (PyDict_SetItem(__pyx_d, __pyx_n_s_getBYCoeffs, __pyx_t_2) < 0) __PYX_ERR(0, 112, __pyx_L1_error)
5992 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6001 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6fenton_6Fenton_7getWavelength, NULL, __pyx_n_s_fenton_Fenton);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error)
6002 __Pyx_GOTREF(__pyx_t_2);
6003 if (PyDict_SetItem(__pyx_d, __pyx_n_s_getWavelength, __pyx_t_2) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
6004 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6013 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6fenton_6Fenton_9copyFiles, NULL, __pyx_n_s_fenton_Fenton);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
6014 __Pyx_GOTREF(__pyx_t_2);
6015 if (PyDict_SetItem(__pyx_d, __pyx_n_s_copyFiles, __pyx_t_2) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
6016 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6024 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6fenton_6Fenton_11__get_dir, NULL, __pyx_n_s_fenton_Fenton);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error)
6025 __Pyx_GOTREF(__pyx_t_2);
6026 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_dir, __pyx_t_2) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
6027 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6034 __pyx_t_2 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
6035 __Pyx_GOTREF(__pyx_t_2);
6036 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6037 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6051 __Pyx_XDECREF(__pyx_t_1);
6052 __Pyx_XDECREF(__pyx_t_2);
6055 __Pyx_AddTraceback(
"init fenton.Fenton", __pyx_clineno, __pyx_lineno, __pyx_filename);
6058 }
else if (!PyErr_Occurred()) {
6059 PyErr_SetString(PyExc_ImportError,
"init fenton.Fenton");
6062 __Pyx_RefNannyFinishContext();
6063 #if CYTHON_PEP489_MULTI_PHASE_INIT
6064 return (__pyx_m != NULL) ? 0 : -1;
6065 #elif PY_MAJOR_VERSION >= 3
6075 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
6076 PyObject *m = NULL, *p = NULL;
6078 m = PyImport_ImportModule(modname);
6080 p = PyObject_GetAttrString(m,
"RefNannyAPI");
6082 r = PyLong_AsVoidPtr(p);
6086 return (__Pyx_RefNannyAPIStruct *)
r;
6091 #if CYTHON_USE_TYPE_SLOTS
6092 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
6093 PyTypeObject* tp = Py_TYPE(obj);
6094 if (likely(tp->tp_getattro))
6095 return tp->tp_getattro(obj, attr_name);
6096 #if PY_MAJOR_VERSION < 3
6097 if (likely(tp->tp_getattr))
6098 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
6100 return PyObject_GetAttr(obj, attr_name);
6105 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
6106 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
6107 if (unlikely(!result)) {
6108 PyErr_Format(PyExc_NameError,
6109 #
if PY_MAJOR_VERSION >= 3
6110 "name '%U' is not defined", name);
6112 "name '%.200s' is not defined", PyString_AS_STRING(name));
6119 static void __Pyx_RaiseArgtupleInvalid(
6120 const char* func_name,
6124 Py_ssize_t num_found)
6126 Py_ssize_t num_expected;
6127 const char *more_or_less;
6128 if (num_found < num_min) {
6129 num_expected = num_min;
6130 more_or_less =
"at least";
6132 num_expected = num_max;
6133 more_or_less =
"at most";
6136 more_or_less =
"exactly";
6138 PyErr_Format(PyExc_TypeError,
6139 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
6140 func_name, more_or_less, num_expected,
6141 (num_expected == 1) ?
"" :
"s", num_found);
6145 static void __Pyx_RaiseDoubleKeywordsError(
6146 const char* func_name,
6149 PyErr_Format(PyExc_TypeError,
6150 #
if PY_MAJOR_VERSION >= 3
6151 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
6153 "%s() got multiple values for keyword argument '%s'", func_name,
6154 PyString_AsString(kw_name));
6159 static int __Pyx_ParseOptionalKeywords(
6161 PyObject **argnames[],
6164 Py_ssize_t num_pos_args,
6165 const char* function_name)
6167 PyObject *key = 0, *value = 0;
6170 PyObject*** first_kw_arg = argnames + num_pos_args;
6171 while (PyDict_Next(kwds, &
pos, &key, &value)) {
6172 name = first_kw_arg;
6173 while (*name && (**name != key)) name++;
6175 values[name-argnames] = value;
6178 name = first_kw_arg;
6179 #if PY_MAJOR_VERSION < 3
6180 if (likely(PyString_Check(key))) {
6182 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
6183 && _PyString_Eq(**name, key)) {
6184 values[name-argnames] = value;
6189 if (*name)
continue;
6191 PyObject*** argname = argnames;
6192 while (argname != first_kw_arg) {
6193 if ((**argname == key) || (
6194 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
6195 && _PyString_Eq(**argname, key))) {
6196 goto arg_passed_twice;
6203 if (likely(PyUnicode_Check(key))) {
6205 int cmp = (**name == key) ? 0 :
6206 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
6207 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
6209 PyUnicode_Compare(**name, key);
6210 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
6212 values[name-argnames] = value;
6217 if (*name)
continue;
6219 PyObject*** argname = argnames;
6220 while (argname != first_kw_arg) {
6221 int cmp = (**argname == key) ? 0 :
6222 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
6223 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
6225 PyUnicode_Compare(**argname, key);
6226 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
6227 if (cmp == 0)
goto arg_passed_twice;
6232 goto invalid_keyword_type;
6234 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
6236 goto invalid_keyword;
6241 __Pyx_RaiseDoubleKeywordsError(function_name, key);
6243 invalid_keyword_type:
6244 PyErr_Format(PyExc_TypeError,
6245 "%.200s() keywords must be strings", function_name);
6248 PyErr_Format(PyExc_TypeError,
6249 #
if PY_MAJOR_VERSION < 3
6250 "%.200s() got an unexpected keyword argument '%.200s'",
6251 function_name, PyString_AsString(key));
6253 "%s() got an unexpected keyword argument '%U'",
6254 function_name, key);
6261 #if CYTHON_COMPILING_IN_CPYTHON
6262 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
6264 ternaryfunc call = Py_TYPE(func)->tp_call;
6265 if (unlikely(!call))
6266 return PyObject_Call(func, arg, kw);
6267 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
6269 result = (*call)(func, arg, kw);
6270 Py_LeaveRecursiveCall();
6271 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
6274 "NULL result without error in PyObject_Call");
6281 #if CYTHON_FAST_PYCALL
6282 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
6283 PyObject *globals) {
6285 PyThreadState *tstate = __Pyx_PyThreadState_Current;
6286 PyObject **fastlocals;
6289 assert(globals != NULL);
6294 assert(tstate != NULL);
6295 f = PyFrame_New(tstate, co, globals, NULL);
6299 fastlocals = __Pyx_PyFrame_GetLocalsplus(
f);
6300 for (i = 0; i < na; i++) {
6302 fastlocals[i] = *args++;
6304 result = PyEval_EvalFrameEx(
f,0);
6305 ++tstate->recursion_depth;
6307 --tstate->recursion_depth;
6310 #if 1 || PY_VERSION_HEX < 0x030600B1
6311 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
6312 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
6313 PyObject *globals = PyFunction_GET_GLOBALS(func);
6314 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
6316 #if PY_MAJOR_VERSION >= 3
6319 PyObject *kwtuple, **k;
6324 assert(kwargs == NULL || PyDict_Check(kwargs));
6325 nk = kwargs ? PyDict_Size(kwargs) : 0;
6326 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
6330 #
if PY_MAJOR_VERSION >= 3
6331 co->co_kwonlyargcount == 0 &&
6333 likely(kwargs == NULL || nk == 0) &&
6334 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
6335 if (argdefs == NULL && co->co_argcount == nargs) {
6336 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
6339 else if (nargs == 0 && argdefs != NULL
6340 && co->co_argcount == Py_SIZE(argdefs)) {
6343 args = &PyTuple_GET_ITEM(argdefs, 0);
6344 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
6348 if (kwargs != NULL) {
6350 kwtuple = PyTuple_New(2 * nk);
6351 if (kwtuple == NULL) {
6355 k = &PyTuple_GET_ITEM(kwtuple, 0);
6357 while (PyDict_Next(kwargs, &
pos, &k[i], &k[i+1])) {
6368 closure = PyFunction_GET_CLOSURE(func);
6369 #if PY_MAJOR_VERSION >= 3
6370 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
6372 if (argdefs != NULL) {
6373 d = &PyTuple_GET_ITEM(argdefs, 0);
6374 nd = Py_SIZE(argdefs);
6380 #if PY_MAJOR_VERSION >= 3
6381 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
6384 d, (
int)nd, kwdefs, closure);
6386 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
6389 d, (
int)nd, closure);
6391 Py_XDECREF(kwtuple);
6393 Py_LeaveRecursiveCall();
6400 #if CYTHON_COMPILING_IN_CPYTHON
6401 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
6402 PyObject *
self, *result;
6404 cfunc = PyCFunction_GET_FUNCTION(func);
6405 self = PyCFunction_GET_SELF(func);
6406 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
6408 result = cfunc(
self, arg);
6409 Py_LeaveRecursiveCall();
6410 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
6413 "NULL result without error in PyObject_Call");
6420 #if CYTHON_COMPILING_IN_CPYTHON
6421 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
6422 #if CYTHON_FAST_PYCALL
6423 if (PyFunction_Check(func)) {
6424 return __Pyx_PyFunction_FastCall(func, NULL, 0);
6427 #ifdef __Pyx_CyFunction_USED
6428 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
6430 if (likely(PyCFunction_Check(func)))
6433 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
6434 return __Pyx_PyObject_CallMethO(func, NULL);
6437 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
6442 #if CYTHON_FAST_PYCCALL
6443 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
6444 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
6445 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
6446 PyObject *
self = PyCFunction_GET_SELF(func);
6447 int flags = PyCFunction_GET_FLAGS(func);
6448 assert(PyCFunction_Check(func));
6449 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
6451 assert(nargs == 0 || args != NULL);
6455 assert(!PyErr_Occurred());
6456 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
6457 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
6459 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
6465 #if CYTHON_COMPILING_IN_CPYTHON
6466 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
6468 PyObject *args = PyTuple_New(1);
6469 if (unlikely(!args))
return NULL;
6471 PyTuple_SET_ITEM(args, 0, arg);
6472 result = __Pyx_PyObject_Call(func, args, NULL);
6476 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
6477 #if CYTHON_FAST_PYCALL
6478 if (PyFunction_Check(func)) {
6479 return __Pyx_PyFunction_FastCall(func, &arg, 1);
6482 if (likely(PyCFunction_Check(func))) {
6483 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
6484 return __Pyx_PyObject_CallMethO(func, arg);
6485 #if CYTHON_FAST_PYCCALL
6486 }
else if (__Pyx_PyFastCFunction_Check(func)) {
6487 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
6491 return __Pyx__PyObject_CallOneArg(func, arg);
6494 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
6496 PyObject *args = PyTuple_Pack(1, arg);
6497 if (unlikely(!args))
return NULL;
6498 result = __Pyx_PyObject_Call(func, args, NULL);
6505 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
6506 #if CYTHON_COMPILING_IN_PYPY
6507 return PyObject_RichCompareBool(s1, s2, equals);
6510 return (equals == Py_EQ);
6511 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
6512 const char *ps1, *ps2;
6513 Py_ssize_t length = PyBytes_GET_SIZE(s1);
6514 if (length != PyBytes_GET_SIZE(s2))
6515 return (equals == Py_NE);
6516 ps1 = PyBytes_AS_STRING(s1);
6517 ps2 = PyBytes_AS_STRING(s2);
6518 if (ps1[0] != ps2[0]) {
6519 return (equals == Py_NE);
6520 }
else if (length == 1) {
6521 return (equals == Py_EQ);
6524 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
6525 Py_hash_t hash1, hash2;
6526 hash1 = ((PyBytesObject*)s1)->ob_shash;
6527 hash2 = ((PyBytesObject*)s2)->ob_shash;
6528 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
6529 return (equals == Py_NE);
6532 result = memcmp(ps1, ps2, (
size_t)length);
6533 return (equals == Py_EQ) ? (result == 0) : (result != 0);
6535 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
6536 return (equals == Py_NE);
6537 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
6538 return (equals == Py_NE);
6541 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
6544 result = __Pyx_PyObject_IsTrue(py_result);
6545 Py_DECREF(py_result);
6552 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
6553 #if CYTHON_COMPILING_IN_PYPY
6554 return PyObject_RichCompareBool(s1, s2, equals);
6556 #if PY_MAJOR_VERSION < 3
6557 PyObject* owned_ref = NULL;
6559 int s1_is_unicode, s2_is_unicode;
6563 s1_is_unicode = PyUnicode_CheckExact(s1);
6564 s2_is_unicode = PyUnicode_CheckExact(s2);
6565 #if PY_MAJOR_VERSION < 3
6566 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
6567 owned_ref = PyUnicode_FromObject(s2);
6568 if (unlikely(!owned_ref))
6572 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
6573 owned_ref = PyUnicode_FromObject(s1);
6574 if (unlikely(!owned_ref))
6578 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
6579 return __Pyx_PyBytes_Equals(s1, s2, equals);
6582 if (s1_is_unicode & s2_is_unicode) {
6585 void *data1, *data2;
6586 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
6588 length = __Pyx_PyUnicode_GET_LENGTH(s1);
6589 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
6592 #if CYTHON_USE_UNICODE_INTERNALS
6594 Py_hash_t hash1, hash2;
6595 #if CYTHON_PEP393_ENABLED
6596 hash1 = ((PyASCIIObject*)s1)->hash;
6597 hash2 = ((PyASCIIObject*)s2)->hash;
6599 hash1 = ((PyUnicodeObject*)s1)->hash;
6600 hash2 = ((PyUnicodeObject*)s2)->hash;
6602 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
6607 kind = __Pyx_PyUnicode_KIND(s1);
6608 if (kind != __Pyx_PyUnicode_KIND(s2)) {
6611 data1 = __Pyx_PyUnicode_DATA(s1);
6612 data2 = __Pyx_PyUnicode_DATA(s2);
6613 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
6615 }
else if (length == 1) {
6618 int result = memcmp(data1, data2, (
size_t)(length * kind));
6619 #if PY_MAJOR_VERSION < 3
6620 Py_XDECREF(owned_ref);
6622 return (equals == Py_EQ) ? (result == 0) : (result != 0);
6624 }
else if ((s1 == Py_None) & s2_is_unicode) {
6626 }
else if ((s2 == Py_None) & s1_is_unicode) {
6630 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
6631 #if PY_MAJOR_VERSION < 3
6632 Py_XDECREF(owned_ref);
6636 result = __Pyx_PyObject_IsTrue(py_result);
6637 Py_DECREF(py_result);
6641 #if PY_MAJOR_VERSION < 3
6642 Py_XDECREF(owned_ref);
6644 return (equals == Py_EQ);
6646 #if PY_MAJOR_VERSION < 3
6647 Py_XDECREF(owned_ref);
6649 return (equals == Py_NE);
6654 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
6655 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
6656 PyObject *dict = Py_TYPE(obj)->tp_dict;
6657 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
6659 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
6660 PyObject **dictptr = NULL;
6661 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
6663 #if CYTHON_COMPILING_IN_CPYTHON
6664 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
6666 dictptr = _PyObject_GetDictPtr(obj);
6669 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
6671 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
6672 PyObject *dict = Py_TYPE(obj)->tp_dict;
6673 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
6675 return obj_dict_version == __Pyx_get_object_dict_version(obj);
6680 #if CYTHON_USE_DICT_VERSIONS
6681 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
6683 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
6687 #if !CYTHON_AVOID_BORROWED_REFS
6688 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
6689 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
6690 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
6691 if (likely(result)) {
6692 return __Pyx_NewRef(result);
6693 }
else if (unlikely(PyErr_Occurred())) {
6697 result = PyDict_GetItem(__pyx_d, name);
6698 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
6699 if (likely(result)) {
6700 return __Pyx_NewRef(result);
6704 result = PyObject_GetItem(__pyx_d, name);
6705 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
6706 if (likely(result)) {
6707 return __Pyx_NewRef(result);
6711 return __Pyx_GetBuiltinName(name);
6715 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
6716 PyObject *args, *result = NULL;
6717 #if CYTHON_FAST_PYCALL
6718 if (PyFunction_Check(
function)) {
6719 PyObject *args[2] = {arg1, arg2};
6720 return __Pyx_PyFunction_FastCall(
function, args, 2);
6723 #if CYTHON_FAST_PYCCALL
6724 if (__Pyx_PyFastCFunction_Check(
function)) {
6725 PyObject *args[2] = {arg1, arg2};
6726 return __Pyx_PyCFunction_FastCall(
function, args, 2);
6729 args = PyTuple_New(2);
6730 if (unlikely(!args))
goto done;
6732 PyTuple_SET_ITEM(args, 0, arg1);
6734 PyTuple_SET_ITEM(args, 1, arg2);
6735 Py_INCREF(
function);
6736 result = __Pyx_PyObject_Call(
function, args, NULL);
6738 Py_DECREF(
function);
6744 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname) {
6745 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
6749 #if CYTHON_USE_EXC_INFO_STACK
6750 static _PyErr_StackItem *
6751 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
6753 _PyErr_StackItem *exc_info = tstate->exc_info;
6754 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
6755 exc_info->previous_item != NULL)
6757 exc_info = exc_info->previous_item;
6764 #if CYTHON_FAST_THREAD_STATE
6765 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
6766 #if CYTHON_USE_EXC_INFO_STACK
6767 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
6768 *type = exc_info->exc_type;
6769 *value = exc_info->exc_value;
6770 *tb = exc_info->exc_traceback;
6772 *type = tstate->exc_type;
6773 *value = tstate->exc_value;
6774 *tb = tstate->exc_traceback;
6780 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
6781 PyObject *tmp_type, *tmp_value, *tmp_tb;
6782 #if CYTHON_USE_EXC_INFO_STACK
6783 _PyErr_StackItem *exc_info = tstate->exc_info;
6784 tmp_type = exc_info->exc_type;
6785 tmp_value = exc_info->exc_value;
6786 tmp_tb = exc_info->exc_traceback;
6787 exc_info->exc_type = type;
6788 exc_info->exc_value = value;
6789 exc_info->exc_traceback = tb;
6791 tmp_type = tstate->exc_type;
6792 tmp_value = tstate->exc_value;
6793 tmp_tb = tstate->exc_traceback;
6794 tstate->exc_type = type;
6795 tstate->exc_value = value;
6796 tstate->exc_traceback = tb;
6798 Py_XDECREF(tmp_type);
6799 Py_XDECREF(tmp_value);
6805 #if CYTHON_FAST_THREAD_STATE
6806 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
6808 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
6811 PyObject *local_type, *local_value, *local_tb;
6812 #if CYTHON_FAST_THREAD_STATE
6813 PyObject *tmp_type, *tmp_value, *tmp_tb;
6814 local_type = tstate->curexc_type;
6815 local_value = tstate->curexc_value;
6816 local_tb = tstate->curexc_traceback;
6817 tstate->curexc_type = 0;
6818 tstate->curexc_value = 0;
6819 tstate->curexc_traceback = 0;
6821 PyErr_Fetch(&local_type, &local_value, &local_tb);
6823 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
6824 #if CYTHON_FAST_THREAD_STATE
6825 if (unlikely(tstate->curexc_type))
6827 if (unlikely(PyErr_Occurred()))
6830 #if PY_MAJOR_VERSION >= 3
6832 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
6836 Py_XINCREF(local_tb);
6837 Py_XINCREF(local_type);
6838 Py_XINCREF(local_value);
6840 *value = local_value;
6842 #if CYTHON_FAST_THREAD_STATE
6843 #if CYTHON_USE_EXC_INFO_STACK
6845 _PyErr_StackItem *exc_info = tstate->exc_info;
6846 tmp_type = exc_info->exc_type;
6847 tmp_value = exc_info->exc_value;
6848 tmp_tb = exc_info->exc_traceback;
6849 exc_info->exc_type = local_type;
6850 exc_info->exc_value = local_value;
6851 exc_info->exc_traceback = local_tb;
6854 tmp_type = tstate->exc_type;
6855 tmp_value = tstate->exc_value;
6856 tmp_tb = tstate->exc_traceback;
6857 tstate->exc_type = local_type;
6858 tstate->exc_value = local_value;
6859 tstate->exc_traceback = local_tb;
6861 Py_XDECREF(tmp_type);
6862 Py_XDECREF(tmp_value);
6865 PyErr_SetExcInfo(local_type, local_value, local_tb);
6872 Py_XDECREF(local_type);
6873 Py_XDECREF(local_value);
6874 Py_XDECREF(local_tb);
6879 #if CYTHON_FAST_THREAD_STATE
6880 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
6881 PyObject *tmp_type, *tmp_value, *tmp_tb;
6882 tmp_type = tstate->curexc_type;
6883 tmp_value = tstate->curexc_value;
6884 tmp_tb = tstate->curexc_traceback;
6885 tstate->curexc_type = type;
6886 tstate->curexc_value = value;
6887 tstate->curexc_traceback = tb;
6888 Py_XDECREF(tmp_type);
6889 Py_XDECREF(tmp_value);
6892 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
6893 *type = tstate->curexc_type;
6894 *value = tstate->curexc_value;
6895 *tb = tstate->curexc_traceback;
6896 tstate->curexc_type = 0;
6897 tstate->curexc_value = 0;
6898 tstate->curexc_traceback = 0;
6903 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
6905 if (!j)
return NULL;
6906 r = PyObject_GetItem(o, j);
6910 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
6911 CYTHON_NCP_UNUSED
int wraparound,
6912 CYTHON_NCP_UNUSED
int boundscheck) {
6913 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6914 Py_ssize_t wrapped_i = i;
6915 if (wraparound & unlikely(i < 0)) {
6916 wrapped_i += PyList_GET_SIZE(o);
6918 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
6919 PyObject *
r = PyList_GET_ITEM(o, wrapped_i);
6923 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
6925 return PySequence_GetItem(o, i);
6928 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
6929 CYTHON_NCP_UNUSED
int wraparound,
6930 CYTHON_NCP_UNUSED
int boundscheck) {
6931 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6932 Py_ssize_t wrapped_i = i;
6933 if (wraparound & unlikely(i < 0)) {
6934 wrapped_i += PyTuple_GET_SIZE(o);
6936 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
6937 PyObject *
r = PyTuple_GET_ITEM(o, wrapped_i);
6941 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
6943 return PySequence_GetItem(o, i);
6946 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
6947 CYTHON_NCP_UNUSED
int wraparound,
6948 CYTHON_NCP_UNUSED
int boundscheck) {
6949 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
6950 if (is_list || PyList_CheckExact(o)) {
6951 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
6952 if ((!boundscheck) || (likely(__Pyx_is_valid_index(
n, PyList_GET_SIZE(o))))) {
6953 PyObject *
r = PyList_GET_ITEM(o,
n);
6958 else if (PyTuple_CheckExact(o)) {
6959 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
6960 if ((!boundscheck) || likely(__Pyx_is_valid_index(
n, PyTuple_GET_SIZE(o)))) {
6961 PyObject *
r = PyTuple_GET_ITEM(o,
n);
6966 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
6967 if (likely(m && m->sq_item)) {
6968 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
6969 Py_ssize_t l = m->sq_length(o);
6970 if (likely(l >= 0)) {
6973 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
6978 return m->sq_item(o, i);
6982 if (is_list || PySequence_Check(o)) {
6983 return PySequence_GetItem(o, i);
6986 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
6990 #if CYTHON_USE_TYPE_SLOTS
6991 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
6993 Py_ssize_t key_value;
6994 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
6995 if (unlikely(!(m && m->sq_item))) {
6996 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
6999 key_value = __Pyx_PyIndex_AsSsize_t(index);
7000 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
7001 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
7003 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
7005 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
7009 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
7010 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
7011 if (likely(m && m->mp_subscript)) {
7012 return m->mp_subscript(obj, key);
7014 return __Pyx_PyObject_GetIndex(obj, key);
7019 #if CYTHON_FAST_THREAD_STATE
7020 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
7022 n = PyTuple_GET_SIZE(tuple);
7023 #if PY_MAJOR_VERSION >= 3
7024 for (i=0; i<
n; i++) {
7025 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
7028 for (i=0; i<
n; i++) {
7029 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
7033 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
7034 PyObject *exc_type = tstate->curexc_type;
7035 if (exc_type == err)
return 1;
7036 if (unlikely(!exc_type))
return 0;
7037 if (unlikely(PyTuple_Check(err)))
7038 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
7039 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
7044 #if PY_MAJOR_VERSION < 3
7045 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
7046 CYTHON_UNUSED PyObject *cause) {
7047 __Pyx_PyThreadState_declare
7049 if (!value || value == Py_None)
7053 if (!tb || tb == Py_None)
7057 if (!PyTraceBack_Check(tb)) {
7058 PyErr_SetString(PyExc_TypeError,
7059 "raise: arg 3 must be a traceback or None");
7063 if (PyType_Check(type)) {
7064 #if CYTHON_COMPILING_IN_PYPY
7070 PyErr_NormalizeException(&type, &value, &tb);
7073 PyErr_SetString(PyExc_TypeError,
7074 "instance exception may not have a separate value");
7078 type = (PyObject*) Py_TYPE(type);
7080 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
7081 PyErr_SetString(PyExc_TypeError,
7082 "raise: exception class must be a subclass of BaseException");
7086 __Pyx_PyThreadState_assign
7087 __Pyx_ErrRestore(type, value, tb);
7096 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
7097 PyObject* owned_instance = NULL;
7098 if (tb == Py_None) {
7100 }
else if (tb && !PyTraceBack_Check(tb)) {
7101 PyErr_SetString(PyExc_TypeError,
7102 "raise: arg 3 must be a traceback or None");
7105 if (value == Py_None)
7107 if (PyExceptionInstance_Check(type)) {
7109 PyErr_SetString(PyExc_TypeError,
7110 "instance exception may not have a separate value");
7114 type = (PyObject*) Py_TYPE(value);
7115 }
else if (PyExceptionClass_Check(type)) {
7116 PyObject *instance_class = NULL;
7117 if (value && PyExceptionInstance_Check(value)) {
7118 instance_class = (PyObject*) Py_TYPE(value);
7119 if (instance_class != type) {
7120 int is_subclass = PyObject_IsSubclass(instance_class, type);
7122 instance_class = NULL;
7123 }
else if (unlikely(is_subclass == -1)) {
7126 type = instance_class;
7130 if (!instance_class) {
7133 args = PyTuple_New(0);
7134 else if (PyTuple_Check(value)) {
7138 args = PyTuple_Pack(1, value);
7141 owned_instance = PyObject_Call(type, args, NULL);
7143 if (!owned_instance)
7145 value = owned_instance;
7146 if (!PyExceptionInstance_Check(value)) {
7147 PyErr_Format(PyExc_TypeError,
7148 "calling %R should have returned an instance of "
7149 "BaseException, not %R",
7150 type, Py_TYPE(value));
7155 PyErr_SetString(PyExc_TypeError,
7156 "raise: exception class must be a subclass of BaseException");
7160 PyObject *fixed_cause;
7161 if (cause == Py_None) {
7163 }
else if (PyExceptionClass_Check(cause)) {
7164 fixed_cause = PyObject_CallObject(cause, NULL);
7165 if (fixed_cause == NULL)
7167 }
else if (PyExceptionInstance_Check(cause)) {
7168 fixed_cause = cause;
7169 Py_INCREF(fixed_cause);
7171 PyErr_SetString(PyExc_TypeError,
7172 "exception causes must derive from "
7176 PyException_SetCause(value, fixed_cause);
7178 PyErr_SetObject(type, value);
7180 #if CYTHON_COMPILING_IN_PYPY
7181 PyObject *tmp_type, *tmp_value, *tmp_tb;
7182 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
7184 PyErr_Restore(tmp_type, tmp_value, tb);
7187 PyThreadState *tstate = __Pyx_PyThreadState_Current;
7188 PyObject* tmp_tb = tstate->curexc_traceback;
7191 tstate->curexc_traceback = tb;
7197 Py_XDECREF(owned_instance);
7203 #ifndef __PYX_HAVE_RT_ImportType
7204 #define __PYX_HAVE_RT_ImportType
7205 static PyTypeObject *__Pyx_ImportType(PyObject *module,
const char *module_name,
const char *class_name,
7206 size_t size,
enum __Pyx_ImportType_CheckSize check_size)
7208 PyObject *result = 0;
7210 Py_ssize_t basicsize;
7211 #ifdef Py_LIMITED_API
7212 PyObject *py_basicsize;
7214 result = PyObject_GetAttrString(module, class_name);
7217 if (!PyType_Check(result)) {
7218 PyErr_Format(PyExc_TypeError,
7219 "%.200s.%.200s is not a type object",
7220 module_name, class_name);
7223 #ifndef Py_LIMITED_API
7224 basicsize = ((PyTypeObject *)result)->tp_basicsize;
7226 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
7229 basicsize = PyLong_AsSsize_t(py_basicsize);
7230 Py_DECREF(py_basicsize);
7232 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
7235 if ((
size_t)basicsize < size) {
7236 PyErr_Format(PyExc_ValueError,
7237 "%.200s.%.200s size changed, may indicate binary incompatibility. "
7238 "Expected %zd from C header, got %zd from PyObject",
7239 module_name, class_name, size, basicsize);
7242 if (check_size == __Pyx_ImportType_CheckSize_Error && (
size_t)basicsize != size) {
7243 PyErr_Format(PyExc_ValueError,
7244 "%.200s.%.200s size changed, may indicate binary incompatibility. "
7245 "Expected %zd from C header, got %zd from PyObject",
7246 module_name, class_name, size, basicsize);
7249 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (
size_t)basicsize > size) {
7250 PyOS_snprintf(warning,
sizeof(warning),
7251 "%s.%s size changed, may indicate binary incompatibility. "
7252 "Expected %zd from C header, got %zd from PyObject",
7253 module_name, class_name, size, basicsize);
7254 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
7256 return (PyTypeObject *)result;
7264 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
7265 PyObject *empty_list = 0;
7266 PyObject *module = 0;
7267 PyObject *global_dict = 0;
7268 PyObject *empty_dict = 0;
7270 #if PY_MAJOR_VERSION < 3
7271 PyObject *py_import;
7272 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
7279 empty_list = PyList_New(0);
7284 global_dict = PyModule_GetDict(__pyx_m);
7287 empty_dict = PyDict_New();
7291 #if PY_MAJOR_VERSION >= 3
7293 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
7294 module = PyImport_ImportModuleLevelObject(
7295 name, global_dict, empty_dict, list, 1);
7297 if (!PyErr_ExceptionMatches(PyExc_ImportError))
7306 #if PY_MAJOR_VERSION < 3
7307 PyObject *py_level = PyInt_FromLong(level);
7310 module = PyObject_CallFunctionObjArgs(py_import,
7311 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
7312 Py_DECREF(py_level);
7314 module = PyImport_ImportModuleLevelObject(
7315 name, global_dict, empty_dict, list, level);
7320 #if PY_MAJOR_VERSION < 3
7321 Py_XDECREF(py_import);
7323 Py_XDECREF(empty_list);
7324 Py_XDECREF(empty_dict);
7329 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
7330 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
7331 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
7332 PyErr_Format(PyExc_ImportError,
7333 #
if PY_MAJOR_VERSION < 3
7334 "cannot import name %.230s", PyString_AS_STRING(name));
7336 "cannot import name %S", name);
7343 #ifndef CYTHON_CLINE_IN_TRACEBACK
7344 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate,
int c_line) {
7345 PyObject *use_cline;
7346 PyObject *ptype, *pvalue, *ptraceback;
7347 #if CYTHON_COMPILING_IN_CPYTHON
7348 PyObject **cython_runtime_dict;
7350 if (unlikely(!__pyx_cython_runtime)) {
7353 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
7354 #if CYTHON_COMPILING_IN_CPYTHON
7355 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
7356 if (likely(cython_runtime_dict)) {
7357 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
7358 use_cline, *cython_runtime_dict,
7359 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
7363 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
7364 if (use_cline_obj) {
7365 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
7366 Py_DECREF(use_cline_obj);
7374 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
7376 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
7379 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
7385 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
7386 int start = 0, mid = 0, end = count - 1;
7387 if (end >= 0 && code_line > entries[end].code_line) {
7390 while (start < end) {
7391 mid = start + (end - start) / 2;
7392 if (code_line < entries[mid].code_line) {
7394 }
else if (code_line > entries[mid].code_line) {
7400 if (code_line <= entries[mid].code_line) {
7406 static PyCodeObject *__pyx_find_code_object(
int code_line) {
7407 PyCodeObject* code_object;
7409 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
7412 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
7413 if (unlikely(
pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[
pos].code_line != code_line)) {
7416 code_object = __pyx_code_cache.entries[
pos].code_object;
7417 Py_INCREF(code_object);
7420 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
7422 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
7423 if (unlikely(!code_line)) {
7426 if (unlikely(!entries)) {
7427 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
7428 if (likely(entries)) {
7429 __pyx_code_cache.entries = entries;
7430 __pyx_code_cache.max_count = 64;
7431 __pyx_code_cache.count = 1;
7432 entries[0].code_line = code_line;
7433 entries[0].code_object = code_object;
7434 Py_INCREF(code_object);
7438 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
7439 if ((
pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[
pos].code_line == code_line)) {
7440 PyCodeObject* tmp = entries[
pos].code_object;
7441 entries[
pos].code_object = code_object;
7445 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
7446 int new_max = __pyx_code_cache.max_count + 64;
7447 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
7448 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
7449 if (unlikely(!entries)) {
7452 __pyx_code_cache.entries = entries;
7453 __pyx_code_cache.max_count = new_max;
7455 for (i=__pyx_code_cache.count; i>
pos; i--) {
7456 entries[i] = entries[i-1];
7458 entries[
pos].code_line = code_line;
7459 entries[
pos].code_object = code_object;
7460 __pyx_code_cache.count++;
7461 Py_INCREF(code_object);
7465 #include "compile.h"
7466 #include "frameobject.h"
7467 #include "traceback.h"
7468 #if PY_VERSION_HEX >= 0x030b00a6
7469 #ifndef Py_BUILD_CORE
7470 #define Py_BUILD_CORE 1
7472 #include "internal/pycore_frame.h"
7474 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
7475 const char *funcname,
int c_line,
7476 int py_line,
const char *filename) {
7477 PyCodeObject *py_code = NULL;
7478 PyObject *py_funcname = NULL;
7479 #if PY_MAJOR_VERSION < 3
7480 PyObject *py_srcfile = NULL;
7481 py_srcfile = PyString_FromString(filename);
7482 if (!py_srcfile)
goto bad;
7485 #if PY_MAJOR_VERSION < 3
7486 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
7487 if (!py_funcname)
goto bad;
7489 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
7490 if (!py_funcname)
goto bad;
7491 funcname = PyUnicode_AsUTF8(py_funcname);
7492 if (!funcname)
goto bad;
7496 #if PY_MAJOR_VERSION < 3
7497 py_funcname = PyString_FromString(funcname);
7498 if (!py_funcname)
goto bad;
7501 #if PY_MAJOR_VERSION < 3
7502 py_code = __Pyx_PyCode_New(
7519 Py_DECREF(py_srcfile);
7521 py_code = PyCode_NewEmpty(filename, funcname, py_line);
7523 Py_XDECREF(py_funcname);
7526 Py_XDECREF(py_funcname);
7527 #if PY_MAJOR_VERSION < 3
7528 Py_XDECREF(py_srcfile);
7532 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
7533 int py_line,
const char *filename) {
7534 PyCodeObject *py_code = 0;
7535 PyFrameObject *py_frame = 0;
7536 PyThreadState *tstate = __Pyx_PyThreadState_Current;
7537 PyObject *ptype, *pvalue, *ptraceback;
7539 c_line = __Pyx_CLineForTraceback(tstate, c_line);
7541 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
7543 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
7544 py_code = __Pyx_CreateCodeObjectForTraceback(
7545 funcname, c_line, py_line, filename);
7551 Py_XDECREF(ptraceback);
7554 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
7555 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
7557 py_frame = PyFrame_New(
7563 if (!py_frame)
goto bad;
7564 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
7565 PyTraceBack_Here(py_frame);
7567 Py_XDECREF(py_code);
7568 Py_XDECREF(py_frame);
7574 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
7575 return ::std::complex< float >(x, y);
7578 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
7579 return x + y*(__pyx_t_float_complex)_Complex_I;
7583 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
7584 __pyx_t_float_complex
z;
7594 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7595 return (a.real == b.real) && (a.imag == b.imag);
7597 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7598 __pyx_t_float_complex
z;
7599 z.real = a.real + b.real;
7600 z.imag = a.imag + b.imag;
7603 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7604 __pyx_t_float_complex
z;
7605 z.real = a.real - b.real;
7606 z.imag = a.imag - b.imag;
7609 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7610 __pyx_t_float_complex
z;
7611 z.real = a.real * b.real - a.imag * b.imag;
7612 z.imag = a.real * b.imag + a.imag * b.real;
7616 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7618 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
7619 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
7620 if (b.real == 0 && b.imag == 0) {
7621 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
7623 float r = b.imag / b.real;
7624 float s = (float)(1.0) / (b.real + b.imag *
r);
7625 return __pyx_t_float_complex_from_parts(
7626 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
7629 float r = b.real / b.imag;
7630 float s = (float)(1.0) / (b.imag + b.real *
r);
7631 return __pyx_t_float_complex_from_parts(
7632 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
7636 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7638 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
7640 float denom = b.real * b.real + b.imag * b.imag;
7641 return __pyx_t_float_complex_from_parts(
7642 (a.real * b.real + a.imag * b.imag) / denom,
7643 (a.imag * b.real - a.real * b.imag) / denom);
7647 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
7648 __pyx_t_float_complex
z;
7653 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
7654 return (a.real == 0) && (a.imag == 0);
7656 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
7657 __pyx_t_float_complex
z;
7663 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
7664 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
7665 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
7667 return hypotf(
z.real,
z.imag);
7670 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
7671 __pyx_t_float_complex
z;
7672 float r, lnr, theta, z_r, z_theta;
7673 if (b.imag == 0 && b.real == (
int)b.real) {
7675 float denom = a.real * a.real + a.imag * a.imag;
7676 a.real = a.real / denom;
7677 a.imag = -a.imag / denom;
7680 switch ((
int)b.real) {
7688 return __Pyx_c_prod_float(a, a);
7690 z = __Pyx_c_prod_float(a, a);
7691 return __Pyx_c_prod_float(
z, a);
7693 z = __Pyx_c_prod_float(a, a);
7694 return __Pyx_c_prod_float(
z,
z);
7700 }
else if (b.imag == 0) {
7701 z.real = powf(a.real, b.real);
7704 }
else if (a.real > 0) {
7709 theta = atan2f(0.0, -1.0);
7712 r = __Pyx_c_abs_float(a);
7713 theta = atan2f(a.imag, a.real);
7716 z_r = expf(lnr * b.real - theta * b.imag);
7717 z_theta = theta * b.real + lnr * b.imag;
7718 z.real = z_r * cosf(z_theta);
7719 z.imag = z_r * sinf(z_theta);
7728 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
7729 return ::std::complex< double >(x, y);
7732 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
7733 return x + y*(__pyx_t_double_complex)_Complex_I;
7737 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
7738 __pyx_t_double_complex
z;
7748 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7749 return (a.real == b.real) && (a.imag == b.imag);
7751 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7752 __pyx_t_double_complex
z;
7753 z.real = a.real + b.real;
7754 z.imag = a.imag + b.imag;
7757 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7758 __pyx_t_double_complex
z;
7759 z.real = a.real - b.real;
7760 z.imag = a.imag - b.imag;
7763 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7764 __pyx_t_double_complex
z;
7765 z.real = a.real * b.real - a.imag * b.imag;
7766 z.imag = a.real * b.imag + a.imag * b.real;
7770 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7772 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
7773 }
else if (fabs(b.real) >= fabs(b.imag)) {
7774 if (b.real == 0 && b.imag == 0) {
7775 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
7777 double r = b.imag / b.real;
7778 double s = (double)(1.0) / (b.real + b.imag *
r);
7779 return __pyx_t_double_complex_from_parts(
7780 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
7783 double r = b.real / b.imag;
7784 double s = (double)(1.0) / (b.imag + b.real *
r);
7785 return __pyx_t_double_complex_from_parts(
7786 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
7790 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7792 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
7794 double denom = b.real * b.real + b.imag * b.imag;
7795 return __pyx_t_double_complex_from_parts(
7796 (a.real * b.real + a.imag * b.imag) / denom,
7797 (a.imag * b.real - a.real * b.imag) / denom);
7801 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
7802 __pyx_t_double_complex
z;
7807 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
7808 return (a.real == 0) && (a.imag == 0);
7810 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
7811 __pyx_t_double_complex
z;
7817 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
7818 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
7819 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
7821 return hypot(
z.real,
z.imag);
7824 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
7825 __pyx_t_double_complex
z;
7826 double r, lnr, theta, z_r, z_theta;
7827 if (b.imag == 0 && b.real == (
int)b.real) {
7829 double denom = a.real * a.real + a.imag * a.imag;
7830 a.real = a.real / denom;
7831 a.imag = -a.imag / denom;
7834 switch ((
int)b.real) {
7842 return __Pyx_c_prod_double(a, a);
7844 z = __Pyx_c_prod_double(a, a);
7845 return __Pyx_c_prod_double(
z, a);
7847 z = __Pyx_c_prod_double(a, a);
7848 return __Pyx_c_prod_double(
z,
z);
7854 }
else if (b.imag == 0) {
7855 z.real = pow(a.real, b.real);
7858 }
else if (a.real > 0) {
7863 theta = atan2(0.0, -1.0);
7866 r = __Pyx_c_abs_double(a);
7867 theta = atan2(a.imag, a.real);
7870 z_r = exp(lnr * b.real - theta * b.imag);
7871 z_theta = theta * b.real + lnr * b.imag;
7872 z.real = z_r * cos(z_theta);
7873 z.imag = z_r * sin(z_theta);
7880 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
7881 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
7882 #pragma GCC diagnostic push
7883 #pragma GCC diagnostic ignored "-Wconversion"
7885 const long neg_one = (long) -1, const_zero = (
long) 0;
7886 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
7887 #pragma GCC diagnostic pop
7889 const int is_unsigned = neg_one > const_zero;
7891 if (
sizeof(
long) <
sizeof(long)) {
7892 return PyInt_FromLong((
long) value);
7893 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
7894 return PyLong_FromUnsignedLong((
unsigned long) value);
7895 #ifdef HAVE_LONG_LONG
7896 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
7897 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
7901 if (
sizeof(
long) <=
sizeof(
long)) {
7902 return PyInt_FromLong((
long) value);
7903 #ifdef HAVE_LONG_LONG
7904 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
7905 return PyLong_FromLongLong((PY_LONG_LONG) value);
7910 int one = 1;
int little = (int)*(
unsigned char *)&one;
7911 unsigned char *bytes = (
unsigned char *)&value;
7912 return _PyLong_FromByteArray(bytes,
sizeof(
long),
7913 little, !is_unsigned);
7918 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
7919 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
7920 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
7921 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
7922 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
7924 func_type value = func_value;\
7925 if (sizeof(target_type) < sizeof(func_type)) {\
7926 if (unlikely(value != (func_type) (target_type) value)) {\
7927 func_type zero = 0;\
7928 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
7929 return (target_type) -1;\
7930 if (is_unsigned && unlikely(value < zero))\
7931 goto raise_neg_overflow;\
7933 goto raise_overflow;\
7936 return (target_type) value;\
7940 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
7941 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
7942 #pragma GCC diagnostic push
7943 #pragma GCC diagnostic ignored "-Wconversion"
7945 const long neg_one = (long) -1, const_zero = (
long) 0;
7946 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
7947 #pragma GCC diagnostic pop
7949 const int is_unsigned = neg_one > const_zero;
7950 #if PY_MAJOR_VERSION < 3
7951 if (likely(PyInt_Check(x))) {
7952 if (
sizeof(
long) <
sizeof(long)) {
7953 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
7955 long val = PyInt_AS_LONG(x);
7956 if (is_unsigned && unlikely(val < 0)) {
7957 goto raise_neg_overflow;
7963 if (likely(PyLong_Check(x))) {
7965 #if CYTHON_USE_PYLONG_INTERNALS
7966 const digit* digits = ((PyLongObject*)x)->ob_digit;
7967 switch (Py_SIZE(x)) {
7968 case 0:
return (
long) 0;
7969 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
7971 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
7972 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
7973 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
7974 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
7975 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
7980 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
7981 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
7982 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
7983 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
7984 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
7989 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
7990 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
7991 __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])))
7992 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
7993 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
7999 #if CYTHON_COMPILING_IN_CPYTHON
8000 if (unlikely(Py_SIZE(x) < 0)) {
8001 goto raise_neg_overflow;
8005 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
8006 if (unlikely(result < 0))
8008 if (unlikely(result == 1))
8009 goto raise_neg_overflow;
8012 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
8013 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
8014 #ifdef HAVE_LONG_LONG
8015 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
8016 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
8020 #if CYTHON_USE_PYLONG_INTERNALS
8021 const digit* digits = ((PyLongObject*)x)->ob_digit;
8022 switch (Py_SIZE(x)) {
8023 case 0:
return (
long) 0;
8024 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
8025 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
8027 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
8028 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
8029 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
8030 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
8031 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
8036 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
8037 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
8038 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
8039 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
8040 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
8045 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
8046 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
8047 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
8048 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
8049 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
8054 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
8055 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
8056 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
8057 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
8058 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
8063 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
8064 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
8065 __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])))
8066 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
8067 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
8072 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
8073 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
8074 __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])))
8075 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
8076 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
8082 if (
sizeof(
long) <=
sizeof(long)) {
8083 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
8084 #ifdef HAVE_LONG_LONG
8085 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
8086 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
8091 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
8092 PyErr_SetString(PyExc_RuntimeError,
8093 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
8096 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
8097 #if PY_MAJOR_VERSION < 3
8098 if (likely(
v) && !PyLong_Check(
v)) {
8100 v = PyNumber_Long(tmp);
8105 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
8106 unsigned char *bytes = (
unsigned char *)&val;
8107 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
8109 is_little, !is_unsigned);
8119 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
8120 if (!tmp)
return (
long) -1;
8121 val = __Pyx_PyInt_As_long(tmp);
8126 PyErr_SetString(PyExc_OverflowError,
8127 "value too large to convert to long");
8130 PyErr_SetString(PyExc_OverflowError,
8131 "can't convert negative value to long");
8136 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
8137 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
8138 #pragma GCC diagnostic push
8139 #pragma GCC diagnostic ignored "-Wconversion"
8141 const int neg_one = (int) -1, const_zero = (
int) 0;
8142 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
8143 #pragma GCC diagnostic pop
8145 const int is_unsigned = neg_one > const_zero;
8146 #if PY_MAJOR_VERSION < 3
8147 if (likely(PyInt_Check(x))) {
8148 if (
sizeof(
int) <
sizeof(long)) {
8149 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
8151 long val = PyInt_AS_LONG(x);
8152 if (is_unsigned && unlikely(val < 0)) {
8153 goto raise_neg_overflow;
8159 if (likely(PyLong_Check(x))) {
8161 #if CYTHON_USE_PYLONG_INTERNALS
8162 const digit* digits = ((PyLongObject*)x)->ob_digit;
8163 switch (Py_SIZE(x)) {
8164 case 0:
return (
int) 0;
8165 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
8167 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
8168 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
8169 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
8170 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
8171 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
8176 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
8177 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
8178 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
8179 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
8180 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
8185 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
8186 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
8187 __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])))
8188 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
8189 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
8195 #if CYTHON_COMPILING_IN_CPYTHON
8196 if (unlikely(Py_SIZE(x) < 0)) {
8197 goto raise_neg_overflow;
8201 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
8202 if (unlikely(result < 0))
8204 if (unlikely(result == 1))
8205 goto raise_neg_overflow;
8208 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
8209 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
8210 #ifdef HAVE_LONG_LONG
8211 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
8212 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
8216 #if CYTHON_USE_PYLONG_INTERNALS
8217 const digit* digits = ((PyLongObject*)x)->ob_digit;
8218 switch (Py_SIZE(x)) {
8219 case 0:
return (
int) 0;
8220 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
8221 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
8223 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
8224 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
8225 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
8226 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
8227 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
8232 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
8233 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
8234 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
8235 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
8236 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
8241 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
8242 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
8243 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
8244 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
8245 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
8250 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
8251 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
8252 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
8253 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
8254 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
8259 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
8260 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
8261 __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])))
8262 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
8263 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
8268 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
8269 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
8270 __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])))
8271 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
8272 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
8278 if (
sizeof(
int) <=
sizeof(long)) {
8279 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
8280 #ifdef HAVE_LONG_LONG
8281 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
8282 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
8287 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
8288 PyErr_SetString(PyExc_RuntimeError,
8289 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
8292 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
8293 #if PY_MAJOR_VERSION < 3
8294 if (likely(
v) && !PyLong_Check(
v)) {
8296 v = PyNumber_Long(tmp);
8301 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
8302 unsigned char *bytes = (
unsigned char *)&val;
8303 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
8305 is_little, !is_unsigned);
8315 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
8316 if (!tmp)
return (
int) -1;
8317 val = __Pyx_PyInt_As_int(tmp);
8322 PyErr_SetString(PyExc_OverflowError,
8323 "value too large to convert to int");
8326 PyErr_SetString(PyExc_OverflowError,
8327 "can't convert negative value to int");
8332 #if CYTHON_COMPILING_IN_CPYTHON
8333 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
8339 return b == &PyBaseObject_Type;
8341 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
8343 if (a == b)
return 1;
8347 n = PyTuple_GET_SIZE(mro);
8348 for (i = 0; i <
n; i++) {
8349 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
8354 return __Pyx_InBases(a, b);
8356 #if PY_MAJOR_VERSION == 2
8357 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
8358 PyObject *exception, *value, *tb;
8360 __Pyx_PyThreadState_declare
8361 __Pyx_PyThreadState_assign
8362 __Pyx_ErrFetch(&exception, &value, &tb);
8363 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
8364 if (unlikely(res == -1)) {
8365 PyErr_WriteUnraisable(err);
8369 res = PyObject_IsSubclass(err, exc_type2);
8370 if (unlikely(res == -1)) {
8371 PyErr_WriteUnraisable(err);
8375 __Pyx_ErrRestore(exception, value, tb);
8379 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
8380 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
8382 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
8387 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
8389 assert(PyExceptionClass_Check(exc_type));
8390 n = PyTuple_GET_SIZE(tuple);
8391 #if PY_MAJOR_VERSION >= 3
8392 for (i=0; i<
n; i++) {
8393 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
8396 for (i=0; i<
n; i++) {
8397 PyObject *t = PyTuple_GET_ITEM(tuple, i);
8398 #if PY_MAJOR_VERSION < 3
8399 if (likely(exc_type == t))
return 1;
8401 if (likely(PyExceptionClass_Check(t))) {
8402 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
8408 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
8409 if (likely(err == exc_type))
return 1;
8410 if (likely(PyExceptionClass_Check(err))) {
8411 if (likely(PyExceptionClass_Check(exc_type))) {
8412 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
8413 }
else if (likely(PyTuple_Check(exc_type))) {
8414 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
8418 return PyErr_GivenExceptionMatches(err, exc_type);
8420 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
8421 assert(PyExceptionClass_Check(exc_type1));
8422 assert(PyExceptionClass_Check(exc_type2));
8423 if (likely(err == exc_type1 || err == exc_type2))
return 1;
8424 if (likely(PyExceptionClass_Check(err))) {
8425 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
8427 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
8432 static int __Pyx_check_binary_version(
void) {
8434 int same=1, i, found_dot;
8435 const char* rt_from_call = Py_GetVersion();
8436 PyOS_snprintf(ctversion, 5,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
8438 for (i = 0; i < 4; i++) {
8439 if (!ctversion[i]) {
8440 same = (rt_from_call[i] <
'0' || rt_from_call[i] >
'9');
8443 if (rt_from_call[i] != ctversion[i]) {
8449 char rtversion[5] = {
'\0'};
8451 for (i=0; i<4; ++i) {
8452 if (rt_from_call[i] ==
'.') {
8453 if (found_dot)
break;
8455 }
else if (rt_from_call[i] <
'0' || rt_from_call[i] >
'9') {
8458 rtversion[i] = rt_from_call[i];
8460 PyOS_snprintf(message,
sizeof(message),
8461 "compiletime version %s of module '%.100s' "
8462 "does not match runtime version %s",
8463 ctversion, __Pyx_MODULE_NAME, rtversion);
8464 return PyErr_WarnEx(NULL, message, 1);
8470 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
8472 #if PY_MAJOR_VERSION < 3
8473 if (t->is_unicode) {
8474 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
8475 }
else if (t->intern) {
8476 *t->p = PyString_InternFromString(t->s);
8478 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
8481 if (t->is_unicode | t->is_str) {
8483 *t->p = PyUnicode_InternFromString(t->s);
8484 }
else if (t->encoding) {
8485 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
8487 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
8490 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
8495 if (PyObject_Hash(*t->p) == -1)
8502 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
8503 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
8505 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
8507 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
8509 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
8510 #if !CYTHON_PEP393_ENABLED
8511 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
8513 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
8514 if (!defenc)
return NULL;
8515 defenc_c = PyBytes_AS_STRING(defenc);
8516 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
8518 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
8520 for (
c = defenc_c;
c < end;
c++) {
8521 if ((
unsigned char) (*
c) >= 128) {
8522 PyUnicode_AsASCIIString(o);
8528 *length = PyBytes_GET_SIZE(defenc);
8532 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
8533 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
8534 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
8535 if (likely(PyUnicode_IS_ASCII(o))) {
8536 *length = PyUnicode_GET_LENGTH(o);
8537 return PyUnicode_AsUTF8(o);
8539 PyUnicode_AsASCIIString(o);
8543 return PyUnicode_AsUTF8AndSize(o, length);
8548 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
8549 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
8551 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
8552 __Pyx_sys_getdefaultencoding_not_ascii &&
8554 PyUnicode_Check(o)) {
8555 return __Pyx_PyUnicode_AsStringAndSize(o, length);
8558 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
8559 if (PyByteArray_Check(o)) {
8560 *length = PyByteArray_GET_SIZE(o);
8561 return PyByteArray_AS_STRING(o);
8566 int r = PyBytes_AsStringAndSize(o, &result, length);
8567 if (unlikely(
r < 0)) {
8574 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
8575 int is_true = x == Py_True;
8576 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
8577 else return PyObject_IsTrue(x);
8579 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
8581 if (unlikely(!x))
return -1;
8582 retval = __Pyx_PyObject_IsTrue(x);
8586 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
8587 #if PY_MAJOR_VERSION >= 3
8588 if (PyLong_Check(result)) {
8589 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
8590 "__int__ returned non-int (type %.200s). "
8591 "The ability to return an instance of a strict subclass of int "
8592 "is deprecated, and may be removed in a future version of Python.",
8593 Py_TYPE(result)->tp_name)) {
8600 PyErr_Format(PyExc_TypeError,
8601 "__%.4s__ returned non-%.4s (type %.200s)",
8602 type_name, type_name, Py_TYPE(result)->tp_name);
8606 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
8607 #if CYTHON_USE_TYPE_SLOTS
8610 const char *name = NULL;
8611 PyObject *res = NULL;
8612 #if PY_MAJOR_VERSION < 3
8613 if (likely(PyInt_Check(x) || PyLong_Check(x)))
8615 if (likely(PyLong_Check(x)))
8617 return __Pyx_NewRef(x);
8618 #if CYTHON_USE_TYPE_SLOTS
8619 m = Py_TYPE(x)->tp_as_number;
8620 #if PY_MAJOR_VERSION < 3
8621 if (m && m->nb_int) {
8625 else if (m && m->nb_long) {
8627 res = m->nb_long(x);
8630 if (likely(m && m->nb_int)) {
8636 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
8637 res = PyNumber_Int(x);
8641 #if PY_MAJOR_VERSION < 3
8642 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
8644 if (unlikely(!PyLong_CheckExact(res))) {
8646 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
8649 else if (!PyErr_Occurred()) {
8650 PyErr_SetString(PyExc_TypeError,
8651 "an integer is required");
8655 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
8658 #if PY_MAJOR_VERSION < 3
8659 if (likely(PyInt_CheckExact(b))) {
8660 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
8661 return PyInt_AS_LONG(b);
8663 return PyInt_AsSsize_t(b);
8666 if (likely(PyLong_CheckExact(b))) {
8667 #if CYTHON_USE_PYLONG_INTERNALS
8668 const digit* digits = ((PyLongObject*)b)->ob_digit;
8669 const Py_ssize_t size = Py_SIZE(b);
8670 if (likely(__Pyx_sst_abs(size) <= 1)) {
8671 ival = likely(size) ? digits[0] : 0;
8672 if (size == -1) ival = -ival;
8677 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
8678 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
8682 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
8683 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
8687 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
8688 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
8692 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
8693 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
8697 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
8698 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]));
8702 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
8703 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]));
8709 return PyLong_AsSsize_t(b);
8711 x = PyNumber_Index(b);
8713 ival = PyInt_AsSsize_t(x);
8717 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
8718 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
8719 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
8720 #if PY_MAJOR_VERSION < 3
8721 }
else if (likely(PyInt_CheckExact(o))) {
8722 return PyInt_AS_LONG(o);
8727 x = PyNumber_Index(o);
8729 ival = PyInt_AsLong(x);
8734 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
8735 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
8737 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
8738 return PyInt_FromSize_t(ival);