3 #ifndef PY_SSIZE_T_CLEAN
4 #define PY_SSIZE_T_CLEAN
8 #error Python headers needed to compile C extensions, please install development version of Python.
9 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
10 #error Cython requires Python 2.6+ or Python 3.3+.
12 #define CYTHON_ABI "0_29_30"
13 #define CYTHON_HEX_VERSION 0x001D1EF0
14 #define CYTHON_FUTURE_DIVISION 0
17 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
19 #if !defined(WIN32) && !defined(MS_WINDOWS)
31 #define DL_IMPORT(t) t
34 #define DL_EXPORT(t) t
37 #ifndef HAVE_LONG_LONG
38 #if PY_VERSION_HEX >= 0x02070000
39 #define HAVE_LONG_LONG
43 #define PY_LONG_LONG LONG_LONG
46 #define Py_HUGE_VAL HUGE_VAL
49 #define CYTHON_COMPILING_IN_PYPY 1
50 #define CYTHON_COMPILING_IN_PYSTON 0
51 #define CYTHON_COMPILING_IN_CPYTHON 0
52 #undef CYTHON_USE_TYPE_SLOTS
53 #define CYTHON_USE_TYPE_SLOTS 0
54 #undef CYTHON_USE_PYTYPE_LOOKUP
55 #define CYTHON_USE_PYTYPE_LOOKUP 0
56 #if PY_VERSION_HEX < 0x03050000
57 #undef CYTHON_USE_ASYNC_SLOTS
58 #define CYTHON_USE_ASYNC_SLOTS 0
59 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
60 #define CYTHON_USE_ASYNC_SLOTS 1
62 #undef CYTHON_USE_PYLIST_INTERNALS
63 #define CYTHON_USE_PYLIST_INTERNALS 0
64 #undef CYTHON_USE_UNICODE_INTERNALS
65 #define CYTHON_USE_UNICODE_INTERNALS 0
66 #undef CYTHON_USE_UNICODE_WRITER
67 #define CYTHON_USE_UNICODE_WRITER 0
68 #undef CYTHON_USE_PYLONG_INTERNALS
69 #define CYTHON_USE_PYLONG_INTERNALS 0
70 #undef CYTHON_AVOID_BORROWED_REFS
71 #define CYTHON_AVOID_BORROWED_REFS 1
72 #undef CYTHON_ASSUME_SAFE_MACROS
73 #define CYTHON_ASSUME_SAFE_MACROS 0
74 #undef CYTHON_UNPACK_METHODS
75 #define CYTHON_UNPACK_METHODS 0
76 #undef CYTHON_FAST_THREAD_STATE
77 #define CYTHON_FAST_THREAD_STATE 0
78 #undef CYTHON_FAST_PYCALL
79 #define CYTHON_FAST_PYCALL 0
80 #undef CYTHON_PEP489_MULTI_PHASE_INIT
81 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
82 #undef CYTHON_USE_TP_FINALIZE
83 #define CYTHON_USE_TP_FINALIZE 0
84 #undef CYTHON_USE_DICT_VERSIONS
85 #define CYTHON_USE_DICT_VERSIONS 0
86 #undef CYTHON_USE_EXC_INFO_STACK
87 #define CYTHON_USE_EXC_INFO_STACK 0
88 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
89 #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)
91 #elif defined(PYSTON_VERSION)
92 #define CYTHON_COMPILING_IN_PYPY 0
93 #define CYTHON_COMPILING_IN_PYSTON 1
94 #define CYTHON_COMPILING_IN_CPYTHON 0
95 #ifndef CYTHON_USE_TYPE_SLOTS
96 #define CYTHON_USE_TYPE_SLOTS 1
98 #undef CYTHON_USE_PYTYPE_LOOKUP
99 #define CYTHON_USE_PYTYPE_LOOKUP 0
100 #undef CYTHON_USE_ASYNC_SLOTS
101 #define CYTHON_USE_ASYNC_SLOTS 0
102 #undef CYTHON_USE_PYLIST_INTERNALS
103 #define CYTHON_USE_PYLIST_INTERNALS 0
104 #ifndef CYTHON_USE_UNICODE_INTERNALS
105 #define CYTHON_USE_UNICODE_INTERNALS 1
107 #undef CYTHON_USE_UNICODE_WRITER
108 #define CYTHON_USE_UNICODE_WRITER 0
109 #undef CYTHON_USE_PYLONG_INTERNALS
110 #define CYTHON_USE_PYLONG_INTERNALS 0
111 #ifndef CYTHON_AVOID_BORROWED_REFS
112 #define CYTHON_AVOID_BORROWED_REFS 0
114 #ifndef CYTHON_ASSUME_SAFE_MACROS
115 #define CYTHON_ASSUME_SAFE_MACROS 1
117 #ifndef CYTHON_UNPACK_METHODS
118 #define CYTHON_UNPACK_METHODS 1
120 #undef CYTHON_FAST_THREAD_STATE
121 #define CYTHON_FAST_THREAD_STATE 0
122 #undef CYTHON_FAST_PYCALL
123 #define CYTHON_FAST_PYCALL 0
124 #undef CYTHON_PEP489_MULTI_PHASE_INIT
125 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
126 #undef CYTHON_USE_TP_FINALIZE
127 #define CYTHON_USE_TP_FINALIZE 0
128 #undef CYTHON_USE_DICT_VERSIONS
129 #define CYTHON_USE_DICT_VERSIONS 0
130 #undef CYTHON_USE_EXC_INFO_STACK
131 #define CYTHON_USE_EXC_INFO_STACK 0
132 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
133 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
136 #define CYTHON_COMPILING_IN_PYPY 0
137 #define CYTHON_COMPILING_IN_PYSTON 0
138 #define CYTHON_COMPILING_IN_CPYTHON 1
139 #ifndef CYTHON_USE_TYPE_SLOTS
140 #define CYTHON_USE_TYPE_SLOTS 1
142 #if PY_VERSION_HEX < 0x02070000
143 #undef CYTHON_USE_PYTYPE_LOOKUP
144 #define CYTHON_USE_PYTYPE_LOOKUP 0
145 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
146 #define CYTHON_USE_PYTYPE_LOOKUP 1
148 #if PY_MAJOR_VERSION < 3
149 #undef CYTHON_USE_ASYNC_SLOTS
150 #define CYTHON_USE_ASYNC_SLOTS 0
151 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
152 #define CYTHON_USE_ASYNC_SLOTS 1
154 #if PY_VERSION_HEX < 0x02070000
155 #undef CYTHON_USE_PYLONG_INTERNALS
156 #define CYTHON_USE_PYLONG_INTERNALS 0
157 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
158 #define CYTHON_USE_PYLONG_INTERNALS 1
160 #ifndef CYTHON_USE_PYLIST_INTERNALS
161 #define CYTHON_USE_PYLIST_INTERNALS 1
163 #ifndef CYTHON_USE_UNICODE_INTERNALS
164 #define CYTHON_USE_UNICODE_INTERNALS 1
166 #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
167 #undef CYTHON_USE_UNICODE_WRITER
168 #define CYTHON_USE_UNICODE_WRITER 0
169 #elif !defined(CYTHON_USE_UNICODE_WRITER)
170 #define CYTHON_USE_UNICODE_WRITER 1
172 #ifndef CYTHON_AVOID_BORROWED_REFS
173 #define CYTHON_AVOID_BORROWED_REFS 0
175 #ifndef CYTHON_ASSUME_SAFE_MACROS
176 #define CYTHON_ASSUME_SAFE_MACROS 1
178 #ifndef CYTHON_UNPACK_METHODS
179 #define CYTHON_UNPACK_METHODS 1
181 #if PY_VERSION_HEX >= 0x030B00A4
182 #undef CYTHON_FAST_THREAD_STATE
183 #define CYTHON_FAST_THREAD_STATE 0
184 #elif !defined(CYTHON_FAST_THREAD_STATE)
185 #define CYTHON_FAST_THREAD_STATE 1
187 #ifndef CYTHON_FAST_PYCALL
188 #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
190 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
191 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
193 #ifndef CYTHON_USE_TP_FINALIZE
194 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
196 #ifndef CYTHON_USE_DICT_VERSIONS
197 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
199 #if PY_VERSION_HEX >= 0x030B00A4
200 #undef CYTHON_USE_EXC_INFO_STACK
201 #define CYTHON_USE_EXC_INFO_STACK 0
202 #elif !defined(CYTHON_USE_EXC_INFO_STACK)
203 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
205 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
206 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
209 #if !defined(CYTHON_FAST_PYCCALL)
210 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
212 #if CYTHON_USE_PYLONG_INTERNALS
213 #if PY_MAJOR_VERSION < 3
214 #include "longintrepr.h"
220 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
223 #ifndef __has_attribute
224 #define __has_attribute(x) 0
226 #ifndef __has_cpp_attribute
227 #define __has_cpp_attribute(x) 0
229 #ifndef CYTHON_RESTRICT
230 #if defined(__GNUC__)
231 #define CYTHON_RESTRICT __restrict__
232 #elif defined(_MSC_VER) && _MSC_VER >= 1400
233 #define CYTHON_RESTRICT __restrict
234 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
235 #define CYTHON_RESTRICT restrict
237 #define CYTHON_RESTRICT
240 #ifndef CYTHON_UNUSED
241 # if defined(__GNUC__)
242 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
243 # define CYTHON_UNUSED __attribute__ ((__unused__))
245 # define CYTHON_UNUSED
247 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
248 # define CYTHON_UNUSED __attribute__ ((__unused__))
250 # define CYTHON_UNUSED
253 #ifndef CYTHON_MAYBE_UNUSED_VAR
254 # if defined(__cplusplus)
255 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
257 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
260 #ifndef CYTHON_NCP_UNUSED
261 # if CYTHON_COMPILING_IN_CPYTHON
262 # define CYTHON_NCP_UNUSED
264 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
267 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
269 #ifndef _MSC_STDINT_H_
271 typedef unsigned char uint8_t;
272 typedef unsigned int uint32_t;
274 typedef unsigned __int8 uint8_t;
275 typedef unsigned __int32 uint32_t;
281 #ifndef CYTHON_FALLTHROUGH
282 #if defined(__cplusplus) && __cplusplus >= 201103L
283 #if __has_cpp_attribute(fallthrough)
284 #define CYTHON_FALLTHROUGH [[fallthrough]]
285 #elif __has_cpp_attribute(clang::fallthrough)
286 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
287 #elif __has_cpp_attribute(gnu::fallthrough)
288 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
291 #ifndef CYTHON_FALLTHROUGH
292 #if __has_attribute(fallthrough)
293 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
295 #define CYTHON_FALLTHROUGH
298 #if defined(__clang__ ) && defined(__apple_build_version__)
299 #if __apple_build_version__ < 7000000
300 #undef CYTHON_FALLTHROUGH
301 #define CYTHON_FALLTHROUGH
306 #ifndef CYTHON_INLINE
307 #if defined(__clang__)
308 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
309 #elif defined(__GNUC__)
310 #define CYTHON_INLINE __inline__
311 #elif defined(_MSC_VER)
312 #define CYTHON_INLINE __inline
313 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
314 #define CYTHON_INLINE inline
316 #define CYTHON_INLINE
320 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
321 #define Py_OptimizeFlag 0
323 #define __PYX_BUILD_PY_SSIZE_T "n"
324 #define CYTHON_FORMAT_SSIZE_T "z"
325 #if PY_MAJOR_VERSION < 3
326 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
327 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
328 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
329 #define __Pyx_DefaultClassType PyClass_Type
331 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
332 #define __Pyx_DefaultClassType PyType_Type
333 #if PY_VERSION_HEX >= 0x030B00A1
334 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(
int a,
int k,
int l,
int s,
int f,
335 PyObject *code, PyObject *
c, PyObject*
n, PyObject *
v,
336 PyObject *fv, PyObject *cell, PyObject* fn,
337 PyObject *name,
int fline, PyObject *lnos) {
338 PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
339 PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
340 const char *fn_cstr=NULL;
341 const char *name_cstr=NULL;
342 PyCodeObject* co=NULL;
343 PyObject *type, *value, *traceback;
344 PyErr_Fetch(&type, &value, &traceback);
345 if (!(kwds=PyDict_New()))
goto end;
346 if (!(argcount=PyLong_FromLong(a)))
goto end;
347 if (PyDict_SetItemString(kwds,
"co_argcount", argcount) != 0)
goto end;
348 if (!(posonlyargcount=PyLong_FromLong(0)))
goto end;
349 if (PyDict_SetItemString(kwds,
"co_posonlyargcount", posonlyargcount) != 0)
goto end;
350 if (!(kwonlyargcount=PyLong_FromLong(k)))
goto end;
351 if (PyDict_SetItemString(kwds,
"co_kwonlyargcount", kwonlyargcount) != 0)
goto end;
352 if (!(nlocals=PyLong_FromLong(l)))
goto end;
353 if (PyDict_SetItemString(kwds,
"co_nlocals", nlocals) != 0)
goto end;
354 if (!(stacksize=PyLong_FromLong(
s)))
goto end;
355 if (PyDict_SetItemString(kwds,
"co_stacksize", stacksize) != 0)
goto end;
356 if (!(flags=PyLong_FromLong(
f)))
goto end;
357 if (PyDict_SetItemString(kwds,
"co_flags", flags) != 0)
goto end;
358 if (PyDict_SetItemString(kwds,
"co_code", code) != 0)
goto end;
359 if (PyDict_SetItemString(kwds,
"co_consts",
c) != 0)
goto end;
360 if (PyDict_SetItemString(kwds,
"co_names",
n) != 0)
goto end;
361 if (PyDict_SetItemString(kwds,
"co_varnames",
v) != 0)
goto end;
362 if (PyDict_SetItemString(kwds,
"co_freevars", fv) != 0)
goto end;
363 if (PyDict_SetItemString(kwds,
"co_cellvars", cell) != 0)
goto end;
364 if (PyDict_SetItemString(kwds,
"co_linetable", lnos) != 0)
goto end;
365 if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL)))
goto end;
366 if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL)))
goto end;
367 if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline)))
goto end;
368 if (!(replace = PyObject_GetAttrString((PyObject*)co,
"replace")))
goto cleanup_code_too;
369 if (!(empty = PyTuple_New(0)))
goto cleanup_code_too;
370 if (!(call_result = PyObject_Call(replace, empty, kwds)))
goto cleanup_code_too;
371 Py_XDECREF((PyObject*)co);
372 co = (PyCodeObject*)call_result;
376 Py_XDECREF((PyObject*)co);
381 Py_XDECREF(argcount);
382 Py_XDECREF(posonlyargcount);
383 Py_XDECREF(kwonlyargcount);
385 Py_XDECREF(stacksize);
387 Py_XDECREF(call_result);
390 PyErr_Restore(type, value, traceback);
395 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
396 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
398 #define __Pyx_DefaultClassType PyType_Type
400 #ifndef Py_TPFLAGS_CHECKTYPES
401 #define Py_TPFLAGS_CHECKTYPES 0
403 #ifndef Py_TPFLAGS_HAVE_INDEX
404 #define Py_TPFLAGS_HAVE_INDEX 0
406 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
407 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
409 #ifndef Py_TPFLAGS_HAVE_FINALIZE
410 #define Py_TPFLAGS_HAVE_FINALIZE 0
412 #ifndef METH_STACKLESS
413 #define METH_STACKLESS 0
415 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
416 #ifndef METH_FASTCALL
417 #define METH_FASTCALL 0x80
419 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
420 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
421 Py_ssize_t nargs, PyObject *kwnames);
423 #define __Pyx_PyCFunctionFast _PyCFunctionFast
424 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
426 #if CYTHON_FAST_PYCCALL
427 #define __Pyx_PyFastCFunction_Check(func)\
428 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
430 #define __Pyx_PyFastCFunction_Check(func) 0
432 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
433 #define PyObject_Malloc(s) PyMem_Malloc(s)
434 #define PyObject_Free(p) PyMem_Free(p)
435 #define PyObject_Realloc(p) PyMem_Realloc(p)
437 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
438 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
439 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
440 #define PyMem_RawFree(p) PyMem_Free(p)
442 #if CYTHON_COMPILING_IN_PYSTON
443 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
444 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
446 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
447 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
449 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
450 #define __Pyx_PyThreadState_Current PyThreadState_GET()
451 #elif PY_VERSION_HEX >= 0x03060000
452 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
453 #elif PY_VERSION_HEX >= 0x03000000
454 #define __Pyx_PyThreadState_Current PyThreadState_GET()
456 #define __Pyx_PyThreadState_Current _PyThreadState_Current
458 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
459 #include "pythread.h"
460 #define Py_tss_NEEDS_INIT 0
461 typedef int Py_tss_t;
462 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
463 *key = PyThread_create_key();
466 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
467 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
468 *key = Py_tss_NEEDS_INIT;
471 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
474 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
475 return *key != Py_tss_NEEDS_INIT;
477 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
478 PyThread_delete_key(*key);
479 *key = Py_tss_NEEDS_INIT;
481 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
482 return PyThread_set_key_value(*key, value);
484 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
485 return PyThread_get_key_value(*key);
488 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
489 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
491 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
493 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
494 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
495 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
497 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
498 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
500 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
501 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
503 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
505 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
506 #define CYTHON_PEP393_ENABLED 1
507 #if defined(PyUnicode_IS_READY)
508 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
509 0 : _PyUnicode_Ready((PyObject *)(op)))
511 #define __Pyx_PyUnicode_READY(op) (0)
513 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
514 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
515 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
516 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
517 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
518 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
519 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
520 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
521 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
522 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
524 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
527 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
530 #define CYTHON_PEP393_ENABLED 0
531 #define PyUnicode_1BYTE_KIND 1
532 #define PyUnicode_2BYTE_KIND 2
533 #define PyUnicode_4BYTE_KIND 4
534 #define __Pyx_PyUnicode_READY(op) (0)
535 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
536 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
537 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
538 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
539 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
540 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
541 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
542 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
544 #if CYTHON_COMPILING_IN_PYPY
545 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
546 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
548 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
549 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
550 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
552 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
553 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
555 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
556 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
558 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
559 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
561 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
562 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
563 #if PY_MAJOR_VERSION >= 3
564 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
566 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
568 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
569 #define PyObject_ASCII(o) PyObject_Repr(o)
571 #if PY_MAJOR_VERSION >= 3
572 #define PyBaseString_Type PyUnicode_Type
573 #define PyStringObject PyUnicodeObject
574 #define PyString_Type PyUnicode_Type
575 #define PyString_Check PyUnicode_Check
576 #define PyString_CheckExact PyUnicode_CheckExact
577 #ifndef PyObject_Unicode
578 #define PyObject_Unicode PyObject_Str
581 #if PY_MAJOR_VERSION >= 3
582 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
583 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
585 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
586 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
588 #ifndef PySet_CheckExact
589 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
591 #if PY_VERSION_HEX >= 0x030900A4
592 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
593 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
595 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
596 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
598 #if CYTHON_ASSUME_SAFE_MACROS
599 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
601 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
603 #if PY_MAJOR_VERSION >= 3
604 #define PyIntObject PyLongObject
605 #define PyInt_Type PyLong_Type
606 #define PyInt_Check(op) PyLong_Check(op)
607 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
608 #define PyInt_FromString PyLong_FromString
609 #define PyInt_FromUnicode PyLong_FromUnicode
610 #define PyInt_FromLong PyLong_FromLong
611 #define PyInt_FromSize_t PyLong_FromSize_t
612 #define PyInt_FromSsize_t PyLong_FromSsize_t
613 #define PyInt_AsLong PyLong_AsLong
614 #define PyInt_AS_LONG PyLong_AS_LONG
615 #define PyInt_AsSsize_t PyLong_AsSsize_t
616 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
617 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
618 #define PyNumber_Int PyNumber_Long
620 #if PY_MAJOR_VERSION >= 3
621 #define PyBoolObject PyLongObject
623 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
624 #ifndef PyUnicode_InternFromString
625 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
628 #if PY_VERSION_HEX < 0x030200A4
629 typedef long Py_hash_t;
630 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
631 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
633 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
634 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
636 #if PY_MAJOR_VERSION >= 3
637 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
639 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
641 #if CYTHON_USE_ASYNC_SLOTS
642 #if PY_VERSION_HEX >= 0x030500B1
643 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
644 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
646 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
649 #define __Pyx_PyType_AsAsync(obj) NULL
651 #ifndef __Pyx_PyAsyncMethodsStruct
656 } __Pyx_PyAsyncMethodsStruct;
659 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
660 #if !defined(_USE_MATH_DEFINES)
661 #define _USE_MATH_DEFINES
666 #define __PYX_NAN() ((float) NAN)
668 static CYTHON_INLINE
float __PYX_NAN() {
670 memset(&value, 0xFF,
sizeof(value));
674 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
675 #define __Pyx_truncl trunc
677 #define __Pyx_truncl truncl
680 #define __PYX_MARK_ERR_POS(f_index, lineno) \
681 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
682 #define __PYX_ERR(f_index, lineno, Ln_error) \
683 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
685 #ifndef __PYX_EXTERN_C
687 #define __PYX_EXTERN_C extern "C"
689 #define __PYX_EXTERN_C extern
693 #define __PYX_HAVE__Isosurface
694 #define __PYX_HAVE_API__Isosurface
698 #include "numpy/arrayobject.h"
699 #include "numpy/ndarrayobject.h"
700 #include "numpy/ndarraytypes.h"
701 #include "numpy/arrayscalars.h"
702 #include "numpy/ufuncobject.h"
711 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
712 #define CYTHON_WITHOUT_ASSERTIONS
715 typedef struct {PyObject **p;
const char *
s;
const Py_ssize_t
n;
const char* encoding;
716 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
718 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
719 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
720 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
721 #define __PYX_DEFAULT_STRING_ENCODING ""
722 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
723 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
724 #define __Pyx_uchar_cast(c) ((unsigned char)c)
725 #define __Pyx_long_cast(x) ((long)x)
726 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
727 (sizeof(type) < sizeof(Py_ssize_t)) ||\
728 (sizeof(type) > sizeof(Py_ssize_t) &&\
729 likely(v < (type)PY_SSIZE_T_MAX ||\
730 v == (type)PY_SSIZE_T_MAX) &&\
731 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
732 v == (type)PY_SSIZE_T_MIN))) ||\
733 (sizeof(type) == sizeof(Py_ssize_t) &&\
734 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
735 v == (type)PY_SSIZE_T_MAX))) )
736 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
737 return (
size_t) i < (size_t) limit;
739 #if defined (__cplusplus) && __cplusplus >= 201103L
741 #define __Pyx_sst_abs(value) std::abs(value)
742 #elif SIZEOF_INT >= SIZEOF_SIZE_T
743 #define __Pyx_sst_abs(value) abs(value)
744 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
745 #define __Pyx_sst_abs(value) labs(value)
746 #elif defined (_MSC_VER)
747 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
748 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
749 #define __Pyx_sst_abs(value) llabs(value)
750 #elif defined (__GNUC__)
751 #define __Pyx_sst_abs(value) __builtin_llabs(value)
753 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
755 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
756 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
757 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
758 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
759 #define __Pyx_PyBytes_FromString PyBytes_FromString
760 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
761 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
762 #if PY_MAJOR_VERSION < 3
763 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
764 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
766 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
767 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
769 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
770 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
771 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
772 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
773 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
774 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
775 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
776 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
777 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
778 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
779 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
780 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
781 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
782 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
783 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
784 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
785 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *
u) {
786 const Py_UNICODE *u_end =
u;
788 return (
size_t)(u_end -
u - 1);
790 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
791 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
792 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
793 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
794 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
795 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
796 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
797 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
798 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
799 #define __Pyx_PySequence_Tuple(obj)\
800 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
801 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
802 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
803 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
804 #if CYTHON_ASSUME_SAFE_MACROS
805 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
807 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
809 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
810 #if PY_MAJOR_VERSION >= 3
811 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
813 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
815 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
816 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
817 static int __Pyx_sys_getdefaultencoding_not_ascii;
818 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
820 PyObject* default_encoding = NULL;
821 PyObject* ascii_chars_u = NULL;
822 PyObject* ascii_chars_b = NULL;
823 const char* default_encoding_c;
824 sys = PyImport_ImportModule(
"sys");
826 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
828 if (!default_encoding)
goto bad;
829 default_encoding_c = PyBytes_AsString(default_encoding);
830 if (!default_encoding_c)
goto bad;
831 if (strcmp(default_encoding_c,
"ascii") == 0) {
832 __Pyx_sys_getdefaultencoding_not_ascii = 0;
834 char ascii_chars[128];
836 for (
c = 0;
c < 128;
c++) {
839 __Pyx_sys_getdefaultencoding_not_ascii = 1;
840 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
841 if (!ascii_chars_u)
goto bad;
842 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
843 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
846 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
850 Py_DECREF(ascii_chars_u);
851 Py_DECREF(ascii_chars_b);
853 Py_DECREF(default_encoding);
856 Py_XDECREF(default_encoding);
857 Py_XDECREF(ascii_chars_u);
858 Py_XDECREF(ascii_chars_b);
862 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
863 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
865 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
866 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
867 static char* __PYX_DEFAULT_STRING_ENCODING;
868 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
870 PyObject* default_encoding = NULL;
871 char* default_encoding_c;
872 sys = PyImport_ImportModule(
"sys");
874 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
876 if (!default_encoding)
goto bad;
877 default_encoding_c = PyBytes_AsString(default_encoding);
878 if (!default_encoding_c)
goto bad;
879 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
880 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
881 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
882 Py_DECREF(default_encoding);
885 Py_XDECREF(default_encoding);
893 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
894 #define likely(x) __builtin_expect(!!(x), 1)
895 #define unlikely(x) __builtin_expect(!!(x), 0)
897 #define likely(x) (x)
898 #define unlikely(x) (x)
900 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
902 static PyObject *__pyx_m = NULL;
903 static PyObject *__pyx_d;
904 static PyObject *__pyx_b;
905 static PyObject *__pyx_cython_runtime = NULL;
906 static PyObject *__pyx_empty_tuple;
907 static PyObject *__pyx_empty_bytes;
908 static PyObject *__pyx_empty_unicode;
909 static int __pyx_lineno;
910 static int __pyx_clineno = 0;
911 static const char * __pyx_cfilenm= __FILE__;
912 static const char *__pyx_filename;
915 #if !defined(CYTHON_CCOMPLEX)
916 #if defined(__cplusplus)
917 #define CYTHON_CCOMPLEX 1
918 #elif defined(_Complex_I)
919 #define CYTHON_CCOMPLEX 1
921 #define CYTHON_CCOMPLEX 0
931 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
933 #define _Complex_I 1.0fj
937 static const char *__pyx_f[] = {
938 "proteus/Isosurface.pyx",
943 #define IS_UNSIGNED(type) (((type) -1) > 0)
944 struct __Pyx_StructField_;
945 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
948 struct __Pyx_StructField_* fields;
956 typedef struct __Pyx_StructField_ {
957 __Pyx_TypeInfo* type;
962 __Pyx_StructField* field;
963 size_t parent_offset;
964 } __Pyx_BufFmt_StackElem;
966 __Pyx_StructField root;
967 __Pyx_BufFmt_StackElem* head;
969 size_t new_count, enc_count;
970 size_t struct_alignment;
976 } __Pyx_BufFmt_Context;
986 typedef npy_int8 __pyx_t_5numpy_int8_t;
995 typedef npy_int16 __pyx_t_5numpy_int16_t;
1004 typedef npy_int32 __pyx_t_5numpy_int32_t;
1013 typedef npy_int64 __pyx_t_5numpy_int64_t;
1022 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1031 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1040 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1049 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1058 typedef npy_float32 __pyx_t_5numpy_float32_t;
1067 typedef npy_float64 __pyx_t_5numpy_float64_t;
1076 typedef npy_long __pyx_t_5numpy_int_t;
1085 typedef npy_longlong __pyx_t_5numpy_long_t;
1094 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1103 typedef npy_ulong __pyx_t_5numpy_uint_t;
1112 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1121 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1130 typedef npy_intp __pyx_t_5numpy_intp_t;
1139 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1148 typedef npy_double __pyx_t_5numpy_float_t;
1157 typedef npy_double __pyx_t_5numpy_double_t;
1166 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1170 typedef ::std::complex< float > __pyx_t_float_complex;
1172 typedef float _Complex __pyx_t_float_complex;
1175 typedef struct {
float real, imag; } __pyx_t_float_complex;
1177 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1182 typedef ::std::complex< double > __pyx_t_double_complex;
1184 typedef double _Complex __pyx_t_double_complex;
1187 typedef struct {
double real, imag; } __pyx_t_double_complex;
1189 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1193 struct __pyx_obj_10Isosurface___pyx_scope_struct__attachModel;
1194 struct __pyx_obj_10Isosurface___pyx_scope_struct_1_genexpr;
1203 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1212 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1221 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1230 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1231 struct __pyx_opt_args_10Isosurface_EVec;
1240 struct __pyx_opt_args_10Isosurface_EVec {
1254 struct __pyx_obj_10Isosurface___pyx_scope_struct__attachModel {
1256 PyObject *__pyx_v_self;
1267 struct __pyx_obj_10Isosurface___pyx_scope_struct_1_genexpr {
1269 struct __pyx_obj_10Isosurface___pyx_scope_struct__attachModel *__pyx_outer_scope;
1270 PyObject *__pyx_v_bn;
1271 PyObject *__pyx_v_gn;
1277 #ifndef CYTHON_REFNANNY
1278 #define CYTHON_REFNANNY 0
1282 void (*INCREF)(
void*, PyObject*, int);
1283 void (*DECREF)(
void*, PyObject*, int);
1284 void (*GOTREF)(
void*, PyObject*, int);
1285 void (*GIVEREF)(
void*, PyObject*, int);
1286 void* (*SetupContext)(
const char*, int,
const char*);
1287 void (*FinishContext)(
void**);
1288 } __Pyx_RefNannyAPIStruct;
1289 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1290 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1291 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1293 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1295 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1296 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1297 PyGILState_Release(__pyx_gilstate_save);\
1299 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1302 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1303 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1305 #define __Pyx_RefNannyFinishContext()\
1306 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1307 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1308 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1309 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1310 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1311 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1312 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1313 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1314 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1316 #define __Pyx_RefNannyDeclarations
1317 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1318 #define __Pyx_RefNannyFinishContext()
1319 #define __Pyx_INCREF(r) Py_INCREF(r)
1320 #define __Pyx_DECREF(r) Py_DECREF(r)
1321 #define __Pyx_GOTREF(r)
1322 #define __Pyx_GIVEREF(r)
1323 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1324 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1325 #define __Pyx_XGOTREF(r)
1326 #define __Pyx_XGIVEREF(r)
1328 #define __Pyx_XDECREF_SET(r, v) do {\
1329 PyObject *tmp = (PyObject *) r;\
1330 r = v; __Pyx_XDECREF(tmp);\
1332 #define __Pyx_DECREF_SET(r, v) do {\
1333 PyObject *tmp = (PyObject *) r;\
1334 r = v; __Pyx_DECREF(tmp);\
1336 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1337 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1340 #if CYTHON_USE_TYPE_SLOTS
1341 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1343 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1347 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1350 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1351 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1352 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1353 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1354 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1355 (cache_var) = (value);
1356 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1357 static PY_UINT64_T __pyx_dict_version = 0;\
1358 static PyObject *__pyx_dict_cached_value = NULL;\
1359 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1360 (VAR) = __pyx_dict_cached_value;\
1362 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1363 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1366 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1367 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1368 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1370 #define __PYX_GET_DICT_VERSION(dict) (0)
1371 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1372 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1376 #if CYTHON_USE_DICT_VERSIONS
1377 #define __Pyx_GetModuleGlobalName(var, name) {\
1378 static PY_UINT64_T __pyx_dict_version = 0;\
1379 static PyObject *__pyx_dict_cached_value = NULL;\
1380 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1381 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1382 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1384 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1385 PY_UINT64_T __pyx_dict_version;\
1386 PyObject *__pyx_dict_cached_value;\
1387 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1389 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1391 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1392 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1393 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1397 #if CYTHON_COMPILING_IN_CPYTHON
1398 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1400 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1404 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1407 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
1410 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
1411 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
1412 __Pyx_BufFmt_StackElem* stack,
1413 __Pyx_TypeInfo* type);
1416 #define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
1417 ((obj == Py_None || obj == NULL) ?\
1418 (__Pyx_ZeroBuffer(buf), 0) :\
1419 __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
1420 static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
1421 __Pyx_TypeInfo* dtype,
int flags,
int nd,
int cast, __Pyx_BufFmt_StackElem* stack);
1422 static void __Pyx_ZeroBuffer(Py_buffer* buf);
1423 static CYTHON_INLINE
void __Pyx_SafeReleaseBuffer(Py_buffer* info);
1424 static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
1425 static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
1428 static void __Pyx_RaiseBufferIndexError(
int axis);
1430 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
1432 #if CYTHON_FAST_THREAD_STATE
1433 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1434 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1435 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1437 #define __Pyx_PyThreadState_declare
1438 #define __Pyx_PyThreadState_assign
1439 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1443 #if CYTHON_FAST_THREAD_STATE
1444 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1445 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1446 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1447 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1448 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1449 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1450 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1451 #if CYTHON_COMPILING_IN_CPYTHON
1452 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1454 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1457 #define __Pyx_PyErr_Clear() PyErr_Clear()
1458 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1459 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1460 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1461 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1462 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1463 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1464 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1468 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1469 int lineno,
const char *filename,
1470 int full_traceback,
int nogil);
1473 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1474 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1477 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1480 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1481 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1482 const char* function_name);
1485 #if CYTHON_USE_TYPE_SLOTS
1486 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1487 static CYTHON_INLINE
int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1489 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1490 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1494 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1497 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1500 static CYTHON_INLINE
int __Pyx_IterFinish(
void);
1503 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
1506 #if !CYTHON_COMPILING_IN_PYPY
1507 static PyObject* __Pyx_PyFloat_EqObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace,
int zerodivision_check);
1509 #define __Pyx_PyFloat_EqObjC(op1, op2, floatval, inplace, zerodivision_check)\
1510 (PyObject_RichCompare(op1, op2, Py_EQ))
1514 #if CYTHON_FAST_PYCALL
1515 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1516 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1517 #if 1 || PY_VERSION_HEX < 0x030600B1
1518 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1520 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1522 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1523 (sizeof(char [1 - 2*!(cond)]) - 1)
1524 #ifndef Py_MEMBER_SIZE
1525 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1527 #if CYTHON_FAST_PYCALL
1528 static size_t __pyx_pyframe_localsplus_offset = 0;
1529 #include "frameobject.h"
1530 #if PY_VERSION_HEX >= 0x030b00a6
1531 #ifndef Py_BUILD_CORE
1532 #define Py_BUILD_CORE 1
1534 #include "internal/pycore_frame.h"
1536 #define __Pxy_PyFrame_Initialize_Offsets()\
1537 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1538 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1539 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1540 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1541 #endif // CYTHON_FAST_PYCALL
1545 #if CYTHON_COMPILING_IN_CPYTHON
1546 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1550 #if CYTHON_COMPILING_IN_CPYTHON
1551 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1553 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1557 #if CYTHON_FAST_PYCCALL
1558 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1560 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1564 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1567 static CYTHON_INLINE
void __Pyx_RaiseClosureNameError(
const char *varname);
1570 #if !CYTHON_COMPILING_IN_PYPY
1571 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
1573 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1574 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1578 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1579 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1580 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1581 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1582 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1583 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1584 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1585 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1586 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1587 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1588 int wraparound,
int boundscheck);
1589 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1590 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1591 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1592 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1593 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1594 int wraparound,
int boundscheck);
1595 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1596 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1597 int is_list,
int wraparound,
int boundscheck);
1600 #if CYTHON_USE_TYPE_SLOTS
1601 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1603 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1607 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1610 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1613 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1614 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1615 PyListObject*
L = (PyListObject*) list;
1616 Py_ssize_t len = Py_SIZE(list);
1617 if (likely(
L->allocated > len)) {
1619 PyList_SET_ITEM(list, len, x);
1620 __Pyx_SET_SIZE(list, len + 1);
1623 return PyList_Append(list, x);
1626 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1630 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1633 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
1634 PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
1635 PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1636 int has_cstart,
int has_cstop,
int wraparound);
1639 static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2,
long intval,
long inplace);
1642 #if !CYTHON_COMPILING_IN_PYPY
1643 static PyObject* __Pyx_PyFloat_NeObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace,
int zerodivision_check);
1645 #define __Pyx_PyFloat_NeObjC(op1, op2, floatval, inplace, zerodivision_check)\
1646 (PyObject_RichCompare(op1, op2, Py_NE))
1650 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1653 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1654 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1655 PyListObject*
L = (PyListObject*) list;
1656 Py_ssize_t len = Py_SIZE(list);
1657 if (likely(
L->allocated > len) & likely(len > (
L->allocated >> 1))) {
1659 PyList_SET_ITEM(list, len, x);
1660 __Pyx_SET_SIZE(list, len + 1);
1663 return PyList_Append(list, x);
1666 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1670 static void __Pyx_RaiseBufferFallbackError(
void);
1673 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1674 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1675 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
1676 (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
1677 __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
1678 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *
v);
1679 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *
v,
1680 int is_list,
int wraparound,
int boundscheck);
1686 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1689 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1692 #if PY_MAJOR_VERSION >= 3
1693 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1695 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1699 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2,
long intval,
long inplace);
1702 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
1705 #if CYTHON_USE_EXC_INFO_STACK
1706 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1710 #if CYTHON_FAST_THREAD_STATE
1711 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1712 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1713 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1714 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1716 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1717 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1721 #if CYTHON_FAST_THREAD_STATE
1722 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1723 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1725 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1729 #if CYTHON_FAST_THREAD_STATE
1730 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1731 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1733 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1737 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1738 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1740 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1744 #ifndef __PYX_HAVE_RT_ImportType_proto
1745 #define __PYX_HAVE_RT_ImportType_proto
1746 enum __Pyx_ImportType_CheckSize {
1747 __Pyx_ImportType_CheckSize_Error = 0,
1748 __Pyx_ImportType_CheckSize_Warn = 1,
1749 __Pyx_ImportType_CheckSize_Ignore = 2
1751 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
1755 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
1758 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1761 #define __Pyx_CyFunction_USED 1
1762 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
1763 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
1764 #define __Pyx_CYFUNCTION_CCLASS 0x04
1765 #define __Pyx_CyFunction_GetClosure(f)\
1766 (((__pyx_CyFunctionObject *) (f))->func_closure)
1767 #define __Pyx_CyFunction_GetClassObj(f)\
1768 (((__pyx_CyFunctionObject *) (f))->func_classobj)
1769 #define __Pyx_CyFunction_Defaults(type, f)\
1770 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
1771 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
1772 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
1774 PyCFunctionObject func;
1775 #if PY_VERSION_HEX < 0x030500A0
1776 PyObject *func_weakreflist;
1778 PyObject *func_dict;
1779 PyObject *func_name;
1780 PyObject *func_qualname;
1782 PyObject *func_globals;
1783 PyObject *func_code;
1784 PyObject *func_closure;
1785 PyObject *func_classobj;
1787 int defaults_pyobjects;
1788 size_t defaults_size;
1790 PyObject *defaults_tuple;
1791 PyObject *defaults_kwdict;
1792 PyObject *(*defaults_getter)(PyObject *);
1793 PyObject *func_annotations;
1794 } __pyx_CyFunctionObject;
1795 static PyTypeObject *__pyx_CyFunctionType = 0;
1796 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
1797 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
1798 int flags, PyObject* qualname,
1800 PyObject *module, PyObject *globals,
1802 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *m,
1805 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
1807 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
1809 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
1811 static int __pyx_CyFunction_init(
void);
1814 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
1815 int flags, PyObject* qualname,
1817 PyObject *module, PyObject *globals,
1821 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
1822 #define __Pyx_SetNameInClass(ns, name, value)\
1823 (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
1824 #elif CYTHON_COMPILING_IN_CPYTHON
1825 #define __Pyx_SetNameInClass(ns, name, value)\
1826 (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
1828 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
1832 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
1833 PyObject *mkw, PyObject *modname, PyObject *doc);
1834 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
1835 PyObject *mkw,
int calculate_metaclass,
int allow_py2_metaclass);
1838 #ifdef CYTHON_CLINE_IN_TRACEBACK
1839 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1841 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1846 PyCodeObject* code_object;
1848 } __Pyx_CodeObjectCacheEntry;
1849 struct __Pyx_CodeObjectCache {
1852 __Pyx_CodeObjectCacheEntry* entries;
1854 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1855 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1856 static PyCodeObject *__pyx_find_code_object(
int code_line);
1857 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1860 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1861 int py_line,
const char *filename);
1865 Py_ssize_t shape, strides, suboffsets;
1866 } __Pyx_Buf_DimInfo;
1872 __Pyx_Buffer *rcbuffer;
1874 __Pyx_Buf_DimInfo diminfo[8];
1875 } __Pyx_LocalBuf_ND;
1877 #if PY_MAJOR_VERSION < 3
1878 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
1879 static void __Pyx_ReleaseBuffer(Py_buffer *view);
1881 #define __Pyx_GetBuffer PyObject_GetBuffer
1882 #define __Pyx_ReleaseBuffer PyBuffer_Release
1887 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
1888 #define __Pyx_HAS_GCC_DIAGNOSTIC
1892 static int __Pyx_Print(PyObject*, PyObject *,
int);
1893 #if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
1894 static PyObject* __pyx_print = 0;
1895 static PyObject* __pyx_print_kwargs = 0;
1901 #define __Pyx_CREAL(z) ((z).real())
1902 #define __Pyx_CIMAG(z) ((z).imag())
1904 #define __Pyx_CREAL(z) (__real__(z))
1905 #define __Pyx_CIMAG(z) (__imag__(z))
1908 #define __Pyx_CREAL(z) ((z).real)
1909 #define __Pyx_CIMAG(z) ((z).imag)
1911 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
1912 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
1913 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1914 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1916 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1917 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1922 #define __Pyx_c_eq_float(a, b) ((a)==(b))
1923 #define __Pyx_c_sum_float(a, b) ((a)+(b))
1924 #define __Pyx_c_diff_float(a, b) ((a)-(b))
1925 #define __Pyx_c_prod_float(a, b) ((a)*(b))
1926 #define __Pyx_c_quot_float(a, b) ((a)/(b))
1927 #define __Pyx_c_neg_float(a) (-(a))
1929 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
1930 #define __Pyx_c_conj_float(z) (::std::conj(z))
1932 #define __Pyx_c_abs_float(z) (::std::abs(z))
1933 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
1936 #define __Pyx_c_is_zero_float(z) ((z)==0)
1937 #define __Pyx_c_conj_float(z) (conjf(z))
1939 #define __Pyx_c_abs_float(z) (cabsf(z))
1940 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
1944 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
1945 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
1946 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
1947 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
1948 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
1949 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
1950 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
1951 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
1953 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
1954 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
1960 #define __Pyx_c_eq_double(a, b) ((a)==(b))
1961 #define __Pyx_c_sum_double(a, b) ((a)+(b))
1962 #define __Pyx_c_diff_double(a, b) ((a)-(b))
1963 #define __Pyx_c_prod_double(a, b) ((a)*(b))
1964 #define __Pyx_c_quot_double(a, b) ((a)/(b))
1965 #define __Pyx_c_neg_double(a) (-(a))
1967 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
1968 #define __Pyx_c_conj_double(z) (::std::conj(z))
1970 #define __Pyx_c_abs_double(z) (::std::abs(z))
1971 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
1974 #define __Pyx_c_is_zero_double(z) ((z)==0)
1975 #define __Pyx_c_conj_double(z) (conj(z))
1977 #define __Pyx_c_abs_double(z) (cabs(z))
1978 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
1982 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
1983 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
1984 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
1985 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
1986 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
1987 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
1988 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
1989 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
1991 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
1992 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
1997 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2000 static int __Pyx_PrintOne(PyObject* stream, PyObject *o);
2003 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2006 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2009 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2012 #if CYTHON_COMPILING_IN_CPYTHON
2013 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2014 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2015 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2016 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2018 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2019 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2020 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2022 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2025 #if CYTHON_FAST_THREAD_STATE
2026 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2027 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2029 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2033 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
2036 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
2039 typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
2040 #if CYTHON_USE_EXC_INFO_STACK
2041 #define __Pyx_ExcInfoStruct _PyErr_StackItem
2045 PyObject *exc_value;
2046 PyObject *exc_traceback;
2047 } __Pyx_ExcInfoStruct;
2051 __pyx_coroutine_body_t body;
2053 __Pyx_ExcInfoStruct gi_exc_state;
2054 PyObject *gi_weakreflist;
2056 PyObject *yieldfrom;
2058 PyObject *gi_qualname;
2059 PyObject *gi_modulename;
2064 } __pyx_CoroutineObject;
2065 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
2066 PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
2067 PyObject *name, PyObject *qualname, PyObject *module_name);
2068 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
2069 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
2070 PyObject *name, PyObject *qualname, PyObject *module_name);
2071 static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *
self);
2072 static int __Pyx_Coroutine_clear(PyObject *
self);
2073 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value);
2074 static PyObject *__Pyx_Coroutine_Close(PyObject *
self);
2075 static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
2076 #if CYTHON_USE_EXC_INFO_STACK
2077 #define __Pyx_Coroutine_SwapException(self)
2078 #define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
2080 #define __Pyx_Coroutine_SwapException(self) {\
2081 __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
2082 __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
2084 #define __Pyx_Coroutine_ResetAndClearException(self) {\
2085 __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
2086 (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
2089 #if CYTHON_FAST_THREAD_STATE
2090 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
2091 __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
2093 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
2094 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
2096 static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
2097 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
2100 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code);
2103 static int __Pyx_patch_abc(
void);
2106 #define __Pyx_Generator_USED
2107 static PyTypeObject *__pyx_GeneratorType = 0;
2108 #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
2109 #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
2110 __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
2111 static PyObject *__Pyx_Generator_Next(PyObject *
self);
2112 static int __pyx_Generator_init(
void);
2115 static int __Pyx_check_binary_version(
void);
2118 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2130 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2143 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2144 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2145 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2146 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2147 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2148 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2149 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2150 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2151 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2152 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2153 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2154 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2155 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2156 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2157 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2162 static PyTypeObject *__pyx_ptype_10Isosurface___pyx_scope_struct__attachModel = 0;
2163 static PyTypeObject *__pyx_ptype_10Isosurface___pyx_scope_struct_1_genexpr = 0;
2164 static PyArrayObject *__pyx_f_10Isosurface_EVec(
struct __pyx_opt_args_10Isosurface_EVec *__pyx_optional_args);
2165 static double __pyx_f_10Isosurface_enorm(PyArrayObject *);
2166 static double __pyx_f_10Isosurface_edot(PyArrayObject *, PyArrayObject *);
2167 static PyArrayObject *__pyx_f_10Isosurface_ecross(PyArrayObject *, PyArrayObject *);
2168 static double __pyx_f_10Isosurface_etriple(PyArrayObject *, PyArrayObject *, PyArrayObject *);
2169 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = {
"float64_t", NULL,
sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0,
'R', 0, 0 };
2170 #define __Pyx_MODULE_NAME "Isosurface"
2171 extern int __pyx_module_is_main_Isosurface;
2172 int __pyx_module_is_main_Isosurface = 0;
2175 static PyObject *__pyx_builtin_enumerate;
2176 static PyObject *__pyx_builtin_NotImplementedError;
2177 static PyObject *__pyx_builtin_range;
2178 static PyObject *__pyx_builtin_open;
2179 static PyObject *__pyx_builtin_zip;
2180 static PyObject *__pyx_builtin_ImportError;
2181 static const char __pyx_k_I[] =
"I";
2182 static const char __pyx_k_J[] =
"J";
2183 static const char __pyx_k_L[] =
"L";
2184 static const char __pyx_k_a[] =
"a";
2185 static const char __pyx_k_d[] =
"d";
2186 static const char __pyx_k_e[] =
"e";
2187 static const char __pyx_k_f[] =
"f";
2188 static const char __pyx_k_i[] =
"i";
2189 static const char __pyx_k_j[] =
"j";
2190 static const char __pyx_k_n[] =
"n";
2191 static const char __pyx_k_s[] =
"s";
2192 static const char __pyx_k_u[] =
"u";
2193 static const char __pyx_k_v[] =
"v";
2194 static const char __pyx_k_w[] =
"w";
2195 static const char __pyx_k_x[] =
"x";
2196 static const char __pyx_k__4[] =
"/";
2197 static const char __pyx_k__6[] =
"}\n";
2198 static const char __pyx_k_ar[] =
"ar";
2199 static const char __pyx_k_dx[] =
"dx";
2200 static const char __pyx_k_eN[] =
"eN";
2201 static const char __pyx_k_h5[] =
"h5";
2202 static const char __pyx_k_ni[] =
"ni";
2203 static const char __pyx_k_np[] =
"np";
2204 static const char __pyx_k_os[] =
"os";
2205 static const char __pyx_k_0_d[] =
"{0:d},\n";
2206 static const char __pyx_k_MPI[] =
"MPI";
2207 static const char __pyx_k__10[] =
"";
2208 static const char __pyx_k_bnt[] =
"bnt";
2209 static const char __pyx_k_cam[] =
"cam";
2210 static const char __pyx_k_doc[] =
"__doc__";
2211 static const char __pyx_k_dof[] =
"dof";
2212 static const char __pyx_k_ebN[] =
"ebN";
2213 static const char __pyx_k_end[] =
"end";
2214 static const char __pyx_k_eps[] =
"eps";
2215 static const char __pyx_k_fur[] =
"fur";
2216 static const char __pyx_k_g2b[] =
"g2b";
2217 static const char __pyx_k_get[] =
"get";
2218 static const char __pyx_k_log[] =
"log";
2219 static const char __pyx_k_nll[] =
"nll";
2220 static const char __pyx_k_phi[] =
"phi";
2221 static const char __pyx_k_pov[] =
"pov";
2222 static const char __pyx_k_zip[] =
"zip";
2223 static const char __pyx_k_Comm[] =
"Comm";
2224 static const char __pyx_k_File[] =
"File";
2225 static const char __pyx_k_args[] =
"args";
2226 static const char __pyx_k_comm[] =
"comm";
2227 static const char __pyx_k_data[] =
"data";
2228 static const char __pyx_k_dset[] =
"dset";
2229 static const char __pyx_k_file[] =
"file";
2230 static const char __pyx_k_h5_2[] =
".h5";
2231 static const char __pyx_k_h5py[] =
"h5py";
2232 static const char __pyx_k_init[] =
"__init__";
2233 static const char __pyx_k_join[] =
"join";
2234 static const char __pyx_k_main[] =
"__main__";
2235 static const char __pyx_k_mesh[] =
"mesh";
2236 static const char __pyx_k_name[] =
"__name__";
2237 static const char __pyx_k_norm[] =
"norm";
2238 static const char __pyx_k_open[] =
"open";
2239 static const char __pyx_k_path[] =
"path";
2240 static const char __pyx_k_plus[] =
"plus";
2241 static const char __pyx_k_rank[] =
"rank";
2242 static const char __pyx_k_self[] =
"self";
2243 static const char __pyx_k_send[] =
"send";
2244 static const char __pyx_k_step[] =
"step";
2245 static const char __pyx_k_test[] =
"__test__";
2246 static const char __pyx_k_time[] =
"time";
2247 static const char __pyx_k_PETSc[] =
"PETSc";
2248 static const char __pyx_k_array[] =
"array";
2249 static const char __pyx_k_cam_x[] =
"cam_x";
2250 static const char __pyx_k_cam_y[] =
"cam_y";
2251 static const char __pyx_k_cam_z[] =
"cam_z";
2252 static const char __pyx_k_close[] =
"close";
2253 static const char __pyx_k_elems[] =
"elems";
2254 static const char __pyx_k_field[] =
"field";
2255 static const char __pyx_k_flush[] =
"flush";
2256 static const char __pyx_k_frame[] =
"frame";
2257 static const char __pyx_k_fur_x[] =
"fur_x";
2258 static const char __pyx_k_fur_y[] =
"fur_y";
2259 static const char __pyx_k_fur_z[] =
"fur_z";
2260 static const char __pyx_k_index[] =
"index";
2261 static const char __pyx_k_light[] =
"light";
2262 static const char __pyx_k_minus[] =
"minus";
2263 static const char __pyx_k_model[] =
"model";
2264 static const char __pyx_k_nPlus[] =
"nPlus";
2265 static const char __pyx_k_nll_x[] =
"nll_x";
2266 static const char __pyx_k_nll_y[] =
"nll_y";
2267 static const char __pyx_k_nll_z[] =
"nll_z";
2268 static const char __pyx_k_nodes[] =
"nodes";
2269 static const char __pyx_k_numpy[] =
"numpy";
2270 static const char __pyx_k_print[] =
"print";
2271 static const char __pyx_k_range[] =
"range";
2272 static const char __pyx_k_shape[] =
"shape";
2273 static const char __pyx_k_sky_z[] =
"sky_z";
2274 static const char __pyx_k_tLast[] =
"tLast";
2275 static const char __pyx_k_throw[] =
"throw";
2276 static const char __pyx_k_value[] =
"value";
2277 static const char __pyx_k_write[] =
"write";
2278 static const char __pyx_k_zeros[] =
"zeros";
2279 static const char __pyx_k_domain[] =
"domain";
2280 static const char __pyx_k_format[] =
"format";
2281 static const char __pyx_k_import[] =
"__import__";
2282 static const char __pyx_k_logDir[] =
"logDir";
2283 static const char __pyx_k_module[] =
"__module__";
2284 static const char __pyx_k_mpi4py[] =
"mpi4py";
2285 static const char __pyx_k_nMinus[] =
"nMinus";
2286 static const char __pyx_k_nZeros[] =
"nZeros";
2287 static const char __pyx_k_normal[] =
"normal";
2288 static const char __pyx_k_string[] =
"string";
2289 static const char __pyx_k_values[] =
"values";
2290 static const char __pyx_k_wall_y[] =
"wall_y";
2291 static const char __pyx_k_AV_base[] =
"AV_base";
2292 static const char __pyx_k_barrier[] =
"barrier";
2293 static const char __pyx_k_field_i[] =
"field_i";
2294 static const char __pyx_k_flatten[] =
"flatten";
2295 static const char __pyx_k_floor_z[] =
"floor_z";
2296 static const char __pyx_k_genexpr[] =
"genexpr";
2297 static const char __pyx_k_light_x[] =
"light_x";
2298 static const char __pyx_k_light_y[] =
"light_y";
2299 static const char __pyx_k_light_z[] =
"light_z";
2300 static const char __pyx_k_look_at[] =
"look_at";
2301 static const char __pyx_k_nFrames[] =
"nFrames";
2302 static const char __pyx_k_normals[] =
"normals";
2303 static const char __pyx_k_prepare[] =
"__prepare__";
2304 static const char __pyx_k_product[] =
"product";
2305 static const char __pyx_k_proteus[] =
"proteus";
2306 static const char __pyx_k_FemField[] =
"FemField";
2307 static const char __pyx_k_Template[] =
"Template";
2308 static const char __pyx_k_elements[] =
"elements";
2309 static const char __pyx_k_filename[] =
"filename";
2310 static const char __pyx_k_get_node[] =
"get_node";
2311 static const char __pyx_k_isMaster[] =
"isMaster";
2312 static const char __pyx_k_light_dx[] =
"light_dx";
2313 static const char __pyx_k_light_dy[] =
"light_dy";
2314 static const char __pyx_k_logEvent[] =
"logEvent";
2315 static const char __pyx_k_nN_start[] =
"nN_start";
2316 static const char __pyx_k_petsc4py[] =
"petsc4py";
2317 static const char __pyx_k_povScene[] =
"povScene";
2318 static const char __pyx_k_qualname[] =
"__qualname__";
2319 static const char __pyx_k_Profiling[] =
"Profiling";
2320 static const char __pyx_k_calculate[] =
"calculate";
2321 static const char __pyx_k_checkTime[] =
"checkTime";
2322 static const char __pyx_k_enumerate[] =
"enumerate";
2323 static const char __pyx_k_fine_grid[] =
"fine_grid";
2324 static const char __pyx_k_itertools[] =
"itertools";
2325 static const char __pyx_k_look_at_x[] =
"look_at_x";
2326 static const char __pyx_k_look_at_y[] =
"look_at_y";
2327 static const char __pyx_k_look_at_z[] =
"look_at_z";
2328 static const char __pyx_k_metaclass[] =
"__metaclass__";
2329 static const char __pyx_k_nodeArray[] =
"nodeArray";
2330 static const char __pyx_k_Isosurface[] =
"Isosurface";
2331 static const char __pyx_k_activeTime[] =
"activeTime";
2332 static const char __pyx_k_attachHDF5[] =
"attachHDF5";
2333 static const char __pyx_k_fieldNames[] =
"fieldNames";
2334 static const char __pyx_k_fileprefix[] =
"fileprefix";
2335 static const char __pyx_k_isosurface[] =
"isosurface";
2336 static const char __pyx_k_namedtuple[] =
"namedtuple";
2337 static const char __pyx_k_sampleRate[] =
"sampleRate";
2338 static const char __pyx_k_substitute[] =
"substitute";
2339 static const char __pyx_k_0_d_1_d_2_d[] =
"<{0:d},{1:d},{2:d}>,\n";
2340 static const char __pyx_k_0_f_1_f_2_f[] =
"<{0:f}, {1:f}, {2:f}>,\n";
2341 static const char __pyx_k_ImportError[] =
"ImportError";
2342 static const char __pyx_k_OrderedDict[] =
"OrderedDict";
2343 static const char __pyx_k_attachModel[] =
"attachModel";
2344 static const char __pyx_k_collections[] =
"collections";
2345 static const char __pyx_k_defaultdict[] =
"defaultdict";
2346 static const char __pyx_k_isosurfaces[] =
"isosurfaces";
2347 static const char __pyx_k_next_output[] =
"next_output";
2348 static const char __pyx_k_proteus_inc[] =
"proteus.inc";
2349 static const char __pyx_k_coefficients[] =
"coefficients";
2350 static const char __pyx_k_domain_fur_x[] =
"domain_fur_x";
2351 static const char __pyx_k_domain_fur_y[] =
"domain_fur_y";
2352 static const char __pyx_k_domain_fur_z[] =
"domain_fur_z";
2353 static const char __pyx_k_domain_nll_x[] =
"domain_nll_x";
2354 static const char __pyx_k_domain_nll_y[] =
"domain_nll_y";
2355 static const char __pyx_k_domain_nll_z[] =
"domain_nll_z";
2356 static const char __pyx_k_face_indices[] =
"face_indices {\n ";
2357 static const char __pyx_k_numpy_linalg[] =
"numpy.linalg";
2358 static const char __pyx_k_pov_filename[] =
"pov_filename";
2359 static const char __pyx_k_0_d_1_d_2_d_2[] =
"<{0:d}, {1:d}, {2:d}>,\n";
2360 static const char __pyx_k_boundaryNodes[] =
"boundaryNodes";
2361 static const char __pyx_k_count_nonzero[] =
"count_nonzero";
2362 static const char __pyx_k_endSequential[] =
"endSequential";
2363 static const char __pyx_k_variableNames[] =
"variableNames";
2364 static const char __pyx_k_writeBoundary[] =
"writeBoundary";
2365 static const char __pyx_k_create_dataset[] =
"create_dataset";
2366 static const char __pyx_k_face_indices_2[] =
" }\n face_indices {\n ";
2367 static const char __pyx_k_levelModelList[] =
"levelModelList";
2368 static const char __pyx_k_normal_indices[] =
"normal_indices";
2369 static const char __pyx_k_normal_vectors[] =
" }\n normal_vectors {\n ";
2370 static const char __pyx_k_beginSequential[] =
"beginSequential";
2371 static const char __pyx_k_timeIntegration[] =
"timeIntegration";
2372 static const char __pyx_k_nElements_global[] =
"nElements_global";
2373 static const char __pyx_k_normal_indices_2[] =
" }\n normal_indices {\n ";
2374 static const char __pyx_k_povSceneTemplate[] =
"povSceneTemplate";
2375 static const char __pyx_k_writeSceneHeader[] =
"writeSceneHeader";
2376 static const char __pyx_k_ATTACHING_TO_HDF5[] =
"ATTACHING TO HDF5 !!";
2377 static const char __pyx_k_Isosurface___init[] =
"Isosurface.__init__";
2378 static const char __pyx_k_Writing_pov_frame[] =
"Writing pov frame ";
2379 static const char __pyx_k_elementNodesArray[] =
"elementNodesArray";
2380 static const char __pyx_k_AuxiliaryVariables[] =
"AuxiliaryVariables";
2381 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2382 static const char __pyx_k_num_owned_elements[] =
"num_owned_elements";
2383 static const char __pyx_k_Extract_isosurfaces[] =
"Extract isosurfaces";
2384 static const char __pyx_k_NotImplementedError[] =
"NotImplementedError";
2385 static const char __pyx_k_nodesSpatial_Domain[] =
"/nodesSpatial_Domain";
2386 static const char __pyx_k_writeIsosurfaceMesh[] =
"writeIsosurfaceMesh";
2387 static const char __pyx_k_Isosurface_calculate[] =
"Isosurface.calculate";
2388 static const char __pyx_k_mesh2_vertex_vectors[] =
"mesh2 {\nvertex_vectors {";
2389 static const char __pyx_k_Isosurface_attachHDF5[] =
"Isosurface.attachHDF5";
2390 static const char __pyx_k_inside_vector_on_mesh[] =
"//inside_vector on\n}//mesh\n";
2391 static const char __pyx_k_triangulateIsosurface[] =
"triangulateIsosurface";
2392 static const char __pyx_k_Isosurface_attachModel[] =
"Isosurface.attachModel";
2393 static const char __pyx_k_elementsSpatial_Domain[] =
"/elementsSpatial_Domain";
2394 static const char __pyx_k_proteus_Isosurface_pyx[] =
"proteus/Isosurface.pyx";
2395 static const char __pyx_k_writeIsosurfaceMesh_h5[] =
"writeIsosurfaceMesh_h5";
2396 static const char __pyx_k_Calculate_called_at_time[] =
"Calculate called at time ";
2397 static const char __pyx_k_elementBoundaryNodesArray[] =
"elementBoundaryNodesArray";
2398 static const char __pyx_k_writeIsosurfaceMesh_povray[] =
"writeIsosurfaceMesh_povray";
2399 static const char __pyx_k_Isosurface_writeSceneHeader[] =
"Isosurface.writeSceneHeader";
2400 static const char __pyx_k_elementBoundaryMaterialTypes[] =
"elementBoundaryMaterialTypes";
2401 static const char __pyx_k_Isosurface_writeIsosurfaceMesh[] =
"Isosurface.writeIsosurfaceMesh";
2402 static const char __pyx_k_exteriorElementBoundariesArray[] =
"exteriorElementBoundariesArray";
2403 static const char __pyx_k_AuxiliaryVariables_subclasses_f[] =
"\nAuxiliaryVariables subclasses for extracting isosurfaces and contours\n";
2404 static const char __pyx_k_Only_zero_isocontour_extraction[] =
"Only zero isocontour extraction";
2405 static const char __pyx_k_field_s___value_f___frame_04d_p[] =
"{field:s}_{value:f}_{frame:04d}.pov";
2406 static const char __pyx_k_include_colors_inc_include_text[] =
"#include \"colors.inc\"\n#include \"textures.inc\"\n#include \"glass.inc\"\n#include \"metals.inc\"\n#include \"golds.inc\"\n#include \"stones.inc\"\n#include \"woods.inc\"\n#include \"shapes.inc\"\n#include \"shapes2.inc\"\n#include \"functions.inc\"\n#include \"math.inc\"\n#include \"transforms.inc\"\n\nglobal_settings {\n ambient_light color rgb <1.0, 1.0, 1.0>\n assumed_gamma 2\n}\n\nbackground { color rgb <0.319997, 0.340002, 0.429999>}\n\ncamera {\n perspective\n location <$cam_x,$cam_y,$cam_z>\n sky <0.0, 0.0, 5.0>\n up <0, 0, 1>\n right <1.33, 0, 0>\n angle 45.000000\n look_at <$look_at_x,$look_at_y,$look_at_z>\n}\n\nlight_source {<$light_x,$light_y,$light_z> color White}\n\nlight_source {\n <$light_x+$light_dx,$light_y+$light_dy,$light_z>\n color <0.99980, 0.999800, 0.999800>*2.250000\n spotlight\n point_at <0.5,0.5,0.0>\n}\n\nlight_source {\n <$light_x+$light_dx,$light_y-$light_dy,$light_z>\n color <0.99980, 0.999800, 0.999800>*2.250000\n spotlight\n point_at <0.5,0.5,0.0>\n}\n\nlight_source {\n <$light_x-$light_dx,$light_y-$light_dy,$light_z>\n color <0.99980, 0.999800, 0.999800>*2.250000\n spotlight\n point_at <0.5,0.5,0.0>\n}\n\nlight_source {\n <$light_x-$light_dx,+$light_y,$light_z>\n color <0.99980, 0.999800, 0.999800>*2.250000\n spotlight\n point_at <0.5,0.5,0.0>\n}\n\n// ground -----------------------------------------------------------------\n//---------------------------------<<< settings of squared plane dimensions\n#declare RasterScale = 0.10;\n#declare RasterHalfLine = 0.0125;\n#declare RasterHalfLineZ = 0.0125;\n//-------------------------------------------------------------------------\n#macro Raster(RScale, HLine)\n pigment{ gradient x scale RScale\n color_map{[0.000 color rgbt<1,1,1,0>*0.8]\n [0+HLine color rgbt<1,1,1,0"">*0.8]\n [0+HLine color rgbt<1,1,1,1>]\n [1-HLine color rgbt<1,1,1,1>]\n [1-HLine color rgbt<1,1,1,0>*0.8]\n [1.000 color rgbt<1,1,1,0>*0.8]} }\n #end// of Raster(RScale, HLine)-macro\n//-------------------------------------------------------------------------\n\n// squared plane XY\nplane { <0,0,1>, $floor_z // plane with layered textures\n texture { pigment{checker color White, color Black}\n scale $light_dy*0.5}\n }\nplane { <0,-1,0>, $wall_y // plane with layered textures\n texture { pigment{color White}\n }\n rotate<0,0,0>\n }\nplane { <0,0,-1>, $sky_z // plane with layered textures\n texture { pigment{color Blue}\n }\n rotate<0,0,0>\n }\n//------------------------------------------------ end of squared plane XZ\n#macro tank_material()\nmaterial{\n texture{\n pigment{ rgbf<.98,.98,.98,0.85>*1}\n finish { ambient 0.0\n diffuse 0.15\n reflection 0.2\n specular 0.6\n roughness 0.005\n // phong 1\n // phong_size 400\n reflection { 0.03, 1.0 fresnel on }\n // conserve_energy\n }\n } // end of texture\n\n interior{ ior 1.5\n fade_power 1001\n fade_distance 0.5\n fade_color <0.8,0.8,0.8>\n } // end of interior\n\n\n} // end of material\n#end\n\n#macro isosurface_material()\nmaterial{\n texture{\n pigment{ rgbf<.98,.98,.98,0.9>*0.95}\n finish { ambient 0.0\n diffuse 0.15\n specular 0.6\n roughness 0.005\n //phong 1\n //phong_size 400\n reflection { 0.2, 1.0 fresnel on }\n conserve_energy\n }\n } // end of texture\n\n interior{ ior 1.33\n fade_power 1001\n fade_distance 0.5\n fade_color <0.8,0.8,0.8>\n } // end of inte""rior\n} // end of material\n#end\n";
2407 static const char __pyx_k_matrix_1_000000_0_000000_0_0000[] =
" }\n matrix < 1.000000, 0.000000, 0.000000,\n 0.000000, 1.000000, 0.000000,\n 0.000000, 0.000000, 1.000000,\n 0.000000, 0.000000, 0.000000 >\n isosurface_material()\n }\n";
2408 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
2409 static const char __pyx_k_object_difference_box_nll_x_nll[] =
"\nobject\n{\ndifference\n{\nbox {\n <$nll_x,$nll_y,$nll_z>, // Near lower left corner\n <$fur_x,$fur_y,$fur_z> // Far upper right corner\n }\nbox {\n <$domain_nll_x,$domain_nll_y,$domain_nll_z>, // Near lower left corner\n <$domain_fur_x,$domain_fur_y,$domain_fur_z> // Far upper right corner\n }\n}//difference of perturbed bounding box and boundary\n matrix < 1.000000, 0.000000, 0.000000,\n 0.000000, 1.000000, 0.000000,\n 0.000000, 0.000000, 1.000000,\n 0.000000, 0.000000, 0.000000 >\n tank_material()\n}//object\n";
2410 static const char __pyx_k_union_of_meshes_difference_of_p[] =
"}//union of meshes\n//}//difference of perturbed bounding box and boundary\n matrix < 1.000000, 0.000000, 0.000000,\n 0.000000, 1.000000, 0.000000,\n 0.000000, 0.000000, 1.000000,\n 0.000000, 0.000000, 0.000000 >\n tank_material()\n}//object\n";
2411 static const char __pyx_k_version_3_7_include_proteus_inc[] =
"#version 3.7;\n#include \"proteus.inc\"\n";
2412 static const char __pyx_k_Elements_have_0_d_vertices_but_a[] =
"Elements have {0:d} vertices but algorithm is for tets";
2413 static const char __pyx_k_Isosurface_attachModel_locals_ge[] =
"Isosurface.attachModel.<locals>.genexpr";
2414 static const char __pyx_k_Isosurface_file_format_not_recog[] =
"Isosurface file format not recognized";
2415 static const char __pyx_k_Isosurface_triangulateIsosurface[] =
"Isosurface.triangulateIsosurface";
2416 static const char __pyx_k_Isosurface_writeIsosurfaceMesh_h[] =
"Isosurface.writeIsosurfaceMesh_h5";
2417 static const char __pyx_k_Isosurface_writeIsosurfaceMesh_p[] =
"Isosurface.writeIsosurfaceMesh_povray";
2418 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
2419 static const char __pyx_k_only_implemented_for_0_isosurfac[] =
"only implemented for 0 isosurface in 3D for now";
2420 static const char __pyx_k_object_difference_box_nll_x_nll_2[] =
"\nobject\n{\n//difference\n//{\n// box {\n// <$nll_x,$nll_y,$nll_z>, // Near lower left corner\n// <$fur_x,$fur_y,$fur_z> // Far upper right corner\n// }\nunion\n{\n";
2421 static PyObject *__pyx_kp_s_0_d;
2422 static PyObject *__pyx_kp_s_0_d_1_d_2_d;
2423 static PyObject *__pyx_kp_s_0_d_1_d_2_d_2;
2424 static PyObject *__pyx_kp_s_0_f_1_f_2_f;
2425 static PyObject *__pyx_kp_s_ATTACHING_TO_HDF5;
2426 static PyObject *__pyx_n_s_AV_base;
2427 static PyObject *__pyx_n_s_AuxiliaryVariables;
2428 static PyObject *__pyx_kp_s_Calculate_called_at_time;
2429 static PyObject *__pyx_n_s_Comm;
2430 static PyObject *__pyx_kp_s_Elements_have_0_d_vertices_but_a;
2431 static PyObject *__pyx_kp_s_Extract_isosurfaces;
2432 static PyObject *__pyx_n_s_FemField;
2433 static PyObject *__pyx_n_s_File;
2434 static PyObject *__pyx_n_s_I;
2435 static PyObject *__pyx_n_s_ImportError;
2436 static PyObject *__pyx_n_s_Isosurface;
2437 static PyObject *__pyx_n_s_Isosurface___init;
2438 static PyObject *__pyx_n_s_Isosurface_attachHDF5;
2439 static PyObject *__pyx_n_s_Isosurface_attachModel;
2440 static PyObject *__pyx_n_s_Isosurface_attachModel_locals_ge;
2441 static PyObject *__pyx_n_s_Isosurface_calculate;
2442 static PyObject *__pyx_kp_s_Isosurface_file_format_not_recog;
2443 static PyObject *__pyx_n_s_Isosurface_triangulateIsosurface;
2444 static PyObject *__pyx_n_s_Isosurface_writeIsosurfaceMesh;
2445 static PyObject *__pyx_n_s_Isosurface_writeIsosurfaceMesh_h;
2446 static PyObject *__pyx_n_s_Isosurface_writeIsosurfaceMesh_p;
2447 static PyObject *__pyx_n_s_Isosurface_writeSceneHeader;
2448 static PyObject *__pyx_n_s_J;
2449 static PyObject *__pyx_n_s_L;
2450 static PyObject *__pyx_n_s_MPI;
2451 static PyObject *__pyx_n_s_NotImplementedError;
2452 static PyObject *__pyx_kp_s_Only_zero_isocontour_extraction;
2453 static PyObject *__pyx_n_s_OrderedDict;
2454 static PyObject *__pyx_n_s_PETSc;
2455 static PyObject *__pyx_n_s_Profiling;
2456 static PyObject *__pyx_n_s_Template;
2457 static PyObject *__pyx_kp_s_Writing_pov_frame;
2458 static PyObject *__pyx_n_s__10;
2459 static PyObject *__pyx_kp_s__4;
2460 static PyObject *__pyx_kp_s__6;
2461 static PyObject *__pyx_n_s_a;
2462 static PyObject *__pyx_n_s_activeTime;
2463 static PyObject *__pyx_n_s_ar;
2464 static PyObject *__pyx_n_s_args;
2465 static PyObject *__pyx_n_s_array;
2466 static PyObject *__pyx_n_s_attachHDF5;
2467 static PyObject *__pyx_n_s_attachModel;
2468 static PyObject *__pyx_n_s_barrier;
2469 static PyObject *__pyx_n_s_beginSequential;
2470 static PyObject *__pyx_n_s_bnt;
2471 static PyObject *__pyx_n_s_boundaryNodes;
2472 static PyObject *__pyx_n_s_calculate;
2473 static PyObject *__pyx_n_s_cam;
2474 static PyObject *__pyx_n_s_cam_x;
2475 static PyObject *__pyx_n_s_cam_y;
2476 static PyObject *__pyx_n_s_cam_z;
2477 static PyObject *__pyx_n_s_checkTime;
2478 static PyObject *__pyx_n_s_cline_in_traceback;
2479 static PyObject *__pyx_n_s_close;
2480 static PyObject *__pyx_n_s_coefficients;
2481 static PyObject *__pyx_n_s_collections;
2482 static PyObject *__pyx_n_s_comm;
2483 static PyObject *__pyx_n_s_count_nonzero;
2484 static PyObject *__pyx_n_s_create_dataset;
2485 static PyObject *__pyx_n_s_d;
2486 static PyObject *__pyx_n_s_data;
2487 static PyObject *__pyx_n_s_defaultdict;
2488 static PyObject *__pyx_n_s_doc;
2489 static PyObject *__pyx_n_s_dof;
2490 static PyObject *__pyx_n_s_domain;
2491 static PyObject *__pyx_n_s_domain_fur_x;
2492 static PyObject *__pyx_n_s_domain_fur_y;
2493 static PyObject *__pyx_n_s_domain_fur_z;
2494 static PyObject *__pyx_n_s_domain_nll_x;
2495 static PyObject *__pyx_n_s_domain_nll_y;
2496 static PyObject *__pyx_n_s_domain_nll_z;
2497 static PyObject *__pyx_n_s_dset;
2498 static PyObject *__pyx_n_s_dx;
2499 static PyObject *__pyx_n_s_e;
2500 static PyObject *__pyx_n_s_eN;
2501 static PyObject *__pyx_n_s_ebN;
2502 static PyObject *__pyx_n_s_elementBoundaryMaterialTypes;
2503 static PyObject *__pyx_n_s_elementBoundaryNodesArray;
2504 static PyObject *__pyx_n_s_elementNodesArray;
2505 static PyObject *__pyx_n_s_elements;
2506 static PyObject *__pyx_kp_s_elementsSpatial_Domain;
2507 static PyObject *__pyx_n_s_elems;
2508 static PyObject *__pyx_n_s_end;
2509 static PyObject *__pyx_n_s_endSequential;
2510 static PyObject *__pyx_n_s_enumerate;
2511 static PyObject *__pyx_n_s_eps;
2512 static PyObject *__pyx_n_s_exteriorElementBoundariesArray;
2513 static PyObject *__pyx_n_s_f;
2514 static PyObject *__pyx_kp_s_face_indices;
2515 static PyObject *__pyx_kp_s_face_indices_2;
2516 static PyObject *__pyx_n_s_field;
2517 static PyObject *__pyx_n_s_fieldNames;
2518 static PyObject *__pyx_n_s_field_i;
2519 static PyObject *__pyx_kp_s_field_s___value_f___frame_04d_p;
2520 static PyObject *__pyx_n_s_file;
2521 static PyObject *__pyx_n_s_filename;
2522 static PyObject *__pyx_n_s_fileprefix;
2523 static PyObject *__pyx_n_s_fine_grid;
2524 static PyObject *__pyx_n_s_flatten;
2525 static PyObject *__pyx_n_s_floor_z;
2526 static PyObject *__pyx_n_s_flush;
2527 static PyObject *__pyx_n_s_format;
2528 static PyObject *__pyx_n_s_frame;
2529 static PyObject *__pyx_n_s_fur;
2530 static PyObject *__pyx_n_s_fur_x;
2531 static PyObject *__pyx_n_s_fur_y;
2532 static PyObject *__pyx_n_s_fur_z;
2533 static PyObject *__pyx_n_s_g2b;
2534 static PyObject *__pyx_n_s_genexpr;
2535 static PyObject *__pyx_n_s_get;
2536 static PyObject *__pyx_n_s_get_node;
2537 static PyObject *__pyx_n_s_h5;
2538 static PyObject *__pyx_kp_s_h5_2;
2539 static PyObject *__pyx_n_s_h5py;
2540 static PyObject *__pyx_n_s_i;
2541 static PyObject *__pyx_n_s_import;
2542 static PyObject *__pyx_kp_s_include_colors_inc_include_text;
2543 static PyObject *__pyx_n_s_index;
2544 static PyObject *__pyx_n_s_init;
2545 static PyObject *__pyx_kp_s_inside_vector_on_mesh;
2546 static PyObject *__pyx_n_s_isMaster;
2547 static PyObject *__pyx_n_s_isosurface;
2548 static PyObject *__pyx_n_s_isosurfaces;
2549 static PyObject *__pyx_n_s_itertools;
2550 static PyObject *__pyx_n_s_j;
2551 static PyObject *__pyx_n_s_join;
2552 static PyObject *__pyx_n_s_levelModelList;
2553 static PyObject *__pyx_n_s_light;
2554 static PyObject *__pyx_n_s_light_dx;
2555 static PyObject *__pyx_n_s_light_dy;
2556 static PyObject *__pyx_n_s_light_x;
2557 static PyObject *__pyx_n_s_light_y;
2558 static PyObject *__pyx_n_s_light_z;
2559 static PyObject *__pyx_n_s_log;
2560 static PyObject *__pyx_n_s_logDir;
2561 static PyObject *__pyx_n_s_logEvent;
2562 static PyObject *__pyx_n_s_look_at;
2563 static PyObject *__pyx_n_s_look_at_x;
2564 static PyObject *__pyx_n_s_look_at_y;
2565 static PyObject *__pyx_n_s_look_at_z;
2566 static PyObject *__pyx_n_s_main;
2567 static PyObject *__pyx_kp_s_matrix_1_000000_0_000000_0_0000;
2568 static PyObject *__pyx_n_s_mesh;
2569 static PyObject *__pyx_kp_s_mesh2_vertex_vectors;
2570 static PyObject *__pyx_n_s_metaclass;
2571 static PyObject *__pyx_n_s_minus;
2572 static PyObject *__pyx_n_s_model;
2573 static PyObject *__pyx_n_s_module;
2574 static PyObject *__pyx_n_s_mpi4py;
2575 static PyObject *__pyx_n_s_n;
2576 static PyObject *__pyx_n_s_nElements_global;
2577 static PyObject *__pyx_n_s_nFrames;
2578 static PyObject *__pyx_n_s_nMinus;
2579 static PyObject *__pyx_n_s_nN_start;
2580 static PyObject *__pyx_n_s_nPlus;
2581 static PyObject *__pyx_n_s_nZeros;
2582 static PyObject *__pyx_n_s_name;
2583 static PyObject *__pyx_n_s_namedtuple;
2584 static PyObject *__pyx_n_s_next_output;
2585 static PyObject *__pyx_n_s_ni;
2586 static PyObject *__pyx_n_s_nll;
2587 static PyObject *__pyx_n_s_nll_x;
2588 static PyObject *__pyx_n_s_nll_y;
2589 static PyObject *__pyx_n_s_nll_z;
2590 static PyObject *__pyx_n_s_nodeArray;
2591 static PyObject *__pyx_n_s_nodes;
2592 static PyObject *__pyx_kp_s_nodesSpatial_Domain;
2593 static PyObject *__pyx_n_s_norm;
2594 static PyObject *__pyx_n_s_normal;
2595 static PyObject *__pyx_n_s_normal_indices;
2596 static PyObject *__pyx_kp_s_normal_indices_2;
2597 static PyObject *__pyx_kp_s_normal_vectors;
2598 static PyObject *__pyx_n_s_normals;
2599 static PyObject *__pyx_n_s_np;
2600 static PyObject *__pyx_n_s_num_owned_elements;
2601 static PyObject *__pyx_n_s_numpy;
2602 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2603 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2604 static PyObject *__pyx_n_s_numpy_linalg;
2605 static PyObject *__pyx_kp_s_object_difference_box_nll_x_nll;
2606 static PyObject *__pyx_kp_s_object_difference_box_nll_x_nll_2;
2607 static PyObject *__pyx_kp_s_only_implemented_for_0_isosurfac;
2608 static PyObject *__pyx_n_s_open;
2609 static PyObject *__pyx_n_s_os;
2610 static PyObject *__pyx_n_s_path;
2611 static PyObject *__pyx_n_s_petsc4py;
2612 static PyObject *__pyx_n_s_phi;
2613 static PyObject *__pyx_n_s_plus;
2614 static PyObject *__pyx_n_s_pov;
2615 static PyObject *__pyx_n_s_povScene;
2616 static PyObject *__pyx_n_s_povSceneTemplate;
2617 static PyObject *__pyx_n_s_pov_filename;
2618 static PyObject *__pyx_n_s_prepare;
2619 static PyObject *__pyx_n_s_print;
2620 static PyObject *__pyx_n_s_product;
2621 static PyObject *__pyx_n_s_proteus;
2622 static PyObject *__pyx_kp_s_proteus_Isosurface_pyx;
2623 static PyObject *__pyx_kp_s_proteus_inc;
2624 static PyObject *__pyx_n_s_qualname;
2625 static PyObject *__pyx_n_s_range;
2626 static PyObject *__pyx_n_s_rank;
2627 static PyObject *__pyx_n_s_s;
2628 static PyObject *__pyx_n_s_sampleRate;
2629 static PyObject *__pyx_n_s_self;
2630 static PyObject *__pyx_n_s_send;
2631 static PyObject *__pyx_n_s_shape;
2632 static PyObject *__pyx_n_s_sky_z;
2633 static PyObject *__pyx_n_s_step;
2634 static PyObject *__pyx_n_s_string;
2635 static PyObject *__pyx_n_s_substitute;
2636 static PyObject *__pyx_n_s_tLast;
2637 static PyObject *__pyx_n_s_test;
2638 static PyObject *__pyx_n_s_throw;
2639 static PyObject *__pyx_n_s_time;
2640 static PyObject *__pyx_n_s_timeIntegration;
2641 static PyObject *__pyx_n_s_triangulateIsosurface;
2642 static PyObject *__pyx_n_s_u;
2643 static PyObject *__pyx_kp_s_union_of_meshes_difference_of_p;
2644 static PyObject *__pyx_n_s_v;
2645 static PyObject *__pyx_n_s_value;
2646 static PyObject *__pyx_n_s_values;
2647 static PyObject *__pyx_n_s_variableNames;
2648 static PyObject *__pyx_kp_s_version_3_7_include_proteus_inc;
2649 static PyObject *__pyx_n_s_w;
2650 static PyObject *__pyx_n_s_wall_y;
2651 static PyObject *__pyx_n_s_write;
2652 static PyObject *__pyx_n_s_writeBoundary;
2653 static PyObject *__pyx_n_s_writeIsosurfaceMesh;
2654 static PyObject *__pyx_n_s_writeIsosurfaceMesh_h5;
2655 static PyObject *__pyx_n_s_writeIsosurfaceMesh_povray;
2656 static PyObject *__pyx_n_s_writeSceneHeader;
2657 static PyObject *__pyx_n_s_x;
2658 static PyObject *__pyx_n_s_zeros;
2659 static PyObject *__pyx_n_s_zip;
2660 static PyObject *__pyx_pf_10Isosurface_10Isosurface___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_isosurfaces, PyObject *__pyx_v_domain, PyObject *__pyx_v_activeTime, PyObject *__pyx_v_sampleRate, PyObject *__pyx_v_format, PyObject *__pyx_v_writeBoundary);
2661 static PyObject *__pyx_pf_10Isosurface_10Isosurface_11attachModel_genexpr(PyObject *__pyx_self);
2662 static PyObject *__pyx_pf_10Isosurface_10Isosurface_2attachModel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_model, CYTHON_UNUSED PyObject *__pyx_v_ar);
2663 static PyObject *__pyx_pf_10Isosurface_10Isosurface_4attachHDF5(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_h5, PyObject *__pyx_v_step, PyObject *__pyx_v_cam);
2664 static PyObject *__pyx_pf_10Isosurface_10Isosurface_6triangulateIsosurface(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value);
2665 static PyObject *__pyx_pf_10Isosurface_10Isosurface_8writeIsosurfaceMesh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value, PyObject *__pyx_v_frame);
2666 static PyObject *__pyx_pf_10Isosurface_10Isosurface_10writeIsosurfaceMesh_h5(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_frame);
2667 static PyObject *__pyx_pf_10Isosurface_10Isosurface_12writeIsosurfaceMesh_povray(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_frame);
2668 static PyObject *__pyx_pf_10Isosurface_10Isosurface_14calculate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_checkTime);
2669 static PyObject *__pyx_pf_10Isosurface_10Isosurface_16writeSceneHeader(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cam);
2670 static PyObject *__pyx_tp_new_10Isosurface___pyx_scope_struct__attachModel(PyTypeObject *t, PyObject *a, PyObject *k);
2671 static PyObject *__pyx_tp_new_10Isosurface___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k);
2672 static PyObject *__pyx_float_0_0;
2673 static PyObject *__pyx_float_0_5;
2674 static PyObject *__pyx_float_2_0;
2675 static PyObject *__pyx_float_0_01;
2676 static PyObject *__pyx_float_0_02;
2677 static PyObject *__pyx_float_0_85;
2678 static PyObject *__pyx_int_0;
2679 static PyObject *__pyx_int_1;
2680 static PyObject *__pyx_int_2;
2681 static PyObject *__pyx_int_3;
2682 static PyObject *__pyx_int_4;
2683 static PyObject *__pyx_int_5;
2684 static PyObject *__pyx_int_10;
2685 static PyObject *__pyx_tuple_;
2686 static PyObject *__pyx_slice__3;
2687 static PyObject *__pyx_tuple__2;
2688 static PyObject *__pyx_tuple__5;
2689 static PyObject *__pyx_tuple__7;
2690 static PyObject *__pyx_tuple__8;
2691 static PyObject *__pyx_tuple__9;
2692 static PyObject *__pyx_tuple__11;
2693 static PyObject *__pyx_tuple__13;
2694 static PyObject *__pyx_tuple__14;
2695 static PyObject *__pyx_tuple__16;
2696 static PyObject *__pyx_tuple__18;
2697 static PyObject *__pyx_tuple__19;
2698 static PyObject *__pyx_tuple__21;
2699 static PyObject *__pyx_tuple__23;
2700 static PyObject *__pyx_tuple__25;
2701 static PyObject *__pyx_tuple__27;
2702 static PyObject *__pyx_tuple__29;
2703 static PyObject *__pyx_tuple__30;
2704 static PyObject *__pyx_tuple__32;
2705 static PyObject *__pyx_codeobj__12;
2706 static PyObject *__pyx_codeobj__15;
2707 static PyObject *__pyx_codeobj__17;
2708 static PyObject *__pyx_codeobj__20;
2709 static PyObject *__pyx_codeobj__22;
2710 static PyObject *__pyx_codeobj__24;
2711 static PyObject *__pyx_codeobj__26;
2712 static PyObject *__pyx_codeobj__28;
2713 static PyObject *__pyx_codeobj__31;
2724 static PyArrayObject *__pyx_f_10Isosurface_EVec(
struct __pyx_opt_args_10Isosurface_EVec *__pyx_optional_args) {
2725 double __pyx_v_x = ((double)0.0);
2726 double __pyx_v_y = ((double)0.0);
2727 double __pyx_v_z = ((double)0.0);
2728 PyArrayObject *__pyx_v_v = 0;
2729 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
2730 __Pyx_Buffer __pyx_pybuffer_v;
2731 PyArrayObject *__pyx_r = NULL;
2732 __Pyx_RefNannyDeclarations
2733 PyObject *__pyx_t_1 = NULL;
2734 PyObject *__pyx_t_2 = NULL;
2735 PyArrayObject *__pyx_t_3 = NULL;
2736 Py_ssize_t __pyx_t_4;
2738 int __pyx_lineno = 0;
2739 const char *__pyx_filename = NULL;
2740 int __pyx_clineno = 0;
2741 __Pyx_RefNannySetupContext(
"EVec", 0);
2742 if (__pyx_optional_args) {
2743 if (__pyx_optional_args->__pyx_n > 0) {
2744 __pyx_v_x = __pyx_optional_args->x;
2745 if (__pyx_optional_args->__pyx_n > 1) {
2746 __pyx_v_y = __pyx_optional_args->y;
2747 if (__pyx_optional_args->__pyx_n > 2) {
2748 __pyx_v_z = __pyx_optional_args->z;
2753 __pyx_pybuffer_v.pybuffer.buf = NULL;
2754 __pyx_pybuffer_v.refcount = 0;
2755 __pyx_pybuffernd_v.data = NULL;
2756 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
2765 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
2766 __Pyx_GOTREF(__pyx_t_1);
2767 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
2768 __Pyx_GOTREF(__pyx_t_2);
2769 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2770 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
2771 __Pyx_GOTREF(__pyx_t_1);
2772 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2773 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 29, __pyx_L1_error)
2774 __pyx_t_3 = ((PyArrayObject *)__pyx_t_1);
2776 __Pyx_BufFmt_StackElem __pyx_stack[1];
2777 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
2778 __pyx_v_v = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_v.rcbuffer->pybuffer.buf = NULL;
2779 __PYX_ERR(0, 29, __pyx_L1_error)
2780 }
else {__pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0];
2784 __pyx_v_v = ((PyArrayObject *)__pyx_t_1);
2796 if (__pyx_t_4 < 0) {
2797 __pyx_t_4 += __pyx_pybuffernd_v.diminfo[0].shape;
2798 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
2799 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_5 = 0;
2800 if (unlikely(__pyx_t_5 != -1)) {
2801 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2802 __PYX_ERR(0, 30, __pyx_L1_error)
2804 *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_v.diminfo[0].strides) = __pyx_v_x;
2815 if (__pyx_t_4 < 0) {
2816 __pyx_t_4 += __pyx_pybuffernd_v.diminfo[0].shape;
2817 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
2818 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_5 = 0;
2819 if (unlikely(__pyx_t_5 != -1)) {
2820 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2821 __PYX_ERR(0, 31, __pyx_L1_error)
2823 *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_v.diminfo[0].strides) = __pyx_v_y;
2834 if (__pyx_t_4 < 0) {
2835 __pyx_t_4 += __pyx_pybuffernd_v.diminfo[0].shape;
2836 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 0;
2837 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_5 = 0;
2838 if (unlikely(__pyx_t_5 != -1)) {
2839 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2840 __PYX_ERR(0, 32, __pyx_L1_error)
2842 *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_v.diminfo[0].strides) = __pyx_v_z;
2851 __Pyx_XDECREF(((PyObject *)__pyx_r));
2852 __Pyx_INCREF(((PyObject *)__pyx_v_v));
2853 __pyx_r = ((PyArrayObject *)__pyx_v_v);
2866 __Pyx_XDECREF(__pyx_t_1);
2867 __Pyx_XDECREF(__pyx_t_2);
2868 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
2869 __Pyx_PyThreadState_declare
2870 __Pyx_PyThreadState_assign
2871 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
2872 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
2873 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
2874 __Pyx_AddTraceback(
"Isosurface.EVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
2878 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
2880 __Pyx_XDECREF((PyObject *)__pyx_v_v);
2881 __Pyx_XGIVEREF((PyObject *)__pyx_r);
2882 __Pyx_RefNannyFinishContext();
2894 static double __pyx_f_10Isosurface_enorm(PyArrayObject *__pyx_v_v) {
2895 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
2896 __Pyx_Buffer __pyx_pybuffer_v;
2898 __Pyx_RefNannyDeclarations
2899 Py_ssize_t __pyx_t_1;
2901 Py_ssize_t __pyx_t_3;
2902 Py_ssize_t __pyx_t_4;
2903 int __pyx_lineno = 0;
2904 const char *__pyx_filename = NULL;
2905 int __pyx_clineno = 0;
2906 __Pyx_RefNannySetupContext(
"enorm", 0);
2907 __pyx_pybuffer_v.pybuffer.buf = NULL;
2908 __pyx_pybuffer_v.refcount = 0;
2909 __pyx_pybuffernd_v.data = NULL;
2910 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
2912 __Pyx_BufFmt_StackElem __pyx_stack[1];
2913 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 35, __pyx_L1_error)
2915 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0];
2926 if (__pyx_t_1 < 0) {
2927 __pyx_t_1 += __pyx_pybuffernd_v.diminfo[0].shape;
2928 if (unlikely(__pyx_t_1 < 0)) __pyx_t_2 = 0;
2929 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_2 = 0;
2930 if (unlikely(__pyx_t_2 != -1)) {
2931 __Pyx_RaiseBufferIndexError(__pyx_t_2);
2932 __PYX_ERR(0, 36, __pyx_L1_error)
2936 if (__pyx_t_3 < 0) {
2937 __pyx_t_3 += __pyx_pybuffernd_v.diminfo[0].shape;
2938 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
2939 }
else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_2 = 0;
2940 if (unlikely(__pyx_t_2 != -1)) {
2941 __Pyx_RaiseBufferIndexError(__pyx_t_2);
2942 __PYX_ERR(0, 36, __pyx_L1_error)
2946 if (__pyx_t_4 < 0) {
2947 __pyx_t_4 += __pyx_pybuffernd_v.diminfo[0].shape;
2948 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
2949 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_2 = 0;
2950 if (unlikely(__pyx_t_2 != -1)) {
2951 __Pyx_RaiseBufferIndexError(__pyx_t_2);
2952 __PYX_ERR(0, 36, __pyx_L1_error)
2954 __pyx_r = sqrt(((pow((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_v.diminfo[0].strides)), 2.0) + pow((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_v.diminfo[0].strides)), 2.0)) + pow((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_v.diminfo[0].strides)), 2.0)));
2967 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
2968 __Pyx_PyThreadState_declare
2969 __Pyx_PyThreadState_assign
2970 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
2971 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
2972 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
2973 __Pyx_WriteUnraisable(
"Isosurface.enorm", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
2977 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
2979 __Pyx_RefNannyFinishContext();
2991 static double __pyx_f_10Isosurface_edot(PyArrayObject *__pyx_v_v0, PyArrayObject *__pyx_v_v1) {
2992 __Pyx_LocalBuf_ND __pyx_pybuffernd_v0;
2993 __Pyx_Buffer __pyx_pybuffer_v0;
2994 __Pyx_LocalBuf_ND __pyx_pybuffernd_v1;
2995 __Pyx_Buffer __pyx_pybuffer_v1;
2997 __Pyx_RefNannyDeclarations
2998 Py_ssize_t __pyx_t_1;
3000 Py_ssize_t __pyx_t_3;
3001 Py_ssize_t __pyx_t_4;
3002 Py_ssize_t __pyx_t_5;
3003 Py_ssize_t __pyx_t_6;
3004 Py_ssize_t __pyx_t_7;
3005 int __pyx_lineno = 0;
3006 const char *__pyx_filename = NULL;
3007 int __pyx_clineno = 0;
3008 __Pyx_RefNannySetupContext(
"edot", 0);
3009 __pyx_pybuffer_v0.pybuffer.buf = NULL;
3010 __pyx_pybuffer_v0.refcount = 0;
3011 __pyx_pybuffernd_v0.data = NULL;
3012 __pyx_pybuffernd_v0.rcbuffer = &__pyx_pybuffer_v0;
3013 __pyx_pybuffer_v1.pybuffer.buf = NULL;
3014 __pyx_pybuffer_v1.refcount = 0;
3015 __pyx_pybuffernd_v1.data = NULL;
3016 __pyx_pybuffernd_v1.rcbuffer = &__pyx_pybuffer_v1;
3018 __Pyx_BufFmt_StackElem __pyx_stack[1];
3019 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v0.rcbuffer->pybuffer, (PyObject*)__pyx_v_v0, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 38, __pyx_L1_error)
3021 __pyx_pybuffernd_v0.diminfo[0].strides = __pyx_pybuffernd_v0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v0.diminfo[0].shape = __pyx_pybuffernd_v0.rcbuffer->pybuffer.shape[0];
3023 __Pyx_BufFmt_StackElem __pyx_stack[1];
3024 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_v_v1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 38, __pyx_L1_error)
3026 __pyx_pybuffernd_v1.diminfo[0].strides = __pyx_pybuffernd_v1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v1.diminfo[0].shape = __pyx_pybuffernd_v1.rcbuffer->pybuffer.shape[0];
3037 if (__pyx_t_1 < 0) {
3038 __pyx_t_1 += __pyx_pybuffernd_v0.diminfo[0].shape;
3039 if (unlikely(__pyx_t_1 < 0)) __pyx_t_2 = 0;
3040 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_v0.diminfo[0].shape)) __pyx_t_2 = 0;
3041 if (unlikely(__pyx_t_2 != -1)) {
3042 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3043 __PYX_ERR(0, 39, __pyx_L1_error)
3047 if (__pyx_t_3 < 0) {
3048 __pyx_t_3 += __pyx_pybuffernd_v1.diminfo[0].shape;
3049 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
3050 }
else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_2 = 0;
3051 if (unlikely(__pyx_t_2 != -1)) {
3052 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3053 __PYX_ERR(0, 39, __pyx_L1_error)
3057 if (__pyx_t_4 < 0) {
3058 __pyx_t_4 += __pyx_pybuffernd_v0.diminfo[0].shape;
3059 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
3060 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_v0.diminfo[0].shape)) __pyx_t_2 = 0;
3061 if (unlikely(__pyx_t_2 != -1)) {
3062 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3063 __PYX_ERR(0, 39, __pyx_L1_error)
3067 if (__pyx_t_5 < 0) {
3068 __pyx_t_5 += __pyx_pybuffernd_v1.diminfo[0].shape;
3069 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
3070 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_2 = 0;
3071 if (unlikely(__pyx_t_2 != -1)) {
3072 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3073 __PYX_ERR(0, 39, __pyx_L1_error)
3077 if (__pyx_t_6 < 0) {
3078 __pyx_t_6 += __pyx_pybuffernd_v0.diminfo[0].shape;
3079 if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
3080 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_v0.diminfo[0].shape)) __pyx_t_2 = 0;
3081 if (unlikely(__pyx_t_2 != -1)) {
3082 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3083 __PYX_ERR(0, 39, __pyx_L1_error)
3087 if (__pyx_t_7 < 0) {
3088 __pyx_t_7 += __pyx_pybuffernd_v1.diminfo[0].shape;
3089 if (unlikely(__pyx_t_7 < 0)) __pyx_t_2 = 0;
3090 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_2 = 0;
3091 if (unlikely(__pyx_t_2 != -1)) {
3092 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3093 __PYX_ERR(0, 39, __pyx_L1_error)
3095 __pyx_r = ((((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v0.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_v0.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v1.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_v1.diminfo[0].strides))) + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v0.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_v0.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v1.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_v1.diminfo[0].strides)))) + ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_v0.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v1.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_v1.diminfo[0].strides))));
3108 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3109 __Pyx_PyThreadState_declare
3110 __Pyx_PyThreadState_assign
3111 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3112 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v0.rcbuffer->pybuffer);
3113 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
3114 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3115 __Pyx_WriteUnraisable(
"Isosurface.edot", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
3119 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v0.rcbuffer->pybuffer);
3120 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
3122 __Pyx_RefNannyFinishContext();
3134 static PyArrayObject *__pyx_f_10Isosurface_ecross(PyArrayObject *__pyx_v_v0, PyArrayObject *__pyx_v_v1) {
3135 __Pyx_LocalBuf_ND __pyx_pybuffernd_v0;
3136 __Pyx_Buffer __pyx_pybuffer_v0;
3137 __Pyx_LocalBuf_ND __pyx_pybuffernd_v1;
3138 __Pyx_Buffer __pyx_pybuffer_v1;
3139 PyArrayObject *__pyx_r = NULL;
3140 __Pyx_RefNannyDeclarations
3141 Py_ssize_t __pyx_t_1;
3143 Py_ssize_t __pyx_t_3;
3144 Py_ssize_t __pyx_t_4;
3145 Py_ssize_t __pyx_t_5;
3146 Py_ssize_t __pyx_t_6;
3147 Py_ssize_t __pyx_t_7;
3148 Py_ssize_t __pyx_t_8;
3149 Py_ssize_t __pyx_t_9;
3150 Py_ssize_t __pyx_t_10;
3151 Py_ssize_t __pyx_t_11;
3152 Py_ssize_t __pyx_t_12;
3153 Py_ssize_t __pyx_t_13;
3154 PyObject *__pyx_t_14 = NULL;
3155 struct __pyx_opt_args_10Isosurface_EVec __pyx_t_15;
3156 int __pyx_lineno = 0;
3157 const char *__pyx_filename = NULL;
3158 int __pyx_clineno = 0;
3159 __Pyx_RefNannySetupContext(
"ecross", 0);
3160 __pyx_pybuffer_v0.pybuffer.buf = NULL;
3161 __pyx_pybuffer_v0.refcount = 0;
3162 __pyx_pybuffernd_v0.data = NULL;
3163 __pyx_pybuffernd_v0.rcbuffer = &__pyx_pybuffer_v0;
3164 __pyx_pybuffer_v1.pybuffer.buf = NULL;
3165 __pyx_pybuffer_v1.refcount = 0;
3166 __pyx_pybuffernd_v1.data = NULL;
3167 __pyx_pybuffernd_v1.rcbuffer = &__pyx_pybuffer_v1;
3169 __Pyx_BufFmt_StackElem __pyx_stack[1];
3170 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v0.rcbuffer->pybuffer, (PyObject*)__pyx_v_v0, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 41, __pyx_L1_error)
3172 __pyx_pybuffernd_v0.diminfo[0].strides = __pyx_pybuffernd_v0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v0.diminfo[0].shape = __pyx_pybuffernd_v0.rcbuffer->pybuffer.shape[0];
3174 __Pyx_BufFmt_StackElem __pyx_stack[1];
3175 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_v_v1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 41, __pyx_L1_error)
3177 __pyx_pybuffernd_v1.diminfo[0].strides = __pyx_pybuffernd_v1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v1.diminfo[0].shape = __pyx_pybuffernd_v1.rcbuffer->pybuffer.shape[0];
3186 __Pyx_XDECREF(((PyObject *)__pyx_r));
3189 if (__pyx_t_1 < 0) {
3190 __pyx_t_1 += __pyx_pybuffernd_v0.diminfo[0].shape;
3191 if (unlikely(__pyx_t_1 < 0)) __pyx_t_2 = 0;
3192 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_v0.diminfo[0].shape)) __pyx_t_2 = 0;
3193 if (unlikely(__pyx_t_2 != -1)) {
3194 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3195 __PYX_ERR(0, 42, __pyx_L1_error)
3199 if (__pyx_t_3 < 0) {
3200 __pyx_t_3 += __pyx_pybuffernd_v1.diminfo[0].shape;
3201 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
3202 }
else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_2 = 0;
3203 if (unlikely(__pyx_t_2 != -1)) {
3204 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3205 __PYX_ERR(0, 42, __pyx_L1_error)
3209 if (__pyx_t_4 < 0) {
3210 __pyx_t_4 += __pyx_pybuffernd_v0.diminfo[0].shape;
3211 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
3212 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_v0.diminfo[0].shape)) __pyx_t_2 = 0;
3213 if (unlikely(__pyx_t_2 != -1)) {
3214 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3215 __PYX_ERR(0, 42, __pyx_L1_error)
3219 if (__pyx_t_5 < 0) {
3220 __pyx_t_5 += __pyx_pybuffernd_v1.diminfo[0].shape;
3221 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
3222 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_2 = 0;
3223 if (unlikely(__pyx_t_2 != -1)) {
3224 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3225 __PYX_ERR(0, 42, __pyx_L1_error)
3237 if (__pyx_t_6 < 0) {
3238 __pyx_t_6 += __pyx_pybuffernd_v0.diminfo[0].shape;
3239 if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
3240 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_v0.diminfo[0].shape)) __pyx_t_2 = 0;
3241 if (unlikely(__pyx_t_2 != -1)) {
3242 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3243 __PYX_ERR(0, 43, __pyx_L1_error)
3247 if (__pyx_t_7 < 0) {
3248 __pyx_t_7 += __pyx_pybuffernd_v1.diminfo[0].shape;
3249 if (unlikely(__pyx_t_7 < 0)) __pyx_t_2 = 0;
3250 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_2 = 0;
3251 if (unlikely(__pyx_t_2 != -1)) {
3252 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3253 __PYX_ERR(0, 43, __pyx_L1_error)
3257 if (__pyx_t_8 < 0) {
3258 __pyx_t_8 += __pyx_pybuffernd_v0.diminfo[0].shape;
3259 if (unlikely(__pyx_t_8 < 0)) __pyx_t_2 = 0;
3260 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_v0.diminfo[0].shape)) __pyx_t_2 = 0;
3261 if (unlikely(__pyx_t_2 != -1)) {
3262 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3263 __PYX_ERR(0, 43, __pyx_L1_error)
3267 if (__pyx_t_9 < 0) {
3268 __pyx_t_9 += __pyx_pybuffernd_v1.diminfo[0].shape;
3269 if (unlikely(__pyx_t_9 < 0)) __pyx_t_2 = 0;
3270 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_2 = 0;
3271 if (unlikely(__pyx_t_2 != -1)) {
3272 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3273 __PYX_ERR(0, 43, __pyx_L1_error)
3285 if (__pyx_t_10 < 0) {
3286 __pyx_t_10 += __pyx_pybuffernd_v0.diminfo[0].shape;
3287 if (unlikely(__pyx_t_10 < 0)) __pyx_t_2 = 0;
3288 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_v0.diminfo[0].shape)) __pyx_t_2 = 0;
3289 if (unlikely(__pyx_t_2 != -1)) {
3290 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3291 __PYX_ERR(0, 44, __pyx_L1_error)
3295 if (__pyx_t_11 < 0) {
3296 __pyx_t_11 += __pyx_pybuffernd_v1.diminfo[0].shape;
3297 if (unlikely(__pyx_t_11 < 0)) __pyx_t_2 = 0;
3298 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_2 = 0;
3299 if (unlikely(__pyx_t_2 != -1)) {
3300 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3301 __PYX_ERR(0, 44, __pyx_L1_error)
3305 if (__pyx_t_12 < 0) {
3306 __pyx_t_12 += __pyx_pybuffernd_v0.diminfo[0].shape;
3307 if (unlikely(__pyx_t_12 < 0)) __pyx_t_2 = 0;
3308 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v0.diminfo[0].shape)) __pyx_t_2 = 0;
3309 if (unlikely(__pyx_t_2 != -1)) {
3310 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3311 __PYX_ERR(0, 44, __pyx_L1_error)
3315 if (__pyx_t_13 < 0) {
3316 __pyx_t_13 += __pyx_pybuffernd_v1.diminfo[0].shape;
3317 if (unlikely(__pyx_t_13 < 0)) __pyx_t_2 = 0;
3318 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_2 = 0;
3319 if (unlikely(__pyx_t_2 != -1)) {
3320 __Pyx_RaiseBufferIndexError(__pyx_t_2);
3321 __PYX_ERR(0, 44, __pyx_L1_error)
3331 __pyx_t_15.__pyx_n = 3;
3332 __pyx_t_15.x = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v0.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_v0.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v1.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_v1.diminfo[0].strides))) - ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v0.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_v0.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v1.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_v1.diminfo[0].strides))));
3333 __pyx_t_15.y = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v0.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_v0.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v1.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_v1.diminfo[0].strides))) - ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v0.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_v0.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v1.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_v1.diminfo[0].strides))));
3334 __pyx_t_15.z = (((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v0.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_v0.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v1.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_v1.diminfo[0].strides))) - ((*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v0.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_v0.diminfo[0].strides)) * (*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v1.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_v1.diminfo[0].strides))));
3335 __pyx_t_14 = ((PyObject *)__pyx_f_10Isosurface_EVec(&__pyx_t_15));
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 42, __pyx_L1_error)
3336 __Pyx_GOTREF(__pyx_t_14);
3337 __pyx_r = ((PyArrayObject *)__pyx_t_14);
3351 __Pyx_XDECREF(__pyx_t_14);
3352 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3353 __Pyx_PyThreadState_declare
3354 __Pyx_PyThreadState_assign
3355 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3356 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v0.rcbuffer->pybuffer);
3357 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
3358 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3359 __Pyx_AddTraceback(
"Isosurface.ecross", __pyx_clineno, __pyx_lineno, __pyx_filename);
3363 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v0.rcbuffer->pybuffer);
3364 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
3366 __Pyx_XGIVEREF((PyObject *)__pyx_r);
3367 __Pyx_RefNannyFinishContext();
3379 static double __pyx_f_10Isosurface_etriple(PyArrayObject *__pyx_v_v0, PyArrayObject *__pyx_v_v1, PyArrayObject *__pyx_v_v2) {
3380 __Pyx_LocalBuf_ND __pyx_pybuffernd_v0;
3381 __Pyx_Buffer __pyx_pybuffer_v0;
3382 __Pyx_LocalBuf_ND __pyx_pybuffernd_v1;
3383 __Pyx_Buffer __pyx_pybuffer_v1;
3384 __Pyx_LocalBuf_ND __pyx_pybuffernd_v2;
3385 __Pyx_Buffer __pyx_pybuffer_v2;
3387 __Pyx_RefNannyDeclarations
3388 PyObject *__pyx_t_1 = NULL;
3389 int __pyx_lineno = 0;
3390 const char *__pyx_filename = NULL;
3391 int __pyx_clineno = 0;
3392 __Pyx_RefNannySetupContext(
"etriple", 0);
3393 __pyx_pybuffer_v0.pybuffer.buf = NULL;
3394 __pyx_pybuffer_v0.refcount = 0;
3395 __pyx_pybuffernd_v0.data = NULL;
3396 __pyx_pybuffernd_v0.rcbuffer = &__pyx_pybuffer_v0;
3397 __pyx_pybuffer_v1.pybuffer.buf = NULL;
3398 __pyx_pybuffer_v1.refcount = 0;
3399 __pyx_pybuffernd_v1.data = NULL;
3400 __pyx_pybuffernd_v1.rcbuffer = &__pyx_pybuffer_v1;
3401 __pyx_pybuffer_v2.pybuffer.buf = NULL;
3402 __pyx_pybuffer_v2.refcount = 0;
3403 __pyx_pybuffernd_v2.data = NULL;
3404 __pyx_pybuffernd_v2.rcbuffer = &__pyx_pybuffer_v2;
3406 __Pyx_BufFmt_StackElem __pyx_stack[1];
3407 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v0.rcbuffer->pybuffer, (PyObject*)__pyx_v_v0, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 46, __pyx_L1_error)
3409 __pyx_pybuffernd_v0.diminfo[0].strides = __pyx_pybuffernd_v0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v0.diminfo[0].shape = __pyx_pybuffernd_v0.rcbuffer->pybuffer.shape[0];
3411 __Pyx_BufFmt_StackElem __pyx_stack[1];
3412 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v1.rcbuffer->pybuffer, (PyObject*)__pyx_v_v1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 46, __pyx_L1_error)
3414 __pyx_pybuffernd_v1.diminfo[0].strides = __pyx_pybuffernd_v1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v1.diminfo[0].shape = __pyx_pybuffernd_v1.rcbuffer->pybuffer.shape[0];
3416 __Pyx_BufFmt_StackElem __pyx_stack[1];
3417 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v2.rcbuffer->pybuffer, (PyObject*)__pyx_v_v2, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 46, __pyx_L1_error)
3419 __pyx_pybuffernd_v2.diminfo[0].strides = __pyx_pybuffernd_v2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v2.diminfo[0].shape = __pyx_pybuffernd_v2.rcbuffer->pybuffer.shape[0];
3428 __pyx_t_1 = ((PyObject *)__pyx_f_10Isosurface_ecross(((PyArrayObject *)__pyx_v_v1), ((PyArrayObject *)__pyx_v_v2)));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
3429 __Pyx_GOTREF(__pyx_t_1);
3430 __pyx_r = __pyx_f_10Isosurface_edot(((PyArrayObject *)__pyx_v_v0), ((PyArrayObject *)__pyx_t_1));
3431 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3444 __Pyx_XDECREF(__pyx_t_1);
3445 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3446 __Pyx_PyThreadState_declare
3447 __Pyx_PyThreadState_assign
3448 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3449 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v0.rcbuffer->pybuffer);
3450 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
3451 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v2.rcbuffer->pybuffer);
3452 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3453 __Pyx_WriteUnraisable(
"Isosurface.etriple", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
3457 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v0.rcbuffer->pybuffer);
3458 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
3459 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v2.rcbuffer->pybuffer);
3461 __Pyx_RefNannyFinishContext();
3474 static PyObject *__pyx_pw_10Isosurface_10Isosurface_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3475 static char __pyx_doc_10Isosurface_10Isosurface___init__[] =
"Isosurface.__init__(self, isosurfaces, domain, activeTime=None, sampleRate=0, format='pov', writeBoundary=True)\nCreate a set of isosurfaces that will be extracted and serialized\n\n :param isosurfaces: An iterable of \"isosurfaces\". Each isosurface is\n specified by a 2-tuple, with the first element in the tuple is a field\n from which to extract isosurfaces, and the second element is an n-tuple\n of isosurface values to extract.\n\n :param domain: a Domain object\n\n :param activeTime: If not None, a 2-tuple of start time and end time\n for which the point gauge is active.\n\n :param sampleRate: The intervals at which samples should be measured.\n Note that this is a rough lower bound, and that the gauge values could\n be computed less frequently depending on the time integrator. The\n default value of zero computes the gauge values at every time step.\n\n :param format: the file format for the isosurfaces ('pov', None).\n\n :param writeBoundary: whether to write the boundary mesh to or the\n domain bounding box\n\n Example:\n\n phi0 = (isosurfaces=('phi', (0.0,)),\n activeTime=(0, 2.5),\n sampleRate=0.2,\n fileName='water.pov')\n\n This creates an Isosurfaces object that will extract phi(x,y,z,t) = 0\n at simulation time between = 0 and 2.5 with samples taken no more\n frequently than every 0.2 seconds. Results will be saved to:\n water.pov.\n\n ";
3476 static PyMethodDef __pyx_mdef_10Isosurface_10Isosurface_1__init__ = {
"__init__", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10Isosurface_10Isosurface_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10Isosurface_10Isosurface___init__};
3477 static PyObject *__pyx_pw_10Isosurface_10Isosurface_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3478 PyObject *__pyx_v_self = 0;
3479 PyObject *__pyx_v_isosurfaces = 0;
3480 PyObject *__pyx_v_domain = 0;
3481 PyObject *__pyx_v_activeTime = 0;
3482 PyObject *__pyx_v_sampleRate = 0;
3483 PyObject *__pyx_v_format = 0;
3484 PyObject *__pyx_v_writeBoundary = 0;
3485 int __pyx_lineno = 0;
3486 const char *__pyx_filename = NULL;
3487 int __pyx_clineno = 0;
3488 PyObject *__pyx_r = 0;
3489 __Pyx_RefNannyDeclarations
3490 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
3492 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_isosurfaces,&__pyx_n_s_domain,&__pyx_n_s_activeTime,&__pyx_n_s_sampleRate,&__pyx_n_s_format,&__pyx_n_s_writeBoundary,0};
3493 PyObject* values[7] = {0,0,0,0,0,0,0};
3494 values[3] = ((PyObject *)((PyObject *)Py_None));
3495 values[4] = ((PyObject *)((PyObject *)__pyx_int_0));
3496 values[5] = ((PyObject *)((PyObject*)__pyx_n_s_pov));
3505 values[6] = ((PyObject *)((PyObject *)Py_True));
3506 if (unlikely(__pyx_kwds)) {
3508 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3510 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3512 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3514 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3516 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3518 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3520 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3522 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3525 default:
goto __pyx_L5_argtuple_error;
3527 kw_args = PyDict_Size(__pyx_kwds);
3530 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
3531 else goto __pyx_L5_argtuple_error;
3534 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isosurfaces)) != 0)) kw_args--;
3536 __Pyx_RaiseArgtupleInvalid(
"__init__", 0, 3, 7, 1); __PYX_ERR(0, 54, __pyx_L3_error)
3540 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_domain)) != 0)) kw_args--;
3542 __Pyx_RaiseArgtupleInvalid(
"__init__", 0, 3, 7, 2); __PYX_ERR(0, 54, __pyx_L3_error)
3547 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_activeTime);
3548 if (value) { values[3] = value; kw_args--; }
3553 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sampleRate);
3554 if (value) { values[4] = value; kw_args--; }
3559 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format);
3560 if (value) { values[5] = value; kw_args--; }
3565 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_writeBoundary);
3566 if (value) { values[6] = value; kw_args--; }
3569 if (unlikely(kw_args > 0)) {
3570 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(0, 54, __pyx_L3_error)
3573 switch (PyTuple_GET_SIZE(__pyx_args)) {
3574 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3576 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3578 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3580 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3582 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3583 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3584 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3586 default:
goto __pyx_L5_argtuple_error;
3589 __pyx_v_self = values[0];
3590 __pyx_v_isosurfaces = values[1];
3591 __pyx_v_domain = values[2];
3592 __pyx_v_activeTime = values[3];
3593 __pyx_v_sampleRate = values[4];
3594 __pyx_v_format = values[5];
3595 __pyx_v_writeBoundary = values[6];
3597 goto __pyx_L4_argument_unpacking_done;
3598 __pyx_L5_argtuple_error:;
3599 __Pyx_RaiseArgtupleInvalid(
"__init__", 0, 3, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 54, __pyx_L3_error)
3601 __Pyx_AddTraceback(
"Isosurface.Isosurface.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3602 __Pyx_RefNannyFinishContext();
3604 __pyx_L4_argument_unpacking_done:;
3605 __pyx_r = __pyx_pf_10Isosurface_10Isosurface___init__(__pyx_self, __pyx_v_self, __pyx_v_isosurfaces, __pyx_v_domain, __pyx_v_activeTime, __pyx_v_sampleRate, __pyx_v_format, __pyx_v_writeBoundary);
3616 __Pyx_RefNannyFinishContext();
3620 static PyObject *__pyx_pf_10Isosurface_10Isosurface___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_isosurfaces, PyObject *__pyx_v_domain, PyObject *__pyx_v_activeTime, PyObject *__pyx_v_sampleRate, PyObject *__pyx_v_format, PyObject *__pyx_v_writeBoundary) {
3621 CYTHON_UNUSED PyObject *__pyx_v_f = NULL;
3622 PyObject *__pyx_v_values = NULL;
3623 PyObject *__pyx_v_v = NULL;
3624 PyObject *__pyx_r = NULL;
3625 __Pyx_RefNannyDeclarations
3626 PyObject *__pyx_t_1 = NULL;
3627 PyObject *__pyx_t_2 = NULL;
3628 Py_ssize_t __pyx_t_3;
3629 PyObject *(*__pyx_t_4)(PyObject *);
3630 PyObject *__pyx_t_5 = NULL;
3631 PyObject *__pyx_t_6 = NULL;
3632 PyObject *__pyx_t_7 = NULL;
3633 PyObject *(*__pyx_t_8)(PyObject *);
3634 Py_ssize_t __pyx_t_9;
3635 PyObject *(*__pyx_t_10)(PyObject *);
3637 int __pyx_lineno = 0;
3638 const char *__pyx_filename = NULL;
3639 int __pyx_clineno = 0;
3640 __Pyx_RefNannySetupContext(
"__init__", 0);
3649 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_isosurfaces, __pyx_v_isosurfaces) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
3658 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_domain, __pyx_v_domain) < 0) __PYX_ERR(0, 92, __pyx_L1_error)
3667 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)
3668 __Pyx_GOTREF(__pyx_t_1);
3669 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nodes, __pyx_t_1) < 0) __PYX_ERR(0, 93, __pyx_L1_error)
3670 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3679 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
3680 __Pyx_GOTREF(__pyx_t_1);
3681 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_elements, __pyx_t_1) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
3682 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3691 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
3692 __Pyx_GOTREF(__pyx_t_1);
3693 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_normals, __pyx_t_1) < 0) __PYX_ERR(0, 95, __pyx_L1_error)
3694 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3703 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
3704 __Pyx_GOTREF(__pyx_t_1);
3705 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_normal_indices, __pyx_t_1) < 0) __PYX_ERR(0, 96, __pyx_L1_error)
3706 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3715 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_isosurfaces);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
3716 __Pyx_GOTREF(__pyx_t_1);
3717 if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
3718 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
3721 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
3722 __Pyx_GOTREF(__pyx_t_2);
3723 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
3725 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3727 if (likely(!__pyx_t_4)) {
3728 if (likely(PyList_CheckExact(__pyx_t_2))) {
3729 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2))
break;
3730 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3731 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 97, __pyx_L1_error)
3733 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
3734 __Pyx_GOTREF(__pyx_t_1);
3737 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
3738 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3739 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 97, __pyx_L1_error)
3741 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
3742 __Pyx_GOTREF(__pyx_t_1);
3746 __pyx_t_1 = __pyx_t_4(__pyx_t_2);
3747 if (unlikely(!__pyx_t_1)) {
3748 PyObject* exc_type = PyErr_Occurred();
3750 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3751 else __PYX_ERR(0, 97, __pyx_L1_error)
3755 __Pyx_GOTREF(__pyx_t_1);
3757 if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
3758 PyObject* sequence = __pyx_t_1;
3759 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
3760 if (unlikely(size != 2)) {
3761 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
3762 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
3763 __PYX_ERR(0, 97, __pyx_L1_error)
3765 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3766 if (likely(PyTuple_CheckExact(sequence))) {
3767 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
3768 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
3770 __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
3771 __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
3773 __Pyx_INCREF(__pyx_t_5);
3774 __Pyx_INCREF(__pyx_t_6);
3776 __pyx_t_5 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error)
3777 __Pyx_GOTREF(__pyx_t_5);
3778 __pyx_t_6 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 97, __pyx_L1_error)
3779 __Pyx_GOTREF(__pyx_t_6);
3781 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3783 Py_ssize_t index = -1;
3784 __pyx_t_7 = PyObject_GetIter(__pyx_t_1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 97, __pyx_L1_error)
3785 __Pyx_GOTREF(__pyx_t_7);
3786 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3787 __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
3788 index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7);
if (unlikely(!__pyx_t_5))
goto __pyx_L5_unpacking_failed;
3789 __Pyx_GOTREF(__pyx_t_5);
3790 index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7);
if (unlikely(!__pyx_t_6))
goto __pyx_L5_unpacking_failed;
3791 __Pyx_GOTREF(__pyx_t_6);
3792 if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
3794 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3795 goto __pyx_L6_unpacking_done;
3796 __pyx_L5_unpacking_failed:;
3797 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3799 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
3800 __PYX_ERR(0, 97, __pyx_L1_error)
3801 __pyx_L6_unpacking_done:;
3803 __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_5);
3805 __Pyx_XDECREF_SET(__pyx_v_values, __pyx_t_6);
3815 if (likely(PyList_CheckExact(__pyx_v_values)) || PyTuple_CheckExact(__pyx_v_values)) {
3816 __pyx_t_1 = __pyx_v_values; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
3819 __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_values);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
3820 __Pyx_GOTREF(__pyx_t_1);
3821 __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext;
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 98, __pyx_L1_error)
3824 if (likely(!__pyx_t_10)) {
3825 if (likely(PyList_CheckExact(__pyx_t_1))) {
3826 if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1))
break;
3827 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3828 __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 98, __pyx_L1_error)
3830 __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 98, __pyx_L1_error)
3831 __Pyx_GOTREF(__pyx_t_6);
3834 if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
3835 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3836 __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 98, __pyx_L1_error)
3838 __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 98, __pyx_L1_error)
3839 __Pyx_GOTREF(__pyx_t_6);
3843 __pyx_t_6 = __pyx_t_10(__pyx_t_1);
3844 if (unlikely(!__pyx_t_6)) {
3845 PyObject* exc_type = PyErr_Occurred();
3847 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3848 else __PYX_ERR(0, 98, __pyx_L1_error)
3852 __Pyx_GOTREF(__pyx_t_6);
3854 __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6);
3864 #ifndef CYTHON_WITHOUT_ASSERTIONS
3865 if (unlikely(!Py_OptimizeFlag)) {
3866 __pyx_t_6 = __Pyx_PyFloat_EqObjC(__pyx_v_v, __pyx_float_0_0, 0.0, 0, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 99, __pyx_L1_error)
3867 __Pyx_GOTREF(__pyx_t_6);
3868 __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6);
if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 99, __pyx_L1_error)
3869 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3870 if (unlikely(!__pyx_t_11)) {
3871 PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_only_implemented_for_0_isosurfac);
3872 __PYX_ERR(0, 99, __pyx_L1_error)
3885 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3895 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3904 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_activeTime, __pyx_v_activeTime) < 0) __PYX_ERR(0, 101, __pyx_L1_error)
3913 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sampleRate, __pyx_v_sampleRate) < 0) __PYX_ERR(0, 102, __pyx_L1_error)
3922 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_format, __pyx_v_format) < 0) __PYX_ERR(0, 103, __pyx_L1_error)
3931 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Comm);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
3932 __Pyx_GOTREF(__pyx_t_1);
3933 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 104, __pyx_L1_error)
3934 __Pyx_GOTREF(__pyx_t_6);
3935 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3937 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
3938 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
3939 if (likely(__pyx_t_1)) {
3940 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
3941 __Pyx_INCREF(__pyx_t_1);
3942 __Pyx_INCREF(
function);
3943 __Pyx_DECREF_SET(__pyx_t_6,
function);
3946 __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
3947 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3948 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error)
3949 __Pyx_GOTREF(__pyx_t_2);
3950 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3951 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_comm, __pyx_t_2) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
3952 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3961 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_writeBoundary, __pyx_v_writeBoundary) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
3970 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_fileprefix, __pyx_n_s_isosurface) < 0) __PYX_ERR(0, 106, __pyx_L1_error)
3981 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3984 __Pyx_XDECREF(__pyx_t_1);
3985 __Pyx_XDECREF(__pyx_t_2);
3986 __Pyx_XDECREF(__pyx_t_5);
3987 __Pyx_XDECREF(__pyx_t_6);
3988 __Pyx_XDECREF(__pyx_t_7);
3989 __Pyx_AddTraceback(
"Isosurface.Isosurface.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3992 __Pyx_XDECREF(__pyx_v_f);
3993 __Pyx_XDECREF(__pyx_v_values);
3994 __Pyx_XDECREF(__pyx_v_v);
3995 __Pyx_XGIVEREF(__pyx_r);
3996 __Pyx_RefNannyFinishContext();
4009 static PyObject *__pyx_pw_10Isosurface_10Isosurface_3attachModel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4010 static char __pyx_doc_10Isosurface_10Isosurface_2attachModel[] =
"Isosurface.attachModel(self, model, ar)\n Attach this isosurface to the given simulation model.\n ";
4011 static PyMethodDef __pyx_mdef_10Isosurface_10Isosurface_3attachModel = {
"attachModel", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10Isosurface_10Isosurface_3attachModel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10Isosurface_10Isosurface_2attachModel};
4012 static PyObject *__pyx_pw_10Isosurface_10Isosurface_3attachModel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4013 PyObject *__pyx_v_self = 0;
4014 PyObject *__pyx_v_model = 0;
4015 CYTHON_UNUSED PyObject *__pyx_v_ar = 0;
4016 int __pyx_lineno = 0;
4017 const char *__pyx_filename = NULL;
4018 int __pyx_clineno = 0;
4019 PyObject *__pyx_r = 0;
4020 __Pyx_RefNannyDeclarations
4021 __Pyx_RefNannySetupContext(
"attachModel (wrapper)", 0);
4023 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_model,&__pyx_n_s_ar,0};
4024 PyObject* values[3] = {0,0,0};
4025 if (unlikely(__pyx_kwds)) {
4027 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4029 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4031 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4033 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4036 default:
goto __pyx_L5_argtuple_error;
4038 kw_args = PyDict_Size(__pyx_kwds);
4041 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
4042 else goto __pyx_L5_argtuple_error;
4045 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_model)) != 0)) kw_args--;
4047 __Pyx_RaiseArgtupleInvalid(
"attachModel", 1, 3, 3, 1); __PYX_ERR(0, 108, __pyx_L3_error)
4051 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ar)) != 0)) kw_args--;
4053 __Pyx_RaiseArgtupleInvalid(
"attachModel", 1, 3, 3, 2); __PYX_ERR(0, 108, __pyx_L3_error)
4056 if (unlikely(kw_args > 0)) {
4057 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"attachModel") < 0)) __PYX_ERR(0, 108, __pyx_L3_error)
4059 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
4060 goto __pyx_L5_argtuple_error;
4062 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4063 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4064 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4066 __pyx_v_self = values[0];
4067 __pyx_v_model = values[1];
4068 __pyx_v_ar = values[2];
4070 goto __pyx_L4_argument_unpacking_done;
4071 __pyx_L5_argtuple_error:;
4072 __Pyx_RaiseArgtupleInvalid(
"attachModel", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 108, __pyx_L3_error)
4074 __Pyx_AddTraceback(
"Isosurface.Isosurface.attachModel", __pyx_clineno, __pyx_lineno, __pyx_filename);
4075 __Pyx_RefNannyFinishContext();
4077 __pyx_L4_argument_unpacking_done:;
4078 __pyx_r = __pyx_pf_10Isosurface_10Isosurface_2attachModel(__pyx_self, __pyx_v_self, __pyx_v_model, __pyx_v_ar);
4081 __Pyx_RefNannyFinishContext();
4084 static PyObject *__pyx_gb_10Isosurface_10Isosurface_11attachModel_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value);
4094 static PyObject *__pyx_pf_10Isosurface_10Isosurface_11attachModel_genexpr(PyObject *__pyx_self) {
4095 struct __pyx_obj_10Isosurface___pyx_scope_struct_1_genexpr *__pyx_cur_scope;
4096 PyObject *__pyx_r = NULL;
4097 __Pyx_RefNannyDeclarations
4098 int __pyx_lineno = 0;
4099 const char *__pyx_filename = NULL;
4100 int __pyx_clineno = 0;
4101 __Pyx_RefNannySetupContext(
"genexpr", 0);
4102 __pyx_cur_scope = (
struct __pyx_obj_10Isosurface___pyx_scope_struct_1_genexpr *)__pyx_tp_new_10Isosurface___pyx_scope_struct_1_genexpr(__pyx_ptype_10Isosurface___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
4103 if (unlikely(!__pyx_cur_scope)) {
4104 __pyx_cur_scope = ((
struct __pyx_obj_10Isosurface___pyx_scope_struct_1_genexpr *)Py_None);
4105 __Pyx_INCREF(Py_None);
4106 __PYX_ERR(0, 125, __pyx_L1_error)
4108 __Pyx_GOTREF(__pyx_cur_scope);
4110 __pyx_cur_scope->__pyx_outer_scope = (
struct __pyx_obj_10Isosurface___pyx_scope_struct__attachModel *) __pyx_self;
4111 __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
4112 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
4114 __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10Isosurface_10Isosurface_11attachModel_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Isosurface_attachModel_locals_ge, __pyx_n_s_Isosurface);
if (unlikely(!gen)) __PYX_ERR(0, 125, __pyx_L1_error)
4115 __Pyx_DECREF(__pyx_cur_scope);
4116 __Pyx_RefNannyFinishContext();
4117 return (PyObject *) gen;
4122 __Pyx_AddTraceback(
"Isosurface.Isosurface.attachModel.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
4124 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4125 __Pyx_XGIVEREF(__pyx_r);
4126 __Pyx_RefNannyFinishContext();
4130 static PyObject *__pyx_gb_10Isosurface_10Isosurface_11attachModel_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value)
4132 struct __pyx_obj_10Isosurface___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((
struct __pyx_obj_10Isosurface___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
4133 PyObject *__pyx_r = NULL;
4134 PyObject *__pyx_t_1 = NULL;
4135 PyObject *__pyx_t_2 = NULL;
4136 PyObject *__pyx_t_3 = NULL;
4137 Py_ssize_t __pyx_t_4;
4138 PyObject *(*__pyx_t_5)(PyObject *);
4139 int __pyx_lineno = 0;
4140 const char *__pyx_filename = NULL;
4141 int __pyx_clineno = 0;
4142 __Pyx_RefNannyDeclarations
4143 __Pyx_RefNannySetupContext(
"genexpr", 0);
4144 switch (__pyx_generator->resume_label) {
4145 case 0:
goto __pyx_L3_first_run;
4147 __Pyx_RefNannyFinishContext();
4150 __pyx_L3_first_run:;
4151 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 125, __pyx_L1_error)
4152 __pyx_r = PyDict_New();
if (unlikely(!__pyx_r)) __PYX_ERR(0, 125, __pyx_L1_error)
4153 __Pyx_GOTREF(__pyx_r);
4154 __Pyx_INCREF(__pyx_int_0);
4155 __pyx_t_1 = __pyx_int_0;
4156 if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError(
"self"); __PYX_ERR(0, 125, __pyx_L1_error) }
4157 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_boundaryNodes);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
4158 __Pyx_GOTREF(__pyx_t_2);
4159 if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
4160 __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
4163 __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
4164 __Pyx_GOTREF(__pyx_t_3);
4165 __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 125, __pyx_L1_error)
4167 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4169 if (likely(!__pyx_t_5)) {
4170 if (likely(PyList_CheckExact(__pyx_t_3))) {
4171 if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3))
break;
4172 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4173 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
if (unlikely(0 < 0)) __PYX_ERR(0, 125, __pyx_L1_error)
4175 __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
4176 __Pyx_GOTREF(__pyx_t_2);
4179 if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
4180 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4181 __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
if (unlikely(0 < 0)) __PYX_ERR(0, 125, __pyx_L1_error)
4183 __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
4184 __Pyx_GOTREF(__pyx_t_2);
4188 __pyx_t_2 = __pyx_t_5(__pyx_t_3);
4189 if (unlikely(!__pyx_t_2)) {
4190 PyObject* exc_type = PyErr_Occurred();
4192 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
4193 else __PYX_ERR(0, 125, __pyx_L1_error)
4197 __Pyx_GOTREF(__pyx_t_2);
4199 __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_gn);
4200 __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_gn, __pyx_t_2);
4201 __Pyx_GIVEREF(__pyx_t_2);
4203 __Pyx_INCREF(__pyx_t_1);
4204 __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_bn);
4205 __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_bn, __pyx_t_1);
4206 __Pyx_GIVEREF(__pyx_t_1);
4207 __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
4208 __Pyx_GOTREF(__pyx_t_2);
4209 __Pyx_DECREF(__pyx_t_1);
4210 __pyx_t_1 = __pyx_t_2;
4212 if (unlikely(PyDict_SetItem(__pyx_r, (PyObject*)__pyx_cur_scope->__pyx_v_gn, (PyObject*)__pyx_cur_scope->__pyx_v_bn))) __PYX_ERR(0, 125, __pyx_L1_error)
4214 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4215 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4216 CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
4221 __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
4222 __Pyx_XDECREF(__pyx_t_1);
4223 __Pyx_XDECREF(__pyx_t_2);
4224 __Pyx_XDECREF(__pyx_t_3);
4225 __Pyx_AddTraceback(
"genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
4227 __Pyx_XGIVEREF(__pyx_r);
4228 #if !CYTHON_USE_EXC_INFO_STACK
4229 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4231 __pyx_generator->resume_label = -1;
4232 __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
4233 __Pyx_RefNannyFinishContext();
4245 static PyObject *__pyx_pf_10Isosurface_10Isosurface_2attachModel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_model, CYTHON_UNUSED PyObject *__pyx_v_ar) {
4246 struct __pyx_obj_10Isosurface___pyx_scope_struct__attachModel *__pyx_cur_scope;
4247 PyObject *__pyx_v_fine_grid = NULL;
4248 PyObject *__pyx_gb_10Isosurface_10Isosurface_11attachModel_2generator = 0;
4249 PyObject *__pyx_r = NULL;
4250 __Pyx_RefNannyDeclarations
4251 PyObject *__pyx_t_1 = NULL;
4252 PyObject *__pyx_t_2 = NULL;
4253 PyObject *__pyx_t_3 = NULL;
4254 PyObject *__pyx_t_4 = NULL;
4255 int __pyx_lineno = 0;
4256 const char *__pyx_filename = NULL;
4257 int __pyx_clineno = 0;
4258 __Pyx_RefNannySetupContext(
"attachModel", 0);
4259 __pyx_cur_scope = (
struct __pyx_obj_10Isosurface___pyx_scope_struct__attachModel *)__pyx_tp_new_10Isosurface___pyx_scope_struct__attachModel(__pyx_ptype_10Isosurface___pyx_scope_struct__attachModel, __pyx_empty_tuple, NULL);
4260 if (unlikely(!__pyx_cur_scope)) {
4261 __pyx_cur_scope = ((
struct __pyx_obj_10Isosurface___pyx_scope_struct__attachModel *)Py_None);
4262 __Pyx_INCREF(Py_None);
4263 __PYX_ERR(0, 108, __pyx_L1_error)
4265 __Pyx_GOTREF(__pyx_cur_scope);
4267 __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
4268 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
4269 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
4278 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_model, __pyx_v_model) < 0) __PYX_ERR(0, 111, __pyx_L1_error)
4287 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_model, __pyx_n_s_levelModelList);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error)
4288 __Pyx_GOTREF(__pyx_t_1);
4289 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, -1
L,
long, 1, __Pyx_PyInt_From_long, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error)
4290 __Pyx_GOTREF(__pyx_t_2);
4291 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4292 __pyx_v_fine_grid = __pyx_t_2;
4302 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fine_grid, __pyx_n_s_coefficients);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
4303 __Pyx_GOTREF(__pyx_t_2);
4304 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_variableNames);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
4305 __Pyx_GOTREF(__pyx_t_1);
4306 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4307 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_fieldNames, __pyx_t_1) < 0) __PYX_ERR(0, 113, __pyx_L1_error)
4308 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4317 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fine_grid, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
4318 __Pyx_GOTREF(__pyx_t_1);
4319 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_elementNodesArray);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error)
4320 __Pyx_GOTREF(__pyx_t_2);
4321 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4322 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_elementNodesArray, __pyx_t_2) < 0) __PYX_ERR(0, 114, __pyx_L1_error)
4323 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4332 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fine_grid, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error)
4333 __Pyx_GOTREF(__pyx_t_2);
4334 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_exteriorElementBoundariesArray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error)
4335 __Pyx_GOTREF(__pyx_t_1);
4336 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4345 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_exteriorElementBoundariesArray, __pyx_t_1) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
4346 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4355 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fine_grid, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
4356 __Pyx_GOTREF(__pyx_t_1);
4357 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_elementBoundaryNodesArray);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error)
4358 __Pyx_GOTREF(__pyx_t_2);
4359 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4368 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_elementBoundaryNodesArray, __pyx_t_2) < 0) __PYX_ERR(0, 117, __pyx_L1_error)
4369 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4378 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fine_grid, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error)
4379 __Pyx_GOTREF(__pyx_t_2);
4380 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_elementBoundaryMaterialTypes);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
4381 __Pyx_GOTREF(__pyx_t_1);
4382 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4391 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_elementBoundaryMaterialTypes, __pyx_t_1) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
4392 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4401 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_elementBoundaryNodesArray);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
4402 __Pyx_GOTREF(__pyx_t_2);
4411 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_exteriorElementBoundariesArray);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
4412 __Pyx_GOTREF(__pyx_t_3);
4421 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error)
4422 __Pyx_GOTREF(__pyx_t_4);
4423 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4424 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4433 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_flatten);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error)
4434 __Pyx_GOTREF(__pyx_t_3);
4435 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4437 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4438 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4439 if (likely(__pyx_t_4)) {
4440 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4441 __Pyx_INCREF(__pyx_t_4);
4442 __Pyx_INCREF(
function);
4443 __Pyx_DECREF_SET(__pyx_t_3,
function);
4446 __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4447 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4448 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
4449 __Pyx_GOTREF(__pyx_t_1);
4450 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4459 __pyx_t_3 = PySet_New(__pyx_t_1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error)
4460 __Pyx_GOTREF(__pyx_t_3);
4461 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4462 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_boundaryNodes, __pyx_t_3) < 0) __PYX_ERR(0, 121, __pyx_L1_error)
4463 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4472 __pyx_t_3 = __pyx_pf_10Isosurface_10Isosurface_11attachModel_genexpr(((PyObject*)__pyx_cur_scope));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
4473 __Pyx_GOTREF(__pyx_t_3);
4474 __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
4475 __Pyx_GOTREF(__pyx_t_1);
4476 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4477 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_g2b, __pyx_t_1) < 0) __PYX_ERR(0, 125, __pyx_L1_error)
4478 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4487 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fine_grid, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
4488 __Pyx_GOTREF(__pyx_t_1);
4489 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
4490 __Pyx_GOTREF(__pyx_t_3);
4491 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4492 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_nodeArray, __pyx_t_3) < 0) __PYX_ERR(0, 126, __pyx_L1_error)
4493 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4502 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_fine_grid, __pyx_n_s_mesh);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error)
4503 __Pyx_GOTREF(__pyx_t_3);
4504 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_nElements_global);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error)
4505 __Pyx_GOTREF(__pyx_t_1);
4506 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4507 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_num_owned_elements, __pyx_t_1) < 0) __PYX_ERR(0, 127, __pyx_L1_error)
4508 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4517 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fine_grid, __pyx_n_s_u);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error)
4518 __Pyx_GOTREF(__pyx_t_1);
4519 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_u, __pyx_t_1) < 0) __PYX_ERR(0, 128, __pyx_L1_error)
4520 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4529 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fine_grid, __pyx_n_s_timeIntegration);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
4530 __Pyx_GOTREF(__pyx_t_1);
4531 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_timeIntegration, __pyx_t_1) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
4532 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4541 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_nFrames, __pyx_int_0) < 0) __PYX_ERR(0, 130, __pyx_L1_error)
4550 if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_next_output, __pyx_int_0) < 0) __PYX_ERR(0, 131, __pyx_L1_error)
4559 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_writeSceneHeader);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error)
4560 __Pyx_GOTREF(__pyx_t_3);
4562 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4563 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4564 if (likely(__pyx_t_4)) {
4565 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4566 __Pyx_INCREF(__pyx_t_4);
4567 __Pyx_INCREF(
function);
4568 __Pyx_DECREF_SET(__pyx_t_3,
function);
4571 __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
4572 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4573 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
4574 __Pyx_GOTREF(__pyx_t_1);
4575 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4576 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4585 __Pyx_XDECREF(__pyx_r);
4586 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
4587 __pyx_r = __pyx_cur_scope->__pyx_v_self;
4600 __Pyx_XDECREF(__pyx_t_1);
4601 __Pyx_XDECREF(__pyx_t_2);
4602 __Pyx_XDECREF(__pyx_t_3);
4603 __Pyx_XDECREF(__pyx_t_4);
4604 __Pyx_AddTraceback(
"Isosurface.Isosurface.attachModel", __pyx_clineno, __pyx_lineno, __pyx_filename);
4607 __Pyx_XDECREF(__pyx_v_fine_grid);
4608 __Pyx_XDECREF(__pyx_gb_10Isosurface_10Isosurface_11attachModel_2generator);
4609 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4610 __Pyx_XGIVEREF(__pyx_r);
4611 __Pyx_RefNannyFinishContext();
4624 static PyObject *__pyx_pw_10Isosurface_10Isosurface_5attachHDF5(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4625 static char __pyx_doc_10Isosurface_10Isosurface_4attachHDF5[] =
"Isosurface.attachHDF5(self, h5, step, cam=None)\n\n Attach this isosurface to and HDF5 archive\n ";
4626 static PyMethodDef __pyx_mdef_10Isosurface_10Isosurface_5attachHDF5 = {
"attachHDF5", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10Isosurface_10Isosurface_5attachHDF5, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10Isosurface_10Isosurface_4attachHDF5};
4627 static PyObject *__pyx_pw_10Isosurface_10Isosurface_5attachHDF5(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4628 PyObject *__pyx_v_self = 0;
4629 PyObject *__pyx_v_h5 = 0;
4630 PyObject *__pyx_v_step = 0;
4631 PyObject *__pyx_v_cam = 0;
4632 int __pyx_lineno = 0;
4633 const char *__pyx_filename = NULL;
4634 int __pyx_clineno = 0;
4635 PyObject *__pyx_r = 0;
4636 __Pyx_RefNannyDeclarations
4637 __Pyx_RefNannySetupContext(
"attachHDF5 (wrapper)", 0);
4639 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_h5,&__pyx_n_s_step,&__pyx_n_s_cam,0};
4640 PyObject* values[4] = {0,0,0,0};
4641 values[3] = ((PyObject *)((PyObject *)Py_None));
4642 if (unlikely(__pyx_kwds)) {
4644 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4646 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4648 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4650 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4652 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4655 default:
goto __pyx_L5_argtuple_error;
4657 kw_args = PyDict_Size(__pyx_kwds);
4660 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
4661 else goto __pyx_L5_argtuple_error;
4664 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h5)) != 0)) kw_args--;
4666 __Pyx_RaiseArgtupleInvalid(
"attachHDF5", 0, 3, 4, 1); __PYX_ERR(0, 135, __pyx_L3_error)
4670 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--;
4672 __Pyx_RaiseArgtupleInvalid(
"attachHDF5", 0, 3, 4, 2); __PYX_ERR(0, 135, __pyx_L3_error)
4677 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cam);
4678 if (value) { values[3] = value; kw_args--; }
4681 if (unlikely(kw_args > 0)) {
4682 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"attachHDF5") < 0)) __PYX_ERR(0, 135, __pyx_L3_error)
4685 switch (PyTuple_GET_SIZE(__pyx_args)) {
4686 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4688 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4689 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4690 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4692 default:
goto __pyx_L5_argtuple_error;
4695 __pyx_v_self = values[0];
4696 __pyx_v_h5 = values[1];
4697 __pyx_v_step = values[2];
4698 __pyx_v_cam = values[3];
4700 goto __pyx_L4_argument_unpacking_done;
4701 __pyx_L5_argtuple_error:;
4702 __Pyx_RaiseArgtupleInvalid(
"attachHDF5", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 135, __pyx_L3_error)
4704 __Pyx_AddTraceback(
"Isosurface.Isosurface.attachHDF5", __pyx_clineno, __pyx_lineno, __pyx_filename);
4705 __Pyx_RefNannyFinishContext();
4707 __pyx_L4_argument_unpacking_done:;
4708 __pyx_r = __pyx_pf_10Isosurface_10Isosurface_4attachHDF5(__pyx_self, __pyx_v_self, __pyx_v_h5, __pyx_v_step, __pyx_v_cam);
4711 __Pyx_RefNannyFinishContext();
4715 static PyObject *__pyx_pf_10Isosurface_10Isosurface_4attachHDF5(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_h5, PyObject *__pyx_v_step, PyObject *__pyx_v_cam) {
4716 PyObject *__pyx_v_namedtuple = NULL;
4717 PyObject *__pyx_v_FemField = NULL;
4718 PyObject *__pyx_v_field_i = NULL;
4719 CYTHON_UNUSED PyObject *__pyx_v_field = NULL;
4720 PyObject *__pyx_v_isosurface = NULL;
4721 PyObject *__pyx_r = NULL;
4722 __Pyx_RefNannyDeclarations
4723 PyObject *__pyx_t_1 = NULL;
4724 PyObject *__pyx_t_2 = NULL;
4725 PyObject *__pyx_t_3 = NULL;
4726 Py_ssize_t __pyx_t_4;
4727 PyObject *(*__pyx_t_5)(PyObject *);
4728 PyObject *__pyx_t_6 = NULL;
4730 PyObject *__pyx_t_8 = NULL;
4731 PyObject *__pyx_t_9 = NULL;
4732 PyObject *__pyx_t_10 = NULL;
4733 PyObject *__pyx_t_11 = NULL;
4735 int __pyx_lineno = 0;
4736 const char *__pyx_filename = NULL;
4737 int __pyx_clineno = 0;
4738 __Pyx_RefNannySetupContext(
"attachHDF5", 0);
4747 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
4748 __Pyx_GOTREF(__pyx_t_1);
4749 __Pyx_INCREF(__pyx_n_s_namedtuple);
4750 __Pyx_GIVEREF(__pyx_n_s_namedtuple);
4751 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_namedtuple);
4752 __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_1, -1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error)
4753 __Pyx_GOTREF(__pyx_t_2);
4754 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4755 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_namedtuple);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
4756 __Pyx_GOTREF(__pyx_t_1);
4757 __Pyx_INCREF(__pyx_t_1);
4758 __pyx_v_namedtuple = __pyx_t_1;
4759 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4760 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4769 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
4770 __Pyx_GOTREF(__pyx_t_2);
4771 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_isosurfaces);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
4772 __Pyx_GOTREF(__pyx_t_1);
4773 if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
4774 __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
4777 __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error)
4778 __Pyx_GOTREF(__pyx_t_3);
4779 __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 140, __pyx_L1_error)
4781 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4783 if (likely(!__pyx_t_5)) {
4784 if (likely(PyList_CheckExact(__pyx_t_3))) {
4785 if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3))
break;
4786 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4787 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
if (unlikely(0 < 0)) __PYX_ERR(0, 140, __pyx_L1_error)
4789 __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
4790 __Pyx_GOTREF(__pyx_t_1);
4793 if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
4794 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4795 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
if (unlikely(0 < 0)) __PYX_ERR(0, 140, __pyx_L1_error)
4797 __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
4798 __Pyx_GOTREF(__pyx_t_1);
4802 __pyx_t_1 = __pyx_t_5(__pyx_t_3);
4803 if (unlikely(!__pyx_t_1)) {
4804 PyObject* exc_type = PyErr_Occurred();
4806 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
4807 else __PYX_ERR(0, 140, __pyx_L1_error)
4811 __Pyx_GOTREF(__pyx_t_1);
4813 __Pyx_XDECREF_SET(__pyx_v_isosurface, __pyx_t_1);
4815 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_isosurface, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
4816 __Pyx_GOTREF(__pyx_t_1);
4817 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 140, __pyx_L1_error)
4818 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4820 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4821 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_fieldNames, __pyx_t_2) < 0) __PYX_ERR(0, 140, __pyx_L1_error)
4822 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4831 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_fieldNames);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
4832 __Pyx_GOTREF(__pyx_t_2);
4833 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error)
4834 __Pyx_GOTREF(__pyx_t_3);
4835 __Pyx_INCREF(__pyx_kp_s_ATTACHING_TO_HDF5);
4836 __Pyx_GIVEREF(__pyx_kp_s_ATTACHING_TO_HDF5);
4837 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_s_ATTACHING_TO_HDF5);
4838 __Pyx_GIVEREF(__pyx_t_2);
4839 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
4841 if (__Pyx_PrintOne(0, __pyx_t_3) < 0) __PYX_ERR(0, 141, __pyx_L1_error)
4842 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4851 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_h5, __pyx_n_s_get_node);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
4852 __Pyx_GOTREF(__pyx_t_2);
4861 __pyx_t_1 = PyObject_Repr(__pyx_v_step);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
4862 __Pyx_GOTREF(__pyx_t_1);
4871 __pyx_t_6 = PyNumber_Add(__pyx_kp_s_elementsSpatial_Domain, __pyx_t_1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 142, __pyx_L1_error)
4872 __Pyx_GOTREF(__pyx_t_6);
4873 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4875 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4876 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
4877 if (likely(__pyx_t_1)) {
4878 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4879 __Pyx_INCREF(__pyx_t_1);
4880 __Pyx_INCREF(
function);
4881 __Pyx_DECREF_SET(__pyx_t_2,
function);
4884 __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6);
4885 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4886 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4887 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error)
4888 __Pyx_GOTREF(__pyx_t_3);
4889 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4898 __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_3, 0, 0, NULL, NULL, &__pyx_slice__3, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
4899 __Pyx_GOTREF(__pyx_t_2);
4900 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4909 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_elementNodesArray, __pyx_t_2) < 0) __PYX_ERR(0, 142, __pyx_L1_error)
4910 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4919 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_h5, __pyx_n_s_get_node);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error)
4920 __Pyx_GOTREF(__pyx_t_3);
4921 __pyx_t_6 = PyObject_Repr(__pyx_v_step);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 144, __pyx_L1_error)
4922 __Pyx_GOTREF(__pyx_t_6);
4923 __pyx_t_1 = PyNumber_Add(__pyx_kp_s_nodesSpatial_Domain, __pyx_t_6);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error)
4924 __Pyx_GOTREF(__pyx_t_1);
4925 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4927 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4928 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
4929 if (likely(__pyx_t_6)) {
4930 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4931 __Pyx_INCREF(__pyx_t_6);
4932 __Pyx_INCREF(
function);
4933 __Pyx_DECREF_SET(__pyx_t_3,
function);
4936 __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1);
4937 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4938 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4939 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
4940 __Pyx_GOTREF(__pyx_t_2);
4941 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4942 __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, 0, NULL, NULL, &__pyx_slice__3, 0, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error)
4943 __Pyx_GOTREF(__pyx_t_3);
4944 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4945 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray, __pyx_t_3) < 0) __PYX_ERR(0, 144, __pyx_L1_error)
4946 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4955 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_elementNodesArray);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error)
4956 __Pyx_GOTREF(__pyx_t_3);
4957 __pyx_t_4 = PyObject_Length(__pyx_t_3);
if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 145, __pyx_L1_error)
4958 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4959 __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error)
4960 __Pyx_GOTREF(__pyx_t_3);
4961 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_num_owned_elements, __pyx_t_3) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
4962 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4971 __pyx_t_3 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
4972 __Pyx_GOTREF(__pyx_t_3);
4973 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_u, __pyx_t_3) < 0) __PYX_ERR(0, 146, __pyx_L1_error)
4974 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4983 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
4984 __Pyx_GOTREF(__pyx_t_2);
4985 __Pyx_INCREF(__pyx_n_s_dof);
4986 __Pyx_GIVEREF(__pyx_n_s_dof);
4987 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_dof);
4988 __Pyx_INCREF(__pyx_v_namedtuple);
4989 __pyx_t_1 = __pyx_v_namedtuple; __pyx_t_6 = NULL;
4991 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
4992 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
4993 if (likely(__pyx_t_6)) {
4994 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
4995 __Pyx_INCREF(__pyx_t_6);
4996 __Pyx_INCREF(
function);
4997 __Pyx_DECREF_SET(__pyx_t_1,
function);
5001 #if CYTHON_FAST_PYCALL
5002 if (PyFunction_Check(__pyx_t_1)) {
5003 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_n_s_FemField, __pyx_t_2};
5004 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
5005 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5006 __Pyx_GOTREF(__pyx_t_3);
5007 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5010 #if CYTHON_FAST_PYCCALL
5011 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
5012 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_n_s_FemField, __pyx_t_2};
5013 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
5014 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5015 __Pyx_GOTREF(__pyx_t_3);
5016 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5020 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 147, __pyx_L1_error)
5021 __Pyx_GOTREF(__pyx_t_8);
5023 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
5025 __Pyx_INCREF(__pyx_n_s_FemField);
5026 __Pyx_GIVEREF(__pyx_n_s_FemField);
5027 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_n_s_FemField);
5028 __Pyx_GIVEREF(__pyx_t_2);
5029 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_2);
5031 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
5032 __Pyx_GOTREF(__pyx_t_3);
5033 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5035 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5036 __pyx_v_FemField = __pyx_t_3;
5046 __Pyx_INCREF(__pyx_int_0);
5047 __pyx_t_3 = __pyx_int_0;
5048 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_fieldNames);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
5049 __Pyx_GOTREF(__pyx_t_1);
5050 if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
5051 __pyx_t_8 = __pyx_t_1; __Pyx_INCREF(__pyx_t_8); __pyx_t_4 = 0;
5054 __pyx_t_4 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 148, __pyx_L1_error)
5055 __Pyx_GOTREF(__pyx_t_8);
5056 __pyx_t_5 = Py_TYPE(__pyx_t_8)->tp_iternext;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error)
5058 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5060 if (likely(!__pyx_t_5)) {
5061 if (likely(PyList_CheckExact(__pyx_t_8))) {
5062 if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_8))
break;
5063 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5064 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
if (unlikely(0 < 0)) __PYX_ERR(0, 148, __pyx_L1_error)
5066 __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_4); __pyx_t_4++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
5067 __Pyx_GOTREF(__pyx_t_1);
5070 if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_8))
break;
5071 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5072 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
if (unlikely(0 < 0)) __PYX_ERR(0, 148, __pyx_L1_error)
5074 __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_4); __pyx_t_4++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
5075 __Pyx_GOTREF(__pyx_t_1);
5079 __pyx_t_1 = __pyx_t_5(__pyx_t_8);
5080 if (unlikely(!__pyx_t_1)) {
5081 PyObject* exc_type = PyErr_Occurred();
5083 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
5084 else __PYX_ERR(0, 148, __pyx_L1_error)
5088 __Pyx_GOTREF(__pyx_t_1);
5090 __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_1);
5092 __Pyx_INCREF(__pyx_t_3);
5093 __Pyx_XDECREF_SET(__pyx_v_field_i, __pyx_t_3);
5094 __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
5095 __Pyx_GOTREF(__pyx_t_1);
5096 __Pyx_DECREF(__pyx_t_3);
5097 __pyx_t_3 = __pyx_t_1;
5107 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
5108 __Pyx_GOTREF(__pyx_t_1);
5109 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_h5, __pyx_n_s_get_node);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error)
5110 __Pyx_GOTREF(__pyx_t_6);
5119 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_isosurfaces);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 150, __pyx_L1_error)
5120 __Pyx_GOTREF(__pyx_t_9);
5121 __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_9, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 150, __pyx_L1_error)
5122 __Pyx_GOTREF(__pyx_t_10);
5123 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5124 __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_10, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 150, __pyx_L1_error)
5125 __Pyx_GOTREF(__pyx_t_9);
5126 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5135 __pyx_t_10 = PyNumber_Add(__pyx_kp_s__4, __pyx_t_9);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 149, __pyx_L1_error)
5136 __Pyx_GOTREF(__pyx_t_10);
5137 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5146 __pyx_t_9 = PyObject_Repr(__pyx_v_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 151, __pyx_L1_error)
5147 __Pyx_GOTREF(__pyx_t_9);
5156 __pyx_t_11 = PyNumber_Add(__pyx_t_10, __pyx_t_9);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 150, __pyx_L1_error)
5157 __Pyx_GOTREF(__pyx_t_11);
5158 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5159 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5161 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
5162 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
5163 if (likely(__pyx_t_9)) {
5164 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
5165 __Pyx_INCREF(__pyx_t_9);
5166 __Pyx_INCREF(
function);
5167 __Pyx_DECREF_SET(__pyx_t_6,
function);
5170 __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_9, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_11);
5171 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5172 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5173 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error)
5174 __Pyx_GOTREF(__pyx_t_2);
5175 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5184 __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, 0, NULL, NULL, &__pyx_slice__3, 0, 0, 1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 151, __pyx_L1_error)
5185 __Pyx_GOTREF(__pyx_t_6);
5186 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5187 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dof, __pyx_t_6) < 0) __PYX_ERR(0, 149, __pyx_L1_error)
5188 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5197 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_FemField, __pyx_empty_tuple, __pyx_t_1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error)
5198 __Pyx_GOTREF(__pyx_t_6);
5199 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5200 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_u);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
5201 __Pyx_GOTREF(__pyx_t_1);
5202 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_field_i, __pyx_t_6) < 0)) __PYX_ERR(0, 149, __pyx_L1_error)
5203 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5204 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5214 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5215 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5224 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nFrames, __pyx_v_step) < 0) __PYX_ERR(0, 152, __pyx_L1_error)
5233 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_next_output, __pyx_int_0) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
5242 __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_step, __pyx_int_0, 0, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error)
5243 __Pyx_GOTREF(__pyx_t_3);
5244 __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 154, __pyx_L1_error)
5245 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5255 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writeSceneHeader);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 155, __pyx_L1_error)
5256 __Pyx_GOTREF(__pyx_t_8);
5258 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
5259 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
5260 if (likely(__pyx_t_6)) {
5261 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
5262 __Pyx_INCREF(__pyx_t_6);
5263 __Pyx_INCREF(
function);
5264 __Pyx_DECREF_SET(__pyx_t_8,
function);
5267 __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_6, __pyx_v_cam) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_cam);
5268 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5269 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error)
5270 __Pyx_GOTREF(__pyx_t_3);
5271 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5272 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5290 __Pyx_XDECREF(__pyx_r);
5291 __Pyx_INCREF(__pyx_v_self);
5292 __pyx_r = __pyx_v_self;
5305 __Pyx_XDECREF(__pyx_t_1);
5306 __Pyx_XDECREF(__pyx_t_2);
5307 __Pyx_XDECREF(__pyx_t_3);
5308 __Pyx_XDECREF(__pyx_t_6);
5309 __Pyx_XDECREF(__pyx_t_8);
5310 __Pyx_XDECREF(__pyx_t_9);
5311 __Pyx_XDECREF(__pyx_t_10);
5312 __Pyx_XDECREF(__pyx_t_11);
5313 __Pyx_AddTraceback(
"Isosurface.Isosurface.attachHDF5", __pyx_clineno, __pyx_lineno, __pyx_filename);
5316 __Pyx_XDECREF(__pyx_v_namedtuple);
5317 __Pyx_XDECREF(__pyx_v_FemField);
5318 __Pyx_XDECREF(__pyx_v_field_i);
5319 __Pyx_XDECREF(__pyx_v_field);
5320 __Pyx_XDECREF(__pyx_v_isosurface);
5321 __Pyx_XGIVEREF(__pyx_r);
5322 __Pyx_RefNannyFinishContext();
5335 static PyObject *__pyx_pw_10Isosurface_10Isosurface_7triangulateIsosurface(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5336 static char __pyx_doc_10Isosurface_10Isosurface_6triangulateIsosurface[] =
"Isosurface.triangulateIsosurface(self, field, value)\n\n Build a triangular mesh of the isosurface\n ";
5337 static PyMethodDef __pyx_mdef_10Isosurface_10Isosurface_7triangulateIsosurface = {
"triangulateIsosurface", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10Isosurface_10Isosurface_7triangulateIsosurface, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10Isosurface_10Isosurface_6triangulateIsosurface};
5338 static PyObject *__pyx_pw_10Isosurface_10Isosurface_7triangulateIsosurface(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5339 PyObject *__pyx_v_self = 0;
5340 PyObject *__pyx_v_field = 0;
5341 PyObject *__pyx_v_value = 0;
5342 int __pyx_lineno = 0;
5343 const char *__pyx_filename = NULL;
5344 int __pyx_clineno = 0;
5345 PyObject *__pyx_r = 0;
5346 __Pyx_RefNannyDeclarations
5347 __Pyx_RefNannySetupContext(
"triangulateIsosurface (wrapper)", 0);
5349 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_field,&__pyx_n_s_value,0};
5350 PyObject* values[3] = {0,0,0};
5351 if (unlikely(__pyx_kwds)) {
5353 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5355 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5357 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5359 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5362 default:
goto __pyx_L5_argtuple_error;
5364 kw_args = PyDict_Size(__pyx_kwds);
5367 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
5368 else goto __pyx_L5_argtuple_error;
5371 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
5373 __Pyx_RaiseArgtupleInvalid(
"triangulateIsosurface", 1, 3, 3, 1); __PYX_ERR(0, 158, __pyx_L3_error)
5377 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
5379 __Pyx_RaiseArgtupleInvalid(
"triangulateIsosurface", 1, 3, 3, 2); __PYX_ERR(0, 158, __pyx_L3_error)
5382 if (unlikely(kw_args > 0)) {
5383 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"triangulateIsosurface") < 0)) __PYX_ERR(0, 158, __pyx_L3_error)
5385 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
5386 goto __pyx_L5_argtuple_error;
5388 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5389 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5390 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5392 __pyx_v_self = values[0];
5393 __pyx_v_field = values[1];
5394 __pyx_v_value = values[2];
5396 goto __pyx_L4_argument_unpacking_done;
5397 __pyx_L5_argtuple_error:;
5398 __Pyx_RaiseArgtupleInvalid(
"triangulateIsosurface", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 158, __pyx_L3_error)
5400 __Pyx_AddTraceback(
"Isosurface.Isosurface.triangulateIsosurface", __pyx_clineno, __pyx_lineno, __pyx_filename);
5401 __Pyx_RefNannyFinishContext();
5403 __pyx_L4_argument_unpacking_done:;
5404 __pyx_r = __pyx_pf_10Isosurface_10Isosurface_6triangulateIsosurface(__pyx_self, __pyx_v_self, __pyx_v_field, __pyx_v_value);
5407 __Pyx_RefNannyFinishContext();
5411 static PyObject *__pyx_pf_10Isosurface_10Isosurface_6triangulateIsosurface(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value) {
5419 int __pyx_v_nN_start;
5422 PyArrayObject *__pyx_v_x = 0;
5423 PyArrayObject *__pyx_v_normal = 0;
5424 PyObject *__pyx_v_nodes = NULL;
5425 PyObject *__pyx_v_elements = NULL;
5426 PyObject *__pyx_v_normals = NULL;
5427 PyObject *__pyx_v_normal_indices = NULL;
5428 PyObject *__pyx_v_phi = NULL;
5429 PyObject *__pyx_v_plus = NULL;
5430 PyObject *__pyx_v_minus = NULL;
5431 PyObject *__pyx_v_zeros = NULL;
5432 PyObject *__pyx_v_j = NULL;
5433 __Pyx_LocalBuf_ND __pyx_pybuffernd_normal;
5434 __Pyx_Buffer __pyx_pybuffer_normal;
5435 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
5436 __Pyx_Buffer __pyx_pybuffer_x;
5437 PyObject *__pyx_r = NULL;
5438 __Pyx_RefNannyDeclarations
5439 PyObject *__pyx_t_1 = NULL;
5440 PyObject *__pyx_t_2 = NULL;
5441 PyObject *__pyx_t_3 = NULL;
5443 PyObject *__pyx_t_5 = NULL;
5450 Py_ssize_t __pyx_t_12;
5452 Py_ssize_t __pyx_t_14;
5453 PyObject *__pyx_t_15 = NULL;
5454 PyObject *__pyx_t_16 = NULL;
5456 PyArrayObject *__pyx_t_18 = NULL;
5457 PyObject *__pyx_t_19 = NULL;
5458 PyObject *__pyx_t_20 = NULL;
5459 PyObject *__pyx_t_21 = NULL;
5461 int __pyx_lineno = 0;
5462 const char *__pyx_filename = NULL;
5463 int __pyx_clineno = 0;
5464 __Pyx_RefNannySetupContext(
"triangulateIsosurface", 0);
5465 __pyx_pybuffer_x.pybuffer.buf = NULL;
5466 __pyx_pybuffer_x.refcount = 0;
5467 __pyx_pybuffernd_x.data = NULL;
5468 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
5469 __pyx_pybuffer_normal.pybuffer.buf = NULL;
5470 __pyx_pybuffer_normal.refcount = 0;
5471 __pyx_pybuffernd_normal.data = NULL;
5472 __pyx_pybuffernd_normal.rcbuffer = &__pyx_pybuffer_normal;
5481 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
5482 __Pyx_GOTREF(__pyx_t_1);
5483 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodes);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error)
5484 __Pyx_GOTREF(__pyx_t_2);
5485 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error)
5486 __Pyx_GOTREF(__pyx_t_3);
5487 __Pyx_INCREF(__pyx_v_field);
5488 __Pyx_GIVEREF(__pyx_v_field);
5489 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_field);
5490 __Pyx_INCREF(__pyx_v_value);
5491 __Pyx_GIVEREF(__pyx_v_value);
5492 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_value);
5493 if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(0, 165, __pyx_L1_error)
5494 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5495 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5496 __Pyx_INCREF(__pyx_t_1);
5497 __pyx_v_nodes = __pyx_t_1;
5498 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5507 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error)
5508 __Pyx_GOTREF(__pyx_t_1);
5509 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_elements);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error)
5510 __Pyx_GOTREF(__pyx_t_3);
5511 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error)
5512 __Pyx_GOTREF(__pyx_t_2);
5513 __Pyx_INCREF(__pyx_v_field);
5514 __Pyx_GIVEREF(__pyx_v_field);
5515 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_field);
5516 __Pyx_INCREF(__pyx_v_value);
5517 __Pyx_GIVEREF(__pyx_v_value);
5518 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_value);
5519 if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_t_2, __pyx_t_1) < 0)) __PYX_ERR(0, 166, __pyx_L1_error)
5520 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5521 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5522 __Pyx_INCREF(__pyx_t_1);
5523 __pyx_v_elements = __pyx_t_1;
5524 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5533 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
5534 __Pyx_GOTREF(__pyx_t_1);
5535 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_normals);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error)
5536 __Pyx_GOTREF(__pyx_t_2);
5537 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error)
5538 __Pyx_GOTREF(__pyx_t_3);
5539 __Pyx_INCREF(__pyx_v_field);
5540 __Pyx_GIVEREF(__pyx_v_field);
5541 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_field);
5542 __Pyx_INCREF(__pyx_v_value);
5543 __Pyx_GIVEREF(__pyx_v_value);
5544 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_value);
5545 if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(0, 167, __pyx_L1_error)
5546 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5547 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5548 __Pyx_INCREF(__pyx_t_1);
5549 __pyx_v_normals = __pyx_t_1;
5550 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5559 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
5560 __Pyx_GOTREF(__pyx_t_1);
5561 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_normal_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L1_error)
5562 __Pyx_GOTREF(__pyx_t_3);
5563 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error)
5564 __Pyx_GOTREF(__pyx_t_2);
5565 __Pyx_INCREF(__pyx_v_field);
5566 __Pyx_GIVEREF(__pyx_v_field);
5567 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_field);
5568 __Pyx_INCREF(__pyx_v_value);
5569 __Pyx_GIVEREF(__pyx_v_value);
5570 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_value);
5571 if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_t_2, __pyx_t_1) < 0)) __PYX_ERR(0, 168, __pyx_L1_error)
5572 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5573 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5574 __Pyx_INCREF(__pyx_t_1);
5575 __pyx_v_normal_indices = __pyx_t_1;
5576 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5585 __pyx_t_1 = __Pyx_PyFloat_NeObjC(__pyx_v_value, __pyx_float_0_0, 0.0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
5586 __Pyx_GOTREF(__pyx_t_1);
5587 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 169, __pyx_L1_error)
5588 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5589 if (unlikely(__pyx_t_4)) {
5598 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
5599 __Pyx_GOTREF(__pyx_t_1);
5600 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5601 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5602 __PYX_ERR(0, 170, __pyx_L1_error)
5620 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_u);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
5621 __Pyx_GOTREF(__pyx_t_1);
5622 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_fieldNames);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error)
5623 __Pyx_GOTREF(__pyx_t_3);
5624 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_index);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error)
5625 __Pyx_GOTREF(__pyx_t_5);
5626 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5628 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
5629 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
5630 if (likely(__pyx_t_3)) {
5631 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
5632 __Pyx_INCREF(__pyx_t_3);
5633 __Pyx_INCREF(
function);
5634 __Pyx_DECREF_SET(__pyx_t_5,
function);
5637 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_v_field) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_field);
5638 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5639 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
5640 __Pyx_GOTREF(__pyx_t_2);
5641 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5642 __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error)
5643 __Pyx_GOTREF(__pyx_t_5);
5644 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5645 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5646 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dof);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
5647 __Pyx_GOTREF(__pyx_t_2);
5648 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5649 __pyx_v_phi = __pyx_t_2;
5659 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_num_owned_elements);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error)
5660 __Pyx_GOTREF(__pyx_t_2);
5661 __pyx_t_6 = __Pyx_PyInt_As_long(__pyx_t_2);
if (unlikely((__pyx_t_6 == (
long)-1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error)
5662 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5663 __pyx_t_7 = __pyx_t_6;
5664 for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
5665 __pyx_v_eN = __pyx_t_8;
5674 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L1_error)
5675 __Pyx_GOTREF(__pyx_t_2);
5676 __Pyx_XDECREF_SET(__pyx_v_plus, ((PyObject*)__pyx_t_2));
5686 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
5687 __Pyx_GOTREF(__pyx_t_2);
5688 __Pyx_XDECREF_SET(__pyx_v_minus, ((PyObject*)__pyx_t_2));
5698 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error)
5699 __Pyx_GOTREF(__pyx_t_2);
5700 __Pyx_XDECREF_SET(__pyx_v_zeros, ((PyObject*)__pyx_t_2));
5710 __pyx_v_eps = 1.0e-8;
5719 for (__pyx_t_9 = 0; __pyx_t_9 < 4; __pyx_t_9+=1) {
5720 __pyx_v_i = __pyx_t_9;
5729 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_elementNodesArray);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
5730 __Pyx_GOTREF(__pyx_t_2);
5731 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 178, __pyx_L1_error)
5732 __Pyx_GOTREF(__pyx_t_5);
5733 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
5734 __Pyx_GOTREF(__pyx_t_1);
5735 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error)
5736 __Pyx_GOTREF(__pyx_t_3);
5737 __Pyx_GIVEREF(__pyx_t_5);
5738 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
5739 __Pyx_GIVEREF(__pyx_t_1);
5740 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
5743 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
5744 __Pyx_GOTREF(__pyx_t_1);
5745 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5746 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5747 __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_10 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L1_error)
5748 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5749 __pyx_v_I = __pyx_t_10;
5758 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error)
5759 __Pyx_GOTREF(__pyx_t_1);
5760 __pyx_t_3 = PyFloat_FromDouble(__pyx_v_eps);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error)
5761 __Pyx_GOTREF(__pyx_t_3);
5762 __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error)
5763 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5764 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5765 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 179, __pyx_L1_error)
5766 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5776 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error)
5777 __Pyx_GOTREF(__pyx_t_2);
5778 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_plus, __pyx_t_2);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 180, __pyx_L1_error)
5779 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5798 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
5799 __Pyx_GOTREF(__pyx_t_2);
5800 __pyx_t_3 = PyFloat_FromDouble((-__pyx_v_eps));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error)
5801 __Pyx_GOTREF(__pyx_t_3);
5802 __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error)
5803 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5804 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5805 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 181, __pyx_L1_error)
5806 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5816 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error)
5817 __Pyx_GOTREF(__pyx_t_1);
5818 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_minus, __pyx_t_1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 182, __pyx_L1_error)
5819 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5839 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error)
5840 __Pyx_GOTREF(__pyx_t_1);
5841 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_zeros, __pyx_t_1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 184, __pyx_L1_error)
5842 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5854 __pyx_t_12 = PyList_GET_SIZE(__pyx_v_zeros);
if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 185, __pyx_L1_error)
5855 __pyx_v_nZeros = __pyx_t_12;
5864 __pyx_t_12 = PyList_GET_SIZE(__pyx_v_minus);
if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 186, __pyx_L1_error)
5865 __pyx_v_nMinus = __pyx_t_12;
5874 __pyx_t_12 = PyList_GET_SIZE(__pyx_v_plus);
if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 187, __pyx_L1_error)
5875 __pyx_v_nPlus = __pyx_t_12;
5884 #ifndef CYTHON_WITHOUT_ASSERTIONS
5885 if (unlikely(!Py_OptimizeFlag)) {
5886 if (unlikely(!((((__pyx_v_nZeros + __pyx_v_nMinus) + __pyx_v_nPlus) == 4) != 0))) {
5887 PyErr_SetNone(PyExc_AssertionError);
5888 __PYX_ERR(0, 188, __pyx_L1_error)
5900 __pyx_t_12 = PyList_GET_SIZE(__pyx_v_nodes);
if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 189, __pyx_L1_error)
5901 __pyx_v_nN_start = __pyx_t_12;
5910 __pyx_t_13 = ((__pyx_v_nMinus == 2) != 0);
5913 __pyx_t_4 = __pyx_t_13;
5914 goto __pyx_L10_bool_binop_done;
5916 __pyx_t_13 = ((__pyx_v_nPlus == 2) != 0);
5917 __pyx_t_4 = __pyx_t_13;
5918 __pyx_L10_bool_binop_done:;
5928 __pyx_t_1 = __pyx_v_minus; __Pyx_INCREF(__pyx_t_1); __pyx_t_12 = 0;
5930 if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_1))
break;
5931 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5932 __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_3); __pyx_t_12++;
if (unlikely(0 < 0)) __PYX_ERR(0, 191, __pyx_L1_error)
5934 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_12); __pyx_t_12++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error)
5935 __Pyx_GOTREF(__pyx_t_3);
5937 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_9 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 191, __pyx_L1_error)
5938 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5939 __pyx_v_J = __pyx_t_9;
5948 __pyx_t_3 = __pyx_v_plus; __Pyx_INCREF(__pyx_t_3); __pyx_t_14 = 0;
5950 if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_3))
break;
5951 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5952 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_14); __Pyx_INCREF(__pyx_t_2); __pyx_t_14++;
if (unlikely(0 < 0)) __PYX_ERR(0, 192, __pyx_L1_error)
5954 __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_14); __pyx_t_14++;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error)
5955 __Pyx_GOTREF(__pyx_t_2);
5957 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_9 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 192, __pyx_L1_error)
5958 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5959 __pyx_v_I = __pyx_t_9;
5968 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
5969 __Pyx_GOTREF(__pyx_t_2);
5970 __pyx_t_5 = PyNumber_Negative(__pyx_t_2);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 193, __pyx_L1_error)
5971 __Pyx_GOTREF(__pyx_t_5);
5972 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5973 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_J,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
5974 __Pyx_GOTREF(__pyx_t_2);
5975 __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 193, __pyx_L1_error)
5976 __Pyx_GOTREF(__pyx_t_15);
5977 __pyx_t_16 = PyNumber_Subtract(__pyx_t_2, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 193, __pyx_L1_error)
5978 __Pyx_GOTREF(__pyx_t_16);
5979 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5980 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5981 __pyx_t_15 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_16);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 193, __pyx_L1_error)
5982 __Pyx_GOTREF(__pyx_t_15);
5983 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5984 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5985 __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_15);
if (unlikely((__pyx_t_17 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L1_error)
5986 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5987 __pyx_v_s = __pyx_t_17;
5996 __pyx_t_15 = PyFloat_FromDouble(__pyx_v_s);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 194, __pyx_L1_error)
5997 __Pyx_GOTREF(__pyx_t_15);
5998 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 194, __pyx_L1_error)
5999 __Pyx_GOTREF(__pyx_t_16);
6000 __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_16, __pyx_v_J,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 194, __pyx_L1_error)
6001 __Pyx_GOTREF(__pyx_t_5);
6002 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6003 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 194, __pyx_L1_error)
6004 __Pyx_GOTREF(__pyx_t_16);
6005 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_16, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error)
6006 __Pyx_GOTREF(__pyx_t_2);
6007 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6008 __pyx_t_16 = PyNumber_Subtract(__pyx_t_5, __pyx_t_2);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 194, __pyx_L1_error)
6009 __Pyx_GOTREF(__pyx_t_16);
6010 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6011 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6012 __pyx_t_2 = PyNumber_Multiply(__pyx_t_15, __pyx_t_16);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error)
6013 __Pyx_GOTREF(__pyx_t_2);
6014 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6015 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6024 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 195, __pyx_L1_error)
6025 __Pyx_GOTREF(__pyx_t_16);
6026 __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_16, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 195, __pyx_L1_error)
6027 __Pyx_GOTREF(__pyx_t_15);
6028 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6029 __pyx_t_16 = PyNumber_Add(__pyx_t_2, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 195, __pyx_L1_error)
6030 __Pyx_GOTREF(__pyx_t_16);
6031 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6032 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6033 if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 195, __pyx_L1_error)
6034 __pyx_t_18 = ((PyArrayObject *)__pyx_t_16);
6036 __Pyx_BufFmt_StackElem __pyx_stack[1];
6037 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
6038 __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
6039 if (unlikely(__pyx_t_9 < 0)) {
6040 PyErr_Fetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
6041 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
6042 Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21);
6043 __Pyx_RaiseBufferFallbackError();
6045 PyErr_Restore(__pyx_t_19, __pyx_t_20, __pyx_t_21);
6047 __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0;
6049 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0];
6050 if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 194, __pyx_L1_error)
6053 __Pyx_XDECREF_SET(__pyx_v_x, ((PyArrayObject *)__pyx_t_16));
6063 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_nodes, ((PyObject *)__pyx_v_x));
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 196, __pyx_L1_error)
6073 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6083 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6092 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error)
6093 __Pyx_GOTREF(__pyx_t_1);
6094 for (__pyx_t_22 = 0; __pyx_t_22 < 3; __pyx_t_22+=1) {
6095 __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_22);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error)
6096 __Pyx_GOTREF(__pyx_t_3);
6097 __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_3);
6099 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_nN_start);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error)
6100 __Pyx_GOTREF(__pyx_t_3);
6101 __pyx_t_16 = PyNumber_Add(__pyx_t_3, __pyx_v_j);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 197, __pyx_L1_error)
6102 __Pyx_GOTREF(__pyx_t_16);
6103 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6104 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_16))) __PYX_ERR(0, 197, __pyx_L1_error)
6105 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6107 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_elements, __pyx_t_1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 197, __pyx_L1_error)
6108 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6117 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error)
6118 __Pyx_GOTREF(__pyx_t_1);
6119 for (__pyx_t_22 = 0; __pyx_t_22 < 3; __pyx_t_22+=1) {
6120 __pyx_t_16 = __Pyx_PyInt_From_long(__pyx_t_22);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 198, __pyx_L1_error)
6121 __Pyx_GOTREF(__pyx_t_16);
6122 __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_16);
6124 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_nN_start);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 198, __pyx_L1_error)
6125 __Pyx_GOTREF(__pyx_t_16);
6126 __pyx_t_3 = PyNumber_Add(__pyx_t_16, __pyx_v_j);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error)
6127 __Pyx_GOTREF(__pyx_t_3);
6128 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6129 __pyx_t_16 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 198, __pyx_L1_error)
6130 __Pyx_GOTREF(__pyx_t_16);
6131 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6132 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_16))) __PYX_ERR(0, 198, __pyx_L1_error)
6133 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6135 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_elements, __pyx_t_1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 198, __pyx_L1_error)
6136 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6145 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
6146 __Pyx_GOTREF(__pyx_t_1);
6147 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_plus, 0,
long, 1, __Pyx_PyInt_From_long, 1, 0, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 199, __pyx_L1_error)
6148 __Pyx_GOTREF(__pyx_t_16);
6149 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_16);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __pyx_L1_error)
6150 __Pyx_GOTREF(__pyx_t_3);
6151 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6152 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6153 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_nodes, -4
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 199, __pyx_L1_error)
6154 __Pyx_GOTREF(__pyx_t_16);
6155 __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_16);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
6156 __Pyx_GOTREF(__pyx_t_1);
6157 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6158 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6159 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 199, __pyx_L1_error)
6168 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 200, __pyx_L1_error)
6169 __Pyx_GOTREF(__pyx_t_16);
6170 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_nodes, -4
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error)
6171 __Pyx_GOTREF(__pyx_t_3);
6172 __pyx_t_15 = PyNumber_Subtract(__pyx_t_16, __pyx_t_3);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 200, __pyx_L1_error)
6173 __Pyx_GOTREF(__pyx_t_15);
6174 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6175 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6176 if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 200, __pyx_L1_error)
6185 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_nodes, -2
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error)
6186 __Pyx_GOTREF(__pyx_t_3);
6187 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_nodes, -4
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 201, __pyx_L1_error)
6188 __Pyx_GOTREF(__pyx_t_16);
6189 __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_16);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
6190 __Pyx_GOTREF(__pyx_t_2);
6191 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6192 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6193 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 201, __pyx_L1_error)
6202 __pyx_t_4 = ((__pyx_f_10Isosurface_etriple(((PyArrayObject *)__pyx_t_1), ((PyArrayObject *)__pyx_t_15), ((PyArrayObject *)__pyx_t_2)) < 0.0) != 0);
6203 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6204 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6205 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6215 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -2
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
6216 __Pyx_GOTREF(__pyx_t_2);
6217 __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_2, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 202, __pyx_L1_error)
6218 __Pyx_GOTREF(__pyx_t_15);
6219 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6228 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -2
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error)
6229 __Pyx_GOTREF(__pyx_t_2);
6230 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error)
6231 __Pyx_GOTREF(__pyx_t_1);
6232 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6241 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -2
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error)
6242 __Pyx_GOTREF(__pyx_t_2);
6243 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 204, __pyx_L1_error)
6244 __Pyx_GOTREF(__pyx_t_16);
6245 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6254 __pyx_t_2 = PyList_New(3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
6255 __Pyx_GOTREF(__pyx_t_2);
6256 __Pyx_GIVEREF(__pyx_t_15);
6257 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_15);
6258 __Pyx_GIVEREF(__pyx_t_1);
6259 PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
6260 __Pyx_GIVEREF(__pyx_t_16);
6261 PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_16);
6265 if (unlikely(__Pyx_SetItemInt(__pyx_v_elements, -2
L, __pyx_t_2,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1) < 0)) __PYX_ERR(0, 202, __pyx_L1_error)
6266 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6284 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error)
6285 __Pyx_GOTREF(__pyx_t_2);
6286 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_plus, 1,
long, 1, __Pyx_PyInt_From_long, 1, 0, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 205, __pyx_L1_error)
6287 __Pyx_GOTREF(__pyx_t_16);
6288 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_16);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
6289 __Pyx_GOTREF(__pyx_t_1);
6290 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6291 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6292 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 205, __pyx_L1_error)
6293 __Pyx_GOTREF(__pyx_t_16);
6294 __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_16);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error)
6295 __Pyx_GOTREF(__pyx_t_2);
6296 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6297 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6298 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 205, __pyx_L1_error)
6307 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_nodes, -2
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 206, __pyx_L1_error)
6308 __Pyx_GOTREF(__pyx_t_16);
6309 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error)
6310 __Pyx_GOTREF(__pyx_t_1);
6311 __pyx_t_15 = PyNumber_Subtract(__pyx_t_16, __pyx_t_1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 206, __pyx_L1_error)
6312 __Pyx_GOTREF(__pyx_t_15);
6313 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6314 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6315 if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 206, __pyx_L1_error)
6324 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_nodes, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
6325 __Pyx_GOTREF(__pyx_t_1);
6326 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 207, __pyx_L1_error)
6327 __Pyx_GOTREF(__pyx_t_16);
6328 __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_16);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error)
6329 __Pyx_GOTREF(__pyx_t_3);
6330 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6331 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6332 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 207, __pyx_L1_error)
6341 __pyx_t_4 = ((__pyx_f_10Isosurface_etriple(((PyArrayObject *)__pyx_t_2), ((PyArrayObject *)__pyx_t_15), ((PyArrayObject *)__pyx_t_3)) < 0.0) != 0);
6342 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6343 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6344 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6354 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error)
6355 __Pyx_GOTREF(__pyx_t_3);
6356 __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_3, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 208, __pyx_L1_error)
6357 __Pyx_GOTREF(__pyx_t_15);
6358 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6367 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error)
6368 __Pyx_GOTREF(__pyx_t_3);
6369 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
6370 __Pyx_GOTREF(__pyx_t_2);
6371 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6380 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error)
6381 __Pyx_GOTREF(__pyx_t_3);
6382 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_3, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 210, __pyx_L1_error)
6383 __Pyx_GOTREF(__pyx_t_16);
6384 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6393 __pyx_t_3 = PyList_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error)
6394 __Pyx_GOTREF(__pyx_t_3);
6395 __Pyx_GIVEREF(__pyx_t_15);
6396 PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_15);
6397 __Pyx_GIVEREF(__pyx_t_2);
6398 PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
6399 __Pyx_GIVEREF(__pyx_t_16);
6400 PyList_SET_ITEM(__pyx_t_3, 2, __pyx_t_16);
6404 if (unlikely(__Pyx_SetItemInt(__pyx_v_elements, -1
L, __pyx_t_3,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1) < 0)) __PYX_ERR(0, 208, __pyx_L1_error)
6405 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6423 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -2
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error)
6424 __Pyx_GOTREF(__pyx_t_3);
6425 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_3, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 212, __pyx_L1_error)
6426 __Pyx_GOTREF(__pyx_t_16);
6427 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6428 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_16);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error)
6429 __Pyx_GOTREF(__pyx_t_3);
6430 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6431 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_elements, -2
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 212, __pyx_L1_error)
6432 __Pyx_GOTREF(__pyx_t_16);
6433 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_16, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error)
6434 __Pyx_GOTREF(__pyx_t_2);
6435 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6436 __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_2);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 212, __pyx_L1_error)
6437 __Pyx_GOTREF(__pyx_t_16);
6438 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6439 __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_16);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error)
6440 __Pyx_GOTREF(__pyx_t_2);
6441 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6442 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6443 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 212, __pyx_L1_error)
6452 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_elements, -2
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 213, __pyx_L1_error)
6453 __Pyx_GOTREF(__pyx_t_16);
6454 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_16, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error)
6455 __Pyx_GOTREF(__pyx_t_3);
6456 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6457 __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_3);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 213, __pyx_L1_error)
6458 __Pyx_GOTREF(__pyx_t_16);
6459 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6460 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -2
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error)
6461 __Pyx_GOTREF(__pyx_t_3);
6462 __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_3, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 213, __pyx_L1_error)
6463 __Pyx_GOTREF(__pyx_t_15);
6464 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6465 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_15);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error)
6466 __Pyx_GOTREF(__pyx_t_3);
6467 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6468 __pyx_t_15 = PyNumber_Subtract(__pyx_t_16, __pyx_t_3);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 213, __pyx_L1_error)
6469 __Pyx_GOTREF(__pyx_t_15);
6470 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6471 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6472 if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 213, __pyx_L1_error)
6481 __pyx_t_3 = ((PyObject *)__pyx_f_10Isosurface_ecross(((PyArrayObject *)__pyx_t_2), ((PyArrayObject *)__pyx_t_15)));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error)
6482 __Pyx_GOTREF(__pyx_t_3);
6483 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6484 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6486 __Pyx_BufFmt_StackElem __pyx_stack[1];
6487 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
6488 __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
6489 if (unlikely(__pyx_t_9 < 0)) {
6490 PyErr_Fetch(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
6491 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)__pyx_v_normal, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
6492 Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_19);
6493 __Pyx_RaiseBufferFallbackError();
6495 PyErr_Restore(__pyx_t_21, __pyx_t_20, __pyx_t_19);
6497 __pyx_t_21 = __pyx_t_20 = __pyx_t_19 = 0;
6499 __pyx_pybuffernd_normal.diminfo[0].strides = __pyx_pybuffernd_normal.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_normal.diminfo[0].shape = __pyx_pybuffernd_normal.rcbuffer->pybuffer.shape[0];
6500 if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 211, __pyx_L1_error)
6502 __Pyx_XDECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_3));
6512 __pyx_t_3 = PyFloat_FromDouble(__pyx_f_10Isosurface_enorm(((PyArrayObject *)__pyx_v_normal)));
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error)
6513 __Pyx_GOTREF(__pyx_t_3);
6514 __pyx_t_15 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_normal), __pyx_t_3);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 214, __pyx_L1_error)
6515 __Pyx_GOTREF(__pyx_t_15);
6516 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6517 if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 214, __pyx_L1_error)
6518 __pyx_t_18 = ((PyArrayObject *)__pyx_t_15);
6520 __Pyx_BufFmt_StackElem __pyx_stack[1];
6521 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
6522 __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
6523 if (unlikely(__pyx_t_9 < 0)) {
6524 PyErr_Fetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
6525 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)__pyx_v_normal, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
6526 Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21);
6527 __Pyx_RaiseBufferFallbackError();
6529 PyErr_Restore(__pyx_t_19, __pyx_t_20, __pyx_t_21);
6531 __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0;
6533 __pyx_pybuffernd_normal.diminfo[0].strides = __pyx_pybuffernd_normal.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_normal.diminfo[0].shape = __pyx_pybuffernd_normal.rcbuffer->pybuffer.shape[0];
6534 if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 214, __pyx_L1_error)
6537 __Pyx_DECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_15));
6547 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal));
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 215, __pyx_L1_error)
6556 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal));
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 216, __pyx_L1_error)
6565 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal));
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 217, __pyx_L1_error)
6574 __pyx_t_15 = __Pyx_GetItemInt_List(__pyx_v_elements, -2
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 218, __pyx_L1_error)
6575 __Pyx_GOTREF(__pyx_t_15);
6576 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normal_indices, __pyx_t_15);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 218, __pyx_L1_error)
6577 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6586 __pyx_t_15 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 220, __pyx_L1_error)
6587 __Pyx_GOTREF(__pyx_t_15);
6588 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_15, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error)
6589 __Pyx_GOTREF(__pyx_t_3);
6590 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6591 __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_3);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 220, __pyx_L1_error)
6592 __Pyx_GOTREF(__pyx_t_15);
6593 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6594 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error)
6595 __Pyx_GOTREF(__pyx_t_3);
6596 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error)
6597 __Pyx_GOTREF(__pyx_t_2);
6598 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6599 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error)
6600 __Pyx_GOTREF(__pyx_t_3);
6601 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6602 __pyx_t_2 = PyNumber_Subtract(__pyx_t_15, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error)
6603 __Pyx_GOTREF(__pyx_t_2);
6604 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6605 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6606 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 220, __pyx_L1_error)
6615 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L1_error)
6616 __Pyx_GOTREF(__pyx_t_3);
6617 __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_3, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 221, __pyx_L1_error)
6618 __Pyx_GOTREF(__pyx_t_15);
6619 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6620 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_15);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L1_error)
6621 __Pyx_GOTREF(__pyx_t_3);
6622 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6623 __pyx_t_15 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 221, __pyx_L1_error)
6624 __Pyx_GOTREF(__pyx_t_15);
6625 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_15, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 221, __pyx_L1_error)
6626 __Pyx_GOTREF(__pyx_t_16);
6627 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6628 __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_16);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 221, __pyx_L1_error)
6629 __Pyx_GOTREF(__pyx_t_15);
6630 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6631 __pyx_t_16 = PyNumber_Subtract(__pyx_t_3, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 221, __pyx_L1_error)
6632 __Pyx_GOTREF(__pyx_t_16);
6633 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6634 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6635 if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 221, __pyx_L1_error)
6644 __pyx_t_15 = ((PyObject *)__pyx_f_10Isosurface_ecross(((PyArrayObject *)__pyx_t_2), ((PyArrayObject *)__pyx_t_16)));
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 219, __pyx_L1_error)
6645 __Pyx_GOTREF(__pyx_t_15);
6646 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6647 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6649 __Pyx_BufFmt_StackElem __pyx_stack[1];
6650 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
6651 __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_15), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
6652 if (unlikely(__pyx_t_9 < 0)) {
6653 PyErr_Fetch(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
6654 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)__pyx_v_normal, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
6655 Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_19);
6656 __Pyx_RaiseBufferFallbackError();
6658 PyErr_Restore(__pyx_t_21, __pyx_t_20, __pyx_t_19);
6660 __pyx_t_21 = __pyx_t_20 = __pyx_t_19 = 0;
6662 __pyx_pybuffernd_normal.diminfo[0].strides = __pyx_pybuffernd_normal.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_normal.diminfo[0].shape = __pyx_pybuffernd_normal.rcbuffer->pybuffer.shape[0];
6663 if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 219, __pyx_L1_error)
6665 __Pyx_DECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_15));
6675 __pyx_t_15 = PyFloat_FromDouble(__pyx_f_10Isosurface_enorm(((PyArrayObject *)__pyx_v_normal)));
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 222, __pyx_L1_error)
6676 __Pyx_GOTREF(__pyx_t_15);
6677 __pyx_t_16 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_normal), __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 222, __pyx_L1_error)
6678 __Pyx_GOTREF(__pyx_t_16);
6679 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6680 if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 222, __pyx_L1_error)
6681 __pyx_t_18 = ((PyArrayObject *)__pyx_t_16);
6683 __Pyx_BufFmt_StackElem __pyx_stack[1];
6684 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
6685 __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
6686 if (unlikely(__pyx_t_9 < 0)) {
6687 PyErr_Fetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
6688 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)__pyx_v_normal, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
6689 Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21);
6690 __Pyx_RaiseBufferFallbackError();
6692 PyErr_Restore(__pyx_t_19, __pyx_t_20, __pyx_t_21);
6694 __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0;
6696 __pyx_pybuffernd_normal.diminfo[0].strides = __pyx_pybuffernd_normal.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_normal.diminfo[0].shape = __pyx_pybuffernd_normal.rcbuffer->pybuffer.shape[0];
6697 if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 222, __pyx_L1_error)
6700 __Pyx_DECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_16));
6710 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal));
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 223, __pyx_L1_error)
6719 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal));
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 224, __pyx_L1_error)
6728 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal));
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 225, __pyx_L1_error)
6737 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 226, __pyx_L1_error)
6738 __Pyx_GOTREF(__pyx_t_16);
6739 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normal_indices, __pyx_t_16);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 226, __pyx_L1_error)
6740 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6759 __pyx_t_13 = ((__pyx_v_nPlus == 3) != 0);
6762 __pyx_t_4 = __pyx_t_13;
6763 goto __pyx_L22_bool_binop_done;
6765 __pyx_t_13 = ((__pyx_v_nMinus == 1) != 0);
6766 __pyx_t_4 = __pyx_t_13;
6767 __pyx_L22_bool_binop_done:;
6777 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_minus, 0,
long, 1, __Pyx_PyInt_From_long, 1, 0, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 228, __pyx_L1_error)
6778 __Pyx_GOTREF(__pyx_t_16);
6779 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_16);
if (unlikely((__pyx_t_9 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 228, __pyx_L1_error)
6780 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6781 __pyx_v_I = __pyx_t_9;
6790 __pyx_t_16 = __pyx_v_plus; __Pyx_INCREF(__pyx_t_16); __pyx_t_12 = 0;
6792 if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_16))
break;
6793 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6794 __pyx_t_15 = PyList_GET_ITEM(__pyx_t_16, __pyx_t_12); __Pyx_INCREF(__pyx_t_15); __pyx_t_12++;
if (unlikely(0 < 0)) __PYX_ERR(0, 229, __pyx_L1_error)
6796 __pyx_t_15 = PySequence_ITEM(__pyx_t_16, __pyx_t_12); __pyx_t_12++;
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 229, __pyx_L1_error)
6797 __Pyx_GOTREF(__pyx_t_15);
6799 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_15);
if (unlikely((__pyx_t_9 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 229, __pyx_L1_error)
6800 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6801 __pyx_v_J = __pyx_t_9;
6810 __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 230, __pyx_L1_error)
6811 __Pyx_GOTREF(__pyx_t_15);
6812 __pyx_t_2 = PyNumber_Negative(__pyx_t_15);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error)
6813 __Pyx_GOTREF(__pyx_t_2);
6814 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6815 __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_J,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 230, __pyx_L1_error)
6816 __Pyx_GOTREF(__pyx_t_15);
6817 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error)
6818 __Pyx_GOTREF(__pyx_t_3);
6819 __pyx_t_1 = PyNumber_Subtract(__pyx_t_15, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
6820 __Pyx_GOTREF(__pyx_t_1);
6821 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6822 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6823 __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error)
6824 __Pyx_GOTREF(__pyx_t_3);
6825 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6826 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6827 __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_3);
if (unlikely((__pyx_t_17 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L1_error)
6828 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6829 __pyx_v_s = __pyx_t_17;
6838 __pyx_t_3 = PyFloat_FromDouble(__pyx_v_s);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error)
6839 __Pyx_GOTREF(__pyx_t_3);
6840 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
6841 __Pyx_GOTREF(__pyx_t_1);
6842 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_J,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
6843 __Pyx_GOTREF(__pyx_t_2);
6844 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6845 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
6846 __Pyx_GOTREF(__pyx_t_1);
6847 __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 231, __pyx_L1_error)
6848 __Pyx_GOTREF(__pyx_t_15);
6849 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6850 __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_15);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
6851 __Pyx_GOTREF(__pyx_t_1);
6852 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6853 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6854 __pyx_t_15 = PyNumber_Multiply(__pyx_t_3, __pyx_t_1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 231, __pyx_L1_error)
6855 __Pyx_GOTREF(__pyx_t_15);
6856 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6857 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6866 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
6867 __Pyx_GOTREF(__pyx_t_1);
6868 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error)
6869 __Pyx_GOTREF(__pyx_t_3);
6870 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6879 __pyx_t_1 = PyNumber_Add(__pyx_t_15, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
6880 __Pyx_GOTREF(__pyx_t_1);
6881 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6882 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6883 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 231, __pyx_L1_error)
6884 __pyx_t_18 = ((PyArrayObject *)__pyx_t_1);
6886 __Pyx_BufFmt_StackElem __pyx_stack[1];
6887 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
6888 __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
6889 if (unlikely(__pyx_t_9 < 0)) {
6890 PyErr_Fetch(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
6891 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
6892 Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_19);
6893 __Pyx_RaiseBufferFallbackError();
6895 PyErr_Restore(__pyx_t_21, __pyx_t_20, __pyx_t_19);
6897 __pyx_t_21 = __pyx_t_20 = __pyx_t_19 = 0;
6899 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0];
6900 if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 231, __pyx_L1_error)
6903 __Pyx_XDECREF_SET(__pyx_v_x, ((PyArrayObject *)__pyx_t_1));
6913 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_nodes, ((PyObject *)__pyx_v_x));
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 233, __pyx_L1_error)
6923 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6932 __pyx_t_16 = PyList_New(0);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 234, __pyx_L1_error)
6933 __Pyx_GOTREF(__pyx_t_16);
6934 for (__pyx_t_22 = 0; __pyx_t_22 < 3; __pyx_t_22+=1) {
6935 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_22);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
6936 __Pyx_GOTREF(__pyx_t_1);
6937 __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_1);
6939 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nN_start);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
6940 __Pyx_GOTREF(__pyx_t_1);
6941 __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_v_j);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 234, __pyx_L1_error)
6942 __Pyx_GOTREF(__pyx_t_3);
6943 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6944 if (unlikely(__Pyx_ListComp_Append(__pyx_t_16, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 234, __pyx_L1_error)
6945 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6947 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_elements, __pyx_t_16);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 234, __pyx_L1_error)
6948 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6957 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 235, __pyx_L1_error)
6958 __Pyx_GOTREF(__pyx_t_16);
6959 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_minus, 0,
long, 1, __Pyx_PyInt_From_long, 1, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error)
6960 __Pyx_GOTREF(__pyx_t_3);
6961 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_16, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
6962 __Pyx_GOTREF(__pyx_t_1);
6963 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6964 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6965 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error)
6966 __Pyx_GOTREF(__pyx_t_3);
6967 __pyx_t_16 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 235, __pyx_L1_error)
6968 __Pyx_GOTREF(__pyx_t_16);
6969 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6970 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6971 if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 235, __pyx_L1_error)
6980 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_nodes, -2
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error)
6981 __Pyx_GOTREF(__pyx_t_3);
6982 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error)
6983 __Pyx_GOTREF(__pyx_t_1);
6984 __pyx_t_15 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 236, __pyx_L1_error)
6985 __Pyx_GOTREF(__pyx_t_15);
6986 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6987 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6988 if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 236, __pyx_L1_error)
6997 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_nodes, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error)
6998 __Pyx_GOTREF(__pyx_t_1);
6999 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 237, __pyx_L1_error)
7000 __Pyx_GOTREF(__pyx_t_3);
7001 __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error)
7002 __Pyx_GOTREF(__pyx_t_2);
7003 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7004 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7005 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 237, __pyx_L1_error)
7014 __pyx_t_4 = ((__pyx_f_10Isosurface_etriple(((PyArrayObject *)__pyx_t_16), ((PyArrayObject *)__pyx_t_15), ((PyArrayObject *)__pyx_t_2)) > 0.0) != 0);
7015 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7016 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7017 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7027 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error)
7028 __Pyx_GOTREF(__pyx_t_2);
7029 __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_2, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 238, __pyx_L1_error)
7030 __Pyx_GOTREF(__pyx_t_15);
7031 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7040 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error)
7041 __Pyx_GOTREF(__pyx_t_2);
7042 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_2, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 239, __pyx_L1_error)
7043 __Pyx_GOTREF(__pyx_t_16);
7044 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7053 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error)
7054 __Pyx_GOTREF(__pyx_t_2);
7055 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L1_error)
7056 __Pyx_GOTREF(__pyx_t_3);
7057 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7066 __pyx_t_2 = PyList_New(3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error)
7067 __Pyx_GOTREF(__pyx_t_2);
7068 __Pyx_GIVEREF(__pyx_t_15);
7069 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_15);
7070 __Pyx_GIVEREF(__pyx_t_16);
7071 PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_16);
7072 __Pyx_GIVEREF(__pyx_t_3);
7073 PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_3);
7077 if (unlikely(__Pyx_SetItemInt(__pyx_v_elements, -1
L, __pyx_t_2,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1) < 0)) __PYX_ERR(0, 238, __pyx_L1_error)
7078 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7096 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
7097 __Pyx_GOTREF(__pyx_t_2);
7098 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error)
7099 __Pyx_GOTREF(__pyx_t_3);
7100 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7101 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
7102 __Pyx_GOTREF(__pyx_t_2);
7103 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7104 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error)
7105 __Pyx_GOTREF(__pyx_t_3);
7106 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_3, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 242, __pyx_L1_error)
7107 __Pyx_GOTREF(__pyx_t_16);
7108 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7109 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_16);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error)
7110 __Pyx_GOTREF(__pyx_t_3);
7111 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7112 __pyx_t_16 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 242, __pyx_L1_error)
7113 __Pyx_GOTREF(__pyx_t_16);
7114 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7115 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7116 if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 242, __pyx_L1_error)
7125 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error)
7126 __Pyx_GOTREF(__pyx_t_3);
7127 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error)
7128 __Pyx_GOTREF(__pyx_t_2);
7129 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7130 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error)
7131 __Pyx_GOTREF(__pyx_t_3);
7132 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7133 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error)
7134 __Pyx_GOTREF(__pyx_t_2);
7135 __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_2, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 243, __pyx_L1_error)
7136 __Pyx_GOTREF(__pyx_t_15);
7137 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7138 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_15);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error)
7139 __Pyx_GOTREF(__pyx_t_2);
7140 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7141 __pyx_t_15 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 243, __pyx_L1_error)
7142 __Pyx_GOTREF(__pyx_t_15);
7143 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7144 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7145 if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 243, __pyx_L1_error)
7154 __pyx_t_2 = ((PyObject *)__pyx_f_10Isosurface_ecross(((PyArrayObject *)__pyx_t_16), ((PyArrayObject *)__pyx_t_15)));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error)
7155 __Pyx_GOTREF(__pyx_t_2);
7156 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7157 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7159 __Pyx_BufFmt_StackElem __pyx_stack[1];
7160 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
7161 __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
7162 if (unlikely(__pyx_t_9 < 0)) {
7163 PyErr_Fetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
7164 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)__pyx_v_normal, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
7165 Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21);
7166 __Pyx_RaiseBufferFallbackError();
7168 PyErr_Restore(__pyx_t_19, __pyx_t_20, __pyx_t_21);
7170 __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0;
7172 __pyx_pybuffernd_normal.diminfo[0].strides = __pyx_pybuffernd_normal.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_normal.diminfo[0].shape = __pyx_pybuffernd_normal.rcbuffer->pybuffer.shape[0];
7173 if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 241, __pyx_L1_error)
7175 __Pyx_XDECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_2));
7185 __pyx_t_2 = PyFloat_FromDouble(__pyx_f_10Isosurface_enorm(((PyArrayObject *)__pyx_v_normal)));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __pyx_L1_error)
7186 __Pyx_GOTREF(__pyx_t_2);
7187 __pyx_t_15 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_normal), __pyx_t_2);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 244, __pyx_L1_error)
7188 __Pyx_GOTREF(__pyx_t_15);
7189 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7190 if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 244, __pyx_L1_error)
7191 __pyx_t_18 = ((PyArrayObject *)__pyx_t_15);
7193 __Pyx_BufFmt_StackElem __pyx_stack[1];
7194 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
7195 __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
7196 if (unlikely(__pyx_t_9 < 0)) {
7197 PyErr_Fetch(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
7198 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)__pyx_v_normal, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
7199 Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_19);
7200 __Pyx_RaiseBufferFallbackError();
7202 PyErr_Restore(__pyx_t_21, __pyx_t_20, __pyx_t_19);
7204 __pyx_t_21 = __pyx_t_20 = __pyx_t_19 = 0;
7206 __pyx_pybuffernd_normal.diminfo[0].strides = __pyx_pybuffernd_normal.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_normal.diminfo[0].shape = __pyx_pybuffernd_normal.rcbuffer->pybuffer.shape[0];
7207 if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 244, __pyx_L1_error)
7210 __Pyx_DECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_15));
7220 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal));
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 245, __pyx_L1_error)
7229 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal));
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 246, __pyx_L1_error)
7238 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal));
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 247, __pyx_L1_error)
7247 __pyx_t_15 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 248, __pyx_L1_error)
7248 __Pyx_GOTREF(__pyx_t_15);
7249 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normal_indices, __pyx_t_15);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 248, __pyx_L1_error)
7250 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7269 __pyx_t_13 = ((__pyx_v_nMinus == 3) != 0);
7272 __pyx_t_4 = __pyx_t_13;
7273 goto __pyx_L29_bool_binop_done;
7275 __pyx_t_13 = ((__pyx_v_nPlus == 1) != 0);
7276 __pyx_t_4 = __pyx_t_13;
7277 __pyx_L29_bool_binop_done:;
7287 __pyx_t_15 = __Pyx_GetItemInt_List(__pyx_v_plus, 0,
long, 1, __Pyx_PyInt_From_long, 1, 0, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 250, __pyx_L1_error)
7288 __Pyx_GOTREF(__pyx_t_15);
7289 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_15);
if (unlikely((__pyx_t_9 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 250, __pyx_L1_error)
7290 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7291 __pyx_v_I = __pyx_t_9;
7300 __pyx_t_15 = __pyx_v_minus; __Pyx_INCREF(__pyx_t_15); __pyx_t_12 = 0;
7302 if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_15))
break;
7303 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7304 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++;
if (unlikely(0 < 0)) __PYX_ERR(0, 251, __pyx_L1_error)
7306 __pyx_t_2 = PySequence_ITEM(__pyx_t_15, __pyx_t_12); __pyx_t_12++;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error)
7307 __Pyx_GOTREF(__pyx_t_2);
7309 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_9 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 251, __pyx_L1_error)
7310 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7311 __pyx_v_J = __pyx_t_9;
7320 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error)
7321 __Pyx_GOTREF(__pyx_t_2);
7322 __pyx_t_16 = PyNumber_Negative(__pyx_t_2);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 252, __pyx_L1_error)
7323 __Pyx_GOTREF(__pyx_t_16);
7324 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7325 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_J,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error)
7326 __Pyx_GOTREF(__pyx_t_2);
7327 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
7328 __Pyx_GOTREF(__pyx_t_3);
7329 __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error)
7330 __Pyx_GOTREF(__pyx_t_1);
7331 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7332 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7333 __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_16, __pyx_t_1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
7334 __Pyx_GOTREF(__pyx_t_3);
7335 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7336 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7337 __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_3);
if (unlikely((__pyx_t_17 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 252, __pyx_L1_error)
7338 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7339 __pyx_v_s = __pyx_t_17;
7348 __pyx_t_3 = PyFloat_FromDouble(__pyx_v_s);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error)
7349 __Pyx_GOTREF(__pyx_t_3);
7350 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error)
7351 __Pyx_GOTREF(__pyx_t_1);
7352 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_J,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 253, __pyx_L1_error)
7353 __Pyx_GOTREF(__pyx_t_16);
7354 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7355 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error)
7356 __Pyx_GOTREF(__pyx_t_1);
7357 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error)
7358 __Pyx_GOTREF(__pyx_t_2);
7359 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7360 __pyx_t_1 = PyNumber_Subtract(__pyx_t_16, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error)
7361 __Pyx_GOTREF(__pyx_t_1);
7362 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7363 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7364 __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error)
7365 __Pyx_GOTREF(__pyx_t_2);
7366 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7367 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7376 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error)
7377 __Pyx_GOTREF(__pyx_t_1);
7378 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 254, __pyx_L1_error)
7379 __Pyx_GOTREF(__pyx_t_3);
7380 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7389 __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error)
7390 __Pyx_GOTREF(__pyx_t_1);
7391 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7392 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7393 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 253, __pyx_L1_error)
7394 __pyx_t_18 = ((PyArrayObject *)__pyx_t_1);
7396 __Pyx_BufFmt_StackElem __pyx_stack[1];
7397 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
7398 __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
7399 if (unlikely(__pyx_t_9 < 0)) {
7400 PyErr_Fetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
7401 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
7402 Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21);
7403 __Pyx_RaiseBufferFallbackError();
7405 PyErr_Restore(__pyx_t_19, __pyx_t_20, __pyx_t_21);
7407 __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0;
7409 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0];
7410 if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 253, __pyx_L1_error)
7413 __Pyx_XDECREF_SET(__pyx_v_x, ((PyArrayObject *)__pyx_t_1));
7423 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_nodes, ((PyObject *)__pyx_v_x));
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 255, __pyx_L1_error)
7433 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7442 __pyx_t_15 = PyList_New(0);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 256, __pyx_L1_error)
7443 __Pyx_GOTREF(__pyx_t_15);
7444 for (__pyx_t_22 = 0; __pyx_t_22 < 3; __pyx_t_22+=1) {
7445 __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_22);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
7446 __Pyx_GOTREF(__pyx_t_1);
7447 __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_1);
7449 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nN_start);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
7450 __Pyx_GOTREF(__pyx_t_1);
7451 __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_v_j);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error)
7452 __Pyx_GOTREF(__pyx_t_3);
7453 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7454 if (unlikely(__Pyx_ListComp_Append(__pyx_t_15, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 256, __pyx_L1_error)
7455 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7457 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_elements, __pyx_t_15);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 256, __pyx_L1_error)
7458 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7467 __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 257, __pyx_L1_error)
7468 __Pyx_GOTREF(__pyx_t_15);
7469 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_plus, 0,
long, 1, __Pyx_PyInt_From_long, 1, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error)
7470 __Pyx_GOTREF(__pyx_t_3);
7471 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_15, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error)
7472 __Pyx_GOTREF(__pyx_t_1);
7473 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7474 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7475 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error)
7476 __Pyx_GOTREF(__pyx_t_3);
7477 __pyx_t_15 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 257, __pyx_L1_error)
7478 __Pyx_GOTREF(__pyx_t_15);
7479 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7480 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7481 if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 257, __pyx_L1_error)
7490 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_nodes, -2
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error)
7491 __Pyx_GOTREF(__pyx_t_3);
7492 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error)
7493 __Pyx_GOTREF(__pyx_t_1);
7494 __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error)
7495 __Pyx_GOTREF(__pyx_t_2);
7496 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7497 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7498 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 258, __pyx_L1_error)
7507 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_nodes, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
7508 __Pyx_GOTREF(__pyx_t_1);
7509 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error)
7510 __Pyx_GOTREF(__pyx_t_3);
7511 __pyx_t_16 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 259, __pyx_L1_error)
7512 __Pyx_GOTREF(__pyx_t_16);
7513 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7514 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7515 if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 259, __pyx_L1_error)
7524 __pyx_t_4 = ((__pyx_f_10Isosurface_etriple(((PyArrayObject *)__pyx_t_15), ((PyArrayObject *)__pyx_t_2), ((PyArrayObject *)__pyx_t_16)) < 0.0) != 0);
7525 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7526 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7527 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7537 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 260, __pyx_L1_error)
7538 __Pyx_GOTREF(__pyx_t_16);
7539 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_16, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
7540 __Pyx_GOTREF(__pyx_t_2);
7541 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7550 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 261, __pyx_L1_error)
7551 __Pyx_GOTREF(__pyx_t_16);
7552 __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_16, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 261, __pyx_L1_error)
7553 __Pyx_GOTREF(__pyx_t_15);
7554 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7563 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 262, __pyx_L1_error)
7564 __Pyx_GOTREF(__pyx_t_16);
7565 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_16, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error)
7566 __Pyx_GOTREF(__pyx_t_3);
7567 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7576 __pyx_t_16 = PyList_New(3);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 260, __pyx_L1_error)
7577 __Pyx_GOTREF(__pyx_t_16);
7578 __Pyx_GIVEREF(__pyx_t_2);
7579 PyList_SET_ITEM(__pyx_t_16, 0, __pyx_t_2);
7580 __Pyx_GIVEREF(__pyx_t_15);
7581 PyList_SET_ITEM(__pyx_t_16, 1, __pyx_t_15);
7582 __Pyx_GIVEREF(__pyx_t_3);
7583 PyList_SET_ITEM(__pyx_t_16, 2, __pyx_t_3);
7587 if (unlikely(__Pyx_SetItemInt(__pyx_v_elements, -1
L, __pyx_t_16,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1) < 0)) __PYX_ERR(0, 260, __pyx_L1_error)
7588 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7606 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 264, __pyx_L1_error)
7607 __Pyx_GOTREF(__pyx_t_16);
7608 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_16, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error)
7609 __Pyx_GOTREF(__pyx_t_3);
7610 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7611 __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_3);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 264, __pyx_L1_error)
7612 __Pyx_GOTREF(__pyx_t_16);
7613 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7614 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error)
7615 __Pyx_GOTREF(__pyx_t_3);
7616 __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_3, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 264, __pyx_L1_error)
7617 __Pyx_GOTREF(__pyx_t_15);
7618 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7619 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_15);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error)
7620 __Pyx_GOTREF(__pyx_t_3);
7621 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7622 __pyx_t_15 = PyNumber_Subtract(__pyx_t_16, __pyx_t_3);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 264, __pyx_L1_error)
7623 __Pyx_GOTREF(__pyx_t_15);
7624 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7625 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7626 if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 264, __pyx_L1_error)
7635 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error)
7636 __Pyx_GOTREF(__pyx_t_3);
7637 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_3, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 265, __pyx_L1_error)
7638 __Pyx_GOTREF(__pyx_t_16);
7639 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7640 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_16);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error)
7641 __Pyx_GOTREF(__pyx_t_3);
7642 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7643 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 265, __pyx_L1_error)
7644 __Pyx_GOTREF(__pyx_t_16);
7645 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_16, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error)
7646 __Pyx_GOTREF(__pyx_t_2);
7647 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7648 __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_2);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 265, __pyx_L1_error)
7649 __Pyx_GOTREF(__pyx_t_16);
7650 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7651 __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_16);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error)
7652 __Pyx_GOTREF(__pyx_t_2);
7653 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7654 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7655 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 265, __pyx_L1_error)
7664 __pyx_t_16 = ((PyObject *)__pyx_f_10Isosurface_ecross(((PyArrayObject *)__pyx_t_15), ((PyArrayObject *)__pyx_t_2)));
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 263, __pyx_L1_error)
7665 __Pyx_GOTREF(__pyx_t_16);
7666 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7667 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7669 __Pyx_BufFmt_StackElem __pyx_stack[1];
7670 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
7671 __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_16), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
7672 if (unlikely(__pyx_t_9 < 0)) {
7673 PyErr_Fetch(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
7674 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)__pyx_v_normal, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
7675 Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_19);
7676 __Pyx_RaiseBufferFallbackError();
7678 PyErr_Restore(__pyx_t_21, __pyx_t_20, __pyx_t_19);
7680 __pyx_t_21 = __pyx_t_20 = __pyx_t_19 = 0;
7682 __pyx_pybuffernd_normal.diminfo[0].strides = __pyx_pybuffernd_normal.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_normal.diminfo[0].shape = __pyx_pybuffernd_normal.rcbuffer->pybuffer.shape[0];
7683 if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 263, __pyx_L1_error)
7685 __Pyx_XDECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_16));
7695 __pyx_t_16 = PyFloat_FromDouble(__pyx_f_10Isosurface_enorm(((PyArrayObject *)__pyx_v_normal)));
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 266, __pyx_L1_error)
7696 __Pyx_GOTREF(__pyx_t_16);
7697 __pyx_t_2 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_normal), __pyx_t_16);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error)
7698 __Pyx_GOTREF(__pyx_t_2);
7699 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7700 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 266, __pyx_L1_error)
7701 __pyx_t_18 = ((PyArrayObject *)__pyx_t_2);
7703 __Pyx_BufFmt_StackElem __pyx_stack[1];
7704 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
7705 __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
7706 if (unlikely(__pyx_t_9 < 0)) {
7707 PyErr_Fetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
7708 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)__pyx_v_normal, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
7709 Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21);
7710 __Pyx_RaiseBufferFallbackError();
7712 PyErr_Restore(__pyx_t_19, __pyx_t_20, __pyx_t_21);
7714 __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0;
7716 __pyx_pybuffernd_normal.diminfo[0].strides = __pyx_pybuffernd_normal.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_normal.diminfo[0].shape = __pyx_pybuffernd_normal.rcbuffer->pybuffer.shape[0];
7717 if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 266, __pyx_L1_error)
7720 __Pyx_DECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_2));
7730 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal));
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 267, __pyx_L1_error)
7739 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal));
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 268, __pyx_L1_error)
7748 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal));
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 269, __pyx_L1_error)
7757 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __pyx_L1_error)
7758 __Pyx_GOTREF(__pyx_t_2);
7759 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normal_indices, __pyx_t_2);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 270, __pyx_L1_error)
7760 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7779 __pyx_t_13 = ((__pyx_v_nZeros == 1) != 0);
7782 __pyx_t_4 = __pyx_t_13;
7783 goto __pyx_L36_bool_binop_done;
7785 __pyx_t_13 = ((__pyx_v_nPlus == 2) != 0);
7787 goto __pyx_L38_next_or;
7790 __pyx_t_13 = ((__pyx_v_nMinus == 1) != 0);
7793 __pyx_t_4 = __pyx_t_13;
7794 goto __pyx_L36_bool_binop_done;
7805 __pyx_t_13 = ((__pyx_v_nPlus == 1) != 0);
7808 __pyx_t_4 = __pyx_t_13;
7809 goto __pyx_L36_bool_binop_done;
7811 __pyx_t_13 = ((__pyx_v_nMinus == 2) != 0);
7812 __pyx_t_4 = __pyx_t_13;
7813 __pyx_L36_bool_binop_done:;
7831 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error)
7832 __Pyx_GOTREF(__pyx_t_2);
7833 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_zeros, 0,
long, 1, __Pyx_PyInt_From_long, 1, 0, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 274, __pyx_L1_error)
7834 __Pyx_GOTREF(__pyx_t_16);
7835 __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_16);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 274, __pyx_L1_error)
7836 __Pyx_GOTREF(__pyx_t_15);
7837 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7838 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7839 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_nodes, __pyx_t_15);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 274, __pyx_L1_error)
7840 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7849 __pyx_t_15 = __pyx_v_minus; __Pyx_INCREF(__pyx_t_15); __pyx_t_12 = 0;
7851 if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_15))
break;
7852 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7853 __pyx_t_16 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_12); __Pyx_INCREF(__pyx_t_16); __pyx_t_12++;
if (unlikely(0 < 0)) __PYX_ERR(0, 275, __pyx_L1_error)
7855 __pyx_t_16 = PySequence_ITEM(__pyx_t_15, __pyx_t_12); __pyx_t_12++;
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 275, __pyx_L1_error)
7856 __Pyx_GOTREF(__pyx_t_16);
7858 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_16);
if (unlikely((__pyx_t_9 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 275, __pyx_L1_error)
7859 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7860 __pyx_v_J = __pyx_t_9;
7869 __pyx_t_16 = __pyx_v_plus; __Pyx_INCREF(__pyx_t_16); __pyx_t_14 = 0;
7871 if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_16))
break;
7872 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7873 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_16, __pyx_t_14); __Pyx_INCREF(__pyx_t_2); __pyx_t_14++;
if (unlikely(0 < 0)) __PYX_ERR(0, 276, __pyx_L1_error)
7875 __pyx_t_2 = PySequence_ITEM(__pyx_t_16, __pyx_t_14); __pyx_t_14++;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error)
7876 __Pyx_GOTREF(__pyx_t_2);
7878 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_9 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 276, __pyx_L1_error)
7879 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7880 __pyx_v_I = __pyx_t_9;
7889 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error)
7890 __Pyx_GOTREF(__pyx_t_2);
7891 __pyx_t_3 = PyNumber_Negative(__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error)
7892 __Pyx_GOTREF(__pyx_t_3);
7893 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7894 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_J,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error)
7895 __Pyx_GOTREF(__pyx_t_2);
7896 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
7897 __Pyx_GOTREF(__pyx_t_1);
7898 __pyx_t_5 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 277, __pyx_L1_error)
7899 __Pyx_GOTREF(__pyx_t_5);
7900 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7901 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7902 __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
7903 __Pyx_GOTREF(__pyx_t_1);
7904 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7905 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7906 __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_1);
if (unlikely((__pyx_t_17 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 277, __pyx_L1_error)
7907 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7908 __pyx_v_s = __pyx_t_17;
7917 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_s);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error)
7918 __Pyx_GOTREF(__pyx_t_1);
7919 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 278, __pyx_L1_error)
7920 __Pyx_GOTREF(__pyx_t_5);
7921 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_J,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error)
7922 __Pyx_GOTREF(__pyx_t_3);
7923 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7924 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 278, __pyx_L1_error)
7925 __Pyx_GOTREF(__pyx_t_5);
7926 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error)
7927 __Pyx_GOTREF(__pyx_t_2);
7928 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7929 __pyx_t_5 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 278, __pyx_L1_error)
7930 __Pyx_GOTREF(__pyx_t_5);
7931 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7932 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7933 __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error)
7934 __Pyx_GOTREF(__pyx_t_2);
7935 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7936 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7945 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error)
7946 __Pyx_GOTREF(__pyx_t_5);
7947 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
7948 __Pyx_GOTREF(__pyx_t_1);
7949 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7950 __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error)
7951 __Pyx_GOTREF(__pyx_t_5);
7952 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7953 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7954 if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 279, __pyx_L1_error)
7955 __pyx_t_18 = ((PyArrayObject *)__pyx_t_5);
7957 __Pyx_BufFmt_StackElem __pyx_stack[1];
7958 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
7959 __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
7960 if (unlikely(__pyx_t_9 < 0)) {
7961 PyErr_Fetch(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
7962 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
7963 Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_19);
7964 __Pyx_RaiseBufferFallbackError();
7966 PyErr_Restore(__pyx_t_21, __pyx_t_20, __pyx_t_19);
7968 __pyx_t_21 = __pyx_t_20 = __pyx_t_19 = 0;
7970 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0];
7971 if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 278, __pyx_L1_error)
7974 __Pyx_XDECREF_SET(__pyx_v_x, ((PyArrayObject *)__pyx_t_5));
7984 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_nodes, ((PyObject *)__pyx_v_x));
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 280, __pyx_L1_error)
7994 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8004 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8013 __pyx_t_15 = PyList_New(0);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 281, __pyx_L1_error)
8014 __Pyx_GOTREF(__pyx_t_15);
8015 for (__pyx_t_22 = 0; __pyx_t_22 < 3; __pyx_t_22+=1) {
8016 __pyx_t_16 = __Pyx_PyInt_From_long(__pyx_t_22);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 281, __pyx_L1_error)
8017 __Pyx_GOTREF(__pyx_t_16);
8018 __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_16);
8020 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_nN_start);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 281, __pyx_L1_error)
8021 __Pyx_GOTREF(__pyx_t_16);
8022 __pyx_t_5 = PyNumber_Add(__pyx_t_16, __pyx_v_j);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 281, __pyx_L1_error)
8023 __Pyx_GOTREF(__pyx_t_5);
8024 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8025 if (unlikely(__Pyx_ListComp_Append(__pyx_t_15, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 281, __pyx_L1_error)
8026 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8028 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_elements, __pyx_t_15);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 281, __pyx_L1_error)
8029 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8038 __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 282, __pyx_L1_error)
8039 __Pyx_GOTREF(__pyx_t_15);
8040 __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_plus, 0,
long, 1, __Pyx_PyInt_From_long, 1, 0, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 282, __pyx_L1_error)
8041 __Pyx_GOTREF(__pyx_t_5);
8042 __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_t_15, __pyx_t_5);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 282, __pyx_L1_error)
8043 __Pyx_GOTREF(__pyx_t_16);
8044 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8045 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8046 __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 282, __pyx_L1_error)
8047 __Pyx_GOTREF(__pyx_t_5);
8048 __pyx_t_15 = PyNumber_Subtract(__pyx_t_16, __pyx_t_5);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 282, __pyx_L1_error)
8049 __Pyx_GOTREF(__pyx_t_15);
8050 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8051 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8052 if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 282, __pyx_L1_error)
8061 __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_nodes, -2
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 283, __pyx_L1_error)
8062 __Pyx_GOTREF(__pyx_t_5);
8063 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 283, __pyx_L1_error)
8064 __Pyx_GOTREF(__pyx_t_16);
8065 __pyx_t_1 = PyNumber_Subtract(__pyx_t_5, __pyx_t_16);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error)
8066 __Pyx_GOTREF(__pyx_t_1);
8067 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8068 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8069 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 283, __pyx_L1_error)
8078 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_nodes, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 284, __pyx_L1_error)
8079 __Pyx_GOTREF(__pyx_t_16);
8080 __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error)
8081 __Pyx_GOTREF(__pyx_t_5);
8082 __pyx_t_2 = PyNumber_Subtract(__pyx_t_16, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error)
8083 __Pyx_GOTREF(__pyx_t_2);
8084 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8085 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8086 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 284, __pyx_L1_error)
8095 __pyx_t_4 = ((__pyx_f_10Isosurface_etriple(((PyArrayObject *)__pyx_t_15), ((PyArrayObject *)__pyx_t_1), ((PyArrayObject *)__pyx_t_2)) < 0.0) != 0);
8096 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8097 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8098 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8108 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error)
8109 __Pyx_GOTREF(__pyx_t_2);
8110 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error)
8111 __Pyx_GOTREF(__pyx_t_1);
8112 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8121 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error)
8122 __Pyx_GOTREF(__pyx_t_2);
8123 __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_2, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 286, __pyx_L1_error)
8124 __Pyx_GOTREF(__pyx_t_15);
8125 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8134 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 287, __pyx_L1_error)
8135 __Pyx_GOTREF(__pyx_t_2);
8136 __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 287, __pyx_L1_error)
8137 __Pyx_GOTREF(__pyx_t_5);
8138 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8147 __pyx_t_2 = PyList_New(3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error)
8148 __Pyx_GOTREF(__pyx_t_2);
8149 __Pyx_GIVEREF(__pyx_t_1);
8150 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
8151 __Pyx_GIVEREF(__pyx_t_15);
8152 PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_15);
8153 __Pyx_GIVEREF(__pyx_t_5);
8154 PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
8158 if (unlikely(__Pyx_SetItemInt(__pyx_v_elements, -1
L, __pyx_t_2,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1) < 0)) __PYX_ERR(0, 285, __pyx_L1_error)
8159 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8177 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error)
8178 __Pyx_GOTREF(__pyx_t_2);
8179 __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error)
8180 __Pyx_GOTREF(__pyx_t_5);
8181 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8182 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error)
8183 __Pyx_GOTREF(__pyx_t_2);
8184 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8185 __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error)
8186 __Pyx_GOTREF(__pyx_t_5);
8187 __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_5, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 289, __pyx_L1_error)
8188 __Pyx_GOTREF(__pyx_t_15);
8189 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8190 __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_15);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error)
8191 __Pyx_GOTREF(__pyx_t_5);
8192 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8193 __pyx_t_15 = PyNumber_Subtract(__pyx_t_2, __pyx_t_5);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 289, __pyx_L1_error)
8194 __Pyx_GOTREF(__pyx_t_15);
8195 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8196 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8197 if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 289, __pyx_L1_error)
8206 __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 290, __pyx_L1_error)
8207 __Pyx_GOTREF(__pyx_t_5);
8208 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_5, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error)
8209 __Pyx_GOTREF(__pyx_t_2);
8210 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8211 __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_2);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 290, __pyx_L1_error)
8212 __Pyx_GOTREF(__pyx_t_5);
8213 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8214 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error)
8215 __Pyx_GOTREF(__pyx_t_2);
8216 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error)
8217 __Pyx_GOTREF(__pyx_t_1);
8218 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8219 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error)
8220 __Pyx_GOTREF(__pyx_t_2);
8221 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8222 __pyx_t_1 = PyNumber_Subtract(__pyx_t_5, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error)
8223 __Pyx_GOTREF(__pyx_t_1);
8224 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8225 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8226 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 290, __pyx_L1_error)
8235 __pyx_t_2 = ((PyObject *)__pyx_f_10Isosurface_ecross(((PyArrayObject *)__pyx_t_15), ((PyArrayObject *)__pyx_t_1)));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error)
8236 __Pyx_GOTREF(__pyx_t_2);
8237 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8238 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8240 __Pyx_BufFmt_StackElem __pyx_stack[1];
8241 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
8242 __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_2), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
8243 if (unlikely(__pyx_t_9 < 0)) {
8244 PyErr_Fetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
8245 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)__pyx_v_normal, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
8246 Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21);
8247 __Pyx_RaiseBufferFallbackError();
8249 PyErr_Restore(__pyx_t_19, __pyx_t_20, __pyx_t_21);
8251 __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0;
8253 __pyx_pybuffernd_normal.diminfo[0].strides = __pyx_pybuffernd_normal.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_normal.diminfo[0].shape = __pyx_pybuffernd_normal.rcbuffer->pybuffer.shape[0];
8254 if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 288, __pyx_L1_error)
8256 __Pyx_XDECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_2));
8266 __pyx_t_2 = PyFloat_FromDouble(__pyx_f_10Isosurface_enorm(((PyArrayObject *)__pyx_v_normal)));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error)
8267 __Pyx_GOTREF(__pyx_t_2);
8268 __pyx_t_1 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_normal), __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error)
8269 __Pyx_GOTREF(__pyx_t_1);
8270 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8271 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 291, __pyx_L1_error)
8272 __pyx_t_18 = ((PyArrayObject *)__pyx_t_1);
8274 __Pyx_BufFmt_StackElem __pyx_stack[1];
8275 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
8276 __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
8277 if (unlikely(__pyx_t_9 < 0)) {
8278 PyErr_Fetch(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
8279 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)__pyx_v_normal, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
8280 Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_19);
8281 __Pyx_RaiseBufferFallbackError();
8283 PyErr_Restore(__pyx_t_21, __pyx_t_20, __pyx_t_19);
8285 __pyx_t_21 = __pyx_t_20 = __pyx_t_19 = 0;
8287 __pyx_pybuffernd_normal.diminfo[0].strides = __pyx_pybuffernd_normal.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_normal.diminfo[0].shape = __pyx_pybuffernd_normal.rcbuffer->pybuffer.shape[0];
8288 if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 291, __pyx_L1_error)
8291 __Pyx_DECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_1));
8301 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal));
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 292, __pyx_L1_error)
8310 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal));
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 293, __pyx_L1_error)
8319 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal));
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 294, __pyx_L1_error)
8328 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error)
8329 __Pyx_GOTREF(__pyx_t_1);
8330 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normal_indices, __pyx_t_1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 295, __pyx_L1_error)
8331 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8350 __pyx_t_13 = ((__pyx_v_nZeros == 2) != 0);
8353 __pyx_t_4 = __pyx_t_13;
8354 goto __pyx_L48_bool_binop_done;
8356 __pyx_t_13 = ((__pyx_v_nPlus == 1) != 0);
8359 __pyx_t_4 = __pyx_t_13;
8360 goto __pyx_L48_bool_binop_done;
8362 __pyx_t_13 = ((__pyx_v_nMinus == 1) != 0);
8363 __pyx_t_4 = __pyx_t_13;
8364 __pyx_L48_bool_binop_done:;
8374 __pyx_t_1 = __pyx_v_zeros; __Pyx_INCREF(__pyx_t_1); __pyx_t_12 = 0;
8376 if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_1))
break;
8377 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8378 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_2); __pyx_t_12++;
if (unlikely(0 < 0)) __PYX_ERR(0, 298, __pyx_L1_error)
8380 __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_12); __pyx_t_12++;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error)
8381 __Pyx_GOTREF(__pyx_t_2);
8383 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_9 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 298, __pyx_L1_error)
8384 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8385 __pyx_v_I = __pyx_t_9;
8394 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error)
8395 __Pyx_GOTREF(__pyx_t_2);
8396 __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 299, __pyx_L1_error)
8397 __Pyx_GOTREF(__pyx_t_15);
8398 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8399 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_nodes, __pyx_t_15);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 299, __pyx_L1_error)
8400 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8410 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8419 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_plus, 0,
long, 1, __Pyx_PyInt_From_long, 1, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error)
8420 __Pyx_GOTREF(__pyx_t_1);
8421 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_9 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 300, __pyx_L1_error)
8422 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8423 __pyx_v_I = __pyx_t_9;
8432 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_minus, 0,
long, 1, __Pyx_PyInt_From_long, 1, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error)
8433 __Pyx_GOTREF(__pyx_t_1);
8434 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_9 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 301, __pyx_L1_error)
8435 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8436 __pyx_v_J = __pyx_t_9;
8445 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
8446 __Pyx_GOTREF(__pyx_t_1);
8447 __pyx_t_15 = PyNumber_Negative(__pyx_t_1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 302, __pyx_L1_error)
8448 __Pyx_GOTREF(__pyx_t_15);
8449 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8450 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_J,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
8451 __Pyx_GOTREF(__pyx_t_1);
8452 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error)
8453 __Pyx_GOTREF(__pyx_t_2);
8454 __pyx_t_5 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 302, __pyx_L1_error)
8455 __Pyx_GOTREF(__pyx_t_5);
8456 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8457 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8458 __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_15, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error)
8459 __Pyx_GOTREF(__pyx_t_2);
8460 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8461 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8462 __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_2);
if (unlikely((__pyx_t_17 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L1_error)
8463 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8464 __pyx_v_s = __pyx_t_17;
8473 __pyx_t_2 = PyFloat_FromDouble(__pyx_v_s);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error)
8474 __Pyx_GOTREF(__pyx_t_2);
8475 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 303, __pyx_L1_error)
8476 __Pyx_GOTREF(__pyx_t_5);
8477 __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_J,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 303, __pyx_L1_error)
8478 __Pyx_GOTREF(__pyx_t_15);
8479 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8480 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 303, __pyx_L1_error)
8481 __Pyx_GOTREF(__pyx_t_5);
8482 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
8483 __Pyx_GOTREF(__pyx_t_1);
8484 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8485 __pyx_t_5 = PyNumber_Subtract(__pyx_t_15, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 303, __pyx_L1_error)
8486 __Pyx_GOTREF(__pyx_t_5);
8487 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8488 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8489 __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_t_5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
8490 __Pyx_GOTREF(__pyx_t_1);
8491 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8492 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8501 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 304, __pyx_L1_error)
8502 __Pyx_GOTREF(__pyx_t_5);
8503 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error)
8504 __Pyx_GOTREF(__pyx_t_2);
8505 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8506 __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 304, __pyx_L1_error)
8507 __Pyx_GOTREF(__pyx_t_5);
8508 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8509 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8510 if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 304, __pyx_L1_error)
8511 __pyx_t_18 = ((PyArrayObject *)__pyx_t_5);
8513 __Pyx_BufFmt_StackElem __pyx_stack[1];
8514 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
8515 __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
8516 if (unlikely(__pyx_t_9 < 0)) {
8517 PyErr_Fetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
8518 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
8519 Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21);
8520 __Pyx_RaiseBufferFallbackError();
8522 PyErr_Restore(__pyx_t_19, __pyx_t_20, __pyx_t_21);
8524 __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0;
8526 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0];
8527 if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 303, __pyx_L1_error)
8530 __Pyx_XDECREF_SET(__pyx_v_x, ((PyArrayObject *)__pyx_t_5));
8540 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_nodes, ((PyObject *)__pyx_v_x));
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 305, __pyx_L1_error)
8549 __pyx_t_5 = PyList_New(0);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error)
8550 __Pyx_GOTREF(__pyx_t_5);
8551 for (__pyx_t_22 = 0; __pyx_t_22 < 3; __pyx_t_22+=1) {
8552 __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_t_22);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error)
8553 __Pyx_GOTREF(__pyx_t_2);
8554 __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_2);
8556 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nN_start);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error)
8557 __Pyx_GOTREF(__pyx_t_2);
8558 __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_j);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error)
8559 __Pyx_GOTREF(__pyx_t_1);
8560 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8561 if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 306, __pyx_L1_error)
8562 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8564 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_elements, __pyx_t_5);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 306, __pyx_L1_error)
8565 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8574 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 307, __pyx_L1_error)
8575 __Pyx_GOTREF(__pyx_t_5);
8576 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_plus, 0,
long, 1, __Pyx_PyInt_From_long, 1, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
8577 __Pyx_GOTREF(__pyx_t_1);
8578 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error)
8579 __Pyx_GOTREF(__pyx_t_2);
8580 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8581 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8582 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
8583 __Pyx_GOTREF(__pyx_t_1);
8584 __pyx_t_5 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 307, __pyx_L1_error)
8585 __Pyx_GOTREF(__pyx_t_5);
8586 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8587 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8588 if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 307, __pyx_L1_error)
8597 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_nodes, -2
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error)
8598 __Pyx_GOTREF(__pyx_t_1);
8599 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L1_error)
8600 __Pyx_GOTREF(__pyx_t_2);
8601 __pyx_t_15 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 308, __pyx_L1_error)
8602 __Pyx_GOTREF(__pyx_t_15);
8603 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8604 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8605 if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 308, __pyx_L1_error)
8614 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_nodes, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 309, __pyx_L1_error)
8615 __Pyx_GOTREF(__pyx_t_2);
8616 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error)
8617 __Pyx_GOTREF(__pyx_t_1);
8618 __pyx_t_16 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 309, __pyx_L1_error)
8619 __Pyx_GOTREF(__pyx_t_16);
8620 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8621 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8622 if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 309, __pyx_L1_error)
8631 __pyx_t_4 = ((__pyx_f_10Isosurface_etriple(((PyArrayObject *)__pyx_t_5), ((PyArrayObject *)__pyx_t_15), ((PyArrayObject *)__pyx_t_16)) < 0.0) != 0);
8632 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8633 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8634 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8644 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 310, __pyx_L1_error)
8645 __Pyx_GOTREF(__pyx_t_16);
8646 __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_16, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 310, __pyx_L1_error)
8647 __Pyx_GOTREF(__pyx_t_15);
8648 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8657 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 311, __pyx_L1_error)
8658 __Pyx_GOTREF(__pyx_t_16);
8659 __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_16, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 311, __pyx_L1_error)
8660 __Pyx_GOTREF(__pyx_t_5);
8661 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8670 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 312, __pyx_L1_error)
8671 __Pyx_GOTREF(__pyx_t_16);
8672 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_16, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error)
8673 __Pyx_GOTREF(__pyx_t_1);
8674 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8683 __pyx_t_16 = PyList_New(3);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 310, __pyx_L1_error)
8684 __Pyx_GOTREF(__pyx_t_16);
8685 __Pyx_GIVEREF(__pyx_t_15);
8686 PyList_SET_ITEM(__pyx_t_16, 0, __pyx_t_15);
8687 __Pyx_GIVEREF(__pyx_t_5);
8688 PyList_SET_ITEM(__pyx_t_16, 1, __pyx_t_5);
8689 __Pyx_GIVEREF(__pyx_t_1);
8690 PyList_SET_ITEM(__pyx_t_16, 2, __pyx_t_1);
8694 if (unlikely(__Pyx_SetItemInt(__pyx_v_elements, -1
L, __pyx_t_16,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1) < 0)) __PYX_ERR(0, 310, __pyx_L1_error)
8695 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8713 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 314, __pyx_L1_error)
8714 __Pyx_GOTREF(__pyx_t_16);
8715 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_16, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __pyx_L1_error)
8716 __Pyx_GOTREF(__pyx_t_1);
8717 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8718 __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 314, __pyx_L1_error)
8719 __Pyx_GOTREF(__pyx_t_16);
8720 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8721 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __pyx_L1_error)
8722 __Pyx_GOTREF(__pyx_t_1);
8723 __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 314, __pyx_L1_error)
8724 __Pyx_GOTREF(__pyx_t_5);
8725 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8726 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __pyx_L1_error)
8727 __Pyx_GOTREF(__pyx_t_1);
8728 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8729 __pyx_t_5 = PyNumber_Subtract(__pyx_t_16, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 314, __pyx_L1_error)
8730 __Pyx_GOTREF(__pyx_t_5);
8731 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8732 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8733 if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 314, __pyx_L1_error)
8742 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error)
8743 __Pyx_GOTREF(__pyx_t_1);
8744 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_1, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 315, __pyx_L1_error)
8745 __Pyx_GOTREF(__pyx_t_16);
8746 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8747 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_16);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error)
8748 __Pyx_GOTREF(__pyx_t_1);
8749 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8750 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 315, __pyx_L1_error)
8751 __Pyx_GOTREF(__pyx_t_16);
8752 __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_16, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 315, __pyx_L1_error)
8753 __Pyx_GOTREF(__pyx_t_15);
8754 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8755 __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 315, __pyx_L1_error)
8756 __Pyx_GOTREF(__pyx_t_16);
8757 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8758 __pyx_t_15 = PyNumber_Subtract(__pyx_t_1, __pyx_t_16);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 315, __pyx_L1_error)
8759 __Pyx_GOTREF(__pyx_t_15);
8760 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8761 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8762 if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 315, __pyx_L1_error)
8771 __pyx_t_16 = ((PyObject *)__pyx_f_10Isosurface_ecross(((PyArrayObject *)__pyx_t_5), ((PyArrayObject *)__pyx_t_15)));
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 313, __pyx_L1_error)
8772 __Pyx_GOTREF(__pyx_t_16);
8773 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8774 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8776 __Pyx_BufFmt_StackElem __pyx_stack[1];
8777 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
8778 __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_16), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
8779 if (unlikely(__pyx_t_9 < 0)) {
8780 PyErr_Fetch(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
8781 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)__pyx_v_normal, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
8782 Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_19);
8783 __Pyx_RaiseBufferFallbackError();
8785 PyErr_Restore(__pyx_t_21, __pyx_t_20, __pyx_t_19);
8787 __pyx_t_21 = __pyx_t_20 = __pyx_t_19 = 0;
8789 __pyx_pybuffernd_normal.diminfo[0].strides = __pyx_pybuffernd_normal.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_normal.diminfo[0].shape = __pyx_pybuffernd_normal.rcbuffer->pybuffer.shape[0];
8790 if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 313, __pyx_L1_error)
8792 __Pyx_XDECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_16));
8802 __pyx_t_16 = PyFloat_FromDouble(__pyx_f_10Isosurface_enorm(((PyArrayObject *)__pyx_v_normal)));
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 316, __pyx_L1_error)
8803 __Pyx_GOTREF(__pyx_t_16);
8804 __pyx_t_15 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_normal), __pyx_t_16);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 316, __pyx_L1_error)
8805 __Pyx_GOTREF(__pyx_t_15);
8806 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8807 if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 316, __pyx_L1_error)
8808 __pyx_t_18 = ((PyArrayObject *)__pyx_t_15);
8810 __Pyx_BufFmt_StackElem __pyx_stack[1];
8811 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
8812 __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
8813 if (unlikely(__pyx_t_9 < 0)) {
8814 PyErr_Fetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
8815 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)__pyx_v_normal, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
8816 Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21);
8817 __Pyx_RaiseBufferFallbackError();
8819 PyErr_Restore(__pyx_t_19, __pyx_t_20, __pyx_t_21);
8821 __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0;
8823 __pyx_pybuffernd_normal.diminfo[0].strides = __pyx_pybuffernd_normal.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_normal.diminfo[0].shape = __pyx_pybuffernd_normal.rcbuffer->pybuffer.shape[0];
8824 if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 316, __pyx_L1_error)
8827 __Pyx_DECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_15));
8837 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal));
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 317, __pyx_L1_error)
8846 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal));
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 318, __pyx_L1_error)
8855 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal));
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 319, __pyx_L1_error)
8864 __pyx_t_15 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 320, __pyx_L1_error)
8865 __Pyx_GOTREF(__pyx_t_15);
8866 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normal_indices, __pyx_t_15);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 320, __pyx_L1_error)
8867 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8886 __pyx_t_4 = ((__pyx_v_nZeros == 3) != 0);
8896 __pyx_t_15 = __pyx_v_zeros; __Pyx_INCREF(__pyx_t_15); __pyx_t_12 = 0;
8898 if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_15))
break;
8899 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8900 __pyx_t_16 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_12); __Pyx_INCREF(__pyx_t_16); __pyx_t_12++;
if (unlikely(0 < 0)) __PYX_ERR(0, 322, __pyx_L1_error)
8902 __pyx_t_16 = PySequence_ITEM(__pyx_t_15, __pyx_t_12); __pyx_t_12++;
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 322, __pyx_L1_error)
8903 __Pyx_GOTREF(__pyx_t_16);
8905 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_16);
if (unlikely((__pyx_t_9 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 322, __pyx_L1_error)
8906 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8907 __pyx_v_I = __pyx_t_9;
8916 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 323, __pyx_L1_error)
8917 __Pyx_GOTREF(__pyx_t_16);
8918 __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_16, __pyx_v_I,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 323, __pyx_L1_error)
8919 __Pyx_GOTREF(__pyx_t_5);
8920 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8921 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_nodes, __pyx_t_5);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 323, __pyx_L1_error)
8922 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8932 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8941 __pyx_t_15 = PyList_New(0);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 324, __pyx_L1_error)
8942 __Pyx_GOTREF(__pyx_t_15);
8943 for (__pyx_t_22 = 0; __pyx_t_22 < 3; __pyx_t_22+=1) {
8944 __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_22);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 324, __pyx_L1_error)
8945 __Pyx_GOTREF(__pyx_t_5);
8946 __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_5);
8948 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nN_start);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 324, __pyx_L1_error)
8949 __Pyx_GOTREF(__pyx_t_5);
8950 __pyx_t_16 = PyNumber_Add(__pyx_t_5, __pyx_v_j);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 324, __pyx_L1_error)
8951 __Pyx_GOTREF(__pyx_t_16);
8952 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8953 if (unlikely(__Pyx_ListComp_Append(__pyx_t_15, (PyObject*)__pyx_t_16))) __PYX_ERR(0, 324, __pyx_L1_error)
8954 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8956 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_elements, __pyx_t_15);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 324, __pyx_L1_error)
8957 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8966 __pyx_t_4 = ((__pyx_v_nPlus == 1) != 0);
8976 __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 326, __pyx_L1_error)
8977 __Pyx_GOTREF(__pyx_t_15);
8978 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_plus, 0,
long, 1, __Pyx_PyInt_From_long, 1, 0, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 326, __pyx_L1_error)
8979 __Pyx_GOTREF(__pyx_t_16);
8980 __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_15, __pyx_t_16);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 326, __pyx_L1_error)
8981 __Pyx_GOTREF(__pyx_t_5);
8982 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8983 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8984 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 326, __pyx_L1_error)
8985 __Pyx_GOTREF(__pyx_t_16);
8986 __pyx_t_15 = PyNumber_Subtract(__pyx_t_5, __pyx_t_16);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 326, __pyx_L1_error)
8987 __Pyx_GOTREF(__pyx_t_15);
8988 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8989 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8990 if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 326, __pyx_L1_error)
8999 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_nodes, -2
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 327, __pyx_L1_error)
9000 __Pyx_GOTREF(__pyx_t_16);
9001 __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 327, __pyx_L1_error)
9002 __Pyx_GOTREF(__pyx_t_5);
9003 __pyx_t_1 = PyNumber_Subtract(__pyx_t_16, __pyx_t_5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error)
9004 __Pyx_GOTREF(__pyx_t_1);
9005 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
9006 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9007 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 327, __pyx_L1_error)
9016 __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_nodes, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 328, __pyx_L1_error)
9017 __Pyx_GOTREF(__pyx_t_5);
9018 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 328, __pyx_L1_error)
9019 __Pyx_GOTREF(__pyx_t_16);
9020 __pyx_t_2 = PyNumber_Subtract(__pyx_t_5, __pyx_t_16);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error)
9021 __Pyx_GOTREF(__pyx_t_2);
9022 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9023 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
9024 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 328, __pyx_L1_error)
9033 __pyx_t_4 = ((__pyx_f_10Isosurface_etriple(((PyArrayObject *)__pyx_t_15), ((PyArrayObject *)__pyx_t_1), ((PyArrayObject *)__pyx_t_2)) < 0.0) != 0);
9034 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
9035 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9036 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9046 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error)
9047 __Pyx_GOTREF(__pyx_t_2);
9048 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
9049 __Pyx_GOTREF(__pyx_t_1);
9050 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9059 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error)
9060 __Pyx_GOTREF(__pyx_t_2);
9061 __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_2, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 330, __pyx_L1_error)
9062 __Pyx_GOTREF(__pyx_t_15);
9063 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9072 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error)
9073 __Pyx_GOTREF(__pyx_t_2);
9074 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 331, __pyx_L1_error)
9075 __Pyx_GOTREF(__pyx_t_16);
9076 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9085 __pyx_t_2 = PyList_New(3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error)
9086 __Pyx_GOTREF(__pyx_t_2);
9087 __Pyx_GIVEREF(__pyx_t_1);
9088 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
9089 __Pyx_GIVEREF(__pyx_t_15);
9090 PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_15);
9091 __Pyx_GIVEREF(__pyx_t_16);
9092 PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_16);
9096 if (unlikely(__Pyx_SetItemInt(__pyx_v_elements, -1
L, __pyx_t_2,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1) < 0)) __PYX_ERR(0, 329, __pyx_L1_error)
9097 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9126 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L1_error)
9127 __Pyx_GOTREF(__pyx_t_2);
9128 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_minus, 0,
long, 1, __Pyx_PyInt_From_long, 1, 0, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 333, __pyx_L1_error)
9129 __Pyx_GOTREF(__pyx_t_16);
9130 __pyx_t_15 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_16);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 333, __pyx_L1_error)
9131 __Pyx_GOTREF(__pyx_t_15);
9132 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9133 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
9134 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 333, __pyx_L1_error)
9135 __Pyx_GOTREF(__pyx_t_16);
9136 __pyx_t_2 = PyNumber_Subtract(__pyx_t_15, __pyx_t_16);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L1_error)
9137 __Pyx_GOTREF(__pyx_t_2);
9138 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
9139 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
9140 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 333, __pyx_L1_error)
9149 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_nodes, -2
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 334, __pyx_L1_error)
9150 __Pyx_GOTREF(__pyx_t_16);
9151 __pyx_t_15 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 334, __pyx_L1_error)
9152 __Pyx_GOTREF(__pyx_t_15);
9153 __pyx_t_1 = PyNumber_Subtract(__pyx_t_16, __pyx_t_15);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error)
9154 __Pyx_GOTREF(__pyx_t_1);
9155 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
9156 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
9157 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 334, __pyx_L1_error)
9166 __pyx_t_15 = __Pyx_GetItemInt_List(__pyx_v_nodes, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 335, __pyx_L1_error)
9167 __Pyx_GOTREF(__pyx_t_15);
9168 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 335, __pyx_L1_error)
9169 __Pyx_GOTREF(__pyx_t_16);
9170 __pyx_t_5 = PyNumber_Subtract(__pyx_t_15, __pyx_t_16);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 335, __pyx_L1_error)
9171 __Pyx_GOTREF(__pyx_t_5);
9172 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
9173 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
9174 if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 335, __pyx_L1_error)
9183 __pyx_t_4 = ((__pyx_f_10Isosurface_etriple(((PyArrayObject *)__pyx_t_2), ((PyArrayObject *)__pyx_t_1), ((PyArrayObject *)__pyx_t_5)) > 0.0) != 0);
9184 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9185 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9186 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9196 __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error)
9197 __Pyx_GOTREF(__pyx_t_5);
9198 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_5, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error)
9199 __Pyx_GOTREF(__pyx_t_1);
9200 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9209 __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L1_error)
9210 __Pyx_GOTREF(__pyx_t_5);
9211 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_5, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
9212 __Pyx_GOTREF(__pyx_t_2);
9213 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9222 __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 338, __pyx_L1_error)
9223 __Pyx_GOTREF(__pyx_t_5);
9224 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_5, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 338, __pyx_L1_error)
9225 __Pyx_GOTREF(__pyx_t_16);
9226 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9235 __pyx_t_5 = PyList_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error)
9236 __Pyx_GOTREF(__pyx_t_5);
9237 __Pyx_GIVEREF(__pyx_t_1);
9238 PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
9239 __Pyx_GIVEREF(__pyx_t_2);
9240 PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
9241 __Pyx_GIVEREF(__pyx_t_16);
9242 PyList_SET_ITEM(__pyx_t_5, 2, __pyx_t_16);
9246 if (unlikely(__Pyx_SetItemInt(__pyx_v_elements, -1
L, __pyx_t_5,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1) < 0)) __PYX_ERR(0, 336, __pyx_L1_error)
9247 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9267 __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error)
9268 __Pyx_GOTREF(__pyx_t_5);
9269 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_5, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 340, __pyx_L1_error)
9270 __Pyx_GOTREF(__pyx_t_16);
9271 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9272 __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_16);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error)
9273 __Pyx_GOTREF(__pyx_t_5);
9274 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
9275 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 340, __pyx_L1_error)
9276 __Pyx_GOTREF(__pyx_t_16);
9277 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_16, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error)
9278 __Pyx_GOTREF(__pyx_t_2);
9279 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
9280 __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_2);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 340, __pyx_L1_error)
9281 __Pyx_GOTREF(__pyx_t_16);
9282 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9283 __pyx_t_2 = PyNumber_Subtract(__pyx_t_5, __pyx_t_16);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error)
9284 __Pyx_GOTREF(__pyx_t_2);
9285 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9286 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
9287 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 340, __pyx_L1_error)
9296 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 341, __pyx_L1_error)
9297 __Pyx_GOTREF(__pyx_t_16);
9298 __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_16, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 341, __pyx_L1_error)
9299 __Pyx_GOTREF(__pyx_t_5);
9300 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
9301 __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_5);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 341, __pyx_L1_error)
9302 __Pyx_GOTREF(__pyx_t_16);
9303 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9304 __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 341, __pyx_L1_error)
9305 __Pyx_GOTREF(__pyx_t_5);
9306 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_5, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error)
9307 __Pyx_GOTREF(__pyx_t_1);
9308 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9309 __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 341, __pyx_L1_error)
9310 __Pyx_GOTREF(__pyx_t_5);
9311 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9312 __pyx_t_1 = PyNumber_Subtract(__pyx_t_16, __pyx_t_5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error)
9313 __Pyx_GOTREF(__pyx_t_1);
9314 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
9315 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9316 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 341, __pyx_L1_error)
9325 __pyx_t_5 = ((PyObject *)__pyx_f_10Isosurface_ecross(((PyArrayObject *)__pyx_t_2), ((PyArrayObject *)__pyx_t_1)));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 339, __pyx_L1_error)
9326 __Pyx_GOTREF(__pyx_t_5);
9327 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9328 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9330 __Pyx_BufFmt_StackElem __pyx_stack[1];
9331 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
9332 __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_5), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
9333 if (unlikely(__pyx_t_9 < 0)) {
9334 PyErr_Fetch(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
9335 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)__pyx_v_normal, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
9336 Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_19);
9337 __Pyx_RaiseBufferFallbackError();
9339 PyErr_Restore(__pyx_t_21, __pyx_t_20, __pyx_t_19);
9341 __pyx_t_21 = __pyx_t_20 = __pyx_t_19 = 0;
9343 __pyx_pybuffernd_normal.diminfo[0].strides = __pyx_pybuffernd_normal.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_normal.diminfo[0].shape = __pyx_pybuffernd_normal.rcbuffer->pybuffer.shape[0];
9344 if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 339, __pyx_L1_error)
9346 __Pyx_XDECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_5));
9356 __pyx_t_5 = PyFloat_FromDouble(__pyx_f_10Isosurface_enorm(((PyArrayObject *)__pyx_v_normal)));
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 342, __pyx_L1_error)
9357 __Pyx_GOTREF(__pyx_t_5);
9358 __pyx_t_1 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_normal), __pyx_t_5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error)
9359 __Pyx_GOTREF(__pyx_t_1);
9360 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9361 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 342, __pyx_L1_error)
9362 __pyx_t_18 = ((PyArrayObject *)__pyx_t_1);
9364 __Pyx_BufFmt_StackElem __pyx_stack[1];
9365 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
9366 __pyx_t_9 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
9367 if (unlikely(__pyx_t_9 < 0)) {
9368 PyErr_Fetch(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
9369 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)__pyx_v_normal, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
9370 Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21);
9371 __Pyx_RaiseBufferFallbackError();
9373 PyErr_Restore(__pyx_t_19, __pyx_t_20, __pyx_t_21);
9375 __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0;
9377 __pyx_pybuffernd_normal.diminfo[0].strides = __pyx_pybuffernd_normal.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_normal.diminfo[0].shape = __pyx_pybuffernd_normal.rcbuffer->pybuffer.shape[0];
9378 if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 342, __pyx_L1_error)
9381 __Pyx_DECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_1));
9391 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal));
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 343, __pyx_L1_error)
9400 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal));
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 344, __pyx_L1_error)
9409 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal));
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 345, __pyx_L1_error)
9418 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_elements, -1
L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error)
9419 __Pyx_GOTREF(__pyx_t_1);
9420 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_normal_indices, __pyx_t_1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(0, 346, __pyx_L1_error)
9421 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9443 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9446 __Pyx_XDECREF(__pyx_t_1);
9447 __Pyx_XDECREF(__pyx_t_2);
9448 __Pyx_XDECREF(__pyx_t_3);
9449 __Pyx_XDECREF(__pyx_t_5);
9450 __Pyx_XDECREF(__pyx_t_15);
9451 __Pyx_XDECREF(__pyx_t_16);
9452 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
9453 __Pyx_PyThreadState_declare
9454 __Pyx_PyThreadState_assign
9455 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
9456 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
9457 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
9458 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
9459 __Pyx_AddTraceback(
"Isosurface.Isosurface.triangulateIsosurface", __pyx_clineno, __pyx_lineno, __pyx_filename);
9463 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
9464 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
9466 __Pyx_XDECREF((PyObject *)__pyx_v_x);
9467 __Pyx_XDECREF((PyObject *)__pyx_v_normal);
9468 __Pyx_XDECREF(__pyx_v_nodes);
9469 __Pyx_XDECREF(__pyx_v_elements);
9470 __Pyx_XDECREF(__pyx_v_normals);
9471 __Pyx_XDECREF(__pyx_v_normal_indices);
9472 __Pyx_XDECREF(__pyx_v_phi);
9473 __Pyx_XDECREF(__pyx_v_plus);
9474 __Pyx_XDECREF(__pyx_v_minus);
9475 __Pyx_XDECREF(__pyx_v_zeros);
9476 __Pyx_XDECREF(__pyx_v_j);
9477 __Pyx_XGIVEREF(__pyx_r);
9478 __Pyx_RefNannyFinishContext();
9491 static PyObject *__pyx_pw_10Isosurface_10Isosurface_9writeIsosurfaceMesh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9492 static char __pyx_doc_10Isosurface_10Isosurface_8writeIsosurfaceMesh[] =
"Isosurface.writeIsosurfaceMesh(self, field, value, frame)";
9493 static PyMethodDef __pyx_mdef_10Isosurface_10Isosurface_9writeIsosurfaceMesh = {
"writeIsosurfaceMesh", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10Isosurface_10Isosurface_9writeIsosurfaceMesh, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10Isosurface_10Isosurface_8writeIsosurfaceMesh};
9494 static PyObject *__pyx_pw_10Isosurface_10Isosurface_9writeIsosurfaceMesh(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9495 PyObject *__pyx_v_self = 0;
9496 PyObject *__pyx_v_field = 0;
9497 PyObject *__pyx_v_value = 0;
9498 PyObject *__pyx_v_frame = 0;
9499 int __pyx_lineno = 0;
9500 const char *__pyx_filename = NULL;
9501 int __pyx_clineno = 0;
9502 PyObject *__pyx_r = 0;
9503 __Pyx_RefNannyDeclarations
9504 __Pyx_RefNannySetupContext(
"writeIsosurfaceMesh (wrapper)", 0);
9506 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_field,&__pyx_n_s_value,&__pyx_n_s_frame,0};
9507 PyObject* values[4] = {0,0,0,0};
9508 if (unlikely(__pyx_kwds)) {
9510 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9512 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9514 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9516 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9518 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9521 default:
goto __pyx_L5_argtuple_error;
9523 kw_args = PyDict_Size(__pyx_kwds);
9526 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
9527 else goto __pyx_L5_argtuple_error;
9530 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
9532 __Pyx_RaiseArgtupleInvalid(
"writeIsosurfaceMesh", 1, 4, 4, 1); __PYX_ERR(0, 348, __pyx_L3_error)
9536 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
9538 __Pyx_RaiseArgtupleInvalid(
"writeIsosurfaceMesh", 1, 4, 4, 2); __PYX_ERR(0, 348, __pyx_L3_error)
9542 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_frame)) != 0)) kw_args--;
9544 __Pyx_RaiseArgtupleInvalid(
"writeIsosurfaceMesh", 1, 4, 4, 3); __PYX_ERR(0, 348, __pyx_L3_error)
9547 if (unlikely(kw_args > 0)) {
9548 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"writeIsosurfaceMesh") < 0)) __PYX_ERR(0, 348, __pyx_L3_error)
9550 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
9551 goto __pyx_L5_argtuple_error;
9553 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9554 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9555 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9556 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9558 __pyx_v_self = values[0];
9559 __pyx_v_field = values[1];
9560 __pyx_v_value = values[2];
9561 __pyx_v_frame = values[3];
9563 goto __pyx_L4_argument_unpacking_done;
9564 __pyx_L5_argtuple_error:;
9565 __Pyx_RaiseArgtupleInvalid(
"writeIsosurfaceMesh", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 348, __pyx_L3_error)
9567 __Pyx_AddTraceback(
"Isosurface.Isosurface.writeIsosurfaceMesh", __pyx_clineno, __pyx_lineno, __pyx_filename);
9568 __Pyx_RefNannyFinishContext();
9570 __pyx_L4_argument_unpacking_done:;
9571 __pyx_r = __pyx_pf_10Isosurface_10Isosurface_8writeIsosurfaceMesh(__pyx_self, __pyx_v_self, __pyx_v_field, __pyx_v_value, __pyx_v_frame);
9574 __Pyx_RefNannyFinishContext();
9578 static PyObject *__pyx_pf_10Isosurface_10Isosurface_8writeIsosurfaceMesh(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value, PyObject *__pyx_v_frame) {
9579 PyObject *__pyx_r = NULL;
9580 __Pyx_RefNannyDeclarations
9581 PyObject *__pyx_t_1 = NULL;
9583 PyObject *__pyx_t_3 = NULL;
9584 PyObject *__pyx_t_4 = NULL;
9585 PyObject *__pyx_t_5 = NULL;
9588 int __pyx_lineno = 0;
9589 const char *__pyx_filename = NULL;
9590 int __pyx_clineno = 0;
9591 __Pyx_RefNannySetupContext(
"writeIsosurfaceMesh", 0);
9600 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error)
9601 __Pyx_GOTREF(__pyx_t_1);
9602 __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_pov, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 349, __pyx_L1_error)
9603 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9613 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_log);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error)
9614 __Pyx_GOTREF(__pyx_t_3);
9615 __pyx_t_4 = PyObject_Repr(__pyx_v_frame);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 350, __pyx_L1_error)
9616 __Pyx_GOTREF(__pyx_t_4);
9617 __pyx_t_5 = PyNumber_Add(__pyx_kp_s_Writing_pov_frame, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 350, __pyx_L1_error)
9618 __Pyx_GOTREF(__pyx_t_5);
9619 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9621 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
9622 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
9623 if (likely(__pyx_t_4)) {
9624 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
9625 __Pyx_INCREF(__pyx_t_4);
9626 __Pyx_INCREF(
function);
9627 __Pyx_DECREF_SET(__pyx_t_3,
function);
9630 __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5);
9631 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9632 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9633 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error)
9634 __Pyx_GOTREF(__pyx_t_1);
9635 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9636 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9645 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writeIsosurfaceMesh_povray);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __pyx_L1_error)
9646 __Pyx_GOTREF(__pyx_t_3);
9649 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
9650 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
9651 if (likely(__pyx_t_5)) {
9652 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
9653 __Pyx_INCREF(__pyx_t_5);
9654 __Pyx_INCREF(
function);
9655 __Pyx_DECREF_SET(__pyx_t_3,
function);
9659 #if CYTHON_FAST_PYCALL
9660 if (PyFunction_Check(__pyx_t_3)) {
9661 PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_field, __pyx_v_value, __pyx_v_frame};
9662 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error)
9663 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9664 __Pyx_GOTREF(__pyx_t_1);
9667 #if CYTHON_FAST_PYCCALL
9668 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
9669 PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_field, __pyx_v_value, __pyx_v_frame};
9670 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error)
9671 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9672 __Pyx_GOTREF(__pyx_t_1);
9676 __pyx_t_4 = PyTuple_New(3+__pyx_t_6);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L1_error)
9677 __Pyx_GOTREF(__pyx_t_4);
9679 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
9681 __Pyx_INCREF(__pyx_v_field);
9682 __Pyx_GIVEREF(__pyx_v_field);
9683 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_v_field);
9684 __Pyx_INCREF(__pyx_v_value);
9685 __Pyx_GIVEREF(__pyx_v_value);
9686 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_v_value);
9687 __Pyx_INCREF(__pyx_v_frame);
9688 __Pyx_GIVEREF(__pyx_v_frame);
9689 PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_6, __pyx_v_frame);
9690 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error)
9691 __Pyx_GOTREF(__pyx_t_1);
9692 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9694 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9695 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9714 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error)
9715 __Pyx_GOTREF(__pyx_t_1);
9716 __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_h5, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 352, __pyx_L1_error)
9717 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9727 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writeIsosurfaceMesh_h5);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 353, __pyx_L1_error)
9728 __Pyx_GOTREF(__pyx_t_3);
9731 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
9732 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
9733 if (likely(__pyx_t_4)) {
9734 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
9735 __Pyx_INCREF(__pyx_t_4);
9736 __Pyx_INCREF(
function);
9737 __Pyx_DECREF_SET(__pyx_t_3,
function);
9741 #if CYTHON_FAST_PYCALL
9742 if (PyFunction_Check(__pyx_t_3)) {
9743 PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_field, __pyx_v_value, __pyx_v_frame};
9744 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error)
9745 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9746 __Pyx_GOTREF(__pyx_t_1);
9749 #if CYTHON_FAST_PYCCALL
9750 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
9751 PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_field, __pyx_v_value, __pyx_v_frame};
9752 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error)
9753 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9754 __Pyx_GOTREF(__pyx_t_1);
9758 __pyx_t_5 = PyTuple_New(3+__pyx_t_6);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 353, __pyx_L1_error)
9759 __Pyx_GOTREF(__pyx_t_5);
9761 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
9763 __Pyx_INCREF(__pyx_v_field);
9764 __Pyx_GIVEREF(__pyx_v_field);
9765 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_v_field);
9766 __Pyx_INCREF(__pyx_v_value);
9767 __Pyx_GIVEREF(__pyx_v_value);
9768 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_v_value);
9769 __Pyx_INCREF(__pyx_v_frame);
9770 __Pyx_GIVEREF(__pyx_v_frame);
9771 PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_6, __pyx_v_frame);
9772 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error)
9773 __Pyx_GOTREF(__pyx_t_1);
9774 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9776 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9777 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9796 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error)
9797 __Pyx_GOTREF(__pyx_t_1);
9798 __pyx_t_2 = (__pyx_t_1 == Py_None);
9799 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9800 __pyx_t_7 = (__pyx_t_2 != 0);
9813 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_log);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error)
9814 __Pyx_GOTREF(__pyx_t_3);
9816 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
9817 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
9818 if (likely(__pyx_t_5)) {
9819 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
9820 __Pyx_INCREF(__pyx_t_5);
9821 __Pyx_INCREF(
function);
9822 __Pyx_DECREF_SET(__pyx_t_3,
function);
9825 __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_kp_s_Isosurface_file_format_not_recog) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_Isosurface_file_format_not_recog);
9826 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9827 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error)
9828 __Pyx_GOTREF(__pyx_t_1);
9829 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9830 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9843 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9846 __Pyx_XDECREF(__pyx_t_1);
9847 __Pyx_XDECREF(__pyx_t_3);
9848 __Pyx_XDECREF(__pyx_t_4);
9849 __Pyx_XDECREF(__pyx_t_5);
9850 __Pyx_AddTraceback(
"Isosurface.Isosurface.writeIsosurfaceMesh", __pyx_clineno, __pyx_lineno, __pyx_filename);
9853 __Pyx_XGIVEREF(__pyx_r);
9854 __Pyx_RefNannyFinishContext();
9867 static PyObject *__pyx_pw_10Isosurface_10Isosurface_11writeIsosurfaceMesh_h5(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9868 static char __pyx_doc_10Isosurface_10Isosurface_10writeIsosurfaceMesh_h5[] =
"Isosurface.writeIsosurfaceMesh_h5(self, field, value, frame)";
9869 static PyMethodDef __pyx_mdef_10Isosurface_10Isosurface_11writeIsosurfaceMesh_h5 = {
"writeIsosurfaceMesh_h5", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10Isosurface_10Isosurface_11writeIsosurfaceMesh_h5, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10Isosurface_10Isosurface_10writeIsosurfaceMesh_h5};
9870 static PyObject *__pyx_pw_10Isosurface_10Isosurface_11writeIsosurfaceMesh_h5(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9871 PyObject *__pyx_v_self = 0;
9872 PyObject *__pyx_v_field = 0;
9873 PyObject *__pyx_v_value = 0;
9874 CYTHON_UNUSED PyObject *__pyx_v_frame = 0;
9875 int __pyx_lineno = 0;
9876 const char *__pyx_filename = NULL;
9877 int __pyx_clineno = 0;
9878 PyObject *__pyx_r = 0;
9879 __Pyx_RefNannyDeclarations
9880 __Pyx_RefNannySetupContext(
"writeIsosurfaceMesh_h5 (wrapper)", 0);
9882 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_field,&__pyx_n_s_value,&__pyx_n_s_frame,0};
9883 PyObject* values[4] = {0,0,0,0};
9884 if (unlikely(__pyx_kwds)) {
9886 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9888 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9890 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9892 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9894 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9897 default:
goto __pyx_L5_argtuple_error;
9899 kw_args = PyDict_Size(__pyx_kwds);
9902 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
9903 else goto __pyx_L5_argtuple_error;
9906 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
9908 __Pyx_RaiseArgtupleInvalid(
"writeIsosurfaceMesh_h5", 1, 4, 4, 1); __PYX_ERR(0, 359, __pyx_L3_error)
9912 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
9914 __Pyx_RaiseArgtupleInvalid(
"writeIsosurfaceMesh_h5", 1, 4, 4, 2); __PYX_ERR(0, 359, __pyx_L3_error)
9918 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_frame)) != 0)) kw_args--;
9920 __Pyx_RaiseArgtupleInvalid(
"writeIsosurfaceMesh_h5", 1, 4, 4, 3); __PYX_ERR(0, 359, __pyx_L3_error)
9923 if (unlikely(kw_args > 0)) {
9924 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"writeIsosurfaceMesh_h5") < 0)) __PYX_ERR(0, 359, __pyx_L3_error)
9926 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
9927 goto __pyx_L5_argtuple_error;
9929 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9930 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9931 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9932 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9934 __pyx_v_self = values[0];
9935 __pyx_v_field = values[1];
9936 __pyx_v_value = values[2];
9937 __pyx_v_frame = values[3];
9939 goto __pyx_L4_argument_unpacking_done;
9940 __pyx_L5_argtuple_error:;
9941 __Pyx_RaiseArgtupleInvalid(
"writeIsosurfaceMesh_h5", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 359, __pyx_L3_error)
9943 __Pyx_AddTraceback(
"Isosurface.Isosurface.writeIsosurfaceMesh_h5", __pyx_clineno, __pyx_lineno, __pyx_filename);
9944 __Pyx_RefNannyFinishContext();
9946 __pyx_L4_argument_unpacking_done:;
9947 __pyx_r = __pyx_pf_10Isosurface_10Isosurface_10writeIsosurfaceMesh_h5(__pyx_self, __pyx_v_self, __pyx_v_field, __pyx_v_value, __pyx_v_frame);
9950 __Pyx_RefNannyFinishContext();
9954 static PyObject *__pyx_pf_10Isosurface_10Isosurface_10writeIsosurfaceMesh_h5(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_frame) {
9955 PyObject *__pyx_v_h5py = NULL;
9956 PyObject *__pyx_v_nodes = NULL;
9957 PyObject *__pyx_v_elements = NULL;
9958 PyObject *__pyx_v_normals = NULL;
9959 PyObject *__pyx_v_normal_indices = NULL;
9960 PyObject *__pyx_v_filename = NULL;
9961 PyObject *__pyx_v_f = NULL;
9962 CYTHON_UNUSED PyObject *__pyx_v_dset = NULL;
9963 PyObject *__pyx_r = NULL;
9964 __Pyx_RefNannyDeclarations
9965 PyObject *__pyx_t_1 = NULL;
9966 PyObject *__pyx_t_2 = NULL;
9967 PyObject *__pyx_t_3 = NULL;
9968 PyObject *__pyx_t_4 = NULL;
9969 PyObject *__pyx_t_5 = NULL;
9970 PyObject *__pyx_t_6 = NULL;
9971 PyObject *__pyx_t_7 = NULL;
9974 int __pyx_lineno = 0;
9975 const char *__pyx_filename = NULL;
9976 int __pyx_clineno = 0;
9977 __Pyx_RefNannySetupContext(
"writeIsosurfaceMesh_h5", 0);
9986 __pyx_t_1 = __Pyx_Import(__pyx_n_s_h5py, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error)
9987 __Pyx_GOTREF(__pyx_t_1);
9988 __pyx_v_h5py = __pyx_t_1;
9998 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodes);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error)
9999 __Pyx_GOTREF(__pyx_t_1);
10000 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error)
10001 __Pyx_GOTREF(__pyx_t_2);
10002 __Pyx_INCREF(__pyx_v_field);
10003 __Pyx_GIVEREF(__pyx_v_field);
10004 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_field);
10005 __Pyx_INCREF(__pyx_v_value);
10006 __Pyx_GIVEREF(__pyx_v_value);
10007 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_value);
10008 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error)
10009 __Pyx_GOTREF(__pyx_t_3);
10010 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10011 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10012 __pyx_v_nodes = __pyx_t_3;
10022 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_elements);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L1_error)
10023 __Pyx_GOTREF(__pyx_t_3);
10024 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error)
10025 __Pyx_GOTREF(__pyx_t_2);
10026 __Pyx_INCREF(__pyx_v_field);
10027 __Pyx_GIVEREF(__pyx_v_field);
10028 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_field);
10029 __Pyx_INCREF(__pyx_v_value);
10030 __Pyx_GIVEREF(__pyx_v_value);
10031 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_value);
10032 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
10033 __Pyx_GOTREF(__pyx_t_1);
10034 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10035 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10036 __pyx_v_elements = __pyx_t_1;
10046 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_normals);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
10047 __Pyx_GOTREF(__pyx_t_1);
10048 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error)
10049 __Pyx_GOTREF(__pyx_t_2);
10050 __Pyx_INCREF(__pyx_v_field);
10051 __Pyx_GIVEREF(__pyx_v_field);
10052 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_field);
10053 __Pyx_INCREF(__pyx_v_value);
10054 __Pyx_GIVEREF(__pyx_v_value);
10055 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_value);
10056 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 363, __pyx_L1_error)
10057 __Pyx_GOTREF(__pyx_t_3);
10058 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10059 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10060 __pyx_v_normals = __pyx_t_3;
10070 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_normal_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L1_error)
10071 __Pyx_GOTREF(__pyx_t_3);
10072 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error)
10073 __Pyx_GOTREF(__pyx_t_2);
10074 __Pyx_INCREF(__pyx_v_field);
10075 __Pyx_GIVEREF(__pyx_v_field);
10076 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_field);
10077 __Pyx_INCREF(__pyx_v_value);
10078 __Pyx_GIVEREF(__pyx_v_value);
10079 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_value);
10080 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error)
10081 __Pyx_GOTREF(__pyx_t_1);
10082 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10083 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10084 __pyx_v_normal_indices = __pyx_t_1;
10094 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error)
10095 __Pyx_GOTREF(__pyx_t_2);
10096 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error)
10097 __Pyx_GOTREF(__pyx_t_3);
10098 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10099 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_join);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error)
10100 __Pyx_GOTREF(__pyx_t_2);
10101 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10102 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Profiling);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error)
10103 __Pyx_GOTREF(__pyx_t_3);
10104 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_logDir);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 365, __pyx_L1_error)
10105 __Pyx_GOTREF(__pyx_t_4);
10106 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10107 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_fileprefix);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error)
10108 __Pyx_GOTREF(__pyx_t_3);
10109 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_comm);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 365, __pyx_L1_error)
10110 __Pyx_GOTREF(__pyx_t_6);
10111 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_rank);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 365, __pyx_L1_error)
10112 __Pyx_GOTREF(__pyx_t_7);
10113 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10115 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
10116 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
10117 if (likely(__pyx_t_6)) {
10118 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
10119 __Pyx_INCREF(__pyx_t_6);
10120 __Pyx_INCREF(
function);
10121 __Pyx_DECREF_SET(__pyx_t_7,
function);
10124 __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
10125 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10126 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 365, __pyx_L1_error)
10127 __Pyx_GOTREF(__pyx_t_5);
10128 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10129 __pyx_t_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_5);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 365, __pyx_L1_error)
10130 __Pyx_GOTREF(__pyx_t_7);
10131 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10132 __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_7);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 365, __pyx_L1_error)
10133 __Pyx_GOTREF(__pyx_t_5);
10134 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10135 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10136 __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_kp_s_h5_2);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 365, __pyx_L1_error)
10137 __Pyx_GOTREF(__pyx_t_7);
10138 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10141 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
10142 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
10143 if (likely(__pyx_t_5)) {
10144 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
10145 __Pyx_INCREF(__pyx_t_5);
10146 __Pyx_INCREF(
function);
10147 __Pyx_DECREF_SET(__pyx_t_2,
function);
10151 #if CYTHON_FAST_PYCALL
10152 if (PyFunction_Check(__pyx_t_2)) {
10153 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_t_7};
10154 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
10155 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10156 __Pyx_GOTREF(__pyx_t_1);
10157 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10158 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10161 #if CYTHON_FAST_PYCCALL
10162 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
10163 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_t_7};
10164 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
10165 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10166 __Pyx_GOTREF(__pyx_t_1);
10167 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10168 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10172 __pyx_t_3 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error)
10173 __Pyx_GOTREF(__pyx_t_3);
10175 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
10177 __Pyx_GIVEREF(__pyx_t_4);
10178 PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_8, __pyx_t_4);
10179 __Pyx_GIVEREF(__pyx_t_7);
10180 PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_8, __pyx_t_7);
10183 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
10184 __Pyx_GOTREF(__pyx_t_1);
10185 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10187 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10188 __pyx_v_filename = __pyx_t_1;
10198 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nFrames);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error)
10199 __Pyx_GOTREF(__pyx_t_1);
10200 __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 366, __pyx_L1_error)
10201 __Pyx_GOTREF(__pyx_t_2);
10202 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10203 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 366, __pyx_L1_error)
10204 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10214 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_h5py, __pyx_n_s_File);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error)
10215 __Pyx_GOTREF(__pyx_t_1);
10218 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
10219 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
10220 if (likely(__pyx_t_3)) {
10221 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
10222 __Pyx_INCREF(__pyx_t_3);
10223 __Pyx_INCREF(
function);
10224 __Pyx_DECREF_SET(__pyx_t_1,
function);
10228 #if CYTHON_FAST_PYCALL
10229 if (PyFunction_Check(__pyx_t_1)) {
10230 PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_filename, __pyx_n_s_w};
10231 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error)
10232 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10233 __Pyx_GOTREF(__pyx_t_2);
10236 #if CYTHON_FAST_PYCCALL
10237 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
10238 PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_filename, __pyx_n_s_w};
10239 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error)
10240 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10241 __Pyx_GOTREF(__pyx_t_2);
10245 __pyx_t_7 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 367, __pyx_L1_error)
10246 __Pyx_GOTREF(__pyx_t_7);
10248 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
10250 __Pyx_INCREF(__pyx_v_filename);
10251 __Pyx_GIVEREF(__pyx_v_filename);
10252 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_filename);
10253 __Pyx_INCREF(__pyx_n_s_w);
10254 __Pyx_GIVEREF(__pyx_n_s_w);
10255 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_n_s_w);
10256 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error)
10257 __Pyx_GOTREF(__pyx_t_2);
10258 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10260 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10261 __pyx_v_f = __pyx_t_2;
10282 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_h5py, __pyx_n_s_File);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error)
10283 __Pyx_GOTREF(__pyx_t_1);
10286 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
10287 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
10288 if (likely(__pyx_t_7)) {
10289 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
10290 __Pyx_INCREF(__pyx_t_7);
10291 __Pyx_INCREF(
function);
10292 __Pyx_DECREF_SET(__pyx_t_1,
function);
10296 #if CYTHON_FAST_PYCALL
10297 if (PyFunction_Check(__pyx_t_1)) {
10298 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_filename, __pyx_n_s_a};
10299 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error)
10300 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10301 __Pyx_GOTREF(__pyx_t_2);
10304 #if CYTHON_FAST_PYCCALL
10305 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
10306 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_filename, __pyx_n_s_a};
10307 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error)
10308 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10309 __Pyx_GOTREF(__pyx_t_2);
10313 __pyx_t_3 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 369, __pyx_L1_error)
10314 __Pyx_GOTREF(__pyx_t_3);
10316 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL;
10318 __Pyx_INCREF(__pyx_v_filename);
10319 __Pyx_GIVEREF(__pyx_v_filename);
10320 PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_8, __pyx_v_filename);
10321 __Pyx_INCREF(__pyx_n_s_a);
10322 __Pyx_GIVEREF(__pyx_n_s_a);
10323 PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_8, __pyx_n_s_a);
10324 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error)
10325 __Pyx_GOTREF(__pyx_t_2);
10326 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10328 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10329 __pyx_v_f = __pyx_t_2;
10341 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_create_dataset);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error)
10342 __Pyx_GOTREF(__pyx_t_2);
10343 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nFrames);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
10344 __Pyx_GOTREF(__pyx_t_1);
10345 __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error)
10346 __Pyx_GOTREF(__pyx_t_3);
10347 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10348 __pyx_t_1 = PyNumber_Add(__pyx_n_s_nodes, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
10349 __Pyx_GOTREF(__pyx_t_1);
10350 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10351 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error)
10352 __Pyx_GOTREF(__pyx_t_3);
10353 __Pyx_GIVEREF(__pyx_t_1);
10354 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
10356 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
10357 __Pyx_GOTREF(__pyx_t_1);
10358 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_data, __pyx_v_nodes) < 0) __PYX_ERR(0, 370, __pyx_L1_error)
10359 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 370, __pyx_L1_error)
10360 __Pyx_GOTREF(__pyx_t_7);
10361 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10362 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10363 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10364 __pyx_v_dset = __pyx_t_7;
10374 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_create_dataset);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 371, __pyx_L1_error)
10375 __Pyx_GOTREF(__pyx_t_7);
10376 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nFrames);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error)
10377 __Pyx_GOTREF(__pyx_t_1);
10378 __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 371, __pyx_L1_error)
10379 __Pyx_GOTREF(__pyx_t_3);
10380 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10381 __pyx_t_1 = PyNumber_Add(__pyx_n_s_elems, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error)
10382 __Pyx_GOTREF(__pyx_t_1);
10383 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10384 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 371, __pyx_L1_error)
10385 __Pyx_GOTREF(__pyx_t_3);
10386 __Pyx_GIVEREF(__pyx_t_1);
10387 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
10389 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error)
10390 __Pyx_GOTREF(__pyx_t_1);
10391 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_data, __pyx_v_elements) < 0) __PYX_ERR(0, 371, __pyx_L1_error)
10392 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error)
10393 __Pyx_GOTREF(__pyx_t_2);
10394 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10395 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10396 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10397 __Pyx_DECREF_SET(__pyx_v_dset, __pyx_t_2);
10407 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_create_dataset);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error)
10408 __Pyx_GOTREF(__pyx_t_2);
10409 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nFrames);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error)
10410 __Pyx_GOTREF(__pyx_t_1);
10411 __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error)
10412 __Pyx_GOTREF(__pyx_t_3);
10413 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10414 __pyx_t_1 = PyNumber_Add(__pyx_n_s_normals, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error)
10415 __Pyx_GOTREF(__pyx_t_1);
10416 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10417 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error)
10418 __Pyx_GOTREF(__pyx_t_3);
10419 __Pyx_GIVEREF(__pyx_t_1);
10420 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
10422 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error)
10423 __Pyx_GOTREF(__pyx_t_1);
10424 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_data, __pyx_v_normals) < 0) __PYX_ERR(0, 372, __pyx_L1_error)
10425 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 372, __pyx_L1_error)
10426 __Pyx_GOTREF(__pyx_t_7);
10427 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10428 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10429 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10430 __Pyx_DECREF_SET(__pyx_v_dset, __pyx_t_7);
10440 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_create_dataset);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 373, __pyx_L1_error)
10441 __Pyx_GOTREF(__pyx_t_7);
10442 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nFrames);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 373, __pyx_L1_error)
10443 __Pyx_GOTREF(__pyx_t_1);
10444 __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 373, __pyx_L1_error)
10445 __Pyx_GOTREF(__pyx_t_3);
10446 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10447 __pyx_t_1 = PyNumber_Add(__pyx_n_s_normal_indices, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 373, __pyx_L1_error)
10448 __Pyx_GOTREF(__pyx_t_1);
10449 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10450 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 373, __pyx_L1_error)
10451 __Pyx_GOTREF(__pyx_t_3);
10452 __Pyx_GIVEREF(__pyx_t_1);
10453 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
10455 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 373, __pyx_L1_error)
10456 __Pyx_GOTREF(__pyx_t_1);
10457 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_data, __pyx_v_normal_indices) < 0) __PYX_ERR(0, 373, __pyx_L1_error)
10458 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error)
10459 __Pyx_GOTREF(__pyx_t_2);
10460 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10461 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10462 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10463 __Pyx_DECREF_SET(__pyx_v_dset, __pyx_t_2);
10473 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_close);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error)
10474 __Pyx_GOTREF(__pyx_t_1);
10476 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
10477 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
10478 if (likely(__pyx_t_3)) {
10479 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
10480 __Pyx_INCREF(__pyx_t_3);
10481 __Pyx_INCREF(
function);
10482 __Pyx_DECREF_SET(__pyx_t_1,
function);
10485 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
10486 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10487 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error)
10488 __Pyx_GOTREF(__pyx_t_2);
10489 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10490 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10501 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10504 __Pyx_XDECREF(__pyx_t_1);
10505 __Pyx_XDECREF(__pyx_t_2);
10506 __Pyx_XDECREF(__pyx_t_3);
10507 __Pyx_XDECREF(__pyx_t_4);
10508 __Pyx_XDECREF(__pyx_t_5);
10509 __Pyx_XDECREF(__pyx_t_6);
10510 __Pyx_XDECREF(__pyx_t_7);
10511 __Pyx_AddTraceback(
"Isosurface.Isosurface.writeIsosurfaceMesh_h5", __pyx_clineno, __pyx_lineno, __pyx_filename);
10514 __Pyx_XDECREF(__pyx_v_h5py);
10515 __Pyx_XDECREF(__pyx_v_nodes);
10516 __Pyx_XDECREF(__pyx_v_elements);
10517 __Pyx_XDECREF(__pyx_v_normals);
10518 __Pyx_XDECREF(__pyx_v_normal_indices);
10519 __Pyx_XDECREF(__pyx_v_filename);
10520 __Pyx_XDECREF(__pyx_v_f);
10521 __Pyx_XDECREF(__pyx_v_dset);
10522 __Pyx_XGIVEREF(__pyx_r);
10523 __Pyx_RefNannyFinishContext();
10536 static PyObject *__pyx_pw_10Isosurface_10Isosurface_13writeIsosurfaceMesh_povray(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
10537 static char __pyx_doc_10Isosurface_10Isosurface_12writeIsosurfaceMesh_povray[] =
"Isosurface.writeIsosurfaceMesh_povray(self, field, value, frame)\n\n Write the triangular mesh to a povray file\n ";
10538 static PyMethodDef __pyx_mdef_10Isosurface_10Isosurface_13writeIsosurfaceMesh_povray = {
"writeIsosurfaceMesh_povray", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10Isosurface_10Isosurface_13writeIsosurfaceMesh_povray, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10Isosurface_10Isosurface_12writeIsosurfaceMesh_povray};
10539 static PyObject *__pyx_pw_10Isosurface_10Isosurface_13writeIsosurfaceMesh_povray(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10540 PyObject *__pyx_v_self = 0;
10541 PyObject *__pyx_v_field = 0;
10542 PyObject *__pyx_v_value = 0;
10543 CYTHON_UNUSED PyObject *__pyx_v_frame = 0;
10544 int __pyx_lineno = 0;
10545 const char *__pyx_filename = NULL;
10546 int __pyx_clineno = 0;
10547 PyObject *__pyx_r = 0;
10548 __Pyx_RefNannyDeclarations
10549 __Pyx_RefNannySetupContext(
"writeIsosurfaceMesh_povray (wrapper)", 0);
10551 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_field,&__pyx_n_s_value,&__pyx_n_s_frame,0};
10552 PyObject* values[4] = {0,0,0,0};
10553 if (unlikely(__pyx_kwds)) {
10554 Py_ssize_t kw_args;
10555 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10556 switch (pos_args) {
10557 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10558 CYTHON_FALLTHROUGH;
10559 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10560 CYTHON_FALLTHROUGH;
10561 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10562 CYTHON_FALLTHROUGH;
10563 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10564 CYTHON_FALLTHROUGH;
10566 default:
goto __pyx_L5_argtuple_error;
10568 kw_args = PyDict_Size(__pyx_kwds);
10569 switch (pos_args) {
10571 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
10572 else goto __pyx_L5_argtuple_error;
10573 CYTHON_FALLTHROUGH;
10575 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_field)) != 0)) kw_args--;
10577 __Pyx_RaiseArgtupleInvalid(
"writeIsosurfaceMesh_povray", 1, 4, 4, 1); __PYX_ERR(0, 376, __pyx_L3_error)
10579 CYTHON_FALLTHROUGH;
10581 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
10583 __Pyx_RaiseArgtupleInvalid(
"writeIsosurfaceMesh_povray", 1, 4, 4, 2); __PYX_ERR(0, 376, __pyx_L3_error)
10585 CYTHON_FALLTHROUGH;
10587 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_frame)) != 0)) kw_args--;
10589 __Pyx_RaiseArgtupleInvalid(
"writeIsosurfaceMesh_povray", 1, 4, 4, 3); __PYX_ERR(0, 376, __pyx_L3_error)
10592 if (unlikely(kw_args > 0)) {
10593 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"writeIsosurfaceMesh_povray") < 0)) __PYX_ERR(0, 376, __pyx_L3_error)
10595 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
10596 goto __pyx_L5_argtuple_error;
10598 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10599 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10600 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10601 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10603 __pyx_v_self = values[0];
10604 __pyx_v_field = values[1];
10605 __pyx_v_value = values[2];
10606 __pyx_v_frame = values[3];
10608 goto __pyx_L4_argument_unpacking_done;
10609 __pyx_L5_argtuple_error:;
10610 __Pyx_RaiseArgtupleInvalid(
"writeIsosurfaceMesh_povray", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 376, __pyx_L3_error)
10612 __Pyx_AddTraceback(
"Isosurface.Isosurface.writeIsosurfaceMesh_povray", __pyx_clineno, __pyx_lineno, __pyx_filename);
10613 __Pyx_RefNannyFinishContext();
10615 __pyx_L4_argument_unpacking_done:;
10616 __pyx_r = __pyx_pf_10Isosurface_10Isosurface_12writeIsosurfaceMesh_povray(__pyx_self, __pyx_v_self, __pyx_v_field, __pyx_v_value, __pyx_v_frame);
10619 __Pyx_RefNannyFinishContext();
10623 static PyObject *__pyx_pf_10Isosurface_10Isosurface_12writeIsosurfaceMesh_povray(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_frame) {
10624 PyObject *__pyx_v_Template = NULL;
10625 PyObject *__pyx_v_nodes = NULL;
10626 PyObject *__pyx_v_elements = NULL;
10627 PyObject *__pyx_v_normals = NULL;
10628 PyObject *__pyx_v_normal_indices = NULL;
10629 PyObject *__pyx_v_pov_filename = NULL;
10630 PyObject *__pyx_v_pov = NULL;
10631 PyObject *__pyx_v_dx = NULL;
10632 PyObject *__pyx_v_nll = NULL;
10633 PyObject *__pyx_v_fur = NULL;
10634 PyObject *__pyx_v_povScene = NULL;
10635 PyObject *__pyx_v_n = NULL;
10636 PyObject *__pyx_v_ebN = NULL;
10637 PyObject *__pyx_v_bnt = NULL;
10638 PyObject *__pyx_v_e = NULL;
10639 PyObject *__pyx_v_ni = NULL;
10640 PyObject *__pyx_r = NULL;
10641 __Pyx_RefNannyDeclarations
10642 PyObject *__pyx_t_1 = NULL;
10643 PyObject *__pyx_t_2 = NULL;
10644 PyObject *__pyx_t_3 = NULL;
10646 PyObject *__pyx_t_5 = NULL;
10648 PyObject *__pyx_t_7 = NULL;
10649 PyObject *__pyx_t_8 = NULL;
10650 Py_ssize_t __pyx_t_9;
10651 PyObject *(*__pyx_t_10)(PyObject *);
10652 PyObject *__pyx_t_11 = NULL;
10653 PyObject *__pyx_t_12 = NULL;
10654 Py_ssize_t __pyx_t_13;
10655 PyObject *(*__pyx_t_14)(PyObject *);
10656 int __pyx_lineno = 0;
10657 const char *__pyx_filename = NULL;
10658 int __pyx_clineno = 0;
10659 __Pyx_RefNannySetupContext(
"writeIsosurfaceMesh_povray", 0);
10668 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
10669 __Pyx_GOTREF(__pyx_t_1);
10670 __Pyx_INCREF(__pyx_n_s_Template);
10671 __Pyx_GIVEREF(__pyx_n_s_Template);
10672 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Template);
10673 __pyx_t_2 = __Pyx_Import(__pyx_n_s_string, __pyx_t_1, -1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error)
10674 __Pyx_GOTREF(__pyx_t_2);
10675 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10676 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Template);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
10677 __Pyx_GOTREF(__pyx_t_1);
10678 __Pyx_INCREF(__pyx_t_1);
10679 __pyx_v_Template = __pyx_t_1;
10680 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10681 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10690 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodes);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error)
10691 __Pyx_GOTREF(__pyx_t_2);
10692 __pyx_t_1 = PyTuple_New(2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error)
10693 __Pyx_GOTREF(__pyx_t_1);
10694 __Pyx_INCREF(__pyx_v_field);
10695 __Pyx_GIVEREF(__pyx_v_field);
10696 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_field);
10697 __Pyx_INCREF(__pyx_v_value);
10698 __Pyx_GIVEREF(__pyx_v_value);
10699 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value);
10700 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 381, __pyx_L1_error)
10701 __Pyx_GOTREF(__pyx_t_3);
10702 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10703 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10704 __pyx_v_nodes = __pyx_t_3;
10714 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_elements);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error)
10715 __Pyx_GOTREF(__pyx_t_3);
10716 __pyx_t_1 = PyTuple_New(2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
10717 __Pyx_GOTREF(__pyx_t_1);
10718 __Pyx_INCREF(__pyx_v_field);
10719 __Pyx_GIVEREF(__pyx_v_field);
10720 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_field);
10721 __Pyx_INCREF(__pyx_v_value);
10722 __Pyx_GIVEREF(__pyx_v_value);
10723 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value);
10724 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error)
10725 __Pyx_GOTREF(__pyx_t_2);
10726 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10727 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10728 __pyx_v_elements = __pyx_t_2;
10738 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_normals);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 383, __pyx_L1_error)
10739 __Pyx_GOTREF(__pyx_t_2);
10740 __pyx_t_1 = PyTuple_New(2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error)
10741 __Pyx_GOTREF(__pyx_t_1);
10742 __Pyx_INCREF(__pyx_v_field);
10743 __Pyx_GIVEREF(__pyx_v_field);
10744 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_field);
10745 __Pyx_INCREF(__pyx_v_value);
10746 __Pyx_GIVEREF(__pyx_v_value);
10747 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value);
10748 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 383, __pyx_L1_error)
10749 __Pyx_GOTREF(__pyx_t_3);
10750 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10751 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10752 __pyx_v_normals = __pyx_t_3;
10762 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_normal_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 384, __pyx_L1_error)
10763 __Pyx_GOTREF(__pyx_t_3);
10764 __pyx_t_1 = PyTuple_New(2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 384, __pyx_L1_error)
10765 __Pyx_GOTREF(__pyx_t_1);
10766 __Pyx_INCREF(__pyx_v_field);
10767 __Pyx_GIVEREF(__pyx_v_field);
10768 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_field);
10769 __Pyx_INCREF(__pyx_v_value);
10770 __Pyx_GIVEREF(__pyx_v_value);
10771 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value);
10772 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error)
10773 __Pyx_GOTREF(__pyx_t_2);
10774 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10775 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10776 __pyx_v_normal_indices = __pyx_t_2;
10786 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_field_s___value_f___frame_04d_p, __pyx_n_s_format);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L1_error)
10787 __Pyx_GOTREF(__pyx_t_2);
10796 __pyx_t_1 = __Pyx_PyDict_NewPresized(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error)
10797 __Pyx_GOTREF(__pyx_t_1);
10798 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_field, __pyx_v_field) < 0) __PYX_ERR(0, 386, __pyx_L1_error)
10807 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_value, __pyx_v_value) < 0) __PYX_ERR(0, 386, __pyx_L1_error)
10816 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nFrames);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 388, __pyx_L1_error)
10817 __Pyx_GOTREF(__pyx_t_3);
10818 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_frame, __pyx_t_3) < 0) __PYX_ERR(0, 386, __pyx_L1_error)
10819 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10828 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 385, __pyx_L1_error)
10829 __Pyx_GOTREF(__pyx_t_3);
10830 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10831 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10832 __pyx_v_pov_filename = __pyx_t_3;
10842 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_comm);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error)
10843 __Pyx_GOTREF(__pyx_t_1);
10844 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_beginSequential);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error)
10845 __Pyx_GOTREF(__pyx_t_2);
10846 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10848 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
10849 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
10850 if (likely(__pyx_t_1)) {
10851 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
10852 __Pyx_INCREF(__pyx_t_1);
10853 __Pyx_INCREF(
function);
10854 __Pyx_DECREF_SET(__pyx_t_2,
function);
10857 __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
10858 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
10859 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 389, __pyx_L1_error)
10860 __Pyx_GOTREF(__pyx_t_3);
10861 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10862 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10871 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_comm);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error)
10872 __Pyx_GOTREF(__pyx_t_2);
10873 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_isMaster);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error)
10874 __Pyx_GOTREF(__pyx_t_1);
10875 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10877 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
10878 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
10879 if (likely(__pyx_t_2)) {
10880 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
10881 __Pyx_INCREF(__pyx_t_2);
10882 __Pyx_INCREF(
function);
10883 __Pyx_DECREF_SET(__pyx_t_1,
function);
10886 __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
10887 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
10888 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 390, __pyx_L1_error)
10889 __Pyx_GOTREF(__pyx_t_3);
10890 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10891 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 390, __pyx_L1_error)
10892 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10902 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L1_error)
10903 __Pyx_GOTREF(__pyx_t_3);
10904 __Pyx_INCREF(__pyx_v_pov_filename);
10905 __Pyx_GIVEREF(__pyx_v_pov_filename);
10906 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_pov_filename);
10907 __Pyx_INCREF(__pyx_n_s_w);
10908 __Pyx_GIVEREF(__pyx_n_s_w);
10909 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_w);
10910 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_3, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error)
10911 __Pyx_GOTREF(__pyx_t_1);
10912 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10913 __pyx_v_pov = __pyx_t_1;
10923 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 392, __pyx_L1_error)
10924 __Pyx_GOTREF(__pyx_t_3);
10925 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error)
10926 __Pyx_GOTREF(__pyx_t_2);
10927 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10928 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 392, __pyx_L1_error)
10929 __Pyx_GOTREF(__pyx_t_3);
10930 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_L);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 392, __pyx_L1_error)
10931 __Pyx_GOTREF(__pyx_t_5);
10932 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10934 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
10935 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
10936 if (likely(__pyx_t_3)) {
10937 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
10938 __Pyx_INCREF(__pyx_t_3);
10939 __Pyx_INCREF(
function);
10940 __Pyx_DECREF_SET(__pyx_t_2,
function);
10943 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5);
10944 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10945 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10946 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 392, __pyx_L1_error)
10947 __Pyx_GOTREF(__pyx_t_1);
10948 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10949 __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_float_0_02);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error)
10950 __Pyx_GOTREF(__pyx_t_2);
10951 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10952 __pyx_v_dx = __pyx_t_2;
10962 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error)
10963 __Pyx_GOTREF(__pyx_t_1);
10964 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 393, __pyx_L1_error)
10965 __Pyx_GOTREF(__pyx_t_5);
10966 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10967 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error)
10968 __Pyx_GOTREF(__pyx_t_1);
10969 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_x);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L1_error)
10970 __Pyx_GOTREF(__pyx_t_3);
10971 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10973 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
10974 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
10975 if (likely(__pyx_t_1)) {
10976 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
10977 __Pyx_INCREF(__pyx_t_1);
10978 __Pyx_INCREF(
function);
10979 __Pyx_DECREF_SET(__pyx_t_5,
function);
10982 __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3);
10983 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
10984 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10985 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error)
10986 __Pyx_GOTREF(__pyx_t_2);
10987 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10988 __pyx_t_5 = PyNumber_Subtract(__pyx_t_2, __pyx_v_dx);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 393, __pyx_L1_error)
10989 __Pyx_GOTREF(__pyx_t_5);
10990 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10991 __pyx_v_nll = __pyx_t_5;
11001 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error)
11002 __Pyx_GOTREF(__pyx_t_2);
11003 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error)
11004 __Pyx_GOTREF(__pyx_t_3);
11005 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11006 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error)
11007 __Pyx_GOTREF(__pyx_t_2);
11008 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_L);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __pyx_L1_error)
11009 __Pyx_GOTREF(__pyx_t_1);
11010 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11012 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
11013 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11014 if (likely(__pyx_t_2)) {
11015 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11016 __Pyx_INCREF(__pyx_t_2);
11017 __Pyx_INCREF(
function);
11018 __Pyx_DECREF_SET(__pyx_t_3,
function);
11021 __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1);
11022 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11023 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11024 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 394, __pyx_L1_error)
11025 __Pyx_GOTREF(__pyx_t_5);
11026 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11027 __pyx_t_3 = PyNumber_Add(__pyx_t_5, __pyx_v_dx);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error)
11028 __Pyx_GOTREF(__pyx_t_3);
11029 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11030 __pyx_v_fur = __pyx_t_3;
11040 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 395, __pyx_L1_error)
11041 __Pyx_GOTREF(__pyx_t_3);
11042 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_L);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 395, __pyx_L1_error)
11043 __Pyx_GOTREF(__pyx_t_5);
11044 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11045 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_5, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 395, __pyx_L1_error)
11046 __Pyx_GOTREF(__pyx_t_3);
11047 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11048 __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_dx, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 395, __pyx_L1_error)
11049 __Pyx_GOTREF(__pyx_t_5);
11050 __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error)
11051 __Pyx_GOTREF(__pyx_t_1);
11052 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11053 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11054 if (unlikely(__Pyx_SetItemInt(__pyx_v_fur, 2, __pyx_t_1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 395, __pyx_L1_error)
11055 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11064 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_write);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 396, __pyx_L1_error)
11065 __Pyx_GOTREF(__pyx_t_5);
11067 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
11068 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
11069 if (likely(__pyx_t_3)) {
11070 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
11071 __Pyx_INCREF(__pyx_t_3);
11072 __Pyx_INCREF(
function);
11073 __Pyx_DECREF_SET(__pyx_t_5,
function);
11076 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_kp_s_version_3_7_include_proteus_inc) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_s_version_3_7_include_proteus_inc);
11077 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11078 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 396, __pyx_L1_error)
11079 __Pyx_GOTREF(__pyx_t_1);
11080 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11081 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11090 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writeBoundary);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error)
11091 __Pyx_GOTREF(__pyx_t_1);
11092 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 399, __pyx_L1_error)
11093 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11094 __pyx_t_6 = ((!__pyx_t_4) != 0);
11104 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_write);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 400, __pyx_L1_error)
11105 __Pyx_GOTREF(__pyx_t_5);
11106 __Pyx_INCREF(__pyx_v_Template);
11107 __pyx_t_2 = __pyx_v_Template; __pyx_t_7 = NULL;
11108 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
11109 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
11110 if (likely(__pyx_t_7)) {
11111 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
11112 __Pyx_INCREF(__pyx_t_7);
11113 __Pyx_INCREF(
function);
11114 __Pyx_DECREF_SET(__pyx_t_2,
function);
11117 __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_kp_s_object_difference_box_nll_x_nll) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_object_difference_box_nll_x_nll);
11118 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11119 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 400, __pyx_L1_error)
11120 __Pyx_GOTREF(__pyx_t_3);
11121 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11130 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_substitute);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error)
11131 __Pyx_GOTREF(__pyx_t_2);
11132 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11133 __pyx_t_3 = __Pyx_PyDict_NewPresized(12);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error)
11134 __Pyx_GOTREF(__pyx_t_3);
11135 __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_nll, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 420, __pyx_L1_error)
11136 __Pyx_GOTREF(__pyx_t_7);
11137 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_nll_x, __pyx_t_7) < 0) __PYX_ERR(0, 420, __pyx_L1_error)
11138 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11147 __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_nll, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 421, __pyx_L1_error)
11148 __Pyx_GOTREF(__pyx_t_7);
11149 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_nll_y, __pyx_t_7) < 0) __PYX_ERR(0, 420, __pyx_L1_error)
11150 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11159 __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_nll, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 422, __pyx_L1_error)
11160 __Pyx_GOTREF(__pyx_t_7);
11161 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_nll_z, __pyx_t_7) < 0) __PYX_ERR(0, 420, __pyx_L1_error)
11162 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11171 __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_fur, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 423, __pyx_L1_error)
11172 __Pyx_GOTREF(__pyx_t_7);
11173 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fur_x, __pyx_t_7) < 0) __PYX_ERR(0, 420, __pyx_L1_error)
11174 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11183 __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_fur, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 424, __pyx_L1_error)
11184 __Pyx_GOTREF(__pyx_t_7);
11185 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fur_y, __pyx_t_7) < 0) __PYX_ERR(0, 420, __pyx_L1_error)
11186 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11195 __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_fur, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 425, __pyx_L1_error)
11196 __Pyx_GOTREF(__pyx_t_7);
11197 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fur_z, __pyx_t_7) < 0) __PYX_ERR(0, 420, __pyx_L1_error)
11198 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11207 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 426, __pyx_L1_error)
11208 __Pyx_GOTREF(__pyx_t_7);
11209 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_x);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 426, __pyx_L1_error)
11210 __Pyx_GOTREF(__pyx_t_8);
11211 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11212 __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_8, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 426, __pyx_L1_error)
11213 __Pyx_GOTREF(__pyx_t_7);
11214 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11215 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_domain_nll_x, __pyx_t_7) < 0) __PYX_ERR(0, 420, __pyx_L1_error)
11216 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11225 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 427, __pyx_L1_error)
11226 __Pyx_GOTREF(__pyx_t_7);
11227 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_x);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 427, __pyx_L1_error)
11228 __Pyx_GOTREF(__pyx_t_8);
11229 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11230 __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_8, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 427, __pyx_L1_error)
11231 __Pyx_GOTREF(__pyx_t_7);
11232 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11233 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_domain_nll_y, __pyx_t_7) < 0) __PYX_ERR(0, 420, __pyx_L1_error)
11234 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11243 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 428, __pyx_L1_error)
11244 __Pyx_GOTREF(__pyx_t_7);
11245 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_x);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 428, __pyx_L1_error)
11246 __Pyx_GOTREF(__pyx_t_8);
11247 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11248 __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_8, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 428, __pyx_L1_error)
11249 __Pyx_GOTREF(__pyx_t_7);
11250 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11251 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_domain_nll_z, __pyx_t_7) < 0) __PYX_ERR(0, 420, __pyx_L1_error)
11252 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11261 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 429, __pyx_L1_error)
11262 __Pyx_GOTREF(__pyx_t_7);
11263 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_L);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 429, __pyx_L1_error)
11264 __Pyx_GOTREF(__pyx_t_8);
11265 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11266 __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_8, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 429, __pyx_L1_error)
11267 __Pyx_GOTREF(__pyx_t_7);
11268 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11269 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_domain_fur_x, __pyx_t_7) < 0) __PYX_ERR(0, 420, __pyx_L1_error)
11270 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11279 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 430, __pyx_L1_error)
11280 __Pyx_GOTREF(__pyx_t_7);
11281 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_L);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 430, __pyx_L1_error)
11282 __Pyx_GOTREF(__pyx_t_8);
11283 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11284 __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_8, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 430, __pyx_L1_error)
11285 __Pyx_GOTREF(__pyx_t_7);
11286 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11287 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_domain_fur_y, __pyx_t_7) < 0) __PYX_ERR(0, 420, __pyx_L1_error)
11288 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11297 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 431, __pyx_L1_error)
11298 __Pyx_GOTREF(__pyx_t_7);
11299 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_L);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 431, __pyx_L1_error)
11300 __Pyx_GOTREF(__pyx_t_8);
11301 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11302 __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_8, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 431, __pyx_L1_error)
11303 __Pyx_GOTREF(__pyx_t_7);
11304 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11305 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_domain_fur_z, __pyx_t_7) < 0) __PYX_ERR(0, 420, __pyx_L1_error)
11306 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11315 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 420, __pyx_L1_error)
11316 __Pyx_GOTREF(__pyx_t_7);
11317 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11318 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11320 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
11321 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
11322 if (likely(__pyx_t_3)) {
11323 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
11324 __Pyx_INCREF(__pyx_t_3);
11325 __Pyx_INCREF(
function);
11326 __Pyx_DECREF_SET(__pyx_t_5,
function);
11329 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7);
11330 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11331 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11332 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
11333 __Pyx_GOTREF(__pyx_t_1);
11334 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11335 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11344 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_flush);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L1_error)
11345 __Pyx_GOTREF(__pyx_t_5);
11347 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
11348 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
11349 if (likely(__pyx_t_7)) {
11350 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
11351 __Pyx_INCREF(__pyx_t_7);
11352 __Pyx_INCREF(
function);
11353 __Pyx_DECREF_SET(__pyx_t_5,
function);
11356 __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
11357 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11358 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error)
11359 __Pyx_GOTREF(__pyx_t_1);
11360 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11361 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11379 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writeBoundary);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L1_error)
11380 __Pyx_GOTREF(__pyx_t_1);
11381 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 433, __pyx_L1_error)
11382 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11392 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_write);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 434, __pyx_L1_error)
11393 __Pyx_GOTREF(__pyx_t_5);
11394 __Pyx_INCREF(__pyx_v_Template);
11395 __pyx_t_3 = __pyx_v_Template; __pyx_t_2 = NULL;
11396 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
11397 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11398 if (likely(__pyx_t_2)) {
11399 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
11400 __Pyx_INCREF(__pyx_t_2);
11401 __Pyx_INCREF(
function);
11402 __Pyx_DECREF_SET(__pyx_t_3,
function);
11405 __pyx_t_7 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_kp_s_object_difference_box_nll_x_nll_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_object_difference_box_nll_x_nll_2);
11406 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11407 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 434, __pyx_L1_error)
11408 __Pyx_GOTREF(__pyx_t_7);
11409 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11418 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_substitute);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 445, __pyx_L1_error)
11419 __Pyx_GOTREF(__pyx_t_3);
11420 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11421 __pyx_t_7 = __Pyx_PyDict_NewPresized(6);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 445, __pyx_L1_error)
11422 __Pyx_GOTREF(__pyx_t_7);
11423 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nll, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error)
11424 __Pyx_GOTREF(__pyx_t_2);
11425 if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_nll_x, __pyx_t_2) < 0) __PYX_ERR(0, 445, __pyx_L1_error)
11426 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11435 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nll, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error)
11436 __Pyx_GOTREF(__pyx_t_2);
11437 if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_nll_y, __pyx_t_2) < 0) __PYX_ERR(0, 445, __pyx_L1_error)
11438 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11447 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nll, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error)
11448 __Pyx_GOTREF(__pyx_t_2);
11449 if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_nll_z, __pyx_t_2) < 0) __PYX_ERR(0, 445, __pyx_L1_error)
11450 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11459 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_fur, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error)
11460 __Pyx_GOTREF(__pyx_t_2);
11461 if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_fur_x, __pyx_t_2) < 0) __PYX_ERR(0, 445, __pyx_L1_error)
11462 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11471 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_fur, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error)
11472 __Pyx_GOTREF(__pyx_t_2);
11473 if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_fur_y, __pyx_t_2) < 0) __PYX_ERR(0, 445, __pyx_L1_error)
11474 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11483 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_fur, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error)
11484 __Pyx_GOTREF(__pyx_t_2);
11485 if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_fur_z, __pyx_t_2) < 0) __PYX_ERR(0, 445, __pyx_L1_error)
11486 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11495 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_7);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error)
11496 __Pyx_GOTREF(__pyx_t_2);
11497 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11498 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11500 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
11501 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
11502 if (likely(__pyx_t_7)) {
11503 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
11504 __Pyx_INCREF(__pyx_t_7);
11505 __Pyx_INCREF(
function);
11506 __Pyx_DECREF_SET(__pyx_t_5,
function);
11509 __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2);
11510 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11511 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11512 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error)
11513 __Pyx_GOTREF(__pyx_t_1);
11514 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11515 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11533 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_flush);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 451, __pyx_L1_error)
11534 __Pyx_GOTREF(__pyx_t_5);
11536 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
11537 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
11538 if (likely(__pyx_t_2)) {
11539 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
11540 __Pyx_INCREF(__pyx_t_2);
11541 __Pyx_INCREF(
function);
11542 __Pyx_DECREF_SET(__pyx_t_5,
function);
11545 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
11546 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11547 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error)
11548 __Pyx_GOTREF(__pyx_t_1);
11549 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11550 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11570 __pyx_t_1 = PyTuple_New(2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error)
11571 __Pyx_GOTREF(__pyx_t_1);
11572 __Pyx_INCREF(__pyx_v_pov_filename);
11573 __Pyx_GIVEREF(__pyx_v_pov_filename);
11574 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_pov_filename);
11575 __Pyx_INCREF(__pyx_n_s_a);
11576 __Pyx_GIVEREF(__pyx_n_s_a);
11577 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_a);
11578 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 453, __pyx_L1_error)
11579 __Pyx_GOTREF(__pyx_t_5);
11580 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11581 __pyx_v_pov = __pyx_t_5;
11593 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writeBoundary);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 454, __pyx_L1_error)
11594 __Pyx_GOTREF(__pyx_t_5);
11595 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 454, __pyx_L1_error)
11596 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11606 __Pyx_INCREF(__pyx_kp_s_mesh2_vertex_vectors);
11607 __pyx_v_povScene = __pyx_kp_s_mesh2_vertex_vectors;
11616 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_write);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
11617 __Pyx_GOTREF(__pyx_t_1);
11619 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
11620 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
11621 if (likely(__pyx_t_2)) {
11622 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
11623 __Pyx_INCREF(__pyx_t_2);
11624 __Pyx_INCREF(
function);
11625 __Pyx_DECREF_SET(__pyx_t_1,
function);
11628 __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_v_povScene) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_povScene);
11629 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11630 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 457, __pyx_L1_error)
11631 __Pyx_GOTREF(__pyx_t_5);
11632 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11633 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11642 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_write);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error)
11643 __Pyx_GOTREF(__pyx_t_1);
11644 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_d, __pyx_n_s_format);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 458, __pyx_L1_error)
11645 __Pyx_GOTREF(__pyx_t_7);
11646 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_boundaryNodes);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error)
11647 __Pyx_GOTREF(__pyx_t_3);
11648 __pyx_t_9 = PyObject_Length(__pyx_t_3);
if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 458, __pyx_L1_error)
11649 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11650 __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_9);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error)
11651 __Pyx_GOTREF(__pyx_t_3);
11653 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
11654 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
11655 if (likely(__pyx_t_8)) {
11656 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
11657 __Pyx_INCREF(__pyx_t_8);
11658 __Pyx_INCREF(
function);
11659 __Pyx_DECREF_SET(__pyx_t_7,
function);
11662 __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3);
11663 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
11664 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11665 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error)
11666 __Pyx_GOTREF(__pyx_t_2);
11667 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11669 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
11670 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
11671 if (likely(__pyx_t_7)) {
11672 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
11673 __Pyx_INCREF(__pyx_t_7);
11674 __Pyx_INCREF(
function);
11675 __Pyx_DECREF_SET(__pyx_t_1,
function);
11678 __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
11679 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11680 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11681 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 458, __pyx_L1_error)
11682 __Pyx_GOTREF(__pyx_t_5);
11683 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11684 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11693 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_boundaryNodes);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 459, __pyx_L1_error)
11694 __Pyx_GOTREF(__pyx_t_5);
11695 if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
11696 __pyx_t_1 = __pyx_t_5; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
11699 __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error)
11700 __Pyx_GOTREF(__pyx_t_1);
11701 __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext;
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 459, __pyx_L1_error)
11703 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11705 if (likely(!__pyx_t_10)) {
11706 if (likely(PyList_CheckExact(__pyx_t_1))) {
11707 if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1))
break;
11708 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11709 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_5); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 459, __pyx_L1_error)
11711 __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 459, __pyx_L1_error)
11712 __Pyx_GOTREF(__pyx_t_5);
11715 if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
11716 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11717 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_5); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 459, __pyx_L1_error)
11719 __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 459, __pyx_L1_error)
11720 __Pyx_GOTREF(__pyx_t_5);
11724 __pyx_t_5 = __pyx_t_10(__pyx_t_1);
11725 if (unlikely(!__pyx_t_5)) {
11726 PyObject* exc_type = PyErr_Occurred();
11728 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11729 else __PYX_ERR(0, 459, __pyx_L1_error)
11733 __Pyx_GOTREF(__pyx_t_5);
11735 __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5);
11745 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_write);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 460, __pyx_L1_error)
11746 __Pyx_GOTREF(__pyx_t_2);
11747 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_f_1_f_2_f, __pyx_n_s_format);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 460, __pyx_L1_error)
11748 __Pyx_GOTREF(__pyx_t_7);
11757 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodeArray);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L1_error)
11758 __Pyx_GOTREF(__pyx_t_3);
11759 __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_n);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 461, __pyx_L1_error)
11760 __Pyx_GOTREF(__pyx_t_8);
11761 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11770 __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_8);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 460, __pyx_L1_error)
11771 __Pyx_GOTREF(__pyx_t_3);
11772 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11773 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 460, __pyx_L1_error)
11774 __Pyx_GOTREF(__pyx_t_8);
11775 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11776 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11778 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
11779 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11780 if (likely(__pyx_t_3)) {
11781 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
11782 __Pyx_INCREF(__pyx_t_3);
11783 __Pyx_INCREF(
function);
11784 __Pyx_DECREF_SET(__pyx_t_2,
function);
11787 __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8);
11788 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11789 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11790 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 460, __pyx_L1_error)
11791 __Pyx_GOTREF(__pyx_t_5);
11792 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11793 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11803 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11812 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_write);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error)
11813 __Pyx_GOTREF(__pyx_t_5);
11815 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
11816 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
11817 if (likely(__pyx_t_2)) {
11818 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
11819 __Pyx_INCREF(__pyx_t_2);
11820 __Pyx_INCREF(
function);
11821 __Pyx_DECREF_SET(__pyx_t_5,
function);
11824 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, __pyx_kp_s__6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_s__6);
11825 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11826 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
11827 __Pyx_GOTREF(__pyx_t_1);
11828 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11829 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11838 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_write);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 463, __pyx_L1_error)
11839 __Pyx_GOTREF(__pyx_t_5);
11841 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
11842 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
11843 if (likely(__pyx_t_2)) {
11844 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
11845 __Pyx_INCREF(__pyx_t_2);
11846 __Pyx_INCREF(
function);
11847 __Pyx_DECREF_SET(__pyx_t_5,
function);
11850 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, __pyx_kp_s_face_indices) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_s_face_indices);
11851 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11852 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
11853 __Pyx_GOTREF(__pyx_t_1);
11854 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11855 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11864 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_write);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 465, __pyx_L1_error)
11865 __Pyx_GOTREF(__pyx_t_5);
11866 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_d, __pyx_n_s_format);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 465, __pyx_L1_error)
11867 __Pyx_GOTREF(__pyx_t_8);
11876 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 466, __pyx_L1_error)
11877 __Pyx_GOTREF(__pyx_t_7);
11878 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_count_nonzero);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 466, __pyx_L1_error)
11879 __Pyx_GOTREF(__pyx_t_11);
11880 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11881 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_elementBoundaryMaterialTypes);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 466, __pyx_L1_error)
11882 __Pyx_GOTREF(__pyx_t_7);
11884 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
11885 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
11886 if (likely(__pyx_t_12)) {
11887 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_11);
11888 __Pyx_INCREF(__pyx_t_12);
11889 __Pyx_INCREF(
function);
11890 __Pyx_DECREF_SET(__pyx_t_11,
function);
11893 __pyx_t_3 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_7);
11894 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
11895 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11896 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error)
11897 __Pyx_GOTREF(__pyx_t_3);
11898 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
11900 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
11901 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
11902 if (likely(__pyx_t_11)) {
11903 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
11904 __Pyx_INCREF(__pyx_t_11);
11905 __Pyx_INCREF(
function);
11906 __Pyx_DECREF_SET(__pyx_t_8,
function);
11909 __pyx_t_2 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_11, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_3);
11910 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
11911 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11912 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error)
11913 __Pyx_GOTREF(__pyx_t_2);
11914 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11916 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
11917 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
11918 if (likely(__pyx_t_8)) {
11919 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
11920 __Pyx_INCREF(__pyx_t_8);
11921 __Pyx_INCREF(
function);
11922 __Pyx_DECREF_SET(__pyx_t_5,
function);
11925 __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2);
11926 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
11927 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11928 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error)
11929 __Pyx_GOTREF(__pyx_t_1);
11930 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11931 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11940 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_exteriorElementBoundariesArray);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error)
11941 __Pyx_GOTREF(__pyx_t_1);
11942 if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
11943 __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_9 = 0;
11946 __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 467, __pyx_L1_error)
11947 __Pyx_GOTREF(__pyx_t_5);
11948 __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext;
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 467, __pyx_L1_error)
11950 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11952 if (likely(!__pyx_t_10)) {
11953 if (likely(PyList_CheckExact(__pyx_t_5))) {
11954 if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_5))
break;
11955 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11956 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 467, __pyx_L1_error)
11958 __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error)
11959 __Pyx_GOTREF(__pyx_t_1);
11962 if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_5))
break;
11963 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11964 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 467, __pyx_L1_error)
11966 __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error)
11967 __Pyx_GOTREF(__pyx_t_1);
11971 __pyx_t_1 = __pyx_t_10(__pyx_t_5);
11972 if (unlikely(!__pyx_t_1)) {
11973 PyObject* exc_type = PyErr_Occurred();
11975 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11976 else __PYX_ERR(0, 467, __pyx_L1_error)
11980 __Pyx_GOTREF(__pyx_t_1);
11982 __Pyx_XDECREF_SET(__pyx_v_ebN, __pyx_t_1);
11992 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_elementBoundaryMaterialTypes);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error)
11993 __Pyx_GOTREF(__pyx_t_1);
11994 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_ebN);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 468, __pyx_L1_error)
11995 __Pyx_GOTREF(__pyx_t_2);
11996 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11997 __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error)
11998 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11999 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 468, __pyx_L1_error)
12000 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12010 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error)
12011 __Pyx_GOTREF(__pyx_t_1);
12020 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_elementBoundaryNodesArray);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error)
12021 __Pyx_GOTREF(__pyx_t_2);
12022 __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_ebN);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 471, __pyx_L1_error)
12023 __Pyx_GOTREF(__pyx_t_8);
12024 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12025 if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
12026 __pyx_t_2 = __pyx_t_8; __Pyx_INCREF(__pyx_t_2); __pyx_t_13 = 0;
12029 __pyx_t_13 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error)
12030 __Pyx_GOTREF(__pyx_t_2);
12031 __pyx_t_14 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 471, __pyx_L1_error)
12033 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12035 if (likely(!__pyx_t_14)) {
12036 if (likely(PyList_CheckExact(__pyx_t_2))) {
12037 if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_2))
break;
12038 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12039 __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_8); __pyx_t_13++;
if (unlikely(0 < 0)) __PYX_ERR(0, 471, __pyx_L1_error)
12041 __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++;
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 471, __pyx_L1_error)
12042 __Pyx_GOTREF(__pyx_t_8);
12045 if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
12046 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12047 __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_13); __Pyx_INCREF(__pyx_t_8); __pyx_t_13++;
if (unlikely(0 < 0)) __PYX_ERR(0, 471, __pyx_L1_error)
12049 __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_13); __pyx_t_13++;
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 471, __pyx_L1_error)
12050 __Pyx_GOTREF(__pyx_t_8);
12054 __pyx_t_8 = __pyx_t_14(__pyx_t_2);
12055 if (unlikely(!__pyx_t_8)) {
12056 PyObject* exc_type = PyErr_Occurred();
12058 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
12059 else __PYX_ERR(0, 471, __pyx_L1_error)
12063 __Pyx_GOTREF(__pyx_t_8);
12065 __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_8);
12075 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_g2b);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 470, __pyx_L1_error)
12076 __Pyx_GOTREF(__pyx_t_8);
12077 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_v_n);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __pyx_L1_error)
12078 __Pyx_GOTREF(__pyx_t_3);
12079 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12080 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 470, __pyx_L1_error)
12081 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12083 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12092 __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 469, __pyx_L1_error)
12093 __Pyx_GOTREF(__pyx_t_2);
12094 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12095 __Pyx_XDECREF_SET(__pyx_v_bnt, ((PyObject*)__pyx_t_2));
12105 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_write);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error)
12106 __Pyx_GOTREF(__pyx_t_1);
12107 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_d_1_d_2_d, __pyx_n_s_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 472, __pyx_L1_error)
12108 __Pyx_GOTREF(__pyx_t_3);
12109 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_v_bnt, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 472, __pyx_L1_error)
12110 __Pyx_GOTREF(__pyx_t_8);
12111 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12113 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
12114 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
12115 if (likely(__pyx_t_3)) {
12116 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
12117 __Pyx_INCREF(__pyx_t_3);
12118 __Pyx_INCREF(
function);
12119 __Pyx_DECREF_SET(__pyx_t_1,
function);
12122 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_8);
12123 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12124 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12125 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 472, __pyx_L1_error)
12126 __Pyx_GOTREF(__pyx_t_2);
12127 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12128 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12147 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12156 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_write);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 473, __pyx_L1_error)
12157 __Pyx_GOTREF(__pyx_t_2);
12159 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12160 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
12161 if (likely(__pyx_t_1)) {
12162 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12163 __Pyx_INCREF(__pyx_t_1);
12164 __Pyx_INCREF(
function);
12165 __Pyx_DECREF_SET(__pyx_t_2,
function);
12168 __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_kp_s__6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s__6);
12169 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12170 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 473, __pyx_L1_error)
12171 __Pyx_GOTREF(__pyx_t_5);
12172 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12173 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12182 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_write);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
12183 __Pyx_GOTREF(__pyx_t_2);
12185 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12186 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
12187 if (likely(__pyx_t_1)) {
12188 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12189 __Pyx_INCREF(__pyx_t_1);
12190 __Pyx_INCREF(
function);
12191 __Pyx_DECREF_SET(__pyx_t_2,
function);
12194 __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_kp_s_inside_vector_on_mesh) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_inside_vector_on_mesh);
12195 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12196 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error)
12197 __Pyx_GOTREF(__pyx_t_5);
12198 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12199 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12208 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_flush);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error)
12209 __Pyx_GOTREF(__pyx_t_2);
12211 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12212 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
12213 if (likely(__pyx_t_1)) {
12214 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12215 __Pyx_INCREF(__pyx_t_1);
12216 __Pyx_INCREF(
function);
12217 __Pyx_DECREF_SET(__pyx_t_2,
function);
12220 __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
12221 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12222 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 475, __pyx_L1_error)
12223 __Pyx_GOTREF(__pyx_t_5);
12224 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12225 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12234 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_close);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error)
12235 __Pyx_GOTREF(__pyx_t_2);
12237 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12238 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
12239 if (likely(__pyx_t_1)) {
12240 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12241 __Pyx_INCREF(__pyx_t_1);
12242 __Pyx_INCREF(
function);
12243 __Pyx_DECREF_SET(__pyx_t_2,
function);
12246 __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
12247 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12248 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 476, __pyx_L1_error)
12249 __Pyx_GOTREF(__pyx_t_5);
12250 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12251 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12260 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_comm);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 477, __pyx_L1_error)
12261 __Pyx_GOTREF(__pyx_t_2);
12262 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_endSequential);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
12263 __Pyx_GOTREF(__pyx_t_1);
12264 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12266 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
12267 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
12268 if (likely(__pyx_t_2)) {
12269 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
12270 __Pyx_INCREF(__pyx_t_2);
12271 __Pyx_INCREF(
function);
12272 __Pyx_DECREF_SET(__pyx_t_1,
function);
12275 __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
12276 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12277 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 477, __pyx_L1_error)
12278 __Pyx_GOTREF(__pyx_t_5);
12279 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12280 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12289 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_comm);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 478, __pyx_L1_error)
12290 __Pyx_GOTREF(__pyx_t_1);
12291 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_barrier);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error)
12292 __Pyx_GOTREF(__pyx_t_2);
12293 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12295 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12296 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
12297 if (likely(__pyx_t_1)) {
12298 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12299 __Pyx_INCREF(__pyx_t_1);
12300 __Pyx_INCREF(
function);
12301 __Pyx_DECREF_SET(__pyx_t_2,
function);
12304 __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
12305 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12306 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 478, __pyx_L1_error)
12307 __Pyx_GOTREF(__pyx_t_5);
12308 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12309 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12318 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_comm);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error)
12319 __Pyx_GOTREF(__pyx_t_2);
12320 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_beginSequential);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 479, __pyx_L1_error)
12321 __Pyx_GOTREF(__pyx_t_1);
12322 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12324 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
12325 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
12326 if (likely(__pyx_t_2)) {
12327 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
12328 __Pyx_INCREF(__pyx_t_2);
12329 __Pyx_INCREF(
function);
12330 __Pyx_DECREF_SET(__pyx_t_1,
function);
12333 __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
12334 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12335 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 479, __pyx_L1_error)
12336 __Pyx_GOTREF(__pyx_t_5);
12337 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12338 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12347 __pyx_t_5 = PyTuple_New(2);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 480, __pyx_L1_error)
12348 __Pyx_GOTREF(__pyx_t_5);
12349 __Pyx_INCREF(__pyx_v_pov_filename);
12350 __Pyx_GIVEREF(__pyx_v_pov_filename);
12351 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_pov_filename);
12352 __Pyx_INCREF(__pyx_n_s_a);
12353 __Pyx_GIVEREF(__pyx_n_s_a);
12354 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_a);
12355 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 480, __pyx_L1_error)
12356 __Pyx_GOTREF(__pyx_t_1);
12357 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12358 __Pyx_DECREF_SET(__pyx_v_pov, __pyx_t_1);
12368 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_comm);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 481, __pyx_L1_error)
12369 __Pyx_GOTREF(__pyx_t_5);
12370 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_isMaster);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error)
12371 __Pyx_GOTREF(__pyx_t_2);
12372 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12374 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12375 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
12376 if (likely(__pyx_t_5)) {
12377 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12378 __Pyx_INCREF(__pyx_t_5);
12379 __Pyx_INCREF(
function);
12380 __Pyx_DECREF_SET(__pyx_t_2,
function);
12383 __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
12384 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12385 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 481, __pyx_L1_error)
12386 __Pyx_GOTREF(__pyx_t_1);
12387 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12388 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 481, __pyx_L1_error)
12389 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12399 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_write);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 482, __pyx_L1_error)
12400 __Pyx_GOTREF(__pyx_t_2);
12402 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12403 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
12404 if (likely(__pyx_t_5)) {
12405 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12406 __Pyx_INCREF(__pyx_t_5);
12407 __Pyx_INCREF(
function);
12408 __Pyx_DECREF_SET(__pyx_t_2,
function);
12411 __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_kp_s_union_of_meshes_difference_of_p) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_union_of_meshes_difference_of_p);
12412 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12413 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 482, __pyx_L1_error)
12414 __Pyx_GOTREF(__pyx_t_1);
12415 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12416 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12443 __Pyx_INCREF(__pyx_kp_s_mesh2_vertex_vectors);
12444 __Pyx_XDECREF_SET(__pyx_v_povScene, __pyx_kp_s_mesh2_vertex_vectors);
12453 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_write);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error)
12454 __Pyx_GOTREF(__pyx_t_2);
12456 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12457 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
12458 if (likely(__pyx_t_5)) {
12459 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12460 __Pyx_INCREF(__pyx_t_5);
12461 __Pyx_INCREF(
function);
12462 __Pyx_DECREF_SET(__pyx_t_2,
function);
12465 __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_v_povScene) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_povScene);
12466 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12467 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error)
12468 __Pyx_GOTREF(__pyx_t_1);
12469 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12470 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12479 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_write);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
12480 __Pyx_GOTREF(__pyx_t_2);
12481 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_d, __pyx_n_s_format);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 494, __pyx_L1_error)
12482 __Pyx_GOTREF(__pyx_t_8);
12483 __pyx_t_9 = PyObject_Length(__pyx_v_nodes);
if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 494, __pyx_L1_error)
12484 __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_9);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L1_error)
12485 __Pyx_GOTREF(__pyx_t_3);
12487 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
12488 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
12489 if (likely(__pyx_t_11)) {
12490 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
12491 __Pyx_INCREF(__pyx_t_11);
12492 __Pyx_INCREF(
function);
12493 __Pyx_DECREF_SET(__pyx_t_8,
function);
12496 __pyx_t_5 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_11, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_3);
12497 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
12498 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12499 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L1_error)
12500 __Pyx_GOTREF(__pyx_t_5);
12501 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12503 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12504 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
12505 if (likely(__pyx_t_8)) {
12506 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12507 __Pyx_INCREF(__pyx_t_8);
12508 __Pyx_INCREF(
function);
12509 __Pyx_DECREF_SET(__pyx_t_2,
function);
12512 __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5);
12513 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12514 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12515 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
12516 __Pyx_GOTREF(__pyx_t_1);
12517 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12518 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12527 if (likely(PyList_CheckExact(__pyx_v_nodes)) || PyTuple_CheckExact(__pyx_v_nodes)) {
12528 __pyx_t_1 = __pyx_v_nodes; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
12531 __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_nodes);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error)
12532 __Pyx_GOTREF(__pyx_t_1);
12533 __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext;
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 495, __pyx_L1_error)
12536 if (likely(!__pyx_t_10)) {
12537 if (likely(PyList_CheckExact(__pyx_t_1))) {
12538 if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1))
break;
12539 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12540 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 495, __pyx_L1_error)
12542 __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error)
12543 __Pyx_GOTREF(__pyx_t_2);
12546 if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
12547 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12548 __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 495, __pyx_L1_error)
12550 __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error)
12551 __Pyx_GOTREF(__pyx_t_2);
12555 __pyx_t_2 = __pyx_t_10(__pyx_t_1);
12556 if (unlikely(!__pyx_t_2)) {
12557 PyObject* exc_type = PyErr_Occurred();
12559 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
12560 else __PYX_ERR(0, 495, __pyx_L1_error)
12564 __Pyx_GOTREF(__pyx_t_2);
12566 __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_2);
12576 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_write);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
12577 __Pyx_GOTREF(__pyx_t_5);
12578 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_f_1_f_2_f, __pyx_n_s_format);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 496, __pyx_L1_error)
12579 __Pyx_GOTREF(__pyx_t_8);
12580 __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_n);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error)
12581 __Pyx_GOTREF(__pyx_t_3);
12582 __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_3, NULL);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 496, __pyx_L1_error)
12583 __Pyx_GOTREF(__pyx_t_11);
12584 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12585 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12587 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
12588 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
12589 if (likely(__pyx_t_3)) {
12590 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
12591 __Pyx_INCREF(__pyx_t_3);
12592 __Pyx_INCREF(
function);
12593 __Pyx_DECREF_SET(__pyx_t_5,
function);
12596 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_11);
12597 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12598 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12599 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error)
12600 __Pyx_GOTREF(__pyx_t_2);
12601 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12602 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12612 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12621 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_write);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 497, __pyx_L1_error)
12622 __Pyx_GOTREF(__pyx_t_2);
12624 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12625 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
12626 if (likely(__pyx_t_5)) {
12627 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12628 __Pyx_INCREF(__pyx_t_5);
12629 __Pyx_INCREF(
function);
12630 __Pyx_DECREF_SET(__pyx_t_2,
function);
12633 __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_kp_s_normal_vectors) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_normal_vectors);
12634 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12635 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __pyx_L1_error)
12636 __Pyx_GOTREF(__pyx_t_1);
12637 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12638 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12647 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_write);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error)
12648 __Pyx_GOTREF(__pyx_t_2);
12649 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_d, __pyx_n_s_format);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 500, __pyx_L1_error)
12650 __Pyx_GOTREF(__pyx_t_11);
12651 __pyx_t_9 = PyObject_Length(__pyx_v_normals);
if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 500, __pyx_L1_error)
12652 __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_9);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 500, __pyx_L1_error)
12653 __Pyx_GOTREF(__pyx_t_3);
12655 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
12656 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_11);
12657 if (likely(__pyx_t_8)) {
12658 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_11);
12659 __Pyx_INCREF(__pyx_t_8);
12660 __Pyx_INCREF(
function);
12661 __Pyx_DECREF_SET(__pyx_t_11,
function);
12664 __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_8, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_3);
12665 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12666 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12667 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 500, __pyx_L1_error)
12668 __Pyx_GOTREF(__pyx_t_5);
12669 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12671 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12672 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2);
12673 if (likely(__pyx_t_11)) {
12674 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12675 __Pyx_INCREF(__pyx_t_11);
12676 __Pyx_INCREF(
function);
12677 __Pyx_DECREF_SET(__pyx_t_2,
function);
12680 __pyx_t_1 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_11, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5);
12681 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
12682 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12683 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error)
12684 __Pyx_GOTREF(__pyx_t_1);
12685 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12686 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12695 if (likely(PyList_CheckExact(__pyx_v_normals)) || PyTuple_CheckExact(__pyx_v_normals)) {
12696 __pyx_t_1 = __pyx_v_normals; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
12699 __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_normals);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error)
12700 __Pyx_GOTREF(__pyx_t_1);
12701 __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext;
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 501, __pyx_L1_error)
12704 if (likely(!__pyx_t_10)) {
12705 if (likely(PyList_CheckExact(__pyx_t_1))) {
12706 if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1))
break;
12707 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12708 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 501, __pyx_L1_error)
12710 __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error)
12711 __Pyx_GOTREF(__pyx_t_2);
12714 if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
12715 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12716 __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 501, __pyx_L1_error)
12718 __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error)
12719 __Pyx_GOTREF(__pyx_t_2);
12723 __pyx_t_2 = __pyx_t_10(__pyx_t_1);
12724 if (unlikely(!__pyx_t_2)) {
12725 PyObject* exc_type = PyErr_Occurred();
12727 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
12728 else __PYX_ERR(0, 501, __pyx_L1_error)
12732 __Pyx_GOTREF(__pyx_t_2);
12734 __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_2);
12744 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_write);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 502, __pyx_L1_error)
12745 __Pyx_GOTREF(__pyx_t_5);
12746 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_f_1_f_2_f, __pyx_n_s_format);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 502, __pyx_L1_error)
12747 __Pyx_GOTREF(__pyx_t_11);
12748 __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_n);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 502, __pyx_L1_error)
12749 __Pyx_GOTREF(__pyx_t_3);
12750 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_3, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 502, __pyx_L1_error)
12751 __Pyx_GOTREF(__pyx_t_8);
12752 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12753 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12755 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
12756 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
12757 if (likely(__pyx_t_3)) {
12758 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
12759 __Pyx_INCREF(__pyx_t_3);
12760 __Pyx_INCREF(
function);
12761 __Pyx_DECREF_SET(__pyx_t_5,
function);
12764 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8);
12765 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12766 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12767 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error)
12768 __Pyx_GOTREF(__pyx_t_2);
12769 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12770 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12780 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12789 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_write);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L1_error)
12790 __Pyx_GOTREF(__pyx_t_2);
12792 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12793 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
12794 if (likely(__pyx_t_5)) {
12795 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12796 __Pyx_INCREF(__pyx_t_5);
12797 __Pyx_INCREF(
function);
12798 __Pyx_DECREF_SET(__pyx_t_2,
function);
12801 __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_kp_s_face_indices_2) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_face_indices_2);
12802 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12803 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error)
12804 __Pyx_GOTREF(__pyx_t_1);
12805 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12806 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12815 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_write);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 506, __pyx_L1_error)
12816 __Pyx_GOTREF(__pyx_t_2);
12817 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_d, __pyx_n_s_format);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 506, __pyx_L1_error)
12818 __Pyx_GOTREF(__pyx_t_8);
12819 __pyx_t_9 = PyObject_Length(__pyx_v_elements);
if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 506, __pyx_L1_error)
12820 __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_9);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 506, __pyx_L1_error)
12821 __Pyx_GOTREF(__pyx_t_3);
12823 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
12824 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
12825 if (likely(__pyx_t_11)) {
12826 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
12827 __Pyx_INCREF(__pyx_t_11);
12828 __Pyx_INCREF(
function);
12829 __Pyx_DECREF_SET(__pyx_t_8,
function);
12832 __pyx_t_5 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_11, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_3);
12833 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
12834 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12835 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 506, __pyx_L1_error)
12836 __Pyx_GOTREF(__pyx_t_5);
12837 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12839 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12840 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
12841 if (likely(__pyx_t_8)) {
12842 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12843 __Pyx_INCREF(__pyx_t_8);
12844 __Pyx_INCREF(
function);
12845 __Pyx_DECREF_SET(__pyx_t_2,
function);
12848 __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5);
12849 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12850 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12851 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 506, __pyx_L1_error)
12852 __Pyx_GOTREF(__pyx_t_1);
12853 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12854 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12863 if (likely(PyList_CheckExact(__pyx_v_elements)) || PyTuple_CheckExact(__pyx_v_elements)) {
12864 __pyx_t_1 = __pyx_v_elements; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
12867 __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_elements);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error)
12868 __Pyx_GOTREF(__pyx_t_1);
12869 __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext;
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 507, __pyx_L1_error)
12872 if (likely(!__pyx_t_10)) {
12873 if (likely(PyList_CheckExact(__pyx_t_1))) {
12874 if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1))
break;
12875 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12876 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 507, __pyx_L1_error)
12878 __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error)
12879 __Pyx_GOTREF(__pyx_t_2);
12882 if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
12883 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12884 __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 507, __pyx_L1_error)
12886 __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error)
12887 __Pyx_GOTREF(__pyx_t_2);
12891 __pyx_t_2 = __pyx_t_10(__pyx_t_1);
12892 if (unlikely(!__pyx_t_2)) {
12893 PyObject* exc_type = PyErr_Occurred();
12895 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
12896 else __PYX_ERR(0, 507, __pyx_L1_error)
12900 __Pyx_GOTREF(__pyx_t_2);
12902 __Pyx_XDECREF_SET(__pyx_v_e, __pyx_t_2);
12912 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_write);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 508, __pyx_L1_error)
12913 __Pyx_GOTREF(__pyx_t_5);
12914 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_d_1_d_2_d_2, __pyx_n_s_format);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 508, __pyx_L1_error)
12915 __Pyx_GOTREF(__pyx_t_8);
12916 __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_e);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error)
12917 __Pyx_GOTREF(__pyx_t_3);
12918 __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_3, NULL);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 508, __pyx_L1_error)
12919 __Pyx_GOTREF(__pyx_t_11);
12920 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12921 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12923 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
12924 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
12925 if (likely(__pyx_t_3)) {
12926 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
12927 __Pyx_INCREF(__pyx_t_3);
12928 __Pyx_INCREF(
function);
12929 __Pyx_DECREF_SET(__pyx_t_5,
function);
12932 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_11);
12933 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12934 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12935 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error)
12936 __Pyx_GOTREF(__pyx_t_2);
12937 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12938 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12948 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12957 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_write);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error)
12958 __Pyx_GOTREF(__pyx_t_2);
12960 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12961 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
12962 if (likely(__pyx_t_5)) {
12963 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
12964 __Pyx_INCREF(__pyx_t_5);
12965 __Pyx_INCREF(
function);
12966 __Pyx_DECREF_SET(__pyx_t_2,
function);
12969 __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_kp_s_normal_indices_2) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_normal_indices_2);
12970 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12971 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error)
12972 __Pyx_GOTREF(__pyx_t_1);
12973 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12974 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12983 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_write);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error)
12984 __Pyx_GOTREF(__pyx_t_2);
12985 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_d, __pyx_n_s_format);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 512, __pyx_L1_error)
12986 __Pyx_GOTREF(__pyx_t_11);
12987 __pyx_t_9 = PyObject_Length(__pyx_v_normal_indices);
if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 512, __pyx_L1_error)
12988 __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_9);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __pyx_L1_error)
12989 __Pyx_GOTREF(__pyx_t_3);
12991 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
12992 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_11);
12993 if (likely(__pyx_t_8)) {
12994 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_11);
12995 __Pyx_INCREF(__pyx_t_8);
12996 __Pyx_INCREF(
function);
12997 __Pyx_DECREF_SET(__pyx_t_11,
function);
13000 __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_8, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_3);
13001 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
13002 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13003 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 512, __pyx_L1_error)
13004 __Pyx_GOTREF(__pyx_t_5);
13005 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13007 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
13008 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2);
13009 if (likely(__pyx_t_11)) {
13010 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
13011 __Pyx_INCREF(__pyx_t_11);
13012 __Pyx_INCREF(
function);
13013 __Pyx_DECREF_SET(__pyx_t_2,
function);
13016 __pyx_t_1 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_11, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5);
13017 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
13018 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13019 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
13020 __Pyx_GOTREF(__pyx_t_1);
13021 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13022 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13031 if (likely(PyList_CheckExact(__pyx_v_normal_indices)) || PyTuple_CheckExact(__pyx_v_normal_indices)) {
13032 __pyx_t_1 = __pyx_v_normal_indices; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
13035 __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_normal_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error)
13036 __Pyx_GOTREF(__pyx_t_1);
13037 __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext;
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 513, __pyx_L1_error)
13040 if (likely(!__pyx_t_10)) {
13041 if (likely(PyList_CheckExact(__pyx_t_1))) {
13042 if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1))
break;
13043 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13044 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 513, __pyx_L1_error)
13046 __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error)
13047 __Pyx_GOTREF(__pyx_t_2);
13050 if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
13051 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13052 __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++;
if (unlikely(0 < 0)) __PYX_ERR(0, 513, __pyx_L1_error)
13054 __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error)
13055 __Pyx_GOTREF(__pyx_t_2);
13059 __pyx_t_2 = __pyx_t_10(__pyx_t_1);
13060 if (unlikely(!__pyx_t_2)) {
13061 PyObject* exc_type = PyErr_Occurred();
13063 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
13064 else __PYX_ERR(0, 513, __pyx_L1_error)
13068 __Pyx_GOTREF(__pyx_t_2);
13070 __Pyx_XDECREF_SET(__pyx_v_ni, __pyx_t_2);
13080 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_write);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 514, __pyx_L1_error)
13081 __Pyx_GOTREF(__pyx_t_5);
13082 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_d_1_d_2_d_2, __pyx_n_s_format);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 514, __pyx_L1_error)
13083 __Pyx_GOTREF(__pyx_t_11);
13084 __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_ni);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error)
13085 __Pyx_GOTREF(__pyx_t_3);
13086 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_3, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 514, __pyx_L1_error)
13087 __Pyx_GOTREF(__pyx_t_8);
13088 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13089 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13091 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
13092 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
13093 if (likely(__pyx_t_3)) {
13094 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
13095 __Pyx_INCREF(__pyx_t_3);
13096 __Pyx_INCREF(
function);
13097 __Pyx_DECREF_SET(__pyx_t_5,
function);
13100 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8);
13101 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13102 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13103 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error)
13104 __Pyx_GOTREF(__pyx_t_2);
13105 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13106 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13116 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13125 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_write);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error)
13126 __Pyx_GOTREF(__pyx_t_2);
13128 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
13129 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
13130 if (likely(__pyx_t_5)) {
13131 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
13132 __Pyx_INCREF(__pyx_t_5);
13133 __Pyx_INCREF(
function);
13134 __Pyx_DECREF_SET(__pyx_t_2,
function);
13137 __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_kp_s_matrix_1_000000_0_000000_0_0000) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_matrix_1_000000_0_000000_0_0000);
13138 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13139 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error)
13140 __Pyx_GOTREF(__pyx_t_1);
13141 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13142 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13151 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_flush);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 523, __pyx_L1_error)
13152 __Pyx_GOTREF(__pyx_t_2);
13154 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
13155 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
13156 if (likely(__pyx_t_5)) {
13157 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
13158 __Pyx_INCREF(__pyx_t_5);
13159 __Pyx_INCREF(
function);
13160 __Pyx_DECREF_SET(__pyx_t_2,
function);
13163 __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
13164 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13165 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error)
13166 __Pyx_GOTREF(__pyx_t_1);
13167 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13168 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13177 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_close);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 524, __pyx_L1_error)
13178 __Pyx_GOTREF(__pyx_t_2);
13180 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
13181 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
13182 if (likely(__pyx_t_5)) {
13183 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
13184 __Pyx_INCREF(__pyx_t_5);
13185 __Pyx_INCREF(
function);
13186 __Pyx_DECREF_SET(__pyx_t_2,
function);
13189 __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
13190 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13191 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L1_error)
13192 __Pyx_GOTREF(__pyx_t_1);
13193 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13194 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13203 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_comm);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 525, __pyx_L1_error)
13204 __Pyx_GOTREF(__pyx_t_2);
13205 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_endSequential);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 525, __pyx_L1_error)
13206 __Pyx_GOTREF(__pyx_t_5);
13207 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13209 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
13210 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
13211 if (likely(__pyx_t_2)) {
13212 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
13213 __Pyx_INCREF(__pyx_t_2);
13214 __Pyx_INCREF(
function);
13215 __Pyx_DECREF_SET(__pyx_t_5,
function);
13218 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
13219 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
13220 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
13221 __Pyx_GOTREF(__pyx_t_1);
13222 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13223 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13234 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13237 __Pyx_XDECREF(__pyx_t_1);
13238 __Pyx_XDECREF(__pyx_t_2);
13239 __Pyx_XDECREF(__pyx_t_3);
13240 __Pyx_XDECREF(__pyx_t_5);
13241 __Pyx_XDECREF(__pyx_t_7);
13242 __Pyx_XDECREF(__pyx_t_8);
13243 __Pyx_XDECREF(__pyx_t_11);
13244 __Pyx_XDECREF(__pyx_t_12);
13245 __Pyx_AddTraceback(
"Isosurface.Isosurface.writeIsosurfaceMesh_povray", __pyx_clineno, __pyx_lineno, __pyx_filename);
13248 __Pyx_XDECREF(__pyx_v_Template);
13249 __Pyx_XDECREF(__pyx_v_nodes);
13250 __Pyx_XDECREF(__pyx_v_elements);
13251 __Pyx_XDECREF(__pyx_v_normals);
13252 __Pyx_XDECREF(__pyx_v_normal_indices);
13253 __Pyx_XDECREF(__pyx_v_pov_filename);
13254 __Pyx_XDECREF(__pyx_v_pov);
13255 __Pyx_XDECREF(__pyx_v_dx);
13256 __Pyx_XDECREF(__pyx_v_nll);
13257 __Pyx_XDECREF(__pyx_v_fur);
13258 __Pyx_XDECREF(__pyx_v_povScene);
13259 __Pyx_XDECREF(__pyx_v_n);
13260 __Pyx_XDECREF(__pyx_v_ebN);
13261 __Pyx_XDECREF(__pyx_v_bnt);
13262 __Pyx_XDECREF(__pyx_v_e);
13263 __Pyx_XDECREF(__pyx_v_ni);
13264 __Pyx_XGIVEREF(__pyx_r);
13265 __Pyx_RefNannyFinishContext();
13278 static PyObject *__pyx_pw_10Isosurface_10Isosurface_15calculate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13279 static char __pyx_doc_10Isosurface_10Isosurface_14calculate[] =
"Isosurface.calculate(self, checkTime=True)\nExtracts isosourfaces at current time and update open output files\n ";
13280 static PyMethodDef __pyx_mdef_10Isosurface_10Isosurface_15calculate = {
"calculate", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10Isosurface_10Isosurface_15calculate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10Isosurface_10Isosurface_14calculate};
13281 static PyObject *__pyx_pw_10Isosurface_10Isosurface_15calculate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13282 PyObject *__pyx_v_self = 0;
13283 PyObject *__pyx_v_checkTime = 0;
13284 int __pyx_lineno = 0;
13285 const char *__pyx_filename = NULL;
13286 int __pyx_clineno = 0;
13287 PyObject *__pyx_r = 0;
13288 __Pyx_RefNannyDeclarations
13289 __Pyx_RefNannySetupContext(
"calculate (wrapper)", 0);
13291 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_checkTime,0};
13292 PyObject* values[2] = {0,0};
13293 values[1] = ((PyObject *)((PyObject *)Py_True));
13294 if (unlikely(__pyx_kwds)) {
13295 Py_ssize_t kw_args;
13296 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13297 switch (pos_args) {
13298 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13299 CYTHON_FALLTHROUGH;
13300 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13301 CYTHON_FALLTHROUGH;
13303 default:
goto __pyx_L5_argtuple_error;
13305 kw_args = PyDict_Size(__pyx_kwds);
13306 switch (pos_args) {
13308 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
13309 else goto __pyx_L5_argtuple_error;
13310 CYTHON_FALLTHROUGH;
13313 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_checkTime);
13314 if (value) { values[1] = value; kw_args--; }
13317 if (unlikely(kw_args > 0)) {
13318 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"calculate") < 0)) __PYX_ERR(0, 527, __pyx_L3_error)
13321 switch (PyTuple_GET_SIZE(__pyx_args)) {
13322 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13323 CYTHON_FALLTHROUGH;
13324 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13326 default:
goto __pyx_L5_argtuple_error;
13329 __pyx_v_self = values[0];
13330 __pyx_v_checkTime = values[1];
13332 goto __pyx_L4_argument_unpacking_done;
13333 __pyx_L5_argtuple_error:;
13334 __Pyx_RaiseArgtupleInvalid(
"calculate", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 527, __pyx_L3_error)
13336 __Pyx_AddTraceback(
"Isosurface.Isosurface.calculate", __pyx_clineno, __pyx_lineno, __pyx_filename);
13337 __Pyx_RefNannyFinishContext();
13339 __pyx_L4_argument_unpacking_done:;
13340 __pyx_r = __pyx_pf_10Isosurface_10Isosurface_14calculate(__pyx_self, __pyx_v_self, __pyx_v_checkTime);
13343 __Pyx_RefNannyFinishContext();
13347 static PyObject *__pyx_pf_10Isosurface_10Isosurface_14calculate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_checkTime) {
13348 CYTHON_UNUSED PyObject *__pyx_v_Template = NULL;
13349 PyObject *__pyx_v_time = NULL;
13350 PyObject *__pyx_v_field = NULL;
13351 PyObject *__pyx_v_values = NULL;
13352 PyObject *__pyx_v_v = NULL;
13353 PyObject *__pyx_r = NULL;
13354 __Pyx_RefNannyDeclarations
13355 PyObject *__pyx_t_1 = NULL;
13356 PyObject *__pyx_t_2 = NULL;
13358 PyObject *__pyx_t_4 = NULL;
13359 PyObject *__pyx_t_5 = NULL;
13362 Py_ssize_t __pyx_t_8;
13363 PyObject *(*__pyx_t_9)(PyObject *);
13364 PyObject *__pyx_t_10 = NULL;
13365 PyObject *(*__pyx_t_11)(PyObject *);
13366 Py_ssize_t __pyx_t_12;
13367 PyObject *(*__pyx_t_13)(PyObject *);
13369 PyObject *__pyx_t_15 = NULL;
13370 PyObject *__pyx_t_16 = NULL;
13371 int __pyx_lineno = 0;
13372 const char *__pyx_filename = NULL;
13373 int __pyx_clineno = 0;
13374 __Pyx_RefNannySetupContext(
"calculate", 0);
13383 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
13384 __Pyx_GOTREF(__pyx_t_1);
13385 __Pyx_INCREF(__pyx_n_s_Template);
13386 __Pyx_GIVEREF(__pyx_n_s_Template);
13387 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Template);
13388 __pyx_t_2 = __Pyx_Import(__pyx_n_s_string, __pyx_t_1, -1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error)
13389 __Pyx_GOTREF(__pyx_t_2);
13390 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13391 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Template);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
13392 __Pyx_GOTREF(__pyx_t_1);
13393 __Pyx_INCREF(__pyx_t_1);
13394 __pyx_v_Template = __pyx_t_1;
13395 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13396 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13405 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_checkTime);
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 531, __pyx_L1_error)
13415 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_timeIntegration);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 532, __pyx_L1_error)
13416 __Pyx_GOTREF(__pyx_t_2);
13417 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_tLast);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 532, __pyx_L1_error)
13418 __Pyx_GOTREF(__pyx_t_1);
13419 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13420 __pyx_v_time = __pyx_t_1;
13430 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_log);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __pyx_L1_error)
13431 __Pyx_GOTREF(__pyx_t_2);
13432 __pyx_t_4 = PyObject_Repr(__pyx_v_time);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 533, __pyx_L1_error)
13433 __Pyx_GOTREF(__pyx_t_4);
13434 __pyx_t_5 = PyNumber_Add(__pyx_kp_s_Calculate_called_at_time, __pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 533, __pyx_L1_error)
13435 __Pyx_GOTREF(__pyx_t_5);
13436 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13438 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
13439 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
13440 if (likely(__pyx_t_4)) {
13441 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
13442 __Pyx_INCREF(__pyx_t_4);
13443 __Pyx_INCREF(
function);
13444 __Pyx_DECREF_SET(__pyx_t_2,
function);
13447 __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5);
13448 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13449 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13450 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __pyx_L1_error)
13451 __Pyx_GOTREF(__pyx_t_1);
13452 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13453 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13462 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_activeTime);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error)
13463 __Pyx_GOTREF(__pyx_t_1);
13464 __pyx_t_6 = (__pyx_t_1 != Py_None);
13465 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13466 __pyx_t_7 = (__pyx_t_6 != 0);
13469 __pyx_t_3 = __pyx_t_7;
13470 goto __pyx_L5_bool_binop_done;
13472 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_activeTime);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error)
13473 __Pyx_GOTREF(__pyx_t_1);
13474 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error)
13475 __Pyx_GOTREF(__pyx_t_2);
13476 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13477 __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_time, Py_GT); __Pyx_XGOTREF(__pyx_t_1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error)
13478 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13479 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 535, __pyx_L1_error)
13480 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13483 __pyx_t_3 = __pyx_t_7;
13484 goto __pyx_L5_bool_binop_done;
13494 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_activeTime);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error)
13495 __Pyx_GOTREF(__pyx_t_1);
13496 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
13497 __Pyx_GOTREF(__pyx_t_2);
13498 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13499 __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_time, Py_LT); __Pyx_XGOTREF(__pyx_t_1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error)
13500 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13501 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 536, __pyx_L1_error)
13502 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13503 __pyx_t_3 = __pyx_t_7;
13504 __pyx_L5_bool_binop_done:;
13522 __Pyx_XDECREF(__pyx_r);
13523 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13542 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_next_output);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error)
13543 __Pyx_GOTREF(__pyx_t_1);
13544 __pyx_t_2 = PyObject_RichCompare(__pyx_v_time, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error)
13545 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13546 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 540, __pyx_L1_error)
13547 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13557 __Pyx_XDECREF(__pyx_r);
13558 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13586 #ifndef CYTHON_WITHOUT_ASSERTIONS
13587 if (unlikely(!Py_OptimizeFlag)) {
13588 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_elementNodesArray);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error)
13589 __Pyx_GOTREF(__pyx_t_2);
13590 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error)
13591 __Pyx_GOTREF(__pyx_t_1);
13592 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13593 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error)
13594 __Pyx_GOTREF(__pyx_t_2);
13595 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13596 __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_4, 4, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error)
13597 __Pyx_GOTREF(__pyx_t_1);
13598 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13599 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 542, __pyx_L1_error)
13600 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13601 if (unlikely(!__pyx_t_3)) {
13610 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Elements_have_0_d_vertices_but_a, __pyx_n_s_format);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error)
13611 __Pyx_GOTREF(__pyx_t_2);
13620 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_elementNodesArray);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 544, __pyx_L1_error)
13621 __Pyx_GOTREF(__pyx_t_5);
13622 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_shape);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 544, __pyx_L1_error)
13623 __Pyx_GOTREF(__pyx_t_4);
13624 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13625 __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 544, __pyx_L1_error)
13626 __Pyx_GOTREF(__pyx_t_5);
13627 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13629 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
13630 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
13631 if (likely(__pyx_t_4)) {
13632 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
13633 __Pyx_INCREF(__pyx_t_4);
13634 __Pyx_INCREF(
function);
13635 __Pyx_DECREF_SET(__pyx_t_2,
function);
13638 __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5);
13639 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13640 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13641 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error)
13642 __Pyx_GOTREF(__pyx_t_1);
13643 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13652 __pyx_t_2 = PyTuple_Pack(1, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error)
13653 __Pyx_GOTREF(__pyx_t_2);
13654 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13655 PyErr_SetObject(PyExc_AssertionError, __pyx_t_2);
13656 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13657 __PYX_ERR(0, 542, __pyx_L1_error)
13669 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_isosurfaces);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error)
13670 __Pyx_GOTREF(__pyx_t_2);
13671 if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
13672 __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0;
13675 __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error)
13676 __Pyx_GOTREF(__pyx_t_1);
13677 __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext;
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 545, __pyx_L1_error)
13679 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13681 if (likely(!__pyx_t_9)) {
13682 if (likely(PyList_CheckExact(__pyx_t_1))) {
13683 if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1))
break;
13684 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13685 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++;
if (unlikely(0 < 0)) __PYX_ERR(0, 545, __pyx_L1_error)
13687 __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error)
13688 __Pyx_GOTREF(__pyx_t_2);
13691 if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
13692 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13693 __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++;
if (unlikely(0 < 0)) __PYX_ERR(0, 545, __pyx_L1_error)
13695 __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error)
13696 __Pyx_GOTREF(__pyx_t_2);
13700 __pyx_t_2 = __pyx_t_9(__pyx_t_1);
13701 if (unlikely(!__pyx_t_2)) {
13702 PyObject* exc_type = PyErr_Occurred();
13704 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
13705 else __PYX_ERR(0, 545, __pyx_L1_error)
13709 __Pyx_GOTREF(__pyx_t_2);
13711 if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
13712 PyObject* sequence = __pyx_t_2;
13713 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
13714 if (unlikely(size != 2)) {
13715 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
13716 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
13717 __PYX_ERR(0, 545, __pyx_L1_error)
13719 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13720 if (likely(PyTuple_CheckExact(sequence))) {
13721 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
13722 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
13724 __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
13725 __pyx_t_4 = PyList_GET_ITEM(sequence, 1);
13727 __Pyx_INCREF(__pyx_t_5);
13728 __Pyx_INCREF(__pyx_t_4);
13730 __pyx_t_5 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 545, __pyx_L1_error)
13731 __Pyx_GOTREF(__pyx_t_5);
13732 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 545, __pyx_L1_error)
13733 __Pyx_GOTREF(__pyx_t_4);
13735 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13737 Py_ssize_t index = -1;
13738 __pyx_t_10 = PyObject_GetIter(__pyx_t_2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 545, __pyx_L1_error)
13739 __Pyx_GOTREF(__pyx_t_10);
13740 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13741 __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
13742 index = 0; __pyx_t_5 = __pyx_t_11(__pyx_t_10);
if (unlikely(!__pyx_t_5))
goto __pyx_L11_unpacking_failed;
13743 __Pyx_GOTREF(__pyx_t_5);
13744 index = 1; __pyx_t_4 = __pyx_t_11(__pyx_t_10);
if (unlikely(!__pyx_t_4))
goto __pyx_L11_unpacking_failed;
13745 __Pyx_GOTREF(__pyx_t_4);
13746 if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 545, __pyx_L1_error)
13748 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13749 goto __pyx_L12_unpacking_done;
13750 __pyx_L11_unpacking_failed:;
13751 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13753 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
13754 __PYX_ERR(0, 545, __pyx_L1_error)
13755 __pyx_L12_unpacking_done:;
13757 __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_5);
13759 __Pyx_XDECREF_SET(__pyx_v_values, __pyx_t_4);
13769 if (likely(PyList_CheckExact(__pyx_v_values)) || PyTuple_CheckExact(__pyx_v_values)) {
13770 __pyx_t_2 = __pyx_v_values; __Pyx_INCREF(__pyx_t_2); __pyx_t_12 = 0;
13773 __pyx_t_12 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_values);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error)
13774 __Pyx_GOTREF(__pyx_t_2);
13775 __pyx_t_13 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 546, __pyx_L1_error)
13778 if (likely(!__pyx_t_13)) {
13779 if (likely(PyList_CheckExact(__pyx_t_2))) {
13780 if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_2))
break;
13781 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13782 __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++;
if (unlikely(0 < 0)) __PYX_ERR(0, 546, __pyx_L1_error)
13784 __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __pyx_L1_error)
13785 __Pyx_GOTREF(__pyx_t_4);
13788 if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
13789 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13790 __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++;
if (unlikely(0 < 0)) __PYX_ERR(0, 546, __pyx_L1_error)
13792 __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_12); __pyx_t_12++;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __pyx_L1_error)
13793 __Pyx_GOTREF(__pyx_t_4);
13797 __pyx_t_4 = __pyx_t_13(__pyx_t_2);
13798 if (unlikely(!__pyx_t_4)) {
13799 PyObject* exc_type = PyErr_Occurred();
13801 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
13802 else __PYX_ERR(0, 546, __pyx_L1_error)
13806 __Pyx_GOTREF(__pyx_t_4);
13808 __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4);
13818 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_triangulateIsosurface);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 547, __pyx_L1_error)
13819 __Pyx_GOTREF(__pyx_t_5);
13822 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
13823 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
13824 if (likely(__pyx_t_10)) {
13825 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
13826 __Pyx_INCREF(__pyx_t_10);
13827 __Pyx_INCREF(
function);
13828 __Pyx_DECREF_SET(__pyx_t_5,
function);
13832 #if CYTHON_FAST_PYCALL
13833 if (PyFunction_Check(__pyx_t_5)) {
13834 PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_field, __pyx_v_v};
13835 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error)
13836 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
13837 __Pyx_GOTREF(__pyx_t_4);
13840 #if CYTHON_FAST_PYCCALL
13841 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
13842 PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_field, __pyx_v_v};
13843 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error)
13844 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
13845 __Pyx_GOTREF(__pyx_t_4);
13849 __pyx_t_15 = PyTuple_New(2+__pyx_t_14);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 547, __pyx_L1_error)
13850 __Pyx_GOTREF(__pyx_t_15);
13852 __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_10); __pyx_t_10 = NULL;
13854 __Pyx_INCREF(__pyx_v_field);
13855 __Pyx_GIVEREF(__pyx_v_field);
13856 PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_14, __pyx_v_field);
13857 __Pyx_INCREF(__pyx_v_v);
13858 __Pyx_GIVEREF(__pyx_v_v);
13859 PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_14, __pyx_v_v);
13860 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error)
13861 __Pyx_GOTREF(__pyx_t_4);
13862 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
13864 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13865 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13874 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_writeIsosurfaceMesh);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 548, __pyx_L1_error)
13875 __Pyx_GOTREF(__pyx_t_5);
13876 __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nFrames);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 548, __pyx_L1_error)
13877 __Pyx_GOTREF(__pyx_t_15);
13880 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
13881 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
13882 if (likely(__pyx_t_10)) {
13883 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
13884 __Pyx_INCREF(__pyx_t_10);
13885 __Pyx_INCREF(
function);
13886 __Pyx_DECREF_SET(__pyx_t_5,
function);
13890 #if CYTHON_FAST_PYCALL
13891 if (PyFunction_Check(__pyx_t_5)) {
13892 PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_v_field, __pyx_v_v, __pyx_t_15};
13893 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_14, 3+__pyx_t_14);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 548, __pyx_L1_error)
13894 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
13895 __Pyx_GOTREF(__pyx_t_4);
13896 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
13899 #if CYTHON_FAST_PYCCALL
13900 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
13901 PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_v_field, __pyx_v_v, __pyx_t_15};
13902 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_14, 3+__pyx_t_14);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 548, __pyx_L1_error)
13903 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
13904 __Pyx_GOTREF(__pyx_t_4);
13905 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
13909 __pyx_t_16 = PyTuple_New(3+__pyx_t_14);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 548, __pyx_L1_error)
13910 __Pyx_GOTREF(__pyx_t_16);
13912 __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_10); __pyx_t_10 = NULL;
13914 __Pyx_INCREF(__pyx_v_field);
13915 __Pyx_GIVEREF(__pyx_v_field);
13916 PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_14, __pyx_v_field);
13917 __Pyx_INCREF(__pyx_v_v);
13918 __Pyx_GIVEREF(__pyx_v_v);
13919 PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_14, __pyx_v_v);
13920 __Pyx_GIVEREF(__pyx_t_15);
13921 PyTuple_SET_ITEM(__pyx_t_16, 2+__pyx_t_14, __pyx_t_15);
13923 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_16, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 548, __pyx_L1_error)
13924 __Pyx_GOTREF(__pyx_t_4);
13925 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
13927 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13928 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13938 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13948 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13957 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nFrames);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error)
13958 __Pyx_GOTREF(__pyx_t_1);
13959 __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 1, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 549, __pyx_L1_error)
13960 __Pyx_GOTREF(__pyx_t_2);
13961 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13962 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nFrames, __pyx_t_2) < 0) __PYX_ERR(0, 549, __pyx_L1_error)
13963 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13972 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_checkTime);
if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 550, __pyx_L1_error)
13975 __pyx_t_3 = __pyx_t_7;
13976 goto __pyx_L16_bool_binop_done;
13978 if (unlikely(!__pyx_v_time)) { __Pyx_RaiseUnboundLocalError(
"time"); __PYX_ERR(0, 550, __pyx_L1_error) }
13979 __pyx_t_2 = __Pyx_PyInt_NeObjC(__pyx_v_time, __pyx_int_0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 550, __pyx_L1_error)
13980 __Pyx_GOTREF(__pyx_t_2);
13981 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 550, __pyx_L1_error)
13982 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13983 __pyx_t_3 = __pyx_t_7;
13984 __pyx_L16_bool_binop_done:;
13994 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_next_output);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error)
13995 __Pyx_GOTREF(__pyx_t_2);
13996 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sampleRate);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error)
13997 __Pyx_GOTREF(__pyx_t_1);
13998 __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error)
13999 __Pyx_GOTREF(__pyx_t_4);
14000 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14001 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14002 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_next_output, __pyx_t_4) < 0) __PYX_ERR(0, 551, __pyx_L1_error)
14003 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14023 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14026 __Pyx_XDECREF(__pyx_t_1);
14027 __Pyx_XDECREF(__pyx_t_2);
14028 __Pyx_XDECREF(__pyx_t_4);
14029 __Pyx_XDECREF(__pyx_t_5);
14030 __Pyx_XDECREF(__pyx_t_10);
14031 __Pyx_XDECREF(__pyx_t_15);
14032 __Pyx_XDECREF(__pyx_t_16);
14033 __Pyx_AddTraceback(
"Isosurface.Isosurface.calculate", __pyx_clineno, __pyx_lineno, __pyx_filename);
14036 __Pyx_XDECREF(__pyx_v_Template);
14037 __Pyx_XDECREF(__pyx_v_time);
14038 __Pyx_XDECREF(__pyx_v_field);
14039 __Pyx_XDECREF(__pyx_v_values);
14040 __Pyx_XDECREF(__pyx_v_v);
14041 __Pyx_XGIVEREF(__pyx_r);
14042 __Pyx_RefNannyFinishContext();
14055 static PyObject *__pyx_pw_10Isosurface_10Isosurface_17writeSceneHeader(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14056 static char __pyx_doc_10Isosurface_10Isosurface_16writeSceneHeader[] =
"Isosurface.writeSceneHeader(self, cam=None)\n\n Write a scene description (can be modified before running povray)\n ";
14057 static PyMethodDef __pyx_mdef_10Isosurface_10Isosurface_17writeSceneHeader = {
"writeSceneHeader", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_10Isosurface_10Isosurface_17writeSceneHeader, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10Isosurface_10Isosurface_16writeSceneHeader};
14058 static PyObject *__pyx_pw_10Isosurface_10Isosurface_17writeSceneHeader(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14059 PyObject *__pyx_v_self = 0;
14060 PyObject *__pyx_v_cam = 0;
14061 int __pyx_lineno = 0;
14062 const char *__pyx_filename = NULL;
14063 int __pyx_clineno = 0;
14064 PyObject *__pyx_r = 0;
14065 __Pyx_RefNannyDeclarations
14066 __Pyx_RefNannySetupContext(
"writeSceneHeader (wrapper)", 0);
14068 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_cam,0};
14069 PyObject* values[2] = {0,0};
14070 values[1] = ((PyObject *)((PyObject *)Py_None));
14071 if (unlikely(__pyx_kwds)) {
14072 Py_ssize_t kw_args;
14073 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14074 switch (pos_args) {
14075 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14076 CYTHON_FALLTHROUGH;
14077 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14078 CYTHON_FALLTHROUGH;
14080 default:
goto __pyx_L5_argtuple_error;
14082 kw_args = PyDict_Size(__pyx_kwds);
14083 switch (pos_args) {
14085 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
14086 else goto __pyx_L5_argtuple_error;
14087 CYTHON_FALLTHROUGH;
14090 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cam);
14091 if (value) { values[1] = value; kw_args--; }
14094 if (unlikely(kw_args > 0)) {
14095 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"writeSceneHeader") < 0)) __PYX_ERR(0, 553, __pyx_L3_error)
14098 switch (PyTuple_GET_SIZE(__pyx_args)) {
14099 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14100 CYTHON_FALLTHROUGH;
14101 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14103 default:
goto __pyx_L5_argtuple_error;
14106 __pyx_v_self = values[0];
14107 __pyx_v_cam = values[1];
14109 goto __pyx_L4_argument_unpacking_done;
14110 __pyx_L5_argtuple_error:;
14111 __Pyx_RaiseArgtupleInvalid(
"writeSceneHeader", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 553, __pyx_L3_error)
14113 __Pyx_AddTraceback(
"Isosurface.Isosurface.writeSceneHeader", __pyx_clineno, __pyx_lineno, __pyx_filename);
14114 __Pyx_RefNannyFinishContext();
14116 __pyx_L4_argument_unpacking_done:;
14117 __pyx_r = __pyx_pf_10Isosurface_10Isosurface_16writeSceneHeader(__pyx_self, __pyx_v_self, __pyx_v_cam);
14120 __Pyx_RefNannyFinishContext();
14124 static PyObject *__pyx_pf_10Isosurface_10Isosurface_16writeSceneHeader(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cam) {
14125 PyObject *__pyx_v_Template = NULL;
14126 PyObject *__pyx_v_look_at = NULL;
14127 PyObject *__pyx_v_light = NULL;
14128 PyObject *__pyx_v_light_dx = NULL;
14129 PyObject *__pyx_v_light_dy = NULL;
14130 PyObject *__pyx_v_floor_z = NULL;
14131 PyObject *__pyx_v_wall_y = NULL;
14132 PyObject *__pyx_v_sky_z = NULL;
14133 PyObject *__pyx_v_pov = NULL;
14134 PyObject *__pyx_v_povSceneTemplate = NULL;
14135 PyObject *__pyx_v_x = NULL;
14136 PyObject *__pyx_v_L = NULL;
14137 PyObject *__pyx_r = NULL;
14138 __Pyx_RefNannyDeclarations
14139 PyObject *__pyx_t_1 = NULL;
14140 PyObject *__pyx_t_2 = NULL;
14141 PyObject *__pyx_t_3 = NULL;
14143 PyObject *__pyx_t_5 = NULL;
14144 Py_ssize_t __pyx_t_6;
14145 PyObject *(*__pyx_t_7)(PyObject *);
14146 PyObject *__pyx_t_8 = NULL;
14147 PyObject *__pyx_t_9 = NULL;
14148 PyObject *(*__pyx_t_10)(PyObject *);
14150 int __pyx_lineno = 0;
14151 const char *__pyx_filename = NULL;
14152 int __pyx_clineno = 0;
14153 __Pyx_RefNannySetupContext(
"writeSceneHeader", 0);
14154 __Pyx_INCREF(__pyx_v_cam);
14163 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error)
14164 __Pyx_GOTREF(__pyx_t_1);
14165 __Pyx_INCREF(__pyx_n_s_Template);
14166 __Pyx_GIVEREF(__pyx_n_s_Template);
14167 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Template);
14168 __pyx_t_2 = __Pyx_Import(__pyx_n_s_string, __pyx_t_1, -1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error)
14169 __Pyx_GOTREF(__pyx_t_2);
14170 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14171 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Template);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error)
14172 __Pyx_GOTREF(__pyx_t_1);
14173 __Pyx_INCREF(__pyx_t_1);
14174 __pyx_v_Template = __pyx_t_1;
14175 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14176 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14185 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_comm);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error)
14186 __Pyx_GOTREF(__pyx_t_1);
14187 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_isMaster);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __pyx_L1_error)
14188 __Pyx_GOTREF(__pyx_t_3);
14189 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14191 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
14192 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
14193 if (likely(__pyx_t_1)) {
14194 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
14195 __Pyx_INCREF(__pyx_t_1);
14196 __Pyx_INCREF(
function);
14197 __Pyx_DECREF_SET(__pyx_t_3,
function);
14200 __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
14201 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
14202 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __pyx_L1_error)
14203 __Pyx_GOTREF(__pyx_t_2);
14204 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14205 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 558, __pyx_L1_error)
14206 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14216 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 559, __pyx_L1_error)
14217 __Pyx_GOTREF(__pyx_t_2);
14226 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error)
14227 __Pyx_GOTREF(__pyx_t_3);
14228 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_x);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __pyx_L1_error)
14229 __Pyx_GOTREF(__pyx_t_1);
14230 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14231 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error)
14232 __Pyx_GOTREF(__pyx_t_3);
14233 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_L);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 560, __pyx_L1_error)
14234 __Pyx_GOTREF(__pyx_t_5);
14235 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14236 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error)
14237 __Pyx_GOTREF(__pyx_t_3);
14238 __Pyx_GIVEREF(__pyx_t_1);
14239 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
14240 __Pyx_GIVEREF(__pyx_t_5);
14241 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
14244 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 560, __pyx_L1_error)
14245 __Pyx_GOTREF(__pyx_t_5);
14246 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14247 if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
14248 __pyx_t_3 = __pyx_t_5; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
14251 __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_5);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error)
14252 __Pyx_GOTREF(__pyx_t_3);
14253 __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 560, __pyx_L1_error)
14255 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14257 if (likely(!__pyx_t_7)) {
14258 if (likely(PyList_CheckExact(__pyx_t_3))) {
14259 if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3))
break;
14260 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14261 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++;
if (unlikely(0 < 0)) __PYX_ERR(0, 560, __pyx_L1_error)
14263 __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 560, __pyx_L1_error)
14264 __Pyx_GOTREF(__pyx_t_5);
14267 if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
14268 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14269 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++;
if (unlikely(0 < 0)) __PYX_ERR(0, 560, __pyx_L1_error)
14271 __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 560, __pyx_L1_error)
14272 __Pyx_GOTREF(__pyx_t_5);
14276 __pyx_t_5 = __pyx_t_7(__pyx_t_3);
14277 if (unlikely(!__pyx_t_5)) {
14278 PyObject* exc_type = PyErr_Occurred();
14280 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14281 else __PYX_ERR(0, 560, __pyx_L1_error)
14285 __Pyx_GOTREF(__pyx_t_5);
14287 if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
14288 PyObject* sequence = __pyx_t_5;
14289 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
14290 if (unlikely(size != 2)) {
14291 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
14292 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
14293 __PYX_ERR(0, 560, __pyx_L1_error)
14295 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14296 if (likely(PyTuple_CheckExact(sequence))) {
14297 __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
14298 __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
14300 __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
14301 __pyx_t_8 = PyList_GET_ITEM(sequence, 1);
14303 __Pyx_INCREF(__pyx_t_1);
14304 __Pyx_INCREF(__pyx_t_8);
14306 __pyx_t_1 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __pyx_L1_error)
14307 __Pyx_GOTREF(__pyx_t_1);
14308 __pyx_t_8 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 560, __pyx_L1_error)
14309 __Pyx_GOTREF(__pyx_t_8);
14311 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14313 Py_ssize_t index = -1;
14314 __pyx_t_9 = PyObject_GetIter(__pyx_t_5);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 560, __pyx_L1_error)
14315 __Pyx_GOTREF(__pyx_t_9);
14316 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14317 __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
14318 index = 0; __pyx_t_1 = __pyx_t_10(__pyx_t_9);
if (unlikely(!__pyx_t_1))
goto __pyx_L6_unpacking_failed;
14319 __Pyx_GOTREF(__pyx_t_1);
14320 index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9);
if (unlikely(!__pyx_t_8))
goto __pyx_L6_unpacking_failed;
14321 __Pyx_GOTREF(__pyx_t_8);
14322 if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 560, __pyx_L1_error)
14324 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14325 goto __pyx_L7_unpacking_done;
14326 __pyx_L6_unpacking_failed:;
14327 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14329 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
14330 __PYX_ERR(0, 560, __pyx_L1_error)
14331 __pyx_L7_unpacking_done:;
14333 __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_1);
14335 __Pyx_XDECREF_SET(__pyx_v_L, __pyx_t_8);
14345 __pyx_t_5 = PyNumber_Add(__pyx_v_x, __pyx_v_L);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 559, __pyx_L1_error)
14346 __Pyx_GOTREF(__pyx_t_5);
14347 __pyx_t_8 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_5);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 559, __pyx_L1_error)
14348 __Pyx_GOTREF(__pyx_t_8);
14349 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14350 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 559, __pyx_L1_error)
14351 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14361 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14362 __pyx_v_look_at = ((PyObject*)__pyx_t_2);
14372 __pyx_t_4 = (__pyx_v_cam == Py_None);
14373 __pyx_t_11 = (__pyx_t_4 != 0);
14383 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 562, __pyx_L1_error)
14384 __Pyx_GOTREF(__pyx_t_2);
14385 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_x);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error)
14386 __Pyx_GOTREF(__pyx_t_3);
14387 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14388 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 562, __pyx_L1_error)
14389 __Pyx_GOTREF(__pyx_t_2);
14390 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14391 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error)
14392 __Pyx_GOTREF(__pyx_t_3);
14393 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_L);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 562, __pyx_L1_error)
14394 __Pyx_GOTREF(__pyx_t_8);
14395 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14396 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_8, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error)
14397 __Pyx_GOTREF(__pyx_t_3);
14398 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14399 __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 562, __pyx_L1_error)
14400 __Pyx_GOTREF(__pyx_t_8);
14401 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14402 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14403 __pyx_t_3 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_8);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error)
14404 __Pyx_GOTREF(__pyx_t_3);
14405 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14414 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 563, __pyx_L1_error)
14415 __Pyx_GOTREF(__pyx_t_8);
14416 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_x);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 563, __pyx_L1_error)
14417 __Pyx_GOTREF(__pyx_t_2);
14418 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14419 __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 563, __pyx_L1_error)
14420 __Pyx_GOTREF(__pyx_t_8);
14421 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14422 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 563, __pyx_L1_error)
14423 __Pyx_GOTREF(__pyx_t_2);
14424 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_L);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 563, __pyx_L1_error)
14425 __Pyx_GOTREF(__pyx_t_5);
14426 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14427 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_5, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 563, __pyx_L1_error)
14428 __Pyx_GOTREF(__pyx_t_2);
14429 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14430 __pyx_t_5 = PyNumber_Multiply(__pyx_int_2, __pyx_t_2);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 563, __pyx_L1_error)
14431 __Pyx_GOTREF(__pyx_t_5);
14432 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14433 __pyx_t_2 = PyNumber_Subtract(__pyx_t_8, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 563, __pyx_L1_error)
14434 __Pyx_GOTREF(__pyx_t_2);
14435 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14436 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14445 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 564, __pyx_L1_error)
14446 __Pyx_GOTREF(__pyx_t_5);
14447 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_x);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 564, __pyx_L1_error)
14448 __Pyx_GOTREF(__pyx_t_8);
14449 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14450 __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_8, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 564, __pyx_L1_error)
14451 __Pyx_GOTREF(__pyx_t_5);
14452 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14453 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 564, __pyx_L1_error)
14454 __Pyx_GOTREF(__pyx_t_8);
14455 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_L);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error)
14456 __Pyx_GOTREF(__pyx_t_1);
14457 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14458 __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 564, __pyx_L1_error)
14459 __Pyx_GOTREF(__pyx_t_8);
14460 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14461 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error)
14462 __Pyx_GOTREF(__pyx_t_1);
14463 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_x);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 564, __pyx_L1_error)
14464 __Pyx_GOTREF(__pyx_t_9);
14465 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14466 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_9, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error)
14467 __Pyx_GOTREF(__pyx_t_1);
14468 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14469 __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_t_1);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 564, __pyx_L1_error)
14470 __Pyx_GOTREF(__pyx_t_9);
14471 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14472 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14473 __pyx_t_1 = PyNumber_Multiply(__pyx_float_0_85, __pyx_t_9);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error)
14474 __Pyx_GOTREF(__pyx_t_1);
14475 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14476 __pyx_t_9 = PyNumber_Add(__pyx_t_5, __pyx_t_1);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 564, __pyx_L1_error)
14477 __Pyx_GOTREF(__pyx_t_9);
14478 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14479 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14488 __pyx_t_1 = PyList_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error)
14489 __Pyx_GOTREF(__pyx_t_1);
14490 __Pyx_GIVEREF(__pyx_t_3);
14491 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
14492 __Pyx_GIVEREF(__pyx_t_2);
14493 PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
14494 __Pyx_GIVEREF(__pyx_t_9);
14495 PyList_SET_ITEM(__pyx_t_1, 2, __pyx_t_9);
14499 __Pyx_DECREF_SET(__pyx_v_cam, __pyx_t_1);
14518 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error)
14519 __Pyx_GOTREF(__pyx_t_1);
14528 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 566, __pyx_L1_error)
14529 __Pyx_GOTREF(__pyx_t_9);
14530 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_x);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error)
14531 __Pyx_GOTREF(__pyx_t_2);
14532 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14533 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 566, __pyx_L1_error)
14534 __Pyx_GOTREF(__pyx_t_9);
14535 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_L);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_error)
14536 __Pyx_GOTREF(__pyx_t_3);
14537 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14538 __pyx_t_9 = PyTuple_New(2);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 566, __pyx_L1_error)
14539 __Pyx_GOTREF(__pyx_t_9);
14540 __Pyx_GIVEREF(__pyx_t_2);
14541 PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
14542 __Pyx_GIVEREF(__pyx_t_3);
14543 PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3);
14546 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_error)
14547 __Pyx_GOTREF(__pyx_t_3);
14548 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14549 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
14550 __pyx_t_9 = __pyx_t_3; __Pyx_INCREF(__pyx_t_9); __pyx_t_6 = 0;
14553 __pyx_t_6 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_3);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 566, __pyx_L1_error)
14554 __Pyx_GOTREF(__pyx_t_9);
14555 __pyx_t_7 = Py_TYPE(__pyx_t_9)->tp_iternext;
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 566, __pyx_L1_error)
14557 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14559 if (likely(!__pyx_t_7)) {
14560 if (likely(PyList_CheckExact(__pyx_t_9))) {
14561 if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_9))
break;
14562 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14563 __pyx_t_3 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++;
if (unlikely(0 < 0)) __PYX_ERR(0, 566, __pyx_L1_error)
14565 __pyx_t_3 = PySequence_ITEM(__pyx_t_9, __pyx_t_6); __pyx_t_6++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_error)
14566 __Pyx_GOTREF(__pyx_t_3);
14569 if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_9))
break;
14570 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14571 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++;
if (unlikely(0 < 0)) __PYX_ERR(0, 566, __pyx_L1_error)
14573 __pyx_t_3 = PySequence_ITEM(__pyx_t_9, __pyx_t_6); __pyx_t_6++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_error)
14574 __Pyx_GOTREF(__pyx_t_3);
14578 __pyx_t_3 = __pyx_t_7(__pyx_t_9);
14579 if (unlikely(!__pyx_t_3)) {
14580 PyObject* exc_type = PyErr_Occurred();
14582 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14583 else __PYX_ERR(0, 566, __pyx_L1_error)
14587 __Pyx_GOTREF(__pyx_t_3);
14589 if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
14590 PyObject* sequence = __pyx_t_3;
14591 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
14592 if (unlikely(size != 2)) {
14593 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
14594 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
14595 __PYX_ERR(0, 566, __pyx_L1_error)
14597 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14598 if (likely(PyTuple_CheckExact(sequence))) {
14599 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
14600 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
14602 __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
14603 __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
14605 __Pyx_INCREF(__pyx_t_2);
14606 __Pyx_INCREF(__pyx_t_5);
14608 __pyx_t_2 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error)
14609 __Pyx_GOTREF(__pyx_t_2);
14610 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 566, __pyx_L1_error)
14611 __Pyx_GOTREF(__pyx_t_5);
14613 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14615 Py_ssize_t index = -1;
14616 __pyx_t_8 = PyObject_GetIter(__pyx_t_3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 566, __pyx_L1_error)
14617 __Pyx_GOTREF(__pyx_t_8);
14618 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14619 __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext;
14620 index = 0; __pyx_t_2 = __pyx_t_10(__pyx_t_8);
if (unlikely(!__pyx_t_2))
goto __pyx_L11_unpacking_failed;
14621 __Pyx_GOTREF(__pyx_t_2);
14622 index = 1; __pyx_t_5 = __pyx_t_10(__pyx_t_8);
if (unlikely(!__pyx_t_5))
goto __pyx_L11_unpacking_failed;
14623 __Pyx_GOTREF(__pyx_t_5);
14624 if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_8), 2) < 0) __PYX_ERR(0, 566, __pyx_L1_error)
14626 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14627 goto __pyx_L12_unpacking_done;
14628 __pyx_L11_unpacking_failed:;
14629 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14631 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
14632 __PYX_ERR(0, 566, __pyx_L1_error)
14633 __pyx_L12_unpacking_done:;
14635 __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2);
14637 __Pyx_XDECREF_SET(__pyx_v_L, __pyx_t_5);
14647 __pyx_t_3 = PyNumber_Add(__pyx_v_x, __pyx_v_L);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 565, __pyx_L1_error)
14648 __Pyx_GOTREF(__pyx_t_3);
14649 __pyx_t_5 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 565, __pyx_L1_error)
14650 __Pyx_GOTREF(__pyx_t_5);
14651 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14652 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 565, __pyx_L1_error)
14653 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14663 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14664 __pyx_v_light = ((PyObject*)__pyx_t_1);
14674 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 567, __pyx_L1_error)
14675 __Pyx_GOTREF(__pyx_t_1);
14676 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_x);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 567, __pyx_L1_error)
14677 __Pyx_GOTREF(__pyx_t_9);
14678 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14679 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_9, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 567, __pyx_L1_error)
14680 __Pyx_GOTREF(__pyx_t_1);
14681 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14682 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 567, __pyx_L1_error)
14683 __Pyx_GOTREF(__pyx_t_9);
14684 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_L);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 567, __pyx_L1_error)
14685 __Pyx_GOTREF(__pyx_t_5);
14686 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14687 __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_5, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 567, __pyx_L1_error)
14688 __Pyx_GOTREF(__pyx_t_9);
14689 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14690 __pyx_t_5 = PyNumber_Multiply(__pyx_int_5, __pyx_t_9);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 567, __pyx_L1_error)
14691 __Pyx_GOTREF(__pyx_t_5);
14692 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14693 __pyx_t_9 = PyNumber_Add(__pyx_t_1, __pyx_t_5);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 567, __pyx_L1_error)
14694 __Pyx_GOTREF(__pyx_t_9);
14695 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14696 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14697 if (unlikely(__Pyx_SetItemInt(__pyx_v_light, 2, __pyx_t_9,
long, 1, __Pyx_PyInt_From_long, 1, 0, 1) < 0)) __PYX_ERR(0, 567, __pyx_L1_error)
14698 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14707 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 568, __pyx_L1_error)
14708 __Pyx_GOTREF(__pyx_t_9);
14709 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_x);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 568, __pyx_L1_error)
14710 __Pyx_GOTREF(__pyx_t_5);
14711 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14712 __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_5, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 568, __pyx_L1_error)
14713 __Pyx_GOTREF(__pyx_t_9);
14714 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14715 __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_light, 0,
long, 1, __Pyx_PyInt_From_long, 1, 0, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 568, __pyx_L1_error)
14716 __Pyx_GOTREF(__pyx_t_5);
14717 __pyx_t_1 = PyNumber_Subtract(__pyx_t_9, __pyx_t_5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error)
14718 __Pyx_GOTREF(__pyx_t_1);
14719 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14720 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14729 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 569, __pyx_L1_error)
14730 __Pyx_GOTREF(__pyx_t_5);
14731 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_x);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 569, __pyx_L1_error)
14732 __Pyx_GOTREF(__pyx_t_9);
14733 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14734 __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_9, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 569, __pyx_L1_error)
14735 __Pyx_GOTREF(__pyx_t_5);
14736 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14737 __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_light, 1,
long, 1, __Pyx_PyInt_From_long, 1, 0, 1);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 569, __pyx_L1_error)
14738 __Pyx_GOTREF(__pyx_t_9);
14739 __pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_t_9);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 569, __pyx_L1_error)
14740 __Pyx_GOTREF(__pyx_t_3);
14741 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14742 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14743 __pyx_v_light_dx = __pyx_t_1;
14745 __pyx_v_light_dy = __pyx_t_3;
14755 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __pyx_L1_error)
14756 __Pyx_GOTREF(__pyx_t_3);
14757 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_x);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error)
14758 __Pyx_GOTREF(__pyx_t_1);
14759 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14760 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __pyx_L1_error)
14761 __Pyx_GOTREF(__pyx_t_3);
14762 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14771 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error)
14772 __Pyx_GOTREF(__pyx_t_1);
14773 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_L);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 571, __pyx_L1_error)
14774 __Pyx_GOTREF(__pyx_t_9);
14775 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14776 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_9, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error)
14777 __Pyx_GOTREF(__pyx_t_1);
14778 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14787 __pyx_t_9 = PyNumber_Multiply(__pyx_float_0_01, __pyx_t_1);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 570, __pyx_L1_error)
14788 __Pyx_GOTREF(__pyx_t_9);
14789 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14790 __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_9);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error)
14791 __Pyx_GOTREF(__pyx_t_1);
14792 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14793 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14794 __pyx_v_floor_z = __pyx_t_1;
14804 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error)
14805 __Pyx_GOTREF(__pyx_t_1);
14806 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_x);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 572, __pyx_L1_error)
14807 __Pyx_GOTREF(__pyx_t_9);
14808 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14809 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_9, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error)
14810 __Pyx_GOTREF(__pyx_t_1);
14811 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14820 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 573, __pyx_L1_error)
14821 __Pyx_GOTREF(__pyx_t_9);
14822 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_L);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 573, __pyx_L1_error)
14823 __Pyx_GOTREF(__pyx_t_3);
14824 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14825 __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_3, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 573, __pyx_L1_error)
14826 __Pyx_GOTREF(__pyx_t_9);
14827 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14836 __pyx_t_3 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_9);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 572, __pyx_L1_error)
14837 __Pyx_GOTREF(__pyx_t_3);
14838 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14839 __pyx_t_9 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 572, __pyx_L1_error)
14840 __Pyx_GOTREF(__pyx_t_9);
14841 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14842 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14843 __pyx_v_wall_y = __pyx_t_9;
14853 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 574, __pyx_L1_error)
14854 __Pyx_GOTREF(__pyx_t_9);
14855 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_x);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error)
14856 __Pyx_GOTREF(__pyx_t_3);
14857 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14858 __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_3, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 574, __pyx_L1_error)
14859 __Pyx_GOTREF(__pyx_t_9);
14860 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14861 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_domain);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error)
14862 __Pyx_GOTREF(__pyx_t_3);
14863 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_L);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error)
14864 __Pyx_GOTREF(__pyx_t_1);
14865 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14866 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error)
14867 __Pyx_GOTREF(__pyx_t_3);
14868 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14869 __pyx_t_1 = PyNumber_Multiply(__pyx_int_10, __pyx_t_3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error)
14870 __Pyx_GOTREF(__pyx_t_1);
14871 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14872 __pyx_t_3 = PyNumber_Add(__pyx_t_9, __pyx_t_1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error)
14873 __Pyx_GOTREF(__pyx_t_3);
14874 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14875 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14876 __pyx_v_sky_z = __pyx_t_3;
14886 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_tuple__7, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 575, __pyx_L1_error)
14887 __Pyx_GOTREF(__pyx_t_3);
14888 __pyx_v_pov = __pyx_t_3;
14898 __Pyx_INCREF(__pyx_v_Template);
14899 __pyx_t_1 = __pyx_v_Template; __pyx_t_9 = NULL;
14900 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
14901 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
14902 if (likely(__pyx_t_9)) {
14903 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
14904 __Pyx_INCREF(__pyx_t_9);
14905 __Pyx_INCREF(
function);
14906 __Pyx_DECREF_SET(__pyx_t_1,
function);
14909 __pyx_t_3 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_9, __pyx_kp_s_include_colors_inc_include_text) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_s_include_colors_inc_include_text);
14910 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14911 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 576, __pyx_L1_error)
14912 __Pyx_GOTREF(__pyx_t_3);
14913 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14914 __pyx_v_povSceneTemplate = __pyx_t_3;
14924 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_write);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 718, __pyx_L1_error)
14925 __Pyx_GOTREF(__pyx_t_1);
14926 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_povSceneTemplate, __pyx_n_s_substitute);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 718, __pyx_L1_error)
14927 __Pyx_GOTREF(__pyx_t_9);
14928 __pyx_t_5 = __Pyx_PyDict_NewPresized(14);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 718, __pyx_L1_error)
14929 __Pyx_GOTREF(__pyx_t_5);
14930 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_look_at, 0,
long, 1, __Pyx_PyInt_From_long, 1, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 718, __pyx_L1_error)
14931 __Pyx_GOTREF(__pyx_t_2);
14932 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_look_at_x, __pyx_t_2) < 0) __PYX_ERR(0, 718, __pyx_L1_error)
14933 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14942 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_look_at, 1,
long, 1, __Pyx_PyInt_From_long, 1, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 719, __pyx_L1_error)
14943 __Pyx_GOTREF(__pyx_t_2);
14944 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_look_at_y, __pyx_t_2) < 0) __PYX_ERR(0, 718, __pyx_L1_error)
14945 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14954 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_look_at, 2,
long, 1, __Pyx_PyInt_From_long, 1, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 720, __pyx_L1_error)
14955 __Pyx_GOTREF(__pyx_t_2);
14956 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_look_at_z, __pyx_t_2) < 0) __PYX_ERR(0, 718, __pyx_L1_error)
14957 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14966 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_cam, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error)
14967 __Pyx_GOTREF(__pyx_t_2);
14968 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_cam_x, __pyx_t_2) < 0) __PYX_ERR(0, 718, __pyx_L1_error)
14969 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14978 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_cam, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 722, __pyx_L1_error)
14979 __Pyx_GOTREF(__pyx_t_2);
14980 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_cam_y, __pyx_t_2) < 0) __PYX_ERR(0, 718, __pyx_L1_error)
14981 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14990 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_cam, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 723, __pyx_L1_error)
14991 __Pyx_GOTREF(__pyx_t_2);
14992 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_cam_z, __pyx_t_2) < 0) __PYX_ERR(0, 718, __pyx_L1_error)
14993 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15002 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_light, 0,
long, 1, __Pyx_PyInt_From_long, 1, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 724, __pyx_L1_error)
15003 __Pyx_GOTREF(__pyx_t_2);
15004 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_light_x, __pyx_t_2) < 0) __PYX_ERR(0, 718, __pyx_L1_error)
15005 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15014 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_light, 1,
long, 1, __Pyx_PyInt_From_long, 1, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
15015 __Pyx_GOTREF(__pyx_t_2);
15016 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_light_y, __pyx_t_2) < 0) __PYX_ERR(0, 718, __pyx_L1_error)
15017 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15026 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_light, 2,
long, 1, __Pyx_PyInt_From_long, 1, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
15027 __Pyx_GOTREF(__pyx_t_2);
15028 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_light_z, __pyx_t_2) < 0) __PYX_ERR(0, 718, __pyx_L1_error)
15029 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15038 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_light_dx, __pyx_v_light_dx) < 0) __PYX_ERR(0, 718, __pyx_L1_error)
15047 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_light_dy, __pyx_v_light_dy) < 0) __PYX_ERR(0, 718, __pyx_L1_error)
15056 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_floor_z, __pyx_v_floor_z) < 0) __PYX_ERR(0, 718, __pyx_L1_error)
15065 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_wall_y, __pyx_v_wall_y) < 0) __PYX_ERR(0, 718, __pyx_L1_error)
15074 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_sky_z, __pyx_v_sky_z) < 0) __PYX_ERR(0, 718, __pyx_L1_error)
15083 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 718, __pyx_L1_error)
15084 __Pyx_GOTREF(__pyx_t_2);
15085 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15086 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15088 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
15089 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
15090 if (likely(__pyx_t_5)) {
15091 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
15092 __Pyx_INCREF(__pyx_t_5);
15093 __Pyx_INCREF(
function);
15094 __Pyx_DECREF_SET(__pyx_t_1,
function);
15097 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
15098 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15099 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15100 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 718, __pyx_L1_error)
15101 __Pyx_GOTREF(__pyx_t_3);
15102 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15103 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15110 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pov, __pyx_n_s_close);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 734, __pyx_L1_error)
15111 __Pyx_GOTREF(__pyx_t_1);
15113 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
15114 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
15115 if (likely(__pyx_t_2)) {
15116 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
15117 __Pyx_INCREF(__pyx_t_2);
15118 __Pyx_INCREF(
function);
15119 __Pyx_DECREF_SET(__pyx_t_1,
function);
15122 __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
15123 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
15124 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 734, __pyx_L1_error)
15125 __Pyx_GOTREF(__pyx_t_3);
15126 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15127 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15147 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15150 __Pyx_XDECREF(__pyx_t_1);
15151 __Pyx_XDECREF(__pyx_t_2);
15152 __Pyx_XDECREF(__pyx_t_3);
15153 __Pyx_XDECREF(__pyx_t_5);
15154 __Pyx_XDECREF(__pyx_t_8);
15155 __Pyx_XDECREF(__pyx_t_9);
15156 __Pyx_AddTraceback(
"Isosurface.Isosurface.writeSceneHeader", __pyx_clineno, __pyx_lineno, __pyx_filename);
15159 __Pyx_XDECREF(__pyx_v_Template);
15160 __Pyx_XDECREF(__pyx_v_look_at);
15161 __Pyx_XDECREF(__pyx_v_light);
15162 __Pyx_XDECREF(__pyx_v_light_dx);
15163 __Pyx_XDECREF(__pyx_v_light_dy);
15164 __Pyx_XDECREF(__pyx_v_floor_z);
15165 __Pyx_XDECREF(__pyx_v_wall_y);
15166 __Pyx_XDECREF(__pyx_v_sky_z);
15167 __Pyx_XDECREF(__pyx_v_pov);
15168 __Pyx_XDECREF(__pyx_v_povSceneTemplate);
15169 __Pyx_XDECREF(__pyx_v_x);
15170 __Pyx_XDECREF(__pyx_v_L);
15171 __Pyx_XDECREF(__pyx_v_cam);
15172 __Pyx_XGIVEREF(__pyx_r);
15173 __Pyx_RefNannyFinishContext();
15185 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
15186 PyObject *__pyx_r = NULL;
15187 __Pyx_RefNannyDeclarations
15188 PyObject *__pyx_t_1 = NULL;
15189 int __pyx_lineno = 0;
15190 const char *__pyx_filename = NULL;
15191 int __pyx_clineno = 0;
15192 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
15201 __Pyx_XDECREF(__pyx_r);
15202 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 736, __pyx_L1_error)
15203 __Pyx_GOTREF(__pyx_t_1);
15204 __pyx_r = __pyx_t_1;
15218 __Pyx_XDECREF(__pyx_t_1);
15219 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
15222 __Pyx_XGIVEREF(__pyx_r);
15223 __Pyx_RefNannyFinishContext();
15235 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
15236 PyObject *__pyx_r = NULL;
15237 __Pyx_RefNannyDeclarations
15238 PyObject *__pyx_t_1 = NULL;
15239 int __pyx_lineno = 0;
15240 const char *__pyx_filename = NULL;
15241 int __pyx_clineno = 0;
15242 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
15251 __Pyx_XDECREF(__pyx_r);
15252 __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)
15253 __Pyx_GOTREF(__pyx_t_1);
15254 __pyx_r = __pyx_t_1;
15268 __Pyx_XDECREF(__pyx_t_1);
15269 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
15272 __Pyx_XGIVEREF(__pyx_r);
15273 __Pyx_RefNannyFinishContext();
15285 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
15286 PyObject *__pyx_r = NULL;
15287 __Pyx_RefNannyDeclarations
15288 PyObject *__pyx_t_1 = NULL;
15289 int __pyx_lineno = 0;
15290 const char *__pyx_filename = NULL;
15291 int __pyx_clineno = 0;
15292 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
15301 __Pyx_XDECREF(__pyx_r);
15302 __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)
15303 __Pyx_GOTREF(__pyx_t_1);
15304 __pyx_r = __pyx_t_1;
15318 __Pyx_XDECREF(__pyx_t_1);
15319 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
15322 __Pyx_XGIVEREF(__pyx_r);
15323 __Pyx_RefNannyFinishContext();
15335 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) {
15336 PyObject *__pyx_r = NULL;
15337 __Pyx_RefNannyDeclarations
15338 PyObject *__pyx_t_1 = NULL;
15339 int __pyx_lineno = 0;
15340 const char *__pyx_filename = NULL;
15341 int __pyx_clineno = 0;
15342 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
15351 __Pyx_XDECREF(__pyx_r);
15352 __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)
15353 __Pyx_GOTREF(__pyx_t_1);
15354 __pyx_r = __pyx_t_1;
15368 __Pyx_XDECREF(__pyx_t_1);
15369 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
15372 __Pyx_XGIVEREF(__pyx_r);
15373 __Pyx_RefNannyFinishContext();
15385 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) {
15386 PyObject *__pyx_r = NULL;
15387 __Pyx_RefNannyDeclarations
15388 PyObject *__pyx_t_1 = NULL;
15389 int __pyx_lineno = 0;
15390 const char *__pyx_filename = NULL;
15391 int __pyx_clineno = 0;
15392 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
15401 __Pyx_XDECREF(__pyx_r);
15402 __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)
15403 __Pyx_GOTREF(__pyx_t_1);
15404 __pyx_r = __pyx_t_1;
15418 __Pyx_XDECREF(__pyx_t_1);
15419 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
15422 __Pyx_XGIVEREF(__pyx_r);
15423 __Pyx_RefNannyFinishContext();
15435 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
15436 PyObject *__pyx_r = NULL;
15437 __Pyx_RefNannyDeclarations
15439 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
15448 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
15458 __Pyx_XDECREF(__pyx_r);
15459 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
15460 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
15480 __Pyx_XDECREF(__pyx_r);
15481 __Pyx_INCREF(__pyx_empty_tuple);
15482 __pyx_r = __pyx_empty_tuple;
15496 __Pyx_XGIVEREF(__pyx_r);
15497 __Pyx_RefNannyFinishContext();
15509 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
15510 __Pyx_RefNannyDeclarations
15511 __Pyx_RefNannySetupContext(
"set_array_base", 0);
15520 Py_INCREF(__pyx_v_base);
15529 (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
15540 __Pyx_RefNannyFinishContext();
15551 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
15552 PyObject *__pyx_v_base;
15553 PyObject *__pyx_r = NULL;
15554 __Pyx_RefNannyDeclarations
15556 __Pyx_RefNannySetupContext(
"get_array_base", 0);
15565 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
15574 __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
15584 __Pyx_XDECREF(__pyx_r);
15585 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15604 __Pyx_XDECREF(__pyx_r);
15605 __Pyx_INCREF(((PyObject *)__pyx_v_base));
15606 __pyx_r = ((PyObject *)__pyx_v_base);
15619 __Pyx_XGIVEREF(__pyx_r);
15620 __Pyx_RefNannyFinishContext();
15632 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
15634 __Pyx_RefNannyDeclarations
15635 PyObject *__pyx_t_1 = NULL;
15636 PyObject *__pyx_t_2 = NULL;
15637 PyObject *__pyx_t_3 = NULL;
15639 PyObject *__pyx_t_5 = NULL;
15640 PyObject *__pyx_t_6 = NULL;
15641 PyObject *__pyx_t_7 = NULL;
15642 PyObject *__pyx_t_8 = NULL;
15643 int __pyx_lineno = 0;
15644 const char *__pyx_filename = NULL;
15645 int __pyx_clineno = 0;
15646 __Pyx_RefNannySetupContext(
"import_array", 0);
15656 __Pyx_PyThreadState_declare
15657 __Pyx_PyThreadState_assign
15658 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
15659 __Pyx_XGOTREF(__pyx_t_1);
15660 __Pyx_XGOTREF(__pyx_t_2);
15661 __Pyx_XGOTREF(__pyx_t_3);
15671 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 943, __pyx_L3_error)
15681 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
15682 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
15683 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15684 goto __pyx_L8_try_end;
15694 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
15696 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
15697 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 944, __pyx_L5_except_error)
15698 __Pyx_GOTREF(__pyx_t_5);
15699 __Pyx_GOTREF(__pyx_t_6);
15700 __Pyx_GOTREF(__pyx_t_7);
15709 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__8, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 945, __pyx_L5_except_error)
15710 __Pyx_GOTREF(__pyx_t_8);
15711 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
15712 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
15713 __PYX_ERR(1, 945, __pyx_L5_except_error)
15715 goto __pyx_L5_except_error;
15716 __pyx_L5_except_error:;
15725 __Pyx_XGIVEREF(__pyx_t_1);
15726 __Pyx_XGIVEREF(__pyx_t_2);
15727 __Pyx_XGIVEREF(__pyx_t_3);
15728 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15729 goto __pyx_L1_error;
15745 __Pyx_XDECREF(__pyx_t_5);
15746 __Pyx_XDECREF(__pyx_t_6);
15747 __Pyx_XDECREF(__pyx_t_7);
15748 __Pyx_XDECREF(__pyx_t_8);
15749 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
15752 __Pyx_RefNannyFinishContext();
15764 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
15766 __Pyx_RefNannyDeclarations
15767 PyObject *__pyx_t_1 = NULL;
15768 PyObject *__pyx_t_2 = NULL;
15769 PyObject *__pyx_t_3 = NULL;
15771 PyObject *__pyx_t_5 = NULL;
15772 PyObject *__pyx_t_6 = NULL;
15773 PyObject *__pyx_t_7 = NULL;
15774 PyObject *__pyx_t_8 = NULL;
15775 int __pyx_lineno = 0;
15776 const char *__pyx_filename = NULL;
15777 int __pyx_clineno = 0;
15778 __Pyx_RefNannySetupContext(
"import_umath", 0);
15788 __Pyx_PyThreadState_declare
15789 __Pyx_PyThreadState_assign
15790 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
15791 __Pyx_XGOTREF(__pyx_t_1);
15792 __Pyx_XGOTREF(__pyx_t_2);
15793 __Pyx_XGOTREF(__pyx_t_3);
15803 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 949, __pyx_L3_error)
15813 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
15814 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
15815 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15816 goto __pyx_L8_try_end;
15826 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
15828 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
15829 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 950, __pyx_L5_except_error)
15830 __Pyx_GOTREF(__pyx_t_5);
15831 __Pyx_GOTREF(__pyx_t_6);
15832 __Pyx_GOTREF(__pyx_t_7);
15841 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 951, __pyx_L5_except_error)
15842 __Pyx_GOTREF(__pyx_t_8);
15843 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
15844 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
15845 __PYX_ERR(1, 951, __pyx_L5_except_error)
15847 goto __pyx_L5_except_error;
15848 __pyx_L5_except_error:;
15857 __Pyx_XGIVEREF(__pyx_t_1);
15858 __Pyx_XGIVEREF(__pyx_t_2);
15859 __Pyx_XGIVEREF(__pyx_t_3);
15860 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15861 goto __pyx_L1_error;
15877 __Pyx_XDECREF(__pyx_t_5);
15878 __Pyx_XDECREF(__pyx_t_6);
15879 __Pyx_XDECREF(__pyx_t_7);
15880 __Pyx_XDECREF(__pyx_t_8);
15881 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
15884 __Pyx_RefNannyFinishContext();
15896 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
15898 __Pyx_RefNannyDeclarations
15899 PyObject *__pyx_t_1 = NULL;
15900 PyObject *__pyx_t_2 = NULL;
15901 PyObject *__pyx_t_3 = NULL;
15903 PyObject *__pyx_t_5 = NULL;
15904 PyObject *__pyx_t_6 = NULL;
15905 PyObject *__pyx_t_7 = NULL;
15906 PyObject *__pyx_t_8 = NULL;
15907 int __pyx_lineno = 0;
15908 const char *__pyx_filename = NULL;
15909 int __pyx_clineno = 0;
15910 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
15920 __Pyx_PyThreadState_declare
15921 __Pyx_PyThreadState_assign
15922 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
15923 __Pyx_XGOTREF(__pyx_t_1);
15924 __Pyx_XGOTREF(__pyx_t_2);
15925 __Pyx_XGOTREF(__pyx_t_3);
15935 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 955, __pyx_L3_error)
15945 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
15946 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
15947 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15948 goto __pyx_L8_try_end;
15958 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
15960 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
15961 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 956, __pyx_L5_except_error)
15962 __Pyx_GOTREF(__pyx_t_5);
15963 __Pyx_GOTREF(__pyx_t_6);
15964 __Pyx_GOTREF(__pyx_t_7);
15973 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 957, __pyx_L5_except_error)
15974 __Pyx_GOTREF(__pyx_t_8);
15975 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
15976 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
15977 __PYX_ERR(1, 957, __pyx_L5_except_error)
15979 goto __pyx_L5_except_error;
15980 __pyx_L5_except_error:;
15989 __Pyx_XGIVEREF(__pyx_t_1);
15990 __Pyx_XGIVEREF(__pyx_t_2);
15991 __Pyx_XGIVEREF(__pyx_t_3);
15992 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
15993 goto __pyx_L1_error;
16009 __Pyx_XDECREF(__pyx_t_5);
16010 __Pyx_XDECREF(__pyx_t_6);
16011 __Pyx_XDECREF(__pyx_t_7);
16012 __Pyx_XDECREF(__pyx_t_8);
16013 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
16016 __Pyx_RefNannyFinishContext();
16028 static CYTHON_INLINE
int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
16030 __Pyx_RefNannyDeclarations
16031 __Pyx_RefNannySetupContext(
"is_timedelta64_object", 0);
16040 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
16053 __Pyx_RefNannyFinishContext();
16065 static CYTHON_INLINE
int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
16067 __Pyx_RefNannyDeclarations
16068 __Pyx_RefNannySetupContext(
"is_datetime64_object", 0);
16077 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
16090 __Pyx_RefNannyFinishContext();
16102 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
16103 npy_datetime __pyx_r;
16112 __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
16136 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
16137 npy_timedelta __pyx_r;
16146 __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
16170 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
16171 NPY_DATETIMEUNIT __pyx_r;
16178 __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
16194 static struct __pyx_obj_10Isosurface___pyx_scope_struct__attachModel *__pyx_freelist_10Isosurface___pyx_scope_struct__attachModel[8];
16195 static int __pyx_freecount_10Isosurface___pyx_scope_struct__attachModel = 0;
16197 static PyObject *__pyx_tp_new_10Isosurface___pyx_scope_struct__attachModel(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
16199 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10Isosurface___pyx_scope_struct__attachModel > 0) & (t->tp_basicsize ==
sizeof(
struct __pyx_obj_10Isosurface___pyx_scope_struct__attachModel)))) {
16200 o = (PyObject*)__pyx_freelist_10Isosurface___pyx_scope_struct__attachModel[--__pyx_freecount_10Isosurface___pyx_scope_struct__attachModel];
16201 memset(o, 0,
sizeof(
struct __pyx_obj_10Isosurface___pyx_scope_struct__attachModel));
16202 (void) PyObject_INIT(o, t);
16203 PyObject_GC_Track(o);
16205 o = (*t->tp_alloc)(t, 0);
16206 if (unlikely(!o))
return 0;
16211 static void __pyx_tp_dealloc_10Isosurface___pyx_scope_struct__attachModel(PyObject *o) {
16212 struct __pyx_obj_10Isosurface___pyx_scope_struct__attachModel *p = (
struct __pyx_obj_10Isosurface___pyx_scope_struct__attachModel *)o;
16213 PyObject_GC_UnTrack(o);
16214 Py_CLEAR(p->__pyx_v_self);
16215 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10Isosurface___pyx_scope_struct__attachModel < 8) & (Py_TYPE(o)->tp_basicsize ==
sizeof(
struct __pyx_obj_10Isosurface___pyx_scope_struct__attachModel)))) {
16216 __pyx_freelist_10Isosurface___pyx_scope_struct__attachModel[__pyx_freecount_10Isosurface___pyx_scope_struct__attachModel++] = ((
struct __pyx_obj_10Isosurface___pyx_scope_struct__attachModel *)o);
16218 (*Py_TYPE(o)->tp_free)(o);
16222 static int __pyx_tp_traverse_10Isosurface___pyx_scope_struct__attachModel(PyObject *o, visitproc
v,
void *a) {
16224 struct __pyx_obj_10Isosurface___pyx_scope_struct__attachModel *p = (
struct __pyx_obj_10Isosurface___pyx_scope_struct__attachModel *)o;
16225 if (p->__pyx_v_self) {
16226 e = (*v)(p->__pyx_v_self, a);
if (e)
return e;
16231 static int __pyx_tp_clear_10Isosurface___pyx_scope_struct__attachModel(PyObject *o) {
16233 struct __pyx_obj_10Isosurface___pyx_scope_struct__attachModel *p = (
struct __pyx_obj_10Isosurface___pyx_scope_struct__attachModel *)o;
16234 tmp = ((PyObject*)p->__pyx_v_self);
16235 p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
16240 static PyTypeObject __pyx_type_10Isosurface___pyx_scope_struct__attachModel = {
16241 PyVarObject_HEAD_INIT(0, 0)
16242 "Isosurface.__pyx_scope_struct__attachModel",
16243 sizeof(
struct __pyx_obj_10Isosurface___pyx_scope_struct__attachModel),
16245 __pyx_tp_dealloc_10Isosurface___pyx_scope_struct__attachModel,
16246 #if PY_VERSION_HEX < 0x030800b4
16249 #if PY_VERSION_HEX >= 0x030800b4
16254 #if PY_MAJOR_VERSION < 3
16257 #if PY_MAJOR_VERSION >= 3
16270 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
16272 __pyx_tp_traverse_10Isosurface___pyx_scope_struct__attachModel,
16273 __pyx_tp_clear_10Isosurface___pyx_scope_struct__attachModel,
16288 __pyx_tp_new_10Isosurface___pyx_scope_struct__attachModel,
16298 #if PY_VERSION_HEX >= 0x030400a1
16301 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
16304 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
16307 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
16312 static struct __pyx_obj_10Isosurface___pyx_scope_struct_1_genexpr *__pyx_freelist_10Isosurface___pyx_scope_struct_1_genexpr[8];
16313 static int __pyx_freecount_10Isosurface___pyx_scope_struct_1_genexpr = 0;
16315 static PyObject *__pyx_tp_new_10Isosurface___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
16317 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10Isosurface___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize ==
sizeof(
struct __pyx_obj_10Isosurface___pyx_scope_struct_1_genexpr)))) {
16318 o = (PyObject*)__pyx_freelist_10Isosurface___pyx_scope_struct_1_genexpr[--__pyx_freecount_10Isosurface___pyx_scope_struct_1_genexpr];
16319 memset(o, 0,
sizeof(
struct __pyx_obj_10Isosurface___pyx_scope_struct_1_genexpr));
16320 (void) PyObject_INIT(o, t);
16321 PyObject_GC_Track(o);
16323 o = (*t->tp_alloc)(t, 0);
16324 if (unlikely(!o))
return 0;
16329 static void __pyx_tp_dealloc_10Isosurface___pyx_scope_struct_1_genexpr(PyObject *o) {
16330 struct __pyx_obj_10Isosurface___pyx_scope_struct_1_genexpr *p = (
struct __pyx_obj_10Isosurface___pyx_scope_struct_1_genexpr *)o;
16331 PyObject_GC_UnTrack(o);
16332 Py_CLEAR(p->__pyx_outer_scope);
16333 Py_CLEAR(p->__pyx_v_bn);
16334 Py_CLEAR(p->__pyx_v_gn);
16335 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10Isosurface___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize ==
sizeof(
struct __pyx_obj_10Isosurface___pyx_scope_struct_1_genexpr)))) {
16336 __pyx_freelist_10Isosurface___pyx_scope_struct_1_genexpr[__pyx_freecount_10Isosurface___pyx_scope_struct_1_genexpr++] = ((
struct __pyx_obj_10Isosurface___pyx_scope_struct_1_genexpr *)o);
16338 (*Py_TYPE(o)->tp_free)(o);
16342 static int __pyx_tp_traverse_10Isosurface___pyx_scope_struct_1_genexpr(PyObject *o, visitproc
v,
void *a) {
16344 struct __pyx_obj_10Isosurface___pyx_scope_struct_1_genexpr *p = (
struct __pyx_obj_10Isosurface___pyx_scope_struct_1_genexpr *)o;
16345 if (p->__pyx_outer_scope) {
16346 e = (*v)(((PyObject *)p->__pyx_outer_scope), a);
if (e)
return e;
16348 if (p->__pyx_v_bn) {
16349 e = (*v)(p->__pyx_v_bn, a);
if (e)
return e;
16351 if (p->__pyx_v_gn) {
16352 e = (*v)(p->__pyx_v_gn, a);
if (e)
return e;
16357 static PyTypeObject __pyx_type_10Isosurface___pyx_scope_struct_1_genexpr = {
16358 PyVarObject_HEAD_INIT(0, 0)
16359 "Isosurface.__pyx_scope_struct_1_genexpr",
16360 sizeof(
struct __pyx_obj_10Isosurface___pyx_scope_struct_1_genexpr),
16362 __pyx_tp_dealloc_10Isosurface___pyx_scope_struct_1_genexpr,
16363 #if PY_VERSION_HEX < 0x030800b4
16366 #if PY_VERSION_HEX >= 0x030800b4
16371 #if PY_MAJOR_VERSION < 3
16374 #if PY_MAJOR_VERSION >= 3
16387 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
16389 __pyx_tp_traverse_10Isosurface___pyx_scope_struct_1_genexpr,
16405 __pyx_tp_new_10Isosurface___pyx_scope_struct_1_genexpr,
16415 #if PY_VERSION_HEX >= 0x030400a1
16418 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
16421 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
16424 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
16429 static PyMethodDef __pyx_methods[] = {
16433 #if PY_MAJOR_VERSION >= 3
16434 #if CYTHON_PEP489_MULTI_PHASE_INIT
16435 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
16436 static int __pyx_pymod_exec_Isosurface(PyObject* module);
16437 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
16438 {Py_mod_create, (
void*)__pyx_pymod_create},
16439 {Py_mod_exec, (
void*)__pyx_pymod_exec_Isosurface},
16444 static struct PyModuleDef __pyx_moduledef = {
16445 PyModuleDef_HEAD_INIT,
16447 __pyx_k_AuxiliaryVariables_subclasses_f,
16448 #if CYTHON_PEP489_MULTI_PHASE_INIT
16454 #if CYTHON_PEP489_MULTI_PHASE_INIT
16455 __pyx_moduledef_slots,
16464 #ifndef CYTHON_SMALL_CODE
16465 #if defined(__clang__)
16466 #define CYTHON_SMALL_CODE
16467 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
16468 #define CYTHON_SMALL_CODE __attribute__((cold))
16470 #define CYTHON_SMALL_CODE
16474 static __Pyx_StringTabEntry __pyx_string_tab[] = {
16475 {&__pyx_kp_s_0_d, __pyx_k_0_d,
sizeof(__pyx_k_0_d), 0, 0, 1, 0},
16476 {&__pyx_kp_s_0_d_1_d_2_d, __pyx_k_0_d_1_d_2_d,
sizeof(__pyx_k_0_d_1_d_2_d), 0, 0, 1, 0},
16477 {&__pyx_kp_s_0_d_1_d_2_d_2, __pyx_k_0_d_1_d_2_d_2,
sizeof(__pyx_k_0_d_1_d_2_d_2), 0, 0, 1, 0},
16478 {&__pyx_kp_s_0_f_1_f_2_f, __pyx_k_0_f_1_f_2_f,
sizeof(__pyx_k_0_f_1_f_2_f), 0, 0, 1, 0},
16479 {&__pyx_kp_s_ATTACHING_TO_HDF5, __pyx_k_ATTACHING_TO_HDF5,
sizeof(__pyx_k_ATTACHING_TO_HDF5), 0, 0, 1, 0},
16480 {&__pyx_n_s_AV_base, __pyx_k_AV_base,
sizeof(__pyx_k_AV_base), 0, 0, 1, 1},
16481 {&__pyx_n_s_AuxiliaryVariables, __pyx_k_AuxiliaryVariables,
sizeof(__pyx_k_AuxiliaryVariables), 0, 0, 1, 1},
16482 {&__pyx_kp_s_Calculate_called_at_time, __pyx_k_Calculate_called_at_time,
sizeof(__pyx_k_Calculate_called_at_time), 0, 0, 1, 0},
16483 {&__pyx_n_s_Comm, __pyx_k_Comm,
sizeof(__pyx_k_Comm), 0, 0, 1, 1},
16484 {&__pyx_kp_s_Elements_have_0_d_vertices_but_a, __pyx_k_Elements_have_0_d_vertices_but_a,
sizeof(__pyx_k_Elements_have_0_d_vertices_but_a), 0, 0, 1, 0},
16485 {&__pyx_kp_s_Extract_isosurfaces, __pyx_k_Extract_isosurfaces,
sizeof(__pyx_k_Extract_isosurfaces), 0, 0, 1, 0},
16486 {&__pyx_n_s_FemField, __pyx_k_FemField,
sizeof(__pyx_k_FemField), 0, 0, 1, 1},
16487 {&__pyx_n_s_File, __pyx_k_File,
sizeof(__pyx_k_File), 0, 0, 1, 1},
16488 {&__pyx_n_s_I, __pyx_k_I,
sizeof(__pyx_k_I), 0, 0, 1, 1},
16489 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
16490 {&__pyx_n_s_Isosurface, __pyx_k_Isosurface,
sizeof(__pyx_k_Isosurface), 0, 0, 1, 1},
16491 {&__pyx_n_s_Isosurface___init, __pyx_k_Isosurface___init,
sizeof(__pyx_k_Isosurface___init), 0, 0, 1, 1},
16492 {&__pyx_n_s_Isosurface_attachHDF5, __pyx_k_Isosurface_attachHDF5,
sizeof(__pyx_k_Isosurface_attachHDF5), 0, 0, 1, 1},
16493 {&__pyx_n_s_Isosurface_attachModel, __pyx_k_Isosurface_attachModel,
sizeof(__pyx_k_Isosurface_attachModel), 0, 0, 1, 1},
16494 {&__pyx_n_s_Isosurface_attachModel_locals_ge, __pyx_k_Isosurface_attachModel_locals_ge,
sizeof(__pyx_k_Isosurface_attachModel_locals_ge), 0, 0, 1, 1},
16495 {&__pyx_n_s_Isosurface_calculate, __pyx_k_Isosurface_calculate,
sizeof(__pyx_k_Isosurface_calculate), 0, 0, 1, 1},
16496 {&__pyx_kp_s_Isosurface_file_format_not_recog, __pyx_k_Isosurface_file_format_not_recog,
sizeof(__pyx_k_Isosurface_file_format_not_recog), 0, 0, 1, 0},
16497 {&__pyx_n_s_Isosurface_triangulateIsosurface, __pyx_k_Isosurface_triangulateIsosurface,
sizeof(__pyx_k_Isosurface_triangulateIsosurface), 0, 0, 1, 1},
16498 {&__pyx_n_s_Isosurface_writeIsosurfaceMesh, __pyx_k_Isosurface_writeIsosurfaceMesh,
sizeof(__pyx_k_Isosurface_writeIsosurfaceMesh), 0, 0, 1, 1},
16499 {&__pyx_n_s_Isosurface_writeIsosurfaceMesh_h, __pyx_k_Isosurface_writeIsosurfaceMesh_h,
sizeof(__pyx_k_Isosurface_writeIsosurfaceMesh_h), 0, 0, 1, 1},
16500 {&__pyx_n_s_Isosurface_writeIsosurfaceMesh_p, __pyx_k_Isosurface_writeIsosurfaceMesh_p,
sizeof(__pyx_k_Isosurface_writeIsosurfaceMesh_p), 0, 0, 1, 1},
16501 {&__pyx_n_s_Isosurface_writeSceneHeader, __pyx_k_Isosurface_writeSceneHeader,
sizeof(__pyx_k_Isosurface_writeSceneHeader), 0, 0, 1, 1},
16502 {&__pyx_n_s_J, __pyx_k_J,
sizeof(__pyx_k_J), 0, 0, 1, 1},
16503 {&__pyx_n_s_L, __pyx_k_L,
sizeof(__pyx_k_L), 0, 0, 1, 1},
16504 {&__pyx_n_s_MPI, __pyx_k_MPI,
sizeof(__pyx_k_MPI), 0, 0, 1, 1},
16505 {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError,
sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
16506 {&__pyx_kp_s_Only_zero_isocontour_extraction, __pyx_k_Only_zero_isocontour_extraction,
sizeof(__pyx_k_Only_zero_isocontour_extraction), 0, 0, 1, 0},
16507 {&__pyx_n_s_OrderedDict, __pyx_k_OrderedDict,
sizeof(__pyx_k_OrderedDict), 0, 0, 1, 1},
16508 {&__pyx_n_s_PETSc, __pyx_k_PETSc,
sizeof(__pyx_k_PETSc), 0, 0, 1, 1},
16509 {&__pyx_n_s_Profiling, __pyx_k_Profiling,
sizeof(__pyx_k_Profiling), 0, 0, 1, 1},
16510 {&__pyx_n_s_Template, __pyx_k_Template,
sizeof(__pyx_k_Template), 0, 0, 1, 1},
16511 {&__pyx_kp_s_Writing_pov_frame, __pyx_k_Writing_pov_frame,
sizeof(__pyx_k_Writing_pov_frame), 0, 0, 1, 0},
16512 {&__pyx_n_s__10, __pyx_k__10,
sizeof(__pyx_k__10), 0, 0, 1, 1},
16513 {&__pyx_kp_s__4, __pyx_k__4,
sizeof(__pyx_k__4), 0, 0, 1, 0},
16514 {&__pyx_kp_s__6, __pyx_k__6,
sizeof(__pyx_k__6), 0, 0, 1, 0},
16515 {&__pyx_n_s_a, __pyx_k_a,
sizeof(__pyx_k_a), 0, 0, 1, 1},
16516 {&__pyx_n_s_activeTime, __pyx_k_activeTime,
sizeof(__pyx_k_activeTime), 0, 0, 1, 1},
16517 {&__pyx_n_s_ar, __pyx_k_ar,
sizeof(__pyx_k_ar), 0, 0, 1, 1},
16518 {&__pyx_n_s_args, __pyx_k_args,
sizeof(__pyx_k_args), 0, 0, 1, 1},
16519 {&__pyx_n_s_array, __pyx_k_array,
sizeof(__pyx_k_array), 0, 0, 1, 1},
16520 {&__pyx_n_s_attachHDF5, __pyx_k_attachHDF5,
sizeof(__pyx_k_attachHDF5), 0, 0, 1, 1},
16521 {&__pyx_n_s_attachModel, __pyx_k_attachModel,
sizeof(__pyx_k_attachModel), 0, 0, 1, 1},
16522 {&__pyx_n_s_barrier, __pyx_k_barrier,
sizeof(__pyx_k_barrier), 0, 0, 1, 1},
16523 {&__pyx_n_s_beginSequential, __pyx_k_beginSequential,
sizeof(__pyx_k_beginSequential), 0, 0, 1, 1},
16524 {&__pyx_n_s_bnt, __pyx_k_bnt,
sizeof(__pyx_k_bnt), 0, 0, 1, 1},
16525 {&__pyx_n_s_boundaryNodes, __pyx_k_boundaryNodes,
sizeof(__pyx_k_boundaryNodes), 0, 0, 1, 1},
16526 {&__pyx_n_s_calculate, __pyx_k_calculate,
sizeof(__pyx_k_calculate), 0, 0, 1, 1},
16527 {&__pyx_n_s_cam, __pyx_k_cam,
sizeof(__pyx_k_cam), 0, 0, 1, 1},
16528 {&__pyx_n_s_cam_x, __pyx_k_cam_x,
sizeof(__pyx_k_cam_x), 0, 0, 1, 1},
16529 {&__pyx_n_s_cam_y, __pyx_k_cam_y,
sizeof(__pyx_k_cam_y), 0, 0, 1, 1},
16530 {&__pyx_n_s_cam_z, __pyx_k_cam_z,
sizeof(__pyx_k_cam_z), 0, 0, 1, 1},
16531 {&__pyx_n_s_checkTime, __pyx_k_checkTime,
sizeof(__pyx_k_checkTime), 0, 0, 1, 1},
16532 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
16533 {&__pyx_n_s_close, __pyx_k_close,
sizeof(__pyx_k_close), 0, 0, 1, 1},
16534 {&__pyx_n_s_coefficients, __pyx_k_coefficients,
sizeof(__pyx_k_coefficients), 0, 0, 1, 1},
16535 {&__pyx_n_s_collections, __pyx_k_collections,
sizeof(__pyx_k_collections), 0, 0, 1, 1},
16536 {&__pyx_n_s_comm, __pyx_k_comm,
sizeof(__pyx_k_comm), 0, 0, 1, 1},
16537 {&__pyx_n_s_count_nonzero, __pyx_k_count_nonzero,
sizeof(__pyx_k_count_nonzero), 0, 0, 1, 1},
16538 {&__pyx_n_s_create_dataset, __pyx_k_create_dataset,
sizeof(__pyx_k_create_dataset), 0, 0, 1, 1},
16539 {&__pyx_n_s_d, __pyx_k_d,
sizeof(__pyx_k_d), 0, 0, 1, 1},
16540 {&__pyx_n_s_data, __pyx_k_data,
sizeof(__pyx_k_data), 0, 0, 1, 1},
16541 {&__pyx_n_s_defaultdict, __pyx_k_defaultdict,
sizeof(__pyx_k_defaultdict), 0, 0, 1, 1},
16542 {&__pyx_n_s_doc, __pyx_k_doc,
sizeof(__pyx_k_doc), 0, 0, 1, 1},
16543 {&__pyx_n_s_dof, __pyx_k_dof,
sizeof(__pyx_k_dof), 0, 0, 1, 1},
16544 {&__pyx_n_s_domain, __pyx_k_domain,
sizeof(__pyx_k_domain), 0, 0, 1, 1},
16545 {&__pyx_n_s_domain_fur_x, __pyx_k_domain_fur_x,
sizeof(__pyx_k_domain_fur_x), 0, 0, 1, 1},
16546 {&__pyx_n_s_domain_fur_y, __pyx_k_domain_fur_y,
sizeof(__pyx_k_domain_fur_y), 0, 0, 1, 1},
16547 {&__pyx_n_s_domain_fur_z, __pyx_k_domain_fur_z,
sizeof(__pyx_k_domain_fur_z), 0, 0, 1, 1},
16548 {&__pyx_n_s_domain_nll_x, __pyx_k_domain_nll_x,
sizeof(__pyx_k_domain_nll_x), 0, 0, 1, 1},
16549 {&__pyx_n_s_domain_nll_y, __pyx_k_domain_nll_y,
sizeof(__pyx_k_domain_nll_y), 0, 0, 1, 1},
16550 {&__pyx_n_s_domain_nll_z, __pyx_k_domain_nll_z,
sizeof(__pyx_k_domain_nll_z), 0, 0, 1, 1},
16551 {&__pyx_n_s_dset, __pyx_k_dset,
sizeof(__pyx_k_dset), 0, 0, 1, 1},
16552 {&__pyx_n_s_dx, __pyx_k_dx,
sizeof(__pyx_k_dx), 0, 0, 1, 1},
16553 {&__pyx_n_s_e, __pyx_k_e,
sizeof(__pyx_k_e), 0, 0, 1, 1},
16554 {&__pyx_n_s_eN, __pyx_k_eN,
sizeof(__pyx_k_eN), 0, 0, 1, 1},
16555 {&__pyx_n_s_ebN, __pyx_k_ebN,
sizeof(__pyx_k_ebN), 0, 0, 1, 1},
16556 {&__pyx_n_s_elementBoundaryMaterialTypes, __pyx_k_elementBoundaryMaterialTypes,
sizeof(__pyx_k_elementBoundaryMaterialTypes), 0, 0, 1, 1},
16557 {&__pyx_n_s_elementBoundaryNodesArray, __pyx_k_elementBoundaryNodesArray,
sizeof(__pyx_k_elementBoundaryNodesArray), 0, 0, 1, 1},
16558 {&__pyx_n_s_elementNodesArray, __pyx_k_elementNodesArray,
sizeof(__pyx_k_elementNodesArray), 0, 0, 1, 1},
16559 {&__pyx_n_s_elements, __pyx_k_elements,
sizeof(__pyx_k_elements), 0, 0, 1, 1},
16560 {&__pyx_kp_s_elementsSpatial_Domain, __pyx_k_elementsSpatial_Domain,
sizeof(__pyx_k_elementsSpatial_Domain), 0, 0, 1, 0},
16561 {&__pyx_n_s_elems, __pyx_k_elems,
sizeof(__pyx_k_elems), 0, 0, 1, 1},
16562 {&__pyx_n_s_end, __pyx_k_end,
sizeof(__pyx_k_end), 0, 0, 1, 1},
16563 {&__pyx_n_s_endSequential, __pyx_k_endSequential,
sizeof(__pyx_k_endSequential), 0, 0, 1, 1},
16564 {&__pyx_n_s_enumerate, __pyx_k_enumerate,
sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
16565 {&__pyx_n_s_eps, __pyx_k_eps,
sizeof(__pyx_k_eps), 0, 0, 1, 1},
16566 {&__pyx_n_s_exteriorElementBoundariesArray, __pyx_k_exteriorElementBoundariesArray,
sizeof(__pyx_k_exteriorElementBoundariesArray), 0, 0, 1, 1},
16567 {&__pyx_n_s_f, __pyx_k_f,
sizeof(__pyx_k_f), 0, 0, 1, 1},
16568 {&__pyx_kp_s_face_indices, __pyx_k_face_indices,
sizeof(__pyx_k_face_indices), 0, 0, 1, 0},
16569 {&__pyx_kp_s_face_indices_2, __pyx_k_face_indices_2,
sizeof(__pyx_k_face_indices_2), 0, 0, 1, 0},
16570 {&__pyx_n_s_field, __pyx_k_field,
sizeof(__pyx_k_field), 0, 0, 1, 1},
16571 {&__pyx_n_s_fieldNames, __pyx_k_fieldNames,
sizeof(__pyx_k_fieldNames), 0, 0, 1, 1},
16572 {&__pyx_n_s_field_i, __pyx_k_field_i,
sizeof(__pyx_k_field_i), 0, 0, 1, 1},
16573 {&__pyx_kp_s_field_s___value_f___frame_04d_p, __pyx_k_field_s___value_f___frame_04d_p,
sizeof(__pyx_k_field_s___value_f___frame_04d_p), 0, 0, 1, 0},
16574 {&__pyx_n_s_file, __pyx_k_file,
sizeof(__pyx_k_file), 0, 0, 1, 1},
16575 {&__pyx_n_s_filename, __pyx_k_filename,
sizeof(__pyx_k_filename), 0, 0, 1, 1},
16576 {&__pyx_n_s_fileprefix, __pyx_k_fileprefix,
sizeof(__pyx_k_fileprefix), 0, 0, 1, 1},
16577 {&__pyx_n_s_fine_grid, __pyx_k_fine_grid,
sizeof(__pyx_k_fine_grid), 0, 0, 1, 1},
16578 {&__pyx_n_s_flatten, __pyx_k_flatten,
sizeof(__pyx_k_flatten), 0, 0, 1, 1},
16579 {&__pyx_n_s_floor_z, __pyx_k_floor_z,
sizeof(__pyx_k_floor_z), 0, 0, 1, 1},
16580 {&__pyx_n_s_flush, __pyx_k_flush,
sizeof(__pyx_k_flush), 0, 0, 1, 1},
16581 {&__pyx_n_s_format, __pyx_k_format,
sizeof(__pyx_k_format), 0, 0, 1, 1},
16582 {&__pyx_n_s_frame, __pyx_k_frame,
sizeof(__pyx_k_frame), 0, 0, 1, 1},
16583 {&__pyx_n_s_fur, __pyx_k_fur,
sizeof(__pyx_k_fur), 0, 0, 1, 1},
16584 {&__pyx_n_s_fur_x, __pyx_k_fur_x,
sizeof(__pyx_k_fur_x), 0, 0, 1, 1},
16585 {&__pyx_n_s_fur_y, __pyx_k_fur_y,
sizeof(__pyx_k_fur_y), 0, 0, 1, 1},
16586 {&__pyx_n_s_fur_z, __pyx_k_fur_z,
sizeof(__pyx_k_fur_z), 0, 0, 1, 1},
16587 {&__pyx_n_s_g2b, __pyx_k_g2b,
sizeof(__pyx_k_g2b), 0, 0, 1, 1},
16588 {&__pyx_n_s_genexpr, __pyx_k_genexpr,
sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
16589 {&__pyx_n_s_get, __pyx_k_get,
sizeof(__pyx_k_get), 0, 0, 1, 1},
16590 {&__pyx_n_s_get_node, __pyx_k_get_node,
sizeof(__pyx_k_get_node), 0, 0, 1, 1},
16591 {&__pyx_n_s_h5, __pyx_k_h5,
sizeof(__pyx_k_h5), 0, 0, 1, 1},
16592 {&__pyx_kp_s_h5_2, __pyx_k_h5_2,
sizeof(__pyx_k_h5_2), 0, 0, 1, 0},
16593 {&__pyx_n_s_h5py, __pyx_k_h5py,
sizeof(__pyx_k_h5py), 0, 0, 1, 1},
16594 {&__pyx_n_s_i, __pyx_k_i,
sizeof(__pyx_k_i), 0, 0, 1, 1},
16595 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
16596 {&__pyx_kp_s_include_colors_inc_include_text, __pyx_k_include_colors_inc_include_text,
sizeof(__pyx_k_include_colors_inc_include_text), 0, 0, 1, 0},
16597 {&__pyx_n_s_index, __pyx_k_index,
sizeof(__pyx_k_index), 0, 0, 1, 1},
16598 {&__pyx_n_s_init, __pyx_k_init,
sizeof(__pyx_k_init), 0, 0, 1, 1},
16599 {&__pyx_kp_s_inside_vector_on_mesh, __pyx_k_inside_vector_on_mesh,
sizeof(__pyx_k_inside_vector_on_mesh), 0, 0, 1, 0},
16600 {&__pyx_n_s_isMaster, __pyx_k_isMaster,
sizeof(__pyx_k_isMaster), 0, 0, 1, 1},
16601 {&__pyx_n_s_isosurface, __pyx_k_isosurface,
sizeof(__pyx_k_isosurface), 0, 0, 1, 1},
16602 {&__pyx_n_s_isosurfaces, __pyx_k_isosurfaces,
sizeof(__pyx_k_isosurfaces), 0, 0, 1, 1},
16603 {&__pyx_n_s_itertools, __pyx_k_itertools,
sizeof(__pyx_k_itertools), 0, 0, 1, 1},
16604 {&__pyx_n_s_j, __pyx_k_j,
sizeof(__pyx_k_j), 0, 0, 1, 1},
16605 {&__pyx_n_s_join, __pyx_k_join,
sizeof(__pyx_k_join), 0, 0, 1, 1},
16606 {&__pyx_n_s_levelModelList, __pyx_k_levelModelList,
sizeof(__pyx_k_levelModelList), 0, 0, 1, 1},
16607 {&__pyx_n_s_light, __pyx_k_light,
sizeof(__pyx_k_light), 0, 0, 1, 1},
16608 {&__pyx_n_s_light_dx, __pyx_k_light_dx,
sizeof(__pyx_k_light_dx), 0, 0, 1, 1},
16609 {&__pyx_n_s_light_dy, __pyx_k_light_dy,
sizeof(__pyx_k_light_dy), 0, 0, 1, 1},
16610 {&__pyx_n_s_light_x, __pyx_k_light_x,
sizeof(__pyx_k_light_x), 0, 0, 1, 1},
16611 {&__pyx_n_s_light_y, __pyx_k_light_y,
sizeof(__pyx_k_light_y), 0, 0, 1, 1},
16612 {&__pyx_n_s_light_z, __pyx_k_light_z,
sizeof(__pyx_k_light_z), 0, 0, 1, 1},
16613 {&__pyx_n_s_log, __pyx_k_log,
sizeof(__pyx_k_log), 0, 0, 1, 1},
16614 {&__pyx_n_s_logDir, __pyx_k_logDir,
sizeof(__pyx_k_logDir), 0, 0, 1, 1},
16615 {&__pyx_n_s_logEvent, __pyx_k_logEvent,
sizeof(__pyx_k_logEvent), 0, 0, 1, 1},
16616 {&__pyx_n_s_look_at, __pyx_k_look_at,
sizeof(__pyx_k_look_at), 0, 0, 1, 1},
16617 {&__pyx_n_s_look_at_x, __pyx_k_look_at_x,
sizeof(__pyx_k_look_at_x), 0, 0, 1, 1},
16618 {&__pyx_n_s_look_at_y, __pyx_k_look_at_y,
sizeof(__pyx_k_look_at_y), 0, 0, 1, 1},
16619 {&__pyx_n_s_look_at_z, __pyx_k_look_at_z,
sizeof(__pyx_k_look_at_z), 0, 0, 1, 1},
16620 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
16621 {&__pyx_kp_s_matrix_1_000000_0_000000_0_0000, __pyx_k_matrix_1_000000_0_000000_0_0000,
sizeof(__pyx_k_matrix_1_000000_0_000000_0_0000), 0, 0, 1, 0},
16622 {&__pyx_n_s_mesh, __pyx_k_mesh,
sizeof(__pyx_k_mesh), 0, 0, 1, 1},
16623 {&__pyx_kp_s_mesh2_vertex_vectors, __pyx_k_mesh2_vertex_vectors,
sizeof(__pyx_k_mesh2_vertex_vectors), 0, 0, 1, 0},
16624 {&__pyx_n_s_metaclass, __pyx_k_metaclass,
sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
16625 {&__pyx_n_s_minus, __pyx_k_minus,
sizeof(__pyx_k_minus), 0, 0, 1, 1},
16626 {&__pyx_n_s_model, __pyx_k_model,
sizeof(__pyx_k_model), 0, 0, 1, 1},
16627 {&__pyx_n_s_module, __pyx_k_module,
sizeof(__pyx_k_module), 0, 0, 1, 1},
16628 {&__pyx_n_s_mpi4py, __pyx_k_mpi4py,
sizeof(__pyx_k_mpi4py), 0, 0, 1, 1},
16629 {&__pyx_n_s_n, __pyx_k_n,
sizeof(__pyx_k_n), 0, 0, 1, 1},
16630 {&__pyx_n_s_nElements_global, __pyx_k_nElements_global,
sizeof(__pyx_k_nElements_global), 0, 0, 1, 1},
16631 {&__pyx_n_s_nFrames, __pyx_k_nFrames,
sizeof(__pyx_k_nFrames), 0, 0, 1, 1},
16632 {&__pyx_n_s_nMinus, __pyx_k_nMinus,
sizeof(__pyx_k_nMinus), 0, 0, 1, 1},
16633 {&__pyx_n_s_nN_start, __pyx_k_nN_start,
sizeof(__pyx_k_nN_start), 0, 0, 1, 1},
16634 {&__pyx_n_s_nPlus, __pyx_k_nPlus,
sizeof(__pyx_k_nPlus), 0, 0, 1, 1},
16635 {&__pyx_n_s_nZeros, __pyx_k_nZeros,
sizeof(__pyx_k_nZeros), 0, 0, 1, 1},
16636 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
16637 {&__pyx_n_s_namedtuple, __pyx_k_namedtuple,
sizeof(__pyx_k_namedtuple), 0, 0, 1, 1},
16638 {&__pyx_n_s_next_output, __pyx_k_next_output,
sizeof(__pyx_k_next_output), 0, 0, 1, 1},
16639 {&__pyx_n_s_ni, __pyx_k_ni,
sizeof(__pyx_k_ni), 0, 0, 1, 1},
16640 {&__pyx_n_s_nll, __pyx_k_nll,
sizeof(__pyx_k_nll), 0, 0, 1, 1},
16641 {&__pyx_n_s_nll_x, __pyx_k_nll_x,
sizeof(__pyx_k_nll_x), 0, 0, 1, 1},
16642 {&__pyx_n_s_nll_y, __pyx_k_nll_y,
sizeof(__pyx_k_nll_y), 0, 0, 1, 1},
16643 {&__pyx_n_s_nll_z, __pyx_k_nll_z,
sizeof(__pyx_k_nll_z), 0, 0, 1, 1},
16644 {&__pyx_n_s_nodeArray, __pyx_k_nodeArray,
sizeof(__pyx_k_nodeArray), 0, 0, 1, 1},
16645 {&__pyx_n_s_nodes, __pyx_k_nodes,
sizeof(__pyx_k_nodes), 0, 0, 1, 1},
16646 {&__pyx_kp_s_nodesSpatial_Domain, __pyx_k_nodesSpatial_Domain,
sizeof(__pyx_k_nodesSpatial_Domain), 0, 0, 1, 0},
16647 {&__pyx_n_s_norm, __pyx_k_norm,
sizeof(__pyx_k_norm), 0, 0, 1, 1},
16648 {&__pyx_n_s_normal, __pyx_k_normal,
sizeof(__pyx_k_normal), 0, 0, 1, 1},
16649 {&__pyx_n_s_normal_indices, __pyx_k_normal_indices,
sizeof(__pyx_k_normal_indices), 0, 0, 1, 1},
16650 {&__pyx_kp_s_normal_indices_2, __pyx_k_normal_indices_2,
sizeof(__pyx_k_normal_indices_2), 0, 0, 1, 0},
16651 {&__pyx_kp_s_normal_vectors, __pyx_k_normal_vectors,
sizeof(__pyx_k_normal_vectors), 0, 0, 1, 0},
16652 {&__pyx_n_s_normals, __pyx_k_normals,
sizeof(__pyx_k_normals), 0, 0, 1, 1},
16653 {&__pyx_n_s_np, __pyx_k_np,
sizeof(__pyx_k_np), 0, 0, 1, 1},
16654 {&__pyx_n_s_num_owned_elements, __pyx_k_num_owned_elements,
sizeof(__pyx_k_num_owned_elements), 0, 0, 1, 1},
16655 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
16656 {&__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},
16657 {&__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},
16658 {&__pyx_n_s_numpy_linalg, __pyx_k_numpy_linalg,
sizeof(__pyx_k_numpy_linalg), 0, 0, 1, 1},
16659 {&__pyx_kp_s_object_difference_box_nll_x_nll, __pyx_k_object_difference_box_nll_x_nll,
sizeof(__pyx_k_object_difference_box_nll_x_nll), 0, 0, 1, 0},
16660 {&__pyx_kp_s_object_difference_box_nll_x_nll_2, __pyx_k_object_difference_box_nll_x_nll_2,
sizeof(__pyx_k_object_difference_box_nll_x_nll_2), 0, 0, 1, 0},
16661 {&__pyx_kp_s_only_implemented_for_0_isosurfac, __pyx_k_only_implemented_for_0_isosurfac,
sizeof(__pyx_k_only_implemented_for_0_isosurfac), 0, 0, 1, 0},
16662 {&__pyx_n_s_open, __pyx_k_open,
sizeof(__pyx_k_open), 0, 0, 1, 1},
16663 {&__pyx_n_s_os, __pyx_k_os,
sizeof(__pyx_k_os), 0, 0, 1, 1},
16664 {&__pyx_n_s_path, __pyx_k_path,
sizeof(__pyx_k_path), 0, 0, 1, 1},
16665 {&__pyx_n_s_petsc4py, __pyx_k_petsc4py,
sizeof(__pyx_k_petsc4py), 0, 0, 1, 1},
16666 {&__pyx_n_s_phi, __pyx_k_phi,
sizeof(__pyx_k_phi), 0, 0, 1, 1},
16667 {&__pyx_n_s_plus, __pyx_k_plus,
sizeof(__pyx_k_plus), 0, 0, 1, 1},
16668 {&__pyx_n_s_pov, __pyx_k_pov,
sizeof(__pyx_k_pov), 0, 0, 1, 1},
16669 {&__pyx_n_s_povScene, __pyx_k_povScene,
sizeof(__pyx_k_povScene), 0, 0, 1, 1},
16670 {&__pyx_n_s_povSceneTemplate, __pyx_k_povSceneTemplate,
sizeof(__pyx_k_povSceneTemplate), 0, 0, 1, 1},
16671 {&__pyx_n_s_pov_filename, __pyx_k_pov_filename,
sizeof(__pyx_k_pov_filename), 0, 0, 1, 1},
16672 {&__pyx_n_s_prepare, __pyx_k_prepare,
sizeof(__pyx_k_prepare), 0, 0, 1, 1},
16673 {&__pyx_n_s_print, __pyx_k_print,
sizeof(__pyx_k_print), 0, 0, 1, 1},
16674 {&__pyx_n_s_product, __pyx_k_product,
sizeof(__pyx_k_product), 0, 0, 1, 1},
16675 {&__pyx_n_s_proteus, __pyx_k_proteus,
sizeof(__pyx_k_proteus), 0, 0, 1, 1},
16676 {&__pyx_kp_s_proteus_Isosurface_pyx, __pyx_k_proteus_Isosurface_pyx,
sizeof(__pyx_k_proteus_Isosurface_pyx), 0, 0, 1, 0},
16677 {&__pyx_kp_s_proteus_inc, __pyx_k_proteus_inc,
sizeof(__pyx_k_proteus_inc), 0, 0, 1, 0},
16678 {&__pyx_n_s_qualname, __pyx_k_qualname,
sizeof(__pyx_k_qualname), 0, 0, 1, 1},
16679 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
16680 {&__pyx_n_s_rank, __pyx_k_rank,
sizeof(__pyx_k_rank), 0, 0, 1, 1},
16681 {&__pyx_n_s_s, __pyx_k_s,
sizeof(__pyx_k_s), 0, 0, 1, 1},
16682 {&__pyx_n_s_sampleRate, __pyx_k_sampleRate,
sizeof(__pyx_k_sampleRate), 0, 0, 1, 1},
16683 {&__pyx_n_s_self, __pyx_k_self,
sizeof(__pyx_k_self), 0, 0, 1, 1},
16684 {&__pyx_n_s_send, __pyx_k_send,
sizeof(__pyx_k_send), 0, 0, 1, 1},
16685 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
16686 {&__pyx_n_s_sky_z, __pyx_k_sky_z,
sizeof(__pyx_k_sky_z), 0, 0, 1, 1},
16687 {&__pyx_n_s_step, __pyx_k_step,
sizeof(__pyx_k_step), 0, 0, 1, 1},
16688 {&__pyx_n_s_string, __pyx_k_string,
sizeof(__pyx_k_string), 0, 0, 1, 1},
16689 {&__pyx_n_s_substitute, __pyx_k_substitute,
sizeof(__pyx_k_substitute), 0, 0, 1, 1},
16690 {&__pyx_n_s_tLast, __pyx_k_tLast,
sizeof(__pyx_k_tLast), 0, 0, 1, 1},
16691 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
16692 {&__pyx_n_s_throw, __pyx_k_throw,
sizeof(__pyx_k_throw), 0, 0, 1, 1},
16693 {&__pyx_n_s_time, __pyx_k_time,
sizeof(__pyx_k_time), 0, 0, 1, 1},
16694 {&__pyx_n_s_timeIntegration, __pyx_k_timeIntegration,
sizeof(__pyx_k_timeIntegration), 0, 0, 1, 1},
16695 {&__pyx_n_s_triangulateIsosurface, __pyx_k_triangulateIsosurface,
sizeof(__pyx_k_triangulateIsosurface), 0, 0, 1, 1},
16696 {&__pyx_n_s_u, __pyx_k_u,
sizeof(__pyx_k_u), 0, 0, 1, 1},
16697 {&__pyx_kp_s_union_of_meshes_difference_of_p, __pyx_k_union_of_meshes_difference_of_p,
sizeof(__pyx_k_union_of_meshes_difference_of_p), 0, 0, 1, 0},
16698 {&__pyx_n_s_v, __pyx_k_v,
sizeof(__pyx_k_v), 0, 0, 1, 1},
16699 {&__pyx_n_s_value, __pyx_k_value,
sizeof(__pyx_k_value), 0, 0, 1, 1},
16700 {&__pyx_n_s_values, __pyx_k_values,
sizeof(__pyx_k_values), 0, 0, 1, 1},
16701 {&__pyx_n_s_variableNames, __pyx_k_variableNames,
sizeof(__pyx_k_variableNames), 0, 0, 1, 1},
16702 {&__pyx_kp_s_version_3_7_include_proteus_inc, __pyx_k_version_3_7_include_proteus_inc,
sizeof(__pyx_k_version_3_7_include_proteus_inc), 0, 0, 1, 0},
16703 {&__pyx_n_s_w, __pyx_k_w,
sizeof(__pyx_k_w), 0, 0, 1, 1},
16704 {&__pyx_n_s_wall_y, __pyx_k_wall_y,
sizeof(__pyx_k_wall_y), 0, 0, 1, 1},
16705 {&__pyx_n_s_write, __pyx_k_write,
sizeof(__pyx_k_write), 0, 0, 1, 1},
16706 {&__pyx_n_s_writeBoundary, __pyx_k_writeBoundary,
sizeof(__pyx_k_writeBoundary), 0, 0, 1, 1},
16707 {&__pyx_n_s_writeIsosurfaceMesh, __pyx_k_writeIsosurfaceMesh,
sizeof(__pyx_k_writeIsosurfaceMesh), 0, 0, 1, 1},
16708 {&__pyx_n_s_writeIsosurfaceMesh_h5, __pyx_k_writeIsosurfaceMesh_h5,
sizeof(__pyx_k_writeIsosurfaceMesh_h5), 0, 0, 1, 1},
16709 {&__pyx_n_s_writeIsosurfaceMesh_povray, __pyx_k_writeIsosurfaceMesh_povray,
sizeof(__pyx_k_writeIsosurfaceMesh_povray), 0, 0, 1, 1},
16710 {&__pyx_n_s_writeSceneHeader, __pyx_k_writeSceneHeader,
sizeof(__pyx_k_writeSceneHeader), 0, 0, 1, 1},
16711 {&__pyx_n_s_x, __pyx_k_x,
sizeof(__pyx_k_x), 0, 0, 1, 1},
16712 {&__pyx_n_s_zeros, __pyx_k_zeros,
sizeof(__pyx_k_zeros), 0, 0, 1, 1},
16713 {&__pyx_n_s_zip, __pyx_k_zip,
sizeof(__pyx_k_zip), 0, 0, 1, 1},
16714 {0, 0, 0, 0, 0, 0, 0}
16716 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
16717 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(0, 125, __pyx_L1_error)
16718 __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError);
if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 170, __pyx_L1_error)
16719 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(0, 172, __pyx_L1_error)
16720 __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open);
if (!__pyx_builtin_open) __PYX_ERR(0, 391, __pyx_L1_error)
16721 __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip);
if (!__pyx_builtin_zip) __PYX_ERR(0, 560, __pyx_L1_error)
16722 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(1, 945, __pyx_L1_error)
16728 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
16729 __Pyx_RefNannyDeclarations
16730 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
16739 __pyx_tuple_ = PyTuple_Pack(1, __pyx_int_3);
if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 29, __pyx_L1_error)
16740 __Pyx_GOTREF(__pyx_tuple_);
16741 __Pyx_GIVEREF(__pyx_tuple_);
16742 __pyx_tuple__2 = PyTuple_Pack(2, __pyx_tuple_, __pyx_n_s_d);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 29, __pyx_L1_error)
16743 __Pyx_GOTREF(__pyx_tuple__2);
16744 __Pyx_GIVEREF(__pyx_tuple__2);
16753 __pyx_slice__3 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__3)) __PYX_ERR(0, 143, __pyx_L1_error)
16754 __Pyx_GOTREF(__pyx_slice__3);
16755 __Pyx_GIVEREF(__pyx_slice__3);
16764 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Only_zero_isocontour_extraction);
if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 170, __pyx_L1_error)
16765 __Pyx_GOTREF(__pyx_tuple__5);
16766 __Pyx_GIVEREF(__pyx_tuple__5);
16775 __pyx_tuple__7 = PyTuple_Pack(2, __pyx_kp_s_proteus_inc, __pyx_n_s_w);
if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 575, __pyx_L1_error)
16776 __Pyx_GOTREF(__pyx_tuple__7);
16777 __Pyx_GIVEREF(__pyx_tuple__7);
16786 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to);
if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 945, __pyx_L1_error)
16787 __Pyx_GOTREF(__pyx_tuple__8);
16788 __Pyx_GIVEREF(__pyx_tuple__8);
16797 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 951, __pyx_L1_error)
16798 __Pyx_GOTREF(__pyx_tuple__9);
16799 __Pyx_GIVEREF(__pyx_tuple__9);
16808 __pyx_tuple__11 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_isosurfaces, __pyx_n_s_domain, __pyx_n_s_activeTime, __pyx_n_s_sampleRate, __pyx_n_s_format, __pyx_n_s_writeBoundary, __pyx_n_s_f, __pyx_n_s_values, __pyx_n_s_v);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 54, __pyx_L1_error)
16809 __Pyx_GOTREF(__pyx_tuple__11);
16810 __Pyx_GIVEREF(__pyx_tuple__11);
16811 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(7, 0, 10, 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_Isosurface_pyx, __pyx_n_s_init, 54, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 54, __pyx_L1_error)
16812 __pyx_tuple__13 = PyTuple_Pack(4, ((PyObject *)Py_None), ((PyObject *)__pyx_int_0), ((PyObject*)__pyx_n_s_pov), ((PyObject *)Py_True));
if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 54, __pyx_L1_error)
16813 __Pyx_GOTREF(__pyx_tuple__13);
16814 __Pyx_GIVEREF(__pyx_tuple__13);
16823 __pyx_tuple__14 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_model, __pyx_n_s_ar, __pyx_n_s_fine_grid, __pyx_n_s_genexpr, __pyx_n_s_genexpr);
if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 108, __pyx_L1_error)
16824 __Pyx_GOTREF(__pyx_tuple__14);
16825 __Pyx_GIVEREF(__pyx_tuple__14);
16826 __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 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_Isosurface_pyx, __pyx_n_s_attachModel, 108, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 108, __pyx_L1_error)
16835 __pyx_tuple__16 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_h5, __pyx_n_s_step, __pyx_n_s_cam, __pyx_n_s_namedtuple, __pyx_n_s_FemField, __pyx_n_s_field_i, __pyx_n_s_field, __pyx_n_s_isosurface);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 135, __pyx_L1_error)
16836 __Pyx_GOTREF(__pyx_tuple__16);
16837 __Pyx_GIVEREF(__pyx_tuple__16);
16838 __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 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_Isosurface_pyx, __pyx_n_s_attachHDF5, 135, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 135, __pyx_L1_error)
16839 __pyx_tuple__18 = PyTuple_Pack(1, ((PyObject *)Py_None));
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 135, __pyx_L1_error)
16840 __Pyx_GOTREF(__pyx_tuple__18);
16841 __Pyx_GIVEREF(__pyx_tuple__18);
16850 __pyx_tuple__19 = PyTuple_Pack(24, __pyx_n_s_self, __pyx_n_s_field, __pyx_n_s_value, __pyx_n_s_eN, __pyx_n_s_i, __pyx_n_s_J, __pyx_n_s_I, __pyx_n_s_nMinus, __pyx_n_s_nPlus, __pyx_n_s_nZeros, __pyx_n_s_nN_start, __pyx_n_s_eps, __pyx_n_s_s, __pyx_n_s_x, __pyx_n_s_normal, __pyx_n_s_nodes, __pyx_n_s_elements, __pyx_n_s_normals, __pyx_n_s_normal_indices, __pyx_n_s_phi, __pyx_n_s_plus, __pyx_n_s_minus, __pyx_n_s_zeros, __pyx_n_s_j);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 158, __pyx_L1_error)
16851 __Pyx_GOTREF(__pyx_tuple__19);
16852 __Pyx_GIVEREF(__pyx_tuple__19);
16853 __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(3, 0, 24, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_Isosurface_pyx, __pyx_n_s_triangulateIsosurface, 158, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 158, __pyx_L1_error)
16862 __pyx_tuple__21 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_field, __pyx_n_s_value, __pyx_n_s_frame);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 348, __pyx_L1_error)
16863 __Pyx_GOTREF(__pyx_tuple__21);
16864 __Pyx_GIVEREF(__pyx_tuple__21);
16865 __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_Isosurface_pyx, __pyx_n_s_writeIsosurfaceMesh, 348, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 348, __pyx_L1_error)
16874 __pyx_tuple__23 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_field, __pyx_n_s_value, __pyx_n_s_frame, __pyx_n_s_h5py, __pyx_n_s_nodes, __pyx_n_s_elements, __pyx_n_s_normals, __pyx_n_s_normal_indices, __pyx_n_s_filename, __pyx_n_s_f, __pyx_n_s_dset);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 359, __pyx_L1_error)
16875 __Pyx_GOTREF(__pyx_tuple__23);
16876 __Pyx_GIVEREF(__pyx_tuple__23);
16877 __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_Isosurface_pyx, __pyx_n_s_writeIsosurfaceMesh_h5, 359, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 359, __pyx_L1_error)
16886 __pyx_tuple__25 = PyTuple_Pack(20, __pyx_n_s_self, __pyx_n_s_field, __pyx_n_s_value, __pyx_n_s_frame, __pyx_n_s_Template, __pyx_n_s_nodes, __pyx_n_s_elements, __pyx_n_s_normals, __pyx_n_s_normal_indices, __pyx_n_s_pov_filename, __pyx_n_s_pov, __pyx_n_s_dx, __pyx_n_s_nll, __pyx_n_s_fur, __pyx_n_s_povScene, __pyx_n_s_n, __pyx_n_s_ebN, __pyx_n_s_bnt, __pyx_n_s_e, __pyx_n_s_ni);
if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 376, __pyx_L1_error)
16887 __Pyx_GOTREF(__pyx_tuple__25);
16888 __Pyx_GIVEREF(__pyx_tuple__25);
16889 __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(4, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_Isosurface_pyx, __pyx_n_s_writeIsosurfaceMesh_povray, 376, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 376, __pyx_L1_error)
16898 __pyx_tuple__27 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_checkTime, __pyx_n_s_Template, __pyx_n_s_time, __pyx_n_s_field, __pyx_n_s_values, __pyx_n_s_v);
if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 527, __pyx_L1_error)
16899 __Pyx_GOTREF(__pyx_tuple__27);
16900 __Pyx_GIVEREF(__pyx_tuple__27);
16901 __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_Isosurface_pyx, __pyx_n_s_calculate, 527, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 527, __pyx_L1_error)
16902 __pyx_tuple__29 = PyTuple_Pack(1, ((PyObject *)Py_True));
if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 527, __pyx_L1_error)
16903 __Pyx_GOTREF(__pyx_tuple__29);
16904 __Pyx_GIVEREF(__pyx_tuple__29);
16913 __pyx_tuple__30 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_cam, __pyx_n_s_Template, __pyx_n_s_look_at, __pyx_n_s_light, __pyx_n_s_light_dx, __pyx_n_s_light_dy, __pyx_n_s_floor_z, __pyx_n_s_wall_y, __pyx_n_s_sky_z, __pyx_n_s_pov, __pyx_n_s_povSceneTemplate, __pyx_n_s_x, __pyx_n_s_L);
if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 553, __pyx_L1_error)
16914 __Pyx_GOTREF(__pyx_tuple__30);
16915 __Pyx_GIVEREF(__pyx_tuple__30);
16916 __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(2, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_Isosurface_pyx, __pyx_n_s_writeSceneHeader, 553, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 553, __pyx_L1_error)
16917 __pyx_tuple__32 = PyTuple_Pack(1, ((PyObject *)Py_None));
if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 553, __pyx_L1_error)
16918 __Pyx_GOTREF(__pyx_tuple__32);
16919 __Pyx_GIVEREF(__pyx_tuple__32);
16920 __Pyx_RefNannyFinishContext();
16923 __Pyx_RefNannyFinishContext();
16927 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
16928 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
16929 __pyx_float_0_0 = PyFloat_FromDouble(0.0);
if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
16930 __pyx_float_0_5 = PyFloat_FromDouble(0.5);
if (unlikely(!__pyx_float_0_5)) __PYX_ERR(0, 1, __pyx_L1_error)
16931 __pyx_float_2_0 = PyFloat_FromDouble(2.0);
if (unlikely(!__pyx_float_2_0)) __PYX_ERR(0, 1, __pyx_L1_error)
16932 __pyx_float_0_01 = PyFloat_FromDouble(0.01);
if (unlikely(!__pyx_float_0_01)) __PYX_ERR(0, 1, __pyx_L1_error)
16933 __pyx_float_0_02 = PyFloat_FromDouble(0.02);
if (unlikely(!__pyx_float_0_02)) __PYX_ERR(0, 1, __pyx_L1_error)
16934 __pyx_float_0_85 = PyFloat_FromDouble(0.85);
if (unlikely(!__pyx_float_0_85)) __PYX_ERR(0, 1, __pyx_L1_error)
16935 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
16936 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
16937 __pyx_int_2 = PyInt_FromLong(2);
if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
16938 __pyx_int_3 = PyInt_FromLong(3);
if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
16939 __pyx_int_4 = PyInt_FromLong(4);
if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
16940 __pyx_int_5 = PyInt_FromLong(5);
if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error)
16941 __pyx_int_10 = PyInt_FromLong(10);
if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error)
16947 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
16948 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
16949 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
16950 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
16951 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
16952 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
16953 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
16955 static int __Pyx_modinit_global_init_code(
void) {
16956 __Pyx_RefNannyDeclarations
16957 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
16959 __Pyx_RefNannyFinishContext();
16963 static int __Pyx_modinit_variable_export_code(
void) {
16964 __Pyx_RefNannyDeclarations
16965 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
16967 __Pyx_RefNannyFinishContext();
16971 static int __Pyx_modinit_function_export_code(
void) {
16972 __Pyx_RefNannyDeclarations
16973 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
16975 __Pyx_RefNannyFinishContext();
16979 static int __Pyx_modinit_type_init_code(
void) {
16980 __Pyx_RefNannyDeclarations
16981 int __pyx_lineno = 0;
16982 const char *__pyx_filename = NULL;
16983 int __pyx_clineno = 0;
16984 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
16986 if (PyType_Ready(&__pyx_type_10Isosurface___pyx_scope_struct__attachModel) < 0) __PYX_ERR(0, 108, __pyx_L1_error)
16987 #if PY_VERSION_HEX < 0x030800B1
16988 __pyx_type_10Isosurface___pyx_scope_struct__attachModel.tp_print = 0;
16990 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10Isosurface___pyx_scope_struct__attachModel.tp_dictoffset && __pyx_type_10Isosurface___pyx_scope_struct__attachModel.tp_getattro == PyObject_GenericGetAttr)) {
16991 __pyx_type_10Isosurface___pyx_scope_struct__attachModel.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
16993 __pyx_ptype_10Isosurface___pyx_scope_struct__attachModel = &__pyx_type_10Isosurface___pyx_scope_struct__attachModel;
16994 if (PyType_Ready(&__pyx_type_10Isosurface___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 125, __pyx_L1_error)
16995 #if PY_VERSION_HEX < 0x030800B1
16996 __pyx_type_10Isosurface___pyx_scope_struct_1_genexpr.tp_print = 0;
16998 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10Isosurface___pyx_scope_struct_1_genexpr.tp_dictoffset && __pyx_type_10Isosurface___pyx_scope_struct_1_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
16999 __pyx_type_10Isosurface___pyx_scope_struct_1_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
17001 __pyx_ptype_10Isosurface___pyx_scope_struct_1_genexpr = &__pyx_type_10Isosurface___pyx_scope_struct_1_genexpr;
17002 __Pyx_RefNannyFinishContext();
17005 __Pyx_RefNannyFinishContext();
17009 static int __Pyx_modinit_type_import_code(
void) {
17010 __Pyx_RefNannyDeclarations
17011 PyObject *__pyx_t_1 = NULL;
17012 int __pyx_lineno = 0;
17013 const char *__pyx_filename = NULL;
17014 int __pyx_clineno = 0;
17015 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
17017 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
17018 __Pyx_GOTREF(__pyx_t_1);
17019 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
17020 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
17021 sizeof(PyTypeObject),
17023 sizeof(PyHeapTypeObject),
17025 __Pyx_ImportType_CheckSize_Warn);
17026 if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
17027 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17028 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 200, __pyx_L1_error)
17029 __Pyx_GOTREF(__pyx_t_1);
17030 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1,
"numpy",
"dtype",
sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
17031 if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 200, __pyx_L1_error)
17032 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flatiter",
sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
17033 if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 223, __pyx_L1_error)
17034 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1,
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
17035 if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 227, __pyx_L1_error)
17036 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ndarray",
sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
17037 if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 239, __pyx_L1_error)
17038 __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1,
"numpy",
"generic",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
17039 if (!__pyx_ptype_5numpy_generic) __PYX_ERR(1, 771, __pyx_L1_error)
17040 __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1,
"numpy",
"number",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
17041 if (!__pyx_ptype_5numpy_number) __PYX_ERR(1, 773, __pyx_L1_error)
17042 __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1,
"numpy",
"integer",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
17043 if (!__pyx_ptype_5numpy_integer) __PYX_ERR(1, 775, __pyx_L1_error)
17044 __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"signedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
17045 if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 777, __pyx_L1_error)
17046 __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1,
"numpy",
"unsignedinteger",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
17047 if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 779, __pyx_L1_error)
17048 __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1,
"numpy",
"inexact",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
17049 if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 781, __pyx_L1_error)
17050 __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"floating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
17051 if (!__pyx_ptype_5numpy_floating) __PYX_ERR(1, 783, __pyx_L1_error)
17052 __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1,
"numpy",
"complexfloating",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
17053 if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 785, __pyx_L1_error)
17054 __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flexible",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
17055 if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 787, __pyx_L1_error)
17056 __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1,
"numpy",
"character",
sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
17057 if (!__pyx_ptype_5numpy_character) __PYX_ERR(1, 789, __pyx_L1_error)
17058 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ufunc",
sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
17059 if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 827, __pyx_L1_error)
17060 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17061 __Pyx_RefNannyFinishContext();
17064 __Pyx_XDECREF(__pyx_t_1);
17065 __Pyx_RefNannyFinishContext();
17069 static int __Pyx_modinit_variable_import_code(
void) {
17070 __Pyx_RefNannyDeclarations
17071 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
17073 __Pyx_RefNannyFinishContext();
17077 static int __Pyx_modinit_function_import_code(
void) {
17078 __Pyx_RefNannyDeclarations
17079 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
17081 __Pyx_RefNannyFinishContext();
17086 #ifndef CYTHON_NO_PYINIT_EXPORT
17087 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
17088 #elif PY_MAJOR_VERSION < 3
17090 #define __Pyx_PyMODINIT_FUNC extern "C" void
17092 #define __Pyx_PyMODINIT_FUNC void
17096 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
17098 #define __Pyx_PyMODINIT_FUNC PyObject *
17103 #if PY_MAJOR_VERSION < 3
17104 __Pyx_PyMODINIT_FUNC initIsosurface(
void) CYTHON_SMALL_CODE;
17105 __Pyx_PyMODINIT_FUNC initIsosurface(
void)
17107 __Pyx_PyMODINIT_FUNC PyInit_Isosurface(
void) CYTHON_SMALL_CODE;
17108 __Pyx_PyMODINIT_FUNC PyInit_Isosurface(
void)
17109 #if CYTHON_PEP489_MULTI_PHASE_INIT
17111 return PyModuleDef_Init(&__pyx_moduledef);
17113 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
17114 #if PY_VERSION_HEX >= 0x030700A1
17115 static PY_INT64_T main_interpreter_id = -1;
17116 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
17117 if (main_interpreter_id == -1) {
17118 main_interpreter_id = current_id;
17119 return (unlikely(current_id == -1)) ? -1 : 0;
17120 }
else if (unlikely(main_interpreter_id != current_id))
17122 static PyInterpreterState *main_interpreter = NULL;
17123 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
17124 if (!main_interpreter) {
17125 main_interpreter = current_interpreter;
17126 }
else if (unlikely(main_interpreter != current_interpreter))
17131 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
17136 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) {
17137 PyObject *value = PyObject_GetAttrString(spec, from_name);
17139 if (likely(value)) {
17140 if (allow_none || value != Py_None) {
17141 result = PyDict_SetItemString(moddict, to_name, value);
17144 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
17151 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
17152 PyObject *module = NULL, *moddict, *modname;
17153 if (__Pyx_check_single_interpreter())
17156 return __Pyx_NewRef(__pyx_m);
17157 modname = PyObject_GetAttrString(spec,
"name");
17158 if (unlikely(!modname))
goto bad;
17159 module = PyModule_NewObject(modname);
17160 Py_DECREF(modname);
17161 if (unlikely(!module))
goto bad;
17162 moddict = PyModule_GetDict(module);
17163 if (unlikely(!moddict))
goto bad;
17164 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
17165 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
17166 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
17167 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
17170 Py_XDECREF(module);
17175 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_Isosurface(PyObject *__pyx_pyinit_module)
17179 PyObject *__pyx_t_1 = NULL;
17180 PyObject *__pyx_t_2 = NULL;
17181 PyObject *__pyx_t_3 = NULL;
17182 PyObject *__pyx_t_4 = NULL;
17183 int __pyx_lineno = 0;
17184 const char *__pyx_filename = NULL;
17185 int __pyx_clineno = 0;
17186 __Pyx_RefNannyDeclarations
17187 #if CYTHON_PEP489_MULTI_PHASE_INIT
17189 if (__pyx_m == __pyx_pyinit_module)
return 0;
17190 PyErr_SetString(PyExc_RuntimeError,
"Module 'Isosurface' has already been imported. Re-initialisation is not supported.");
17193 #elif PY_MAJOR_VERSION >= 3
17194 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
17196 #if CYTHON_REFNANNY
17197 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
17198 if (!__Pyx_RefNanny) {
17200 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
17201 if (!__Pyx_RefNanny)
17202 Py_FatalError(
"failed to import 'refnanny' module");
17205 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_Isosurface(void)", 0);
17206 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17207 #ifdef __Pxy_PyFrame_Initialize_Offsets
17208 __Pxy_PyFrame_Initialize_Offsets();
17210 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
17211 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
17212 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
17213 #ifdef __Pyx_CyFunction_USED
17214 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17216 #ifdef __Pyx_FusedFunction_USED
17217 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17219 #ifdef __Pyx_Coroutine_USED
17220 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17222 #ifdef __Pyx_Generator_USED
17223 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17225 #ifdef __Pyx_AsyncGen_USED
17226 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17228 #ifdef __Pyx_StopAsyncIteration_USED
17229 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17233 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
17234 PyEval_InitThreads();
17237 #if CYTHON_PEP489_MULTI_PHASE_INIT
17238 __pyx_m = __pyx_pyinit_module;
17239 Py_INCREF(__pyx_m);
17241 #if PY_MAJOR_VERSION < 3
17242 __pyx_m = Py_InitModule4(
"Isosurface", __pyx_methods, __pyx_k_AuxiliaryVariables_subclasses_f, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
17244 __pyx_m = PyModule_Create(&__pyx_moduledef);
17246 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
17248 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
17249 Py_INCREF(__pyx_d);
17250 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
17251 Py_INCREF(__pyx_b);
17252 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
17253 Py_INCREF(__pyx_cython_runtime);
17254 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
17256 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17257 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
17258 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17260 if (__pyx_module_is_main_Isosurface) {
17261 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17263 #if PY_MAJOR_VERSION >= 3
17265 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
17266 if (!PyDict_GetItemString(modules,
"Isosurface")) {
17267 if (unlikely(PyDict_SetItemString(modules,
"Isosurface", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
17272 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17274 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17276 (void)__Pyx_modinit_global_init_code();
17277 (void)__Pyx_modinit_variable_export_code();
17278 (void)__Pyx_modinit_function_export_code();
17279 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
17280 if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
17281 (void)__Pyx_modinit_variable_import_code();
17282 (void)__Pyx_modinit_function_import_code();
17284 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
17285 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17295 __pyx_t_1 = PyList_New(2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
17296 __Pyx_GOTREF(__pyx_t_1);
17297 __Pyx_INCREF(__pyx_n_s_defaultdict);
17298 __Pyx_GIVEREF(__pyx_n_s_defaultdict);
17299 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_defaultdict);
17300 __Pyx_INCREF(__pyx_n_s_OrderedDict);
17301 __Pyx_GIVEREF(__pyx_n_s_OrderedDict);
17302 PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_OrderedDict);
17303 __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_1, -1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error)
17304 __Pyx_GOTREF(__pyx_t_2);
17305 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17306 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_defaultdict);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
17307 __Pyx_GOTREF(__pyx_t_1);
17308 if (PyDict_SetItem(__pyx_d, __pyx_n_s_defaultdict, __pyx_t_1) < 0) __PYX_ERR(0, 6, __pyx_L1_error)
17309 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17310 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_OrderedDict);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
17311 __Pyx_GOTREF(__pyx_t_1);
17312 if (PyDict_SetItem(__pyx_d, __pyx_n_s_OrderedDict, __pyx_t_1) < 0) __PYX_ERR(0, 6, __pyx_L1_error)
17313 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17314 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17323 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error)
17324 __Pyx_GOTREF(__pyx_t_2);
17325 __Pyx_INCREF(__pyx_n_s_product);
17326 __Pyx_GIVEREF(__pyx_n_s_product);
17327 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_product);
17328 __pyx_t_1 = __Pyx_Import(__pyx_n_s_itertools, __pyx_t_2, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
17329 __Pyx_GOTREF(__pyx_t_1);
17330 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17331 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_product);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error)
17332 __Pyx_GOTREF(__pyx_t_2);
17333 if (PyDict_SetItem(__pyx_d, __pyx_n_s_product, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
17334 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17335 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17344 __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
17345 __Pyx_GOTREF(__pyx_t_1);
17346 if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
17347 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17356 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
17357 __Pyx_GOTREF(__pyx_t_1);
17358 __Pyx_INCREF(__pyx_n_s_MPI);
17359 __Pyx_GIVEREF(__pyx_n_s_MPI);
17360 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_MPI);
17361 __pyx_t_2 = __Pyx_Import(__pyx_n_s_mpi4py, __pyx_t_1, -1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
17362 __Pyx_GOTREF(__pyx_t_2);
17363 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17364 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_MPI);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
17365 __Pyx_GOTREF(__pyx_t_1);
17366 if (PyDict_SetItem(__pyx_d, __pyx_n_s_MPI, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
17367 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17368 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17377 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
17378 __Pyx_GOTREF(__pyx_t_2);
17379 __Pyx_INCREF(__pyx_n_s_PETSc);
17380 __Pyx_GIVEREF(__pyx_n_s_PETSc);
17381 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PETSc);
17382 __pyx_t_1 = __Pyx_Import(__pyx_n_s_petsc4py, __pyx_t_2, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
17383 __Pyx_GOTREF(__pyx_t_1);
17384 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17385 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_PETSc);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
17386 __Pyx_GOTREF(__pyx_t_2);
17387 if (PyDict_SetItem(__pyx_d, __pyx_n_s_PETSc, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
17388 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17389 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17398 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
17399 __Pyx_GOTREF(__pyx_t_1);
17400 if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
17401 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17410 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
17411 __Pyx_GOTREF(__pyx_t_1);
17412 __Pyx_INCREF(__pyx_n_s_norm);
17413 __Pyx_GIVEREF(__pyx_n_s_norm);
17414 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_norm);
17415 __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy_linalg, __pyx_t_1, -1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
17416 __Pyx_GOTREF(__pyx_t_2);
17417 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17418 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_norm);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
17419 __Pyx_GOTREF(__pyx_t_1);
17420 if (PyDict_SetItem(__pyx_d, __pyx_n_s_norm, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
17421 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17422 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17431 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
17432 __Pyx_GOTREF(__pyx_t_2);
17433 __Pyx_INCREF(__pyx_n_s_Comm);
17434 __Pyx_GIVEREF(__pyx_n_s_Comm);
17435 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Comm);
17436 __pyx_t_1 = __Pyx_Import(__pyx_n_s__10, __pyx_t_2, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
17437 __Pyx_GOTREF(__pyx_t_1);
17438 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17439 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Comm);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
17440 __Pyx_GOTREF(__pyx_t_2);
17441 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Comm, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
17442 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17443 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17452 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
17453 __Pyx_GOTREF(__pyx_t_1);
17454 __Pyx_INCREF(__pyx_n_s_AV_base);
17455 __Pyx_GIVEREF(__pyx_n_s_AV_base);
17456 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_AV_base);
17457 __pyx_t_2 = __Pyx_Import(__pyx_n_s_AuxiliaryVariables, __pyx_t_1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
17458 __Pyx_GOTREF(__pyx_t_2);
17459 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17460 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_AV_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
17461 __Pyx_GOTREF(__pyx_t_1);
17462 if (PyDict_SetItem(__pyx_d, __pyx_n_s_AV_base, __pyx_t_1) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
17463 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17464 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17473 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
17474 __Pyx_GOTREF(__pyx_t_2);
17475 __Pyx_INCREF(__pyx_n_s_Profiling);
17476 __Pyx_GIVEREF(__pyx_n_s_Profiling);
17477 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Profiling);
17478 __pyx_t_1 = __Pyx_Import(__pyx_n_s_proteus, __pyx_t_2, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
17479 __Pyx_GOTREF(__pyx_t_1);
17480 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17481 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Profiling);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
17482 __Pyx_GOTREF(__pyx_t_2);
17483 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Profiling, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
17484 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17485 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17494 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
17495 __Pyx_GOTREF(__pyx_t_1);
17496 __Pyx_INCREF(__pyx_n_s_logEvent);
17497 __Pyx_GIVEREF(__pyx_n_s_logEvent);
17498 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_logEvent);
17499 __pyx_t_2 = __Pyx_Import(__pyx_n_s_Profiling, __pyx_t_1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
17500 __Pyx_GOTREF(__pyx_t_2);
17501 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17502 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_logEvent);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
17503 __Pyx_GOTREF(__pyx_t_1);
17504 if (PyDict_SetItem(__pyx_d, __pyx_n_s_log, __pyx_t_1) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
17505 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17506 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17515 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_AV_base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error)
17516 __Pyx_GOTREF(__pyx_t_2);
17517 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error)
17518 __Pyx_GOTREF(__pyx_t_1);
17519 __Pyx_GIVEREF(__pyx_t_2);
17520 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
17522 __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error)
17523 __Pyx_GOTREF(__pyx_t_2);
17524 __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Isosurface, __pyx_n_s_Isosurface, (PyObject *) NULL, __pyx_n_s_Isosurface, __pyx_kp_s_Extract_isosurfaces);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error)
17525 __Pyx_GOTREF(__pyx_t_3);
17534 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10Isosurface_10Isosurface_1__init__, 0, __pyx_n_s_Isosurface___init, NULL, __pyx_n_s_Isosurface, __pyx_d, ((PyObject *)__pyx_codeobj__12));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L1_error)
17535 __Pyx_GOTREF(__pyx_t_4);
17536 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__13);
17537 if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 54, __pyx_L1_error)
17538 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17547 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10Isosurface_10Isosurface_3attachModel, 0, __pyx_n_s_Isosurface_attachModel, NULL, __pyx_n_s_Isosurface, __pyx_d, ((PyObject *)__pyx_codeobj__15));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 108, __pyx_L1_error)
17548 __Pyx_GOTREF(__pyx_t_4);
17549 if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_attachModel, __pyx_t_4) < 0) __PYX_ERR(0, 108, __pyx_L1_error)
17550 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17559 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10Isosurface_10Isosurface_5attachHDF5, 0, __pyx_n_s_Isosurface_attachHDF5, NULL, __pyx_n_s_Isosurface, __pyx_d, ((PyObject *)__pyx_codeobj__17));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error)
17560 __Pyx_GOTREF(__pyx_t_4);
17561 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__18);
17562 if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_attachHDF5, __pyx_t_4) < 0) __PYX_ERR(0, 135, __pyx_L1_error)
17563 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17572 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10Isosurface_10Isosurface_7triangulateIsosurface, 0, __pyx_n_s_Isosurface_triangulateIsosurface, NULL, __pyx_n_s_Isosurface, __pyx_d, ((PyObject *)__pyx_codeobj__20));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
17573 __Pyx_GOTREF(__pyx_t_4);
17574 if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_triangulateIsosurface, __pyx_t_4) < 0) __PYX_ERR(0, 158, __pyx_L1_error)
17575 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17584 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10Isosurface_10Isosurface_9writeIsosurfaceMesh, 0, __pyx_n_s_Isosurface_writeIsosurfaceMesh, NULL, __pyx_n_s_Isosurface, __pyx_d, ((PyObject *)__pyx_codeobj__22));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 348, __pyx_L1_error)
17585 __Pyx_GOTREF(__pyx_t_4);
17586 if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_writeIsosurfaceMesh, __pyx_t_4) < 0) __PYX_ERR(0, 348, __pyx_L1_error)
17587 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17596 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10Isosurface_10Isosurface_11writeIsosurfaceMesh_h5, 0, __pyx_n_s_Isosurface_writeIsosurfaceMesh_h, NULL, __pyx_n_s_Isosurface, __pyx_d, ((PyObject *)__pyx_codeobj__24));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __pyx_L1_error)
17597 __Pyx_GOTREF(__pyx_t_4);
17598 if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_writeIsosurfaceMesh_h5, __pyx_t_4) < 0) __PYX_ERR(0, 359, __pyx_L1_error)
17599 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17608 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10Isosurface_10Isosurface_13writeIsosurfaceMesh_povray, 0, __pyx_n_s_Isosurface_writeIsosurfaceMesh_p, NULL, __pyx_n_s_Isosurface, __pyx_d, ((PyObject *)__pyx_codeobj__26));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 376, __pyx_L1_error)
17609 __Pyx_GOTREF(__pyx_t_4);
17610 if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_writeIsosurfaceMesh_povray, __pyx_t_4) < 0) __PYX_ERR(0, 376, __pyx_L1_error)
17611 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17620 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10Isosurface_10Isosurface_15calculate, 0, __pyx_n_s_Isosurface_calculate, NULL, __pyx_n_s_Isosurface, __pyx_d, ((PyObject *)__pyx_codeobj__28));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error)
17621 __Pyx_GOTREF(__pyx_t_4);
17622 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__29);
17623 if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_calculate, __pyx_t_4) < 0) __PYX_ERR(0, 527, __pyx_L1_error)
17624 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17633 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10Isosurface_10Isosurface_17writeSceneHeader, 0, __pyx_n_s_Isosurface_writeSceneHeader, NULL, __pyx_n_s_Isosurface, __pyx_d, ((PyObject *)__pyx_codeobj__31));
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error)
17634 __Pyx_GOTREF(__pyx_t_4);
17635 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__32);
17636 if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_writeSceneHeader, __pyx_t_4) < 0) __PYX_ERR(0, 553, __pyx_L1_error)
17637 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17646 __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Isosurface, __pyx_t_1, __pyx_t_3, NULL, 0, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 50, __pyx_L1_error)
17647 __Pyx_GOTREF(__pyx_t_4);
17648 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Isosurface, __pyx_t_4) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
17649 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17650 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17651 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17652 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17659 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
17660 __Pyx_GOTREF(__pyx_t_1);
17661 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17662 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17676 __Pyx_XDECREF(__pyx_t_1);
17677 __Pyx_XDECREF(__pyx_t_2);
17678 __Pyx_XDECREF(__pyx_t_3);
17679 __Pyx_XDECREF(__pyx_t_4);
17682 __Pyx_AddTraceback(
"init Isosurface", __pyx_clineno, __pyx_lineno, __pyx_filename);
17685 }
else if (!PyErr_Occurred()) {
17686 PyErr_SetString(PyExc_ImportError,
"init Isosurface");
17689 __Pyx_RefNannyFinishContext();
17690 #if CYTHON_PEP489_MULTI_PHASE_INIT
17691 return (__pyx_m != NULL) ? 0 : -1;
17692 #elif PY_MAJOR_VERSION >= 3
17701 #if CYTHON_REFNANNY
17702 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
17703 PyObject *m = NULL, *p = NULL;
17705 m = PyImport_ImportModule(modname);
17707 p = PyObject_GetAttrString(m,
"RefNannyAPI");
17709 r = PyLong_AsVoidPtr(p);
17713 return (__Pyx_RefNannyAPIStruct *)
r;
17718 #if CYTHON_USE_TYPE_SLOTS
17719 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
17720 PyTypeObject* tp = Py_TYPE(obj);
17721 if (likely(tp->tp_getattro))
17722 return tp->tp_getattro(obj, attr_name);
17723 #if PY_MAJOR_VERSION < 3
17724 if (likely(tp->tp_getattr))
17725 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
17727 return PyObject_GetAttr(obj, attr_name);
17732 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
17733 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
17734 if (unlikely(!result)) {
17735 PyErr_Format(PyExc_NameError,
17736 #
if PY_MAJOR_VERSION >= 3
17737 "name '%U' is not defined", name);
17739 "name '%.200s' is not defined", PyString_AS_STRING(name));
17746 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
17747 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
17748 PyObject *dict = Py_TYPE(obj)->tp_dict;
17749 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
17751 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
17752 PyObject **dictptr = NULL;
17753 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
17755 #if CYTHON_COMPILING_IN_CPYTHON
17756 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
17758 dictptr = _PyObject_GetDictPtr(obj);
17761 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
17763 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
17764 PyObject *dict = Py_TYPE(obj)->tp_dict;
17765 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
17767 return obj_dict_version == __Pyx_get_object_dict_version(obj);
17772 #if CYTHON_USE_DICT_VERSIONS
17773 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
17775 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
17779 #if !CYTHON_AVOID_BORROWED_REFS
17780 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
17781 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
17782 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
17783 if (likely(result)) {
17784 return __Pyx_NewRef(result);
17785 }
else if (unlikely(PyErr_Occurred())) {
17789 result = PyDict_GetItem(__pyx_d, name);
17790 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
17791 if (likely(result)) {
17792 return __Pyx_NewRef(result);
17796 result = PyObject_GetItem(__pyx_d, name);
17797 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
17798 if (likely(result)) {
17799 return __Pyx_NewRef(result);
17803 return __Pyx_GetBuiltinName(name);
17807 #if CYTHON_COMPILING_IN_CPYTHON
17808 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
17810 ternaryfunc call = Py_TYPE(func)->tp_call;
17811 if (unlikely(!call))
17812 return PyObject_Call(func, arg, kw);
17813 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
17815 result = (*call)(func, arg, kw);
17816 Py_LeaveRecursiveCall();
17817 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
17820 "NULL result without error in PyObject_Call");
17827 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
17828 if (unlikely(!type)) {
17829 PyErr_SetString(PyExc_SystemError,
"Missing type object");
17832 if (likely(__Pyx_TypeCheck(obj, type)))
17834 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
17835 Py_TYPE(obj)->tp_name, type->tp_name);
17840 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
17846 S.u32 = 0x01020304;
17847 return S.u8[0] == 4;
17851 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
17852 __Pyx_BufFmt_StackElem* stack,
17853 __Pyx_TypeInfo* type) {
17854 stack[0].field = &ctx->root;
17855 stack[0].parent_offset = 0;
17856 ctx->root.type = type;
17857 ctx->root.name =
"buffer dtype";
17858 ctx->root.offset = 0;
17860 ctx->head->field = &ctx->root;
17861 ctx->fmt_offset = 0;
17862 ctx->head->parent_offset = 0;
17863 ctx->new_packmode =
'@';
17864 ctx->enc_packmode =
'@';
17865 ctx->new_count = 1;
17866 ctx->enc_count = 0;
17868 ctx->is_complex = 0;
17869 ctx->is_valid_array = 0;
17870 ctx->struct_alignment = 0;
17871 while (type->typegroup ==
'S') {
17873 ctx->head->field = type->fields;
17874 ctx->head->parent_offset = 0;
17875 type = type->fields->type;
17878 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
17880 const char* t = *ts;
17881 if (*t < '0' || *t >
'9') {
17884 count = *t++ -
'0';
17885 while (*t >=
'0' && *t <=
'9') {
17887 count += *t++ -
'0';
17893 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
17894 int number = __Pyx_BufFmt_ParseNumber(ts);
17896 PyErr_Format(PyExc_ValueError,\
17897 "Does not understand character buffer dtype format string ('%c')", **ts);
17900 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
17901 PyErr_Format(PyExc_ValueError,
17902 "Unexpected format string character: '%c'", ch);
17904 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
17906 case '?':
return "'bool'";
17907 case 'c':
return "'char'";
17908 case 'b':
return "'signed char'";
17909 case 'B':
return "'unsigned char'";
17910 case 'h':
return "'short'";
17911 case 'H':
return "'unsigned short'";
17912 case 'i':
return "'int'";
17913 case 'I':
return "'unsigned int'";
17914 case 'l':
return "'long'";
17915 case 'L':
return "'unsigned long'";
17916 case 'q':
return "'long long'";
17917 case 'Q':
return "'unsigned long long'";
17918 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
17919 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
17920 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
17921 case 'T':
return "a struct";
17922 case 'O':
return "Python object";
17923 case 'P':
return "a pointer";
17924 case 's':
case 'p':
return "a string";
17925 case 0:
return "end";
17926 default:
return "unparseable format string";
17929 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
17931 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
17932 case 'h':
case 'H':
return 2;
17933 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
17934 case 'q':
case 'Q':
return 8;
17935 case 'f':
return (is_complex ? 8 : 4);
17936 case 'd':
return (is_complex ? 16 : 8);
17938 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
17941 case 'O':
case 'P':
return sizeof(
void*);
17943 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
17947 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
17949 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
17950 case 'h':
case 'H':
return sizeof(short);
17951 case 'i':
case 'I':
return sizeof(int);
17952 case 'l':
case 'L':
return sizeof(long);
17953 #ifdef HAVE_LONG_LONG
17954 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
17956 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
17957 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
17958 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
17959 case 'O':
case 'P':
return sizeof(
void*);
17961 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
17966 typedef struct {
char c;
short x; } __Pyx_st_short;
17967 typedef struct {
char c;
int x; } __Pyx_st_int;
17968 typedef struct {
char c;
long x; } __Pyx_st_long;
17969 typedef struct {
char c;
float x; } __Pyx_st_float;
17970 typedef struct {
char c;
double x; } __Pyx_st_double;
17971 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
17972 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
17973 #ifdef HAVE_LONG_LONG
17974 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
17976 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
17978 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
17979 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
17980 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
17981 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
17982 #ifdef HAVE_LONG_LONG
17983 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
17985 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
17986 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
17987 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
17988 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
17990 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
17998 typedef struct {
short x;
char c; } __Pyx_pad_short;
17999 typedef struct {
int x;
char c; } __Pyx_pad_int;
18000 typedef struct {
long x;
char c; } __Pyx_pad_long;
18001 typedef struct {
float x;
char c; } __Pyx_pad_float;
18002 typedef struct {
double x;
char c; } __Pyx_pad_double;
18003 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
18004 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
18005 #ifdef HAVE_LONG_LONG
18006 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
18008 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
18010 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
18011 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
18012 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
18013 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
18014 #ifdef HAVE_LONG_LONG
18015 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
18017 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
18018 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
18019 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
18020 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
18022 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
18026 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
18030 case 'b':
case 'h':
case 'i':
18031 case 'l':
case 'q':
case 's':
case 'p':
18033 case '?':
case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
18035 case 'f':
case 'd':
case 'g':
18036 return (is_complex ?
'C' :
'R');
18042 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
18047 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
18048 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
18049 const char* expected;
18051 if (ctx->head == NULL) {
18055 expected = ctx->head->field->type->name;
18058 PyErr_Format(PyExc_ValueError,
18059 "Buffer dtype mismatch, expected %s%s%s but got %s",
18060 quote, expected, quote,
18061 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
18063 __Pyx_StructField* field = ctx->head->field;
18064 __Pyx_StructField* parent = (ctx->head - 1)->field;
18065 PyErr_Format(PyExc_ValueError,
18066 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
18067 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
18068 parent->type->name, field->name);
18071 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
18073 size_t size, offset, arraysize = 1;
18074 if (ctx->enc_type == 0)
return 0;
18075 if (ctx->head->field->type->arraysize[0]) {
18077 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
18078 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
18080 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
18081 PyErr_Format(PyExc_ValueError,
18082 "Expected a dimension of size %zu, got %zu",
18083 ctx->head->field->type->arraysize[0], ctx->enc_count);
18087 if (!ctx->is_valid_array) {
18088 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
18089 ctx->head->field->type->ndim, ndim);
18092 for (i = 0; i < ctx->head->field->type->ndim; i++) {
18093 arraysize *= ctx->head->field->type->arraysize[i];
18095 ctx->is_valid_array = 0;
18096 ctx->enc_count = 1;
18098 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
18100 __Pyx_StructField* field = ctx->head->field;
18101 __Pyx_TypeInfo* type = field->type;
18102 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
18103 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
18105 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
18107 if (ctx->enc_packmode ==
'@') {
18108 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
18109 size_t align_mod_offset;
18110 if (align_at == 0)
return -1;
18111 align_mod_offset = ctx->fmt_offset % align_at;
18112 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
18113 if (ctx->struct_alignment == 0)
18114 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
18117 if (type->size != size || type->typegroup != group) {
18118 if (type->typegroup ==
'C' && type->fields != NULL) {
18119 size_t parent_offset = ctx->head->parent_offset + field->offset;
18121 ctx->head->field = type->fields;
18122 ctx->head->parent_offset = parent_offset;
18125 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
18127 __Pyx_BufFmt_RaiseExpected(ctx);
18131 offset = ctx->head->parent_offset + field->offset;
18132 if (ctx->fmt_offset != offset) {
18133 PyErr_Format(PyExc_ValueError,
18134 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
18135 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
18138 ctx->fmt_offset += size;
18140 ctx->fmt_offset += (arraysize - 1) * size;
18143 if (field == &ctx->root) {
18145 if (ctx->enc_count != 0) {
18146 __Pyx_BufFmt_RaiseExpected(ctx);
18151 ctx->head->field = ++field;
18152 if (field->type == NULL) {
18154 field = ctx->head->field;
18156 }
else if (field->type->typegroup ==
'S') {
18157 size_t parent_offset = ctx->head->parent_offset + field->offset;
18158 if (field->type->fields->type == NULL)
continue;
18159 field = field->type->fields;
18161 ctx->head->field = field;
18162 ctx->head->parent_offset = parent_offset;
18168 }
while (ctx->enc_count);
18170 ctx->is_complex = 0;
18174 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
18176 const char *ts = *tsp;
18177 int i = 0,
number, ndim;
18179 if (ctx->new_count != 1) {
18180 PyErr_SetString(PyExc_ValueError,
18181 "Cannot handle repeated arrays in format string");
18184 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
18185 ndim = ctx->head->field->type->ndim;
18186 while (*ts && *ts !=
')') {
18188 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
18191 number = __Pyx_BufFmt_ExpectNumber(&ts);
18192 if (
number == -1)
return NULL;
18193 if (i < ndim && (
size_t)
number != ctx->head->field->type->arraysize[i])
18194 return PyErr_Format(PyExc_ValueError,
18195 "Expected a dimension of size %zu, got %d",
18196 ctx->head->field->type->arraysize[i],
number);
18197 if (*ts !=
',' && *ts !=
')')
18198 return PyErr_Format(PyExc_ValueError,
18199 "Expected a comma in format string, got '%c'", *ts);
18200 if (*ts ==
',') ts++;
18204 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
18205 ctx->head->field->type->ndim, i);
18207 PyErr_SetString(PyExc_ValueError,
18208 "Unexpected end of format string, expected ')'");
18211 ctx->is_valid_array = 1;
18212 ctx->new_count = 1;
18216 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
18221 if (ctx->enc_type != 0 && ctx->head == NULL) {
18222 __Pyx_BufFmt_RaiseExpected(ctx);
18225 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
18226 if (ctx->head != NULL) {
18227 __Pyx_BufFmt_RaiseExpected(ctx);
18237 if (!__Pyx_Is_Little_Endian()) {
18238 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
18241 ctx->new_packmode =
'=';
18246 if (__Pyx_Is_Little_Endian()) {
18247 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
18250 ctx->new_packmode =
'=';
18256 ctx->new_packmode = *ts++;
18260 const char* ts_after_sub;
18261 size_t i, struct_count = ctx->new_count;
18262 size_t struct_alignment = ctx->struct_alignment;
18263 ctx->new_count = 1;
18266 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
18269 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
18271 ctx->enc_count = 0;
18272 ctx->struct_alignment = 0;
18275 for (i = 0; i != struct_count; ++i) {
18276 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
18277 if (!ts_after_sub)
return NULL;
18280 if (struct_alignment) ctx->struct_alignment = struct_alignment;
18285 size_t alignment = ctx->struct_alignment;
18287 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
18289 if (alignment && ctx->fmt_offset % alignment) {
18290 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
18295 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
18296 ctx->fmt_offset += ctx->new_count;
18297 ctx->new_count = 1;
18298 ctx->enc_count = 0;
18300 ctx->enc_packmode = ctx->new_packmode;
18306 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
18307 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
18310 CYTHON_FALLTHROUGH;
18311 case '?':
case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
18312 case 'l':
case 'L':
case 'q':
case 'Q':
18313 case 'f':
case 'd':
case 'g':
18314 case 'O':
case 'p':
18315 if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
18316 (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
18317 ctx->enc_count += ctx->new_count;
18318 ctx->new_count = 1;
18323 CYTHON_FALLTHROUGH;
18325 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
18326 ctx->enc_count = ctx->new_count;
18327 ctx->enc_packmode = ctx->new_packmode;
18328 ctx->enc_type = *ts;
18329 ctx->is_complex = got_Z;
18331 ctx->new_count = 1;
18336 while(*ts !=
':') ++ts;
18340 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
18344 int number = __Pyx_BufFmt_ExpectNumber(&ts);
18345 if (
number == -1)
return NULL;
18346 ctx->new_count = (size_t)
number;
18353 static CYTHON_INLINE
void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
18354 if (unlikely(info->buf == NULL))
return;
18355 if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
18356 __Pyx_ReleaseBuffer(info);
18358 static void __Pyx_ZeroBuffer(Py_buffer* buf) {
18361 buf->strides = __Pyx_zeros;
18362 buf->shape = __Pyx_zeros;
18363 buf->suboffsets = __Pyx_minusones;
18365 static int __Pyx__GetBufferAndValidate(
18366 Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype,
int flags,
18367 int nd,
int cast, __Pyx_BufFmt_StackElem* stack)
18370 if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
18371 __Pyx_ZeroBuffer(buf);
18374 if (unlikely(buf->ndim != nd)) {
18375 PyErr_Format(PyExc_ValueError,
18376 "Buffer has wrong number of dimensions (expected %d, got %d)",
18381 __Pyx_BufFmt_Context ctx;
18382 __Pyx_BufFmt_Init(&ctx, stack, dtype);
18383 if (!__Pyx_BufFmt_CheckString(&ctx, buf->format))
goto fail;
18385 if (unlikely((
size_t)buf->itemsize != dtype->size)) {
18386 PyErr_Format(PyExc_ValueError,
18387 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"d byte%s)",
18388 buf->itemsize, (buf->itemsize > 1) ?
"s" :
"",
18389 dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ?
"s" :
"");
18392 if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
18395 __Pyx_SafeReleaseBuffer(buf);
18400 static void __Pyx_RaiseBufferIndexError(
int axis) {
18401 PyErr_Format(PyExc_IndexError,
18402 "Out of bounds on buffer access (axis %d)", axis);
18406 #if CYTHON_FAST_THREAD_STATE
18407 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
18408 PyObject *tmp_type, *tmp_value, *tmp_tb;
18409 tmp_type = tstate->curexc_type;
18410 tmp_value = tstate->curexc_value;
18411 tmp_tb = tstate->curexc_traceback;
18412 tstate->curexc_type = type;
18413 tstate->curexc_value = value;
18414 tstate->curexc_traceback = tb;
18415 Py_XDECREF(tmp_type);
18416 Py_XDECREF(tmp_value);
18417 Py_XDECREF(tmp_tb);
18419 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
18420 *type = tstate->curexc_type;
18421 *value = tstate->curexc_value;
18422 *tb = tstate->curexc_traceback;
18423 tstate->curexc_type = 0;
18424 tstate->curexc_value = 0;
18425 tstate->curexc_traceback = 0;
18430 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
18431 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
18432 int full_traceback, CYTHON_UNUSED
int nogil) {
18433 PyObject *old_exc, *old_val, *old_tb;
18435 __Pyx_PyThreadState_declare
18437 PyGILState_STATE state;
18439 state = PyGILState_Ensure();
18441 else state = (PyGILState_STATE)-1;
18444 __Pyx_PyThreadState_assign
18445 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
18446 if (full_traceback) {
18447 Py_XINCREF(old_exc);
18448 Py_XINCREF(old_val);
18449 Py_XINCREF(old_tb);
18450 __Pyx_ErrRestore(old_exc, old_val, old_tb);
18453 #if PY_MAJOR_VERSION < 3
18454 ctx = PyString_FromString(name);
18456 ctx = PyUnicode_FromString(name);
18458 __Pyx_ErrRestore(old_exc, old_val, old_tb);
18460 PyErr_WriteUnraisable(Py_None);
18462 PyErr_WriteUnraisable(ctx);
18467 PyGILState_Release(state);
18472 static void __Pyx_RaiseArgtupleInvalid(
18473 const char* func_name,
18475 Py_ssize_t num_min,
18476 Py_ssize_t num_max,
18477 Py_ssize_t num_found)
18479 Py_ssize_t num_expected;
18480 const char *more_or_less;
18481 if (num_found < num_min) {
18482 num_expected = num_min;
18483 more_or_less =
"at least";
18485 num_expected = num_max;
18486 more_or_less =
"at most";
18489 more_or_less =
"exactly";
18491 PyErr_Format(PyExc_TypeError,
18492 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
18493 func_name, more_or_less, num_expected,
18494 (num_expected == 1) ?
"" :
"s", num_found);
18498 static void __Pyx_RaiseDoubleKeywordsError(
18499 const char* func_name,
18502 PyErr_Format(PyExc_TypeError,
18503 #
if PY_MAJOR_VERSION >= 3
18504 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
18506 "%s() got multiple values for keyword argument '%s'", func_name,
18507 PyString_AsString(kw_name));
18512 static int __Pyx_ParseOptionalKeywords(
18514 PyObject **argnames[],
18516 PyObject *values[],
18517 Py_ssize_t num_pos_args,
18518 const char* function_name)
18520 PyObject *key = 0, *value = 0;
18521 Py_ssize_t
pos = 0;
18523 PyObject*** first_kw_arg = argnames + num_pos_args;
18524 while (PyDict_Next(kwds, &
pos, &key, &value)) {
18525 name = first_kw_arg;
18526 while (*name && (**name != key)) name++;
18528 values[name-argnames] = value;
18531 name = first_kw_arg;
18532 #if PY_MAJOR_VERSION < 3
18533 if (likely(PyString_Check(key))) {
18535 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
18536 && _PyString_Eq(**name, key)) {
18537 values[name-argnames] = value;
18542 if (*name)
continue;
18544 PyObject*** argname = argnames;
18545 while (argname != first_kw_arg) {
18546 if ((**argname == key) || (
18547 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
18548 && _PyString_Eq(**argname, key))) {
18549 goto arg_passed_twice;
18556 if (likely(PyUnicode_Check(key))) {
18558 int cmp = (**name == key) ? 0 :
18559 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
18560 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
18562 PyUnicode_Compare(**name, key);
18563 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
18565 values[name-argnames] = value;
18570 if (*name)
continue;
18572 PyObject*** argname = argnames;
18573 while (argname != first_kw_arg) {
18574 int cmp = (**argname == key) ? 0 :
18575 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
18576 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
18578 PyUnicode_Compare(**argname, key);
18579 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
18580 if (cmp == 0)
goto arg_passed_twice;
18585 goto invalid_keyword_type;
18587 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
18589 goto invalid_keyword;
18594 __Pyx_RaiseDoubleKeywordsError(function_name, key);
18596 invalid_keyword_type:
18597 PyErr_Format(PyExc_TypeError,
18598 "%.200s() keywords must be strings", function_name);
18601 PyErr_Format(PyExc_TypeError,
18602 #
if PY_MAJOR_VERSION < 3
18603 "%.200s() got an unexpected keyword argument '%.200s'",
18604 function_name, PyString_AsString(key));
18606 "%s() got an unexpected keyword argument '%U'",
18607 function_name, key);
18614 #if CYTHON_USE_TYPE_SLOTS
18615 static CYTHON_INLINE
int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
18616 PyTypeObject* tp = Py_TYPE(obj);
18617 if (likely(tp->tp_setattro))
18618 return tp->tp_setattro(obj, attr_name, value);
18619 #if PY_MAJOR_VERSION < 3
18620 if (likely(tp->tp_setattr))
18621 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
18623 return PyObject_SetAttr(obj, attr_name, value);
18628 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
18629 PyErr_Format(PyExc_ValueError,
18630 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
18634 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
18635 PyErr_Format(PyExc_ValueError,
18636 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
18637 index, (index == 1) ?
"" :
"s");
18641 static CYTHON_INLINE
int __Pyx_IterFinish(
void) {
18642 #if CYTHON_FAST_THREAD_STATE
18643 PyThreadState *tstate = __Pyx_PyThreadState_Current;
18644 PyObject* exc_type = tstate->curexc_type;
18645 if (unlikely(exc_type)) {
18646 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
18647 PyObject *exc_value, *exc_tb;
18648 exc_value = tstate->curexc_value;
18649 exc_tb = tstate->curexc_traceback;
18650 tstate->curexc_type = 0;
18651 tstate->curexc_value = 0;
18652 tstate->curexc_traceback = 0;
18653 Py_DECREF(exc_type);
18654 Py_XDECREF(exc_value);
18655 Py_XDECREF(exc_tb);
18663 if (unlikely(PyErr_Occurred())) {
18664 if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
18676 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
18677 if (unlikely(retval)) {
18679 __Pyx_RaiseTooManyValuesError(expected);
18682 return __Pyx_IterFinish();
18688 #if !CYTHON_COMPILING_IN_PYPY
18689 static PyObject* __Pyx_PyFloat_EqObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace,
int zerodivision_check) {
18690 const double b = floatval;
18693 (void)zerodivision_check;
18697 if (likely(PyFloat_CheckExact(op1))) {
18698 a = PyFloat_AS_DOUBLE(op1);
18701 #if PY_MAJOR_VERSION < 3
18702 if (likely(PyInt_CheckExact(op1))) {
18703 a = (double) PyInt_AS_LONG(op1);
18707 if (likely(PyLong_CheckExact(op1))) {
18708 #if CYTHON_USE_PYLONG_INTERNALS
18709 const digit* digits = ((PyLongObject*)op1)->ob_digit;
18710 const Py_ssize_t size = Py_SIZE(op1);
18712 case 0: a = 0.0;
break;
18713 case -1: a = -(double) digits[0];
break;
18714 case 1: a = (double) digits[0];
break;
18717 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
18718 a = (double) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
18719 if ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
18725 CYTHON_FALLTHROUGH;
18728 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
18729 a = (double) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
18730 if ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
18736 CYTHON_FALLTHROUGH;
18739 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
18740 a = (double) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
18741 if ((8 *
sizeof(
unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
18747 CYTHON_FALLTHROUGH;
18753 PyFloat_Type.tp_richcompare(op2, op1, Py_EQ));
18757 PyObject_RichCompare(op1, op2, Py_EQ));
18768 #if CYTHON_FAST_PYCALL
18769 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
18770 PyObject *globals) {
18772 PyThreadState *tstate = __Pyx_PyThreadState_Current;
18773 PyObject **fastlocals;
18776 assert(globals != NULL);
18781 assert(tstate != NULL);
18782 f = PyFrame_New(tstate, co, globals, NULL);
18786 fastlocals = __Pyx_PyFrame_GetLocalsplus(
f);
18787 for (i = 0; i < na; i++) {
18789 fastlocals[i] = *args++;
18791 result = PyEval_EvalFrameEx(
f,0);
18792 ++tstate->recursion_depth;
18794 --tstate->recursion_depth;
18797 #if 1 || PY_VERSION_HEX < 0x030600B1
18798 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
18799 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
18800 PyObject *globals = PyFunction_GET_GLOBALS(func);
18801 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
18803 #if PY_MAJOR_VERSION >= 3
18806 PyObject *kwtuple, **k;
18811 assert(kwargs == NULL || PyDict_Check(kwargs));
18812 nk = kwargs ? PyDict_Size(kwargs) : 0;
18813 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
18817 #
if PY_MAJOR_VERSION >= 3
18818 co->co_kwonlyargcount == 0 &&
18820 likely(kwargs == NULL || nk == 0) &&
18821 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
18822 if (argdefs == NULL && co->co_argcount == nargs) {
18823 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
18826 else if (nargs == 0 && argdefs != NULL
18827 && co->co_argcount == Py_SIZE(argdefs)) {
18830 args = &PyTuple_GET_ITEM(argdefs, 0);
18831 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
18835 if (kwargs != NULL) {
18837 kwtuple = PyTuple_New(2 * nk);
18838 if (kwtuple == NULL) {
18842 k = &PyTuple_GET_ITEM(kwtuple, 0);
18844 while (PyDict_Next(kwargs, &
pos, &k[i], &k[i+1])) {
18855 closure = PyFunction_GET_CLOSURE(func);
18856 #if PY_MAJOR_VERSION >= 3
18857 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
18859 if (argdefs != NULL) {
18860 d = &PyTuple_GET_ITEM(argdefs, 0);
18861 nd = Py_SIZE(argdefs);
18867 #if PY_MAJOR_VERSION >= 3
18868 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
18871 d, (
int)nd, kwdefs, closure);
18873 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
18876 d, (
int)nd, closure);
18878 Py_XDECREF(kwtuple);
18880 Py_LeaveRecursiveCall();
18887 #if CYTHON_COMPILING_IN_CPYTHON
18888 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
18889 PyObject *
self, *result;
18891 cfunc = PyCFunction_GET_FUNCTION(func);
18892 self = PyCFunction_GET_SELF(func);
18893 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
18895 result = cfunc(
self, arg);
18896 Py_LeaveRecursiveCall();
18897 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
18900 "NULL result without error in PyObject_Call");
18907 #if CYTHON_COMPILING_IN_CPYTHON
18908 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
18909 #if CYTHON_FAST_PYCALL
18910 if (PyFunction_Check(func)) {
18911 return __Pyx_PyFunction_FastCall(func, NULL, 0);
18914 #ifdef __Pyx_CyFunction_USED
18915 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
18917 if (likely(PyCFunction_Check(func)))
18920 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
18921 return __Pyx_PyObject_CallMethO(func, NULL);
18924 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
18929 #if CYTHON_FAST_PYCCALL
18930 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
18931 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
18932 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
18933 PyObject *
self = PyCFunction_GET_SELF(func);
18934 int flags = PyCFunction_GET_FLAGS(func);
18935 assert(PyCFunction_Check(func));
18936 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
18937 assert(nargs >= 0);
18938 assert(nargs == 0 || args != NULL);
18942 assert(!PyErr_Occurred());
18943 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
18944 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
18946 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
18952 #if CYTHON_COMPILING_IN_CPYTHON
18953 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
18955 PyObject *args = PyTuple_New(1);
18956 if (unlikely(!args))
return NULL;
18958 PyTuple_SET_ITEM(args, 0, arg);
18959 result = __Pyx_PyObject_Call(func, args, NULL);
18963 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
18964 #if CYTHON_FAST_PYCALL
18965 if (PyFunction_Check(func)) {
18966 return __Pyx_PyFunction_FastCall(func, &arg, 1);
18969 if (likely(PyCFunction_Check(func))) {
18970 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
18971 return __Pyx_PyObject_CallMethO(func, arg);
18972 #if CYTHON_FAST_PYCCALL
18973 }
else if (__Pyx_PyFastCFunction_Check(func)) {
18974 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
18978 return __Pyx__PyObject_CallOneArg(func, arg);
18981 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
18983 PyObject *args = PyTuple_Pack(1, arg);
18984 if (unlikely(!args))
return NULL;
18985 result = __Pyx_PyObject_Call(func, args, NULL);
18992 static CYTHON_INLINE
void __Pyx_RaiseClosureNameError(
const char *varname) {
18993 PyErr_Format(PyExc_NameError,
"free variable '%s' referenced before assignment in enclosing scope", varname);
18997 #if !CYTHON_COMPILING_IN_PYPY
18998 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
19000 (void)zerodivision_check;
19001 #if PY_MAJOR_VERSION < 3
19002 if (likely(PyInt_CheckExact(op1))) {
19003 const long b = intval;
19005 long a = PyInt_AS_LONG(op1);
19006 x = (long)((
unsigned long)a + b);
19007 if (likely((x^a) >= 0 || (x^b) >= 0))
19008 return PyInt_FromLong(x);
19009 return PyLong_Type.tp_as_number->nb_add(op1, op2);
19012 #if CYTHON_USE_PYLONG_INTERNALS
19013 if (likely(PyLong_CheckExact(op1))) {
19014 const long b = intval;
19016 #ifdef HAVE_LONG_LONG
19017 const PY_LONG_LONG llb = intval;
19018 PY_LONG_LONG lla, llx;
19020 const digit* digits = ((PyLongObject*)op1)->ob_digit;
19021 const Py_ssize_t size = Py_SIZE(op1);
19022 if (likely(__Pyx_sst_abs(size) <= 1)) {
19023 a = likely(size) ? digits[0] : 0;
19024 if (size == -1) a = -a;
19028 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
19029 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
19031 #ifdef HAVE_LONG_LONG
19032 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
19033 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
19037 CYTHON_FALLTHROUGH;
19039 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
19040 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
19042 #ifdef HAVE_LONG_LONG
19043 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
19044 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
19048 CYTHON_FALLTHROUGH;
19050 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
19051 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
19053 #ifdef HAVE_LONG_LONG
19054 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
19055 lla = -(PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
19059 CYTHON_FALLTHROUGH;
19061 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
19062 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
19064 #ifdef HAVE_LONG_LONG
19065 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
19066 lla = (PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
19070 CYTHON_FALLTHROUGH;
19072 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
19073 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
19075 #ifdef HAVE_LONG_LONG
19076 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
19077 lla = -(PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
19081 CYTHON_FALLTHROUGH;
19083 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
19084 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
19086 #ifdef HAVE_LONG_LONG
19087 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
19088 lla = (PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
19092 CYTHON_FALLTHROUGH;
19093 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
19097 return PyLong_FromLong(x);
19098 #ifdef HAVE_LONG_LONG
19101 return PyLong_FromLongLong(llx);
19107 if (PyFloat_CheckExact(op1)) {
19108 const long b = intval;
19109 double a = PyFloat_AS_DOUBLE(op1);
19111 PyFPE_START_PROTECT(
"add",
return NULL)
19112 result = ((double)a) + (double)b;
19113 PyFPE_END_PROTECT(result)
19114 return PyFloat_FromDouble(result);
19116 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
19121 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
19123 if (!j)
return NULL;
19124 r = PyObject_GetItem(o, j);
19128 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
19129 CYTHON_NCP_UNUSED
int wraparound,
19130 CYTHON_NCP_UNUSED
int boundscheck) {
19131 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
19132 Py_ssize_t wrapped_i = i;
19133 if (wraparound & unlikely(i < 0)) {
19134 wrapped_i += PyList_GET_SIZE(o);
19136 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
19137 PyObject *
r = PyList_GET_ITEM(o, wrapped_i);
19141 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
19143 return PySequence_GetItem(o, i);
19146 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
19147 CYTHON_NCP_UNUSED
int wraparound,
19148 CYTHON_NCP_UNUSED
int boundscheck) {
19149 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
19150 Py_ssize_t wrapped_i = i;
19151 if (wraparound & unlikely(i < 0)) {
19152 wrapped_i += PyTuple_GET_SIZE(o);
19154 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
19155 PyObject *
r = PyTuple_GET_ITEM(o, wrapped_i);
19159 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
19161 return PySequence_GetItem(o, i);
19164 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
19165 CYTHON_NCP_UNUSED
int wraparound,
19166 CYTHON_NCP_UNUSED
int boundscheck) {
19167 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
19168 if (is_list || PyList_CheckExact(o)) {
19169 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
19170 if ((!boundscheck) || (likely(__Pyx_is_valid_index(
n, PyList_GET_SIZE(o))))) {
19171 PyObject *
r = PyList_GET_ITEM(o,
n);
19176 else if (PyTuple_CheckExact(o)) {
19177 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
19178 if ((!boundscheck) || likely(__Pyx_is_valid_index(
n, PyTuple_GET_SIZE(o)))) {
19179 PyObject *
r = PyTuple_GET_ITEM(o,
n);
19184 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
19185 if (likely(m && m->sq_item)) {
19186 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
19187 Py_ssize_t l = m->sq_length(o);
19188 if (likely(l >= 0)) {
19191 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
19196 return m->sq_item(o, i);
19200 if (is_list || PySequence_Check(o)) {
19201 return PySequence_GetItem(o, i);
19204 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
19208 #if CYTHON_USE_TYPE_SLOTS
19209 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
19211 Py_ssize_t key_value;
19212 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
19213 if (unlikely(!(m && m->sq_item))) {
19214 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
19217 key_value = __Pyx_PyIndex_AsSsize_t(index);
19218 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
19219 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
19221 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
19223 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
19227 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
19228 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
19229 if (likely(m && m->mp_subscript)) {
19230 return m->mp_subscript(obj, key);
19232 return __Pyx_PyObject_GetIndex(obj, key);
19237 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
19238 PyObject *empty_list = 0;
19239 PyObject *module = 0;
19240 PyObject *global_dict = 0;
19241 PyObject *empty_dict = 0;
19243 #if PY_MAJOR_VERSION < 3
19244 PyObject *py_import;
19245 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
19252 empty_list = PyList_New(0);
19257 global_dict = PyModule_GetDict(__pyx_m);
19260 empty_dict = PyDict_New();
19264 #if PY_MAJOR_VERSION >= 3
19266 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
19267 module = PyImport_ImportModuleLevelObject(
19268 name, global_dict, empty_dict, list, 1);
19270 if (!PyErr_ExceptionMatches(PyExc_ImportError))
19279 #if PY_MAJOR_VERSION < 3
19280 PyObject *py_level = PyInt_FromLong(level);
19283 module = PyObject_CallFunctionObjArgs(py_import,
19284 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
19285 Py_DECREF(py_level);
19287 module = PyImport_ImportModuleLevelObject(
19288 name, global_dict, empty_dict, list, level);
19293 #if PY_MAJOR_VERSION < 3
19294 Py_XDECREF(py_import);
19296 Py_XDECREF(empty_list);
19297 Py_XDECREF(empty_dict);
19302 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
19303 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
19304 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
19305 PyErr_Format(PyExc_ImportError,
19306 #
if PY_MAJOR_VERSION < 3
19307 "cannot import name %.230s", PyString_AS_STRING(name));
19309 "cannot import name %S", name);
19316 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
19317 PyObject *args, *result = NULL;
19318 #if CYTHON_FAST_PYCALL
19319 if (PyFunction_Check(
function)) {
19320 PyObject *args[2] = {arg1, arg2};
19321 return __Pyx_PyFunction_FastCall(
function, args, 2);
19324 #if CYTHON_FAST_PYCCALL
19325 if (__Pyx_PyFastCFunction_Check(
function)) {
19326 PyObject *args[2] = {arg1, arg2};
19327 return __Pyx_PyCFunction_FastCall(
function, args, 2);
19330 args = PyTuple_New(2);
19331 if (unlikely(!args))
goto done;
19333 PyTuple_SET_ITEM(args, 0, arg1);
19335 PyTuple_SET_ITEM(args, 1, arg2);
19336 Py_INCREF(
function);
19337 result = __Pyx_PyObject_Call(
function, args, NULL);
19339 Py_DECREF(
function);
19345 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
19346 Py_ssize_t cstart, Py_ssize_t cstop,
19347 PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
19348 int has_cstart,
int has_cstop, CYTHON_UNUSED
int wraparound) {
19349 #if CYTHON_USE_TYPE_SLOTS
19350 PyMappingMethods* mp;
19351 #if PY_MAJOR_VERSION < 3
19352 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
19353 if (likely(ms && ms->sq_slice)) {
19355 if (_py_start && (*_py_start != Py_None)) {
19356 cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
19357 if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred())
goto bad;
19362 if (_py_stop && (*_py_stop != Py_None)) {
19363 cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
19364 if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred())
goto bad;
19366 cstop = PY_SSIZE_T_MAX;
19368 if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
19369 Py_ssize_t l = ms->sq_length(obj);
19370 if (likely(l >= 0)) {
19373 if (cstop < 0) cstop = 0;
19377 if (cstart < 0) cstart = 0;
19380 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
19385 return ms->sq_slice(obj, cstart, cstop);
19388 mp = Py_TYPE(obj)->tp_as_mapping;
19389 if (likely(mp && mp->mp_subscript))
19393 PyObject *py_slice, *py_start, *py_stop;
19395 py_slice = *_py_slice;
19397 PyObject* owned_start = NULL;
19398 PyObject* owned_stop = NULL;
19400 py_start = *_py_start;
19403 owned_start = py_start = PyInt_FromSsize_t(cstart);
19404 if (unlikely(!py_start))
goto bad;
19406 py_start = Py_None;
19409 py_stop = *_py_stop;
19412 owned_stop = py_stop = PyInt_FromSsize_t(cstop);
19413 if (unlikely(!py_stop)) {
19414 Py_XDECREF(owned_start);
19420 py_slice = PySlice_New(py_start, py_stop, Py_None);
19421 Py_XDECREF(owned_start);
19422 Py_XDECREF(owned_stop);
19423 if (unlikely(!py_slice))
goto bad;
19425 #if CYTHON_USE_TYPE_SLOTS
19426 result = mp->mp_subscript(obj, py_slice);
19428 result = PyObject_GetItem(obj, py_slice);
19431 Py_DECREF(py_slice);
19435 PyErr_Format(PyExc_TypeError,
19436 "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
19442 static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval, CYTHON_UNUSED
long inplace) {
19446 #if PY_MAJOR_VERSION < 3
19447 if (likely(PyInt_CheckExact(op1))) {
19448 const long b = intval;
19449 long a = PyInt_AS_LONG(op1);
19450 if (a == b) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
19453 #if CYTHON_USE_PYLONG_INTERNALS
19454 if (likely(PyLong_CheckExact(op1))) {
19456 unsigned long uintval;
19457 Py_ssize_t size = Py_SIZE(op1);
19458 const digit* digits = ((PyLongObject*)op1)->ob_digit;
19460 if (size == 0) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
19461 }
else if (intval < 0) {
19470 uintval = (
unsigned long) intval;
19471 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
19472 if (uintval >> (PyLong_SHIFT * 4)) {
19473 unequal = (size != 5) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
19474 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
19477 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
19478 if (uintval >> (PyLong_SHIFT * 3)) {
19479 unequal = (size != 4) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
19480 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
19483 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
19484 if (uintval >> (PyLong_SHIFT * 2)) {
19485 unequal = (size != 3) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
19486 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
19489 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
19490 if (uintval >> (PyLong_SHIFT * 1)) {
19491 unequal = (size != 2) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
19492 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
19495 unequal = (size != 1) || (((
unsigned long) digits[0]) != (uintval & (
unsigned long) PyLong_MASK));
19496 if (unequal == 0) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
19499 if (PyFloat_CheckExact(op1)) {
19500 const long b = intval;
19501 double a = PyFloat_AS_DOUBLE(op1);
19502 if ((
double)a == (
double)b) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
19505 PyObject_RichCompare(op1, op2, Py_EQ));
19509 #if !CYTHON_COMPILING_IN_PYPY
19510 static PyObject* __Pyx_PyFloat_NeObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace,
int zerodivision_check) {
19511 const double b = floatval;
19514 (void)zerodivision_check;
19518 if (likely(PyFloat_CheckExact(op1))) {
19519 a = PyFloat_AS_DOUBLE(op1);
19522 #if PY_MAJOR_VERSION < 3
19523 if (likely(PyInt_CheckExact(op1))) {
19524 a = (double) PyInt_AS_LONG(op1);
19528 if (likely(PyLong_CheckExact(op1))) {
19529 #if CYTHON_USE_PYLONG_INTERNALS
19530 const digit* digits = ((PyLongObject*)op1)->ob_digit;
19531 const Py_ssize_t size = Py_SIZE(op1);
19533 case 0: a = 0.0;
break;
19534 case -1: a = -(double) digits[0];
break;
19535 case 1: a = (double) digits[0];
break;
19538 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
19539 a = (double) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
19540 if ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
19546 CYTHON_FALLTHROUGH;
19549 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
19550 a = (double) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
19551 if ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
19557 CYTHON_FALLTHROUGH;
19560 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
19561 a = (double) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
19562 if ((8 *
sizeof(
unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
19568 CYTHON_FALLTHROUGH;
19574 PyFloat_Type.tp_richcompare(op2, op1, Py_NE));
19578 PyObject_RichCompare(op1, op2, Py_NE));
19589 #if PY_MAJOR_VERSION < 3
19590 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
19591 CYTHON_UNUSED PyObject *cause) {
19592 __Pyx_PyThreadState_declare
19594 if (!value || value == Py_None)
19598 if (!tb || tb == Py_None)
19602 if (!PyTraceBack_Check(tb)) {
19603 PyErr_SetString(PyExc_TypeError,
19604 "raise: arg 3 must be a traceback or None");
19608 if (PyType_Check(type)) {
19609 #if CYTHON_COMPILING_IN_PYPY
19611 Py_INCREF(Py_None);
19615 PyErr_NormalizeException(&type, &value, &tb);
19618 PyErr_SetString(PyExc_TypeError,
19619 "instance exception may not have a separate value");
19623 type = (PyObject*) Py_TYPE(type);
19625 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
19626 PyErr_SetString(PyExc_TypeError,
19627 "raise: exception class must be a subclass of BaseException");
19631 __Pyx_PyThreadState_assign
19632 __Pyx_ErrRestore(type, value, tb);
19641 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
19642 PyObject* owned_instance = NULL;
19643 if (tb == Py_None) {
19645 }
else if (tb && !PyTraceBack_Check(tb)) {
19646 PyErr_SetString(PyExc_TypeError,
19647 "raise: arg 3 must be a traceback or None");
19650 if (value == Py_None)
19652 if (PyExceptionInstance_Check(type)) {
19654 PyErr_SetString(PyExc_TypeError,
19655 "instance exception may not have a separate value");
19659 type = (PyObject*) Py_TYPE(value);
19660 }
else if (PyExceptionClass_Check(type)) {
19661 PyObject *instance_class = NULL;
19662 if (value && PyExceptionInstance_Check(value)) {
19663 instance_class = (PyObject*) Py_TYPE(value);
19664 if (instance_class != type) {
19665 int is_subclass = PyObject_IsSubclass(instance_class, type);
19666 if (!is_subclass) {
19667 instance_class = NULL;
19668 }
else if (unlikely(is_subclass == -1)) {
19671 type = instance_class;
19675 if (!instance_class) {
19678 args = PyTuple_New(0);
19679 else if (PyTuple_Check(value)) {
19683 args = PyTuple_Pack(1, value);
19686 owned_instance = PyObject_Call(type, args, NULL);
19688 if (!owned_instance)
19690 value = owned_instance;
19691 if (!PyExceptionInstance_Check(value)) {
19692 PyErr_Format(PyExc_TypeError,
19693 "calling %R should have returned an instance of "
19694 "BaseException, not %R",
19695 type, Py_TYPE(value));
19700 PyErr_SetString(PyExc_TypeError,
19701 "raise: exception class must be a subclass of BaseException");
19705 PyObject *fixed_cause;
19706 if (cause == Py_None) {
19707 fixed_cause = NULL;
19708 }
else if (PyExceptionClass_Check(cause)) {
19709 fixed_cause = PyObject_CallObject(cause, NULL);
19710 if (fixed_cause == NULL)
19712 }
else if (PyExceptionInstance_Check(cause)) {
19713 fixed_cause = cause;
19714 Py_INCREF(fixed_cause);
19716 PyErr_SetString(PyExc_TypeError,
19717 "exception causes must derive from "
19721 PyException_SetCause(value, fixed_cause);
19723 PyErr_SetObject(type, value);
19725 #if CYTHON_COMPILING_IN_PYPY
19726 PyObject *tmp_type, *tmp_value, *tmp_tb;
19727 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
19729 PyErr_Restore(tmp_type, tmp_value, tb);
19730 Py_XDECREF(tmp_tb);
19732 PyThreadState *tstate = __Pyx_PyThreadState_Current;
19733 PyObject* tmp_tb = tstate->curexc_traceback;
19734 if (tb != tmp_tb) {
19736 tstate->curexc_traceback = tb;
19737 Py_XDECREF(tmp_tb);
19742 Py_XDECREF(owned_instance);
19748 static void __Pyx_RaiseBufferFallbackError(
void) {
19749 PyErr_SetString(PyExc_ValueError,
19750 "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
19754 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *
v) {
19757 r = PyObject_SetItem(o, j,
v);
19761 static CYTHON_INLINE
int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *
v,
int is_list,
19762 CYTHON_NCP_UNUSED
int wraparound, CYTHON_NCP_UNUSED
int boundscheck) {
19763 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
19764 if (is_list || PyList_CheckExact(o)) {
19765 Py_ssize_t
n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
19766 if ((!boundscheck) || likely(__Pyx_is_valid_index(
n, PyList_GET_SIZE(o)))) {
19767 PyObject* old = PyList_GET_ITEM(o,
n);
19769 PyList_SET_ITEM(o,
n,
v);
19774 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
19775 if (likely(m && m->sq_ass_item)) {
19776 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
19777 Py_ssize_t l = m->sq_length(o);
19778 if (likely(l >= 0)) {
19781 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
19786 return m->sq_ass_item(o, i,
v);
19790 #if CYTHON_COMPILING_IN_PYPY
19791 if (is_list || (PySequence_Check(o) && !PyDict_Check(o)))
19793 if (is_list || PySequence_Check(o))
19796 return PySequence_SetItem(o, i,
v);
19799 return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i),
v);
19803 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
19804 #if CYTHON_COMPILING_IN_PYPY
19805 return PyObject_RichCompareBool(s1, s2, equals);
19808 return (equals == Py_EQ);
19809 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
19810 const char *ps1, *ps2;
19811 Py_ssize_t length = PyBytes_GET_SIZE(s1);
19812 if (length != PyBytes_GET_SIZE(s2))
19813 return (equals == Py_NE);
19814 ps1 = PyBytes_AS_STRING(s1);
19815 ps2 = PyBytes_AS_STRING(s2);
19816 if (ps1[0] != ps2[0]) {
19817 return (equals == Py_NE);
19818 }
else if (length == 1) {
19819 return (equals == Py_EQ);
19822 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
19823 Py_hash_t hash1, hash2;
19824 hash1 = ((PyBytesObject*)s1)->ob_shash;
19825 hash2 = ((PyBytesObject*)s2)->ob_shash;
19826 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
19827 return (equals == Py_NE);
19830 result = memcmp(ps1, ps2, (
size_t)length);
19831 return (equals == Py_EQ) ? (result == 0) : (result != 0);
19833 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
19834 return (equals == Py_NE);
19835 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
19836 return (equals == Py_NE);
19839 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
19842 result = __Pyx_PyObject_IsTrue(py_result);
19843 Py_DECREF(py_result);
19850 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
19851 #if CYTHON_COMPILING_IN_PYPY
19852 return PyObject_RichCompareBool(s1, s2, equals);
19854 #if PY_MAJOR_VERSION < 3
19855 PyObject* owned_ref = NULL;
19857 int s1_is_unicode, s2_is_unicode;
19861 s1_is_unicode = PyUnicode_CheckExact(s1);
19862 s2_is_unicode = PyUnicode_CheckExact(s2);
19863 #if PY_MAJOR_VERSION < 3
19864 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
19865 owned_ref = PyUnicode_FromObject(s2);
19866 if (unlikely(!owned_ref))
19870 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
19871 owned_ref = PyUnicode_FromObject(s1);
19872 if (unlikely(!owned_ref))
19876 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
19877 return __Pyx_PyBytes_Equals(s1, s2, equals);
19880 if (s1_is_unicode & s2_is_unicode) {
19883 void *data1, *data2;
19884 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
19886 length = __Pyx_PyUnicode_GET_LENGTH(s1);
19887 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
19890 #if CYTHON_USE_UNICODE_INTERNALS
19892 Py_hash_t hash1, hash2;
19893 #if CYTHON_PEP393_ENABLED
19894 hash1 = ((PyASCIIObject*)s1)->hash;
19895 hash2 = ((PyASCIIObject*)s2)->hash;
19897 hash1 = ((PyUnicodeObject*)s1)->hash;
19898 hash2 = ((PyUnicodeObject*)s2)->hash;
19900 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
19905 kind = __Pyx_PyUnicode_KIND(s1);
19906 if (kind != __Pyx_PyUnicode_KIND(s2)) {
19909 data1 = __Pyx_PyUnicode_DATA(s1);
19910 data2 = __Pyx_PyUnicode_DATA(s2);
19911 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
19913 }
else if (length == 1) {
19916 int result = memcmp(data1, data2, (
size_t)(length * kind));
19917 #if PY_MAJOR_VERSION < 3
19918 Py_XDECREF(owned_ref);
19920 return (equals == Py_EQ) ? (result == 0) : (result != 0);
19922 }
else if ((s1 == Py_None) & s2_is_unicode) {
19924 }
else if ((s2 == Py_None) & s1_is_unicode) {
19928 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
19929 #if PY_MAJOR_VERSION < 3
19930 Py_XDECREF(owned_ref);
19934 result = __Pyx_PyObject_IsTrue(py_result);
19935 Py_DECREF(py_result);
19939 #if PY_MAJOR_VERSION < 3
19940 Py_XDECREF(owned_ref);
19942 return (equals == Py_EQ);
19944 #if PY_MAJOR_VERSION < 3
19945 Py_XDECREF(owned_ref);
19947 return (equals == Py_NE);
19952 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval, CYTHON_UNUSED
long inplace) {
19956 #if PY_MAJOR_VERSION < 3
19957 if (likely(PyInt_CheckExact(op1))) {
19958 const long b = intval;
19959 long a = PyInt_AS_LONG(op1);
19960 if (a != b) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
19963 #if CYTHON_USE_PYLONG_INTERNALS
19964 if (likely(PyLong_CheckExact(op1))) {
19966 unsigned long uintval;
19967 Py_ssize_t size = Py_SIZE(op1);
19968 const digit* digits = ((PyLongObject*)op1)->ob_digit;
19970 if (size != 0) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
19971 }
else if (intval < 0) {
19980 uintval = (
unsigned long) intval;
19981 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
19982 if (uintval >> (PyLong_SHIFT * 4)) {
19983 unequal = (size != 5) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
19984 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
19987 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
19988 if (uintval >> (PyLong_SHIFT * 3)) {
19989 unequal = (size != 4) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
19990 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
19993 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
19994 if (uintval >> (PyLong_SHIFT * 2)) {
19995 unequal = (size != 3) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
19996 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
19999 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
20000 if (uintval >> (PyLong_SHIFT * 1)) {
20001 unequal = (size != 2) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
20002 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
20005 unequal = (size != 1) || (((
unsigned long) digits[0]) != (uintval & (
unsigned long) PyLong_MASK));
20006 if (unequal != 0) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
20009 if (PyFloat_CheckExact(op1)) {
20010 const long b = intval;
20011 double a = PyFloat_AS_DOUBLE(op1);
20012 if ((
double)a != (
double)b) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
20015 PyObject_RichCompare(op1, op2, Py_NE));
20019 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname) {
20020 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
20024 #if CYTHON_USE_EXC_INFO_STACK
20025 static _PyErr_StackItem *
20026 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
20028 _PyErr_StackItem *exc_info = tstate->exc_info;
20029 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
20030 exc_info->previous_item != NULL)
20032 exc_info = exc_info->previous_item;
20039 #if CYTHON_FAST_THREAD_STATE
20040 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
20041 #if CYTHON_USE_EXC_INFO_STACK
20042 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
20043 *type = exc_info->exc_type;
20044 *value = exc_info->exc_value;
20045 *tb = exc_info->exc_traceback;
20047 *type = tstate->exc_type;
20048 *value = tstate->exc_value;
20049 *tb = tstate->exc_traceback;
20052 Py_XINCREF(*value);
20055 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
20056 PyObject *tmp_type, *tmp_value, *tmp_tb;
20057 #if CYTHON_USE_EXC_INFO_STACK
20058 _PyErr_StackItem *exc_info = tstate->exc_info;
20059 tmp_type = exc_info->exc_type;
20060 tmp_value = exc_info->exc_value;
20061 tmp_tb = exc_info->exc_traceback;
20062 exc_info->exc_type = type;
20063 exc_info->exc_value = value;
20064 exc_info->exc_traceback = tb;
20066 tmp_type = tstate->exc_type;
20067 tmp_value = tstate->exc_value;
20068 tmp_tb = tstate->exc_traceback;
20069 tstate->exc_type = type;
20070 tstate->exc_value = value;
20071 tstate->exc_traceback = tb;
20073 Py_XDECREF(tmp_type);
20074 Py_XDECREF(tmp_value);
20075 Py_XDECREF(tmp_tb);
20080 #if CYTHON_FAST_THREAD_STATE
20081 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
20083 n = PyTuple_GET_SIZE(tuple);
20084 #if PY_MAJOR_VERSION >= 3
20085 for (i=0; i<
n; i++) {
20086 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
20089 for (i=0; i<
n; i++) {
20090 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
20094 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
20095 PyObject *exc_type = tstate->curexc_type;
20096 if (exc_type == err)
return 1;
20097 if (unlikely(!exc_type))
return 0;
20098 if (unlikely(PyTuple_Check(err)))
20099 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
20100 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
20105 #if CYTHON_FAST_THREAD_STATE
20106 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
20108 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
20111 PyObject *local_type, *local_value, *local_tb;
20112 #if CYTHON_FAST_THREAD_STATE
20113 PyObject *tmp_type, *tmp_value, *tmp_tb;
20114 local_type = tstate->curexc_type;
20115 local_value = tstate->curexc_value;
20116 local_tb = tstate->curexc_traceback;
20117 tstate->curexc_type = 0;
20118 tstate->curexc_value = 0;
20119 tstate->curexc_traceback = 0;
20121 PyErr_Fetch(&local_type, &local_value, &local_tb);
20123 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
20124 #if CYTHON_FAST_THREAD_STATE
20125 if (unlikely(tstate->curexc_type))
20127 if (unlikely(PyErr_Occurred()))
20130 #if PY_MAJOR_VERSION >= 3
20132 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
20136 Py_XINCREF(local_tb);
20137 Py_XINCREF(local_type);
20138 Py_XINCREF(local_value);
20139 *type = local_type;
20140 *value = local_value;
20142 #if CYTHON_FAST_THREAD_STATE
20143 #if CYTHON_USE_EXC_INFO_STACK
20145 _PyErr_StackItem *exc_info = tstate->exc_info;
20146 tmp_type = exc_info->exc_type;
20147 tmp_value = exc_info->exc_value;
20148 tmp_tb = exc_info->exc_traceback;
20149 exc_info->exc_type = local_type;
20150 exc_info->exc_value = local_value;
20151 exc_info->exc_traceback = local_tb;
20154 tmp_type = tstate->exc_type;
20155 tmp_value = tstate->exc_value;
20156 tmp_tb = tstate->exc_traceback;
20157 tstate->exc_type = local_type;
20158 tstate->exc_value = local_value;
20159 tstate->exc_traceback = local_tb;
20161 Py_XDECREF(tmp_type);
20162 Py_XDECREF(tmp_value);
20163 Py_XDECREF(tmp_tb);
20165 PyErr_SetExcInfo(local_type, local_value, local_tb);
20172 Py_XDECREF(local_type);
20173 Py_XDECREF(local_value);
20174 Py_XDECREF(local_tb);
20179 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
20180 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
20181 PyErr_Format(PyExc_AttributeError,
20182 #
if PY_MAJOR_VERSION >= 3
20183 "'%.50s' object has no attribute '%U'",
20184 tp->tp_name, attr_name);
20186 "'%.50s' object has no attribute '%.400s'",
20187 tp->tp_name, PyString_AS_STRING(attr_name));
20191 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
20193 PyTypeObject *tp = Py_TYPE(obj);
20194 if (unlikely(!PyString_Check(attr_name))) {
20195 return PyObject_GenericGetAttr(obj, attr_name);
20197 assert(!tp->tp_dictoffset);
20198 descr = _PyType_Lookup(tp, attr_name);
20199 if (unlikely(!descr)) {
20200 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
20203 #if PY_MAJOR_VERSION < 3
20204 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
20207 descrgetfunc
f = Py_TYPE(descr)->tp_descr_get;
20209 PyObject *res =
f(descr, obj, (PyObject *)tp);
20219 #ifndef __PYX_HAVE_RT_ImportType
20220 #define __PYX_HAVE_RT_ImportType
20221 static PyTypeObject *__Pyx_ImportType(PyObject *module,
const char *module_name,
const char *class_name,
20222 size_t size,
enum __Pyx_ImportType_CheckSize check_size)
20224 PyObject *result = 0;
20226 Py_ssize_t basicsize;
20227 #ifdef Py_LIMITED_API
20228 PyObject *py_basicsize;
20230 result = PyObject_GetAttrString(module, class_name);
20233 if (!PyType_Check(result)) {
20234 PyErr_Format(PyExc_TypeError,
20235 "%.200s.%.200s is not a type object",
20236 module_name, class_name);
20239 #ifndef Py_LIMITED_API
20240 basicsize = ((PyTypeObject *)result)->tp_basicsize;
20242 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
20245 basicsize = PyLong_AsSsize_t(py_basicsize);
20246 Py_DECREF(py_basicsize);
20248 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
20251 if ((
size_t)basicsize < size) {
20252 PyErr_Format(PyExc_ValueError,
20253 "%.200s.%.200s size changed, may indicate binary incompatibility. "
20254 "Expected %zd from C header, got %zd from PyObject",
20255 module_name, class_name, size, basicsize);
20258 if (check_size == __Pyx_ImportType_CheckSize_Error && (
size_t)basicsize != size) {
20259 PyErr_Format(PyExc_ValueError,
20260 "%.200s.%.200s size changed, may indicate binary incompatibility. "
20261 "Expected %zd from C header, got %zd from PyObject",
20262 module_name, class_name, size, basicsize);
20265 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (
size_t)basicsize > size) {
20266 PyOS_snprintf(warning,
sizeof(warning),
20267 "%s.%s size changed, may indicate binary incompatibility. "
20268 "Expected %zd from C header, got %zd from PyObject",
20269 module_name, class_name, size, basicsize);
20270 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
20272 return (PyTypeObject *)result;
20274 Py_XDECREF(result);
20280 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
20281 Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
20282 for (i=0; i < nbases; i++) {
20283 PyTypeObject *tmptype;
20284 PyObject *tmp = PyTuple_GET_ITEM(bases, i);
20285 tmptype = Py_TYPE(tmp);
20286 #if PY_MAJOR_VERSION < 3
20287 if (tmptype == &PyClass_Type)
20291 metaclass = tmptype;
20294 if (PyType_IsSubtype(metaclass, tmptype))
20296 if (PyType_IsSubtype(tmptype, metaclass)) {
20297 metaclass = tmptype;
20300 PyErr_SetString(PyExc_TypeError,
20301 "metaclass conflict: "
20302 "the metaclass of a derived class "
20303 "must be a (non-strict) subclass "
20304 "of the metaclasses of all its bases");
20308 #if PY_MAJOR_VERSION < 3
20309 metaclass = &PyClass_Type;
20311 metaclass = &PyType_Type;
20314 Py_INCREF((PyObject*) metaclass);
20315 return (PyObject*) metaclass;
20319 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
20320 PyObject* fake_module;
20321 PyTypeObject* cached_type = NULL;
20322 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
20323 if (!fake_module)
return NULL;
20324 Py_INCREF(fake_module);
20325 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
20327 if (!PyType_Check((PyObject*)cached_type)) {
20328 PyErr_Format(PyExc_TypeError,
20329 "Shared Cython type %.200s is not a type object",
20333 if (cached_type->tp_basicsize != type->tp_basicsize) {
20334 PyErr_Format(PyExc_TypeError,
20335 "Shared Cython type %.200s has the wrong size, try recompiling",
20340 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
20342 if (PyType_Ready(type) < 0)
goto bad;
20343 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
20346 cached_type = type;
20349 Py_DECREF(fake_module);
20350 return cached_type;
20352 Py_XDECREF(cached_type);
20353 cached_type = NULL;
20358 #include <structmember.h>
20360 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *closure)
20362 if (unlikely(op->func_doc == NULL)) {
20363 if (op->func.m_ml->ml_doc) {
20364 #if PY_MAJOR_VERSION >= 3
20365 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
20367 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
20369 if (unlikely(op->func_doc == NULL))
20372 Py_INCREF(Py_None);
20376 Py_INCREF(op->func_doc);
20377 return op->func_doc;
20380 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
20382 PyObject *tmp = op->func_doc;
20383 if (value == NULL) {
20387 op->func_doc = value;
20392 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
20394 if (unlikely(op->func_name == NULL)) {
20395 #if PY_MAJOR_VERSION >= 3
20396 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
20398 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
20400 if (unlikely(op->func_name == NULL))
20403 Py_INCREF(op->func_name);
20404 return op->func_name;
20407 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
20410 #if PY_MAJOR_VERSION >= 3
20411 if (unlikely(value == NULL || !PyUnicode_Check(value)))
20413 if (unlikely(value == NULL || !PyString_Check(value)))
20416 PyErr_SetString(PyExc_TypeError,
20417 "__name__ must be set to a string object");
20420 tmp = op->func_name;
20422 op->func_name = value;
20427 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
20429 Py_INCREF(op->func_qualname);
20430 return op->func_qualname;
20433 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
20436 #if PY_MAJOR_VERSION >= 3
20437 if (unlikely(value == NULL || !PyUnicode_Check(value)))
20439 if (unlikely(value == NULL || !PyString_Check(value)))
20442 PyErr_SetString(PyExc_TypeError,
20443 "__qualname__ must be set to a string object");
20446 tmp = op->func_qualname;
20448 op->func_qualname = value;
20453 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED
void *closure)
20456 self = m->func_closure;
20463 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
20465 if (unlikely(op->func_dict == NULL)) {
20466 op->func_dict = PyDict_New();
20467 if (unlikely(op->func_dict == NULL))
20470 Py_INCREF(op->func_dict);
20471 return op->func_dict;
20474 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
20477 if (unlikely(value == NULL)) {
20478 PyErr_SetString(PyExc_TypeError,
20479 "function's dictionary may not be deleted");
20482 if (unlikely(!PyDict_Check(value))) {
20483 PyErr_SetString(PyExc_TypeError,
20484 "setting function's dictionary to a non-dict");
20487 tmp = op->func_dict;
20489 op->func_dict = value;
20494 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
20496 Py_INCREF(op->func_globals);
20497 return op->func_globals;
20500 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
20502 Py_INCREF(Py_None);
20506 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
20508 PyObject* result = (op->func_code) ? op->func_code : Py_None;
20513 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
20515 PyObject *res = op->defaults_getter((PyObject *) op);
20516 if (unlikely(!res))
20518 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
20519 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
20520 Py_INCREF(op->defaults_tuple);
20521 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
20522 Py_INCREF(op->defaults_kwdict);
20524 op->defaults_tuple = PySequence_ITEM(res, 0);
20525 if (unlikely(!op->defaults_tuple)) result = -1;
20527 op->defaults_kwdict = PySequence_ITEM(res, 1);
20528 if (unlikely(!op->defaults_kwdict)) result = -1;
20535 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
20539 }
else if (value != Py_None && !PyTuple_Check(value)) {
20540 PyErr_SetString(PyExc_TypeError,
20541 "__defaults__ must be set to a tuple object");
20545 tmp = op->defaults_tuple;
20546 op->defaults_tuple = value;
20551 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
20552 PyObject* result = op->defaults_tuple;
20553 if (unlikely(!result)) {
20554 if (op->defaults_getter) {
20555 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
20556 result = op->defaults_tuple;
20565 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
20569 }
else if (value != Py_None && !PyDict_Check(value)) {
20570 PyErr_SetString(PyExc_TypeError,
20571 "__kwdefaults__ must be set to a dict object");
20575 tmp = op->defaults_kwdict;
20576 op->defaults_kwdict = value;
20581 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
20582 PyObject* result = op->defaults_kwdict;
20583 if (unlikely(!result)) {
20584 if (op->defaults_getter) {
20585 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
20586 result = op->defaults_kwdict;
20595 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
20597 if (!value || value == Py_None) {
20599 }
else if (!PyDict_Check(value)) {
20600 PyErr_SetString(PyExc_TypeError,
20601 "__annotations__ must be set to a dict object");
20605 tmp = op->func_annotations;
20606 op->func_annotations = value;
20611 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
20612 PyObject* result = op->func_annotations;
20613 if (unlikely(!result)) {
20614 result = PyDict_New();
20615 if (unlikely(!result))
return NULL;
20616 op->func_annotations = result;
20621 static PyGetSetDef __pyx_CyFunction_getsets[] = {
20622 {(
char *)
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
20623 {(
char *)
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
20624 {(
char *)
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
20625 {(
char *)
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
20626 {(
char *)
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
20627 {(
char *)
"__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
20628 {(
char *)
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
20629 {(
char *)
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
20630 {(
char *)
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
20631 {(
char *)
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
20632 {(
char *)
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
20633 {(
char *)
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
20634 {(
char *)
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
20635 {(
char *)
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
20636 {(
char *)
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
20637 {(
char *)
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
20638 {(
char *)
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
20639 {(
char *)
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
20642 static PyMemberDef __pyx_CyFunction_members[] = {
20643 {(
char *)
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
20647 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
20649 #if PY_MAJOR_VERSION >= 3
20650 Py_INCREF(m->func_qualname);
20651 return m->func_qualname;
20653 return PyString_FromString(m->func.m_ml->ml_name);
20656 static PyMethodDef __pyx_CyFunction_methods[] = {
20657 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
20660 #if PY_VERSION_HEX < 0x030500A0
20661 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
20663 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
20665 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml,
int flags, PyObject* qualname,
20666 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
20667 if (unlikely(op == NULL))
20670 __Pyx_CyFunction_weakreflist(op) = NULL;
20671 op->func.m_ml = ml;
20672 op->func.m_self = (PyObject *) op;
20673 Py_XINCREF(closure);
20674 op->func_closure = closure;
20675 Py_XINCREF(module);
20676 op->func.m_module = module;
20677 op->func_dict = NULL;
20678 op->func_name = NULL;
20679 Py_INCREF(qualname);
20680 op->func_qualname = qualname;
20681 op->func_doc = NULL;
20682 op->func_classobj = NULL;
20683 op->func_globals = globals;
20684 Py_INCREF(op->func_globals);
20686 op->func_code = code;
20687 op->defaults_pyobjects = 0;
20688 op->defaults_size = 0;
20689 op->defaults = NULL;
20690 op->defaults_tuple = NULL;
20691 op->defaults_kwdict = NULL;
20692 op->defaults_getter = NULL;
20693 op->func_annotations = NULL;
20694 return (PyObject *) op;
20697 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
20699 Py_CLEAR(m->func_closure);
20700 Py_CLEAR(m->func.m_module);
20701 Py_CLEAR(m->func_dict);
20702 Py_CLEAR(m->func_name);
20703 Py_CLEAR(m->func_qualname);
20704 Py_CLEAR(m->func_doc);
20705 Py_CLEAR(m->func_globals);
20706 Py_CLEAR(m->func_code);
20707 Py_CLEAR(m->func_classobj);
20708 Py_CLEAR(m->defaults_tuple);
20709 Py_CLEAR(m->defaults_kwdict);
20710 Py_CLEAR(m->func_annotations);
20712 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
20714 for (i = 0; i < m->defaults_pyobjects; i++)
20715 Py_XDECREF(pydefaults[i]);
20716 PyObject_Free(m->defaults);
20717 m->defaults = NULL;
20721 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
20723 if (__Pyx_CyFunction_weakreflist(m) != NULL)
20724 PyObject_ClearWeakRefs((PyObject *) m);
20725 __Pyx_CyFunction_clear(m);
20726 PyObject_GC_Del(m);
20728 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
20730 PyObject_GC_UnTrack(m);
20731 __Pyx__CyFunction_dealloc(m);
20733 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit,
void *arg)
20735 Py_VISIT(m->func_closure);
20736 Py_VISIT(m->func.m_module);
20737 Py_VISIT(m->func_dict);
20738 Py_VISIT(m->func_name);
20739 Py_VISIT(m->func_qualname);
20740 Py_VISIT(m->func_doc);
20741 Py_VISIT(m->func_globals);
20742 Py_VISIT(m->func_code);
20743 Py_VISIT(m->func_classobj);
20744 Py_VISIT(m->defaults_tuple);
20745 Py_VISIT(m->defaults_kwdict);
20747 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
20749 for (i = 0; i < m->defaults_pyobjects; i++)
20750 Py_VISIT(pydefaults[i]);
20754 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
20756 #if PY_MAJOR_VERSION < 3
20757 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
20758 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
20762 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
20764 type = (PyObject *)(Py_TYPE(obj));
20765 return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
20767 if (obj == Py_None)
20770 return __Pyx_PyMethod_New(func, obj, type);
20773 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
20775 #if PY_MAJOR_VERSION >= 3
20776 return PyUnicode_FromFormat(
"<cyfunction %U at %p>",
20777 op->func_qualname, (
void *)op);
20779 return PyString_FromFormat(
"<cyfunction %s at %p>",
20780 PyString_AsString(op->func_qualname), (
void *)op);
20783 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *
self, PyObject *arg, PyObject *kw) {
20784 PyCFunctionObject*
f = (PyCFunctionObject*)func;
20785 PyCFunction meth =
f->m_ml->ml_meth;
20787 switch (
f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
20789 if (likely(kw == NULL || PyDict_Size(kw) == 0))
20790 return (*meth)(
self, arg);
20792 case METH_VARARGS | METH_KEYWORDS:
20793 return (*(PyCFunctionWithKeywords)(
void*)meth)(
self, arg, kw);
20795 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
20796 size = PyTuple_GET_SIZE(arg);
20797 if (likely(size == 0))
20798 return (*meth)(
self, NULL);
20799 PyErr_Format(PyExc_TypeError,
20800 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T
"d given)",
20801 f->m_ml->ml_name, size);
20806 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
20807 size = PyTuple_GET_SIZE(arg);
20808 if (likely(size == 1)) {
20809 PyObject *result, *arg0;
20810 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
20811 arg0 = PyTuple_GET_ITEM(arg, 0);
20813 arg0 = PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
20815 result = (*meth)(
self, arg0);
20816 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
20821 PyErr_Format(PyExc_TypeError,
20822 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T
"d given)",
20823 f->m_ml->ml_name, size);
20828 PyErr_SetString(PyExc_SystemError,
"Bad call flags in "
20829 "__Pyx_CyFunction_Call. METH_OLDARGS is no "
20830 "longer supported!");
20833 PyErr_Format(PyExc_TypeError,
"%.200s() takes no keyword arguments",
20837 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
20838 return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
20840 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
20842 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
20843 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
20845 PyObject *new_args;
20847 argc = PyTuple_GET_SIZE(args);
20848 new_args = PyTuple_GetSlice(args, 1, argc);
20849 if (unlikely(!new_args))
20851 self = PyTuple_GetItem(args, 0);
20852 if (unlikely(!
self)) {
20853 Py_DECREF(new_args);
20854 PyErr_Format(PyExc_TypeError,
20855 "unbound method %.200S() needs an argument",
20856 cyfunc->func_qualname);
20859 result = __Pyx_CyFunction_CallMethod(func,
self, new_args, kw);
20860 Py_DECREF(new_args);
20862 result = __Pyx_CyFunction_Call(func, args, kw);
20866 static PyTypeObject __pyx_CyFunctionType_type = {
20867 PyVarObject_HEAD_INIT(0, 0)
20868 "cython_function_or_method",
20869 sizeof(__pyx_CyFunctionObject),
20871 (destructor) __Pyx_CyFunction_dealloc,
20875 #if PY_MAJOR_VERSION < 3
20880 (reprfunc) __Pyx_CyFunction_repr,
20885 __Pyx_CyFunction_CallAsMethod,
20890 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
20892 (traverseproc) __Pyx_CyFunction_traverse,
20893 (inquiry) __Pyx_CyFunction_clear,
20895 #
if PY_VERSION_HEX < 0x030500A0
20896 offsetof(__pyx_CyFunctionObject, func_weakreflist),
20898 offsetof(PyCFunctionObject, m_weakreflist),
20902 __pyx_CyFunction_methods,
20903 __pyx_CyFunction_members,
20904 __pyx_CyFunction_getsets,
20907 __Pyx_CyFunction_descr_get,
20909 offsetof(__pyx_CyFunctionObject, func_dict),
20922 #if PY_VERSION_HEX >= 0x030400a1
20925 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
20928 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20931 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
20935 static int __pyx_CyFunction_init(
void) {
20936 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
20937 if (unlikely(__pyx_CyFunctionType == NULL)) {
20942 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *func,
size_t size,
int pyobjects) {
20943 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
20944 m->defaults = PyObject_Malloc(size);
20945 if (unlikely(!m->defaults))
20946 return PyErr_NoMemory();
20947 memset(m->defaults, 0, size);
20948 m->defaults_pyobjects = pyobjects;
20949 m->defaults_size = size;
20950 return m->defaults;
20952 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
20953 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
20954 m->defaults_tuple = tuple;
20957 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
20958 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
20959 m->defaults_kwdict = dict;
20962 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
20963 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
20964 m->func_annotations = dict;
20969 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
int flags, PyObject* qualname,
20970 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
20971 PyObject *op = __Pyx_CyFunction_Init(
20972 PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
20973 ml, flags, qualname, closure, module, globals, code
20976 PyObject_GC_Track(op);
20982 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
20983 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
20986 PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
20988 PyObject *pargs = PyTuple_Pack(2, name, bases);
20989 if (unlikely(!pargs)) {
20993 ns = PyObject_Call(prep, pargs, mkw);
20997 if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
21007 if (unlikely(PyObject_SetItem(
ns, __pyx_n_s_module, modname) < 0))
goto bad;
21008 if (unlikely(PyObject_SetItem(
ns, __pyx_n_s_qualname, qualname) < 0))
goto bad;
21009 if (unlikely(doc && PyObject_SetItem(
ns, __pyx_n_s_doc, doc) < 0))
goto bad;
21015 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
21016 PyObject *dict, PyObject *mkw,
21017 int calculate_metaclass,
int allow_py2_metaclass) {
21018 PyObject *result, *margs;
21019 PyObject *owned_metaclass = NULL;
21020 if (allow_py2_metaclass) {
21021 owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
21022 if (owned_metaclass) {
21023 metaclass = owned_metaclass;
21024 }
else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
21030 if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
21031 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
21032 Py_XDECREF(owned_metaclass);
21033 if (unlikely(!metaclass))
21035 owned_metaclass = metaclass;
21037 margs = PyTuple_Pack(3, name, bases, dict);
21038 if (unlikely(!margs)) {
21041 result = PyObject_Call(metaclass, margs, mkw);
21044 Py_XDECREF(owned_metaclass);
21049 #ifndef CYTHON_CLINE_IN_TRACEBACK
21050 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate,
int c_line) {
21051 PyObject *use_cline;
21052 PyObject *ptype, *pvalue, *ptraceback;
21053 #if CYTHON_COMPILING_IN_CPYTHON
21054 PyObject **cython_runtime_dict;
21056 if (unlikely(!__pyx_cython_runtime)) {
21059 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
21060 #if CYTHON_COMPILING_IN_CPYTHON
21061 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
21062 if (likely(cython_runtime_dict)) {
21063 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
21064 use_cline, *cython_runtime_dict,
21065 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
21069 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
21070 if (use_cline_obj) {
21071 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
21072 Py_DECREF(use_cline_obj);
21080 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
21082 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
21085 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
21091 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
21092 int start = 0, mid = 0, end = count - 1;
21093 if (end >= 0 && code_line > entries[end].code_line) {
21096 while (start < end) {
21097 mid = start + (end - start) / 2;
21098 if (code_line < entries[mid].code_line) {
21100 }
else if (code_line > entries[mid].code_line) {
21106 if (code_line <= entries[mid].code_line) {
21112 static PyCodeObject *__pyx_find_code_object(
int code_line) {
21113 PyCodeObject* code_object;
21115 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
21118 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
21119 if (unlikely(
pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[
pos].code_line != code_line)) {
21122 code_object = __pyx_code_cache.entries[
pos].code_object;
21123 Py_INCREF(code_object);
21124 return code_object;
21126 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
21128 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
21129 if (unlikely(!code_line)) {
21132 if (unlikely(!entries)) {
21133 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
21134 if (likely(entries)) {
21135 __pyx_code_cache.entries = entries;
21136 __pyx_code_cache.max_count = 64;
21137 __pyx_code_cache.count = 1;
21138 entries[0].code_line = code_line;
21139 entries[0].code_object = code_object;
21140 Py_INCREF(code_object);
21144 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
21145 if ((
pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[
pos].code_line == code_line)) {
21146 PyCodeObject* tmp = entries[
pos].code_object;
21147 entries[
pos].code_object = code_object;
21151 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
21152 int new_max = __pyx_code_cache.max_count + 64;
21153 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
21154 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
21155 if (unlikely(!entries)) {
21158 __pyx_code_cache.entries = entries;
21159 __pyx_code_cache.max_count = new_max;
21161 for (i=__pyx_code_cache.count; i>
pos; i--) {
21162 entries[i] = entries[i-1];
21164 entries[
pos].code_line = code_line;
21165 entries[
pos].code_object = code_object;
21166 __pyx_code_cache.count++;
21167 Py_INCREF(code_object);
21171 #include "compile.h"
21172 #include "frameobject.h"
21173 #include "traceback.h"
21174 #if PY_VERSION_HEX >= 0x030b00a6
21175 #ifndef Py_BUILD_CORE
21176 #define Py_BUILD_CORE 1
21178 #include "internal/pycore_frame.h"
21180 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
21181 const char *funcname,
int c_line,
21182 int py_line,
const char *filename) {
21183 PyCodeObject *py_code = NULL;
21184 PyObject *py_funcname = NULL;
21185 #if PY_MAJOR_VERSION < 3
21186 PyObject *py_srcfile = NULL;
21187 py_srcfile = PyString_FromString(filename);
21188 if (!py_srcfile)
goto bad;
21191 #if PY_MAJOR_VERSION < 3
21192 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
21193 if (!py_funcname)
goto bad;
21195 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
21196 if (!py_funcname)
goto bad;
21197 funcname = PyUnicode_AsUTF8(py_funcname);
21198 if (!funcname)
goto bad;
21202 #if PY_MAJOR_VERSION < 3
21203 py_funcname = PyString_FromString(funcname);
21204 if (!py_funcname)
goto bad;
21207 #if PY_MAJOR_VERSION < 3
21208 py_code = __Pyx_PyCode_New(
21225 Py_DECREF(py_srcfile);
21227 py_code = PyCode_NewEmpty(filename, funcname, py_line);
21229 Py_XDECREF(py_funcname);
21232 Py_XDECREF(py_funcname);
21233 #if PY_MAJOR_VERSION < 3
21234 Py_XDECREF(py_srcfile);
21238 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
21239 int py_line,
const char *filename) {
21240 PyCodeObject *py_code = 0;
21241 PyFrameObject *py_frame = 0;
21242 PyThreadState *tstate = __Pyx_PyThreadState_Current;
21243 PyObject *ptype, *pvalue, *ptraceback;
21245 c_line = __Pyx_CLineForTraceback(tstate, c_line);
21247 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
21249 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
21250 py_code = __Pyx_CreateCodeObjectForTraceback(
21251 funcname, c_line, py_line, filename);
21256 Py_XDECREF(pvalue);
21257 Py_XDECREF(ptraceback);
21260 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
21261 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
21263 py_frame = PyFrame_New(
21269 if (!py_frame)
goto bad;
21270 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
21271 PyTraceBack_Here(py_frame);
21273 Py_XDECREF(py_code);
21274 Py_XDECREF(py_frame);
21277 #if PY_MAJOR_VERSION < 3
21278 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
21279 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
21280 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
21283 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
21284 PyObject *obj = view->obj;
21286 if (PyObject_CheckBuffer(obj)) {
21287 PyBuffer_Release(view);
21298 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
21299 static PyObject *__Pyx_GetStdout(
void) {
21300 PyObject *
f = PySys_GetObject((
char *)
"stdout");
21302 PyErr_SetString(PyExc_RuntimeError,
"lost sys.stdout");
21306 static int __Pyx_Print(PyObject*
f, PyObject *arg_tuple,
int newline) {
21309 if (!(
f = __Pyx_GetStdout()))
21313 for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
21315 if (PyFile_SoftSpace(
f, 1)) {
21316 if (PyFile_WriteString(
" ",
f) < 0)
21319 v = PyTuple_GET_ITEM(arg_tuple, i);
21320 if (PyFile_WriteObject(
v,
f, Py_PRINT_RAW) < 0)
21322 if (PyString_Check(
v)) {
21323 char *
s = PyString_AsString(
v);
21324 Py_ssize_t len = PyString_Size(
v);
21326 switch (
s[len-1]) {
21328 case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
21329 PyFile_SoftSpace(
f, 0);
21337 if (PyFile_WriteString(
"\n",
f) < 0)
21339 PyFile_SoftSpace(
f, 0);
21348 static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple,
int newline) {
21349 PyObject* kwargs = 0;
21350 PyObject* result = 0;
21351 PyObject* end_string;
21352 if (unlikely(!__pyx_print)) {
21353 __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print);
21358 kwargs = PyDict_New();
21359 if (unlikely(!kwargs))
21361 if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0))
21364 end_string = PyUnicode_FromStringAndSize(
" ", 1);
21365 if (unlikely(!end_string))
21367 if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) {
21368 Py_DECREF(end_string);
21371 Py_DECREF(end_string);
21373 }
else if (!newline) {
21374 if (unlikely(!__pyx_print_kwargs)) {
21375 __pyx_print_kwargs = PyDict_New();
21376 if (unlikely(!__pyx_print_kwargs))
21378 end_string = PyUnicode_FromStringAndSize(
" ", 1);
21379 if (unlikely(!end_string))
21381 if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) {
21382 Py_DECREF(end_string);
21385 Py_DECREF(end_string);
21387 kwargs = __pyx_print_kwargs;
21389 result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
21390 if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
21397 if (kwargs != __pyx_print_kwargs)
21398 Py_XDECREF(kwargs);
21404 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
21405 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
21406 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
21407 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
21408 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
21410 func_type value = func_value;\
21411 if (sizeof(target_type) < sizeof(func_type)) {\
21412 if (unlikely(value != (func_type) (target_type) value)) {\
21413 func_type zero = 0;\
21414 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
21415 return (target_type) -1;\
21416 if (is_unsigned && unlikely(value < zero))\
21417 goto raise_neg_overflow;\
21419 goto raise_overflow;\
21422 return (target_type) value;\
21426 #if CYTHON_CCOMPLEX
21428 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
21429 return ::std::complex< float >(x, y);
21432 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
21433 return x + y*(__pyx_t_float_complex)_Complex_I;
21437 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
21438 __pyx_t_float_complex
z;
21446 #if CYTHON_CCOMPLEX
21448 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
21449 return (a.real == b.real) && (a.imag == b.imag);
21451 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
21452 __pyx_t_float_complex
z;
21453 z.real = a.real + b.real;
21454 z.imag = a.imag + b.imag;
21457 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
21458 __pyx_t_float_complex
z;
21459 z.real = a.real - b.real;
21460 z.imag = a.imag - b.imag;
21463 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
21464 __pyx_t_float_complex
z;
21465 z.real = a.real * b.real - a.imag * b.imag;
21466 z.imag = a.real * b.imag + a.imag * b.real;
21470 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
21472 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
21473 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
21474 if (b.real == 0 && b.imag == 0) {
21475 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
21477 float r = b.imag / b.real;
21478 float s = (float)(1.0) / (b.real + b.imag *
r);
21479 return __pyx_t_float_complex_from_parts(
21480 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
21483 float r = b.real / b.imag;
21484 float s = (float)(1.0) / (b.imag + b.real *
r);
21485 return __pyx_t_float_complex_from_parts(
21486 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
21490 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
21492 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
21494 float denom = b.real * b.real + b.imag * b.imag;
21495 return __pyx_t_float_complex_from_parts(
21496 (a.real * b.real + a.imag * b.imag) / denom,
21497 (a.imag * b.real - a.real * b.imag) / denom);
21501 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
21502 __pyx_t_float_complex
z;
21507 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
21508 return (a.real == 0) && (a.imag == 0);
21510 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
21511 __pyx_t_float_complex
z;
21517 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
21518 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
21519 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
21521 return hypotf(
z.real,
z.imag);
21524 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
21525 __pyx_t_float_complex
z;
21526 float r, lnr, theta, z_r, z_theta;
21527 if (b.imag == 0 && b.real == (
int)b.real) {
21529 float denom = a.real * a.real + a.imag * a.imag;
21530 a.real = a.real / denom;
21531 a.imag = -a.imag / denom;
21534 switch ((
int)b.real) {
21542 return __Pyx_c_prod_float(a, a);
21544 z = __Pyx_c_prod_float(a, a);
21545 return __Pyx_c_prod_float(
z, a);
21547 z = __Pyx_c_prod_float(a, a);
21548 return __Pyx_c_prod_float(
z,
z);
21554 }
else if (b.imag == 0) {
21555 z.real = powf(a.real, b.real);
21558 }
else if (a.real > 0) {
21563 theta = atan2f(0.0, -1.0);
21566 r = __Pyx_c_abs_float(a);
21567 theta = atan2f(a.imag, a.real);
21570 z_r = expf(lnr * b.real - theta * b.imag);
21571 z_theta = theta * b.real + lnr * b.imag;
21572 z.real = z_r * cosf(z_theta);
21573 z.imag = z_r * sinf(z_theta);
21580 #if CYTHON_CCOMPLEX
21582 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
21583 return ::std::complex< double >(x, y);
21586 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
21587 return x + y*(__pyx_t_double_complex)_Complex_I;
21591 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
21592 __pyx_t_double_complex
z;
21600 #if CYTHON_CCOMPLEX
21602 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
21603 return (a.real == b.real) && (a.imag == b.imag);
21605 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
21606 __pyx_t_double_complex
z;
21607 z.real = a.real + b.real;
21608 z.imag = a.imag + b.imag;
21611 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
21612 __pyx_t_double_complex
z;
21613 z.real = a.real - b.real;
21614 z.imag = a.imag - b.imag;
21617 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
21618 __pyx_t_double_complex
z;
21619 z.real = a.real * b.real - a.imag * b.imag;
21620 z.imag = a.real * b.imag + a.imag * b.real;
21624 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
21626 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
21627 }
else if (fabs(b.real) >= fabs(b.imag)) {
21628 if (b.real == 0 && b.imag == 0) {
21629 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
21631 double r = b.imag / b.real;
21632 double s = (double)(1.0) / (b.real + b.imag *
r);
21633 return __pyx_t_double_complex_from_parts(
21634 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
21637 double r = b.real / b.imag;
21638 double s = (double)(1.0) / (b.imag + b.real *
r);
21639 return __pyx_t_double_complex_from_parts(
21640 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
21644 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
21646 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
21648 double denom = b.real * b.real + b.imag * b.imag;
21649 return __pyx_t_double_complex_from_parts(
21650 (a.real * b.real + a.imag * b.imag) / denom,
21651 (a.imag * b.real - a.real * b.imag) / denom);
21655 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
21656 __pyx_t_double_complex
z;
21661 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
21662 return (a.real == 0) && (a.imag == 0);
21664 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
21665 __pyx_t_double_complex
z;
21671 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
21672 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
21673 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
21675 return hypot(
z.real,
z.imag);
21678 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
21679 __pyx_t_double_complex
z;
21680 double r, lnr, theta, z_r, z_theta;
21681 if (b.imag == 0 && b.real == (
int)b.real) {
21683 double denom = a.real * a.real + a.imag * a.imag;
21684 a.real = a.real / denom;
21685 a.imag = -a.imag / denom;
21688 switch ((
int)b.real) {
21696 return __Pyx_c_prod_double(a, a);
21698 z = __Pyx_c_prod_double(a, a);
21699 return __Pyx_c_prod_double(
z, a);
21701 z = __Pyx_c_prod_double(a, a);
21702 return __Pyx_c_prod_double(
z,
z);
21708 }
else if (b.imag == 0) {
21709 z.real = pow(a.real, b.real);
21712 }
else if (a.real > 0) {
21717 theta = atan2(0.0, -1.0);
21720 r = __Pyx_c_abs_double(a);
21721 theta = atan2(a.imag, a.real);
21724 z_r = exp(lnr * b.real - theta * b.imag);
21725 z_theta = theta * b.real + lnr * b.imag;
21726 z.real = z_r * cos(z_theta);
21727 z.imag = z_r * sin(z_theta);
21734 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
21735 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
21736 #pragma GCC diagnostic push
21737 #pragma GCC diagnostic ignored "-Wconversion"
21739 const long neg_one = (long) -1, const_zero = (
long) 0;
21740 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
21741 #pragma GCC diagnostic pop
21743 const int is_unsigned = neg_one > const_zero;
21745 if (
sizeof(
long) <
sizeof(long)) {
21746 return PyInt_FromLong((
long) value);
21747 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
21748 return PyLong_FromUnsignedLong((
unsigned long) value);
21749 #ifdef HAVE_LONG_LONG
21750 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
21751 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
21755 if (
sizeof(
long) <=
sizeof(
long)) {
21756 return PyInt_FromLong((
long) value);
21757 #ifdef HAVE_LONG_LONG
21758 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
21759 return PyLong_FromLongLong((PY_LONG_LONG) value);
21764 int one = 1;
int little = (int)*(
unsigned char *)&one;
21765 unsigned char *bytes = (
unsigned char *)&value;
21766 return _PyLong_FromByteArray(bytes,
sizeof(
long),
21767 little, !is_unsigned);
21772 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
21773 static int __Pyx_PrintOne(PyObject*
f, PyObject *o) {
21775 if (!(
f = __Pyx_GetStdout()))
21779 if (PyFile_SoftSpace(
f, 0)) {
21780 if (PyFile_WriteString(
" ",
f) < 0)
21783 if (PyFile_WriteObject(o,
f, Py_PRINT_RAW) < 0)
21785 if (PyFile_WriteString(
"\n",
f) < 0)
21794 return __Pyx_Print(
f, NULL, 0);
21797 static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
21799 PyObject* arg_tuple = PyTuple_Pack(1, o);
21800 if (unlikely(!arg_tuple))
21802 res = __Pyx_Print(stream, arg_tuple, 1);
21803 Py_DECREF(arg_tuple);
21809 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
21810 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
21811 #pragma GCC diagnostic push
21812 #pragma GCC diagnostic ignored "-Wconversion"
21814 const int neg_one = (int) -1, const_zero = (
int) 0;
21815 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
21816 #pragma GCC diagnostic pop
21818 const int is_unsigned = neg_one > const_zero;
21819 #if PY_MAJOR_VERSION < 3
21820 if (likely(PyInt_Check(x))) {
21821 if (
sizeof(
int) <
sizeof(long)) {
21822 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
21824 long val = PyInt_AS_LONG(x);
21825 if (is_unsigned && unlikely(val < 0)) {
21826 goto raise_neg_overflow;
21832 if (likely(PyLong_Check(x))) {
21834 #if CYTHON_USE_PYLONG_INTERNALS
21835 const digit* digits = ((PyLongObject*)x)->ob_digit;
21836 switch (Py_SIZE(x)) {
21837 case 0:
return (
int) 0;
21838 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
21840 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
21841 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
21842 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
21843 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
21844 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
21849 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
21850 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
21851 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
21852 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
21853 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
21858 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
21859 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
21860 __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])))
21861 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
21862 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
21868 #if CYTHON_COMPILING_IN_CPYTHON
21869 if (unlikely(Py_SIZE(x) < 0)) {
21870 goto raise_neg_overflow;
21874 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
21875 if (unlikely(result < 0))
21877 if (unlikely(result == 1))
21878 goto raise_neg_overflow;
21881 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
21882 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
21883 #ifdef HAVE_LONG_LONG
21884 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
21885 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
21889 #if CYTHON_USE_PYLONG_INTERNALS
21890 const digit* digits = ((PyLongObject*)x)->ob_digit;
21891 switch (Py_SIZE(x)) {
21892 case 0:
return (
int) 0;
21893 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
21894 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
21896 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
21897 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
21898 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
21899 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
21900 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
21905 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
21906 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
21907 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
21908 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
21909 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
21914 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
21915 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
21916 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
21917 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
21918 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
21923 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
21924 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
21925 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
21926 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
21927 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
21932 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
21933 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
21934 __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])))
21935 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
21936 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
21941 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
21942 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
21943 __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])))
21944 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
21945 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
21951 if (
sizeof(
int) <=
sizeof(long)) {
21952 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
21953 #ifdef HAVE_LONG_LONG
21954 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
21955 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
21960 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
21961 PyErr_SetString(PyExc_RuntimeError,
21962 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
21965 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
21966 #if PY_MAJOR_VERSION < 3
21967 if (likely(
v) && !PyLong_Check(
v)) {
21969 v = PyNumber_Long(tmp);
21974 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
21975 unsigned char *bytes = (
unsigned char *)&val;
21976 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
21977 bytes,
sizeof(val),
21978 is_little, !is_unsigned);
21988 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
21989 if (!tmp)
return (
int) -1;
21990 val = __Pyx_PyInt_As_int(tmp);
21995 PyErr_SetString(PyExc_OverflowError,
21996 "value too large to convert to int");
21998 raise_neg_overflow:
21999 PyErr_SetString(PyExc_OverflowError,
22000 "can't convert negative value to int");
22005 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
22006 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
22007 #pragma GCC diagnostic push
22008 #pragma GCC diagnostic ignored "-Wconversion"
22010 const int neg_one = (int) -1, const_zero = (
int) 0;
22011 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
22012 #pragma GCC diagnostic pop
22014 const int is_unsigned = neg_one > const_zero;
22016 if (
sizeof(
int) <
sizeof(long)) {
22017 return PyInt_FromLong((
long) value);
22018 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
22019 return PyLong_FromUnsignedLong((
unsigned long) value);
22020 #ifdef HAVE_LONG_LONG
22021 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
22022 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
22026 if (
sizeof(
int) <=
sizeof(
long)) {
22027 return PyInt_FromLong((
long) value);
22028 #ifdef HAVE_LONG_LONG
22029 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
22030 return PyLong_FromLongLong((PY_LONG_LONG) value);
22035 int one = 1;
int little = (int)*(
unsigned char *)&one;
22036 unsigned char *bytes = (
unsigned char *)&value;
22037 return _PyLong_FromByteArray(bytes,
sizeof(
int),
22038 little, !is_unsigned);
22043 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
22044 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
22045 #pragma GCC diagnostic push
22046 #pragma GCC diagnostic ignored "-Wconversion"
22048 const long neg_one = (long) -1, const_zero = (
long) 0;
22049 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
22050 #pragma GCC diagnostic pop
22052 const int is_unsigned = neg_one > const_zero;
22053 #if PY_MAJOR_VERSION < 3
22054 if (likely(PyInt_Check(x))) {
22055 if (
sizeof(
long) <
sizeof(long)) {
22056 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
22058 long val = PyInt_AS_LONG(x);
22059 if (is_unsigned && unlikely(val < 0)) {
22060 goto raise_neg_overflow;
22066 if (likely(PyLong_Check(x))) {
22068 #if CYTHON_USE_PYLONG_INTERNALS
22069 const digit* digits = ((PyLongObject*)x)->ob_digit;
22070 switch (Py_SIZE(x)) {
22071 case 0:
return (
long) 0;
22072 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
22074 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
22075 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22076 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22077 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
22078 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
22083 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
22084 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22085 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22086 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
22087 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
22092 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
22093 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22094 __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])))
22095 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
22096 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
22102 #if CYTHON_COMPILING_IN_CPYTHON
22103 if (unlikely(Py_SIZE(x) < 0)) {
22104 goto raise_neg_overflow;
22108 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
22109 if (unlikely(result < 0))
22111 if (unlikely(result == 1))
22112 goto raise_neg_overflow;
22115 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
22116 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
22117 #ifdef HAVE_LONG_LONG
22118 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
22119 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
22123 #if CYTHON_USE_PYLONG_INTERNALS
22124 const digit* digits = ((PyLongObject*)x)->ob_digit;
22125 switch (Py_SIZE(x)) {
22126 case 0:
return (
long) 0;
22127 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
22128 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
22130 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
22131 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22132 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22133 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22134 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22139 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
22140 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
22141 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22142 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22143 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22148 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
22149 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22150 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22151 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22152 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22157 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
22158 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
22159 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
22160 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22161 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
22166 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
22167 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22168 __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])))
22169 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
22170 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22175 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
22176 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
22177 __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])))
22178 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
22179 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
22185 if (
sizeof(
long) <=
sizeof(long)) {
22186 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
22187 #ifdef HAVE_LONG_LONG
22188 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
22189 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
22194 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
22195 PyErr_SetString(PyExc_RuntimeError,
22196 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
22199 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
22200 #if PY_MAJOR_VERSION < 3
22201 if (likely(
v) && !PyLong_Check(
v)) {
22203 v = PyNumber_Long(tmp);
22208 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
22209 unsigned char *bytes = (
unsigned char *)&val;
22210 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
22211 bytes,
sizeof(val),
22212 is_little, !is_unsigned);
22222 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
22223 if (!tmp)
return (
long) -1;
22224 val = __Pyx_PyInt_As_long(tmp);
22229 PyErr_SetString(PyExc_OverflowError,
22230 "value too large to convert to long");
22232 raise_neg_overflow:
22233 PyErr_SetString(PyExc_OverflowError,
22234 "can't convert negative value to long");
22239 #if CYTHON_COMPILING_IN_CPYTHON
22240 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
22246 return b == &PyBaseObject_Type;
22248 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
22250 if (a == b)
return 1;
22254 n = PyTuple_GET_SIZE(mro);
22255 for (i = 0; i <
n; i++) {
22256 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
22261 return __Pyx_InBases(a, b);
22263 #if PY_MAJOR_VERSION == 2
22264 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
22265 PyObject *exception, *value, *tb;
22267 __Pyx_PyThreadState_declare
22268 __Pyx_PyThreadState_assign
22269 __Pyx_ErrFetch(&exception, &value, &tb);
22270 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
22271 if (unlikely(res == -1)) {
22272 PyErr_WriteUnraisable(err);
22276 res = PyObject_IsSubclass(err, exc_type2);
22277 if (unlikely(res == -1)) {
22278 PyErr_WriteUnraisable(err);
22282 __Pyx_ErrRestore(exception, value, tb);
22286 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
22287 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
22289 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
22294 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
22296 assert(PyExceptionClass_Check(exc_type));
22297 n = PyTuple_GET_SIZE(tuple);
22298 #if PY_MAJOR_VERSION >= 3
22299 for (i=0; i<
n; i++) {
22300 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
22303 for (i=0; i<
n; i++) {
22304 PyObject *t = PyTuple_GET_ITEM(tuple, i);
22305 #if PY_MAJOR_VERSION < 3
22306 if (likely(exc_type == t))
return 1;
22308 if (likely(PyExceptionClass_Check(t))) {
22309 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
22315 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
22316 if (likely(err == exc_type))
return 1;
22317 if (likely(PyExceptionClass_Check(err))) {
22318 if (likely(PyExceptionClass_Check(exc_type))) {
22319 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
22320 }
else if (likely(PyTuple_Check(exc_type))) {
22321 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
22325 return PyErr_GivenExceptionMatches(err, exc_type);
22327 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
22328 assert(PyExceptionClass_Check(exc_type1));
22329 assert(PyExceptionClass_Check(exc_type2));
22330 if (likely(err == exc_type1 || err == exc_type2))
return 1;
22331 if (likely(PyExceptionClass_Check(err))) {
22332 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
22334 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
22339 #if CYTHON_FAST_THREAD_STATE
22340 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
22341 PyObject *tmp_type, *tmp_value, *tmp_tb;
22342 #if CYTHON_USE_EXC_INFO_STACK
22343 _PyErr_StackItem *exc_info = tstate->exc_info;
22344 tmp_type = exc_info->exc_type;
22345 tmp_value = exc_info->exc_value;
22346 tmp_tb = exc_info->exc_traceback;
22347 exc_info->exc_type = *type;
22348 exc_info->exc_value = *value;
22349 exc_info->exc_traceback = *tb;
22351 tmp_type = tstate->exc_type;
22352 tmp_value = tstate->exc_value;
22353 tmp_tb = tstate->exc_traceback;
22354 tstate->exc_type = *type;
22355 tstate->exc_value = *value;
22356 tstate->exc_traceback = *tb;
22359 *value = tmp_value;
22363 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
22364 PyObject *tmp_type, *tmp_value, *tmp_tb;
22365 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
22366 PyErr_SetExcInfo(*type, *value, *tb);
22368 *value = tmp_value;
22374 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
22376 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
22377 PyTypeObject *tp = Py_TYPE(obj);
22379 descrgetfunc
f = NULL;
22380 PyObject **dictptr, *dict;
22381 int meth_found = 0;
22382 assert (*method == NULL);
22383 if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
22384 attr = __Pyx_PyObject_GetAttrStr(obj, name);
22387 if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
22390 descr = _PyType_Lookup(tp, name);
22391 if (likely(descr != NULL)) {
22393 #if PY_MAJOR_VERSION >= 3
22394 #ifdef __Pyx_CyFunction_USED
22395 if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
22397 if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
22400 #ifdef __Pyx_CyFunction_USED
22401 if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
22403 if (likely(PyFunction_Check(descr)))
22409 f = Py_TYPE(descr)->tp_descr_get;
22410 if (
f != NULL && PyDescr_IsData(descr)) {
22411 attr =
f(descr, obj, (PyObject *)Py_TYPE(obj));
22417 dictptr = _PyObject_GetDictPtr(obj);
22418 if (dictptr != NULL && (dict = *dictptr) != NULL) {
22420 attr = __Pyx_PyDict_GetItemStr(dict, name);
22421 if (attr != NULL) {
22434 attr =
f(descr, obj, (PyObject *)Py_TYPE(obj));
22438 if (descr != NULL) {
22442 PyErr_Format(PyExc_AttributeError,
22443 #
if PY_MAJOR_VERSION >= 3
22444 "'%.50s' object has no attribute '%U'",
22445 tp->tp_name, name);
22447 "'%.50s' object has no attribute '%.400s'",
22448 tp->tp_name, PyString_AS_STRING(name));
22452 attr = __Pyx_PyObject_GetAttrStr(obj, name);
22456 #if CYTHON_UNPACK_METHODS
22457 if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
22458 PyObject *
function = PyMethod_GET_FUNCTION(attr);
22459 Py_INCREF(
function);
22461 *method =
function;
22470 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
22471 PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
22475 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
22476 PyObject *method = NULL, *result;
22477 int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
22478 if (likely(is_method)) {
22479 result = __Pyx_PyObject_Call2Args(method, obj, arg);
22483 if (unlikely(!method))
return NULL;
22484 return __Pyx__PyObject_CallMethod1(method, arg);
22488 #include <structmember.h>
22489 #include <frameobject.h>
22490 #if PY_VERSION_HEX >= 0x030b00a6
22491 #ifndef Py_BUILD_CORE
22492 #define Py_BUILD_CORE 1
22494 #include "internal/pycore_frame.h"
22496 #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
22497 static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
22498 PyObject *et, *ev, *tb;
22499 PyObject *value = NULL;
22500 __Pyx_ErrFetch(&et, &ev, &tb);
22504 Py_INCREF(Py_None);
22508 if (likely(et == PyExc_StopIteration)) {
22510 Py_INCREF(Py_None);
22513 #if PY_VERSION_HEX >= 0x030300A0
22514 else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
22515 value = ((PyStopIterationObject *)ev)->value;
22520 else if (unlikely(PyTuple_Check(ev))) {
22521 if (PyTuple_GET_SIZE(ev) >= 1) {
22522 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22523 value = PyTuple_GET_ITEM(ev, 0);
22526 value = PySequence_ITEM(ev, 0);
22529 Py_INCREF(Py_None);
22534 else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
22537 if (likely(value)) {
22543 }
else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
22544 __Pyx_ErrRestore(et, ev, tb);
22547 PyErr_NormalizeException(&et, &ev, &tb);
22548 if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
22549 __Pyx_ErrRestore(et, ev, tb);
22554 #if PY_VERSION_HEX >= 0x030300A0
22555 value = ((PyStopIterationObject *)ev)->value;
22560 PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
22562 if (likely(args)) {
22563 value = PySequence_GetItem(args, 0);
22566 if (unlikely(!value)) {
22567 __Pyx_ErrRestore(NULL, NULL, NULL);
22568 Py_INCREF(Py_None);
22576 static CYTHON_INLINE
22577 void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
22578 PyObject *t, *
v, *tb;
22579 t = exc_state->exc_type;
22580 v = exc_state->exc_value;
22581 tb = exc_state->exc_traceback;
22582 exc_state->exc_type = NULL;
22583 exc_state->exc_value = NULL;
22584 exc_state->exc_traceback = NULL;
22589 #define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
22590 static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
22593 #ifdef __Pyx_Coroutine_USED
22594 }
else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
22595 msg =
"coroutine already executing";
22597 #ifdef __Pyx_AsyncGen_USED
22598 }
else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
22599 msg =
"async generator already executing";
22602 msg =
"generator already executing";
22604 PyErr_SetString(PyExc_ValueError, msg);
22606 #define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
22607 static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
22610 #ifdef __Pyx_Coroutine_USED
22611 }
else if (__Pyx_Coroutine_Check(gen)) {
22612 msg =
"can't send non-None value to a just-started coroutine";
22614 #ifdef __Pyx_AsyncGen_USED
22615 }
else if (__Pyx_AsyncGen_CheckExact(gen)) {
22616 msg =
"can't send non-None value to a just-started async generator";
22619 msg =
"can't send non-None value to a just-started generator";
22621 PyErr_SetString(PyExc_TypeError, msg);
22623 #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
22624 static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED
int closing) {
22625 #ifdef __Pyx_Coroutine_USED
22626 if (!closing && __Pyx_Coroutine_Check(gen)) {
22627 PyErr_SetString(PyExc_RuntimeError,
"cannot reuse already awaited coroutine");
22631 #ifdef __Pyx_AsyncGen_USED
22632 if (__Pyx_AsyncGen_CheckExact(gen))
22633 PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
22636 PyErr_SetNone(PyExc_StopIteration);
22640 PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *
self, PyObject *value,
int closing) {
22641 __Pyx_PyThreadState_declare
22642 PyThreadState *tstate;
22643 __Pyx_ExcInfoStruct *exc_state;
22645 assert(!self->is_running);
22646 if (unlikely(self->resume_label == 0)) {
22647 if (unlikely(value && value != Py_None)) {
22648 return __Pyx_Coroutine_NotStartedError((PyObject*)
self);
22651 if (unlikely(self->resume_label == -1)) {
22652 return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)
self, value, closing);
22654 #if CYTHON_FAST_THREAD_STATE
22655 __Pyx_PyThreadState_assign
22656 tstate = __pyx_tstate;
22658 tstate = __Pyx_PyThreadState_Current;
22660 exc_state = &
self->gi_exc_state;
22661 if (exc_state->exc_type) {
22662 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
22664 if (exc_state->exc_traceback) {
22665 PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
22666 PyFrameObject *
f = tb->tb_frame;
22667 assert(
f->f_back == NULL);
22668 #if PY_VERSION_HEX >= 0x030B00A1
22669 f->f_back = PyThreadState_GetFrame(tstate);
22671 Py_XINCREF(tstate->frame);
22672 f->f_back = tstate->frame;
22677 #if CYTHON_USE_EXC_INFO_STACK
22678 exc_state->previous_item = tstate->exc_info;
22679 tstate->exc_info = exc_state;
22681 if (exc_state->exc_type) {
22682 __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
22684 __Pyx_Coroutine_ExceptionClear(exc_state);
22685 __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
22688 self->is_running = 1;
22689 retval =
self->body((PyObject *)
self, tstate, value);
22690 self->is_running = 0;
22691 #if CYTHON_USE_EXC_INFO_STACK
22692 exc_state = &
self->gi_exc_state;
22693 tstate->exc_info = exc_state->previous_item;
22694 exc_state->previous_item = NULL;
22695 __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
22699 static CYTHON_INLINE
void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
22700 PyObject *exc_tb = exc_state->exc_traceback;
22701 if (likely(exc_tb)) {
22702 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
22704 PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
22705 PyFrameObject *
f = tb->tb_frame;
22706 Py_CLEAR(
f->f_back);
22710 static CYTHON_INLINE
22711 PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
22712 if (unlikely(!retval)) {
22713 __Pyx_PyThreadState_declare
22714 __Pyx_PyThreadState_assign
22715 if (!__Pyx_PyErr_Occurred()) {
22716 PyObject *exc = PyExc_StopIteration;
22717 #ifdef __Pyx_AsyncGen_USED
22718 if (__Pyx_AsyncGen_CheckExact(gen))
22719 exc = __Pyx_PyExc_StopAsyncIteration;
22721 __Pyx_PyErr_SetNone(exc);
22726 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
22727 static CYTHON_INLINE
22728 PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) {
22729 #if PY_VERSION_HEX <= 0x030A00A1
22730 return _PyGen_Send(gen, arg);
22733 if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) {
22734 if (PyAsyncGen_CheckExact(gen)) {
22735 assert(result == Py_None);
22736 PyErr_SetNone(PyExc_StopAsyncIteration);
22738 else if (result == Py_None) {
22739 PyErr_SetNone(PyExc_StopIteration);
22742 _PyGen_SetStopIterationValue(result);
22750 static CYTHON_INLINE
22751 PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
22753 PyObject *val = NULL;
22754 __Pyx_Coroutine_Undelegate(gen);
22755 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
22756 ret = __Pyx_Coroutine_SendEx(gen, val, 0);
22760 static PyObject *__Pyx_Coroutine_Send(PyObject *
self, PyObject *value) {
22762 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*)
self;
22763 PyObject *yf = gen->yieldfrom;
22764 if (unlikely(gen->is_running))
22765 return __Pyx_Coroutine_AlreadyRunningError(gen);
22768 gen->is_running = 1;
22769 #ifdef __Pyx_Generator_USED
22770 if (__Pyx_Generator_CheckExact(yf)) {
22771 ret = __Pyx_Coroutine_Send(yf, value);
22774 #ifdef __Pyx_Coroutine_USED
22775 if (__Pyx_Coroutine_Check(yf)) {
22776 ret = __Pyx_Coroutine_Send(yf, value);
22779 #ifdef __Pyx_AsyncGen_USED
22780 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
22781 ret = __Pyx_async_gen_asend_send(yf, value);
22784 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
22785 if (PyGen_CheckExact(yf)) {
22786 ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
22789 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
22790 if (PyCoro_CheckExact(yf)) {
22791 ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
22795 if (value == Py_None)
22796 ret = Py_TYPE(yf)->tp_iternext(yf);
22798 ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
22800 gen->is_running = 0;
22804 retval = __Pyx_Coroutine_FinishDelegation(gen);
22806 retval = __Pyx_Coroutine_SendEx(gen, value, 0);
22808 return __Pyx_Coroutine_MethodReturn(
self, retval);
22810 static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
22811 PyObject *retval = NULL;
22813 #ifdef __Pyx_Generator_USED
22814 if (__Pyx_Generator_CheckExact(yf)) {
22815 retval = __Pyx_Coroutine_Close(yf);
22820 #ifdef __Pyx_Coroutine_USED
22821 if (__Pyx_Coroutine_Check(yf)) {
22822 retval = __Pyx_Coroutine_Close(yf);
22826 if (__Pyx_CoroutineAwait_CheckExact(yf)) {
22827 retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
22832 #ifdef __Pyx_AsyncGen_USED
22833 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
22834 retval = __Pyx_async_gen_asend_close(yf, NULL);
22836 if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
22837 retval = __Pyx_async_gen_athrow_close(yf, NULL);
22842 gen->is_running = 1;
22843 meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
22844 if (unlikely(!meth)) {
22845 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
22846 PyErr_WriteUnraisable(yf);
22850 retval = PyObject_CallFunction(meth, NULL);
22855 gen->is_running = 0;
22857 Py_XDECREF(retval);
22860 static PyObject *__Pyx_Generator_Next(PyObject *
self) {
22861 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*)
self;
22862 PyObject *yf = gen->yieldfrom;
22863 if (unlikely(gen->is_running))
22864 return __Pyx_Coroutine_AlreadyRunningError(gen);
22867 gen->is_running = 1;
22868 #ifdef __Pyx_Generator_USED
22869 if (__Pyx_Generator_CheckExact(yf)) {
22870 ret = __Pyx_Generator_Next(yf);
22873 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
22874 if (PyGen_CheckExact(yf)) {
22875 ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL);
22878 #ifdef __Pyx_Coroutine_USED
22879 if (__Pyx_Coroutine_Check(yf)) {
22880 ret = __Pyx_Coroutine_Send(yf, Py_None);
22883 ret = Py_TYPE(yf)->tp_iternext(yf);
22884 gen->is_running = 0;
22888 return __Pyx_Coroutine_FinishDelegation(gen);
22890 return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
22892 static PyObject *__Pyx_Coroutine_Close_Method(PyObject *
self, CYTHON_UNUSED PyObject *arg) {
22893 return __Pyx_Coroutine_Close(
self);
22895 static PyObject *__Pyx_Coroutine_Close(PyObject *
self) {
22896 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
22897 PyObject *retval, *raised_exception;
22898 PyObject *yf = gen->yieldfrom;
22900 if (unlikely(gen->is_running))
22901 return __Pyx_Coroutine_AlreadyRunningError(gen);
22904 err = __Pyx_Coroutine_CloseIter(gen, yf);
22905 __Pyx_Coroutine_Undelegate(gen);
22909 PyErr_SetNone(PyExc_GeneratorExit);
22910 retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
22911 if (unlikely(retval)) {
22915 #ifdef __Pyx_Coroutine_USED
22916 }
else if (__Pyx_Coroutine_Check(
self)) {
22917 msg =
"coroutine ignored GeneratorExit";
22919 #ifdef __Pyx_AsyncGen_USED
22920 }
else if (__Pyx_AsyncGen_CheckExact(
self)) {
22921 #if PY_VERSION_HEX < 0x03060000
22922 msg =
"async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
22924 msg =
"async generator ignored GeneratorExit";
22928 msg =
"generator ignored GeneratorExit";
22930 PyErr_SetString(PyExc_RuntimeError, msg);
22933 raised_exception = PyErr_Occurred();
22934 if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
22935 if (raised_exception) PyErr_Clear();
22936 Py_INCREF(Py_None);
22941 static PyObject *__Pyx__Coroutine_Throw(PyObject *
self, PyObject *typ, PyObject *val, PyObject *tb,
22942 PyObject *args,
int close_on_genexit) {
22943 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
22944 PyObject *yf = gen->yieldfrom;
22945 if (unlikely(gen->is_running))
22946 return __Pyx_Coroutine_AlreadyRunningError(gen);
22950 if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
22951 int err = __Pyx_Coroutine_CloseIter(gen, yf);
22953 __Pyx_Coroutine_Undelegate(gen);
22955 return __Pyx_Coroutine_MethodReturn(
self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
22958 gen->is_running = 1;
22960 #ifdef __Pyx_Generator_USED
22961 || __Pyx_Generator_CheckExact(yf)
22963 #ifdef __Pyx_Coroutine_USED
22964 || __Pyx_Coroutine_Check(yf)
22967 ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
22968 #ifdef __Pyx_Coroutine_USED
22969 }
else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
22970 ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
22973 PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
22974 if (unlikely(!meth)) {
22976 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
22977 gen->is_running = 0;
22981 __Pyx_Coroutine_Undelegate(gen);
22982 gen->is_running = 0;
22985 if (likely(args)) {
22986 ret = PyObject_CallObject(meth, args);
22988 ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
22992 gen->is_running = 0;
22995 ret = __Pyx_Coroutine_FinishDelegation(gen);
22997 return __Pyx_Coroutine_MethodReturn(
self, ret);
23000 __Pyx_Raise(typ, val, tb, NULL);
23001 return __Pyx_Coroutine_MethodReturn(
self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
23003 static PyObject *__Pyx_Coroutine_Throw(PyObject *
self, PyObject *args) {
23005 PyObject *val = NULL;
23006 PyObject *tb = NULL;
23007 if (!PyArg_UnpackTuple(args, (
char *)
"throw", 1, 3, &typ, &val, &tb))
23009 return __Pyx__Coroutine_Throw(
self, typ, val, tb, args, 1);
23011 static CYTHON_INLINE
int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit,
void *arg) {
23012 Py_VISIT(exc_state->exc_type);
23013 Py_VISIT(exc_state->exc_value);
23014 Py_VISIT(exc_state->exc_traceback);
23017 static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit,
void *arg) {
23018 Py_VISIT(gen->closure);
23019 Py_VISIT(gen->classobj);
23020 Py_VISIT(gen->yieldfrom);
23021 return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
23023 static int __Pyx_Coroutine_clear(PyObject *
self) {
23024 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23025 Py_CLEAR(gen->closure);
23026 Py_CLEAR(gen->classobj);
23027 Py_CLEAR(gen->yieldfrom);
23028 __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
23029 #ifdef __Pyx_AsyncGen_USED
23030 if (__Pyx_AsyncGen_CheckExact(
self)) {
23031 Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
23034 Py_CLEAR(gen->gi_code);
23035 Py_CLEAR(gen->gi_frame);
23036 Py_CLEAR(gen->gi_name);
23037 Py_CLEAR(gen->gi_qualname);
23038 Py_CLEAR(gen->gi_modulename);
23041 static void __Pyx_Coroutine_dealloc(PyObject *
self) {
23042 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23043 PyObject_GC_UnTrack(gen);
23044 if (gen->gi_weakreflist != NULL)
23045 PyObject_ClearWeakRefs(
self);
23046 if (gen->resume_label >= 0) {
23047 PyObject_GC_Track(
self);
23048 #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
23049 if (PyObject_CallFinalizerFromDealloc(
self))
23051 Py_TYPE(gen)->tp_del(
self);
23052 if (Py_REFCNT(
self) > 0)
23057 PyObject_GC_UnTrack(
self);
23059 #ifdef __Pyx_AsyncGen_USED
23060 if (__Pyx_AsyncGen_CheckExact(
self)) {
23064 Py_CLEAR(((__pyx_PyAsyncGenObject*)
self)->ag_finalizer);
23067 __Pyx_Coroutine_clear(
self);
23068 PyObject_GC_Del(gen);
23070 static void __Pyx_Coroutine_del(PyObject *
self) {
23071 PyObject *error_type, *error_value, *error_traceback;
23072 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *)
self;
23073 __Pyx_PyThreadState_declare
23074 if (gen->resume_label < 0) {
23077 #if !CYTHON_USE_TP_FINALIZE
23078 assert(self->ob_refcnt == 0);
23079 __Pyx_SET_REFCNT(
self, 1);
23081 __Pyx_PyThreadState_assign
23082 __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
23083 #ifdef __Pyx_AsyncGen_USED
23084 if (__Pyx_AsyncGen_CheckExact(
self)) {
23085 __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)
self;
23086 PyObject *finalizer = agen->ag_finalizer;
23087 if (finalizer && !agen->ag_closed) {
23088 PyObject *res = __Pyx_PyObject_CallOneArg(finalizer,
self);
23089 if (unlikely(!res)) {
23090 PyErr_WriteUnraisable(
self);
23094 __Pyx_ErrRestore(error_type, error_value, error_traceback);
23099 if (unlikely(gen->resume_label == 0 && !error_value)) {
23100 #ifdef __Pyx_Coroutine_USED
23101 #ifdef __Pyx_Generator_USED
23102 if (!__Pyx_Generator_CheckExact(
self))
23105 PyObject_GC_UnTrack(
self);
23106 #if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat)
23107 if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1,
"coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
23108 PyErr_WriteUnraisable(
self);
23112 #if CYTHON_COMPILING_IN_PYPY
23114 cmsg = (
char*)
"coroutine was never awaited";
23117 PyObject *qualname;
23118 qualname = gen->gi_qualname;
23119 cname = PyString_AS_STRING(qualname);
23120 msg = PyString_FromFormat(
"coroutine '%.50s' was never awaited", cname);
23121 if (unlikely(!msg)) {
23123 cmsg = (
char*)
"coroutine was never awaited";
23125 cmsg = PyString_AS_STRING(msg);
23128 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
23129 PyErr_WriteUnraisable(
self);
23132 PyObject_GC_Track(
self);
23136 PyObject *res = __Pyx_Coroutine_Close(
self);
23137 if (unlikely(!res)) {
23138 if (PyErr_Occurred())
23139 PyErr_WriteUnraisable(
self);
23144 __Pyx_ErrRestore(error_type, error_value, error_traceback);
23145 #if !CYTHON_USE_TP_FINALIZE
23146 assert(Py_REFCNT(
self) > 0);
23147 if (--self->ob_refcnt == 0) {
23151 Py_ssize_t refcnt = Py_REFCNT(
self);
23152 _Py_NewReference(
self);
23153 __Pyx_SET_REFCNT(
self, refcnt);
23155 #if CYTHON_COMPILING_IN_CPYTHON
23156 assert(PyType_IS_GC(Py_TYPE(
self)) &&
23157 _Py_AS_GC(
self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
23160 #ifdef COUNT_ALLOCS
23161 --Py_TYPE(
self)->tp_frees;
23162 --Py_TYPE(
self)->tp_allocs;
23167 __Pyx_Coroutine_get_name(__pyx_CoroutineObject *
self, CYTHON_UNUSED
void *context)
23169 PyObject *name =
self->gi_name;
23170 if (unlikely(!name)) name = Py_None;
23175 __Pyx_Coroutine_set_name(__pyx_CoroutineObject *
self, PyObject *value, CYTHON_UNUSED
void *context)
23178 #if PY_MAJOR_VERSION >= 3
23179 if (unlikely(value == NULL || !PyUnicode_Check(value)))
23181 if (unlikely(value == NULL || !PyString_Check(value)))
23184 PyErr_SetString(PyExc_TypeError,
23185 "__name__ must be set to a string object");
23188 tmp =
self->gi_name;
23190 self->gi_name = value;
23195 __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *
self, CYTHON_UNUSED
void *context)
23197 PyObject *name =
self->gi_qualname;
23198 if (unlikely(!name)) name = Py_None;
23203 __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *
self, PyObject *value, CYTHON_UNUSED
void *context)
23206 #if PY_MAJOR_VERSION >= 3
23207 if (unlikely(value == NULL || !PyUnicode_Check(value)))
23209 if (unlikely(value == NULL || !PyString_Check(value)))
23212 PyErr_SetString(PyExc_TypeError,
23213 "__qualname__ must be set to a string object");
23216 tmp =
self->gi_qualname;
23218 self->gi_qualname = value;
23223 __Pyx_Coroutine_get_frame(__pyx_CoroutineObject *
self, CYTHON_UNUSED
void *context)
23225 PyObject *frame =
self->gi_frame;
23227 if (unlikely(!self->gi_code)) {
23230 frame = (PyObject *) PyFrame_New(
23231 PyThreadState_Get(),
23232 (PyCodeObject*) self->gi_code,
23236 if (unlikely(!frame))
23238 self->gi_frame = frame;
23243 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
23244 PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
23245 PyObject *name, PyObject *qualname, PyObject *module_name) {
23246 __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
23247 if (unlikely(!gen))
23249 return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
23251 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
23252 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
23253 PyObject *name, PyObject *qualname, PyObject *module_name) {
23255 gen->closure = closure;
23256 Py_XINCREF(closure);
23257 gen->is_running = 0;
23258 gen->resume_label = 0;
23259 gen->classobj = NULL;
23260 gen->yieldfrom = NULL;
23261 gen->gi_exc_state.exc_type = NULL;
23262 gen->gi_exc_state.exc_value = NULL;
23263 gen->gi_exc_state.exc_traceback = NULL;
23264 #if CYTHON_USE_EXC_INFO_STACK
23265 gen->gi_exc_state.previous_item = NULL;
23267 gen->gi_weakreflist = NULL;
23268 Py_XINCREF(qualname);
23269 gen->gi_qualname = qualname;
23271 gen->gi_name = name;
23272 Py_XINCREF(module_name);
23273 gen->gi_modulename = module_name;
23275 gen->gi_code = code;
23276 gen->gi_frame = NULL;
23277 PyObject_GC_Track(gen);
23282 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module,
const char* py_code) {
23283 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23285 PyObject *globals, *result_obj;
23286 globals = PyDict_New();
if (unlikely(!globals))
goto ignore;
23287 result = PyDict_SetItemString(globals,
"_cython_coroutine_type",
23288 #ifdef __Pyx_Coroutine_USED
23289 (PyObject*)__pyx_CoroutineType);
23293 if (unlikely(result < 0))
goto ignore;
23294 result = PyDict_SetItemString(globals,
"_cython_generator_type",
23295 #ifdef __Pyx_Generator_USED
23296 (PyObject*)__pyx_GeneratorType);
23300 if (unlikely(result < 0))
goto ignore;
23301 if (unlikely(PyDict_SetItemString(globals,
"_module", module) < 0))
goto ignore;
23302 if (unlikely(PyDict_SetItemString(globals,
"__builtins__", __pyx_b) < 0))
goto ignore;
23303 result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
23304 if (unlikely(!result_obj))
goto ignore;
23305 Py_DECREF(result_obj);
23306 Py_DECREF(globals);
23309 Py_XDECREF(globals);
23310 PyErr_WriteUnraisable(module);
23311 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
"Cython module failed to patch module with custom type", 1) < 0)) {
23322 #ifndef CYTHON_REGISTER_ABCS
23323 #define CYTHON_REGISTER_ABCS 1
23325 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23326 static PyObject* __Pyx_patch_abc_module(PyObject *module);
23327 static PyObject* __Pyx_patch_abc_module(PyObject *module) {
23328 module = __Pyx_Coroutine_patch_module(
23330 "if _cython_generator_type is not None:\n"
23331 " try: Generator = _module.Generator\n"
23332 " except AttributeError: pass\n"
23333 " else: Generator.register(_cython_generator_type)\n"
23334 "if _cython_coroutine_type is not None:\n"
23335 " try: Coroutine = _module.Coroutine\n"
23336 " except AttributeError: pass\n"
23337 " else: Coroutine.register(_cython_coroutine_type)\n"
23342 static int __Pyx_patch_abc(
void) {
23343 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23344 static int abc_patched = 0;
23345 if (CYTHON_REGISTER_ABCS && !abc_patched) {
23347 module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ?
"collections.abc" :
"collections");
23349 PyErr_WriteUnraisable(NULL);
23350 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
23351 ((PY_MAJOR_VERSION >= 3) ?
23352 "Cython module failed to register with collections.abc module" :
23353 "Cython module failed to register with collections module"), 1) < 0)) {
23357 module = __Pyx_patch_abc_module(module);
23359 if (unlikely(!module))
23363 module = PyImport_ImportModule(
"backports_abc");
23365 module = __Pyx_patch_abc_module(module);
23366 Py_XDECREF(module);
23373 if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
23379 static PyMethodDef __pyx_Generator_methods[] = {
23380 {
"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
23381 (
char*) PyDoc_STR(
"send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
23382 {
"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
23383 (
char*) PyDoc_STR(
"throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
23384 {
"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
23385 (
char*) PyDoc_STR(
"close() -> raise GeneratorExit inside generator.")},
23388 static PyMemberDef __pyx_Generator_memberlist[] = {
23389 {(
char *)
"gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
23390 {(
char*)
"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
23391 (
char*) PyDoc_STR(
"object being iterated by 'yield from', or None")},
23392 {(
char*)
"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
23395 static PyGetSetDef __pyx_Generator_getsets[] = {
23396 {(
char *)
"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
23397 (
char*) PyDoc_STR(
"name of the generator"), 0},
23398 {(
char *)
"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
23399 (
char*) PyDoc_STR(
"qualified name of the generator"), 0},
23400 {(
char *)
"gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
23401 (
char*) PyDoc_STR(
"Frame of the generator"), 0},
23404 static PyTypeObject __pyx_GeneratorType_type = {
23405 PyVarObject_HEAD_INIT(0, 0)
23407 sizeof(__pyx_CoroutineObject),
23409 (destructor) __Pyx_Coroutine_dealloc,
23424 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
23426 (traverseproc) __Pyx_Coroutine_traverse,
23429 offsetof(__pyx_CoroutineObject, gi_weakreflist),
23431 (iternextfunc) __Pyx_Generator_Next,
23432 __pyx_Generator_methods,
23433 __pyx_Generator_memberlist,
23434 __pyx_Generator_getsets,
23450 #
if CYTHON_USE_TP_FINALIZE
23453 __Pyx_Coroutine_del,
23456 #
if CYTHON_USE_TP_FINALIZE
23457 __Pyx_Coroutine_del,
23458 #elif PY_VERSION_HEX >= 0x030400a1
23461 #
if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
23464 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
23467 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
23471 static int __pyx_Generator_init(
void) {
23472 __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23473 __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
23474 __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
23475 if (unlikely(!__pyx_GeneratorType)) {
23482 static int __Pyx_check_binary_version(
void) {
23484 int same=1, i, found_dot;
23485 const char* rt_from_call = Py_GetVersion();
23486 PyOS_snprintf(ctversion, 5,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
23488 for (i = 0; i < 4; i++) {
23489 if (!ctversion[i]) {
23490 same = (rt_from_call[i] <
'0' || rt_from_call[i] >
'9');
23493 if (rt_from_call[i] != ctversion[i]) {
23499 char rtversion[5] = {
'\0'};
23501 for (i=0; i<4; ++i) {
23502 if (rt_from_call[i] ==
'.') {
23503 if (found_dot)
break;
23505 }
else if (rt_from_call[i] <
'0' || rt_from_call[i] >
'9') {
23508 rtversion[i] = rt_from_call[i];
23510 PyOS_snprintf(message,
sizeof(message),
23511 "compiletime version %s of module '%.100s' "
23512 "does not match runtime version %s",
23513 ctversion, __Pyx_MODULE_NAME, rtversion);
23514 return PyErr_WarnEx(NULL, message, 1);
23520 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
23522 #if PY_MAJOR_VERSION < 3
23523 if (t->is_unicode) {
23524 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
23525 }
else if (t->intern) {
23526 *t->p = PyString_InternFromString(t->s);
23528 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
23531 if (t->is_unicode | t->is_str) {
23533 *t->p = PyUnicode_InternFromString(t->s);
23534 }
else if (t->encoding) {
23535 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
23537 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
23540 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
23545 if (PyObject_Hash(*t->p) == -1)
23552 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
23553 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
23555 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
23557 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
23559 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
23560 #if !CYTHON_PEP393_ENABLED
23561 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
23563 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
23564 if (!defenc)
return NULL;
23565 defenc_c = PyBytes_AS_STRING(defenc);
23566 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
23568 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
23570 for (
c = defenc_c;
c < end;
c++) {
23571 if ((
unsigned char) (*
c) >= 128) {
23572 PyUnicode_AsASCIIString(o);
23578 *length = PyBytes_GET_SIZE(defenc);
23582 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
23583 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
23584 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
23585 if (likely(PyUnicode_IS_ASCII(o))) {
23586 *length = PyUnicode_GET_LENGTH(o);
23587 return PyUnicode_AsUTF8(o);
23589 PyUnicode_AsASCIIString(o);
23593 return PyUnicode_AsUTF8AndSize(o, length);
23598 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
23599 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
23601 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
23602 __Pyx_sys_getdefaultencoding_not_ascii &&
23604 PyUnicode_Check(o)) {
23605 return __Pyx_PyUnicode_AsStringAndSize(o, length);
23608 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
23609 if (PyByteArray_Check(o)) {
23610 *length = PyByteArray_GET_SIZE(o);
23611 return PyByteArray_AS_STRING(o);
23616 int r = PyBytes_AsStringAndSize(o, &result, length);
23617 if (unlikely(
r < 0)) {
23624 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
23625 int is_true = x == Py_True;
23626 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
23627 else return PyObject_IsTrue(x);
23629 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
23631 if (unlikely(!x))
return -1;
23632 retval = __Pyx_PyObject_IsTrue(x);
23636 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
23637 #if PY_MAJOR_VERSION >= 3
23638 if (PyLong_Check(result)) {
23639 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
23640 "__int__ returned non-int (type %.200s). "
23641 "The ability to return an instance of a strict subclass of int "
23642 "is deprecated, and may be removed in a future version of Python.",
23643 Py_TYPE(result)->tp_name)) {
23650 PyErr_Format(PyExc_TypeError,
23651 "__%.4s__ returned non-%.4s (type %.200s)",
23652 type_name, type_name, Py_TYPE(result)->tp_name);
23656 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
23657 #if CYTHON_USE_TYPE_SLOTS
23658 PyNumberMethods *m;
23660 const char *name = NULL;
23661 PyObject *res = NULL;
23662 #if PY_MAJOR_VERSION < 3
23663 if (likely(PyInt_Check(x) || PyLong_Check(x)))
23665 if (likely(PyLong_Check(x)))
23667 return __Pyx_NewRef(x);
23668 #if CYTHON_USE_TYPE_SLOTS
23669 m = Py_TYPE(x)->tp_as_number;
23670 #if PY_MAJOR_VERSION < 3
23671 if (m && m->nb_int) {
23673 res = m->nb_int(x);
23675 else if (m && m->nb_long) {
23677 res = m->nb_long(x);
23680 if (likely(m && m->nb_int)) {
23682 res = m->nb_int(x);
23686 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
23687 res = PyNumber_Int(x);
23691 #if PY_MAJOR_VERSION < 3
23692 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
23694 if (unlikely(!PyLong_CheckExact(res))) {
23696 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
23699 else if (!PyErr_Occurred()) {
23700 PyErr_SetString(PyExc_TypeError,
23701 "an integer is required");
23705 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
23708 #if PY_MAJOR_VERSION < 3
23709 if (likely(PyInt_CheckExact(b))) {
23710 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
23711 return PyInt_AS_LONG(b);
23713 return PyInt_AsSsize_t(b);
23716 if (likely(PyLong_CheckExact(b))) {
23717 #if CYTHON_USE_PYLONG_INTERNALS
23718 const digit* digits = ((PyLongObject*)b)->ob_digit;
23719 const Py_ssize_t size = Py_SIZE(b);
23720 if (likely(__Pyx_sst_abs(size) <= 1)) {
23721 ival = likely(size) ? digits[0] : 0;
23722 if (size == -1) ival = -ival;
23727 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
23728 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
23732 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
23733 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
23737 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
23738 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
23742 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
23743 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
23747 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
23748 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]));
23752 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
23753 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]));
23759 return PyLong_AsSsize_t(b);
23761 x = PyNumber_Index(b);
23763 ival = PyInt_AsSsize_t(x);
23767 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
23768 if (
sizeof(Py_hash_t) ==
sizeof(Py_ssize_t)) {
23769 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
23770 #if PY_MAJOR_VERSION < 3
23771 }
else if (likely(PyInt_CheckExact(o))) {
23772 return PyInt_AS_LONG(o);
23777 x = PyNumber_Index(o);
23779 ival = PyInt_AsLong(x);
23784 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
23785 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
23787 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
23788 return PyInt_FromSize_t(ival);