proteus 1.9.0
C/C++/Fortran libraries
Loading...
Searching...
No Matches
Isosurface.c
Go to the documentation of this file.
1/* Generated by Cython 3.3.0 */
2
3/* BEGIN: Cython Metadata
4{
5 "distutils": {
6 "depends": [
7 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/arrayobject.h",
8 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/arrayscalars.h",
9 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/ndarrayobject.h",
10 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/ndarraytypes.h",
11 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/ufuncobject.h"
12 ],
13 "extra_link_args": [
14 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
15 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
16 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
17 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
18 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
19 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
20 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
21 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib"
22 ],
23 "include_dirs": [
24 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include",
25 "proteus"
26 ],
27 "language": "c",
28 "name": "Isosurface",
29 "sources": [
30 "proteus/Isosurface.pyx"
31 ]
32 },
33 "module_name": "Isosurface"
34}
35END: Cython Metadata */
36
37#ifndef PY_SSIZE_T_CLEAN
38#define PY_SSIZE_T_CLEAN
39#endif /* PY_SSIZE_T_CLEAN */
40/* InitLimitedAPI */
41#if defined(Py_LIMITED_API)
42 #if !defined(CYTHON_LIMITED_API)
43 #define CYTHON_LIMITED_API 1
44 #endif
45#elif defined(CYTHON_LIMITED_API)
46 #ifdef _MSC_VER
47 #pragma message ("Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.")
48 #else
49 #warning Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.
50 #endif
51#endif
52
53#include "Python.h"
54#ifndef Py_PYTHON_H
55 #error Python headers needed to compile C extensions, please install development version of Python.
56#elif PY_VERSION_HEX < 0x03090000
57 #error Cython requires Python 3.9+.
58#elif defined(Py_LIMITED_API) && (Py_LIMITED_API & 0xFFFF0000) > (PY_VERSION_HEX & 0xFFFF0000)
59 #error 'Py_LIMITED_API' can only select past Python X.Y versions, not future ones.
60#else
61#define __PYX_ABI_VERSION "3_3_0"
62#define CYTHON_HEX_VERSION 0x030300F0
63#define CYTHON_FUTURE_DIVISION 1
64/* CModulePreamble */
65#include <stddef.h>
66#ifndef offsetof
67 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
68#endif
69#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
70 #ifndef __stdcall
71 #define __stdcall
72 #endif
73 #ifndef __cdecl
74 #define __cdecl
75 #endif
76 #ifndef __fastcall
77 #define __fastcall
78 #endif
79#endif
80#ifdef __has_builtin
81 #define __Pyx_has_cbuiltin(name) __has_builtin(name)
82#else
83 #define __Pyx_has_cbuiltin(name) (0)
84#endif
85#ifndef DL_IMPORT
86 #define DL_IMPORT(t) t
87#endif
88#ifndef DL_EXPORT
89 #define DL_EXPORT(t) t
90#endif
91#define __PYX_COMMA ,
92#ifndef PY_LONG_LONG
93 #define PY_LONG_LONG LONG_LONG
94#endif
95#ifndef Py_HUGE_VAL
96 #define Py_HUGE_VAL HUGE_VAL
97#endif
98#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
99#if defined(CYTHON_LIMITED_API)
100 #ifdef Py_LIMITED_API
101 #undef __PYX_LIMITED_VERSION_HEX
102 #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
103 #if Py_LIMITED_API < 0x03090000
104 #error "Cython 3.3 requires the Python Limited API version to be 3.9 or greater."
105 #endif
106 #endif
107 #if defined(GRAALVM_PYTHON) || defined(PYPY_VERSION)
108 #ifdef _MSC_VER
109 #pragma message ("Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
110 code for PyPy and GraalPy and is unlikely to work.")
111 #else
112 #warning "Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
113 code for PyPy and GraalPy and is unlikely to work."
114 #endif
115 #endif
116 #define CYTHON_COMPILING_IN_PYPY 0
117 #define CYTHON_COMPILING_IN_CPYTHON 0
118 #define CYTHON_COMPILING_IN_LIMITED_API 1
119 #define CYTHON_COMPILING_IN_GRAAL 0
120 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
121 #undef CYTHON_USE_TYPE_SLOTS
122 #define CYTHON_USE_TYPE_SLOTS 0
123 #undef CYTHON_USE_TYPE_SPECS
124 #define CYTHON_USE_TYPE_SPECS 1
125 #undef CYTHON_USE_PYTYPE_LOOKUP
126 #define CYTHON_USE_PYTYPE_LOOKUP 0
127 #undef CYTHON_USE_PYLIST_INTERNALS
128 #define CYTHON_USE_PYLIST_INTERNALS 0
129 #undef CYTHON_USE_UNICODE_INTERNALS
130 #define CYTHON_USE_UNICODE_INTERNALS 0
131 #ifndef CYTHON_USE_UNICODE_WRITER
132 #define CYTHON_USE_UNICODE_WRITER 0
133 #endif
134 #undef CYTHON_USE_PYLONG_INTERNALS
135 #define CYTHON_USE_PYLONG_INTERNALS 0
136 #ifndef CYTHON_AVOID_BORROWED_REFS
137 #define CYTHON_AVOID_BORROWED_REFS 0
138 #endif
139 #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
140 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
141 #endif
142 #undef CYTHON_ASSUME_SAFE_MACROS
143 #define CYTHON_ASSUME_SAFE_MACROS 0
144 #undef CYTHON_ASSUME_SAFE_SIZE
145 #define CYTHON_ASSUME_SAFE_SIZE 0
146 #undef CYTHON_UNPACK_METHODS
147 #define CYTHON_UNPACK_METHODS 0
148 #undef CYTHON_FAST_THREAD_STATE
149 #define CYTHON_FAST_THREAD_STATE 0
150 #undef CYTHON_FAST_GIL
151 #define CYTHON_FAST_GIL 0
152 #undef CYTHON_VECTORCALL
153 #define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
154 #ifndef CYTHON_VECTORCALL_TPNEW
155 #define CYTHON_VECTORCALL_TPNEW (CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
156 #endif
157 #ifndef CYTHON_PEP487_INIT_SUBCLASS
158 #define CYTHON_PEP487_INIT_SUBCLASS 1
159 #endif
160 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
161 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
162 #endif
163 #ifndef CYTHON_USE_MODULE_STATE
164 #define CYTHON_USE_MODULE_STATE 0
165 #endif
166 #undef CYTHON_USE_SYS_MONITORING
167 #define CYTHON_USE_SYS_MONITORING 0
168 #ifndef CYTHON_USE_TP_FINALIZE
169 #define CYTHON_USE_TP_FINALIZE (__PYX_LIMITED_VERSION_HEX >= 0x030F0000 && PY_VERSION_HEX > 0x030F00A8)
170 #endif
171 #ifndef CYTHON_USE_AM_SEND
172 #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
173 #endif
174 #undef CYTHON_USE_DICT_VERSIONS
175 #define CYTHON_USE_DICT_VERSIONS 0
176 #undef CYTHON_USE_EXC_INFO_STACK
177 #define CYTHON_USE_EXC_INFO_STACK 0
178 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
179 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
180 #endif
181 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
182 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
183 #endif
184 #ifndef CYTHON_USE_FREELISTS
185 #define CYTHON_USE_FREELISTS 1
186 #endif
187 #undef CYTHON_IMMORTAL_CONSTANTS
188 #define CYTHON_IMMORTAL_CONSTANTS 0
189 #if __PYX_LIMITED_VERSION_HEX < 0x030E0000
190 #undef CYTHON_OPAQUE_OBJECTS
191 #define CYTHON_OPAQUE_OBJECTS 0
192 #elif !defined(CYTHON_OPAQUE_OBJECTS)
193 #define CYTHON_OPAQUE_OBJECTS (__PYX_LIMITED_VERSION_HEX >= 0x030F0000)
194 #endif
195#elif defined(GRAALVM_PYTHON)
196 /* For very preliminary testing purposes. Most variables are set the same as PyPy.
197 The existence of this section does not imply that anything works or is even tested */
198 #define CYTHON_COMPILING_IN_PYPY 0
199 #define CYTHON_COMPILING_IN_CPYTHON 0
200 #define CYTHON_COMPILING_IN_LIMITED_API 0
201 #define CYTHON_COMPILING_IN_GRAAL 1
202 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
203 #ifndef CYTHON_USE_TYPE_SLOTS
204 #define CYTHON_USE_TYPE_SLOTS 0
205 #endif
206 #undef CYTHON_USE_TYPE_SPECS
207 #define CYTHON_USE_TYPE_SPECS 0
208 #undef CYTHON_USE_PYTYPE_LOOKUP
209 #define CYTHON_USE_PYTYPE_LOOKUP 0
210 #undef CYTHON_USE_PYLIST_INTERNALS
211 #define CYTHON_USE_PYLIST_INTERNALS 0
212 #undef CYTHON_USE_UNICODE_INTERNALS
213 #define CYTHON_USE_UNICODE_INTERNALS 0
214 #undef CYTHON_USE_UNICODE_WRITER
215 #define CYTHON_USE_UNICODE_WRITER 0
216 #undef CYTHON_USE_PYLONG_INTERNALS
217 #define CYTHON_USE_PYLONG_INTERNALS 0
218 #undef CYTHON_AVOID_BORROWED_REFS
219 #define CYTHON_AVOID_BORROWED_REFS 1
220 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
221 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
222 #undef CYTHON_ASSUME_SAFE_MACROS
223 #define CYTHON_ASSUME_SAFE_MACROS 0
224 #undef CYTHON_ASSUME_SAFE_SIZE
225 #define CYTHON_ASSUME_SAFE_SIZE 0
226 #undef CYTHON_UNPACK_METHODS
227 #define CYTHON_UNPACK_METHODS 0
228 #undef CYTHON_FAST_THREAD_STATE
229 #define CYTHON_FAST_THREAD_STATE 0
230 #undef CYTHON_FAST_GIL
231 #define CYTHON_FAST_GIL 0
232 #ifndef CYTHON_VECTORCALL
233 #define CYTHON_VECTORCALL 1
234 #endif
235 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
236 #undef CYTHON_VECTORCALL_TPNEW
237 #define CYTHON_VECTORCALL_TPNEW 0
238 #elif !defined(CYTHON_VECTORCALL_TPNEW)
239 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
240 #endif
241 #ifndef CYTHON_PEP487_INIT_SUBCLASS
242 #define CYTHON_PEP487_INIT_SUBCLASS 1
243 #endif
244 #undef CYTHON_PEP489_MULTI_PHASE_INIT
245 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
246 #undef CYTHON_USE_MODULE_STATE
247 #define CYTHON_USE_MODULE_STATE 0
248 #undef CYTHON_USE_SYS_MONITORING
249 #define CYTHON_USE_SYS_MONITORING 0
250 #undef CYTHON_USE_TP_FINALIZE
251 #define CYTHON_USE_TP_FINALIZE 0
252 #undef CYTHON_USE_AM_SEND
253 #define CYTHON_USE_AM_SEND 0
254 #undef CYTHON_USE_DICT_VERSIONS
255 #define CYTHON_USE_DICT_VERSIONS 0
256 #undef CYTHON_USE_EXC_INFO_STACK
257 #define CYTHON_USE_EXC_INFO_STACK 1
258 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
259 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
260 #endif
261 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
262 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
263 #endif
264 #undef CYTHON_USE_FREELISTS
265 #define CYTHON_USE_FREELISTS 0
266 #undef CYTHON_IMMORTAL_CONSTANTS
267 #define CYTHON_IMMORTAL_CONSTANTS 0
268 #undef CYTHON_OPAQUE_OBJECTS
269 #define CYTHON_OPAQUE_OBJECTS 0
270#elif defined(PYPY_VERSION)
271 #define CYTHON_COMPILING_IN_PYPY 1
272 #define CYTHON_COMPILING_IN_CPYTHON 0
273 #define CYTHON_COMPILING_IN_LIMITED_API 0
274 #define CYTHON_COMPILING_IN_GRAAL 0
275 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
276 #undef CYTHON_USE_TYPE_SLOTS
277 #define CYTHON_USE_TYPE_SLOTS 1
278 #ifndef CYTHON_USE_TYPE_SPECS
279 #define CYTHON_USE_TYPE_SPECS 0
280 #endif
281 #undef CYTHON_USE_PYTYPE_LOOKUP
282 #define CYTHON_USE_PYTYPE_LOOKUP 0
283 #undef CYTHON_USE_PYLIST_INTERNALS
284 #define CYTHON_USE_PYLIST_INTERNALS 0
285 #undef CYTHON_USE_UNICODE_INTERNALS
286 #define CYTHON_USE_UNICODE_INTERNALS 0
287 #undef CYTHON_USE_UNICODE_WRITER
288 #define CYTHON_USE_UNICODE_WRITER 0
289 #undef CYTHON_USE_PYLONG_INTERNALS
290 #define CYTHON_USE_PYLONG_INTERNALS 0
291 #undef CYTHON_AVOID_BORROWED_REFS
292 #define CYTHON_AVOID_BORROWED_REFS 1
293 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
294 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
295 #undef CYTHON_ASSUME_SAFE_MACROS
296 #define CYTHON_ASSUME_SAFE_MACROS 0
297 #ifndef CYTHON_ASSUME_SAFE_SIZE
298 #define CYTHON_ASSUME_SAFE_SIZE 1
299 #endif
300 #undef CYTHON_UNPACK_METHODS
301 #define CYTHON_UNPACK_METHODS 0
302 #undef CYTHON_FAST_THREAD_STATE
303 #define CYTHON_FAST_THREAD_STATE 0
304 #undef CYTHON_FAST_GIL
305 #define CYTHON_FAST_GIL 0
306 #ifndef CYTHON_VECTORCALL
307 #define CYTHON_VECTORCALL 1
308 #endif
309 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
310 #undef CYTHON_VECTORCALL_TPNEW
311 #define CYTHON_VECTORCALL_TPNEW 0
312 #elif !defined(CYTHON_VECTORCALL_TPNEW)
313 #define CYTHON_VECTORCALL_TPNEW (PYPY_VERSION_NUM >= 0x07030800 && CYTHON_VECTORCALL)
314 #endif
315 #ifndef CYTHON_PEP487_INIT_SUBCLASS
316 #define CYTHON_PEP487_INIT_SUBCLASS 1
317 #endif
318 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
319 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
320 #endif
321 #undef CYTHON_USE_MODULE_STATE
322 #define CYTHON_USE_MODULE_STATE 0
323 #undef CYTHON_USE_SYS_MONITORING
324 #define CYTHON_USE_SYS_MONITORING 0
325 #ifndef CYTHON_USE_TP_FINALIZE
326 #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
327 #endif
328 #undef CYTHON_USE_AM_SEND
329 #define CYTHON_USE_AM_SEND 0
330 #undef CYTHON_USE_DICT_VERSIONS
331 #define CYTHON_USE_DICT_VERSIONS 0
332 #undef CYTHON_USE_EXC_INFO_STACK
333 #define CYTHON_USE_EXC_INFO_STACK 0
334 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
335 #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
336 #endif
337 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
338 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
339 #endif
340 #undef CYTHON_USE_FREELISTS
341 #define CYTHON_USE_FREELISTS 0
342 #undef CYTHON_IMMORTAL_CONSTANTS
343 #define CYTHON_IMMORTAL_CONSTANTS 0
344 #undef CYTHON_OPAQUE_OBJECTS
345 #define CYTHON_OPAQUE_OBJECTS 0
346#else
347 #define CYTHON_COMPILING_IN_PYPY 0
348 #define CYTHON_COMPILING_IN_CPYTHON 1
349 #define CYTHON_COMPILING_IN_LIMITED_API 0
350 #define CYTHON_COMPILING_IN_GRAAL 0
351 #ifdef Py_GIL_DISABLED
352 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
353 #else
354 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
355 #endif
356 #if PY_VERSION_HEX < 0x030A0000
357 #undef CYTHON_USE_TYPE_SLOTS
358 #define CYTHON_USE_TYPE_SLOTS 1
359 #elif !defined(CYTHON_USE_TYPE_SLOTS)
360 #define CYTHON_USE_TYPE_SLOTS 1
361 #endif
362 #ifndef CYTHON_USE_TYPE_SPECS
363 #define CYTHON_USE_TYPE_SPECS 0
364 #endif
365 #ifndef CYTHON_USE_PYTYPE_LOOKUP
366 #define CYTHON_USE_PYTYPE_LOOKUP 1
367 #endif
368 #ifndef CYTHON_USE_PYLONG_INTERNALS
369 #define CYTHON_USE_PYLONG_INTERNALS 1
370 #endif
371 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
372 #undef CYTHON_USE_PYLIST_INTERNALS
373 #define CYTHON_USE_PYLIST_INTERNALS 0
374 #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
375 #define CYTHON_USE_PYLIST_INTERNALS 1
376 #endif
377 #ifndef CYTHON_USE_UNICODE_INTERNALS
378 #define CYTHON_USE_UNICODE_INTERNALS 1
379 #endif
380 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
381 #undef CYTHON_USE_UNICODE_WRITER
382 #define CYTHON_USE_UNICODE_WRITER 0
383 #elif !defined(CYTHON_USE_UNICODE_WRITER)
384 #define CYTHON_USE_UNICODE_WRITER 1
385 #endif
386 #ifndef CYTHON_AVOID_BORROWED_REFS
387 #define CYTHON_AVOID_BORROWED_REFS 0
388 #endif
389 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
390 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
391 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
392 #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
393 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
394 #endif
395 #ifndef CYTHON_ASSUME_SAFE_MACROS
396 #define CYTHON_ASSUME_SAFE_MACROS 1
397 #endif
398 #ifndef CYTHON_ASSUME_SAFE_SIZE
399 #define CYTHON_ASSUME_SAFE_SIZE 1
400 #endif
401 #ifndef CYTHON_UNPACK_METHODS
402 #define CYTHON_UNPACK_METHODS 1
403 #endif
404 #ifndef CYTHON_FAST_THREAD_STATE
405 #define CYTHON_FAST_THREAD_STATE 1
406 #endif
407 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
408 #undef CYTHON_FAST_GIL
409 #define CYTHON_FAST_GIL 0
410 #elif !defined(CYTHON_FAST_GIL)
411 #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
412 #endif
413 #ifndef CYTHON_VECTORCALL
414 #define CYTHON_VECTORCALL 1
415 #endif
416 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
417 #undef CYTHON_VECTORCALL_TPNEW
418 #define CYTHON_VECTORCALL_TPNEW 0
419 #elif !defined(CYTHON_VECTORCALL_TPNEW)
420 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
421 #endif
422 #ifndef CYTHON_PEP487_INIT_SUBCLASS
423 #define CYTHON_PEP487_INIT_SUBCLASS 1
424 #endif
425 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
426 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
427 #endif
428 #ifndef CYTHON_USE_MODULE_STATE
429 #define CYTHON_USE_MODULE_STATE 0
430 #endif
431 #ifndef CYTHON_USE_SYS_MONITORING
432 #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
433 #endif
434 #ifndef CYTHON_USE_TP_FINALIZE
435 #define CYTHON_USE_TP_FINALIZE 1
436 #endif
437 #ifndef CYTHON_USE_AM_SEND
438 #define CYTHON_USE_AM_SEND 1
439 #endif
440 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
441 #undef CYTHON_USE_DICT_VERSIONS
442 #define CYTHON_USE_DICT_VERSIONS 0
443 #elif !defined(CYTHON_USE_DICT_VERSIONS)
444 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
445 #endif
446 #ifndef CYTHON_USE_EXC_INFO_STACK
447 #define CYTHON_USE_EXC_INFO_STACK 1
448 #endif
449 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
450 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
451 #endif
452 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
453 #define CYTHON_USE_OWN_PREP_RERAISE_STAR (PY_VERSION_HEX < 0x030C00B2)
454 #endif
455 #ifndef CYTHON_USE_FREELISTS
456 #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
457 #endif
458 #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
459 #undef CYTHON_IMMORTAL_CONSTANTS
460 #define CYTHON_IMMORTAL_CONSTANTS 0 // definitely won't work
461 #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
462 #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
463 #endif
464 #ifndef CYTHON_OPAQUE_OBJECTS
465 #define CYTHON_OPAQUE_OBJECTS 0
466 #endif
467#endif
468#if CYTHON_USE_PYLONG_INTERNALS
469 #undef SHIFT
470 #undef BASE
471 #undef MASK
472 #ifdef SIZEOF_VOID_P
473 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
474 #endif
475#endif
476#ifndef __has_attribute
477 #define __has_attribute(x) 0
478#endif
479#ifndef __has_cpp_attribute
480 #define __has_cpp_attribute(x) 0
481#endif
482#ifndef CYTHON_RESTRICT
483 #if defined(__GNUC__)
484 #define CYTHON_RESTRICT __restrict__
485 #elif defined(_MSC_VER) && _MSC_VER >= 1400
486 #define CYTHON_RESTRICT __restrict
487 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
488 #define CYTHON_RESTRICT restrict
489 #else
490 #define CYTHON_RESTRICT
491 #endif
492#endif
493#ifndef CYTHON_UNUSED
494 #if defined(__cplusplus)
495 /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
496 * but leads to warnings with -pedantic, since it is a C++17 feature */
497 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
498 #if __has_cpp_attribute(maybe_unused)
499 #define CYTHON_UNUSED [[maybe_unused]]
500 #endif
501 #endif
502 #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
503 #define CYTHON_UNUSED [[maybe_unused]]
504 #endif
505#endif
506#ifndef CYTHON_UNUSED
507# if defined(__GNUC__)
508# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
509# define CYTHON_UNUSED __attribute__ ((__unused__))
510# else
511# define CYTHON_UNUSED
512# endif
513# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
514# define CYTHON_UNUSED __attribute__ ((__unused__))
515# else
516# define CYTHON_UNUSED
517# endif
518#endif
519#ifndef CYTHON_UNUSED_VAR
520# if defined(__cplusplus)
521 template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
522# else
523# define CYTHON_UNUSED_VAR(x) (void)(x)
524# endif
525#endif
526#ifndef CYTHON_MAYBE_UNUSED_VAR
527 #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
528#endif
529#ifndef CYTHON_NCP_UNUSED
530# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
531# define CYTHON_NCP_UNUSED
532# else
533# define CYTHON_NCP_UNUSED CYTHON_UNUSED
534# endif
535#endif
536#ifndef CYTHON_USE_CPP_STD_MOVE
537 #if defined(__cplusplus) && (\
538 __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
539 #define CYTHON_USE_CPP_STD_MOVE 1
540 #else
541 #define CYTHON_USE_CPP_STD_MOVE 0
542 #endif
543#endif
544#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
545#include <stdint.h>
546typedef uintptr_t __pyx_uintptr_t;
547#ifndef CYTHON_FALLTHROUGH
548 #if defined(__cplusplus)
549 /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
550 * but leads to warnings with -pedantic, since it is a C++17 feature */
551 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
552 #if __has_cpp_attribute(fallthrough)
553 #define CYTHON_FALLTHROUGH [[fallthrough]]
554 #endif
555 #endif
556 #ifndef CYTHON_FALLTHROUGH
557 #if __has_cpp_attribute(clang::fallthrough)
558 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
559 #elif __has_cpp_attribute(gnu::fallthrough)
560 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
561 #endif
562 #endif
563 #endif
564 #ifndef CYTHON_FALLTHROUGH
565 #if __has_attribute(fallthrough)
566 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
567 #else
568 #define CYTHON_FALLTHROUGH
569 #endif
570 #endif
571 #if defined(__clang__) && defined(__apple_build_version__)
572 #if __apple_build_version__ < 7000000
573 #undef CYTHON_FALLTHROUGH
574 #define CYTHON_FALLTHROUGH
575 #endif
576 #endif
577#endif
578#ifdef Py_UNREACHABLE
579 #define __Pyx_UNREACHABLE() Py_UNREACHABLE()
580#elif __Pyx_has_cbuiltin(__builtin_unreachable)
581 #define __Pyx_UNREACHABLE() __builtin_unreachable()
582#elif defined(__clang__) || defined(__INTEL_COMPILER) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)))
583 #define __Pyx_UNREACHABLE() __builtin_unreachable()
584#elif defined(_MSC_VER)
585 #define __Pyx_UNREACHABLE() __assume(0)
586#else
587 #define __Pyx_UNREACHABLE() Py_FatalError("Unreachable C code path reached")
588#endif
589#ifndef Py_UNREACHABLE
590 #define Py_UNREACHABLE() __Pyx_UNREACHABLE()
591#endif
592#ifdef __cplusplus
593 template <typename T>
594 struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
595 #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
596#else
597 #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
598#endif
599#if CYTHON_COMPILING_IN_PYPY == 1
600 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x030A0000)
601#else
602 #define __PYX_NEED_TP_PRINT_SLOT 0
603#endif
604#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
605#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
606#define __Pyx_PyErr_FetchException(petype, peval, petb) PyErr_Fetch(petype, peval, petb)
607#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_Restore(etype, eval, etb)
608#else
609#define __Pyx_PyErr_FetchException(petype, peval, petb) *(petype)=NULL; *(peval)=PyErr_GetRaisedException(); *(petb)=NULL
610#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_SetRaisedException(eval)
611#endif
612
613/* CInitCode */
614#ifndef CYTHON_INLINE
615 #if defined(__clang__)
616 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
617 #elif defined(__GNUC__)
618 #define CYTHON_INLINE __inline__
619 #elif defined(_MSC_VER)
620 #define CYTHON_INLINE __inline
621 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
622 #define CYTHON_INLINE inline
623 #else
624 #define CYTHON_INLINE
625 #endif
626#endif
627
628/* PythonCompatibility */
629#define __PYX_BUILD_PY_SSIZE_T "n"
630#define CYTHON_FORMAT_SSIZE_T "z"
631#define __Pyx_BUILTIN_MODULE_NAME "builtins"
632#define __Pyx_DefaultClassType PyType_Type
633#if CYTHON_COMPILING_IN_LIMITED_API
634 #ifndef CO_OPTIMIZED
635 static int CO_OPTIMIZED;
636 #endif
637 #ifndef CO_NEWLOCALS
638 static int CO_NEWLOCALS;
639 #endif
640 #ifndef CO_VARARGS
641 static int CO_VARARGS;
642 #endif
643 #ifndef CO_VARKEYWORDS
644 static int CO_VARKEYWORDS;
645 #endif
646 #ifndef CO_ASYNC_GENERATOR
647 static int CO_ASYNC_GENERATOR;
648 #endif
649 #ifndef CO_GENERATOR
650 static int CO_GENERATOR;
651 #endif
652 #ifndef CO_COROUTINE
653 static int CO_COROUTINE;
654 #endif
655#else
656 #ifndef CO_COROUTINE
657 #define CO_COROUTINE 0x80
658 #endif
659 #ifndef CO_ASYNC_GENERATOR
660 #define CO_ASYNC_GENERATOR 0x200
661 #endif
662#endif
663static int __Pyx_init_co_variables(void);
664#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
665 #define __Pyx_Py_Is(x, y) Py_Is(x, y)
666#else
667 #define __Pyx_Py_Is(x, y) ((x) == (y))
668#endif
669#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
670 #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
671#else
672 #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
673#endif
674#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
675 #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
676#else
677 #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
678#endif
679#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
680 #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
681#else
682 #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
683#endif
684#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
685#if CYTHON_COMPILING_IN_PYPY
686 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
687#else
688 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
689#endif
690#if CYTHON_COMPILING_IN_LIMITED_API
691static unsigned long __Pyx_Runtime_TPFLAGS_SEQUENCE;
692static unsigned long __Pyx_Runtime_TPFLAGS_MAPPING;
693#else
694#define __Pyx_Runtime_TPFLAGS_SEQUENCE Py_TPFLAGS_SEQUENCE
695#define __Pyx_Runtime_TPFLAGS_MAPPING Py_TPFLAGS_MAPPING
696#endif
697static int __Pyx_init_tpflags_variables(void);
698#ifndef Py_TPFLAGS_HAVE_FINALIZE
699 #define Py_TPFLAGS_HAVE_FINALIZE 0
700#endif
701#ifndef Py_TPFLAGS_SEQUENCE
702 #define Py_TPFLAGS_SEQUENCE (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 5)
703#endif
704#ifndef Py_TPFLAGS_MAPPING
705 #define Py_TPFLAGS_MAPPING (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 6)
706#endif
707#ifndef Py_TPFLAGS_IMMUTABLETYPE
708 #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
709#endif
710#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
711 #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
712#endif
713#ifndef METH_STACKLESS
714 #define METH_STACKLESS 0
715#endif
716#if !defined(METH_FASTCALL) || CYTHON_COMPILING_IN_PYPY
717 #ifndef METH_FASTCALL
718 #define METH_FASTCALL 0x80
719 #endif
720 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
721 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
722 Py_ssize_t nargs, PyObject *kwnames);
723#else
724 #if PY_VERSION_HEX >= 0x030d00A4
725 # define __Pyx_PyCFunctionFast PyCFunctionFast
726 # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
727 #else
728 # define __Pyx_PyCFunctionFast _PyCFunctionFast
729 # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
730 #endif
731#endif
732#if CYTHON_VECTORCALL
733 #define __Pyx_METH_FASTCALL METH_FASTCALL
734 #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
735 #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
736#else
737 #define __Pyx_METH_FASTCALL METH_VARARGS
738 #define __Pyx_PyCFunction_FastCall PyCFunction
739 #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
740#endif
741#if CYTHON_VECTORCALL
742 #define __pyx_vectorcallfunc vectorcallfunc
743 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
744 #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
745#else
746 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
747 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
748#endif
749#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
750#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
751#if CYTHON_COMPILING_IN_CPYTHON
752#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
753#elif !CYTHON_COMPILING_IN_LIMITED_API
754#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
755#endif
756#if CYTHON_COMPILING_IN_CPYTHON
757#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
758static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
759 return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
760}
761#endif
762static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) {
763#if CYTHON_COMPILING_IN_LIMITED_API
764 return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
765#else
766 return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
767#endif
768}
769#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
770#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
771 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
772#else
773 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
774#endif
775#if CYTHON_COMPILING_IN_PYPY
776 typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
777#else
778 #define __Pyx_PyCMethod PyCMethod
779#endif
780#ifndef METH_METHOD
781 #define METH_METHOD 0x200
782#endif
783#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
784 #define PyObject_Malloc(s) PyMem_Malloc(s)
785 #define PyObject_Free(p) PyMem_Free(p)
786 #define PyObject_Realloc(p) PyMem_Realloc(p)
787#endif
788#if CYTHON_COMPILING_IN_LIMITED_API
789 #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
790#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
791 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
792 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno))
793#elif CYTHON_COMPILING_IN_GRAAL
794 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
795 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
796#else
797 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
798 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
799#endif
800#if CYTHON_COMPILING_IN_LIMITED_API
801 #define __Pyx_PyThreadState_Current PyThreadState_Get()
802#elif !CYTHON_FAST_THREAD_STATE
803 #define __Pyx_PyThreadState_Current PyThreadState_GET()
804#elif PY_VERSION_HEX >= 0x030d00A1
805 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
806#else
807 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
808#endif
809#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
810 #define __PYX_SHARED_SIZEOF(T) -((int)sizeof(T))
811 #define __PYX_SHARED_RELATIVE_OFFSET Py_RELATIVE_OFFSET
812 #define CYTHON_OPAQUE_SHARED_TYPES 1
813#else
814 #define __PYX_SHARED_SIZEOF(T) sizeof(T)
815 #define __PYX_SHARED_RELATIVE_OFFSET 0
816 #define CYTHON_OPAQUE_SHARED_TYPES 0
817#endif
818#if CYTHON_USE_MODULE_STATE
819static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op)
820{
821 void *result;
822 result = PyModule_GetState(op);
823 if (!result)
824 Py_FatalError("Couldn't find the module state");
825 return result;
826}
827#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
828#else
829#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
830#endif
831#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
832#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
833#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
834#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
835#if CYTHON_USE_TYPE_SLOTS
836 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
837 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
838 #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
839 #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
840#else
841 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
842 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
843 ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
844 (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
845 __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
846 #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
847 #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
848#endif
849#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
850#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
851#else
852#define __Pyx_PyDict_NewPresized(n) PyDict_New()
853#endif
854#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
855#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
856#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
857#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
858static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
859 PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
860 if (res == NULL && PyErr_Occurred()) {
861 PyErr_WriteUnraisable(NULL);
862 }
863 return res;
864}
865#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
866#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
867#define __Pyx_PyDict_GetItemStr PyDict_GetItem
868#else
869static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
870#if CYTHON_COMPILING_IN_PYPY
871 return PyDict_GetItem(dict, name);
872#else
873 PyDictEntry *ep;
874 PyDictObject *mp = (PyDictObject*) dict;
875 long hash = ((PyStringObject *) name)->ob_shash;
876 assert(hash != -1);
877 ep = (mp->ma_lookup)(mp, name, hash);
878 if (ep == NULL) {
879 return NULL;
880 }
881 return ep->me_value;
882#endif
883}
884#define __Pyx_PyDict_GetItemStr PyDict_GetItem
885#endif
886#if CYTHON_USE_TYPE_SLOTS
887 #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
888 #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
889#else
890 #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
891 #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
892#endif
893#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
894#if CYTHON_USE_TYPE_SPECS
895#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
896 PyTypeObject *type = Py_TYPE((PyObject*)obj);\
897 assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
898 PyObject_GC_Del(obj);\
899 Py_DECREF(type);\
900}
901#else
902#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
903#endif
904#if CYTHON_COMPILING_IN_LIMITED_API
905 #define __Pyx_PyUnicode_READY(op) (0)
906 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
907 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
908 #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
909 #define __Pyx_PyUnicode_KIND_04(u) __Pyx_PyUnicode_KIND(u)
910 #define __Pyx_PyUnicode_DATA(u) ((void*)u)
911 #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
912 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
913#else
914 #if PY_VERSION_HEX >= 0x030C0000
915 #define __Pyx_PyUnicode_READY(op) (0)
916 #else
917 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
918 0 : _PyUnicode_Ready((PyObject *)(op)))
919 #endif
920 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
921 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
922 #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
923 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
924 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
925 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
926 #if PY_VERSION_HEX >= 0x030C0000
927 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
928 #else
929 #if CYTHON_COMPILING_IN_CPYTHON
930 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
931 #else
932 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
933 #endif
934 #endif
935 static CYTHON_INLINE int __Pyx_PyUnicode_KIND_04(PyObject *o) {
936 return __Pyx_PyUnicode_KIND(o) - (int) !!PyUnicode_IS_ASCII(o);
937 }
938#endif
939#if CYTHON_COMPILING_IN_PYPY
940 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
941 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
942#else
943 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
944 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
945 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
946#endif
947#if CYTHON_COMPILING_IN_PYPY
948 #if !defined(PyUnicode_DecodeUnicodeEscape)
949 #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
950 #endif
951 #if !defined(PyUnicode_Contains)
952 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
953 #endif
954 #if !defined(PyByteArray_Check)
955 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
956 #endif
957 #if !defined(PyObject_Format)
958 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
959 #endif
960#endif
961#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
962#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
963 #define __Pyx_PySequence_ListKeepNew(obj)\
964 (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
965#elif CYTHON_COMPILING_IN_CPYTHON
966 #define __Pyx_PySequence_ListKeepNew(obj)\
967 (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
968#else
969 #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
970#endif
971#ifndef PySet_CheckExact
972 #define PySet_CheckExact(obj) Py_IS_TYPE(obj, &PySet_Type)
973#endif
974enum __Pyx_ReferenceSharing {
975 __Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check
976 __Pyx_ReferenceSharing_OwnStrongReference,
977 __Pyx_ReferenceSharing_FunctionArgument,
978 __Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar
979};
980#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
981#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
982 (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
983 (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
984 (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
985#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
986#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
987#else
988#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
989#endif
990#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
991 #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
992#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
993 #if CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
994 #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
995 #else
996 #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
997 #endif
998#elif CYTHON_COMPILING_IN_LIMITED_API || !(CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE)
999 #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
1000#else
1001 #define __Pyx_PyList_GetItemRef(o, i) (likely(__Pyx_is_valid_index(i, PyList_GET_SIZE(o))) ?\
1002 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1003#endif
1004#if CYTHON_AVOID_BORROWED_REFS || CYTHON_COMPILING_IN_LIMITED_API
1005 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1006 __Pyx_PyList_GetItemRef(o, i))
1007#elif CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1008 #if CYTHON_ASSUME_SAFE_MACROS
1009 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1010 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1011 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1012 #else
1013 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1014 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1015 __Pyx_XNewRef(PyList_GetItem(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1016 #endif
1017#elif CYTHON_ASSUME_SAFE_MACROS
1018 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1019 __Pyx_NewRef(PyList_GET_ITEM(o, i)))
1020#else
1021 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1022 __Pyx_XNewRef(PyList_GetItem(o, i)))
1023#endif
1024#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1025#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
1026#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1027static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1028 *result = PyObject_GetItem(dict, key);
1029 if (*result == NULL) {
1030 if (PyErr_ExceptionMatches(PyExc_KeyError)) {
1031 PyErr_Clear();
1032 return 0;
1033 }
1034 return -1;
1035 }
1036 return 1;
1037}
1038#else
1039static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1040 *result = PyDict_GetItemWithError(dict, key);
1041 if (*result == NULL) {
1042 return PyErr_Occurred() ? -1 : 0;
1043 }
1044 Py_INCREF(*result);
1045 return 1;
1046}
1047#endif
1048#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
1049 #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj)
1050#else
1051 #define __Pyx_VISIT_CONST(obj)
1052#endif
1053#if CYTHON_ASSUME_SAFE_MACROS
1054 #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
1055 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
1056 #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
1057 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
1058 #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
1059 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
1060#else
1061 #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
1062 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
1063 #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
1064 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
1065 #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
1066 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
1067#endif
1068#if CYTHON_ASSUME_SAFE_SIZE
1069 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
1070 #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
1071 #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
1072 #define __Pyx_PyDict_GET_SIZE(o) PyDict_GET_SIZE(o)
1073 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
1074 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
1075 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
1076#else
1077 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
1078 #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
1079 #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
1080 #define __Pyx_PyDict_GET_SIZE(o) PyDict_Size(o)
1081 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1082 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1083 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
1084#endif
1085#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
1086 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1087#endif
1088#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
1089#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t
1090#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1091 #define __Pyx_PySendResult PySendResult
1092#else
1093 typedef enum {
1094 PYGEN_RETURN = 0,
1095 PYGEN_ERROR = -1,
1096 PYGEN_NEXT = 1,
1097 } __Pyx_PySendResult;
1098#endif
1099#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
1100 typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
1101#else
1102 #define __Pyx_pyiter_sendfunc sendfunc
1103#endif
1104#if !CYTHON_USE_AM_SEND
1105#define __PYX_HAS_PY_AM_SEND 0
1106#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1107#define __PYX_HAS_PY_AM_SEND 1
1108#else
1109#define __PYX_HAS_PY_AM_SEND 2 // our own backported implementation
1110#endif
1111#if __PYX_HAS_PY_AM_SEND < 2
1112 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1113#else
1114 typedef struct {
1115 unaryfunc am_await;
1116 unaryfunc am_aiter;
1117 unaryfunc am_anext;
1118 __Pyx_pyiter_sendfunc am_send;
1119 } __Pyx_PyAsyncMethodsStruct;
1120 #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
1121#endif
1122#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
1123 #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
1124#else
1125 #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
1126#endif
1127#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
1128#ifdef __cplusplus
1129extern "C"
1130#endif
1131PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
1132#endif
1133#if CYTHON_COMPILING_IN_LIMITED_API
1134static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) {
1135 int value;
1136 PyObject *py_value = PyObject_GetAttrString(inspect, name);
1137 if (!py_value) return 0;
1138 value = (int) PyLong_AsLong(py_value);
1139 Py_DECREF(py_value);
1140 *write_to = value;
1141 return value != -1 || !PyErr_Occurred();
1142}
1143static int __Pyx_init_co_variables(void) {
1144 PyObject *inspect;
1145 int result;
1146 inspect = PyImport_ImportModule("inspect");
1147 result =
1148#if !defined(CO_OPTIMIZED)
1149 __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) &&
1150#endif
1151#if !defined(CO_NEWLOCALS)
1152 __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) &&
1153#endif
1154#if !defined(CO_VARARGS)
1155 __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) &&
1156#endif
1157#if !defined(CO_VARKEYWORDS)
1158 __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
1159#endif
1160#if !defined(CO_ASYNC_GENERATOR)
1161 __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
1162#endif
1163#if !defined(CO_GENERATOR)
1164 __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) &&
1165#endif
1166#if !defined(CO_COROUTINE)
1167 __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) &&
1168#endif
1169 1;
1170 Py_DECREF(inspect);
1171 return result ? 0 : -1;
1172}
1173static int __Pyx_init_tpflags_bitcount(unsigned long flag) {
1174 int count = 0;
1175 while (flag) {
1176 count += (int) (flag & 1);
1177 flag >>= 1;
1178 }
1179 return count;
1180}
1181static int __Pyx_init_tpflags_variables(void) {
1182 if (__Pyx_Runtime_TPFLAGS_SEQUENCE != 0 && __Pyx_Runtime_TPFLAGS_MAPPING != 0) {
1183 return 0;
1184 }
1185 PyObject *collections_abc = PyImport_ImportModule("collections.abc");
1186 if (!collections_abc) return -1;
1187 int result = 0;
1188 PyObject *sequence = NULL, *mapping = NULL;
1189#if __PYX_LIMITED_VERSION_HEX >= 0x030D0000
1190 if (PyObject_GetOptionalAttrString(collections_abc, "Sequence", &sequence) != 1) goto fail;
1191 if (PyObject_GetOptionalAttrString(collections_abc, "Mapping", &mapping) != 1) goto fail;
1192#else
1193 sequence = PyObject_GetAttrString(collections_abc, "Sequence");
1194 if (!sequence) goto fail_attr_lookup;
1195 mapping = PyObject_GetAttrString(collections_abc, "Mapping");
1196 if (!mapping) goto fail_attr_lookup;
1197#endif
1198 if (!PyType_Check(sequence) || !PyType_Check(mapping)) goto fail;
1199 {
1200 unsigned long sequence_flags = PyType_GetFlags((PyTypeObject*)sequence);
1201 unsigned long mapping_flags = PyType_GetFlags((PyTypeObject*)mapping);
1202 unsigned long mutual_flags = sequence_flags & mapping_flags;
1203 sequence_flags = sequence_flags ^ mutual_flags;
1204 mapping_flags = mapping_flags ^ mutual_flags;
1205 if (__Pyx_Runtime_TPFLAGS_SEQUENCE == 0 && __Pyx_init_tpflags_bitcount(sequence_flags) == 1) {
1206 __Pyx_Runtime_TPFLAGS_SEQUENCE = sequence_flags;
1207 }
1208 if (__Pyx_Runtime_TPFLAGS_MAPPING == 0 && __Pyx_init_tpflags_bitcount(mapping_flags) == 1) {
1209 __Pyx_Runtime_TPFLAGS_MAPPING = mapping_flags;
1210 }
1211 }
1212 cleanup:
1213 Py_XDECREF(mapping);
1214 Py_XDECREF(sequence);
1215 Py_DECREF(collections_abc);
1216 return result;
1217#if __PYX_LIMITED_VERSION_HEX < 0x030D0000
1218 fail_attr_lookup:
1219 if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
1220 PyErr_Clear();
1221 }
1222#endif
1223 fail:
1224 result = PyErr_Occurred() ? -1 : 0;
1225 goto cleanup;
1226}
1227#else
1228static int __Pyx_init_co_variables(void) {
1229 return 0; // It's a limited API-only feature
1230}
1231static int __Pyx_init_tpflags_variables(void) {
1232 return 0; // It's a limited API-only feature
1233}
1234#endif
1235
1236/* MathInitCode */
1237#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1238 #ifndef _USE_MATH_DEFINES
1239 #define _USE_MATH_DEFINES
1240 #endif
1241#endif
1242#include <math.h>
1243#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1244#define __Pyx_truncl trunc
1245#else
1246#define __Pyx_truncl truncl
1247#endif
1248
1249#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1250#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 1
1251#endif
1252#ifndef CYTHON_CLINE_IN_TRACEBACK
1253#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1254#endif
1255#if CYTHON_CLINE_IN_TRACEBACK
1256#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; }
1257#else
1258#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; }
1259#endif
1260#define __PYX_ERR(f_index, lineno, Ln_error) \
1261 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1262
1263#ifdef CYTHON_EXTERN_C
1264 #undef __PYX_EXTERN_C
1265 #define __PYX_EXTERN_C CYTHON_EXTERN_C
1266#elif defined(__PYX_EXTERN_C)
1267 #ifdef _MSC_VER
1268 #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1269 #else
1270 #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1271 #endif
1272#else
1273 #ifdef __cplusplus
1274 #define __PYX_EXTERN_C extern "C"
1275 #else
1276 #define __PYX_EXTERN_C extern
1277 #endif
1278#endif
1279
1280#define __PYX_HAVE__Isosurface
1281#define __PYX_HAVE_API__Isosurface
1282/* Early includes */
1283#include <string.h>
1284#include <stdio.h>
1285
1286 /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */
1287
1288#include "numpy/arrayobject.h"
1289#include "numpy/ndarrayobject.h"
1290#include "numpy/ndarraytypes.h"
1291#include "numpy/arrayscalars.h"
1292#include "numpy/ufuncobject.h"
1293#include <math.h>
1294#ifdef _OPENMP
1295#include <omp.h>
1296#endif /* _OPENMP */
1297
1298#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1299#define CYTHON_WITHOUT_ASSERTIONS
1300#endif
1301
1302#ifdef CYTHON_FREETHREADING_COMPATIBLE
1303#if CYTHON_FREETHREADING_COMPATIBLE
1304#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
1305#else
1306#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1307#endif
1308#else
1309#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1310#endif
1311#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1312#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1313#define __PYX_DEFAULT_STRING_ENCODING ""
1314#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1315#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1316#define __Pyx_uchar_cast(c) ((unsigned char)c)
1317#define __Pyx_long_cast(x) ((long)x)
1318#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1319 (sizeof(type) < sizeof(Py_ssize_t)) ||\
1320 (sizeof(type) > sizeof(Py_ssize_t) &&\
1321 likely(v < (type)PY_SSIZE_T_MAX ||\
1322 v == (type)PY_SSIZE_T_MAX) &&\
1323 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1324 v == (type)PY_SSIZE_T_MIN))) ||\
1325 (sizeof(type) == sizeof(Py_ssize_t) &&\
1326 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1327 v == (type)PY_SSIZE_T_MAX))) )
1328static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1329 return (size_t) i < (size_t) limit;
1330}
1331#if defined (__cplusplus) && __cplusplus >= 201103L
1332 #include <cstdlib>
1333 #define __Pyx_sst_abs(value) std::abs(value)
1334#elif SIZEOF_INT >= SIZEOF_SIZE_T
1335 #define __Pyx_sst_abs(value) abs(value)
1336#elif SIZEOF_LONG >= SIZEOF_SIZE_T
1337 #define __Pyx_sst_abs(value) labs(value)
1338#elif defined (_MSC_VER)
1339 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1340#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1341 #define __Pyx_sst_abs(value) llabs(value)
1342#elif defined (__GNUC__)
1343 #define __Pyx_sst_abs(value) __builtin_llabs(value)
1344#else
1345 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1346#endif
1347static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
1348static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
1349static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1350static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
1351#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1352#define __Pyx_PyBytes_FromString PyBytes_FromString
1353#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1354static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
1355#if CYTHON_ASSUME_SAFE_MACROS
1356 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1357 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1358 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1359 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1360 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1361 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1362 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
1363#else
1364 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s))
1365 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s))
1366 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s))
1367 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s))
1368 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s))
1369 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s))
1370 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
1371#endif
1372#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1373#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1374#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1375#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1376#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1377#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1378#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1379#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1380#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1381#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1382#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1383static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
1384#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
1385 return Py_NewRef(obj);
1386#else
1387 Py_INCREF(obj);
1388 return obj;
1389#endif
1390}
1391static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
1392#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
1393 return Py_XNewRef(obj);
1394#else
1395 Py_XINCREF(obj);
1396 return obj;
1397#endif
1398}
1399static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b);
1400static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
1401static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
1402static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1403static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x);
1404#define __Pyx_PyObject_RichCompareBool(a,b,cmp) __Pyx_PyObject_IsTrueAndDecref(PyObject_RichCompare((a),(b),(cmp)))
1405#define __Pyx_PySequence_Tuple(obj)\
1406 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1407static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1408static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t);
1409static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1410#if CYTHON_ASSUME_SAFE_MACROS
1411#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1412#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
1413#define __Pyx_PyFloat_IsNonZero(x) (PyFloat_AS_DOUBLE(x) != 0.0)
1414#else
1415#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1416#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
1417#define __Pyx_PyFloat_IsNonZero(x) PyObject_IsTrue(x)
1418#endif
1419#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
1420#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1421#if CYTHON_USE_PYLONG_INTERNALS
1422 #if PY_VERSION_HEX >= 0x030C00A7
1423 #ifndef _PyLong_SIGN_MASK
1424 #define _PyLong_SIGN_MASK 3
1425 #endif
1426 #ifndef _PyLong_NON_SIZE_BITS
1427 #define _PyLong_NON_SIZE_BITS 3
1428 #endif
1429 #define __Pyx_PyLong_SignBits(x) ((int) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK))
1430 #define __Pyx_PyLong_Sign(x) (1 - __Pyx_PyLong_SignBits(x))
1431 #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_SignBits(x) & 2) != 0)
1432 #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1433 #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_SignBits(x) & 1)
1434 #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_SignBits(x) == 0)
1435 #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1436 #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1437 #define __Pyx_PyLong_SignedDigitCount(x)\
1438 (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1439 #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1440 #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1441 #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1442 #else
1443 #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1444 #define __Pyx_PyLong_CompactValue(x) (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1445 #endif
1446 static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_CompareSignAndSize(PyObject *a, PyObject *b) {
1447 uintptr_t tag_a = ((PyLongObject*)a)->long_value.lv_tag;
1448 uintptr_t tag_b = ((PyLongObject*)b)->long_value.lv_tag;
1449 if (tag_a == tag_b) return 0;
1450 int sign_a = (int) (tag_a & _PyLong_SIGN_MASK);
1451 int sign_b = (int) (tag_b & _PyLong_SIGN_MASK);
1452 if (sign_a > sign_b) return -1;
1453 if (sign_a < sign_b) return 1;
1454 Py_ssize_t size_a = (Py_ssize_t) (tag_a >> _PyLong_NON_SIZE_BITS);
1455 Py_ssize_t size_b = (Py_ssize_t) (tag_b >> _PyLong_NON_SIZE_BITS);
1456 return (1 - sign_a) * (size_a - size_b);
1457 }
1458 typedef Py_ssize_t __Pyx_compact_pylong;
1459 typedef size_t __Pyx_compact_upylong;
1460 #else
1461 #define __Pyx_PyLong_Sign(x) ((int) ((Py_SIZE(x) == 0) ? 0 : (Py_SIZE(x) < 0) ? -1 : 1))
1462 #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1463 #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1464 #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1465 #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1466 #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1467 #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1468 #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1469 #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1470 #define __Pyx_PyLong_CompactValue(x)\
1471 ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1472 #define __Pyx_PyLong_CompareSignAndSize(a, b) (Py_SIZE(a) - Py_SIZE(b))
1473 typedef sdigit __Pyx_compact_pylong;
1474 typedef digit __Pyx_compact_upylong;
1475 #endif
1476 #if PY_VERSION_HEX >= 0x030C00A5
1477 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1478 #else
1479 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1480 #endif
1481 #define __Pyx_PyLong_IsNonZero(x) (!__Pyx_PyLong_IsZero(x))
1482#else
1483 #define __Pyx_PyLong_IsNonZero(x) PyObject_IsTrue(x)
1484#endif
1485#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
1486 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1487#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1488 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
1489#else
1490 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1491#endif
1492
1493
1494/* Test for GCC > 2.95 */
1495#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1496 #define likely(x) __builtin_expect(!!(x), 1)
1497 #define unlikely(x) __builtin_expect(!!(x), 0)
1498#else /* !__GNUC__ or GCC < 2.95 */
1499 #define likely(x) (x)
1500 #define unlikely(x) (x)
1501#endif /* __GNUC__ */
1502/* PretendToInitialize */
1503#ifdef __cplusplus
1504#if __cplusplus > 201103L
1505#include <type_traits>
1506#endif
1507template <typename T>
1508static void __Pyx_pretend_to_initialize(T* ptr) {
1509#if __cplusplus > 201103L
1510 if ((std::is_trivially_default_constructible<T>::value))
1511#endif
1512 *ptr = T();
1513 (void)ptr;
1514}
1515#else
1516static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1517#endif
1518
1519
1520#if !CYTHON_USE_MODULE_STATE
1521static PyObject *__pyx_m = NULL;
1522#endif
1523static const char * const __pyx_cfilenm = __FILE__;
1524
1525/* Header.proto */
1526#if !defined(CYTHON_CCOMPLEX)
1527 #if defined(__cplusplus)
1528 #define CYTHON_CCOMPLEX 1
1529 #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
1530 #define CYTHON_CCOMPLEX 1
1531 #else
1532 #define CYTHON_CCOMPLEX 0
1533 #endif
1534#endif
1535#if CYTHON_CCOMPLEX
1536 #ifdef __cplusplus
1537 #include <complex>
1538 #else
1539 #include <complex.h>
1540 #endif
1541#endif
1542#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1543 #undef _Complex_I
1544 #define _Complex_I 1.0fj
1545#endif
1546
1547/* #### Code section: filename_table ### */
1548
1549static const char* const __pyx_f[] = {
1550 "proteus/Isosurface.pyx",
1551 "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd",
1552 "cpython/type.pxd",
1553};
1554/* #### Code section: utility_code_proto_before_types ### */
1555/* BufferFormatStructs.proto (used by BufferFormatCheck) */
1556struct __Pyx_StructField_;
1557#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1558typedef struct {
1559 const char* name;
1560 const struct __Pyx_StructField_* fields;
1561 size_t size;
1562 size_t arraysize[8];
1563 int ndim;
1564 char typegroup;
1565 char is_unsigned;
1566 int flags;
1567} __Pyx_TypeInfo;
1568typedef struct __Pyx_StructField_ {
1569 const __Pyx_TypeInfo* type;
1570 const char* name;
1571 size_t offset;
1572} __Pyx_StructField;
1573typedef struct {
1574 const __Pyx_StructField* field;
1575 size_t parent_offset;
1576} __Pyx_BufFmt_StackElem;
1577typedef struct {
1578 __Pyx_StructField root;
1579 __Pyx_BufFmt_StackElem* head;
1580 size_t fmt_offset;
1581 size_t new_count, enc_count;
1582 size_t struct_alignment;
1583 int is_complex;
1584 char enc_type;
1585 char new_packmode;
1586 char enc_packmode;
1587 char is_valid_array;
1588} __Pyx_BufFmt_Context;
1589
1590/* Atomics.proto (used by UnpackUnboundCMethod) */
1591#include <pythread.h>
1592#ifndef CYTHON_ATOMICS
1593 #define CYTHON_ATOMICS 1
1594#endif
1595#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1596#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1597#define __pyx_atomic_int_type int
1598#define __pyx_nonatomic_int_type int
1599#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1600 (__STDC_VERSION__ >= 201112L) &&\
1601 !defined(__STDC_NO_ATOMICS__))
1602 #include <stdatomic.h>
1603#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1604 (__cplusplus >= 201103L) ||\
1605 (defined(_MSC_VER) && _MSC_VER >= 1700)))
1606 #include <atomic>
1607#endif
1608#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1609 (__STDC_VERSION__ >= 201112L) &&\
1610 !defined(__STDC_NO_ATOMICS__) &&\
1611 ATOMIC_INT_LOCK_FREE == 2)
1612 #undef __pyx_atomic_int_type
1613 #define __pyx_atomic_int_type atomic_int
1614 #define __pyx_atomic_ptr_type atomic_uintptr_t
1615 #define __pyx_nonatomic_ptr_type uintptr_t
1616 #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
1617 #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
1618 #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
1619 #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
1620 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1621 #define __pyx_atomic_load(value) atomic_load(value)
1622 #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
1623 #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
1624 #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
1625 #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1626 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1627 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1628 #pragma message ("Using standard C atomics")
1629 #elif defined(__PYX_DEBUG_ATOMICS)
1630 #warning "Using standard C atomics"
1631 #endif
1632#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1633 (__cplusplus >= 201103L) ||\
1634\
1635 (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
1636 ATOMIC_INT_LOCK_FREE == 2)
1637 #undef __pyx_atomic_int_type
1638 #define __pyx_atomic_int_type std::atomic_int
1639 #define __pyx_atomic_ptr_type std::atomic_uintptr_t
1640 #define __pyx_nonatomic_ptr_type uintptr_t
1641 #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
1642 #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
1643 #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
1644 #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
1645 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1646 #define __pyx_atomic_load(value) std::atomic_load(value)
1647 #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
1648 #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
1649 #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
1650 #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1651 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1652 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1653 #pragma message ("Using standard C++ atomics")
1654 #elif defined(__PYX_DEBUG_ATOMICS)
1655 #warning "Using standard C++ atomics"
1656 #endif
1657#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1658 (__GNUC_MINOR__ > 1 ||\
1659 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1660 #define __pyx_atomic_ptr_type void*
1661 #define __pyx_nonatomic_ptr_type void*
1662 #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
1663 #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
1664 #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
1665 #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
1666 static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1667 __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
1668 int result = old == *expected;
1669 *expected = old;
1670 return result;
1671 }
1672 #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
1673 #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
1674 #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
1675 #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
1676 #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
1677 static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1678 __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
1679 int result = old == *expected;
1680 *expected = old;
1681 return result;
1682 }
1683 #ifdef __PYX_DEBUG_ATOMICS
1684 #warning "Using GNU atomics"
1685 #endif
1686#elif CYTHON_ATOMICS && defined(_MSC_VER)
1687 #include <intrin.h>
1688 #undef __pyx_atomic_int_type
1689 #define __pyx_atomic_int_type long
1690 #define __pyx_atomic_ptr_type void*
1691 #undef __pyx_nonatomic_int_type
1692 #define __pyx_nonatomic_int_type long
1693 #define __pyx_nonatomic_ptr_type void*
1694 #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
1695 #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
1696 #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
1697 #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
1698 #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
1699 static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1700 __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
1701 int result = old == *expected;
1702 *expected = old;
1703 return result;
1704 }
1705 #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
1706 #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
1707 #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
1708 #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
1709 #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
1710 static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1711 __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
1712 int result = old == *expected;
1713 *expected = old;
1714 return result;
1715 }
1716 #ifdef __PYX_DEBUG_ATOMICS
1717 #pragma message ("Using MSVC atomics")
1718 #endif
1719#else
1720 #undef CYTHON_ATOMICS
1721 #define CYTHON_ATOMICS 0
1722 #ifdef __PYX_DEBUG_ATOMICS
1723 #warning "Not using atomics"
1724 #endif
1725#endif
1726
1727/* CriticalSectionsDefinition.proto (used by CriticalSections) */
1728#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1729#define __Pyx_PyCriticalSection void*
1730#define __Pyx_PyCriticalSection2 void*
1731#define __Pyx_PyCriticalSection_End(cs)
1732#define __Pyx_PyCriticalSection2_End(cs)
1733#else
1734#define __Pyx_PyCriticalSection PyCriticalSection
1735#define __Pyx_PyCriticalSection2 PyCriticalSection2
1736#define __Pyx_PyCriticalSection_End PyCriticalSection_End
1737#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
1738#endif
1739
1740/* CriticalSections.proto (used by ParseKeywordsImpl) */
1741#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1742#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs)
1743#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs)
1744#else
1745#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
1746#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
1747#endif
1748#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
1749#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
1750#define __Pyx_END_CRITICAL_SECTION() }
1751#else
1752#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
1753#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
1754#endif
1755
1756/* IncludeStructmemberH.proto (used by CythonFunctionShared) */
1757#include <structmember.h>
1758
1759/* #### Code section: numeric_typedefs ### */
1760
1761/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":761
1762 * # in Cython to enable them only on the right systems.
1763 *
1764 * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1765 * ctypedef npy_int16 int16_t
1766 * ctypedef npy_int32 int32_t
1767*/
1768typedef npy_int8 __pyx_t_5numpy_int8_t;
1769
1770/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":762
1771 *
1772 * ctypedef npy_int8 int8_t
1773 * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1774 * ctypedef npy_int32 int32_t
1775 * ctypedef npy_int64 int64_t
1776*/
1777typedef npy_int16 __pyx_t_5numpy_int16_t;
1778
1779/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":763
1780 * ctypedef npy_int8 int8_t
1781 * ctypedef npy_int16 int16_t
1782 * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1783 * ctypedef npy_int64 int64_t
1784 *
1785*/
1786typedef npy_int32 __pyx_t_5numpy_int32_t;
1787
1788/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":764
1789 * ctypedef npy_int16 int16_t
1790 * ctypedef npy_int32 int32_t
1791 * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1792 *
1793 * ctypedef npy_uint8 uint8_t
1794*/
1795typedef npy_int64 __pyx_t_5numpy_int64_t;
1796
1797/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":766
1798 * ctypedef npy_int64 int64_t
1799 *
1800 * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1801 * ctypedef npy_uint16 uint16_t
1802 * ctypedef npy_uint32 uint32_t
1803*/
1804typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1805
1806/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":767
1807 *
1808 * ctypedef npy_uint8 uint8_t
1809 * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1810 * ctypedef npy_uint32 uint32_t
1811 * ctypedef npy_uint64 uint64_t
1812*/
1813typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1814
1815/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":768
1816 * ctypedef npy_uint8 uint8_t
1817 * ctypedef npy_uint16 uint16_t
1818 * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1819 * ctypedef npy_uint64 uint64_t
1820 *
1821*/
1822typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1823
1824/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":769
1825 * ctypedef npy_uint16 uint16_t
1826 * ctypedef npy_uint32 uint32_t
1827 * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1828 *
1829 * ctypedef npy_float32 float32_t
1830*/
1831typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1832
1833/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":771
1834 * ctypedef npy_uint64 uint64_t
1835 *
1836 * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1837 * ctypedef npy_float64 float64_t
1838 * #ctypedef npy_float80 float80_t
1839*/
1840typedef npy_float32 __pyx_t_5numpy_float32_t;
1841
1842/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":772
1843 *
1844 * ctypedef npy_float32 float32_t
1845 * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1846 * #ctypedef npy_float80 float80_t
1847 * #ctypedef npy_float128 float128_t
1848*/
1849typedef npy_float64 __pyx_t_5numpy_float64_t;
1850
1851/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":779
1852 * ctypedef double complex complex128_t
1853 *
1854 * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1855 * ctypedef npy_ulonglong ulonglong_t
1856 *
1857*/
1858typedef npy_longlong __pyx_t_5numpy_longlong_t;
1859
1860/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":780
1861 *
1862 * ctypedef npy_longlong longlong_t
1863 * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1864 *
1865 * ctypedef npy_intp intp_t
1866*/
1867typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1868
1869/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":782
1870 * ctypedef npy_ulonglong ulonglong_t
1871 *
1872 * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1873 * ctypedef npy_uintp uintp_t
1874 *
1875*/
1876typedef npy_intp __pyx_t_5numpy_intp_t;
1877
1878/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":783
1879 *
1880 * ctypedef npy_intp intp_t
1881 * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1882 *
1883 * ctypedef npy_double float_t
1884*/
1885typedef npy_uintp __pyx_t_5numpy_uintp_t;
1886
1887/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":785
1888 * ctypedef npy_uintp uintp_t
1889 *
1890 * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1891 * ctypedef npy_double double_t
1892 * ctypedef npy_longdouble longdouble_t
1893*/
1894typedef npy_double __pyx_t_5numpy_float_t;
1895
1896/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":786
1897 *
1898 * ctypedef npy_double float_t
1899 * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1900 * ctypedef npy_longdouble longdouble_t
1901 *
1902*/
1903typedef npy_double __pyx_t_5numpy_double_t;
1904
1905/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":787
1906 * ctypedef npy_double float_t
1907 * ctypedef npy_double double_t
1908 * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1909 *
1910 * ctypedef float complex cfloat_t
1911*/
1912typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1913/* #### Code section: complex_type_declarations ### */
1914/* Declarations.proto */
1915#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1916 #ifdef __cplusplus
1917 typedef ::std::complex< float > __pyx_t_float_complex;
1918 #else
1919 typedef float _Complex __pyx_t_float_complex;
1920 #endif
1921#else
1922 typedef struct { float real, imag; } __pyx_t_float_complex;
1923#endif
1924static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1925
1926/* Declarations.proto */
1927#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1928 #ifdef __cplusplus
1929 typedef ::std::complex< double > __pyx_t_double_complex;
1930 #else
1931 typedef double _Complex __pyx_t_double_complex;
1932 #endif
1933#else
1934 typedef struct { double real, imag; } __pyx_t_double_complex;
1935#endif
1936static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1937
1938/* Declarations.proto */
1939#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1940 #ifdef __cplusplus
1941 typedef ::std::complex< long double > __pyx_t_long_double_complex;
1942 #else
1943 typedef long double _Complex __pyx_t_long_double_complex;
1944 #endif
1945#else
1946 typedef struct { long double real, imag; } __pyx_t_long_double_complex;
1947#endif
1948static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double);
1949
1950/* #### Code section: type_declarations ### */
1951
1952/*--- Type declarations ---*/
1953struct __pyx_obj_10Isosurface___pyx_scope_struct__genexpr;
1954struct __pyx_opt_args_10Isosurface_EVec;
1955
1956/* "Isosurface.pyx":25
1957 * from libc.math cimport sqrt
1958 *
1959 * cdef np.ndarray[np.float64_t,ndim=1] EVec(double x=0.0, double y=0.0, double z=0.0): # <<<<<<<<<<<<<<
1960 * cdef np.ndarray [np.float64_t, ndim=1] v = np.zeros((3,),'d')
1961 * v[0] = x
1962*/
1963struct __pyx_opt_args_10Isosurface_EVec {
1964 int __pyx_n;
1965 double x;
1966 double y;
1967 double z;
1968};
1969
1970/* "Isosurface.pyx":122
1971 * self.exteriorElementBoundariesArray
1972 * ].flatten())
1973 * self.g2b = dict((gn, bn) for bn, gn in enumerate(self.boundaryNodes)) # <<<<<<<<<<<<<<
1974 * self.nodeArray = fine_grid.mesh.nodeArray
1975 * self.num_owned_elements = fine_grid.mesh.nElements_global
1976*/
1977struct __pyx_obj_10Isosurface___pyx_scope_struct__genexpr {
1978 PyObject_HEAD
1979 PyObject *__pyx_genexpr_arg_0;
1980 PyObject *__pyx_v_bn;
1981 PyObject *__pyx_v_gn;
1982};
1983
1984/* #### Code section: utility_code_proto ### */
1985
1986/* --- Runtime support code (head) --- */
1987/* Refnanny.proto */
1988#ifndef CYTHON_REFNANNY
1989 #define CYTHON_REFNANNY 0
1990#endif
1991#if CYTHON_REFNANNY
1992 typedef struct {
1993 void (*INCREF)(void*, PyObject*, Py_ssize_t);
1994 void (*DECREF)(void*, PyObject*, Py_ssize_t);
1995 void (*GOTREF)(void*, PyObject*, Py_ssize_t);
1996 void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
1997 void* (*SetupContext)(const char*, Py_ssize_t, const char*);
1998 void (*FinishContext)(void**);
1999 } __Pyx_RefNannyAPIStruct;
2000 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
2001 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
2002 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
2003 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2004 if (acquire_gil) {\
2005 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2006 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2007 PyGILState_Release(__pyx_gilstate_save);\
2008 } else {\
2009 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2010 }
2011 #define __Pyx_RefNannyFinishContextNogil() {\
2012 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2013 __Pyx_RefNannyFinishContext();\
2014 PyGILState_Release(__pyx_gilstate_save);\
2015 }
2016 #define __Pyx_RefNannyFinishContextNogil() {\
2017 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2018 __Pyx_RefNannyFinishContext();\
2019 PyGILState_Release(__pyx_gilstate_save);\
2020 }
2021 #define __Pyx_RefNannyFinishContext()\
2022 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
2023 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2024 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2025 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2026 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2027 #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
2028 #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
2029 #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
2030 #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
2031#else
2032 #define __Pyx_RefNannyDeclarations
2033 #define __Pyx_RefNannySetupContext(name, acquire_gil)
2034 #define __Pyx_RefNannyFinishContextNogil()
2035 #define __Pyx_RefNannyFinishContext()
2036 #define __Pyx_INCREF(r) Py_INCREF(r)
2037 #define __Pyx_DECREF(r) Py_DECREF(r)
2038 #define __Pyx_GOTREF(r)
2039 #define __Pyx_GIVEREF(r)
2040 #define __Pyx_XINCREF(r) Py_XINCREF(r)
2041 #define __Pyx_XDECREF(r) Py_XDECREF(r)
2042 #define __Pyx_XGOTREF(r)
2043 #define __Pyx_XGIVEREF(r)
2044#endif
2045#define __Pyx_Py_XDECREF_SET(r, v) do {\
2046 PyObject *tmp = (PyObject *) r;\
2047 r = v; Py_XDECREF(tmp);\
2048 } while (0)
2049#define __Pyx_XDECREF_SET(r, v) do {\
2050 PyObject *tmp = (PyObject *) r;\
2051 r = v; __Pyx_XDECREF(tmp);\
2052 } while (0)
2053#define __Pyx_DECREF_SET(r, v) do {\
2054 PyObject *tmp = (PyObject *) r;\
2055 r = v; __Pyx_DECREF(tmp);\
2056 } while (0)
2057#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
2058#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
2059
2060/* FastTypeChecks.proto (used by GivenExceptionMatches) */
2061#if CYTHON_COMPILING_IN_CPYTHON
2062#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2063#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
2064static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2065static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
2066#define __Pyx_PyAnySet_Check(obj) __Pyx_TypeCheck2(obj, &PySet_Type, &PyFrozenSet_Type)
2067#else
2068#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2069#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
2070#define __Pyx_PyAnySet_Check(obj) PyAnySet_Check(obj)
2071#endif
2072
2073/* PyThreadStateGet.proto (used by PyErrFetchRestore) */
2074#if CYTHON_FAST_THREAD_STATE
2075#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2076#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2077#if PY_VERSION_HEX >= 0x030C00A6
2078#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
2079#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
2080#else
2081#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
2082#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
2083#endif
2084#else
2085#define __Pyx_PyThreadState_declare
2086#define __Pyx_PyThreadState_assign
2087#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
2088#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
2089#endif
2090
2091/* PyErrFetchRestore.proto (used by GivenExceptionMatches) */
2092#if CYTHON_FAST_THREAD_STATE
2093#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2094#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2095#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2096#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2097#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2098static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2099static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2100#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
2101#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2102#else
2103#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2104#endif
2105#else
2106#define __Pyx_PyErr_Clear() PyErr_Clear()
2107#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2108#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2109#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2110#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2111#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2112#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2113#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2114#endif
2115
2116/* GivenExceptionMatches.proto (used by PyErrExceptionMatches) */
2117#if CYTHON_COMPILING_IN_CPYTHON
2118static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2119static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2120#else
2121#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2122static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
2123 return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
2124}
2125#endif
2126#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
2127
2128/* PyErrExceptionMatches.proto (used by PyObjectGetAttrStrNoError) */
2129#if CYTHON_FAST_THREAD_STATE
2130#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2131static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2132#else
2133#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2134#endif
2135
2136/* PyObjectGetAttrStr.proto (used by PyObjectGetAttrStrNoError) */
2137#if CYTHON_USE_TYPE_SLOTS
2138static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2139#else
2140#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2141#endif
2142
2143/* PyObjectGetAttrStrNoError.proto (used by GetBuiltinName) */
2144static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2145
2146/* GetBuiltinName.proto */
2147static PyObject *__Pyx_GetBuiltinName(PyObject *name);
2148
2149/* GetTopmostException.proto (used by SaveResetException) */
2150#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
2151static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2152#endif
2153
2154/* SaveResetException.proto */
2155#if CYTHON_FAST_THREAD_STATE
2156#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2157static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2158#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2159static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2160#else
2161#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2162#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2163#endif
2164
2165/* PyException_Check.proto */
2166#define __Pyx_PyExc_Exception_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2167
2168/* GetException.proto */
2169#if CYTHON_FAST_THREAD_STATE
2170#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2171static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2172#else
2173static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2174#endif
2175
2176/* PyImportError_Check.proto */
2177#define __Pyx_PyExc_ImportError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ImportError)
2178
2179/* PyObjectCall.proto (used by PyObjectFastCall) */
2180#if CYTHON_COMPILING_IN_CPYTHON
2181static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2182#else
2183#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2184#endif
2185
2186/* PyObjectCallMethO.proto (used by PyObjectFastCall) */
2187#if CYTHON_COMPILING_IN_CPYTHON
2188static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2189#endif
2190
2191/* PyObjectFastCall.proto */
2192#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
2193static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargsf, PyObject *kwargs);
2194
2195/* RaiseException.export */
2196static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2197
2198/* IgnoreException.proto (used by GetModuleGlobalName) */
2199static CYTHON_INLINE int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception);
2200#define __Pyx_IgnoreException(ignorable_exception) __Pyx_IgnoreGivenException(NULL, ignorable_exception)
2201
2202/* PyDictVersioning.proto (used by GetModuleGlobalName) */
2203#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2204#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
2205#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
2206#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2207 (version_var) = __PYX_GET_DICT_VERSION(dict);\
2208 (cache_var) = (value);
2209#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2210 static PY_UINT64_T __pyx_dict_version = 0;\
2211 static PyObject *__pyx_dict_cached_value = NULL;\
2212 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2213 (VAR) = __Pyx_XNewRef(__pyx_dict_cached_value);\
2214 } else {\
2215 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2216 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2217 }\
2218}
2219static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2220static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2221static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2222#else
2223#define __PYX_GET_DICT_VERSION(dict) (0)
2224#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2225#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
2226#endif
2227
2228/* GetModuleGlobalName.proto */
2229#if CYTHON_USE_DICT_VERSIONS
2230#define __Pyx_GetModuleGlobalName(var, name) do {\
2231 static PY_UINT64_T __pyx_dict_version = 0;\
2232 static PyObject *__pyx_dict_cached_value = NULL;\
2233 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\
2234 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
2235 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2236} while(0)
2237#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
2238 PY_UINT64_T __pyx_dict_version;\
2239 PyObject *__pyx_dict_cached_value;\
2240 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2241} while(0)
2242static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
2243#else
2244#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2245#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2246static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
2247#endif
2248
2249/* CopyObjectArray.proto (used by TupleOrListFromArrayImpl) */
2250#if CYTHON_COMPILING_IN_CPYTHON
2251static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length);
2252#endif
2253
2254/* TupleOrListFromArrayImpl.proto (used by TupleFromArray) */
2255#if PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API
2256#define __Pyx_PyTuple_FromArray(src, n) PyTuple_FromArray(src, ((n)<0) ? 0 : (n))
2257#else
2258CYTHON_UNUSED static PyObject *
2259__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
2260#endif
2261
2262/* TupleFromArray.proto */
2263
2264
2265/* FormatTypeName.proto (used by RaiseErrorWithObjectTypes) */
2266#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030d0000
2267typedef PyObject *__Pyx_TypeName;
2268#define __Pyx_FMT_TYPENAME "%N"
2269#define __Pyx_PyType_GetFullyQualifiedName(tp) Py_NewRef((PyObject*)tp)
2270#define __Pyx_DECREF_TypeName(obj) Py_DECREF(obj)
2271#elif CYTHON_COMPILING_IN_LIMITED_API
2272typedef PyObject *__Pyx_TypeName;
2273#define __Pyx_FMT_TYPENAME "%U"
2274#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
2275static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
2276#else // !LIMITED_API
2277typedef const char *__Pyx_TypeName;
2278#define __Pyx_FMT_TYPENAME "%.200s"
2279#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
2280#define __Pyx_DECREF_TypeName(obj)
2281#endif
2282
2283/* RaiseErrorWithObjectTypes.proto (used by ExtTypeTest) */
2284#define __Pyx_RaiseErrorWithObjectTypes1(exc_type, message, arg, obj1, obj2) __Pyx_RaiseErrorWithTypes1(exc_type, message, arg, Py_TYPE(obj1), Py_TYPE(obj2))
2285#define __Pyx_RaiseTypeErrorWithObjectTypes(message, obj1, obj2) __Pyx_RaiseTypeErrorWithTypes(message, Py_TYPE(obj1), Py_TYPE(obj2))
2286#define __Pyx_RaiseTypeErrorWithTypes(message, type_obj1, type_obj2) __Pyx_RaiseErrorWithTypes1(PyExc_TypeError, "%.1s" message, "", type_obj1, type_obj2)
2287CYTHON_UNUSED
2288static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type, const char *message, const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2);
2289
2290/* ExtTypeTest.proto */
2291static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2292
2293/* IsLittleEndian.proto (used by BufferFormatCheck) */
2294static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2295
2296/* BufferFormatCheck.proto (used by BufferGetAndValidate) */
2297static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2298static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2299 __Pyx_BufFmt_StackElem* stack,
2300 const __Pyx_TypeInfo* type);
2301
2302/* BufferGetAndValidate.proto */
2303#define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
2304 ((obj == Py_None || obj == NULL) ?\
2305 (__Pyx_ZeroBuffer(buf), 0) :\
2306 __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
2307static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
2308 const __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
2309static void __Pyx_ZeroBuffer(Py_buffer* buf);
2310static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
2311static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
2312static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
2313
2314/* BufferIndexError.proto */
2315static void __Pyx_RaiseBufferIndexError(int axis);
2316
2317#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
2318/* IncludeStringH.proto (used by PyObjectCompare) */
2319#include <string.h>
2320
2321/* PyObjectCompare.proto (used by UnicodeEquals) */
2322static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2, int pyop);
2323
2324/* UnicodeEquals.proto (used by fastcall) */
2325#define __Pyx_PyUnicode_Equals(s1, s2) __Pyx_PyObject_CompareBoolEq_str_str(s1, s2, Py_EQ)
2326
2327/* fastcall.proto */
2328#if CYTHON_AVOID_BORROWED_REFS
2329 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
2330#elif CYTHON_ASSUME_SAFE_MACROS
2331 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
2332#else
2333 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
2334#endif
2335#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
2336#define __Pyx_KwValues_VARARGS(args, nargs) NULL
2337#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
2338#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
2339#if CYTHON_VECTORCALL
2340 #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
2341 #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
2342 #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
2343 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
2344 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
2345 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
2346 #else
2347 #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
2348 #endif
2349#else
2350 #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
2351 #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
2352 #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
2353 #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
2354 #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
2355#endif
2356#if CYTHON_VECTORCALL_TPNEW
2357 #if !CYTHON_VECTORCALL
2358 #error Enabling CYTHON_VECTORCALL_TPNEW without CYTHON_VECTORCALL is not supported
2359 #endif
2360 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_FASTCALL
2361 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_FASTCALL
2362 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_FASTCALL
2363 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_FASTCALL
2364 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_FASTCALL
2365#else
2366 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_VARARGS
2367 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_VARARGS
2368 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_VARARGS
2369 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_VARARGS
2370 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_VARARGS
2371#endif
2372#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
2373#if CYTHON_VECTORCALL
2374#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
2375#else
2376#define __Pyx_ArgsSlice_FASTCALL __Pyx_ArgsSlice_VARARGS
2377#endif
2378
2379/* py_dict_items.proto (used by OwnedDictNext) */
2380#define __Pyx_PyDict_items_TypePtr (&PyDictKeys_Type)
2381#define __Pyx_PyDict_items_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictItems_TypePtr)
2382#define __Pyx_PyDict_items_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictItems_TypePtr)
2383static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);
2384
2385/* CallCFunction.proto (used by CallUnboundCMethod0) */
2386#define __Pyx_CallCFunction(cfunc, self, args)\
2387 ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
2388#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
2389 ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
2390#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
2391 ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
2392#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
2393 ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)
2394
2395/* PyObjectCallOneArg.proto (used by CallUnboundCMethod0) */
2396static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2397
2398/* UnpackUnboundCMethod_decl.proto (used by UnpackUnboundCMethod) */
2399typedef struct {
2400 PyObject *type;
2401 PyObject **method_name;
2402 PyCFunction func;
2403 PyObject *method;
2404 int flag;
2405#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
2406 __pyx_atomic_int_type initialized;
2407#endif
2408} __Pyx_CachedCFunction;
2409
2410/* UnpackUnboundCMethod_impl.export */
2411static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target);
2412
2413/* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */
2414#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
2415static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
2416#if !CYTHON_ATOMICS
2417 return 1;
2418#else
2419 __pyx_nonatomic_int_type expected = 0;
2420 if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
2421 return 0;
2422 }
2423 return expected;
2424#endif
2425}
2426static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
2427#if CYTHON_ATOMICS
2428 __pyx_atomic_store(&cfunc->initialized, 2);
2429#endif
2430}
2431#else
2432#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
2433#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
2434#endif
2435
2436/* CallUnboundCMethod0.proto */
2437CYTHON_UNUSED
2438static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2439#if CYTHON_COMPILING_IN_CPYTHON
2440static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2441#else
2442#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
2443#endif
2444
2445/* py_dict_values.proto (used by OwnedDictNext) */
2446#define __Pyx_PyDict_values_TypePtr (&PyDictKeys_Type)
2447#define __Pyx_PyDict_values_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictValues_TypePtr)
2448#define __Pyx_PyDict_values_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictValues_TypePtr)
2449static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);
2450
2451/* OwnedDictNext.proto (used by ParseKeywordsImpl) */
2452#if CYTHON_AVOID_BORROWED_REFS
2453static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue);
2454#else
2455CYTHON_INLINE
2456static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
2457#endif
2458
2459/* RaiseDoubleKeywords.proto (used by ParseKeywordsImpl) */
2460static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
2461
2462/* ParseKeywordsImpl.export */
2463static int __Pyx_ParseKeywordsTuple(
2464 PyObject *kwds,
2465 PyObject * const *kwvalues,
2466 PyObject ** const argnames[],
2467 PyObject *kwds2,
2468 PyObject *values[],
2469 Py_ssize_t num_pos_args,
2470 Py_ssize_t num_kwargs,
2471 const char* function_name,
2472 int ignore_unknown_kwargs
2473);
2474static int __Pyx_ParseKeywordDictToDict(
2475 PyObject *kwds,
2476 PyObject ** const argnames[],
2477 PyObject *kwds2,
2478 PyObject *values[],
2479 Py_ssize_t num_pos_args,
2480 const char* function_name
2481);
2482static int __Pyx_ParseKeywordDict(
2483 PyObject *kwds,
2484 PyObject ** const argnames[],
2485 PyObject *values[],
2486 Py_ssize_t num_pos_args,
2487 Py_ssize_t num_kwargs,
2488 const char* function_name,
2489 int ignore_unknown_kwargs
2490);
2491
2492/* CallUnboundCMethod2.proto */
2493CYTHON_UNUSED
2494static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
2495#if CYTHON_COMPILING_IN_CPYTHON
2496static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
2497#else
2498#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
2499#endif
2500
2501/* ParseKeywords.proto */
2502static CYTHON_INLINE int __Pyx_ParseKeywords(
2503 PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[],
2504 PyObject *kwds2, PyObject *values[],
2505 Py_ssize_t num_pos_args, Py_ssize_t num_kwargs,
2506 const char* function_name,
2507 int ignore_unknown_kwargs
2508);
2509
2510/* RaiseArgTupleInvalid.export */
2511static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
2512 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2513
2514/* PyObjectDelAttr.proto (used by PyObjectSetAttrStr) */
2515#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
2516#define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL)
2517#else
2518#define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(o, n)
2519#endif
2520
2521/* PyObjectSetAttrStr.proto */
2522#if CYTHON_USE_TYPE_SLOTS
2523#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
2524static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
2525#else
2526#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_DelAttr(o,n)
2527#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
2528#endif
2529
2530/* RaiseTooManyValuesToUnpack.proto */
2531static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2532
2533/* RaiseNeedMoreValuesToUnpack.proto */
2534static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2535
2536/* IterFinish.proto */
2537static CYTHON_INLINE int __Pyx_IterFinish(void);
2538
2539/* UnpackItemEndCheck.proto */
2540static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
2541
2542/* AssertionsEnabled.proto */
2543#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000
2544 static int __pyx_assertions_enabled_flag;
2545 #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2546 #if __clang__ || __GNUC__
2547 __attribute__((no_sanitize("thread")))
2548 #endif
2549 static int __Pyx_init_assertions_enabled(void) {
2550 PyObject *builtins, *debug, *debug_str;
2551 int flag;
2552 builtins = PyEval_GetBuiltins();
2553 if (!builtins) goto bad;
2554 debug_str = PyUnicode_FromStringAndSize("__debug__", 9);
2555 if (!debug_str) goto bad;
2556 debug = PyObject_GetItem(builtins, debug_str);
2557 Py_DECREF(debug_str);
2558 if (!debug) goto bad;
2559 flag = PyObject_IsTrue(debug);
2560 Py_DECREF(debug);
2561 if (flag == -1) goto bad;
2562 __pyx_assertions_enabled_flag = flag;
2563 return 0;
2564 bad:
2565 __pyx_assertions_enabled_flag = 1;
2566 return -1;
2567 }
2568#else
2569 #define __Pyx_init_assertions_enabled() (0)
2570 #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2571#endif
2572
2573/* PyFloatBinop.proto */
2574#if !CYTHON_COMPILING_IN_PYPY
2575static int __Pyx_PyFloat_BoolEqObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check);
2576#else
2577#define __Pyx_PyFloat_BoolEqObjC(op1, op2, floatval, inplace, zerodivision_check)\
2578 PyObject_RichCompareBool(op1, op2, Py_EQ)
2579 #endif
2580
2581/* PyAssertionError_Check.proto */
2582#define __Pyx_PyExc_AssertionError_Check(obj) __Pyx_TypeCheck(obj, PyExc_AssertionError)
2583
2584/* RaiseUnboundLocalError.proto */
2585static void __Pyx_RaiseUnboundLocalError(const char *varname);
2586
2587/* PyLongBinop.proto */
2588#if !CYTHON_COMPILING_IN_PYPY
2589static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2590#else
2591#define __Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2592 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2593#endif
2594
2595/* pep479.proto */
2596static void __Pyx_Generator_Replace_StopIteration(int in_async_gen);
2597
2598/* PyFrozenDict.proto (used by GetItemInt) */
2599#if CYTHON_COMPILING_IN_LIMITED_API
2600#define __Pyx_PyFrozenDict_TypePtr ((PyTypeObject*) __pyx_mstate_global->__Pyx_PyFrozenDictType)
2601#define __Pyx_PyFrozenDict_New(it) __Pyx__PyFrozenDict_New(__pyx_mstate_global->__Pyx_PyFrozenDictType, it)
2602static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it);
2603#define __Pyx_PyFrozenDict_NewEmpty() __Pyx_PyFrozenDict_New(NULL)
2604#define __Pyx_PyFrozenDict_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyFrozenDict_TypePtr)
2605#define __Pyx_PyFrozenDict_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyFrozenDict_TypePtr)
2606#define __Pyx_PyAnyDict_Check(obj) __Pyx__PyAnyDict_Check(obj, __Pyx_PyFrozenDict_TypePtr)
2607static CYTHON_INLINE int __Pyx__PyAnyDict_Check(PyObject *obj, PyTypeObject* frozendict_type) {
2608 return PyObject_TypeCheck(obj, &PyDict_Type) || PyObject_TypeCheck(obj, frozendict_type);
2609}
2610#define __Pyx_PyAnyDict_CheckExact(obj) __Pyx__PyAnyDict_CheckExact(obj, __Pyx_PyFrozenDict_TypePtr)
2611static CYTHON_INLINE int __Pyx__PyAnyDict_CheckExact(PyObject *obj, PyTypeObject* frozendict_type) {
2612 return Py_IS_TYPE(obj, &PyDict_Type) || Py_IS_TYPE(obj, frozendict_type);
2613}
2614#elif PY_VERSION_HEX >= 0x030f00a6 ||\
2615 (defined(PyFrozenDict_Check) && defined(PyAnyDict_Check) && defined(PyFrozenDict_New))
2616#define __Pyx_PyFrozenDict_TypePtr (&PyFrozenDict_Type)
2617#define __Pyx_PyFrozenDict_New(it) PyFrozenDict_New(it)
2618#define __Pyx_PyFrozenDict_NewEmpty() PyFrozenDict_New(NULL)
2619#define __Pyx_PyFrozenDict_Check(obj) PyFrozenDict_Check(obj)
2620#define __Pyx_PyFrozenDict_CheckExact(obj) PyFrozenDict_CheckExact(obj)
2621#define __Pyx_PyAnyDict_Check(obj) PyAnyDict_Check(obj)
2622#define __Pyx_PyAnyDict_CheckExact(obj) PyAnyDict_CheckExact(obj)
2623#else
2624#define __Pyx_PyFrozenDict_TypePtr (&PyDict_Type)
2625static CYTHON_INLINE PyObject* __Pyx_PyFrozenDict_New(PyObject* it) {
2626 if (!it) {
2627 return PyDict_New();
2628 } else if (PyDict_Check(it)) {
2629 return PyDict_Copy(it);
2630 } else {
2631 PyObject *dict = PyDict_New();
2632 if (!dict) return NULL;
2633 PyObject *result = PyNumber_InPlaceOr(dict, it);
2634 Py_DECREF(dict);
2635 return result;
2636 }
2637}
2638#define __Pyx_PyFrozenDict_NewEmpty() PyDict_New()
2639#define __Pyx_PyFrozenDict_Check(obj) PyDict_Check(obj)
2640#define __Pyx_PyFrozenDict_CheckExact(obj) PyDict_CheckExact(obj)
2641#define __Pyx_PyAnyDict_Check(obj) PyDict_Check(obj)
2642#define __Pyx_PyAnyDict_CheckExact(obj) PyDict_CheckExact(obj)
2643#endif
2644
2645/* GetItemInt.proto */
2646#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2647 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2648 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2649 __Pyx_GetItemInt_Generic(o, to_py_func(i)))
2650#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2651 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2652 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2653 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2654static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2655 int wraparound, int boundscheck, int unsafe_shared);
2656#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2657 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2658 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
2659 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2660static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2661 int wraparound, int boundscheck, int unsafe_shared);
2662static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2663static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2664 int wraparound, int boundscheck, int unsafe_shared);
2665
2666/* RaiseErrorWithObjectType.proto (used by ObjectGetItem) */
2667#define __Pyx_RaiseTypeErrorWithObjectType(message, obj) __Pyx_RaiseErrorWithObjectType(PyExc_TypeError, message, obj)
2668#define __Pyx_RaiseErrorWithObjectType(exc_type, message, obj) __Pyx_RaiseErrorWithType(exc_type, message, Py_TYPE(obj))
2669CYTHON_UNUSED
2670static void __Pyx_RaiseErrorWithType(PyObject* exc_type, const char* message, PyTypeObject *type_obj);
2671
2672/* ObjectGetItem.proto */
2673#if CYTHON_USE_TYPE_SLOTS
2674static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
2675#else
2676#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2677#endif
2678
2679/* PyObjectFastCallMethod.proto */
2680#if CYTHON_VECTORCALL
2681#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL)
2682#else
2683static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf);
2684#endif
2685
2686/* HasAttr.proto (used by ImportImpl) */
2687#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
2688#define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n)
2689#else
2690static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2691#endif
2692
2693/* TupleOrListFromArrayImpl.proto (used by ListFromArray) */
2694CYTHON_UNUSED static PyObject *
2695__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
2696
2697/* ListFromArray.proto (used by ImportImpl) */
2698
2699
2700/* ImportImpl.export */
2701static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level);
2702
2703/* Import.proto */
2704static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level);
2705
2706/* ImportFrom.export */
2707static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2708
2709/* ListCompAppendAndDecref.proto */
2710static CYTHON_INLINE int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x);
2711
2712/* DictGetItem.proto */
2713#if !CYTHON_COMPILING_IN_PYPY
2714static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
2715#define __Pyx_PyObject_Dict_GetItem(obj, name)\
2716 (likely(__Pyx_PyAnyDict_CheckExact(obj)) ?\
2717 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
2718#else
2719#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
2720#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
2721#endif
2722
2723/* SliceObject.proto */
2724static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
2725 PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
2726 PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
2727 int has_cstart, int has_cstop, int wraparound);
2728
2729/* PyObjectVectorcallKwds.proto */
2730#if CYTHON_VECTORCALL
2731#define __Pyx_Object_VectorcallKwds PyObject_Vectorcall
2732CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i);
2733#else
2734#define __Pyx_Object_VectorcallKwds __Pyx_PyObject_FastCallDict
2735CYTHON_UNUSED static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t n);
2736CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i);
2737#endif
2738
2739/* PyLongCompare.proto */
2740static CYTHON_INLINE int __Pyx_PyLong_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
2741
2742/* PyFloatBinop.proto */
2743#if !CYTHON_COMPILING_IN_PYPY
2744static int __Pyx_PyFloat_BoolNeObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check);
2745#else
2746#define __Pyx_PyFloat_BoolNeObjC(op1, op2, floatval, inplace, zerodivision_check)\
2747 PyObject_RichCompareBool(op1, op2, Py_NE)
2748 #endif
2749
2750/* PyNotImplementedError_Check.proto */
2751#define __Pyx_PyExc_NotImplementedError_Check(obj) __Pyx_TypeCheck(obj, PyExc_NotImplementedError)
2752
2753/* PyObjectCompare.proto */
2754static CYTHON_INLINE int __Pyx_PyObject_CompareBoolGt_object_float(PyObject *op1, PyObject *op2, int pyop);
2755
2756/* ListAppend.proto */
2757#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
2758static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x);
2759#else
2760#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2761#endif
2762
2763/* PyObjectCompare.proto */
2764static CYTHON_INLINE int __Pyx_PyObject_CompareBoolLt_object_float(PyObject *op1, PyObject *op2, int pyop);
2765
2766/* PyNumberBinop.proto */
2767#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API
2768#define __Pyx_PyNumber_Subtract_object_object(op1, op2) PyNumber_Subtract(op1, op2)
2769#define __Pyx_PyNumber_InPlaceSubtract_object_object(op1, op2) PyNumber_InPlaceSubtract(op1, op2)
2770#else
2771#define __Pyx_PyNumber_Subtract_object_object(op1, op2) __Pyx__PyNumber_Subtract_object_object(op1, op2, 0)
2772#define __Pyx_PyNumber_InPlaceSubtract_object_object(op1, op2) __Pyx__PyNumber_Subtract_object_object(op1, op2, 1)
2773static CYTHON_INLINE PyObject* __Pyx__PyNumber_Subtract_object_object(PyObject *op1, PyObject *op2, int inplace);
2774#endif
2775
2776/* PyNumberBinop.proto */
2777#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API
2778#define __Pyx_PyNumber_Multiply_float_object(op1, op2) PyNumber_Multiply(op1, op2)
2779#define __Pyx_PyNumber_InPlaceMultiply_float_object(op1, op2) PyNumber_InPlaceMultiply(op1, op2)
2780#else
2781#define __Pyx_PyNumber_Multiply_float_object(op1, op2) __Pyx__PyNumber_Multiply_float_object(op1, op2, 0)
2782#define __Pyx_PyNumber_InPlaceMultiply_float_object(op1, op2) __Pyx__PyNumber_Multiply_float_object(op1, op2, 1)
2783static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_float_object(PyObject *op1, PyObject *op2, int inplace);
2784#endif
2785
2786/* PyNumberBinop.proto */
2787#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API
2788#define __Pyx_PyNumber_Add_object_object(op1, op2) PyNumber_Add(op1, op2)
2789#define __Pyx_PyNumber_InPlaceAdd_object_object(op1, op2) PyNumber_InPlaceAdd(op1, op2)
2790#else
2791#define __Pyx_PyNumber_Add_object_object(op1, op2) __Pyx__PyNumber_Add_object_object(op1, op2, 0)
2792#define __Pyx_PyNumber_InPlaceAdd_object_object(op1, op2) __Pyx__PyNumber_Add_object_object(op1, op2, 1)
2793static CYTHON_INLINE PyObject* __Pyx__PyNumber_Add_object_object(PyObject *op1, PyObject *op2, int inplace);
2794#endif
2795
2796/* BufferFallbackError.proto */
2797static void __Pyx_RaiseBufferFallbackError(void);
2798
2799/* SetItemInt.proto */
2800#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
2801 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2802 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, wraparound, boundscheck, unsafe_shared) :\
2803 __Pyx_SetItemInt_Generic(o, to_py_func(i), v))
2804static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
2805static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
2806 int wraparound, int boundscheck, int unsafe_shared);
2807
2808/* PyObjectCompare.proto */
2809static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_object_str(PyObject *op1, PyObject *op2, int pyop);
2810
2811/* PyObject_Unicode.proto */
2812#define __Pyx_PyObject_Unicode(obj)\
2813 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
2814
2815/* PyObjectVectorcallMethodKwds.proto */
2816#if CYTHON_VECTORCALL
2817#define __Pyx_Object_VectorcallMethodKwds PyObject_VectorcallMethod
2818#else
2819static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2820#endif
2821
2822/* RaiseErrorWithObjectType1.proto (used by RaiseUnexpectedTypeError) */
2823#define __Pyx_RaiseTypeErrorWithObjectType1(message, arg, obj) __Pyx_RaiseErrorWithObjectType1(PyExc_TypeError, message, arg, obj)
2824#define __Pyx_RaiseErrorWithObjectType1(exc_type, message, arg, obj) __Pyx_RaiseErrorWithType1(exc_type, message, arg, Py_TYPE(obj))
2825CYTHON_UNUSED
2826static void __Pyx_RaiseErrorWithType1(PyObject* exc_type, const char* message, const char *arg, PyTypeObject *type_obj);
2827
2828/* RaiseUnexpectedTypeError.proto */
2829CYTHON_UNUSED
2830static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);
2831
2832/* PyNumberBinop.proto */
2833#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API
2834#define __Pyx_PyNumber_Multiply_object_float(op1, op2) PyNumber_Multiply(op1, op2)
2835#define __Pyx_PyNumber_InPlaceMultiply_object_float(op1, op2) PyNumber_InPlaceMultiply(op1, op2)
2836#else
2837#define __Pyx_PyNumber_Multiply_object_float(op1, op2) __Pyx__PyNumber_Multiply_object_float(op1, op2, 0)
2838#define __Pyx_PyNumber_InPlaceMultiply_object_float(op1, op2) __Pyx__PyNumber_Multiply_object_float(op1, op2, 1)
2839static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_object_float(PyObject *op1, PyObject *op2, int inplace);
2840#endif
2841
2842/* PyObjectCompare.proto */
2843static CYTHON_INLINE int __Pyx_PyObject_CompareBoolGt_object_int(PyObject *op1, PyObject *op2, int pyop);
2844
2845/* PyObjectCompare.proto */
2846static CYTHON_INLINE int __Pyx_PyObject_CompareBoolGt_object_object(PyObject *op1, PyObject *op2, int pyop);
2847
2848/* PyObjectCompare.proto */
2849static CYTHON_INLINE int __Pyx_PyObject_CompareBoolLt_object_object(PyObject *op1, PyObject *op2, int pyop);
2850
2851/* PyLongCompare.proto */
2852static CYTHON_INLINE int __Pyx_PyLong_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
2853
2854/* PyLongBinop.proto */
2855#if !CYTHON_COMPILING_IN_PYPY
2856static CYTHON_INLINE PyObject* __Pyx_PyLong_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2857#else
2858#define __Pyx_PyLong_MultiplyCObj(op1, op2, intval, inplace, zerodivision_check)\
2859 (inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2))
2860#endif
2861
2862/* CheckTypeForFreelists.proto */
2863#if CYTHON_USE_FREELISTS
2864#if CYTHON_USE_TYPE_SPECS
2865#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t) == (expected_tp)))
2866#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS Py_TPFLAGS_IS_ABSTRACT
2867#else
2868#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t)->tp_basicsize == (expected_size)))
2869#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)
2870#endif
2871#define __PYX_CHECK_TYPE_FOR_FREELISTS(t, expected_tp, expected_size)\
2872 (__PYX_CHECK_FINAL_TYPE_FOR_FREELISTS((t), (expected_tp), (expected_size)) &\
2873 (int) (!__Pyx_PyType_HasFeature((t), __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS)))
2874#endif
2875
2876/* AllocateExtensionType.proto */
2877static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final);
2878
2879/* CallSlotAsVectorcall.proto */
2880#if CYTHON_VECTORCALL_TPNEW
2881typedef PyObject * (*__Pyx_tpnewvectorcallfunc)(PyTypeObject* o, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames);
2882static PyObject * __Pyx_CallTpnewAsVectorcall(__Pyx_tpnewvectorcallfunc f, PyTypeObject* o, PyObject *a, PyObject *k);
2883#endif
2884
2885/* CallNewInitFromVectorcall.proto */
2886#if CYTHON_VECTORCALL_TPNEW
2887static PyObject *__Pyx_CallNewInitFromVectorcall(PyTypeObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2888#endif
2889
2890/* CallTypeTraverse.proto */
2891#if !CYTHON_USE_TYPE_SPECS
2892#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
2893#else
2894static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg);
2895#endif
2896
2897/* PyObjectCallMethod0.proto (used by PyType_Ready) */
2898static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
2899
2900/* GetTypeDictOffset.proto (used by ValidateBasesTuple) */
2901#if !CYTHON_USE_TYPE_SLOTS
2902CYTHON_UNUSED static Py_ssize_t __Pyx_GetTypeDictOffset(PyObject *tp, int require_cython_valid_result);
2903#endif
2904
2905/* ValidateBasesTuple.proto (used by PyType_Ready) */
2906#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
2907static int __Pyx_validate_bases_tuple(const char *type_name, int has_dictoffset, PyObject *bases);
2908#endif
2909
2910/* PyType_Ready.export */
2911CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);
2912
2913/* TypeImport.proto */
2914#ifndef __PYX_HAVE_RT_ImportType_proto_3_3_0
2915#define __PYX_HAVE_RT_ImportType_proto_3_3_0
2916#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
2917#include <stdalign.h>
2918#endif
2919#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
2920#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) alignof(s)
2921#else
2922#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) sizeof(void*)
2923#endif
2924enum __Pyx_ImportType_CheckSize_3_3_0 {
2925 __Pyx_ImportType_CheckSize_Error_3_3_0 = 0,
2926 __Pyx_ImportType_CheckSize_Warn_3_3_0 = 1,
2927 __Pyx_ImportType_CheckSize_Ignore_3_3_0 = 2
2928};
2929static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_3_0 check_size);
2930#endif
2931
2932/* Py3UpdateBases.export */
2933static PyObject* __Pyx_PEP560_update_bases(PyObject *bases);
2934
2935/* CalculateMetaclass.proto */
2936static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
2937
2938/* dict_setdefault.proto (used by FetchCommonType) */
2939static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);
2940
2941/* AddModuleRef.proto (used by FetchSharedCythonModule) */
2942#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3) ||\
2943 __PYX_LIMITED_VERSION_HEX < 0x030d0000)
2944 static PyObject *__Pyx_PyImport_AddModuleRef(const char *name);
2945#else
2946 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
2947#endif
2948
2949/* FetchSharedCythonModule.proto (used by FetchCommonType) */
2950static PyObject *__Pyx_FetchSharedCythonABIModule(void);
2951
2952/* VerifyCachedType.proto (used by FetchCommonType) */
2953static int __Pyx_VerifyCachedType(PyObject *cached_type,
2954 const char *name,
2955 Py_ssize_t expected_basicsize);
2956
2957/* FetchCommonType.proto (used by CommonTypesMetaclass) */
2958static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);
2959
2960/* CommonTypesMetaclass.proto (used by CythonFunctionShared) */
2961static int __pyx_CommonTypesMetaclass_init(PyObject *module);
2962#define __Pyx_CommonTypesMetaclass_USED
2963
2964/* CythonFunctionPerModule.proto (used by CythonFunctionShared) */
2965#define __Pyx_CyFunction_USED
2966#if CYTHON_OPAQUE_SHARED_TYPES
2967#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)PyObject_GetTypeData((o), __pyx_mstate_global->__pyx_CyFunctionType))
2968#else
2969#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)o)
2970#endif
2971#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2972#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2973#define __Pyx_CYFUNCTION_CCLASS 0x04
2974#define __Pyx_CYFUNCTION_COROUTINE 0x08
2975#define __Pyx_CyFunction_GetClosure(f)\
2976 ((__Pyx_as_CyFunctionObject(f))->func_closure)
2977#if CYTHON_COMPILING_IN_LIMITED_API
2978 #define __Pyx__CyFunction_GetClassObj(f)\
2979 ((f)->func_classobj)
2980#else
2981 #define __Pyx__CyFunction_GetClassObj(f)\
2982 ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
2983#endif
2984#define __Pyx_CyFunction_GetClassObj(f)\
2985 __Pyx__CyFunction_GetClassObj(__Pyx_as_CyFunctionObject(f))
2986#define __Pyx_CyFunction_SetClassObj(f, classobj)\
2987 __Pyx__CyFunction_SetClassObj(__Pyx_as_CyFunctionObject(f), (classobj))
2988#define __Pyx_CyFunction_Defaults(type, f)\
2989 ((type *)((__Pyx_as_CyFunctionObject(f))->defaults))
2990#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2991 (__Pyx_as_CyFunctionObject(f))->defaults_getter = (g)
2992typedef struct {
2993#if CYTHON_COMPILING_IN_LIMITED_API
2994#if !CYTHON_OPAQUE_OBJECTS
2995 PyObject_HEAD
2996#endif
2997 PyMethodDef *func_methoddef;
2998 PyObject *func_module;
2999#else
3000 PyCMethodObject func;
3001#endif
3002#if (CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY) && CYTHON_VECTORCALL
3003 __pyx_vectorcallfunc func_vectorcall;
3004#endif
3005#if CYTHON_COMPILING_IN_LIMITED_API
3006 PyObject *func_weakreflist;
3007#endif
3008#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
3009 PyObject *func_dict;
3010#endif
3011 PyObject *func_name;
3012 PyObject *func_qualname;
3013 PyObject *func_doc;
3014 PyObject *func_globals;
3015 PyObject *func_code;
3016 PyObject *func_closure;
3017#if CYTHON_COMPILING_IN_LIMITED_API
3018 PyObject *func_classobj;
3019#endif
3020 PyObject *defaults;
3021 int flags;
3022 PyObject *defaults_tuple;
3023 PyObject *defaults_kwdict;
3024 PyObject *(*defaults_getter)(PyObject *);
3025 PyObject *func_annotations;
3026#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
3027 PyObject *func_is_coroutine;
3028#endif
3029} __pyx_CyFunctionObject;
3030#undef __Pyx_CyOrPyCFunction_Check
3031#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType)
3032#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
3033#define __Pyx_CyFunction_CheckExact(obj) Py_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
3034static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void));
3035#undef __Pyx_IsSameCFunction
3036#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
3037static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
3038static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
3039 PyTypeObject *defaults_type);
3040static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
3041 PyObject *tuple);
3042static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
3043 PyObject *dict);
3044static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
3045 PyObject *dict);
3046static int __pyx_CyFunction_init(PyObject *module);
3047#if CYTHON_VECTORCALL
3048#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
3049#define __Pyx_CyFunction_func_vectorcall(f) ((f)->func_vectorcall)
3050#else
3051#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
3052#endif
3053#endif
3054
3055/* PyMethodNew.proto (used by CythonFunctionShared) */
3056static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);
3057
3058/* PyVectorcallFastCallDict.proto (used by CythonFunctionShared) */
3059#if CYTHON_VECTORCALL
3060static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
3061#endif
3062
3063/* CythonFunctionShared.proto (used by CythonFunction) */
3064static PyObject *__Pyx_CyFunction_Init(PyObject *op_in, PyMethodDef *ml,
3065 int flags, PyObject* qualname,
3066 PyObject *closure,
3067 PyObject *module, PyObject *globals,
3068 PyObject* code);
3069#if CYTHON_VECTORCALL
3070static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3071static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3072static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3073static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3074#endif
3075
3076/* CythonFunction.export */
3077static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
3078 int flags, PyObject* qualname,
3079 PyObject *closure,
3080 PyObject *module, PyObject *globals,
3081 PyObject* code);
3082static PyTypeObject *__Pyx_Get_CyFunction_Type(void);
3083
3084/* SetNameInClass.proto */
3085#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
3086#define __Pyx_SetNameInClass(ns, name, value)\
3087 (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
3088#elif CYTHON_COMPILING_IN_CPYTHON
3089#define __Pyx_SetNameInClass(ns, name, value)\
3090 (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
3091#else
3092#define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
3093#endif
3094
3095/* PyObjectCall2Args.proto (used by Py3ClassCreate) */
3096static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
3097
3098/* PyObjectLookupSpecial.proto (used by Py3ClassCreate) */
3099#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3100#define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0)
3101#define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1)
3102static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error);
3103#else
3104#define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n)
3105#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
3106#endif
3107
3108/* Py3ClassCreate.export */
3109static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
3110 PyObject *mkw, PyObject *modname, PyObject *doc);
3111static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
3112 PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
3113
3114/* CLineInTraceback.proto (used by AddTraceback) */
3115#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
3116static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
3117#else
3118#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
3119#endif
3120
3121/* CodeObjectCache.proto (used by AddTraceback) */
3122#if CYTHON_COMPILING_IN_LIMITED_API
3123typedef PyObject __Pyx_CachedCodeObjectType;
3124#else
3125typedef PyCodeObject __Pyx_CachedCodeObjectType;
3126#endif
3127typedef struct {
3128 __Pyx_CachedCodeObjectType* code_object;
3129 int code_line;
3130} __Pyx_CodeObjectCacheEntry;
3131struct __Pyx_CodeObjectCache {
3132 int count;
3133 int max_count;
3134 __Pyx_CodeObjectCacheEntry* entries;
3135 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
3136 __pyx_atomic_int_type accessor_count;
3137 #endif
3138};
3139static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
3140static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line);
3141static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object);
3142
3143/* AddTraceback.proto */
3144static void __Pyx_AddTraceback(const char *funcname, int c_line,
3145 int py_line, const char *filename);
3146
3147/* BufferStructDeclare.proto */
3148typedef struct {
3149 Py_ssize_t shape, strides, suboffsets;
3150} __Pyx_Buf_DimInfo;
3151typedef struct {
3152 size_t refcount;
3153 Py_buffer pybuffer;
3154} __Pyx_Buffer;
3155typedef struct {
3156 __Pyx_Buffer *rcbuffer;
3157 char *data;
3158 __Pyx_Buf_DimInfo diminfo[8];
3159} __Pyx_LocalBuf_ND;
3160
3161/* GCCDiagnostics.proto */
3162#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
3163#define __Pyx_HAS_GCC_DIAGNOSTIC
3164#endif
3165
3166/* RealImag.proto */
3167#if CYTHON_CCOMPLEX
3168 #ifdef __cplusplus
3169 #define __Pyx_CREAL(z) ((z).real())
3170 #define __Pyx_CIMAG(z) ((z).imag())
3171 #else
3172 #define __Pyx_CREAL(z) (__real__(z))
3173 #define __Pyx_CIMAG(z) (__imag__(z))
3174 #endif
3175#else
3176 #define __Pyx_CREAL(z) ((z).real)
3177 #define __Pyx_CIMAG(z) ((z).imag)
3178#endif
3179#if defined(__cplusplus) && CYTHON_CCOMPLEX\
3180 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
3181 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
3182 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
3183#else
3184 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
3185 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
3186#endif
3187
3188/* Arithmetic.proto */
3189#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3190 #define __Pyx_c_eq_float(a, b) ((a)==(b))
3191 #define __Pyx_c_sum_float(a, b) ((a)+(b))
3192 #define __Pyx_c_diff_float(a, b) ((a)-(b))
3193 #define __Pyx_c_prod_float(a, b) ((a)*(b))
3194 #define __Pyx_c_quot_float(a, b) ((a)/(b))
3195 #define __Pyx_c_neg_float(a) (-(a))
3196 #ifdef __cplusplus
3197 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
3198 #define __Pyx_c_conj_float(z) (::std::conj(z))
3199 #if 1
3200 #define __Pyx_c_abs_float(z) (::std::abs(z))
3201 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
3202 #endif
3203 #else
3204 #define __Pyx_c_is_zero_float(z) ((z)==0)
3205 #define __Pyx_c_conj_float(z) (conjf(z))
3206 #if 1
3207 #define __Pyx_c_abs_float(z) (cabsf(z))
3208 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
3209 #endif
3210 #endif
3211#else
3212 static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
3213 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
3214 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
3215 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
3216 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
3217 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
3218 static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
3219 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
3220 #if 1
3221 static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
3222 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
3223 #endif
3224#endif
3225
3226/* Arithmetic.proto */
3227#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3228 #define __Pyx_c_eq_double(a, b) ((a)==(b))
3229 #define __Pyx_c_sum_double(a, b) ((a)+(b))
3230 #define __Pyx_c_diff_double(a, b) ((a)-(b))
3231 #define __Pyx_c_prod_double(a, b) ((a)*(b))
3232 #define __Pyx_c_quot_double(a, b) ((a)/(b))
3233 #define __Pyx_c_neg_double(a) (-(a))
3234 #ifdef __cplusplus
3235 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
3236 #define __Pyx_c_conj_double(z) (::std::conj(z))
3237 #if 1
3238 #define __Pyx_c_abs_double(z) (::std::abs(z))
3239 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
3240 #endif
3241 #else
3242 #define __Pyx_c_is_zero_double(z) ((z)==0)
3243 #define __Pyx_c_conj_double(z) (conj(z))
3244 #if 1
3245 #define __Pyx_c_abs_double(z) (cabs(z))
3246 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
3247 #endif
3248 #endif
3249#else
3250 static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
3251 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
3252 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
3253 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
3254 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
3255 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
3256 static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
3257 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
3258 #if 1
3259 static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
3260 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
3261 #endif
3262#endif
3263
3264/* Arithmetic.proto */
3265#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3266 #define __Pyx_c_eq_long__double(a, b) ((a)==(b))
3267 #define __Pyx_c_sum_long__double(a, b) ((a)+(b))
3268 #define __Pyx_c_diff_long__double(a, b) ((a)-(b))
3269 #define __Pyx_c_prod_long__double(a, b) ((a)*(b))
3270 #define __Pyx_c_quot_long__double(a, b) ((a)/(b))
3271 #define __Pyx_c_neg_long__double(a) (-(a))
3272 #ifdef __cplusplus
3273 #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
3274 #define __Pyx_c_conj_long__double(z) (::std::conj(z))
3275 #if 1
3276 #define __Pyx_c_abs_long__double(z) (::std::abs(z))
3277 #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b))
3278 #endif
3279 #else
3280 #define __Pyx_c_is_zero_long__double(z) ((z)==0)
3281 #define __Pyx_c_conj_long__double(z) (conjl(z))
3282 #if 1
3283 #define __Pyx_c_abs_long__double(z) (cabsl(z))
3284 #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b))
3285 #endif
3286 #endif
3287#else
3288 static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3289 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3290 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3291 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3292 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3293 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
3294 static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
3295 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
3296 #if 1
3297 static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
3298 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3299 #endif
3300#endif
3301
3302/* CIntToPy.proto */
3303static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value);
3304
3305/* CIntFromPy.proto */
3306static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *);
3307
3308/* CIntToPy.proto */
3309static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value);
3310
3311/* CIntFromPy.proto */
3312static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *);
3313
3314/* GetRuntimeVersion.proto */
3315#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
3316static unsigned long __Pyx_cached_runtime_version = 0;
3317static void __Pyx_init_runtime_version(void);
3318#else
3319#define __Pyx_init_runtime_version()
3320#endif
3321static unsigned long __Pyx_get_runtime_version(void);
3322
3323/* SwapException.proto (used by CoroutineBase) */
3324#if CYTHON_FAST_THREAD_STATE
3325#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
3326static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3327#else
3328static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
3329#endif
3330
3331/* IterNextPlain.proto (used by CoroutineBase) */
3332static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator);
3333#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
3334static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void);
3335#endif
3336
3337/* PyObjectCallMethod1.proto (used by CoroutineBase) */
3338static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
3339
3340/* PyObjectCallNoArg.proto (used by CoroutineBase) */
3341static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
3342
3343/* ReturnWithStopIteration.proto (used by CoroutineBase) */
3344static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext);
3345
3346/* CoroutineBase.proto (used by Generator) */
3347struct __pyx_CoroutineObject;
3348typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *);
3349#if CYTHON_USE_EXC_INFO_STACK
3350#define __Pyx_ExcInfoStruct _PyErr_StackItem
3351#else
3352typedef struct {
3353 PyObject *exc_type;
3354 PyObject *exc_value;
3355 PyObject *exc_traceback;
3356} __Pyx_ExcInfoStruct;
3357#endif
3358typedef struct __pyx_CoroutineObject {
3359 PyObject_HEAD
3360 __pyx_coroutine_body_t body;
3361 PyObject *closure;
3362 __Pyx_ExcInfoStruct gi_exc_state;
3363#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
3364 PyObject *gi_weakreflist;
3365#endif
3366 PyObject *classobj;
3367 PyObject *yieldfrom;
3368 __Pyx_pyiter_sendfunc yieldfrom_am_send;
3369 PyObject *gi_name;
3370 PyObject *gi_qualname;
3371 PyObject *gi_modulename;
3372 PyObject *gi_code;
3373 PyObject *gi_frame;
3374#if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE)
3375 PyMonitoringState __pyx_pymonitoring_state[__Pyx_MonitoringEventTypes_CyGen_count];
3376 uint64_t __pyx_pymonitoring_version;
3377#endif
3378 int resume_label;
3379 char is_running;
3380} __pyx_CoroutineObject;
3381static __pyx_CoroutineObject *__Pyx__Coroutine_New(
3382 PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
3383 PyObject *name, PyObject *qualname, PyObject *module_name);
3384static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
3385 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
3386 PyObject *name, PyObject *qualname, PyObject *module_name);
3387static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
3388static int __Pyx_Coroutine_clear(PyObject *self);
3389static __Pyx_PySendResult __Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval);
3390static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
3391static __Pyx_PySendResult __Pyx_Coroutine_Close(PyObject *self, PyObject **retval);
3392static PyObject *__Pyx_Coroutine_Throw(PyObject *gen,
3393#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
3394 PyObject *args
3395#else
3396 PyObject *const *args, Py_ssize_t nargs
3397#endif
3398 );
3399#if CYTHON_USE_EXC_INFO_STACK
3400#define __Pyx_Coroutine_SwapException(self)
3401#define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
3402#else
3403#define __Pyx_Coroutine_SwapException(self) {\
3404 __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
3405 __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
3406 }
3407#define __Pyx_Coroutine_ResetAndClearException(self) {\
3408 __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
3409 (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
3410 }
3411#endif
3412#if CYTHON_FAST_THREAD_STATE
3413#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
3414 __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
3415#else
3416#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
3417 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
3418#endif
3419static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
3420static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
3421static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen);
3422static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen);
3423static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen);
3424static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure);
3425#if __PYX_HAS_PY_AM_SEND == 2
3426static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send);
3427#endif
3428static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg);
3429
3430/* Generator.proto */
3431#define __Pyx_Generator_USED
3432#define __Pyx_Generator_CheckExact(obj) Py_IS_TYPE(obj, __pyx_mstate_global->__pyx_GeneratorType)
3433#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
3434 __Pyx__Coroutine_New(__pyx_mstate_global->__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
3435static PyObject *__Pyx_Generator_Next(PyObject *self);
3436static int __pyx_Generator_init(PyObject *module);
3437static CYTHON_INLINE PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self);
3438
3439/* CheckBinaryVersion.proto */
3440static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
3441
3442/* DecompressString.proto */
3443static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo);
3444
3445/* DecompressString_LZSS.proto */
3446static PyObject *__Pyx_DecompressString_LZSS(const char *s, size_t compressed_length, size_t uncompressed_length);
3447
3448/* MultiPhaseInitModuleState.proto */
3449#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
3450#include <stdlib.h>
3451static PyObject *__Pyx_State_FindModule(void*);
3452static int __Pyx_State_AddModule(PyObject* module, void*);
3453static int __Pyx_State_RemoveModule(void*);
3454#elif CYTHON_USE_MODULE_STATE
3455#define __Pyx_State_FindModule PyState_FindModule
3456#define __Pyx_State_AddModule PyState_AddModule
3457#define __Pyx_State_RemoveModule PyState_RemoveModule
3458#endif
3459
3460/* #### Code section: module_declarations ### */
3461/* CythonABIVersion.proto */
3462#if CYTHON_COMPILING_IN_LIMITED_API
3463 #if CYTHON_VECTORCALL
3464 #define __PYX_VECTORCALL_ABI_SUFFIX "_vectorcall"
3465 #else
3466 #define __PYX_VECTORCALL_ABI_SUFFIX
3467 #endif
3468 #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_VECTORCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
3469#else
3470 #define __PYX_LIMITED_ABI_SUFFIX
3471#endif
3472#if __PYX_HAS_PY_AM_SEND == 1
3473 #define __PYX_AM_SEND_ABI_SUFFIX
3474#elif __PYX_HAS_PY_AM_SEND == 2
3475 #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
3476#else
3477 #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
3478#endif
3479#ifndef __PYX_MONITORING_ABI_SUFFIX
3480 #define __PYX_MONITORING_ABI_SUFFIX
3481#endif
3482#if CYTHON_USE_TP_FINALIZE
3483 #define __PYX_TP_FINALIZE_ABI_SUFFIX
3484#else
3485 #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
3486#endif
3487#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
3488 #define __PYX_FREELISTS_ABI_SUFFIX
3489#else
3490 #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
3491#endif
3492#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
3493 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX "opaque"
3494#else
3495 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
3496#endif
3497#define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
3498#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
3499#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
3500
3501static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3502static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3503static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3504static CYTHON_INLINE char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3505static CYTHON_INLINE int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3506static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3507static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3508static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3509static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3510static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3511static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self); /* proto*/
3512static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3513static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3514static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3515static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3516static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3517static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3518static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self); /* proto*/
3519static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self); /* proto*/
3520static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self); /* proto*/
3521static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self); /* proto*/
3522static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self); /* proto*/
3523static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self); /* proto*/
3524static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self); /* proto*/
3525static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3526static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3527static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3528static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3529static CYTHON_INLINE void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3530static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3531static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3532static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3533static CYTHON_INLINE void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3534static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3535static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self); /* proto*/
3536
3537/* Module declarations from "libc.string" */
3538
3539/* Module declarations from "libc.stdio" */
3540
3541/* Module declarations from "__builtin__" */
3542
3543/* Module declarations from "cpython.type" */
3544
3545/* Module declarations from "cpython" */
3546
3547/* Module declarations from "cpython.object" */
3548
3549/* Module declarations from "cpython.ref" */
3550
3551/* Module declarations from "numpy" */
3552
3553/* Module declarations from "numpy" */
3554
3555/* Module declarations from "libc.math" */
3556
3557/* Module declarations from "Isosurface" */
3558static PyArrayObject *__pyx_f_10Isosurface_EVec(struct __pyx_opt_args_10Isosurface_EVec *__pyx_optional_args); /*proto*/
3559static double __pyx_f_10Isosurface_enorm(PyArrayObject *); /*proto*/
3560static double __pyx_f_10Isosurface_edot(PyArrayObject *, PyArrayObject *); /*proto*/
3561static PyArrayObject *__pyx_f_10Isosurface_ecross(PyArrayObject *, PyArrayObject *); /*proto*/
3562static double __pyx_f_10Isosurface_etriple(PyArrayObject *, PyArrayObject *, PyArrayObject *); /*proto*/
3563/* #### Code section: typeinfo ### */
3564static const __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 };
3565/* #### Code section: before_global_var ### */
3566#define __Pyx_MODULE_NAME "Isosurface"
3567extern int __pyx_module_is_main_Isosurface;
3568int __pyx_module_is_main_Isosurface = 0;
3569
3570/* Implementation of "Isosurface" */
3571/* #### Code section: global_var ### */
3572static PyObject *__pyx_builtin_enumerate;
3573static PyObject *__pyx_builtin_print;
3574static PyObject *__pyx_builtin_open;
3575static PyObject *__pyx_builtin_zip;
3576/* #### Code section: string_decls ### */
3577static const char __pyx_k_AuxiliaryVariables_subclasses_f[] = "\nAuxiliaryVariables subclasses for extracting isosurfaces and contours\n";
3578/* #### Code section: decls ### */
3579static 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); /* proto */
3580static PyObject *__pyx_pf_10Isosurface_10Isosurface_11attachModel_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
3581static 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); /* proto */
3582static 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); /* proto */
3583static PyObject *__pyx_pf_10Isosurface_10Isosurface_6triangulateIsosurface(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value); /* proto */
3584static 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); /* proto */
3585static 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); /* proto */
3586static 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); /* proto */
3587static PyObject *__pyx_pf_10Isosurface_10Isosurface_14calculate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_checkTime); /* proto */
3588static PyObject *__pyx_pf_10Isosurface_10Isosurface_16writeSceneHeader(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cam); /* proto */
3589static PyObject *__pyx_tp_new__initialisation_10Isosurface___pyx_scope_struct__genexpr(PyObject *o,
3590#if CYTHON_VECTORCALL_TPNEW
3591 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
3592#else
3593 PyObject *a, PyObject *k
3594#endif
3595); /*proto*/
3596static PyObject *__pyx_tp_new_vectorcall_10Isosurface___pyx_scope_struct__genexpr(PyTypeObject *t,
3597#if CYTHON_VECTORCALL_TPNEW
3598 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
3599#else
3600 PyObject *a, PyObject *k
3601#endif
3602); /*proto*/
3603#if CYTHON_VECTORCALL_TPNEW
3604static PyObject *__pyx_tp_new_10Isosurface___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3605#endif
3606#if !CYTHON_VECTORCALL_TPNEW
3607#define __pyx_tp_new_10Isosurface___pyx_scope_struct__genexpr __pyx_tp_new_vectorcall_10Isosurface___pyx_scope_struct__genexpr
3608#endif
3609#if CYTHON_VECTORCALL_TPNEW
3610static PyObject *__pyx_tp_vectorcall_10Isosurface___pyx_scope_struct__genexpr(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
3611#endif
3612/* #### Code section: late_includes ### */
3613/* #### Code section: module_state ### */
3614/* SmallCodeConfig */
3615#ifndef CYTHON_SMALL_CODE
3616#if defined(__clang__)
3617 #define CYTHON_SMALL_CODE
3618#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
3619 #define CYTHON_SMALL_CODE __attribute__((cold))
3620#else
3621 #define CYTHON_SMALL_CODE
3622#endif
3623#endif
3624
3625#ifdef __cplusplus
3626namespace {
3627 #endif
3628 typedef struct {
3629 PyObject *__pyx_d;
3630 PyObject *__pyx_b;
3631 PyObject *__pyx_cython_runtime;
3632 PyObject *__pyx_empty_tuple;
3633 PyObject *__pyx_empty_bytes;
3634 PyObject *__pyx_empty_unicode;
3635 PyTypeObject *__pyx_ptype_7cpython_4type_type;
3636 PyTypeObject *__pyx_ptype_5numpy_dtype;
3637 PyTypeObject *__pyx_ptype_5numpy_flatiter;
3638 PyTypeObject *__pyx_ptype_5numpy_broadcast;
3639 PyTypeObject *__pyx_ptype_5numpy_ndarray;
3640 PyTypeObject *__pyx_ptype_5numpy_generic;
3641 PyTypeObject *__pyx_ptype_5numpy_number;
3642 PyTypeObject *__pyx_ptype_5numpy_integer;
3643 PyTypeObject *__pyx_ptype_5numpy_signedinteger;
3644 PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
3645 PyTypeObject *__pyx_ptype_5numpy_inexact;
3646 PyTypeObject *__pyx_ptype_5numpy_floating;
3647 PyTypeObject *__pyx_ptype_5numpy_complexfloating;
3648 PyTypeObject *__pyx_ptype_5numpy_flexible;
3649 PyTypeObject *__pyx_ptype_5numpy_character;
3650 PyTypeObject *__pyx_ptype_5numpy_ufunc;
3651 PyObject *__pyx_type_10Isosurface___pyx_scope_struct__genexpr;
3652 PyTypeObject *__pyx_ptype_10Isosurface___pyx_scope_struct__genexpr;
3653 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
3654 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
3655 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
3656 PyObject *__pyx_slice[1];
3657 PyObject *__pyx_tuple[12];
3658 PyObject *__pyx_codeobj_tab[10];
3659 PyObject *__pyx_string_tab[262];
3660 PyObject *__pyx_number_tab[13];
3661/* #### Code section: module_state_contents ### */
3662/* PyFrozenDict.module_state_decls */
3663#if CYTHON_COMPILING_IN_LIMITED_API
3664PyObject *__Pyx_PyFrozenDictType;
3665#endif
3666
3667
3668#if CYTHON_USE_FREELISTS
3669struct __pyx_obj_10Isosurface___pyx_scope_struct__genexpr *__pyx_freelist_10Isosurface___pyx_scope_struct__genexpr[8];
3670int __pyx_freecount_10Isosurface___pyx_scope_struct__genexpr;
3671#endif
3672/* CommonTypesMetaclass.module_state_decls */
3673PyTypeObject *__pyx_CommonTypesMetaclassType;
3674
3675/* CachedMethodType.module_state_decls */
3676#if CYTHON_COMPILING_IN_LIMITED_API
3677PyObject *__Pyx_CachedMethodType;
3678#endif
3679
3680/* CythonFunctionPerModule.module_state_decls */
3681PyTypeObject *__pyx_CyFunctionType;
3682
3683/* CodeObjectCache.module_state_decls */
3684struct __Pyx_CodeObjectCache __pyx_code_cache;
3685
3686/* IterNextPlain.module_state_decls */
3687#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
3688PyObject *__Pyx_GetBuiltinNext_LimitedAPI_cache;
3689#endif
3690
3691/* Generator.module_state_decls */
3692PyTypeObject *__pyx_GeneratorType;
3693
3694/* #### Code section: module_state_end ### */
3695} __pyx_mstatetype;
3696#ifdef __cplusplus
3697} /* anonymous namespace */
3698#endif
3699
3700#if CYTHON_USE_MODULE_STATE
3701#ifdef __cplusplus
3702namespace {
3703extern struct PyModuleDef __pyx_moduledef;
3704} /* anonymous namespace */
3705#else
3706static struct PyModuleDef __pyx_moduledef;
3707#endif
3708
3709#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))
3710
3711#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
3712#else
3713static __pyx_mstatetype __pyx_mstate_global_static =
3714#ifdef __cplusplus
3715 {};
3716#else
3717 {0};
3718#endif
3719static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static;
3720#endif
3721/* #### Code section: constant_name_defines ### */
3722#define __pyx_kp_u_object_difference_box_nll_x_nll_2 __pyx_string_tab[0]
3723#define __pyx_kp_u_object_difference_box_nll_x_nll __pyx_string_tab[1]
3724#define __pyx_kp_u_matrix_1_000000_0_000000_0_0000 __pyx_string_tab[2]
3725#define __pyx_kp_u_face_indices_2 __pyx_string_tab[3]
3726#define __pyx_kp_u_normal_indices_2 __pyx_string_tab[4]
3727#define __pyx_kp_u_normal_vectors __pyx_string_tab[5]
3728#define __pyx_kp_u_include_colors_inc_include_text __pyx_string_tab[6]
3729#define __pyx_kp_u_version_3_7_include_proteus_inc __pyx_string_tab[7]
3730#define __pyx_kp_u__2 __pyx_string_tab[8]
3731#define __pyx_kp_u_AuxiliaryVariables_2 __pyx_string_tab[9]
3732#define __pyx_kp_u_Profiling_2 __pyx_string_tab[10]
3733#define __pyx_kp_u_h5_2 __pyx_string_tab[11]
3734#define __pyx_kp_u__3 __pyx_string_tab[12]
3735#define __pyx_kp_u_inside_vector_on_mesh __pyx_string_tab[13]
3736#define __pyx_kp_u_elementsSpatial_Domain __pyx_string_tab[14]
3737#define __pyx_kp_u_nodesSpatial_Domain __pyx_string_tab[15]
3738#define __pyx_kp_u_0_d_1_d_2_d_2 __pyx_string_tab[16]
3739#define __pyx_kp_u_0_d_1_d_2_d __pyx_string_tab[17]
3740#define __pyx_kp_u_0_f_1_f_2_f __pyx_string_tab[18]
3741#define __pyx_kp_u_ __pyx_string_tab[19]
3742#define __pyx_kp_u_ATTACHING_TO_HDF5 __pyx_string_tab[20]
3743#define __pyx_kp_u_Calculate_called_at_time __pyx_string_tab[21]
3744#define __pyx_kp_u_Elements_have_0_d_vertices_but_a __pyx_string_tab[22]
3745#define __pyx_kp_u_Extract_isosurfaces __pyx_string_tab[23]
3746#define __pyx_kp_u_Isosurface_file_format_not_recog __pyx_string_tab[24]
3747#define __pyx_kp_u_Only_zero_isocontour_extraction __pyx_string_tab[25]
3748#define __pyx_kp_u_Writing_pov_frame __pyx_string_tab[26]
3749#define __pyx_kp_u_disable __pyx_string_tab[27]
3750#define __pyx_kp_u_enable __pyx_string_tab[28]
3751#define __pyx_kp_u_face_indices __pyx_string_tab[29]
3752#define __pyx_kp_u_gc __pyx_string_tab[30]
3753#define __pyx_kp_u_isenabled __pyx_string_tab[31]
3754#define __pyx_kp_u_mesh2_vertex_vectors __pyx_string_tab[32]
3755#define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_string_tab[33]
3756#define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_string_tab[34]
3757#define __pyx_kp_u_only_implemented_for_0_isosurfac __pyx_string_tab[35]
3758#define __pyx_kp_u_proteus_inc __pyx_string_tab[36]
3759#define __pyx_kp_u_proteus_Isosurface_pyx __pyx_string_tab[37]
3760#define __pyx_kp_u_0_d __pyx_string_tab[38]
3761#define __pyx_kp_u_field_s___value_f___frame_04d_p __pyx_string_tab[39]
3762#define __pyx_kp_u__4 __pyx_string_tab[40]
3763#define __pyx_kp_u_union_of_meshes_difference_of_p __pyx_string_tab[41]
3764#define __pyx_n_u__5 __pyx_string_tab[42]
3765#define __pyx_n_u_AV_base __pyx_string_tab[43]
3766#define __pyx_n_u_AuxiliaryVariables __pyx_string_tab[44]
3767#define __pyx_n_u_Comm __pyx_string_tab[45]
3768#define __pyx_n_u_FemField __pyx_string_tab[46]
3769#define __pyx_n_u_File __pyx_string_tab[47]
3770#define __pyx_n_u_I __pyx_string_tab[48]
3771#define __pyx_n_u_Isosurface __pyx_string_tab[49]
3772#define __pyx_n_u_Isosurface___init __pyx_string_tab[50]
3773#define __pyx_n_u_Isosurface_attachHDF5 __pyx_string_tab[51]
3774#define __pyx_n_u_Isosurface_attachModel __pyx_string_tab[52]
3775#define __pyx_n_u_Isosurface_attachModel_locals_ge __pyx_string_tab[53]
3776#define __pyx_n_u_Isosurface_calculate __pyx_string_tab[54]
3777#define __pyx_n_u_Isosurface_triangulateIsosurface __pyx_string_tab[55]
3778#define __pyx_n_u_Isosurface_writeIsosurfaceMesh __pyx_string_tab[56]
3779#define __pyx_n_u_Isosurface_writeIsosurfaceMesh_h __pyx_string_tab[57]
3780#define __pyx_n_u_Isosurface_writeIsosurfaceMesh_p __pyx_string_tab[58]
3781#define __pyx_n_u_Isosurface_writeSceneHeader __pyx_string_tab[59]
3782#define __pyx_n_u_J __pyx_string_tab[60]
3783#define __pyx_n_u_L __pyx_string_tab[61]
3784#define __pyx_n_u_MPI __pyx_string_tab[62]
3785#define __pyx_n_u_OrderedDict __pyx_string_tab[63]
3786#define __pyx_n_u_PETSc __pyx_string_tab[64]
3787#define __pyx_n_u_Profiling __pyx_string_tab[65]
3788#define __pyx_n_u_Template __pyx_string_tab[66]
3789#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[67]
3790#define __pyx_n_u_annotate __pyx_string_tab[68]
3791#define __pyx_n_u_class_getitem __pyx_string_tab[69]
3792#define __pyx_n_u_doc __pyx_string_tab[70]
3793#define __pyx_n_u_func __pyx_string_tab[71]
3794#define __pyx_n_u_init __pyx_string_tab[72]
3795#define __pyx_n_u_main __pyx_string_tab[73]
3796#define __pyx_n_u_metaclass __pyx_string_tab[74]
3797#define __pyx_n_u_module __pyx_string_tab[75]
3798#define __pyx_n_u_mro_entries __pyx_string_tab[76]
3799#define __pyx_n_u_name __pyx_string_tab[77]
3800#define __pyx_n_u_prepare __pyx_string_tab[78]
3801#define __pyx_n_u_qualname __pyx_string_tab[79]
3802#define __pyx_n_u_test __pyx_string_tab[80]
3803#define __pyx_n_u_is_coroutine __pyx_string_tab[81]
3804#define __pyx_n_u_a __pyx_string_tab[82]
3805#define __pyx_n_u_activeTime __pyx_string_tab[83]
3806#define __pyx_n_u_ar __pyx_string_tab[84]
3807#define __pyx_n_u_array __pyx_string_tab[85]
3808#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[86]
3809#define __pyx_n_u_attachHDF5 __pyx_string_tab[87]
3810#define __pyx_n_u_attachModel __pyx_string_tab[88]
3811#define __pyx_n_u_barrier __pyx_string_tab[89]
3812#define __pyx_n_u_beginSequential __pyx_string_tab[90]
3813#define __pyx_n_u_bn __pyx_string_tab[91]
3814#define __pyx_n_u_bnt __pyx_string_tab[92]
3815#define __pyx_n_u_boundaryNodes __pyx_string_tab[93]
3816#define __pyx_n_u_calculate __pyx_string_tab[94]
3817#define __pyx_n_u_cam __pyx_string_tab[95]
3818#define __pyx_n_u_cam_x __pyx_string_tab[96]
3819#define __pyx_n_u_cam_y __pyx_string_tab[97]
3820#define __pyx_n_u_cam_z __pyx_string_tab[98]
3821#define __pyx_n_u_checkTime __pyx_string_tab[99]
3822#define __pyx_n_u_cline_in_traceback __pyx_string_tab[100]
3823#define __pyx_n_u_close __pyx_string_tab[101]
3824#define __pyx_n_u_coefficients __pyx_string_tab[102]
3825#define __pyx_n_u_collections __pyx_string_tab[103]
3826#define __pyx_n_u_comm __pyx_string_tab[104]
3827#define __pyx_n_u_count_nonzero __pyx_string_tab[105]
3828#define __pyx_n_u_create_dataset __pyx_string_tab[106]
3829#define __pyx_n_u_d __pyx_string_tab[107]
3830#define __pyx_n_u_data __pyx_string_tab[108]
3831#define __pyx_n_u_defaultdict __pyx_string_tab[109]
3832#define __pyx_n_u_dof __pyx_string_tab[110]
3833#define __pyx_n_u_domain __pyx_string_tab[111]
3834#define __pyx_n_u_domain_fur_x __pyx_string_tab[112]
3835#define __pyx_n_u_domain_fur_y __pyx_string_tab[113]
3836#define __pyx_n_u_domain_fur_z __pyx_string_tab[114]
3837#define __pyx_n_u_domain_nll_x __pyx_string_tab[115]
3838#define __pyx_n_u_domain_nll_y __pyx_string_tab[116]
3839#define __pyx_n_u_domain_nll_z __pyx_string_tab[117]
3840#define __pyx_n_u_dset __pyx_string_tab[118]
3841#define __pyx_n_u_dx __pyx_string_tab[119]
3842#define __pyx_n_u_e __pyx_string_tab[120]
3843#define __pyx_n_u_eN __pyx_string_tab[121]
3844#define __pyx_n_u_ebN __pyx_string_tab[122]
3845#define __pyx_n_u_elementBoundaryMaterialTypes __pyx_string_tab[123]
3846#define __pyx_n_u_elementBoundaryNodesArray __pyx_string_tab[124]
3847#define __pyx_n_u_elementNodesArray __pyx_string_tab[125]
3848#define __pyx_n_u_elements __pyx_string_tab[126]
3849#define __pyx_n_u_elems __pyx_string_tab[127]
3850#define __pyx_n_u_endSequential __pyx_string_tab[128]
3851#define __pyx_n_u_enumerate __pyx_string_tab[129]
3852#define __pyx_n_u_eps __pyx_string_tab[130]
3853#define __pyx_n_u_exteriorElementBoundariesArray __pyx_string_tab[131]
3854#define __pyx_n_u_f __pyx_string_tab[132]
3855#define __pyx_n_u_field __pyx_string_tab[133]
3856#define __pyx_n_u_fieldNames __pyx_string_tab[134]
3857#define __pyx_n_u_field_i __pyx_string_tab[135]
3858#define __pyx_n_u_filename __pyx_string_tab[136]
3859#define __pyx_n_u_fileprefix __pyx_string_tab[137]
3860#define __pyx_n_u_fine_grid __pyx_string_tab[138]
3861#define __pyx_n_u_flatten __pyx_string_tab[139]
3862#define __pyx_n_u_floor_z __pyx_string_tab[140]
3863#define __pyx_n_u_flush __pyx_string_tab[141]
3864#define __pyx_n_u_format __pyx_string_tab[142]
3865#define __pyx_n_u_frame __pyx_string_tab[143]
3866#define __pyx_n_u_fur __pyx_string_tab[144]
3867#define __pyx_n_u_fur_x __pyx_string_tab[145]
3868#define __pyx_n_u_fur_y __pyx_string_tab[146]
3869#define __pyx_n_u_fur_z __pyx_string_tab[147]
3870#define __pyx_n_u_g2b __pyx_string_tab[148]
3871#define __pyx_n_u_genexpr __pyx_string_tab[149]
3872#define __pyx_n_u_get __pyx_string_tab[150]
3873#define __pyx_n_u_gn __pyx_string_tab[151]
3874#define __pyx_n_u_h5 __pyx_string_tab[152]
3875#define __pyx_n_u_h5py __pyx_string_tab[153]
3876#define __pyx_n_u_i __pyx_string_tab[154]
3877#define __pyx_n_u_index __pyx_string_tab[155]
3878#define __pyx_n_u_isMaster __pyx_string_tab[156]
3879#define __pyx_n_u_isosurface __pyx_string_tab[157]
3880#define __pyx_n_u_isosurfaces __pyx_string_tab[158]
3881#define __pyx_n_u_items __pyx_string_tab[159]
3882#define __pyx_n_u_itertools __pyx_string_tab[160]
3883#define __pyx_n_u_j __pyx_string_tab[161]
3884#define __pyx_n_u_join __pyx_string_tab[162]
3885#define __pyx_n_u_levelModelList __pyx_string_tab[163]
3886#define __pyx_n_u_light __pyx_string_tab[164]
3887#define __pyx_n_u_light_dx __pyx_string_tab[165]
3888#define __pyx_n_u_light_dy __pyx_string_tab[166]
3889#define __pyx_n_u_light_x __pyx_string_tab[167]
3890#define __pyx_n_u_light_y __pyx_string_tab[168]
3891#define __pyx_n_u_light_z __pyx_string_tab[169]
3892#define __pyx_n_u_log __pyx_string_tab[170]
3893#define __pyx_n_u_logDir __pyx_string_tab[171]
3894#define __pyx_n_u_logEvent __pyx_string_tab[172]
3895#define __pyx_n_u_look_at __pyx_string_tab[173]
3896#define __pyx_n_u_look_at_x __pyx_string_tab[174]
3897#define __pyx_n_u_look_at_y __pyx_string_tab[175]
3898#define __pyx_n_u_look_at_z __pyx_string_tab[176]
3899#define __pyx_n_u_mesh __pyx_string_tab[177]
3900#define __pyx_n_u_minus __pyx_string_tab[178]
3901#define __pyx_n_u_model __pyx_string_tab[179]
3902#define __pyx_n_u_mpi4py __pyx_string_tab[180]
3903#define __pyx_n_u_n __pyx_string_tab[181]
3904#define __pyx_n_u_nElements_global __pyx_string_tab[182]
3905#define __pyx_n_u_nFrames __pyx_string_tab[183]
3906#define __pyx_n_u_nMinus __pyx_string_tab[184]
3907#define __pyx_n_u_nN_start __pyx_string_tab[185]
3908#define __pyx_n_u_nPlus __pyx_string_tab[186]
3909#define __pyx_n_u_nZeros __pyx_string_tab[187]
3910#define __pyx_n_u_namedtuple __pyx_string_tab[188]
3911#define __pyx_n_u_next __pyx_string_tab[189]
3912#define __pyx_n_u_next_output __pyx_string_tab[190]
3913#define __pyx_n_u_ni __pyx_string_tab[191]
3914#define __pyx_n_u_nll __pyx_string_tab[192]
3915#define __pyx_n_u_nll_x __pyx_string_tab[193]
3916#define __pyx_n_u_nll_y __pyx_string_tab[194]
3917#define __pyx_n_u_nll_z __pyx_string_tab[195]
3918#define __pyx_n_u_nodeArray __pyx_string_tab[196]
3919#define __pyx_n_u_nodes __pyx_string_tab[197]
3920#define __pyx_n_u_norm __pyx_string_tab[198]
3921#define __pyx_n_u_normal __pyx_string_tab[199]
3922#define __pyx_n_u_normal_indices __pyx_string_tab[200]
3923#define __pyx_n_u_normals __pyx_string_tab[201]
3924#define __pyx_n_u_np __pyx_string_tab[202]
3925#define __pyx_n_u_num_owned_elements __pyx_string_tab[203]
3926#define __pyx_n_u_numpy __pyx_string_tab[204]
3927#define __pyx_n_u_numpy_linalg __pyx_string_tab[205]
3928#define __pyx_n_u_open __pyx_string_tab[206]
3929#define __pyx_n_u_os __pyx_string_tab[207]
3930#define __pyx_n_u_path __pyx_string_tab[208]
3931#define __pyx_n_u_petsc4py __pyx_string_tab[209]
3932#define __pyx_n_u_phi __pyx_string_tab[210]
3933#define __pyx_n_u_plus __pyx_string_tab[211]
3934#define __pyx_n_u_pop __pyx_string_tab[212]
3935#define __pyx_n_u_pov __pyx_string_tab[213]
3936#define __pyx_n_u_povScene __pyx_string_tab[214]
3937#define __pyx_n_u_povSceneTemplate __pyx_string_tab[215]
3938#define __pyx_n_u_pov_filename __pyx_string_tab[216]
3939#define __pyx_n_u_print __pyx_string_tab[217]
3940#define __pyx_n_u_product __pyx_string_tab[218]
3941#define __pyx_n_u_proteus __pyx_string_tab[219]
3942#define __pyx_n_u_rank __pyx_string_tab[220]
3943#define __pyx_n_u_s __pyx_string_tab[221]
3944#define __pyx_n_u_sampleRate __pyx_string_tab[222]
3945#define __pyx_n_u_self __pyx_string_tab[223]
3946#define __pyx_n_u_send __pyx_string_tab[224]
3947#define __pyx_n_u_setdefault __pyx_string_tab[225]
3948#define __pyx_n_u_shape __pyx_string_tab[226]
3949#define __pyx_n_u_sky_z __pyx_string_tab[227]
3950#define __pyx_n_u_step __pyx_string_tab[228]
3951#define __pyx_n_u_string __pyx_string_tab[229]
3952#define __pyx_n_u_substitute __pyx_string_tab[230]
3953#define __pyx_n_u_tLast __pyx_string_tab[231]
3954#define __pyx_n_u_throw __pyx_string_tab[232]
3955#define __pyx_n_u_time __pyx_string_tab[233]
3956#define __pyx_n_u_timeIntegration __pyx_string_tab[234]
3957#define __pyx_n_u_triangulateIsosurface __pyx_string_tab[235]
3958#define __pyx_n_u_u __pyx_string_tab[236]
3959#define __pyx_n_u_v __pyx_string_tab[237]
3960#define __pyx_n_u_value __pyx_string_tab[238]
3961#define __pyx_n_u_values __pyx_string_tab[239]
3962#define __pyx_n_u_variableNames __pyx_string_tab[240]
3963#define __pyx_n_u_w __pyx_string_tab[241]
3964#define __pyx_n_u_wall_y __pyx_string_tab[242]
3965#define __pyx_n_u_write __pyx_string_tab[243]
3966#define __pyx_n_u_writeBoundary __pyx_string_tab[244]
3967#define __pyx_n_u_writeIsosurfaceMesh __pyx_string_tab[245]
3968#define __pyx_n_u_writeIsosurfaceMesh_h5 __pyx_string_tab[246]
3969#define __pyx_n_u_writeIsosurfaceMesh_povray __pyx_string_tab[247]
3970#define __pyx_n_u_writeSceneHeader __pyx_string_tab[248]
3971#define __pyx_n_u_x __pyx_string_tab[249]
3972#define __pyx_n_u_zeros __pyx_string_tab[250]
3973#define __pyx_n_u_zip __pyx_string_tab[251]
3974#define __pyx_kp_b_iso88591_A_4xs_q_Rt1A_1G7_A_q_wa_A_q __pyx_string_tab[252]
3975#define __pyx_kp_b_iso88591_A_F_G1_4y_hb_q__BgQ_2U_q_k_Qd_uT __pyx_string_tab[253]
3976#define __pyx_kp_b_iso88591_A_IQ_E_N_q_A_uA_A_uA_A_uA_S_A_Q __pyx_string_tab[254]
3977#define __pyx_kp_b_iso88591_A_1_F_G1_4y_hb_q__BgQ_G1_a_E_4uI __pyx_string_tab[255]
3978#define __pyx_kp_b_iso88591_A_F_G_XQ_IRwj_1_HBgZz_O2WJ_q_6_A __pyx_string_tab[256]
3979#define __pyx_kp_b_iso88591__6 __pyx_string_tab[257]
3980#define __pyx_kp_b_iso88591_1_1_4_q_q_Bd_1_t_we5_Kq_2U_04Kq __pyx_string_tab[258]
3981#define __pyx_kp_b_iso88591_q_1_4uIQ_at3b_3e3at7_d_t3a_as_D __pyx_string_tab[259]
3982#define __pyx_kp_b_iso88591_1_N_Qc_4q_Q_d_1_b_AV1_M_1_32T_Q __pyx_string_tab[260]
3983#define __pyx_kp_b_iso88591_A_QH_O1_Ja_IQ_L_Kq_a_Cz_Q_Q_r_A __pyx_string_tab[261]
3984#define __pyx_float_0_0 __pyx_number_tab[0]
3985#define __pyx_float_0_5 __pyx_number_tab[1]
3986#define __pyx_float_2_0 __pyx_number_tab[2]
3987#define __pyx_float_0_01 __pyx_number_tab[3]
3988#define __pyx_float_0_02 __pyx_number_tab[4]
3989#define __pyx_float_0_85 __pyx_number_tab[5]
3990#define __pyx_int_0 __pyx_number_tab[6]
3991#define __pyx_int_1 __pyx_number_tab[7]
3992#define __pyx_int_2 __pyx_number_tab[8]
3993#define __pyx_int_3 __pyx_number_tab[9]
3994#define __pyx_int_4 __pyx_number_tab[10]
3995#define __pyx_int_5 __pyx_number_tab[11]
3996#define __pyx_int_10 __pyx_number_tab[12]
3997/* #### Code section: module_state_clear ### */
3998#if CYTHON_USE_MODULE_STATE
3999static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
4000 __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
4001 if (!clear_module_state) return 0;
4002 Py_CLEAR(clear_module_state->__pyx_d);
4003 Py_CLEAR(clear_module_state->__pyx_b);
4004 Py_CLEAR(clear_module_state->__pyx_cython_runtime);
4005 Py_CLEAR(clear_module_state->__pyx_empty_tuple);
4006 Py_CLEAR(clear_module_state->__pyx_empty_bytes);
4007 Py_CLEAR(clear_module_state->__pyx_empty_unicode);
4008 #if CYTHON_PEP489_MULTI_PHASE_INIT
4009 __Pyx_State_RemoveModule(NULL);
4010 #endif
4011 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
4012 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
4013 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
4014 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
4015 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
4016 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
4017 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
4018 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
4019 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
4020 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
4021 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
4022 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
4023 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
4024 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
4025 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
4026 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
4027 Py_CLEAR(clear_module_state->__pyx_ptype_10Isosurface___pyx_scope_struct__genexpr);
4028 Py_CLEAR(clear_module_state->__pyx_type_10Isosurface___pyx_scope_struct__genexpr);
4029 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_items.method);
4030 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_pop.method);
4031 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_values.method);
4032 for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); }
4033 for (int i=0; i<12; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
4034 for (int i=0; i<10; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
4035 for (int i=0; i<262; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
4036 for (int i=0; i<13; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); }
4037/* #### Code section: module_state_clear_contents ### */
4038/* CommonTypesMetaclass.module_state_clear */
4039Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);
4040
4041/* CythonFunctionPerModule.module_state_clear */
4042Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
4043
4044/* Generator.module_state_clear */
4045Py_CLEAR(clear_module_state->__pyx_GeneratorType);
4046
4047/* #### Code section: module_state_clear_end ### */
4048return 0;
4049}
4050#endif
4051/* #### Code section: module_state_traverse ### */
4052#if CYTHON_USE_MODULE_STATE
4053static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
4054 __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
4055 if (!traverse_module_state) return 0;
4056 Py_VISIT(traverse_module_state->__pyx_d);
4057 Py_VISIT(traverse_module_state->__pyx_b);
4058 Py_VISIT(traverse_module_state->__pyx_cython_runtime);
4059 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
4060 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
4061 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
4062 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
4063 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
4064 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
4065 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
4066 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
4067 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
4068 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
4069 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
4070 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
4071 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
4072 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
4073 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
4074 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
4075 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
4076 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
4077 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
4078 Py_VISIT(traverse_module_state->__pyx_ptype_10Isosurface___pyx_scope_struct__genexpr);
4079 Py_VISIT(traverse_module_state->__pyx_type_10Isosurface___pyx_scope_struct__genexpr);
4080 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_items.method);
4081 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_pop.method);
4082 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_values.method);
4083 for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); }
4084 for (int i=0; i<12; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
4085 for (int i=0; i<10; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
4086 for (int i=0; i<262; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
4087 for (int i=0; i<13; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); }
4088/* #### Code section: module_state_traverse_contents ### */
4089/* CommonTypesMetaclass.module_state_traverse */
4090Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);
4091
4092/* CythonFunctionPerModule.module_state_traverse */
4093Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
4094
4095/* Generator.module_state_traverse */
4096Py_VISIT(traverse_module_state->__pyx_GeneratorType);
4097
4098/* #### Code section: module_state_traverse_end ### */
4099return 0;
4100}
4101#endif
4102/* #### Code section: module_code ### */
4103
4104/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":230
4105 *
4106 * ctypedef class numpy.dtype [object PyArray_Descr, check_size ignore]:
4107 * @property # <<<<<<<<<<<<<<
4108 * cdef inline PyTypeObject* typeobj(self) noexcept nogil:
4109 * return PyDataType_TYPEOBJ(self)
4110*/
4111
4112static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self) {
4113 PyTypeObject *__pyx_r;
4114
4115 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":232
4116 * @property
4117 * cdef inline PyTypeObject* typeobj(self) noexcept nogil:
4118 * return PyDataType_TYPEOBJ(self) # <<<<<<<<<<<<<<
4119 *
4120 * @property
4121*/
4122 {
4123
4124 __pyx_r = PyDataType_TYPEOBJ(__pyx_v_self);
4125 }
4126 goto __pyx_L0;
4127
4128 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":230
4129 *
4130 * ctypedef class numpy.dtype [object PyArray_Descr, check_size ignore]:
4131 * @property # <<<<<<<<<<<<<<
4132 * cdef inline PyTypeObject* typeobj(self) noexcept nogil:
4133 * return PyDataType_TYPEOBJ(self)
4134*/
4135
4136 /* function exit code */
4137 __pyx_L0:;
4138 return __pyx_r;
4139}
4140
4141/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":234
4142 * return PyDataType_TYPEOBJ(self)
4143 *
4144 * @property # <<<<<<<<<<<<<<
4145 * cdef inline char kind(self) noexcept nogil:
4146 * return PyDataType_KIND(self)
4147*/
4148
4149static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self) {
4150 char __pyx_r;
4151
4152 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":236
4153 * @property
4154 * cdef inline char kind(self) noexcept nogil:
4155 * return PyDataType_KIND(self) # <<<<<<<<<<<<<<
4156 *
4157 * @property
4158*/
4159 {
4160
4161 __pyx_r = PyDataType_KIND(__pyx_v_self);
4162 }
4163 goto __pyx_L0;
4164
4165 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":234
4166 * return PyDataType_TYPEOBJ(self)
4167 *
4168 * @property # <<<<<<<<<<<<<<
4169 * cdef inline char kind(self) noexcept nogil:
4170 * return PyDataType_KIND(self)
4171*/
4172
4173 /* function exit code */
4174 __pyx_L0:;
4175 return __pyx_r;
4176}
4177
4178/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":238
4179 * return PyDataType_KIND(self)
4180 *
4181 * @property # <<<<<<<<<<<<<<
4182 * cdef inline char type(self) noexcept nogil:
4183 * return PyDataType_TYPE(self)
4184*/
4185
4186static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self) {
4187 char __pyx_r;
4188
4189 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":240
4190 * @property
4191 * cdef inline char type(self) noexcept nogil:
4192 * return PyDataType_TYPE(self) # <<<<<<<<<<<<<<
4193 *
4194 * # Numpy sometimes mutates this without warning (e.g. it'll
4195*/
4196 {
4197
4198 __pyx_r = PyDataType_TYPE(__pyx_v_self);
4199 }
4200 goto __pyx_L0;
4201
4202 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":238
4203 * return PyDataType_KIND(self)
4204 *
4205 * @property # <<<<<<<<<<<<<<
4206 * cdef inline char type(self) noexcept nogil:
4207 * return PyDataType_TYPE(self)
4208*/
4209
4210 /* function exit code */
4211 __pyx_L0:;
4212 return __pyx_r;
4213}
4214
4215/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":247
4216 * # PyArray_IsNativeByteOrder(dtype.byteorder) instead of
4217 * # directly accessing this field.
4218 * @property # <<<<<<<<<<<<<<
4219 * cdef inline char byteorder(self) noexcept nogil:
4220 * return PyDataType_BYTEORDER(self)
4221*/
4222
4223static CYTHON_INLINE char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self) {
4224 char __pyx_r;
4225
4226 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":249
4227 * @property
4228 * cdef inline char byteorder(self) noexcept nogil:
4229 * return PyDataType_BYTEORDER(self) # <<<<<<<<<<<<<<
4230 *
4231 * @property
4232*/
4233 {
4234
4235 __pyx_r = PyDataType_BYTEORDER(__pyx_v_self);
4236 }
4237 goto __pyx_L0;
4238
4239 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":247
4240 * # PyArray_IsNativeByteOrder(dtype.byteorder) instead of
4241 * # directly accessing this field.
4242 * @property # <<<<<<<<<<<<<<
4243 * cdef inline char byteorder(self) noexcept nogil:
4244 * return PyDataType_BYTEORDER(self)
4245*/
4246
4247 /* function exit code */
4248 __pyx_L0:;
4249 return __pyx_r;
4250}
4251
4252/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":251
4253 * return PyDataType_BYTEORDER(self)
4254 *
4255 * @property # <<<<<<<<<<<<<<
4256 * cdef inline int type_num(self) noexcept nogil:
4257 * return PyDataType_TYPENUM(self)
4258*/
4259
4260static CYTHON_INLINE int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self) {
4261 int __pyx_r;
4262
4263 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":253
4264 * @property
4265 * cdef inline int type_num(self) noexcept nogil:
4266 * return PyDataType_TYPENUM(self) # <<<<<<<<<<<<<<
4267 *
4268 * @property
4269*/
4270 {
4271
4272 __pyx_r = PyDataType_TYPENUM(__pyx_v_self);
4273 }
4274 goto __pyx_L0;
4275
4276 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":251
4277 * return PyDataType_BYTEORDER(self)
4278 *
4279 * @property # <<<<<<<<<<<<<<
4280 * cdef inline int type_num(self) noexcept nogil:
4281 * return PyDataType_TYPENUM(self)
4282*/
4283
4284 /* function exit code */
4285 __pyx_L0:;
4286 return __pyx_r;
4287}
4288
4289/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":255
4290 * return PyDataType_TYPENUM(self)
4291 *
4292 * @property # <<<<<<<<<<<<<<
4293 * cdef inline npy_intp itemsize(self) noexcept nogil:
4294 * return PyDataType_ELSIZE(self)
4295*/
4296
4297static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self) {
4298 npy_intp __pyx_r;
4299
4300 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":257
4301 * @property
4302 * cdef inline npy_intp itemsize(self) noexcept nogil:
4303 * return PyDataType_ELSIZE(self) # <<<<<<<<<<<<<<
4304 *
4305 * @property
4306*/
4307 {
4308
4309 __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
4310 }
4311 goto __pyx_L0;
4312
4313 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":255
4314 * return PyDataType_TYPENUM(self)
4315 *
4316 * @property # <<<<<<<<<<<<<<
4317 * cdef inline npy_intp itemsize(self) noexcept nogil:
4318 * return PyDataType_ELSIZE(self)
4319*/
4320
4321 /* function exit code */
4322 __pyx_L0:;
4323 return __pyx_r;
4324}
4325
4326/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":259
4327 * return PyDataType_ELSIZE(self)
4328 *
4329 * @property # <<<<<<<<<<<<<<
4330 * cdef inline npy_intp alignment(self) noexcept nogil:
4331 * return PyDataType_ALIGNMENT(self)
4332*/
4333
4334static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self) {
4335 npy_intp __pyx_r;
4336
4337 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":261
4338 * @property
4339 * cdef inline npy_intp alignment(self) noexcept nogil:
4340 * return PyDataType_ALIGNMENT(self) # <<<<<<<<<<<<<<
4341 *
4342 * # Use fields/names with care as they may be NULL. You must check
4343*/
4344 {
4345
4346 __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
4347 }
4348 goto __pyx_L0;
4349
4350 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":259
4351 * return PyDataType_ELSIZE(self)
4352 *
4353 * @property # <<<<<<<<<<<<<<
4354 * cdef inline npy_intp alignment(self) noexcept nogil:
4355 * return PyDataType_ALIGNMENT(self)
4356*/
4357
4358 /* function exit code */
4359 __pyx_L0:;
4360 return __pyx_r;
4361}
4362
4363/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":265
4364 * # Use fields/names with care as they may be NULL. You must check
4365 * # for this using PyDataType_HASFIELDS.
4366 * @property # <<<<<<<<<<<<<<
4367 * cdef inline object fields(self):
4368 * return <object>PyDataType_FIELDS(self)
4369*/
4370
4371static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self) {
4372 PyObject *__pyx_r = NULL;
4373 __Pyx_RefNannyDeclarations
4374 PyObject *__pyx_t_1;
4375 __Pyx_RefNannySetupContext("__get__", 0);
4376
4377 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":267
4378 * @property
4379 * cdef inline object fields(self):
4380 * return <object>PyDataType_FIELDS(self) # <<<<<<<<<<<<<<
4381 *
4382 * @property
4383*/
4384 __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
4385
4386 {
4387 PyObject *__pyx_temp;
4388 {
4389 __pyx_temp = __pyx_r;
4390 __Pyx_INCREF(((PyObject *)__pyx_t_1));
4391 __pyx_r = ((PyObject *)__pyx_t_1);
4392 }
4393 __Pyx_XDECREF(__pyx_temp);
4394 }
4395
4396 goto __pyx_L0;
4397
4398 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":265
4399 * # Use fields/names with care as they may be NULL. You must check
4400 * # for this using PyDataType_HASFIELDS.
4401 * @property # <<<<<<<<<<<<<<
4402 * cdef inline object fields(self):
4403 * return <object>PyDataType_FIELDS(self)
4404*/
4405
4406 /* function exit code */
4407 __pyx_L0:;
4408 __Pyx_XGIVEREF(__pyx_r);
4409 __Pyx_RefNannyFinishContext();
4410 return __pyx_r;
4411}
4412
4413/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":269
4414 * return <object>PyDataType_FIELDS(self)
4415 *
4416 * @property # <<<<<<<<<<<<<<
4417 * cdef inline tuple names(self):
4418 * return <tuple>PyDataType_NAMES(self)
4419*/
4420
4421static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self) {
4422 PyObject *__pyx_r = NULL;
4423 __Pyx_RefNannyDeclarations
4424 PyObject *__pyx_t_1;
4425 __Pyx_RefNannySetupContext("__get__", 0);
4426
4427 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":271
4428 * @property
4429 * cdef inline tuple names(self):
4430 * return <tuple>PyDataType_NAMES(self) # <<<<<<<<<<<<<<
4431 *
4432 * # Use PyDataType_HASSUBARRAY to test whether this field is
4433*/
4434 __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
4435
4436 {
4437 PyObject *__pyx_temp;
4438 {
4439 __pyx_temp = __pyx_r;
4440 __Pyx_INCREF(((PyObject*)__pyx_t_1));
4441 __pyx_r = ((PyObject*)__pyx_t_1);
4442 }
4443 __Pyx_XDECREF(__pyx_temp);
4444 }
4445
4446 goto __pyx_L0;
4447
4448 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":269
4449 * return <object>PyDataType_FIELDS(self)
4450 *
4451 * @property # <<<<<<<<<<<<<<
4452 * cdef inline tuple names(self):
4453 * return <tuple>PyDataType_NAMES(self)
4454*/
4455
4456 /* function exit code */
4457 __pyx_L0:;
4458 __Pyx_XGIVEREF(__pyx_r);
4459 __Pyx_RefNannyFinishContext();
4460 return __pyx_r;
4461}
4462
4463/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":276
4464 * # valid (the pointer can be NULL). Most users should access
4465 * # this field via the inline helper method PyDataType_SHAPE.
4466 * @property # <<<<<<<<<<<<<<
4467 * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
4468 * return PyDataType_SUBARRAY(self)
4469*/
4470
4471static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self) {
4472 PyArray_ArrayDescr *__pyx_r;
4473
4474 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":278
4475 * @property
4476 * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
4477 * return PyDataType_SUBARRAY(self) # <<<<<<<<<<<<<<
4478 *
4479 * @property
4480*/
4481 {
4482
4483 __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
4484 }
4485 goto __pyx_L0;
4486
4487 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":276
4488 * # valid (the pointer can be NULL). Most users should access
4489 * # this field via the inline helper method PyDataType_SHAPE.
4490 * @property # <<<<<<<<<<<<<<
4491 * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
4492 * return PyDataType_SUBARRAY(self)
4493*/
4494
4495 /* function exit code */
4496 __pyx_L0:;
4497 return __pyx_r;
4498}
4499
4500/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":280
4501 * return PyDataType_SUBARRAY(self)
4502 *
4503 * @property # <<<<<<<<<<<<<<
4504 * cdef inline npy_uint64 flags(self) noexcept nogil:
4505 * """The data types flags."""
4506*/
4507
4508static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self) {
4509 npy_uint64 __pyx_r;
4510
4511 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":283
4512 * cdef inline npy_uint64 flags(self) noexcept nogil:
4513 * """The data types flags."""
4514 * return PyDataType_FLAGS(self) # <<<<<<<<<<<<<<
4515 *
4516 *
4517*/
4518 {
4519
4520 __pyx_r = PyDataType_FLAGS(__pyx_v_self);
4521 }
4522 goto __pyx_L0;
4523
4524 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":280
4525 * return PyDataType_SUBARRAY(self)
4526 *
4527 * @property # <<<<<<<<<<<<<<
4528 * cdef inline npy_uint64 flags(self) noexcept nogil:
4529 * """The data types flags."""
4530*/
4531
4532 /* function exit code */
4533 __pyx_L0:;
4534 return __pyx_r;
4535}
4536
4537/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":292
4538 * ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]:
4539 *
4540 * @property # <<<<<<<<<<<<<<
4541 * cdef inline int numiter(self) noexcept nogil:
4542 * """The number of arrays that need to be broadcast to the same shape."""
4543*/
4544
4545static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self) {
4546 int __pyx_r;
4547
4548 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":295
4549 * cdef inline int numiter(self) noexcept nogil:
4550 * """The number of arrays that need to be broadcast to the same shape."""
4551 * return PyArray_MultiIter_NUMITER(self) # <<<<<<<<<<<<<<
4552 *
4553 * @property
4554*/
4555 {
4556
4557 __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
4558 }
4559 goto __pyx_L0;
4560
4561 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":292
4562 * ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]:
4563 *
4564 * @property # <<<<<<<<<<<<<<
4565 * cdef inline int numiter(self) noexcept nogil:
4566 * """The number of arrays that need to be broadcast to the same shape."""
4567*/
4568
4569 /* function exit code */
4570 __pyx_L0:;
4571 return __pyx_r;
4572}
4573
4574/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":297
4575 * return PyArray_MultiIter_NUMITER(self)
4576 *
4577 * @property # <<<<<<<<<<<<<<
4578 * cdef inline npy_intp size(self) noexcept nogil:
4579 * """The total broadcasted size."""
4580*/
4581
4582static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self) {
4583 npy_intp __pyx_r;
4584
4585 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":300
4586 * cdef inline npy_intp size(self) noexcept nogil:
4587 * """The total broadcasted size."""
4588 * return PyArray_MultiIter_SIZE(self) # <<<<<<<<<<<<<<
4589 *
4590 * @property
4591*/
4592 {
4593
4594 __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
4595 }
4596 goto __pyx_L0;
4597
4598 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":297
4599 * return PyArray_MultiIter_NUMITER(self)
4600 *
4601 * @property # <<<<<<<<<<<<<<
4602 * cdef inline npy_intp size(self) noexcept nogil:
4603 * """The total broadcasted size."""
4604*/
4605
4606 /* function exit code */
4607 __pyx_L0:;
4608 return __pyx_r;
4609}
4610
4611/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":302
4612 * return PyArray_MultiIter_SIZE(self)
4613 *
4614 * @property # <<<<<<<<<<<<<<
4615 * cdef inline npy_intp index(self) noexcept nogil:
4616 * """The current (1-d) index into the broadcasted result."""
4617*/
4618
4619static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self) {
4620 npy_intp __pyx_r;
4621
4622 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":305
4623 * cdef inline npy_intp index(self) noexcept nogil:
4624 * """The current (1-d) index into the broadcasted result."""
4625 * return PyArray_MultiIter_INDEX(self) # <<<<<<<<<<<<<<
4626 *
4627 * @property
4628*/
4629 {
4630
4631 __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
4632 }
4633 goto __pyx_L0;
4634
4635 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":302
4636 * return PyArray_MultiIter_SIZE(self)
4637 *
4638 * @property # <<<<<<<<<<<<<<
4639 * cdef inline npy_intp index(self) noexcept nogil:
4640 * """The current (1-d) index into the broadcasted result."""
4641*/
4642
4643 /* function exit code */
4644 __pyx_L0:;
4645 return __pyx_r;
4646}
4647
4648/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":307
4649 * return PyArray_MultiIter_INDEX(self)
4650 *
4651 * @property # <<<<<<<<<<<<<<
4652 * cdef inline int nd(self) noexcept nogil:
4653 * """The number of dimensions in the broadcasted result."""
4654*/
4655
4656static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self) {
4657 int __pyx_r;
4658
4659 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":310
4660 * cdef inline int nd(self) noexcept nogil:
4661 * """The number of dimensions in the broadcasted result."""
4662 * return PyArray_MultiIter_NDIM(self) # <<<<<<<<<<<<<<
4663 *
4664 * @property
4665*/
4666 {
4667
4668 __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
4669 }
4670 goto __pyx_L0;
4671
4672 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":307
4673 * return PyArray_MultiIter_INDEX(self)
4674 *
4675 * @property # <<<<<<<<<<<<<<
4676 * cdef inline int nd(self) noexcept nogil:
4677 * """The number of dimensions in the broadcasted result."""
4678*/
4679
4680 /* function exit code */
4681 __pyx_L0:;
4682 return __pyx_r;
4683}
4684
4685/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":312
4686 * return PyArray_MultiIter_NDIM(self)
4687 *
4688 * @property # <<<<<<<<<<<<<<
4689 * cdef inline npy_intp* dimensions(self) noexcept nogil:
4690 * """The shape of the broadcasted result."""
4691*/
4692
4693static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self) {
4694 npy_intp *__pyx_r;
4695
4696 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":315
4697 * cdef inline npy_intp* dimensions(self) noexcept nogil:
4698 * """The shape of the broadcasted result."""
4699 * return PyArray_MultiIter_DIMS(self) # <<<<<<<<<<<<<<
4700 *
4701 * @property
4702*/
4703 {
4704
4705 __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
4706 }
4707 goto __pyx_L0;
4708
4709 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":312
4710 * return PyArray_MultiIter_NDIM(self)
4711 *
4712 * @property # <<<<<<<<<<<<<<
4713 * cdef inline npy_intp* dimensions(self) noexcept nogil:
4714 * """The shape of the broadcasted result."""
4715*/
4716
4717 /* function exit code */
4718 __pyx_L0:;
4719 return __pyx_r;
4720}
4721
4722/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":317
4723 * return PyArray_MultiIter_DIMS(self)
4724 *
4725 * @property # <<<<<<<<<<<<<<
4726 * cdef inline void** iters(self) noexcept nogil:
4727 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
4728*/
4729
4730static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self) {
4731 void **__pyx_r;
4732
4733 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":321
4734 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
4735 * On return, the iterators are adjusted for broadcasting."""
4736 * return PyArray_MultiIter_ITERS(self) # <<<<<<<<<<<<<<
4737 *
4738 *
4739*/
4740 {
4741
4742 __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
4743 }
4744 goto __pyx_L0;
4745
4746 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":317
4747 * return PyArray_MultiIter_DIMS(self)
4748 *
4749 * @property # <<<<<<<<<<<<<<
4750 * cdef inline void** iters(self) noexcept nogil:
4751 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
4752*/
4753
4754 /* function exit code */
4755 __pyx_L0:;
4756 return __pyx_r;
4757}
4758
4759/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":335
4760 * # Instead, we use properties that map to the corresponding C-API functions.
4761 *
4762 * @property # <<<<<<<<<<<<<<
4763 * cdef inline PyObject* base(self) noexcept nogil:
4764 * """Returns a borrowed reference to the object owning the data/memory.
4765*/
4766
4767static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self) {
4768 PyObject *__pyx_r;
4769
4770 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":339
4771 * """Returns a borrowed reference to the object owning the data/memory.
4772 * """
4773 * return PyArray_BASE(self) # <<<<<<<<<<<<<<
4774 *
4775 * @property
4776*/
4777 {
4778
4779 __pyx_r = PyArray_BASE(__pyx_v_self);
4780 }
4781 goto __pyx_L0;
4782
4783 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":335
4784 * # Instead, we use properties that map to the corresponding C-API functions.
4785 *
4786 * @property # <<<<<<<<<<<<<<
4787 * cdef inline PyObject* base(self) noexcept nogil:
4788 * """Returns a borrowed reference to the object owning the data/memory.
4789*/
4790
4791 /* function exit code */
4792 __pyx_L0:;
4793 return __pyx_r;
4794}
4795
4796/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":341
4797 * return PyArray_BASE(self)
4798 *
4799 * @property # <<<<<<<<<<<<<<
4800 * cdef inline dtype descr(self):
4801 * """Returns an owned reference to the dtype of the array.
4802*/
4803
4804static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self) {
4805 PyArray_Descr *__pyx_r = NULL;
4806 __Pyx_RefNannyDeclarations
4807 PyArray_Descr *__pyx_t_1;
4808 __Pyx_RefNannySetupContext("__get__", 0);
4809
4810 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":345
4811 * """Returns an owned reference to the dtype of the array.
4812 * """
4813 * return <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
4814 *
4815 * @property
4816*/
4817 __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
4818
4819 {
4820 PyArray_Descr *__pyx_temp;
4821 {
4822 __pyx_temp = __pyx_r;
4823 __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
4824 __pyx_r = ((PyArray_Descr *)__pyx_t_1);
4825 }
4826 __Pyx_XDECREF((PyObject *)__pyx_temp);
4827 }
4828
4829 goto __pyx_L0;
4830
4831 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":341
4832 * return PyArray_BASE(self)
4833 *
4834 * @property # <<<<<<<<<<<<<<
4835 * cdef inline dtype descr(self):
4836 * """Returns an owned reference to the dtype of the array.
4837*/
4838
4839 /* function exit code */
4840 __pyx_L0:;
4841 __Pyx_XGIVEREF((PyObject *)__pyx_r);
4842 __Pyx_RefNannyFinishContext();
4843 return __pyx_r;
4844}
4845
4846/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":347
4847 * return <dtype>PyArray_DESCR(self)
4848 *
4849 * @property # <<<<<<<<<<<<<<
4850 * cdef inline int ndim(self) noexcept nogil:
4851 * """Returns the number of dimensions in the array.
4852*/
4853
4854static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self) {
4855 int __pyx_r;
4856
4857 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":351
4858 * """Returns the number of dimensions in the array.
4859 * """
4860 * return PyArray_NDIM(self) # <<<<<<<<<<<<<<
4861 *
4862 * @property
4863*/
4864 {
4865
4866 __pyx_r = PyArray_NDIM(__pyx_v_self);
4867 }
4868 goto __pyx_L0;
4869
4870 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":347
4871 * return <dtype>PyArray_DESCR(self)
4872 *
4873 * @property # <<<<<<<<<<<<<<
4874 * cdef inline int ndim(self) noexcept nogil:
4875 * """Returns the number of dimensions in the array.
4876*/
4877
4878 /* function exit code */
4879 __pyx_L0:;
4880 return __pyx_r;
4881}
4882
4883/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":353
4884 * return PyArray_NDIM(self)
4885 *
4886 * @property # <<<<<<<<<<<<<<
4887 * cdef inline npy_intp *shape(self) noexcept nogil:
4888 * """Returns a pointer to the dimensions/shape of the array.
4889*/
4890
4891static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self) {
4892 npy_intp *__pyx_r;
4893
4894 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":359
4895 * Can return NULL for 0-dimensional arrays.
4896 * """
4897 * return PyArray_DIMS(self) # <<<<<<<<<<<<<<
4898 *
4899 * @property
4900*/
4901 {
4902
4903 __pyx_r = PyArray_DIMS(__pyx_v_self);
4904 }
4905 goto __pyx_L0;
4906
4907 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":353
4908 * return PyArray_NDIM(self)
4909 *
4910 * @property # <<<<<<<<<<<<<<
4911 * cdef inline npy_intp *shape(self) noexcept nogil:
4912 * """Returns a pointer to the dimensions/shape of the array.
4913*/
4914
4915 /* function exit code */
4916 __pyx_L0:;
4917 return __pyx_r;
4918}
4919
4920/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":361
4921 * return PyArray_DIMS(self)
4922 *
4923 * @property # <<<<<<<<<<<<<<
4924 * cdef inline npy_intp *strides(self) noexcept nogil:
4925 * """Returns a pointer to the strides of the array.
4926*/
4927
4928static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self) {
4929 npy_intp *__pyx_r;
4930
4931 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":366
4932 * The number of elements matches the number of dimensions of the array (ndim).
4933 * """
4934 * return PyArray_STRIDES(self) # <<<<<<<<<<<<<<
4935 *
4936 * @property
4937*/
4938 {
4939
4940 __pyx_r = PyArray_STRIDES(__pyx_v_self);
4941 }
4942 goto __pyx_L0;
4943
4944 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":361
4945 * return PyArray_DIMS(self)
4946 *
4947 * @property # <<<<<<<<<<<<<<
4948 * cdef inline npy_intp *strides(self) noexcept nogil:
4949 * """Returns a pointer to the strides of the array.
4950*/
4951
4952 /* function exit code */
4953 __pyx_L0:;
4954 return __pyx_r;
4955}
4956
4957/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":368
4958 * return PyArray_STRIDES(self)
4959 *
4960 * @property # <<<<<<<<<<<<<<
4961 * cdef inline npy_intp size(self) noexcept nogil:
4962 * """Returns the total size (in number of elements) of the array.
4963*/
4964
4965static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self) {
4966 npy_intp __pyx_r;
4967
4968 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":372
4969 * """Returns the total size (in number of elements) of the array.
4970 * """
4971 * return PyArray_SIZE(self) # <<<<<<<<<<<<<<
4972 *
4973 * @property
4974*/
4975 {
4976
4977 __pyx_r = PyArray_SIZE(__pyx_v_self);
4978 }
4979 goto __pyx_L0;
4980
4981 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":368
4982 * return PyArray_STRIDES(self)
4983 *
4984 * @property # <<<<<<<<<<<<<<
4985 * cdef inline npy_intp size(self) noexcept nogil:
4986 * """Returns the total size (in number of elements) of the array.
4987*/
4988
4989 /* function exit code */
4990 __pyx_L0:;
4991 return __pyx_r;
4992}
4993
4994/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":374
4995 * return PyArray_SIZE(self)
4996 *
4997 * @property # <<<<<<<<<<<<<<
4998 * cdef inline char* data(self) noexcept nogil:
4999 * """The pointer to the data buffer as a char*.
5000*/
5001
5002static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self) {
5003 char *__pyx_r;
5004
5005 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":381
5006 * of `PyArray_DATA()` instead, which returns a 'void*'.
5007 * """
5008 * return PyArray_BYTES(self) # <<<<<<<<<<<<<<
5009 *
5010 *
5011*/
5012 {
5013
5014 __pyx_r = PyArray_BYTES(__pyx_v_self);
5015 }
5016 goto __pyx_L0;
5017
5018 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":374
5019 * return PyArray_SIZE(self)
5020 *
5021 * @property # <<<<<<<<<<<<<<
5022 * cdef inline char* data(self) noexcept nogil:
5023 * """The pointer to the data buffer as a char*.
5024*/
5025
5026 /* function exit code */
5027 __pyx_L0:;
5028 return __pyx_r;
5029}
5030
5031/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":794
5032 * ctypedef long double complex clongdouble_t
5033 *
5034 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
5035 * return PyArray_MultiIterNew(1, <void*>a)
5036 *
5037*/
5038
5039static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
5040 PyObject *__pyx_r = NULL;
5041 __Pyx_RefNannyDeclarations
5042 PyObject *__pyx_t_1 = NULL;
5043 int __pyx_lineno = 0;
5044 const char *__pyx_filename = NULL;
5045 int __pyx_clineno = 0;
5046 __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
5047
5048 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":795
5049 *
5050 * cdef inline object PyArray_MultiIterNew1(a):
5051 * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
5052 *
5053 * cdef inline object PyArray_MultiIterNew2(a, b):
5054*/
5055 __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 795, __pyx_L1_error)
5056 __Pyx_GOTREF(__pyx_t_1);
5057 {
5058 PyObject *__pyx_temp;
5059 {
5060 __pyx_temp = __pyx_r;
5061 __pyx_r = __pyx_t_1;
5062 }
5063 __Pyx_XDECREF(__pyx_temp);
5064 }
5065 __pyx_t_1 = 0;
5066 goto __pyx_L0;
5067
5068 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":794
5069 * ctypedef long double complex clongdouble_t
5070 *
5071 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
5072 * return PyArray_MultiIterNew(1, <void*>a)
5073 *
5074*/
5075
5076 /* function exit code */
5077 __pyx_L1_error:;
5078 __Pyx_XDECREF(__pyx_t_1);
5079 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
5080 __pyx_r = 0;
5081 __pyx_L0:;
5082 __Pyx_XGIVEREF(__pyx_r);
5083 __Pyx_RefNannyFinishContext();
5084 return __pyx_r;
5085}
5086
5087/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":797
5088 * return PyArray_MultiIterNew(1, <void*>a)
5089 *
5090 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
5091 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
5092 *
5093*/
5094
5095static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
5096 PyObject *__pyx_r = NULL;
5097 __Pyx_RefNannyDeclarations
5098 PyObject *__pyx_t_1 = NULL;
5099 int __pyx_lineno = 0;
5100 const char *__pyx_filename = NULL;
5101 int __pyx_clineno = 0;
5102 __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
5103
5104 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":798
5105 *
5106 * cdef inline object PyArray_MultiIterNew2(a, b):
5107 * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
5108 *
5109 * cdef inline object PyArray_MultiIterNew3(a, b, c):
5110*/
5111 __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 798, __pyx_L1_error)
5112 __Pyx_GOTREF(__pyx_t_1);
5113 {
5114 PyObject *__pyx_temp;
5115 {
5116 __pyx_temp = __pyx_r;
5117 __pyx_r = __pyx_t_1;
5118 }
5119 __Pyx_XDECREF(__pyx_temp);
5120 }
5121 __pyx_t_1 = 0;
5122 goto __pyx_L0;
5123
5124 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":797
5125 * return PyArray_MultiIterNew(1, <void*>a)
5126 *
5127 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
5128 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
5129 *
5130*/
5131
5132 /* function exit code */
5133 __pyx_L1_error:;
5134 __Pyx_XDECREF(__pyx_t_1);
5135 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
5136 __pyx_r = 0;
5137 __pyx_L0:;
5138 __Pyx_XGIVEREF(__pyx_r);
5139 __Pyx_RefNannyFinishContext();
5140 return __pyx_r;
5141}
5142
5143/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":800
5144 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
5145 *
5146 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
5147 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
5148 *
5149*/
5150
5151static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
5152 PyObject *__pyx_r = NULL;
5153 __Pyx_RefNannyDeclarations
5154 PyObject *__pyx_t_1 = NULL;
5155 int __pyx_lineno = 0;
5156 const char *__pyx_filename = NULL;
5157 int __pyx_clineno = 0;
5158 __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
5159
5160 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":801
5161 *
5162 * cdef inline object PyArray_MultiIterNew3(a, b, c):
5163 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
5164 *
5165 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
5166*/
5167 __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, 801, __pyx_L1_error)
5168 __Pyx_GOTREF(__pyx_t_1);
5169 {
5170 PyObject *__pyx_temp;
5171 {
5172 __pyx_temp = __pyx_r;
5173 __pyx_r = __pyx_t_1;
5174 }
5175 __Pyx_XDECREF(__pyx_temp);
5176 }
5177 __pyx_t_1 = 0;
5178 goto __pyx_L0;
5179
5180 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":800
5181 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
5182 *
5183 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
5184 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
5185 *
5186*/
5187
5188 /* function exit code */
5189 __pyx_L1_error:;
5190 __Pyx_XDECREF(__pyx_t_1);
5191 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
5192 __pyx_r = 0;
5193 __pyx_L0:;
5194 __Pyx_XGIVEREF(__pyx_r);
5195 __Pyx_RefNannyFinishContext();
5196 return __pyx_r;
5197}
5198
5199/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":803
5200 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
5201 *
5202 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
5203 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
5204 *
5205*/
5206
5207static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
5208 PyObject *__pyx_r = NULL;
5209 __Pyx_RefNannyDeclarations
5210 PyObject *__pyx_t_1 = NULL;
5211 int __pyx_lineno = 0;
5212 const char *__pyx_filename = NULL;
5213 int __pyx_clineno = 0;
5214 __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
5215
5216 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":804
5217 *
5218 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
5219 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
5220 *
5221 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
5222*/
5223 __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, 804, __pyx_L1_error)
5224 __Pyx_GOTREF(__pyx_t_1);
5225 {
5226 PyObject *__pyx_temp;
5227 {
5228 __pyx_temp = __pyx_r;
5229 __pyx_r = __pyx_t_1;
5230 }
5231 __Pyx_XDECREF(__pyx_temp);
5232 }
5233 __pyx_t_1 = 0;
5234 goto __pyx_L0;
5235
5236 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":803
5237 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
5238 *
5239 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
5240 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
5241 *
5242*/
5243
5244 /* function exit code */
5245 __pyx_L1_error:;
5246 __Pyx_XDECREF(__pyx_t_1);
5247 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
5248 __pyx_r = 0;
5249 __pyx_L0:;
5250 __Pyx_XGIVEREF(__pyx_r);
5251 __Pyx_RefNannyFinishContext();
5252 return __pyx_r;
5253}
5254
5255/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":806
5256 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
5257 *
5258 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
5259 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5260 *
5261*/
5262
5263static 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) {
5264 PyObject *__pyx_r = NULL;
5265 __Pyx_RefNannyDeclarations
5266 PyObject *__pyx_t_1 = NULL;
5267 int __pyx_lineno = 0;
5268 const char *__pyx_filename = NULL;
5269 int __pyx_clineno = 0;
5270 __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
5271
5272 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":807
5273 *
5274 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
5275 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
5276 *
5277 * cdef inline tuple PyDataType_SHAPE(dtype d):
5278*/
5279 __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, 807, __pyx_L1_error)
5280 __Pyx_GOTREF(__pyx_t_1);
5281 {
5282 PyObject *__pyx_temp;
5283 {
5284 __pyx_temp = __pyx_r;
5285 __pyx_r = __pyx_t_1;
5286 }
5287 __Pyx_XDECREF(__pyx_temp);
5288 }
5289 __pyx_t_1 = 0;
5290 goto __pyx_L0;
5291
5292 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":806
5293 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
5294 *
5295 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
5296 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5297 *
5298*/
5299
5300 /* function exit code */
5301 __pyx_L1_error:;
5302 __Pyx_XDECREF(__pyx_t_1);
5303 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
5304 __pyx_r = 0;
5305 __pyx_L0:;
5306 __Pyx_XGIVEREF(__pyx_r);
5307 __Pyx_RefNannyFinishContext();
5308 return __pyx_r;
5309}
5310
5311/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":809
5312 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5313 *
5314 * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
5315 * if PyDataType_HASSUBARRAY(d):
5316 * return <tuple>d.subarray.shape
5317*/
5318
5319static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
5320 PyObject *__pyx_r = NULL;
5321 __Pyx_RefNannyDeclarations
5322 int __pyx_t_1;
5323 PyObject *__pyx_t_2;
5324 __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
5325
5326 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":810
5327 *
5328 * cdef inline tuple PyDataType_SHAPE(dtype d):
5329 * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
5330 * return <tuple>d.subarray.shape
5331 * else:
5332*/
5333 __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
5334
5335 if (__pyx_t_1) {
5336
5337
5338 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":811
5339 * cdef inline tuple PyDataType_SHAPE(dtype d):
5340 * if PyDataType_HASSUBARRAY(d):
5341 * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
5342 * else:
5343 * return ()
5344*/
5345 __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray___get__(__pyx_v_d)->shape;
5346
5347 {
5348 PyObject *__pyx_temp;
5349 {
5350 __pyx_temp = __pyx_r;
5351 __Pyx_INCREF(((PyObject*)__pyx_t_2));
5352 __pyx_r = ((PyObject*)__pyx_t_2);
5353 }
5354 __Pyx_XDECREF(__pyx_temp);
5355 }
5356
5357 goto __pyx_L0;
5358
5359 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":810
5360 *
5361 * cdef inline tuple PyDataType_SHAPE(dtype d):
5362 * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
5363 * return <tuple>d.subarray.shape
5364 * else:
5365*/
5366 }
5367
5368 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":813
5369 * return <tuple>d.subarray.shape
5370 * else:
5371 * return () # <<<<<<<<<<<<<<
5372 *
5373 *
5374*/
5375 /*else*/ {
5376 {
5377 PyObject *__pyx_temp;
5378 {
5379 __pyx_temp = __pyx_r;
5380 __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
5381 __pyx_r = __pyx_mstate_global->__pyx_empty_tuple;
5382 }
5383 __Pyx_XDECREF(__pyx_temp);
5384 }
5385 goto __pyx_L0;
5386 }
5387
5388 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":809
5389 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
5390 *
5391 * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
5392 * if PyDataType_HASSUBARRAY(d):
5393 * return <tuple>d.subarray.shape
5394*/
5395
5396 /* function exit code */
5397 __pyx_L0:;
5398 __Pyx_XGIVEREF(__pyx_r);
5399 __Pyx_RefNannyFinishContext();
5400 return __pyx_r;
5401}
5402
5403/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":947
5404 *
5405 * ctypedef class numpy.ufunc [object PyUFuncObject, check_size ignore]:
5406 * @property # <<<<<<<<<<<<<<
5407 * cdef inline int nin(self) noexcept nogil:
5408 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
5409*/
5410
5411static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self) {
5412 int __pyx_r;
5413
5414 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":949
5415 * @property
5416 * cdef inline int nin(self) noexcept nogil:
5417 * return _PyUFuncObject_GET_ITEM_DATA(self).nin # <<<<<<<<<<<<<<
5418 *
5419 * @property
5420*/
5421 {
5422
5423 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nin;
5424 }
5425 goto __pyx_L0;
5426
5427 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":947
5428 *
5429 * ctypedef class numpy.ufunc [object PyUFuncObject, check_size ignore]:
5430 * @property # <<<<<<<<<<<<<<
5431 * cdef inline int nin(self) noexcept nogil:
5432 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
5433*/
5434
5435 /* function exit code */
5436 __pyx_L0:;
5437 return __pyx_r;
5438}
5439
5440/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":951
5441 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
5442 *
5443 * @property # <<<<<<<<<<<<<<
5444 * cdef inline int nout(self) noexcept nogil:
5445 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
5446*/
5447
5448static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self) {
5449 int __pyx_r;
5450
5451 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":953
5452 * @property
5453 * cdef inline int nout(self) noexcept nogil:
5454 * return _PyUFuncObject_GET_ITEM_DATA(self).nout # <<<<<<<<<<<<<<
5455 *
5456 * @property
5457*/
5458 {
5459
5460 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nout;
5461 }
5462 goto __pyx_L0;
5463
5464 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":951
5465 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
5466 *
5467 * @property # <<<<<<<<<<<<<<
5468 * cdef inline int nout(self) noexcept nogil:
5469 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
5470*/
5471
5472 /* function exit code */
5473 __pyx_L0:;
5474 return __pyx_r;
5475}
5476
5477/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":955
5478 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
5479 *
5480 * @property # <<<<<<<<<<<<<<
5481 * cdef inline int nargs(self) noexcept nogil:
5482 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
5483*/
5484
5485static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self) {
5486 int __pyx_r;
5487
5488 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":957
5489 * @property
5490 * cdef inline int nargs(self) noexcept nogil:
5491 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs # <<<<<<<<<<<<<<
5492 *
5493 * @property
5494*/
5495 {
5496
5497 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nargs;
5498 }
5499 goto __pyx_L0;
5500
5501 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":955
5502 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
5503 *
5504 * @property # <<<<<<<<<<<<<<
5505 * cdef inline int nargs(self) noexcept nogil:
5506 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
5507*/
5508
5509 /* function exit code */
5510 __pyx_L0:;
5511 return __pyx_r;
5512}
5513
5514/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":959
5515 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
5516 *
5517 * @property # <<<<<<<<<<<<<<
5518 * cdef inline PyUFuncGenericFunction* functions(self) noexcept nogil:
5519 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
5520*/
5521
5522static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self) {
5523 PyUFuncGenericFunction *__pyx_r;
5524
5525 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":961
5526 * @property
5527 * cdef inline PyUFuncGenericFunction* functions(self) noexcept nogil:
5528 * return _PyUFuncObject_GET_ITEM_DATA(self).functions # <<<<<<<<<<<<<<
5529 *
5530 * @property
5531*/
5532 {
5533
5534 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->functions;
5535 }
5536 goto __pyx_L0;
5537
5538 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":959
5539 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
5540 *
5541 * @property # <<<<<<<<<<<<<<
5542 * cdef inline PyUFuncGenericFunction* functions(self) noexcept nogil:
5543 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
5544*/
5545
5546 /* function exit code */
5547 __pyx_L0:;
5548 return __pyx_r;
5549}
5550
5551/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":963
5552 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
5553 *
5554 * @property # <<<<<<<<<<<<<<
5555 * cdef inline void ** data(self) noexcept nogil:
5556 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
5557*/
5558
5559static CYTHON_INLINE void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self) {
5560 void **__pyx_r;
5561
5562 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":965
5563 * @property
5564 * cdef inline void ** data(self) noexcept nogil:
5565 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data # <<<<<<<<<<<<<<
5566 *
5567 * @property
5568*/
5569 {
5570
5571 __pyx_r = ((void **)_PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->data);
5572 }
5573 goto __pyx_L0;
5574
5575 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":963
5576 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
5577 *
5578 * @property # <<<<<<<<<<<<<<
5579 * cdef inline void ** data(self) noexcept nogil:
5580 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
5581*/
5582
5583 /* function exit code */
5584 __pyx_L0:;
5585 return __pyx_r;
5586}
5587
5588/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":967
5589 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
5590 *
5591 * @property # <<<<<<<<<<<<<<
5592 * cdef inline int ntypes(self) noexcept nogil:
5593 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
5594*/
5595
5596static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self) {
5597 int __pyx_r;
5598
5599 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":969
5600 * @property
5601 * cdef inline int ntypes(self) noexcept nogil:
5602 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes # <<<<<<<<<<<<<<
5603 *
5604 * @property
5605*/
5606 {
5607
5608 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ntypes;
5609 }
5610 goto __pyx_L0;
5611
5612 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":967
5613 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
5614 *
5615 * @property # <<<<<<<<<<<<<<
5616 * cdef inline int ntypes(self) noexcept nogil:
5617 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
5618*/
5619
5620 /* function exit code */
5621 __pyx_L0:;
5622 return __pyx_r;
5623}
5624
5625/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":971
5626 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
5627 *
5628 * @property # <<<<<<<<<<<<<<
5629 * cdef inline const char* name(self) noexcept nogil:
5630 * return _PyUFuncObject_GET_ITEM_DATA(self).name
5631*/
5632
5633static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self) {
5634 char const *__pyx_r;
5635
5636 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":973
5637 * @property
5638 * cdef inline const char* name(self) noexcept nogil:
5639 * return _PyUFuncObject_GET_ITEM_DATA(self).name # <<<<<<<<<<<<<<
5640 *
5641 * @property
5642*/
5643 {
5644
5645 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->name;
5646 }
5647 goto __pyx_L0;
5648
5649 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":971
5650 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
5651 *
5652 * @property # <<<<<<<<<<<<<<
5653 * cdef inline const char* name(self) noexcept nogil:
5654 * return _PyUFuncObject_GET_ITEM_DATA(self).name
5655*/
5656
5657 /* function exit code */
5658 __pyx_L0:;
5659 return __pyx_r;
5660}
5661
5662/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":975
5663 * return _PyUFuncObject_GET_ITEM_DATA(self).name
5664 *
5665 * @property # <<<<<<<<<<<<<<
5666 * cdef inline const char* doc(self) noexcept nogil:
5667 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
5668*/
5669
5670static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self) {
5671 char const *__pyx_r;
5672
5673 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":977
5674 * @property
5675 * cdef inline const char* doc(self) noexcept nogil:
5676 * return _PyUFuncObject_GET_ITEM_DATA(self).doc # <<<<<<<<<<<<<<
5677 *
5678 * @property
5679*/
5680 {
5681
5682 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->doc;
5683 }
5684 goto __pyx_L0;
5685
5686 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":975
5687 * return _PyUFuncObject_GET_ITEM_DATA(self).name
5688 *
5689 * @property # <<<<<<<<<<<<<<
5690 * cdef inline const char* doc(self) noexcept nogil:
5691 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
5692*/
5693
5694 /* function exit code */
5695 __pyx_L0:;
5696 return __pyx_r;
5697}
5698
5699/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":979
5700 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
5701 *
5702 * @property # <<<<<<<<<<<<<<
5703 * cdef inline void* ptr(self) noexcept nogil:
5704 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
5705*/
5706
5707static CYTHON_INLINE void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self) {
5708 void *__pyx_r;
5709
5710 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":981
5711 * @property
5712 * cdef inline void* ptr(self) noexcept nogil:
5713 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr # <<<<<<<<<<<<<<
5714 *
5715 * @property
5716*/
5717 {
5718
5719 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ptr;
5720 }
5721 goto __pyx_L0;
5722
5723 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":979
5724 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
5725 *
5726 * @property # <<<<<<<<<<<<<<
5727 * cdef inline void* ptr(self) noexcept nogil:
5728 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
5729*/
5730
5731 /* function exit code */
5732 __pyx_L0:;
5733 return __pyx_r;
5734}
5735
5736/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":983
5737 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
5738 *
5739 * @property # <<<<<<<<<<<<<<
5740 * cdef inline PyObject* obj(self) noexcept nogil:
5741 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
5742*/
5743
5744static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self) {
5745 PyObject *__pyx_r;
5746
5747 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":985
5748 * @property
5749 * cdef inline PyObject* obj(self) noexcept nogil:
5750 * return _PyUFuncObject_GET_ITEM_DATA(self).obj # <<<<<<<<<<<<<<
5751 *
5752 * @property
5753*/
5754 {
5755
5756 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->obj;
5757 }
5758 goto __pyx_L0;
5759
5760 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":983
5761 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
5762 *
5763 * @property # <<<<<<<<<<<<<<
5764 * cdef inline PyObject* obj(self) noexcept nogil:
5765 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
5766*/
5767
5768 /* function exit code */
5769 __pyx_L0:;
5770 return __pyx_r;
5771}
5772
5773/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":987
5774 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
5775 *
5776 * @property # <<<<<<<<<<<<<<
5777 * cdef inline PyObject* userloops(self) noexcept nogil:
5778 * return _PyUFuncObject_GET_ITEM_DATA(self).userloops
5779*/
5780
5781static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self) {
5782 PyObject *__pyx_r;
5783
5784 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":989
5785 * @property
5786 * cdef inline PyObject* userloops(self) noexcept nogil:
5787 * return _PyUFuncObject_GET_ITEM_DATA(self).userloops # <<<<<<<<<<<<<<
5788 *
5789 * PyUFuncObject_fields *_PyUFuncObject_GET_ITEM_DATA(ufunc) nogil
5790*/
5791 {
5792
5793 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->userloops;
5794 }
5795 goto __pyx_L0;
5796
5797 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":987
5798 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
5799 *
5800 * @property # <<<<<<<<<<<<<<
5801 * cdef inline PyObject* userloops(self) noexcept nogil:
5802 * return _PyUFuncObject_GET_ITEM_DATA(self).userloops
5803*/
5804
5805 /* function exit code */
5806 __pyx_L0:;
5807 return __pyx_r;
5808}
5809
5810/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1065
5811 * int _import_umath() except -1
5812 *
5813 * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
5814 * Py_INCREF(base) # important to do this before stealing the reference below!
5815 * PyArray_SetBaseObject(arr, base)
5816*/
5817
5818static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
5819 int __pyx_t_1;
5820 int __pyx_lineno = 0;
5821 const char *__pyx_filename = NULL;
5822 int __pyx_clineno = 0;
5823
5824 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1066
5825 *
5826 * cdef inline void set_array_base(ndarray arr, object base) except *:
5827 * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
5828 * PyArray_SetBaseObject(arr, base)
5829 *
5830*/
5831 Py_INCREF(__pyx_v_base);
5832
5833 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1067
5834 * cdef inline void set_array_base(ndarray arr, object base) except *:
5835 * Py_INCREF(base) # important to do this before stealing the reference below!
5836 * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
5837 *
5838 * cdef inline object get_array_base(ndarray arr):
5839*/
5840 __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 1067, __pyx_L1_error)
5841
5842
5843 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1065
5844 * int _import_umath() except -1
5845 *
5846 * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
5847 * Py_INCREF(base) # important to do this before stealing the reference below!
5848 * PyArray_SetBaseObject(arr, base)
5849*/
5850
5851 /* function exit code */
5852 goto __pyx_L0;
5853 __pyx_L1_error:;
5854 __Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
5855 __pyx_L0:;
5856
5857}
5858
5859/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1069
5860 * PyArray_SetBaseObject(arr, base)
5861 *
5862 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
5863 * base = PyArray_BASE(arr)
5864 * if base is NULL:
5865*/
5866
5867static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
5868 PyObject *__pyx_v_base;
5869 PyObject *__pyx_r = NULL;
5870 __Pyx_RefNannyDeclarations
5871 int __pyx_t_1;
5872 __Pyx_RefNannySetupContext("get_array_base", 0);
5873
5874 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1070
5875 *
5876 * cdef inline object get_array_base(ndarray arr):
5877 * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
5878 * if base is NULL:
5879 * return None
5880*/
5881 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
5882
5883 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1071
5884 * cdef inline object get_array_base(ndarray arr):
5885 * base = PyArray_BASE(arr)
5886 * if base is NULL: # <<<<<<<<<<<<<<
5887 * return None
5888 * return <object>base
5889*/
5890 __pyx_t_1 = (__pyx_v_base == NULL);
5891
5892 if (__pyx_t_1) {
5893
5894
5895 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1072
5896 * base = PyArray_BASE(arr)
5897 * if base is NULL:
5898 * return None # <<<<<<<<<<<<<<
5899 * return <object>base
5900 *
5901*/
5902 {
5903 PyObject *__pyx_temp;
5904 {
5905 __pyx_temp = __pyx_r;
5906 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5907 }
5908 __Pyx_XDECREF(__pyx_temp);
5909 }
5910 goto __pyx_L0;
5911
5912 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1071
5913 * cdef inline object get_array_base(ndarray arr):
5914 * base = PyArray_BASE(arr)
5915 * if base is NULL: # <<<<<<<<<<<<<<
5916 * return None
5917 * return <object>base
5918*/
5919 }
5920
5921 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1073
5922 * if base is NULL:
5923 * return None
5924 * return <object>base # <<<<<<<<<<<<<<
5925 *
5926 * # Versions of the import_* functions which are more suitable for
5927*/
5928 {
5929 PyObject *__pyx_temp;
5930 {
5931 __pyx_temp = __pyx_r;
5932 __Pyx_INCREF(((PyObject *)__pyx_v_base));
5933 __pyx_r = ((PyObject *)__pyx_v_base);
5934 }
5935 __Pyx_XDECREF(__pyx_temp);
5936 }
5937 goto __pyx_L0;
5938
5939 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1069
5940 * PyArray_SetBaseObject(arr, base)
5941 *
5942 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
5943 * base = PyArray_BASE(arr)
5944 * if base is NULL:
5945*/
5946
5947 /* function exit code */
5948 __pyx_L0:;
5949
5950 __Pyx_XGIVEREF(__pyx_r);
5951 __Pyx_RefNannyFinishContext();
5952 return __pyx_r;
5953}
5954
5955/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1077
5956 * # Versions of the import_* functions which are more suitable for
5957 * # Cython code.
5958 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
5959 * try:
5960 * __pyx_import_array()
5961*/
5962
5963static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
5964 int __pyx_r;
5965 __Pyx_RefNannyDeclarations
5966 PyObject *__pyx_t_1 = NULL;
5967 PyObject *__pyx_t_2 = NULL;
5968 PyObject *__pyx_t_3 = NULL;
5969 int __pyx_t_4;
5970 PyObject *__pyx_t_5 = NULL;
5971 PyObject *__pyx_t_6 = NULL;
5972 PyObject *__pyx_t_7 = NULL;
5973 PyObject *__pyx_t_8 = NULL;
5974 PyObject *__pyx_t_9 = NULL;
5975 size_t __pyx_t_10;
5976 int __pyx_lineno = 0;
5977 const char *__pyx_filename = NULL;
5978 int __pyx_clineno = 0;
5979 __Pyx_RefNannySetupContext("import_array", 0);
5980
5981 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1078
5982 * # Cython code.
5983 * cdef inline int import_array() except -1:
5984 * try: # <<<<<<<<<<<<<<
5985 * __pyx_import_array()
5986 * except Exception:
5987*/
5988 {
5989 __Pyx_PyThreadState_declare
5990 __Pyx_PyThreadState_assign
5991 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5992 __Pyx_XGOTREF(__pyx_t_1);
5993 __Pyx_XGOTREF(__pyx_t_2);
5994 __Pyx_XGOTREF(__pyx_t_3);
5995 /*try:*/ {
5996
5997 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1079
5998 * cdef inline int import_array() except -1:
5999 * try:
6000 * __pyx_import_array() # <<<<<<<<<<<<<<
6001 * except Exception:
6002 * raise ImportError("numpy._core.multiarray failed to import")
6003*/
6004 __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1079, __pyx_L3_error)
6005
6006
6007 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1078
6008 * # Cython code.
6009 * cdef inline int import_array() except -1:
6010 * try: # <<<<<<<<<<<<<<
6011 * __pyx_import_array()
6012 * except Exception:
6013*/
6014 }
6015 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6016 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6017 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6018 goto __pyx_L8_try_end;
6019 __pyx_L3_error:;
6020
6021 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1080
6022 * try:
6023 * __pyx_import_array()
6024 * except Exception: # <<<<<<<<<<<<<<
6025 * raise ImportError("numpy._core.multiarray failed to import")
6026 *
6027*/
6028 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
6029 if (__pyx_t_4) {
6030 __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
6031 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1080, __pyx_L5_except_error)
6032 __Pyx_XGOTREF(__pyx_t_5);
6033 __Pyx_XGOTREF(__pyx_t_6);
6034 __Pyx_XGOTREF(__pyx_t_7);
6035
6036 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1081
6037 * __pyx_import_array()
6038 * except Exception:
6039 * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<<
6040 *
6041 * cdef inline int import_umath() except -1:
6042*/
6043 __pyx_t_9 = NULL;
6044 __pyx_t_10 = 1;
6045 {
6046 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to};
6047 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
6048 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
6049 if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1081, __pyx_L5_except_error)
6050 __Pyx_GOTREF(__pyx_t_8);
6051 }
6052 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6053 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6054 __PYX_ERR(1, 1081, __pyx_L5_except_error)
6055 }
6056 goto __pyx_L5_except_error;
6057
6058 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1078
6059 * # Cython code.
6060 * cdef inline int import_array() except -1:
6061 * try: # <<<<<<<<<<<<<<
6062 * __pyx_import_array()
6063 * except Exception:
6064*/
6065 __pyx_L5_except_error:;
6066 __Pyx_XGIVEREF(__pyx_t_1);
6067 __Pyx_XGIVEREF(__pyx_t_2);
6068 __Pyx_XGIVEREF(__pyx_t_3);
6069 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
6070 goto __pyx_L1_error;
6071 __pyx_L8_try_end:;
6072 }
6073
6074 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1077
6075 * # Versions of the import_* functions which are more suitable for
6076 * # Cython code.
6077 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
6078 * try:
6079 * __pyx_import_array()
6080*/
6081
6082 /* function exit code */
6083 __pyx_r = 0;
6084 goto __pyx_L0;
6085 __pyx_L1_error:;
6086 __Pyx_XDECREF(__pyx_t_5);
6087 __Pyx_XDECREF(__pyx_t_6);
6088 __Pyx_XDECREF(__pyx_t_7);
6089 __Pyx_XDECREF(__pyx_t_8);
6090 __Pyx_XDECREF(__pyx_t_9);
6091 __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
6092 __pyx_r = -1;
6093 __pyx_L0:;
6094
6095 __Pyx_RefNannyFinishContext();
6096 return __pyx_r;
6097}
6098
6099/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1083
6100 * raise ImportError("numpy._core.multiarray failed to import")
6101 *
6102 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
6103 * try:
6104 * _import_umath()
6105*/
6106
6107static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
6108 int __pyx_r;
6109 __Pyx_RefNannyDeclarations
6110 PyObject *__pyx_t_1 = NULL;
6111 PyObject *__pyx_t_2 = NULL;
6112 PyObject *__pyx_t_3 = NULL;
6113 int __pyx_t_4;
6114 PyObject *__pyx_t_5 = NULL;
6115 PyObject *__pyx_t_6 = NULL;
6116 PyObject *__pyx_t_7 = NULL;
6117 PyObject *__pyx_t_8 = NULL;
6118 PyObject *__pyx_t_9 = NULL;
6119 size_t __pyx_t_10;
6120 int __pyx_lineno = 0;
6121 const char *__pyx_filename = NULL;
6122 int __pyx_clineno = 0;
6123 __Pyx_RefNannySetupContext("import_umath", 0);
6124
6125 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1084
6126 *
6127 * cdef inline int import_umath() except -1:
6128 * try: # <<<<<<<<<<<<<<
6129 * _import_umath()
6130 * except Exception:
6131*/
6132 {
6133 __Pyx_PyThreadState_declare
6134 __Pyx_PyThreadState_assign
6135 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
6136 __Pyx_XGOTREF(__pyx_t_1);
6137 __Pyx_XGOTREF(__pyx_t_2);
6138 __Pyx_XGOTREF(__pyx_t_3);
6139 /*try:*/ {
6140
6141 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1085
6142 * cdef inline int import_umath() except -1:
6143 * try:
6144 * _import_umath() # <<<<<<<<<<<<<<
6145 * except Exception:
6146 * raise ImportError("numpy._core.umath failed to import")
6147*/
6148 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1085, __pyx_L3_error)
6149
6150
6151 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1084
6152 *
6153 * cdef inline int import_umath() except -1:
6154 * try: # <<<<<<<<<<<<<<
6155 * _import_umath()
6156 * except Exception:
6157*/
6158 }
6159 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6160 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6161 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6162 goto __pyx_L8_try_end;
6163 __pyx_L3_error:;
6164
6165 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1086
6166 * try:
6167 * _import_umath()
6168 * except Exception: # <<<<<<<<<<<<<<
6169 * raise ImportError("numpy._core.umath failed to import")
6170 *
6171*/
6172 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
6173 if (__pyx_t_4) {
6174 __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
6175 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1086, __pyx_L5_except_error)
6176 __Pyx_XGOTREF(__pyx_t_5);
6177 __Pyx_XGOTREF(__pyx_t_6);
6178 __Pyx_XGOTREF(__pyx_t_7);
6179
6180 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1087
6181 * _import_umath()
6182 * except Exception:
6183 * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
6184 *
6185 * cdef inline int import_ufunc() except -1:
6186*/
6187 __pyx_t_9 = NULL;
6188 __pyx_t_10 = 1;
6189 {
6190 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
6191 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
6192 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
6193 if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1087, __pyx_L5_except_error)
6194 __Pyx_GOTREF(__pyx_t_8);
6195 }
6196 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6197 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6198 __PYX_ERR(1, 1087, __pyx_L5_except_error)
6199 }
6200 goto __pyx_L5_except_error;
6201
6202 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1084
6203 *
6204 * cdef inline int import_umath() except -1:
6205 * try: # <<<<<<<<<<<<<<
6206 * _import_umath()
6207 * except Exception:
6208*/
6209 __pyx_L5_except_error:;
6210 __Pyx_XGIVEREF(__pyx_t_1);
6211 __Pyx_XGIVEREF(__pyx_t_2);
6212 __Pyx_XGIVEREF(__pyx_t_3);
6213 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
6214 goto __pyx_L1_error;
6215 __pyx_L8_try_end:;
6216 }
6217
6218 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1083
6219 * raise ImportError("numpy._core.multiarray failed to import")
6220 *
6221 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
6222 * try:
6223 * _import_umath()
6224*/
6225
6226 /* function exit code */
6227 __pyx_r = 0;
6228 goto __pyx_L0;
6229 __pyx_L1_error:;
6230 __Pyx_XDECREF(__pyx_t_5);
6231 __Pyx_XDECREF(__pyx_t_6);
6232 __Pyx_XDECREF(__pyx_t_7);
6233 __Pyx_XDECREF(__pyx_t_8);
6234 __Pyx_XDECREF(__pyx_t_9);
6235 __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
6236 __pyx_r = -1;
6237 __pyx_L0:;
6238
6239 __Pyx_RefNannyFinishContext();
6240 return __pyx_r;
6241}
6242
6243/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1089
6244 * raise ImportError("numpy._core.umath failed to import")
6245 *
6246 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
6247 * try:
6248 * _import_umath()
6249*/
6250
6251static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
6252 int __pyx_r;
6253 __Pyx_RefNannyDeclarations
6254 PyObject *__pyx_t_1 = NULL;
6255 PyObject *__pyx_t_2 = NULL;
6256 PyObject *__pyx_t_3 = NULL;
6257 int __pyx_t_4;
6258 PyObject *__pyx_t_5 = NULL;
6259 PyObject *__pyx_t_6 = NULL;
6260 PyObject *__pyx_t_7 = NULL;
6261 PyObject *__pyx_t_8 = NULL;
6262 PyObject *__pyx_t_9 = NULL;
6263 size_t __pyx_t_10;
6264 int __pyx_lineno = 0;
6265 const char *__pyx_filename = NULL;
6266 int __pyx_clineno = 0;
6267 __Pyx_RefNannySetupContext("import_ufunc", 0);
6268
6269 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1090
6270 *
6271 * cdef inline int import_ufunc() except -1:
6272 * try: # <<<<<<<<<<<<<<
6273 * _import_umath()
6274 * except Exception:
6275*/
6276 {
6277 __Pyx_PyThreadState_declare
6278 __Pyx_PyThreadState_assign
6279 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
6280 __Pyx_XGOTREF(__pyx_t_1);
6281 __Pyx_XGOTREF(__pyx_t_2);
6282 __Pyx_XGOTREF(__pyx_t_3);
6283 /*try:*/ {
6284
6285 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1091
6286 * cdef inline int import_ufunc() except -1:
6287 * try:
6288 * _import_umath() # <<<<<<<<<<<<<<
6289 * except Exception:
6290 * raise ImportError("numpy._core.umath failed to import")
6291*/
6292 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1091, __pyx_L3_error)
6293
6294
6295 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1090
6296 *
6297 * cdef inline int import_ufunc() except -1:
6298 * try: # <<<<<<<<<<<<<<
6299 * _import_umath()
6300 * except Exception:
6301*/
6302 }
6303 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6304 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6305 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6306 goto __pyx_L8_try_end;
6307 __pyx_L3_error:;
6308
6309 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1092
6310 * try:
6311 * _import_umath()
6312 * except Exception: # <<<<<<<<<<<<<<
6313 * raise ImportError("numpy._core.umath failed to import")
6314 *
6315*/
6316 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
6317 if (__pyx_t_4) {
6318 __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
6319 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1092, __pyx_L5_except_error)
6320 __Pyx_XGOTREF(__pyx_t_5);
6321 __Pyx_XGOTREF(__pyx_t_6);
6322 __Pyx_XGOTREF(__pyx_t_7);
6323
6324 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1093
6325 * _import_umath()
6326 * except Exception:
6327 * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
6328 *
6329 *
6330*/
6331 __pyx_t_9 = NULL;
6332 __pyx_t_10 = 1;
6333 {
6334 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
6335 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ImportError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
6336 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
6337 if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1093, __pyx_L5_except_error)
6338 __Pyx_GOTREF(__pyx_t_8);
6339 }
6340 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
6341 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6342 __PYX_ERR(1, 1093, __pyx_L5_except_error)
6343 }
6344 goto __pyx_L5_except_error;
6345
6346 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1090
6347 *
6348 * cdef inline int import_ufunc() except -1:
6349 * try: # <<<<<<<<<<<<<<
6350 * _import_umath()
6351 * except Exception:
6352*/
6353 __pyx_L5_except_error:;
6354 __Pyx_XGIVEREF(__pyx_t_1);
6355 __Pyx_XGIVEREF(__pyx_t_2);
6356 __Pyx_XGIVEREF(__pyx_t_3);
6357 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
6358 goto __pyx_L1_error;
6359 __pyx_L8_try_end:;
6360 }
6361
6362 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1089
6363 * raise ImportError("numpy._core.umath failed to import")
6364 *
6365 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
6366 * try:
6367 * _import_umath()
6368*/
6369
6370 /* function exit code */
6371 __pyx_r = 0;
6372 goto __pyx_L0;
6373 __pyx_L1_error:;
6374 __Pyx_XDECREF(__pyx_t_5);
6375 __Pyx_XDECREF(__pyx_t_6);
6376 __Pyx_XDECREF(__pyx_t_7);
6377 __Pyx_XDECREF(__pyx_t_8);
6378 __Pyx_XDECREF(__pyx_t_9);
6379 __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
6380 __pyx_r = -1;
6381 __pyx_L0:;
6382
6383 __Pyx_RefNannyFinishContext();
6384 return __pyx_r;
6385}
6386
6387/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1096
6388 *
6389 *
6390 * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
6391 * """
6392 * Cython equivalent of `isinstance(obj, np.timedelta64)`
6393*/
6394
6395static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
6396 int __pyx_r;
6397
6398 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1108
6399 * bool
6400 * """
6401 * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
6402 *
6403 *
6404*/
6405 {
6406
6407 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
6408 }
6409 goto __pyx_L0;
6410
6411 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1096
6412 *
6413 *
6414 * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
6415 * """
6416 * Cython equivalent of `isinstance(obj, np.timedelta64)`
6417*/
6418
6419 /* function exit code */
6420 __pyx_L0:;
6421
6422 return __pyx_r;
6423}
6424
6425/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1111
6426 *
6427 *
6428 * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
6429 * """
6430 * Cython equivalent of `isinstance(obj, np.datetime64)`
6431*/
6432
6433static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
6434 int __pyx_r;
6435
6436 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1123
6437 * bool
6438 * """
6439 * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
6440 *
6441 *
6442*/
6443 {
6444
6445 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
6446 }
6447 goto __pyx_L0;
6448
6449 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1111
6450 *
6451 *
6452 * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
6453 * """
6454 * Cython equivalent of `isinstance(obj, np.datetime64)`
6455*/
6456
6457 /* function exit code */
6458 __pyx_L0:;
6459
6460 return __pyx_r;
6461}
6462
6463/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1126
6464 *
6465 *
6466 * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
6467 * """
6468 * returns the int64 value underlying scalar numpy datetime64 object
6469*/
6470
6471static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
6472 npy_datetime __pyx_r;
6473
6474 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1133
6475 * also needed. That can be found using `get_datetime64_unit`.
6476 * """
6477 * return _PyDatetimeScalarObject_GetValue(obj) # <<<<<<<<<<<<<<
6478 *
6479 *
6480*/
6481 {
6482
6483 __pyx_r = _PyDatetimeScalarObject_GetValue(__pyx_v_obj);
6484 }
6485 goto __pyx_L0;
6486
6487 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1126
6488 *
6489 *
6490 * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
6491 * """
6492 * returns the int64 value underlying scalar numpy datetime64 object
6493*/
6494
6495 /* function exit code */
6496 __pyx_L0:;
6497 return __pyx_r;
6498}
6499
6500/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1136
6501 *
6502 *
6503 * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
6504 * """
6505 * returns the int64 value underlying scalar numpy timedelta64 object
6506*/
6507
6508static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
6509 npy_timedelta __pyx_r;
6510
6511 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1140
6512 * returns the int64 value underlying scalar numpy timedelta64 object
6513 * """
6514 * return _PyTimedeltaScalarObject_GetValue(obj) # <<<<<<<<<<<<<<
6515 *
6516 *
6517*/
6518 {
6519
6520 __pyx_r = _PyTimedeltaScalarObject_GetValue(__pyx_v_obj);
6521 }
6522 goto __pyx_L0;
6523
6524 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1136
6525 *
6526 *
6527 * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
6528 * """
6529 * returns the int64 value underlying scalar numpy timedelta64 object
6530*/
6531
6532 /* function exit code */
6533 __pyx_L0:;
6534 return __pyx_r;
6535}
6536
6537/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1143
6538 *
6539 *
6540 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
6541 * """
6542 * returns the unit part of the dtype for a numpy datetime64 object.
6543*/
6544
6545static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
6546 NPY_DATETIMEUNIT __pyx_r;
6547
6548 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1147
6549 * returns the unit part of the dtype for a numpy datetime64 object.
6550 * """
6551 * return _PyDatetimeScalarObject_GetMetadata(obj).base # <<<<<<<<<<<<<<
6552 *
6553 *
6554*/
6555 {
6556
6557 __pyx_r = _PyDatetimeScalarObject_GetMetadata(__pyx_v_obj).base;
6558 }
6559 goto __pyx_L0;
6560
6561 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1143
6562 *
6563 *
6564 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
6565 * """
6566 * returns the unit part of the dtype for a numpy datetime64 object.
6567*/
6568
6569 /* function exit code */
6570 __pyx_L0:;
6571 return __pyx_r;
6572}
6573
6574/* "Isosurface.pyx":25
6575 * from libc.math cimport sqrt
6576 *
6577 * cdef np.ndarray[np.float64_t,ndim=1] EVec(double x=0.0, double y=0.0, double z=0.0): # <<<<<<<<<<<<<<
6578 * cdef np.ndarray [np.float64_t, ndim=1] v = np.zeros((3,),'d')
6579 * v[0] = x
6580*/
6581
6582static PyArrayObject *__pyx_f_10Isosurface_EVec(struct __pyx_opt_args_10Isosurface_EVec *__pyx_optional_args) {
6583 double __pyx_v_x = ((double)0.0);
6584 double __pyx_v_y = ((double)0.0);
6585 double __pyx_v_z = ((double)0.0);
6586 PyArrayObject *__pyx_v_v = 0;
6587 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
6588 __Pyx_Buffer __pyx_pybuffer_v;
6589 PyArrayObject *__pyx_r = NULL;
6590 __Pyx_RefNannyDeclarations
6591 PyObject *__pyx_t_1 = NULL;
6592 PyObject *__pyx_t_2 = NULL;
6593 Py_ssize_t __pyx_t_3;
6594 int __pyx_t_4;
6595 int __pyx_lineno = 0;
6596 const char *__pyx_filename = NULL;
6597 int __pyx_clineno = 0;
6598 __Pyx_RefNannySetupContext("EVec", 0);
6599 if (__pyx_optional_args) {
6600 if (__pyx_optional_args->__pyx_n > 0) {
6601 __pyx_v_x = __pyx_optional_args->x;
6602 if (__pyx_optional_args->__pyx_n > 1) {
6603 __pyx_v_y = __pyx_optional_args->y;
6604 if (__pyx_optional_args->__pyx_n > 2) {
6605 __pyx_v_z = __pyx_optional_args->z;
6606 }
6607 }
6608 }
6609 }
6610 __pyx_pybuffer_v.pybuffer.buf = NULL;
6611 __pyx_pybuffer_v.refcount = 0;
6612 __pyx_pybuffernd_v.data = NULL;
6613 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
6614
6615 /* "Isosurface.pyx":26
6616 *
6617 * cdef np.ndarray[np.float64_t,ndim=1] EVec(double x=0.0, double y=0.0, double z=0.0):
6618 * cdef np.ndarray [np.float64_t, ndim=1] v = np.zeros((3,),'d') # <<<<<<<<<<<<<<
6619 * v[0] = x
6620 * v[1] = y
6621*/
6622 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
6623 __Pyx_GOTREF(__pyx_t_1);
6624 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
6625 __Pyx_GOTREF(__pyx_t_2);
6626 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6627 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
6628 __Pyx_GOTREF(__pyx_t_1);
6629 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6630 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 26, __pyx_L1_error)
6631 {
6632 __Pyx_BufFmt_StackElem __pyx_stack[1];
6633 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
6634 __pyx_v_v = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_v.rcbuffer->pybuffer.buf = NULL;
6635 __PYX_ERR(0, 26, __pyx_L1_error)
6636 } 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];
6637 }
6638 }
6639 __pyx_v_v = ((PyArrayObject *)__pyx_t_1);
6640 __pyx_t_1 = 0;
6641
6642 /* "Isosurface.pyx":27
6643 * cdef np.ndarray[np.float64_t,ndim=1] EVec(double x=0.0, double y=0.0, double z=0.0):
6644 * cdef np.ndarray [np.float64_t, ndim=1] v = np.zeros((3,),'d')
6645 * v[0] = x # <<<<<<<<<<<<<<
6646 * v[1] = y
6647 * v[2] = z
6648*/
6649 __pyx_t_3 = 0;
6650 __pyx_t_4 = -1;
6651 if (__pyx_t_3 < 0) {
6652 __pyx_t_3 += __pyx_pybuffernd_v.diminfo[0].shape;
6653 if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0;
6654 } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_4 = 0;
6655 if (unlikely(__pyx_t_4 != -1)) {
6656 __Pyx_RaiseBufferIndexError(__pyx_t_4);
6657 __PYX_ERR(0, 27, __pyx_L1_error)
6658 }
6659 *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_v.diminfo[0].strides) = __pyx_v_x;
6660
6661 /* "Isosurface.pyx":28
6662 * cdef np.ndarray [np.float64_t, ndim=1] v = np.zeros((3,),'d')
6663 * v[0] = x
6664 * v[1] = y # <<<<<<<<<<<<<<
6665 * v[2] = z
6666 * return v
6667*/
6668 __pyx_t_3 = 1;
6669 __pyx_t_4 = -1;
6670 if (__pyx_t_3 < 0) {
6671 __pyx_t_3 += __pyx_pybuffernd_v.diminfo[0].shape;
6672 if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0;
6673 } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_4 = 0;
6674 if (unlikely(__pyx_t_4 != -1)) {
6675 __Pyx_RaiseBufferIndexError(__pyx_t_4);
6676 __PYX_ERR(0, 28, __pyx_L1_error)
6677 }
6678 *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_v.diminfo[0].strides) = __pyx_v_y;
6679
6680 /* "Isosurface.pyx":29
6681 * v[0] = x
6682 * v[1] = y
6683 * v[2] = z # <<<<<<<<<<<<<<
6684 * return v
6685 *
6686*/
6687 __pyx_t_3 = 2;
6688 __pyx_t_4 = -1;
6689 if (__pyx_t_3 < 0) {
6690 __pyx_t_3 += __pyx_pybuffernd_v.diminfo[0].shape;
6691 if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0;
6692 } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_4 = 0;
6693 if (unlikely(__pyx_t_4 != -1)) {
6694 __Pyx_RaiseBufferIndexError(__pyx_t_4);
6695 __PYX_ERR(0, 29, __pyx_L1_error)
6696 }
6697 *__Pyx_BufPtrStrided1d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_v.diminfo[0].strides) = __pyx_v_z;
6698
6699 /* "Isosurface.pyx":30
6700 * v[1] = y
6701 * v[2] = z
6702 * return v # <<<<<<<<<<<<<<
6703 *
6704 * cdef double enorm(np.ndarray[np.float64_t, ndim=1] v):
6705*/
6706 {
6707 PyArrayObject *__pyx_temp;
6708 {
6709 __pyx_temp = __pyx_r;
6710 __Pyx_INCREF((PyObject *)__pyx_v_v);
6711 __pyx_r = ((PyArrayObject *)__pyx_v_v);
6712 }
6713 __Pyx_XDECREF((PyObject *)__pyx_temp);
6714 }
6715 goto __pyx_L0;
6716
6717 /* "Isosurface.pyx":25
6718 * from libc.math cimport sqrt
6719 *
6720 * cdef np.ndarray[np.float64_t,ndim=1] EVec(double x=0.0, double y=0.0, double z=0.0): # <<<<<<<<<<<<<<
6721 * cdef np.ndarray [np.float64_t, ndim=1] v = np.zeros((3,),'d')
6722 * v[0] = x
6723*/
6724
6725 /* function exit code */
6726 __pyx_L1_error:;
6727 __Pyx_XDECREF(__pyx_t_1);
6728 __Pyx_XDECREF(__pyx_t_2);
6729 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
6730 __Pyx_PyThreadState_declare
6731 __Pyx_PyThreadState_assign
6732 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
6733 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
6734 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
6735 __Pyx_AddTraceback("Isosurface.EVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
6736 __pyx_r = 0;
6737 goto __pyx_L2;
6738 __pyx_L0:;
6739 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
6740 __pyx_L2:;
6741 __Pyx_XDECREF((PyObject *)__pyx_v_v);
6742
6743
6744 __Pyx_XGIVEREF((PyObject *)__pyx_r);
6745 __Pyx_RefNannyFinishContext();
6746 return __pyx_r;
6747}
6748
6749/* "Isosurface.pyx":32
6750 * return v
6751 *
6752 * cdef double enorm(np.ndarray[np.float64_t, ndim=1] v): # <<<<<<<<<<<<<<
6753 * return sqrt(v[0]**2 + v[1]**2 + v[2]**2)
6754 *
6755*/
6756
6757static double __pyx_f_10Isosurface_enorm(PyArrayObject *__pyx_v_v) {
6758 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
6759 __Pyx_Buffer __pyx_pybuffer_v;
6760 double __pyx_r;
6761 Py_ssize_t __pyx_t_1;
6762 int __pyx_t_2;
6763 Py_ssize_t __pyx_t_3;
6764 Py_ssize_t __pyx_t_4;
6765 int __pyx_lineno = 0;
6766 const char *__pyx_filename = NULL;
6767 int __pyx_clineno = 0;
6768 __pyx_pybuffer_v.pybuffer.buf = NULL;
6769 __pyx_pybuffer_v.refcount = 0;
6770 __pyx_pybuffernd_v.data = NULL;
6771 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
6772 {
6773 __Pyx_BufFmt_StackElem __pyx_stack[1];
6774 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, 32, __pyx_L1_error)
6775 }
6776 __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];
6777
6778 /* "Isosurface.pyx":33
6779 *
6780 * cdef double enorm(np.ndarray[np.float64_t, ndim=1] v):
6781 * return sqrt(v[0]**2 + v[1]**2 + v[2]**2) # <<<<<<<<<<<<<<
6782 *
6783 * cdef double edot(np.ndarray[np.float64_t, ndim=1] v0, np.ndarray[np.float64_t, ndim=1] v1):
6784*/
6785 __pyx_t_1 = 0;
6786 __pyx_t_2 = -1;
6787 if (__pyx_t_1 < 0) {
6788 __pyx_t_1 += __pyx_pybuffernd_v.diminfo[0].shape;
6789 if (unlikely(__pyx_t_1 < 0)) __pyx_t_2 = 0;
6790 } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_2 = 0;
6791 if (unlikely(__pyx_t_2 != -1)) {
6792 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6793 __PYX_ERR(0, 33, __pyx_L1_error)
6794 }
6795 __pyx_t_3 = 1;
6796 __pyx_t_2 = -1;
6797 if (__pyx_t_3 < 0) {
6798 __pyx_t_3 += __pyx_pybuffernd_v.diminfo[0].shape;
6799 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
6800 } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_2 = 0;
6801 if (unlikely(__pyx_t_2 != -1)) {
6802 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6803 __PYX_ERR(0, 33, __pyx_L1_error)
6804 }
6805 __pyx_t_4 = 2;
6806 __pyx_t_2 = -1;
6807 if (__pyx_t_4 < 0) {
6808 __pyx_t_4 += __pyx_pybuffernd_v.diminfo[0].shape;
6809 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
6810 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_2 = 0;
6811 if (unlikely(__pyx_t_2 != -1)) {
6812 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6813 __PYX_ERR(0, 33, __pyx_L1_error)
6814 }
6815 {
6816
6817 __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)));
6818 }
6819 goto __pyx_L0;
6820
6821 /* "Isosurface.pyx":32
6822 * return v
6823 *
6824 * cdef double enorm(np.ndarray[np.float64_t, ndim=1] v): # <<<<<<<<<<<<<<
6825 * return sqrt(v[0]**2 + v[1]**2 + v[2]**2)
6826 *
6827*/
6828
6829 /* function exit code */
6830 __pyx_L1_error:;
6831 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
6832 __Pyx_PyThreadState_declare
6833 __Pyx_PyThreadState_assign
6834 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
6835 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
6836 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
6837 __Pyx_AddTraceback("Isosurface.enorm", __pyx_clineno, __pyx_lineno, __pyx_filename);
6838 __pyx_r = -1;
6839 goto __pyx_L2;
6840 __pyx_L0:;
6841 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
6842 __pyx_L2:;
6843
6844
6845
6846 return __pyx_r;
6847}
6848
6849/* "Isosurface.pyx":35
6850 * return sqrt(v[0]**2 + v[1]**2 + v[2]**2)
6851 *
6852 * cdef double edot(np.ndarray[np.float64_t, ndim=1] v0, np.ndarray[np.float64_t, ndim=1] v1): # <<<<<<<<<<<<<<
6853 * return v0[0]*v1[0] + v0[1]*v1[1] + v0[2]*v1[2]
6854 *
6855*/
6856
6857static double __pyx_f_10Isosurface_edot(PyArrayObject *__pyx_v_v0, PyArrayObject *__pyx_v_v1) {
6858 __Pyx_LocalBuf_ND __pyx_pybuffernd_v0;
6859 __Pyx_Buffer __pyx_pybuffer_v0;
6860 __Pyx_LocalBuf_ND __pyx_pybuffernd_v1;
6861 __Pyx_Buffer __pyx_pybuffer_v1;
6862 double __pyx_r;
6863 Py_ssize_t __pyx_t_1;
6864 int __pyx_t_2;
6865 Py_ssize_t __pyx_t_3;
6866 Py_ssize_t __pyx_t_4;
6867 Py_ssize_t __pyx_t_5;
6868 Py_ssize_t __pyx_t_6;
6869 Py_ssize_t __pyx_t_7;
6870 int __pyx_lineno = 0;
6871 const char *__pyx_filename = NULL;
6872 int __pyx_clineno = 0;
6873 __pyx_pybuffer_v0.pybuffer.buf = NULL;
6874 __pyx_pybuffer_v0.refcount = 0;
6875 __pyx_pybuffernd_v0.data = NULL;
6876 __pyx_pybuffernd_v0.rcbuffer = &__pyx_pybuffer_v0;
6877 __pyx_pybuffer_v1.pybuffer.buf = NULL;
6878 __pyx_pybuffer_v1.refcount = 0;
6879 __pyx_pybuffernd_v1.data = NULL;
6880 __pyx_pybuffernd_v1.rcbuffer = &__pyx_pybuffer_v1;
6881 {
6882 __Pyx_BufFmt_StackElem __pyx_stack[1];
6883 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, 35, __pyx_L1_error)
6884 }
6885 __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];
6886 {
6887 __Pyx_BufFmt_StackElem __pyx_stack[1];
6888 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, 35, __pyx_L1_error)
6889 }
6890 __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];
6891
6892 /* "Isosurface.pyx":36
6893 *
6894 * cdef double edot(np.ndarray[np.float64_t, ndim=1] v0, np.ndarray[np.float64_t, ndim=1] v1):
6895 * return v0[0]*v1[0] + v0[1]*v1[1] + v0[2]*v1[2] # <<<<<<<<<<<<<<
6896 *
6897 * cdef np.ndarray[np.float64_t, ndim=1] ecross(np.ndarray[np.float64_t, ndim=1] v0, np.ndarray[np.float64_t, ndim=1] v1):
6898*/
6899 __pyx_t_1 = 0;
6900 __pyx_t_2 = -1;
6901 if (__pyx_t_1 < 0) {
6902 __pyx_t_1 += __pyx_pybuffernd_v0.diminfo[0].shape;
6903 if (unlikely(__pyx_t_1 < 0)) __pyx_t_2 = 0;
6904 } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_v0.diminfo[0].shape)) __pyx_t_2 = 0;
6905 if (unlikely(__pyx_t_2 != -1)) {
6906 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6907 __PYX_ERR(0, 36, __pyx_L1_error)
6908 }
6909 __pyx_t_3 = 0;
6910 __pyx_t_2 = -1;
6911 if (__pyx_t_3 < 0) {
6912 __pyx_t_3 += __pyx_pybuffernd_v1.diminfo[0].shape;
6913 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
6914 } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_2 = 0;
6915 if (unlikely(__pyx_t_2 != -1)) {
6916 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6917 __PYX_ERR(0, 36, __pyx_L1_error)
6918 }
6919 __pyx_t_4 = 1;
6920 __pyx_t_2 = -1;
6921 if (__pyx_t_4 < 0) {
6922 __pyx_t_4 += __pyx_pybuffernd_v0.diminfo[0].shape;
6923 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
6924 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_v0.diminfo[0].shape)) __pyx_t_2 = 0;
6925 if (unlikely(__pyx_t_2 != -1)) {
6926 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6927 __PYX_ERR(0, 36, __pyx_L1_error)
6928 }
6929 __pyx_t_5 = 1;
6930 __pyx_t_2 = -1;
6931 if (__pyx_t_5 < 0) {
6932 __pyx_t_5 += __pyx_pybuffernd_v1.diminfo[0].shape;
6933 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
6934 } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_2 = 0;
6935 if (unlikely(__pyx_t_2 != -1)) {
6936 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6937 __PYX_ERR(0, 36, __pyx_L1_error)
6938 }
6939 __pyx_t_6 = 2;
6940 __pyx_t_2 = -1;
6941 if (__pyx_t_6 < 0) {
6942 __pyx_t_6 += __pyx_pybuffernd_v0.diminfo[0].shape;
6943 if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
6944 } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_v0.diminfo[0].shape)) __pyx_t_2 = 0;
6945 if (unlikely(__pyx_t_2 != -1)) {
6946 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6947 __PYX_ERR(0, 36, __pyx_L1_error)
6948 }
6949 __pyx_t_7 = 2;
6950 __pyx_t_2 = -1;
6951 if (__pyx_t_7 < 0) {
6952 __pyx_t_7 += __pyx_pybuffernd_v1.diminfo[0].shape;
6953 if (unlikely(__pyx_t_7 < 0)) __pyx_t_2 = 0;
6954 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_2 = 0;
6955 if (unlikely(__pyx_t_2 != -1)) {
6956 __Pyx_RaiseBufferIndexError(__pyx_t_2);
6957 __PYX_ERR(0, 36, __pyx_L1_error)
6958 }
6959 {
6960
6961 __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))));
6962 }
6963 goto __pyx_L0;
6964
6965 /* "Isosurface.pyx":35
6966 * return sqrt(v[0]**2 + v[1]**2 + v[2]**2)
6967 *
6968 * cdef double edot(np.ndarray[np.float64_t, ndim=1] v0, np.ndarray[np.float64_t, ndim=1] v1): # <<<<<<<<<<<<<<
6969 * return v0[0]*v1[0] + v0[1]*v1[1] + v0[2]*v1[2]
6970 *
6971*/
6972
6973 /* function exit code */
6974 __pyx_L1_error:;
6975 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
6976 __Pyx_PyThreadState_declare
6977 __Pyx_PyThreadState_assign
6978 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
6979 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v0.rcbuffer->pybuffer);
6980 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
6981 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
6982 __Pyx_AddTraceback("Isosurface.edot", __pyx_clineno, __pyx_lineno, __pyx_filename);
6983 __pyx_r = -1;
6984 goto __pyx_L2;
6985 __pyx_L0:;
6986 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v0.rcbuffer->pybuffer);
6987 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
6988 __pyx_L2:;
6989
6990
6991
6992
6993
6994 return __pyx_r;
6995}
6996
6997/* "Isosurface.pyx":38
6998 * return v0[0]*v1[0] + v0[1]*v1[1] + v0[2]*v1[2]
6999 *
7000 * cdef np.ndarray[np.float64_t, ndim=1] ecross(np.ndarray[np.float64_t, ndim=1] v0, np.ndarray[np.float64_t, ndim=1] v1): # <<<<<<<<<<<<<<
7001 * return EVec(v0[1]*v1[2] - v0[2]*v1[1],
7002 * v0[2]*v1[0] - v0[0]*v1[2],
7003*/
7004
7005static PyArrayObject *__pyx_f_10Isosurface_ecross(PyArrayObject *__pyx_v_v0, PyArrayObject *__pyx_v_v1) {
7006 __Pyx_LocalBuf_ND __pyx_pybuffernd_v0;
7007 __Pyx_Buffer __pyx_pybuffer_v0;
7008 __Pyx_LocalBuf_ND __pyx_pybuffernd_v1;
7009 __Pyx_Buffer __pyx_pybuffer_v1;
7010 PyArrayObject *__pyx_r = NULL;
7011 __Pyx_RefNannyDeclarations
7012 Py_ssize_t __pyx_t_1;
7013 int __pyx_t_2;
7014 Py_ssize_t __pyx_t_3;
7015 Py_ssize_t __pyx_t_4;
7016 Py_ssize_t __pyx_t_5;
7017 Py_ssize_t __pyx_t_6;
7018 Py_ssize_t __pyx_t_7;
7019 Py_ssize_t __pyx_t_8;
7020 Py_ssize_t __pyx_t_9;
7021 Py_ssize_t __pyx_t_10;
7022 Py_ssize_t __pyx_t_11;
7023 Py_ssize_t __pyx_t_12;
7024 Py_ssize_t __pyx_t_13;
7025 PyObject *__pyx_t_14 = NULL;
7026 struct __pyx_opt_args_10Isosurface_EVec __pyx_t_15;
7027 int __pyx_lineno = 0;
7028 const char *__pyx_filename = NULL;
7029 int __pyx_clineno = 0;
7030 __Pyx_RefNannySetupContext("ecross", 0);
7031 __pyx_pybuffer_v0.pybuffer.buf = NULL;
7032 __pyx_pybuffer_v0.refcount = 0;
7033 __pyx_pybuffernd_v0.data = NULL;
7034 __pyx_pybuffernd_v0.rcbuffer = &__pyx_pybuffer_v0;
7035 __pyx_pybuffer_v1.pybuffer.buf = NULL;
7036 __pyx_pybuffer_v1.refcount = 0;
7037 __pyx_pybuffernd_v1.data = NULL;
7038 __pyx_pybuffernd_v1.rcbuffer = &__pyx_pybuffer_v1;
7039 {
7040 __Pyx_BufFmt_StackElem __pyx_stack[1];
7041 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)
7042 }
7043 __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];
7044 {
7045 __Pyx_BufFmt_StackElem __pyx_stack[1];
7046 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)
7047 }
7048 __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];
7049
7050 /* "Isosurface.pyx":39
7051 *
7052 * cdef np.ndarray[np.float64_t, ndim=1] ecross(np.ndarray[np.float64_t, ndim=1] v0, np.ndarray[np.float64_t, ndim=1] v1):
7053 * return EVec(v0[1]*v1[2] - v0[2]*v1[1], # <<<<<<<<<<<<<<
7054 * v0[2]*v1[0] - v0[0]*v1[2],
7055 * v0[0]*v1[1] - v0[1]*v1[0])
7056*/
7057 __pyx_t_1 = 1;
7058 __pyx_t_2 = -1;
7059 if (__pyx_t_1 < 0) {
7060 __pyx_t_1 += __pyx_pybuffernd_v0.diminfo[0].shape;
7061 if (unlikely(__pyx_t_1 < 0)) __pyx_t_2 = 0;
7062 } else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_v0.diminfo[0].shape)) __pyx_t_2 = 0;
7063 if (unlikely(__pyx_t_2 != -1)) {
7064 __Pyx_RaiseBufferIndexError(__pyx_t_2);
7065 __PYX_ERR(0, 39, __pyx_L1_error)
7066 }
7067 __pyx_t_3 = 2;
7068 __pyx_t_2 = -1;
7069 if (__pyx_t_3 < 0) {
7070 __pyx_t_3 += __pyx_pybuffernd_v1.diminfo[0].shape;
7071 if (unlikely(__pyx_t_3 < 0)) __pyx_t_2 = 0;
7072 } else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_2 = 0;
7073 if (unlikely(__pyx_t_2 != -1)) {
7074 __Pyx_RaiseBufferIndexError(__pyx_t_2);
7075 __PYX_ERR(0, 39, __pyx_L1_error)
7076 }
7077 __pyx_t_4 = 2;
7078 __pyx_t_2 = -1;
7079 if (__pyx_t_4 < 0) {
7080 __pyx_t_4 += __pyx_pybuffernd_v0.diminfo[0].shape;
7081 if (unlikely(__pyx_t_4 < 0)) __pyx_t_2 = 0;
7082 } else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_v0.diminfo[0].shape)) __pyx_t_2 = 0;
7083 if (unlikely(__pyx_t_2 != -1)) {
7084 __Pyx_RaiseBufferIndexError(__pyx_t_2);
7085 __PYX_ERR(0, 39, __pyx_L1_error)
7086 }
7087 __pyx_t_5 = 1;
7088 __pyx_t_2 = -1;
7089 if (__pyx_t_5 < 0) {
7090 __pyx_t_5 += __pyx_pybuffernd_v1.diminfo[0].shape;
7091 if (unlikely(__pyx_t_5 < 0)) __pyx_t_2 = 0;
7092 } else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_2 = 0;
7093 if (unlikely(__pyx_t_2 != -1)) {
7094 __Pyx_RaiseBufferIndexError(__pyx_t_2);
7095 __PYX_ERR(0, 39, __pyx_L1_error)
7096 }
7097
7098 /* "Isosurface.pyx":40
7099 * cdef np.ndarray[np.float64_t, ndim=1] ecross(np.ndarray[np.float64_t, ndim=1] v0, np.ndarray[np.float64_t, ndim=1] v1):
7100 * return EVec(v0[1]*v1[2] - v0[2]*v1[1],
7101 * v0[2]*v1[0] - v0[0]*v1[2], # <<<<<<<<<<<<<<
7102 * v0[0]*v1[1] - v0[1]*v1[0])
7103 *
7104*/
7105 __pyx_t_6 = 2;
7106 __pyx_t_2 = -1;
7107 if (__pyx_t_6 < 0) {
7108 __pyx_t_6 += __pyx_pybuffernd_v0.diminfo[0].shape;
7109 if (unlikely(__pyx_t_6 < 0)) __pyx_t_2 = 0;
7110 } else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_v0.diminfo[0].shape)) __pyx_t_2 = 0;
7111 if (unlikely(__pyx_t_2 != -1)) {
7112 __Pyx_RaiseBufferIndexError(__pyx_t_2);
7113 __PYX_ERR(0, 40, __pyx_L1_error)
7114 }
7115 __pyx_t_7 = 0;
7116 __pyx_t_2 = -1;
7117 if (__pyx_t_7 < 0) {
7118 __pyx_t_7 += __pyx_pybuffernd_v1.diminfo[0].shape;
7119 if (unlikely(__pyx_t_7 < 0)) __pyx_t_2 = 0;
7120 } else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_2 = 0;
7121 if (unlikely(__pyx_t_2 != -1)) {
7122 __Pyx_RaiseBufferIndexError(__pyx_t_2);
7123 __PYX_ERR(0, 40, __pyx_L1_error)
7124 }
7125 __pyx_t_8 = 0;
7126 __pyx_t_2 = -1;
7127 if (__pyx_t_8 < 0) {
7128 __pyx_t_8 += __pyx_pybuffernd_v0.diminfo[0].shape;
7129 if (unlikely(__pyx_t_8 < 0)) __pyx_t_2 = 0;
7130 } else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_v0.diminfo[0].shape)) __pyx_t_2 = 0;
7131 if (unlikely(__pyx_t_2 != -1)) {
7132 __Pyx_RaiseBufferIndexError(__pyx_t_2);
7133 __PYX_ERR(0, 40, __pyx_L1_error)
7134 }
7135 __pyx_t_9 = 2;
7136 __pyx_t_2 = -1;
7137 if (__pyx_t_9 < 0) {
7138 __pyx_t_9 += __pyx_pybuffernd_v1.diminfo[0].shape;
7139 if (unlikely(__pyx_t_9 < 0)) __pyx_t_2 = 0;
7140 } else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_2 = 0;
7141 if (unlikely(__pyx_t_2 != -1)) {
7142 __Pyx_RaiseBufferIndexError(__pyx_t_2);
7143 __PYX_ERR(0, 40, __pyx_L1_error)
7144 }
7145
7146 /* "Isosurface.pyx":41
7147 * return EVec(v0[1]*v1[2] - v0[2]*v1[1],
7148 * v0[2]*v1[0] - v0[0]*v1[2],
7149 * v0[0]*v1[1] - v0[1]*v1[0]) # <<<<<<<<<<<<<<
7150 *
7151 * cdef double etriple(np.ndarray[np.float64_t, ndim=1] v0, np.ndarray[np.float64_t, ndim=1] v1, np.ndarray[np.float64_t, ndim=1] v2):
7152*/
7153 __pyx_t_10 = 0;
7154 __pyx_t_2 = -1;
7155 if (__pyx_t_10 < 0) {
7156 __pyx_t_10 += __pyx_pybuffernd_v0.diminfo[0].shape;
7157 if (unlikely(__pyx_t_10 < 0)) __pyx_t_2 = 0;
7158 } else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_v0.diminfo[0].shape)) __pyx_t_2 = 0;
7159 if (unlikely(__pyx_t_2 != -1)) {
7160 __Pyx_RaiseBufferIndexError(__pyx_t_2);
7161 __PYX_ERR(0, 41, __pyx_L1_error)
7162 }
7163 __pyx_t_11 = 1;
7164 __pyx_t_2 = -1;
7165 if (__pyx_t_11 < 0) {
7166 __pyx_t_11 += __pyx_pybuffernd_v1.diminfo[0].shape;
7167 if (unlikely(__pyx_t_11 < 0)) __pyx_t_2 = 0;
7168 } else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_2 = 0;
7169 if (unlikely(__pyx_t_2 != -1)) {
7170 __Pyx_RaiseBufferIndexError(__pyx_t_2);
7171 __PYX_ERR(0, 41, __pyx_L1_error)
7172 }
7173 __pyx_t_12 = 1;
7174 __pyx_t_2 = -1;
7175 if (__pyx_t_12 < 0) {
7176 __pyx_t_12 += __pyx_pybuffernd_v0.diminfo[0].shape;
7177 if (unlikely(__pyx_t_12 < 0)) __pyx_t_2 = 0;
7178 } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v0.diminfo[0].shape)) __pyx_t_2 = 0;
7179 if (unlikely(__pyx_t_2 != -1)) {
7180 __Pyx_RaiseBufferIndexError(__pyx_t_2);
7181 __PYX_ERR(0, 41, __pyx_L1_error)
7182 }
7183 __pyx_t_13 = 0;
7184 __pyx_t_2 = -1;
7185 if (__pyx_t_13 < 0) {
7186 __pyx_t_13 += __pyx_pybuffernd_v1.diminfo[0].shape;
7187 if (unlikely(__pyx_t_13 < 0)) __pyx_t_2 = 0;
7188 } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v1.diminfo[0].shape)) __pyx_t_2 = 0;
7189 if (unlikely(__pyx_t_2 != -1)) {
7190 __Pyx_RaiseBufferIndexError(__pyx_t_2);
7191 __PYX_ERR(0, 41, __pyx_L1_error)
7192 }
7193
7194 /* "Isosurface.pyx":39
7195 *
7196 * cdef np.ndarray[np.float64_t, ndim=1] ecross(np.ndarray[np.float64_t, ndim=1] v0, np.ndarray[np.float64_t, ndim=1] v1):
7197 * return EVec(v0[1]*v1[2] - v0[2]*v1[1], # <<<<<<<<<<<<<<
7198 * v0[2]*v1[0] - v0[0]*v1[2],
7199 * v0[0]*v1[1] - v0[1]*v1[0])
7200*/
7201 __pyx_t_15.__pyx_n = 3;
7202 __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))));
7203 __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))));
7204 __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))));
7205 __pyx_t_14 = ((PyObject *)__pyx_f_10Isosurface_EVec(&__pyx_t_15)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 39, __pyx_L1_error)
7206 __Pyx_GOTREF(__pyx_t_14);
7207 {
7208 PyArrayObject *__pyx_temp;
7209 {
7210 __pyx_temp = __pyx_r;
7211 __pyx_r = ((PyArrayObject *)__pyx_t_14);
7212 }
7213 __Pyx_XDECREF((PyObject *)__pyx_temp);
7214 }
7215 __pyx_t_14 = 0;
7216 goto __pyx_L0;
7217
7218 /* "Isosurface.pyx":38
7219 * return v0[0]*v1[0] + v0[1]*v1[1] + v0[2]*v1[2]
7220 *
7221 * cdef np.ndarray[np.float64_t, ndim=1] ecross(np.ndarray[np.float64_t, ndim=1] v0, np.ndarray[np.float64_t, ndim=1] v1): # <<<<<<<<<<<<<<
7222 * return EVec(v0[1]*v1[2] - v0[2]*v1[1],
7223 * v0[2]*v1[0] - v0[0]*v1[2],
7224*/
7225
7226 /* function exit code */
7227 __pyx_L1_error:;
7228 __Pyx_XDECREF(__pyx_t_14);
7229 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
7230 __Pyx_PyThreadState_declare
7231 __Pyx_PyThreadState_assign
7232 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
7233 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v0.rcbuffer->pybuffer);
7234 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
7235 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
7236 __Pyx_AddTraceback("Isosurface.ecross", __pyx_clineno, __pyx_lineno, __pyx_filename);
7237 __pyx_r = 0;
7238 goto __pyx_L2;
7239 __pyx_L0:;
7240 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v0.rcbuffer->pybuffer);
7241 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
7242 __pyx_L2:;
7243
7244
7245
7246
7247 __Pyx_XGIVEREF((PyObject *)__pyx_r);
7248 __Pyx_RefNannyFinishContext();
7249 return __pyx_r;
7250}
7251
7252/* "Isosurface.pyx":43
7253 * v0[0]*v1[1] - v0[1]*v1[0])
7254 *
7255 * cdef double etriple(np.ndarray[np.float64_t, ndim=1] v0, np.ndarray[np.float64_t, ndim=1] v1, np.ndarray[np.float64_t, ndim=1] v2): # <<<<<<<<<<<<<<
7256 * return edot(v0,ecross(v1,v2))
7257 *
7258*/
7259
7260static double __pyx_f_10Isosurface_etriple(PyArrayObject *__pyx_v_v0, PyArrayObject *__pyx_v_v1, PyArrayObject *__pyx_v_v2) {
7261 __Pyx_LocalBuf_ND __pyx_pybuffernd_v0;
7262 __Pyx_Buffer __pyx_pybuffer_v0;
7263 __Pyx_LocalBuf_ND __pyx_pybuffernd_v1;
7264 __Pyx_Buffer __pyx_pybuffer_v1;
7265 __Pyx_LocalBuf_ND __pyx_pybuffernd_v2;
7266 __Pyx_Buffer __pyx_pybuffer_v2;
7267 double __pyx_r;
7268 __Pyx_RefNannyDeclarations
7269 PyObject *__pyx_t_1 = NULL;
7270 double __pyx_t_2;
7271 int __pyx_lineno = 0;
7272 const char *__pyx_filename = NULL;
7273 int __pyx_clineno = 0;
7274 __Pyx_RefNannySetupContext("etriple", 0);
7275 __pyx_pybuffer_v0.pybuffer.buf = NULL;
7276 __pyx_pybuffer_v0.refcount = 0;
7277 __pyx_pybuffernd_v0.data = NULL;
7278 __pyx_pybuffernd_v0.rcbuffer = &__pyx_pybuffer_v0;
7279 __pyx_pybuffer_v1.pybuffer.buf = NULL;
7280 __pyx_pybuffer_v1.refcount = 0;
7281 __pyx_pybuffernd_v1.data = NULL;
7282 __pyx_pybuffernd_v1.rcbuffer = &__pyx_pybuffer_v1;
7283 __pyx_pybuffer_v2.pybuffer.buf = NULL;
7284 __pyx_pybuffer_v2.refcount = 0;
7285 __pyx_pybuffernd_v2.data = NULL;
7286 __pyx_pybuffernd_v2.rcbuffer = &__pyx_pybuffer_v2;
7287 {
7288 __Pyx_BufFmt_StackElem __pyx_stack[1];
7289 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, 43, __pyx_L1_error)
7290 }
7291 __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];
7292 {
7293 __Pyx_BufFmt_StackElem __pyx_stack[1];
7294 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, 43, __pyx_L1_error)
7295 }
7296 __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];
7297 {
7298 __Pyx_BufFmt_StackElem __pyx_stack[1];
7299 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, 43, __pyx_L1_error)
7300 }
7301 __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];
7302
7303 /* "Isosurface.pyx":44
7304 *
7305 * cdef double etriple(np.ndarray[np.float64_t, ndim=1] v0, np.ndarray[np.float64_t, ndim=1] v1, np.ndarray[np.float64_t, ndim=1] v2):
7306 * return edot(v0,ecross(v1,v2)) # <<<<<<<<<<<<<<
7307 *
7308 *
7309*/
7310 __pyx_t_1 = ((PyObject *)__pyx_f_10Isosurface_ecross(((PyArrayObject *)__pyx_v_v1), ((PyArrayObject *)__pyx_v_v2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
7311 __Pyx_GOTREF(__pyx_t_1);
7312 __pyx_t_2 = __pyx_f_10Isosurface_edot(((PyArrayObject *)__pyx_v_v0), ((PyArrayObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L1_error)
7313 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7314 {
7315 __pyx_r = __pyx_t_2;
7316 }
7317 goto __pyx_L0;
7318
7319 /* "Isosurface.pyx":43
7320 * v0[0]*v1[1] - v0[1]*v1[0])
7321 *
7322 * cdef double etriple(np.ndarray[np.float64_t, ndim=1] v0, np.ndarray[np.float64_t, ndim=1] v1, np.ndarray[np.float64_t, ndim=1] v2): # <<<<<<<<<<<<<<
7323 * return edot(v0,ecross(v1,v2))
7324 *
7325*/
7326
7327 /* function exit code */
7328 __pyx_L1_error:;
7329 __Pyx_XDECREF(__pyx_t_1);
7330 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
7331 __Pyx_PyThreadState_declare
7332 __Pyx_PyThreadState_assign
7333 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
7334 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v0.rcbuffer->pybuffer);
7335 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
7336 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v2.rcbuffer->pybuffer);
7337 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
7338 __Pyx_AddTraceback("Isosurface.etriple", __pyx_clineno, __pyx_lineno, __pyx_filename);
7339 __pyx_r = -1;
7340 goto __pyx_L2;
7341 __pyx_L0:;
7342 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v0.rcbuffer->pybuffer);
7343 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v1.rcbuffer->pybuffer);
7344 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v2.rcbuffer->pybuffer);
7345 __pyx_L2:;
7346
7347
7348
7349
7350
7351
7352
7353 __Pyx_RefNannyFinishContext();
7354 return __pyx_r;
7355}
7356
7357/* "Isosurface.pyx":51
7358 * """Extract isosurfaces"""
7359 *
7360 * def __init__(self, isosurfaces, domain, activeTime=None, # <<<<<<<<<<<<<<
7361 * sampleRate=0, format='pov', writeBoundary=True):
7362 * """Create a set of isosurfaces that will be extracted and serialized
7363*/
7364
7365/* Python wrapper */
7366static PyObject *__pyx_pw_10Isosurface_10Isosurface_1__init__(PyObject *__pyx_self,
7367#if CYTHON_VECTORCALL
7368PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7369#else
7370PyObject *__pyx_args, PyObject *__pyx_kwds
7371#endif
7372); /*proto*/
7373PyDoc_STRVAR(__pyx_doc_10Isosurface_10Isosurface___init__, "Isosurface.__init__(self, isosurfaces, domain, activeTime=None, sampleRate=0, format=\047pov\047, writeBoundary=True)\n\nCreate a set of isosurfaces that will be extracted and serialized\n\n:param isosurfaces: An iterable of \"isosurfaces\". Each isosurface is\nspecified by a 2-tuple, with the first element in the tuple is a field\nfrom which to extract isosurfaces, and the second element is an n-tuple\nof 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\nfor which the point gauge is active.\n\n:param sampleRate: The intervals at which samples should be measured.\nNote that this is a rough lower bound, and that the gauge values could\nbe computed less frequently depending on the time integrator. The\ndefault value of zero computes the gauge values at every time step.\n\n:param format: the file format for the isosurfaces (\047pov\047, None).\n\n:param writeBoundary: whether to write the boundary mesh to or the\ndomain bounding box\n\nExample:\n\nphi0 = (isosurfaces=(\047phi\047, (0.0,)),\n activeTime=(0, 2.5),\n sampleRate=0.2,\n fileName=\047water.pov\047)\n\nThis creates an Isosurfaces object that will extract phi(x,y,z,t) = 0\nat simulation time between = 0 and 2.5 with samples taken no more\nfrequently than every 0.2 seconds. Results will be saved to:\nwater.pov.");
7374static PyMethodDef __pyx_mdef_10Isosurface_10Isosurface_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10Isosurface_10Isosurface_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10Isosurface_10Isosurface___init__};
7375static PyObject *__pyx_pw_10Isosurface_10Isosurface_1__init__(PyObject *__pyx_self,
7376#if CYTHON_VECTORCALL
7377PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7378#else
7379PyObject *__pyx_args, PyObject *__pyx_kwds
7380#endif
7381) {
7382 PyObject *__pyx_v_self = 0;
7383 PyObject *__pyx_v_isosurfaces = 0;
7384 PyObject *__pyx_v_domain = 0;
7385 PyObject *__pyx_v_activeTime = 0;
7386 PyObject *__pyx_v_sampleRate = 0;
7387 PyObject *__pyx_v_format = 0;
7388 PyObject *__pyx_v_writeBoundary = 0;
7389 #if !CYTHON_VECTORCALL
7390 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7391 #endif
7392 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7393 PyObject* values[7] = {0,0,0,0,0,0,0};
7394 int __pyx_lineno = 0;
7395 const char *__pyx_filename = NULL;
7396 int __pyx_clineno = 0;
7397 PyObject *__pyx_r = 0;
7398 __Pyx_RefNannyDeclarations
7399 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
7400 #if !CYTHON_VECTORCALL
7401 #if CYTHON_ASSUME_SAFE_SIZE
7402 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7403 #else
7404 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7405 #endif
7406 #endif
7407 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7408 {
7409 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_isosurfaces,&__pyx_mstate_global->__pyx_n_u_domain,&__pyx_mstate_global->__pyx_n_u_activeTime,&__pyx_mstate_global->__pyx_n_u_sampleRate,&__pyx_mstate_global->__pyx_n_u_format,&__pyx_mstate_global->__pyx_n_u_writeBoundary,0};
7410 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
7411 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 51, __pyx_L3_error)
7412 if (__pyx_kwds_len > 0) {
7413 switch (__pyx_nargs) {
7414 case 7:
7415 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
7416 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 51, __pyx_L3_error)
7417 CYTHON_FALLTHROUGH;
7418 case 6:
7419 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
7420 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 51, __pyx_L3_error)
7421 CYTHON_FALLTHROUGH;
7422 case 5:
7423 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
7424 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 51, __pyx_L3_error)
7425 CYTHON_FALLTHROUGH;
7426 case 4:
7427 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
7428 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 51, __pyx_L3_error)
7429 CYTHON_FALLTHROUGH;
7430 case 3:
7431 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
7432 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 51, __pyx_L3_error)
7433 CYTHON_FALLTHROUGH;
7434 case 2:
7435 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
7436 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 51, __pyx_L3_error)
7437 CYTHON_FALLTHROUGH;
7438 case 1:
7439 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
7440 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 51, __pyx_L3_error)
7441 CYTHON_FALLTHROUGH;
7442 case 0: break;
7443 default: goto __pyx_L5_argtuple_error;
7444 }
7445 const Py_ssize_t kwd_pos_args = __pyx_nargs;
7446 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 51, __pyx_L3_error)
7447 if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
7448 if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_0)));
7449 if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_n_u_pov)));
7450
7451 /* "Isosurface.pyx":52
7452 *
7453 * def __init__(self, isosurfaces, domain, activeTime=None,
7454 * sampleRate=0, format='pov', writeBoundary=True): # <<<<<<<<<<<<<<
7455 * """Create a set of isosurfaces that will be extracted and serialized
7456 *
7457*/
7458 if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True)));
7459 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
7460 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 7, i); __PYX_ERR(0, 51, __pyx_L3_error) }
7461 }
7462 } else {
7463 switch (__pyx_nargs) {
7464 case 7:
7465 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
7466 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 51, __pyx_L3_error)
7467 CYTHON_FALLTHROUGH;
7468 case 6:
7469 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
7470 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 51, __pyx_L3_error)
7471 CYTHON_FALLTHROUGH;
7472 case 5:
7473 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
7474 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 51, __pyx_L3_error)
7475 CYTHON_FALLTHROUGH;
7476 case 4:
7477 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
7478 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 51, __pyx_L3_error)
7479 CYTHON_FALLTHROUGH;
7480 case 3:
7481 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
7482 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 51, __pyx_L3_error)
7483 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
7484 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 51, __pyx_L3_error)
7485 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
7486 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 51, __pyx_L3_error)
7487 break;
7488 default: goto __pyx_L5_argtuple_error;
7489 }
7490
7491 /* "Isosurface.pyx":51
7492 * """Extract isosurfaces"""
7493 *
7494 * def __init__(self, isosurfaces, domain, activeTime=None, # <<<<<<<<<<<<<<
7495 * sampleRate=0, format='pov', writeBoundary=True):
7496 * """Create a set of isosurfaces that will be extracted and serialized
7497*/
7498 if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
7499 if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_int_0)));
7500 if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_n_u_pov)));
7501 if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True)));
7502 }
7503 __pyx_v_self = values[0];
7504 __pyx_v_isosurfaces = values[1];
7505 __pyx_v_domain = values[2];
7506 __pyx_v_activeTime = values[3];
7507 __pyx_v_sampleRate = values[4];
7508 __pyx_v_format = values[5];
7509 __pyx_v_writeBoundary = values[6];
7510 }
7511 goto __pyx_L6_skip;
7512 __pyx_L5_argtuple_error:;
7513 __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 7, __pyx_nargs); __PYX_ERR(0, 51, __pyx_L3_error)
7514 __pyx_L6_skip:;
7515 goto __pyx_L4_argument_unpacking_done;
7516 __pyx_L3_error:;
7517 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7518 Py_XDECREF(values[__pyx_temp]);
7519 }
7520 __Pyx_AddTraceback("Isosurface.Isosurface.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7521 __Pyx_RefNannyFinishContext();
7522 return NULL;
7523 __pyx_L4_argument_unpacking_done:;
7524 __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);
7525
7526 /* function exit code */
7527 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7528 Py_XDECREF(values[__pyx_temp]);
7529 }
7530 __Pyx_RefNannyFinishContext();
7531 return __pyx_r;
7532}
7533
7534static 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) {
7535 CYTHON_UNUSED PyObject *__pyx_v_f = NULL;
7536 PyObject *__pyx_v_values = NULL;
7537 PyObject *__pyx_v_v = NULL;
7538 PyObject *__pyx_r = NULL;
7539 __Pyx_RefNannyDeclarations
7540 PyObject *__pyx_t_1 = NULL;
7541 PyObject *__pyx_t_2 = NULL;
7542 Py_ssize_t __pyx_t_3;
7543 PyObject *(*__pyx_t_4)(PyObject *);
7544 PyObject *__pyx_t_5 = NULL;
7545 PyObject *__pyx_t_6 = NULL;
7546 PyObject *__pyx_t_7 = NULL;
7547 PyObject *(*__pyx_t_8)(PyObject *);
7548 Py_ssize_t __pyx_t_9;
7549 PyObject *(*__pyx_t_10)(PyObject *);
7550 int __pyx_t_11;
7551 size_t __pyx_t_12;
7552 int __pyx_lineno = 0;
7553 const char *__pyx_filename = NULL;
7554 int __pyx_clineno = 0;
7555 __Pyx_RefNannySetupContext("__init__", 0);
7556
7557 /* "Isosurface.pyx":88
7558 *
7559 * """
7560 * self.isosurfaces = isosurfaces # <<<<<<<<<<<<<<
7561 * self.domain = domain
7562 * self.nodes = {}
7563*/
7564 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_isosurfaces, __pyx_v_isosurfaces) < (0)) __PYX_ERR(0, 88, __pyx_L1_error)
7565
7566 /* "Isosurface.pyx":89
7567 * """
7568 * self.isosurfaces = isosurfaces
7569 * self.domain = domain # <<<<<<<<<<<<<<
7570 * self.nodes = {}
7571 * self.elements = {}
7572*/
7573 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain, __pyx_v_domain) < (0)) __PYX_ERR(0, 89, __pyx_L1_error)
7574
7575 /* "Isosurface.pyx":90
7576 * self.isosurfaces = isosurfaces
7577 * self.domain = domain
7578 * self.nodes = {} # <<<<<<<<<<<<<<
7579 * self.elements = {}
7580 * self.normals = {}
7581*/
7582 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
7583 __Pyx_GOTREF(__pyx_t_1);
7584 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodes, __pyx_t_1) < (0)) __PYX_ERR(0, 90, __pyx_L1_error)
7585 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7586
7587 /* "Isosurface.pyx":91
7588 * self.domain = domain
7589 * self.nodes = {}
7590 * self.elements = {} # <<<<<<<<<<<<<<
7591 * self.normals = {}
7592 * self.normal_indices = {}
7593*/
7594 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
7595 __Pyx_GOTREF(__pyx_t_1);
7596 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_elements, __pyx_t_1) < (0)) __PYX_ERR(0, 91, __pyx_L1_error)
7597 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7598
7599 /* "Isosurface.pyx":92
7600 * self.nodes = {}
7601 * self.elements = {}
7602 * self.normals = {} # <<<<<<<<<<<<<<
7603 * self.normal_indices = {}
7604 * for f, values in self.isosurfaces:
7605*/
7606 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
7607 __Pyx_GOTREF(__pyx_t_1);
7608 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_normals, __pyx_t_1) < (0)) __PYX_ERR(0, 92, __pyx_L1_error)
7609 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7610
7611 /* "Isosurface.pyx":93
7612 * self.elements = {}
7613 * self.normals = {}
7614 * self.normal_indices = {} # <<<<<<<<<<<<<<
7615 * for f, values in self.isosurfaces:
7616 * for v in values:
7617*/
7618 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)
7619 __Pyx_GOTREF(__pyx_t_1);
7620 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_normal_indices, __pyx_t_1) < (0)) __PYX_ERR(0, 93, __pyx_L1_error)
7621 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7622
7623 /* "Isosurface.pyx":94
7624 * self.normals = {}
7625 * self.normal_indices = {}
7626 * for f, values in self.isosurfaces: # <<<<<<<<<<<<<<
7627 * for v in values:
7628 * assert v == 0.0, \
7629*/
7630 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_isosurfaces); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
7631 __Pyx_GOTREF(__pyx_t_1);
7632 if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
7633 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2);
7634 __pyx_t_3 = 0;
7635 __pyx_t_4 = NULL;
7636 } else {
7637 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error)
7638 __Pyx_GOTREF(__pyx_t_2);
7639 __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __pyx_L1_error)
7640 }
7641 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7642 for (;;) {
7643 if (likely(!__pyx_t_4)) {
7644 if (likely(PyList_CheckExact(__pyx_t_2))) {
7645 {
7646 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
7647 #if !CYTHON_ASSUME_SAFE_SIZE
7648 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 94, __pyx_L1_error)
7649 #endif
7650 if (__pyx_t_3 >= __pyx_temp) break;
7651 }
7652 __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
7653 ++__pyx_t_3;
7654 } else {
7655 {
7656 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
7657 #if !CYTHON_ASSUME_SAFE_SIZE
7658 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 94, __pyx_L1_error)
7659 #endif
7660 if (__pyx_t_3 >= __pyx_temp) break;
7661 }
7662 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7663 __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
7664 #else
7665 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
7666 #endif
7667 ++__pyx_t_3;
7668 }
7669 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
7670 } else {
7671 __pyx_t_1 = __pyx_t_4(__pyx_t_2);
7672 if (unlikely(!__pyx_t_1)) {
7673 PyObject* exc_type = PyErr_Occurred();
7674 if (exc_type) {
7675 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 94, __pyx_L1_error)
7676 PyErr_Clear();
7677 }
7678 break;
7679 }
7680 }
7681 __Pyx_GOTREF(__pyx_t_1);
7682 if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
7683 PyObject* sequence = __pyx_t_1;
7684 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7685 if (unlikely(size != 2)) {
7686 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
7687 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7688 __PYX_ERR(0, 94, __pyx_L1_error)
7689 }
7690 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7691 if (likely(PyTuple_CheckExact(sequence))) {
7692 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
7693 __Pyx_INCREF(__pyx_t_5);
7694 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
7695 __Pyx_INCREF(__pyx_t_6);
7696 } else {
7697 __pyx_t_5 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
7698 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 94, __pyx_L1_error)
7699 __Pyx_XGOTREF(__pyx_t_5);
7700 __pyx_t_6 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
7701 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 94, __pyx_L1_error)
7702 __Pyx_XGOTREF(__pyx_t_6);
7703 }
7704 #else
7705 __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 94, __pyx_L1_error)
7706 __Pyx_GOTREF(__pyx_t_5);
7707 __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 94, __pyx_L1_error)
7708 __Pyx_GOTREF(__pyx_t_6);
7709 #endif
7710 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7711 } else {
7712 Py_ssize_t index = -1;
7713 __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 94, __pyx_L1_error)
7714 __Pyx_GOTREF(__pyx_t_7);
7715 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7716 __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
7717 index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
7718 __Pyx_GOTREF(__pyx_t_5);
7719 index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
7720 __Pyx_GOTREF(__pyx_t_6);
7721 if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < (0)) __PYX_ERR(0, 94, __pyx_L1_error)
7722 __pyx_t_8 = NULL;
7723 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7724 goto __pyx_L6_unpacking_done;
7725 __pyx_L5_unpacking_failed:;
7726 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7727 __pyx_t_8 = NULL;
7728 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
7729 __PYX_ERR(0, 94, __pyx_L1_error)
7730 __pyx_L6_unpacking_done:;
7731 }
7732 __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_5);
7733 __pyx_t_5 = 0;
7734 __Pyx_XDECREF_SET(__pyx_v_values, __pyx_t_6);
7735 __pyx_t_6 = 0;
7736
7737 /* "Isosurface.pyx":95
7738 * self.normal_indices = {}
7739 * for f, values in self.isosurfaces:
7740 * for v in values: # <<<<<<<<<<<<<<
7741 * assert v == 0.0, \
7742 * "only implemented for 0 isosurface in 3D for now"
7743*/
7744 if (likely(PyList_CheckExact(__pyx_v_values)) || PyTuple_CheckExact(__pyx_v_values)) {
7745 __pyx_t_1 = __pyx_v_values; __Pyx_INCREF(__pyx_t_1);
7746 __pyx_t_9 = 0;
7747 __pyx_t_10 = NULL;
7748 } else {
7749 __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
7750 __Pyx_GOTREF(__pyx_t_1);
7751 __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 95, __pyx_L1_error)
7752 }
7753 for (;;) {
7754 if (likely(!__pyx_t_10)) {
7755 if (likely(PyList_CheckExact(__pyx_t_1))) {
7756 {
7757 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
7758 #if !CYTHON_ASSUME_SAFE_SIZE
7759 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 95, __pyx_L1_error)
7760 #endif
7761 if (__pyx_t_9 >= __pyx_temp) break;
7762 }
7763 __pyx_t_6 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_9, __Pyx_ReferenceSharing_OwnStrongReference);
7764 ++__pyx_t_9;
7765 } else {
7766 {
7767 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
7768 #if !CYTHON_ASSUME_SAFE_SIZE
7769 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 95, __pyx_L1_error)
7770 #endif
7771 if (__pyx_t_9 >= __pyx_temp) break;
7772 }
7773 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7774 __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9));
7775 #else
7776 __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_9);
7777 #endif
7778 ++__pyx_t_9;
7779 }
7780 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 95, __pyx_L1_error)
7781 } else {
7782 __pyx_t_6 = __pyx_t_10(__pyx_t_1);
7783 if (unlikely(!__pyx_t_6)) {
7784 PyObject* exc_type = PyErr_Occurred();
7785 if (exc_type) {
7786 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 95, __pyx_L1_error)
7787 PyErr_Clear();
7788 }
7789 break;
7790 }
7791 }
7792 __Pyx_GOTREF(__pyx_t_6);
7793 __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6);
7794 __pyx_t_6 = 0;
7795
7796 /* "Isosurface.pyx":96
7797 * for f, values in self.isosurfaces:
7798 * for v in values:
7799 * assert v == 0.0, \ # <<<<<<<<<<<<<<
7800 * "only implemented for 0 isosurface in 3D for now"
7801 * self.activeTime = activeTime
7802*/
7803 #ifndef CYTHON_WITHOUT_ASSERTIONS
7804 if (unlikely(__pyx_assertions_enabled())) {
7805 __pyx_t_11 = (__Pyx_PyFloat_BoolEqObjC(__pyx_v_v, __pyx_mstate_global->__pyx_float_0_0, 0.0, 0, 0)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 96, __pyx_L1_error)
7806 if (unlikely(!__pyx_t_11)) {
7807 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_only_implemented_for_0_isosurfac, 0, 0);
7808 __PYX_ERR(0, 96, __pyx_L1_error)
7809 }
7810
7811 }
7812 #else
7813 if ((1)); else __PYX_ERR(0, 96, __pyx_L1_error)
7814 #endif
7815
7816 /* "Isosurface.pyx":95
7817 * self.normal_indices = {}
7818 * for f, values in self.isosurfaces:
7819 * for v in values: # <<<<<<<<<<<<<<
7820 * assert v == 0.0, \
7821 * "only implemented for 0 isosurface in 3D for now"
7822*/
7823 }
7824 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7825
7826 /* "Isosurface.pyx":94
7827 * self.normals = {}
7828 * self.normal_indices = {}
7829 * for f, values in self.isosurfaces: # <<<<<<<<<<<<<<
7830 * for v in values:
7831 * assert v == 0.0, \
7832*/
7833 }
7834 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7835
7836 /* "Isosurface.pyx":98
7837 * assert v == 0.0, \
7838 * "only implemented for 0 isosurface in 3D for now"
7839 * self.activeTime = activeTime # <<<<<<<<<<<<<<
7840 * self.sampleRate = sampleRate
7841 * self.format = format
7842*/
7843 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_activeTime, __pyx_v_activeTime) < (0)) __PYX_ERR(0, 98, __pyx_L1_error)
7844
7845 /* "Isosurface.pyx":99
7846 * "only implemented for 0 isosurface in 3D for now"
7847 * self.activeTime = activeTime
7848 * self.sampleRate = sampleRate # <<<<<<<<<<<<<<
7849 * self.format = format
7850 * self.comm = Comm.get()
7851*/
7852 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sampleRate, __pyx_v_sampleRate) < (0)) __PYX_ERR(0, 99, __pyx_L1_error)
7853
7854 /* "Isosurface.pyx":100
7855 * self.activeTime = activeTime
7856 * self.sampleRate = sampleRate
7857 * self.format = format # <<<<<<<<<<<<<<
7858 * self.comm = Comm.get()
7859 * self.writeBoundary = writeBoundary
7860*/
7861 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_format, __pyx_v_format) < (0)) __PYX_ERR(0, 100, __pyx_L1_error)
7862
7863 /* "Isosurface.pyx":101
7864 * self.sampleRate = sampleRate
7865 * self.format = format
7866 * self.comm = Comm.get() # <<<<<<<<<<<<<<
7867 * self.writeBoundary = writeBoundary
7868 * self.fileprefix = 'isosurface'
7869*/
7870 __pyx_t_1 = NULL;
7871 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_Comm); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 101, __pyx_L1_error)
7872 __Pyx_GOTREF(__pyx_t_6);
7873 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 101, __pyx_L1_error)
7874 __Pyx_GOTREF(__pyx_t_5);
7875 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7876 __pyx_t_12 = 1;
7877 #if CYTHON_UNPACK_METHODS
7878 if (unlikely(PyMethod_Check(__pyx_t_5))) {
7879 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
7880 assert(__pyx_t_1);
7881 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
7882 __Pyx_INCREF(__pyx_t_1);
7883 __Pyx_INCREF(__pyx__function);
7884 __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
7885 __pyx_t_12 = 0;
7886 }
7887 #endif
7888 {
7889 PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
7890 __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_12, (1-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
7891 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7892 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7893 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
7894 __Pyx_GOTREF(__pyx_t_2);
7895 }
7896 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_comm, __pyx_t_2) < (0)) __PYX_ERR(0, 101, __pyx_L1_error)
7897 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7898
7899 /* "Isosurface.pyx":102
7900 * self.format = format
7901 * self.comm = Comm.get()
7902 * self.writeBoundary = writeBoundary # <<<<<<<<<<<<<<
7903 * self.fileprefix = 'isosurface'
7904 *
7905*/
7906 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_writeBoundary, __pyx_v_writeBoundary) < (0)) __PYX_ERR(0, 102, __pyx_L1_error)
7907
7908 /* "Isosurface.pyx":103
7909 * self.comm = Comm.get()
7910 * self.writeBoundary = writeBoundary
7911 * self.fileprefix = 'isosurface' # <<<<<<<<<<<<<<
7912 *
7913 * def attachModel(self, model, ar):
7914*/
7915 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_fileprefix, __pyx_mstate_global->__pyx_n_u_isosurface) < (0)) __PYX_ERR(0, 103, __pyx_L1_error)
7916
7917 /* "Isosurface.pyx":51
7918 * """Extract isosurfaces"""
7919 *
7920 * def __init__(self, isosurfaces, domain, activeTime=None, # <<<<<<<<<<<<<<
7921 * sampleRate=0, format='pov', writeBoundary=True):
7922 * """Create a set of isosurfaces that will be extracted and serialized
7923*/
7924
7925 /* function exit code */
7926 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7927 goto __pyx_L0;
7928 __pyx_L1_error:;
7929 __Pyx_XDECREF(__pyx_t_1);
7930 __Pyx_XDECREF(__pyx_t_2);
7931 __Pyx_XDECREF(__pyx_t_5);
7932 __Pyx_XDECREF(__pyx_t_6);
7933 __Pyx_XDECREF(__pyx_t_7);
7934 __Pyx_AddTraceback("Isosurface.Isosurface.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7935 __pyx_r = NULL;
7936 __pyx_L0:;
7937 __Pyx_XDECREF(__pyx_v_f);
7938 __Pyx_XDECREF(__pyx_v_values);
7939 __Pyx_XDECREF(__pyx_v_v);
7940 __Pyx_XGIVEREF(__pyx_r);
7941 __Pyx_RefNannyFinishContext();
7942 return __pyx_r;
7943}
7944
7945/* "Isosurface.pyx":105
7946 * self.fileprefix = 'isosurface'
7947 *
7948 * def attachModel(self, model, ar): # <<<<<<<<<<<<<<
7949 * """ Attach this isosurface to the given simulation model.
7950 * """
7951*/
7952
7953/* Python wrapper */
7954static PyObject *__pyx_pw_10Isosurface_10Isosurface_3attachModel(PyObject *__pyx_self,
7955#if CYTHON_VECTORCALL
7956PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7957#else
7958PyObject *__pyx_args, PyObject *__pyx_kwds
7959#endif
7960); /*proto*/
7961PyDoc_STRVAR(__pyx_doc_10Isosurface_10Isosurface_2attachModel, "Isosurface.attachModel(self, model, ar)\n\nAttach this isosurface to the given simulation model.\n ");
7962static PyMethodDef __pyx_mdef_10Isosurface_10Isosurface_3attachModel = {"attachModel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10Isosurface_10Isosurface_3attachModel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10Isosurface_10Isosurface_2attachModel};
7963static PyObject *__pyx_pw_10Isosurface_10Isosurface_3attachModel(PyObject *__pyx_self,
7964#if CYTHON_VECTORCALL
7965PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7966#else
7967PyObject *__pyx_args, PyObject *__pyx_kwds
7968#endif
7969) {
7970 PyObject *__pyx_v_self = 0;
7971 PyObject *__pyx_v_model = 0;
7972 CYTHON_UNUSED PyObject *__pyx_v_ar = 0;
7973 #if !CYTHON_VECTORCALL
7974 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7975 #endif
7976 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7977 PyObject* values[3] = {0,0,0};
7978 int __pyx_lineno = 0;
7979 const char *__pyx_filename = NULL;
7980 int __pyx_clineno = 0;
7981 PyObject *__pyx_r = 0;
7982 __Pyx_RefNannyDeclarations
7983 __Pyx_RefNannySetupContext("attachModel (wrapper)", 0);
7984 #if !CYTHON_VECTORCALL
7985 #if CYTHON_ASSUME_SAFE_SIZE
7986 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7987 #else
7988 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7989 #endif
7990 #endif
7991 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7992 {
7993 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_model,&__pyx_mstate_global->__pyx_n_u_ar,0};
7994 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
7995 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 105, __pyx_L3_error)
7996 if (__pyx_kwds_len > 0) {
7997 switch (__pyx_nargs) {
7998 case 3:
7999 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
8000 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 105, __pyx_L3_error)
8001 CYTHON_FALLTHROUGH;
8002 case 2:
8003 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
8004 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 105, __pyx_L3_error)
8005 CYTHON_FALLTHROUGH;
8006 case 1:
8007 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
8008 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 105, __pyx_L3_error)
8009 CYTHON_FALLTHROUGH;
8010 case 0: break;
8011 default: goto __pyx_L5_argtuple_error;
8012 }
8013 const Py_ssize_t kwd_pos_args = __pyx_nargs;
8014 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "attachModel", 0) < (0)) __PYX_ERR(0, 105, __pyx_L3_error)
8015 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
8016 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("attachModel", 1, 3, 3, i); __PYX_ERR(0, 105, __pyx_L3_error) }
8017 }
8018 } else if (unlikely(__pyx_nargs != 3)) {
8019 goto __pyx_L5_argtuple_error;
8020 } else {
8021 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
8022 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 105, __pyx_L3_error)
8023 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
8024 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 105, __pyx_L3_error)
8025 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
8026 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 105, __pyx_L3_error)
8027 }
8028 __pyx_v_self = values[0];
8029 __pyx_v_model = values[1];
8030 __pyx_v_ar = values[2];
8031 }
8032 goto __pyx_L6_skip;
8033 __pyx_L5_argtuple_error:;
8034 __Pyx_RaiseArgtupleInvalid("attachModel", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 105, __pyx_L3_error)
8035 __pyx_L6_skip:;
8036 goto __pyx_L4_argument_unpacking_done;
8037 __pyx_L3_error:;
8038 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
8039 Py_XDECREF(values[__pyx_temp]);
8040 }
8041 __Pyx_AddTraceback("Isosurface.Isosurface.attachModel", __pyx_clineno, __pyx_lineno, __pyx_filename);
8042 __Pyx_RefNannyFinishContext();
8043 return NULL;
8044 __pyx_L4_argument_unpacking_done:;
8045 __pyx_r = __pyx_pf_10Isosurface_10Isosurface_2attachModel(__pyx_self, __pyx_v_self, __pyx_v_model, __pyx_v_ar);
8046
8047 /* function exit code */
8048 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
8049 Py_XDECREF(values[__pyx_temp]);
8050 }
8051 __Pyx_RefNannyFinishContext();
8052 return __pyx_r;
8053}
8054static PyObject *__pyx_gb_10Isosurface_10Isosurface_11attachModel_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
8055
8056/* "Isosurface.pyx":122
8057 * self.exteriorElementBoundariesArray
8058 * ].flatten())
8059 * self.g2b = dict((gn, bn) for bn, gn in enumerate(self.boundaryNodes)) # <<<<<<<<<<<<<<
8060 * self.nodeArray = fine_grid.mesh.nodeArray
8061 * self.num_owned_elements = fine_grid.mesh.nElements_global
8062*/
8063
8064static PyObject *__pyx_pf_10Isosurface_10Isosurface_11attachModel_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
8065 struct __pyx_obj_10Isosurface___pyx_scope_struct__genexpr *__pyx_cur_scope;
8066 PyObject *__pyx_r = NULL;
8067 __Pyx_RefNannyDeclarations
8068 int __pyx_lineno = 0;
8069 const char *__pyx_filename = NULL;
8070 int __pyx_clineno = 0;
8071 __Pyx_RefNannySetupContext("genexpr", 0);
8072 __pyx_cur_scope = (struct __pyx_obj_10Isosurface___pyx_scope_struct__genexpr *)__pyx_tp_new_10Isosurface___pyx_scope_struct__genexpr(__pyx_mstate_global->__pyx_ptype_10Isosurface___pyx_scope_struct__genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL);
8073 if (unlikely(!__pyx_cur_scope)) {
8074 __pyx_cur_scope = ((struct __pyx_obj_10Isosurface___pyx_scope_struct__genexpr *)Py_None);
8075 __Pyx_INCREF(Py_None);
8076 __PYX_ERR(0, 122, __pyx_L1_error)
8077 } else {
8078 __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
8079 }
8080 __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
8081 __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
8082 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
8083 {
8084 __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10Isosurface_10Isosurface_11attachModel_2generator, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_Isosurface_attachModel_locals_ge, __pyx_mstate_global->__pyx_n_u_Isosurface); if (unlikely(!gen)) __PYX_ERR(0, 122, __pyx_L1_error)
8085 __Pyx_DECREF(__pyx_cur_scope);
8086 __Pyx_RefNannyFinishContext();
8087 return (PyObject *) gen;
8088 }
8089
8090 /* function exit code */
8091 __pyx_L1_error:;
8092 __Pyx_AddTraceback("Isosurface.Isosurface.attachModel.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
8093 __pyx_r = NULL;
8094 __Pyx_DECREF((PyObject *)__pyx_cur_scope);
8095 __Pyx_XGIVEREF(__pyx_r);
8096 __Pyx_RefNannyFinishContext();
8097 return __pyx_r;
8098}
8099
8100static PyObject *__pyx_gb_10Isosurface_10Isosurface_11attachModel_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
8101{
8102 struct __pyx_obj_10Isosurface___pyx_scope_struct__genexpr *__pyx_cur_scope = ((struct __pyx_obj_10Isosurface___pyx_scope_struct__genexpr *)__pyx_generator->closure);
8103 PyObject *__pyx_r = NULL;
8104 PyObject *__pyx_t_1 = NULL;
8105 PyObject *__pyx_t_2 = NULL;
8106 Py_ssize_t __pyx_t_3;
8107 PyObject *(*__pyx_t_4)(PyObject *);
8108 PyObject *__pyx_t_5 = NULL;
8109 int __pyx_lineno = 0;
8110 const char *__pyx_filename = NULL;
8111 int __pyx_clineno = 0;
8112 __Pyx_RefNannyDeclarations
8113 __Pyx_RefNannySetupContext("genexpr", 0);
8114 switch (__pyx_generator->resume_label) {
8115 case 0: goto __pyx_L3_first_run;
8116 default: /* CPython raises the right error here */
8117 __Pyx_RefNannyFinishContext();
8118 return NULL;
8119 }
8120 __pyx_L3_first_run:;
8121 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 122, __pyx_L1_error)
8122 __pyx_r = PyDict_New(); if (unlikely(!__pyx_r)) __PYX_ERR(0, 122, __pyx_L1_error)
8123 __Pyx_GOTREF(__pyx_r);
8124 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
8125 __pyx_t_1 = __pyx_mstate_global->__pyx_int_0;
8126 if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 122, __pyx_L1_error) }
8127 if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) {
8128 __pyx_t_2 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_2);
8129 __pyx_t_3 = 0;
8130 __pyx_t_4 = NULL;
8131 } else {
8132 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
8133 __Pyx_GOTREF(__pyx_t_2);
8134 __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error)
8135 }
8136 for (;;) {
8137 if (likely(!__pyx_t_4)) {
8138 if (likely(PyList_CheckExact(__pyx_t_2))) {
8139 {
8140 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
8141 #if !CYTHON_ASSUME_SAFE_SIZE
8142 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 122, __pyx_L1_error)
8143 #endif
8144 if (__pyx_t_3 >= __pyx_temp) break;
8145 }
8146 __pyx_t_5 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
8147 ++__pyx_t_3;
8148 } else {
8149 {
8150 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
8151 #if !CYTHON_ASSUME_SAFE_SIZE
8152 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 122, __pyx_L1_error)
8153 #endif
8154 if (__pyx_t_3 >= __pyx_temp) break;
8155 }
8156 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8157 __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
8158 #else
8159 __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
8160 #endif
8161 ++__pyx_t_3;
8162 }
8163 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error)
8164 } else {
8165 __pyx_t_5 = __pyx_t_4(__pyx_t_2);
8166 if (unlikely(!__pyx_t_5)) {
8167 PyObject* exc_type = PyErr_Occurred();
8168 if (exc_type) {
8169 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 122, __pyx_L1_error)
8170 PyErr_Clear();
8171 }
8172 break;
8173 }
8174 }
8175 __Pyx_GOTREF(__pyx_t_5);
8176 __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_gn);
8177 __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_gn, __pyx_t_5);
8178 __Pyx_GIVEREF(__pyx_t_5);
8179 __pyx_t_5 = 0;
8180 __Pyx_INCREF(__pyx_t_1);
8181 __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_bn);
8182 __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_bn, __pyx_t_1);
8183 __Pyx_GIVEREF(__pyx_t_1);
8184 __pyx_t_5 = __Pyx_PyLong_AddObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error)
8185 __Pyx_GOTREF(__pyx_t_5);
8186 __Pyx_DECREF(__pyx_t_1);
8187 __pyx_t_1 = __pyx_t_5;
8188 __pyx_t_5 = 0;
8189 if (unlikely(PyDict_SetItem(__pyx_r, __pyx_cur_scope->__pyx_v_gn, __pyx_cur_scope->__pyx_v_bn))) __PYX_ERR(0, 122, __pyx_L1_error)
8190 }
8191 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8192 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8193 CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
8194
8195 /* function exit code */
8196 goto __pyx_L0;
8197 __pyx_L1_error:;
8198 __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
8199 __Pyx_XDECREF(__pyx_t_1);
8200 __Pyx_XDECREF(__pyx_t_2);
8201 __Pyx_XDECREF(__pyx_t_5);
8202 if (__Pyx_PyErr_Occurred()) {
8203 __Pyx_Generator_Replace_StopIteration(0);
8204 __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
8205 }
8206 __pyx_L0:;
8207 __Pyx_XGIVEREF(__pyx_r);
8208 #if !CYTHON_USE_EXC_INFO_STACK
8209 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
8210 #endif
8211 __pyx_generator->resume_label = -1;
8212 __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
8213 __Pyx_RefNannyFinishContext();
8214 return __pyx_r;
8215}
8216
8217/* "Isosurface.pyx":105
8218 * self.fileprefix = 'isosurface'
8219 *
8220 * def attachModel(self, model, ar): # <<<<<<<<<<<<<<
8221 * """ Attach this isosurface to the given simulation model.
8222 * """
8223*/
8224
8225static 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) {
8226 PyObject *__pyx_v_fine_grid = NULL;
8227 PyObject *__pyx_gb_10Isosurface_10Isosurface_11attachModel_2generator = 0;
8228 PyObject *__pyx_r = NULL;
8229 __Pyx_RefNannyDeclarations
8230 PyObject *__pyx_t_1 = NULL;
8231 PyObject *__pyx_t_2 = NULL;
8232 PyObject *__pyx_t_3 = NULL;
8233 PyObject *__pyx_t_4 = NULL;
8234 PyObject *__pyx_t_5 = NULL;
8235 size_t __pyx_t_6;
8236 int __pyx_lineno = 0;
8237 const char *__pyx_filename = NULL;
8238 int __pyx_clineno = 0;
8239 __Pyx_RefNannySetupContext("attachModel", 0);
8240
8241 /* "Isosurface.pyx":108
8242 * """ Attach this isosurface to the given simulation model.
8243 * """
8244 * self.model = model # <<<<<<<<<<<<<<
8245 * fine_grid = model.levelModelList[-1]
8246 * self.fieldNames = fine_grid.coefficients.variableNames
8247*/
8248 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_model, __pyx_v_model) < (0)) __PYX_ERR(0, 108, __pyx_L1_error)
8249
8250 /* "Isosurface.pyx":109
8251 * """
8252 * self.model = model
8253 * fine_grid = model.levelModelList[-1] # <<<<<<<<<<<<<<
8254 * self.fieldNames = fine_grid.coefficients.variableNames
8255 * self.elementNodesArray = fine_grid.mesh.elementNodesArray
8256*/
8257 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_model, __pyx_mstate_global->__pyx_n_u_levelModelList); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
8258 __Pyx_GOTREF(__pyx_t_1);
8259 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error)
8260 __Pyx_GOTREF(__pyx_t_2);
8261 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8262 __pyx_v_fine_grid = __pyx_t_2;
8263 __pyx_t_2 = 0;
8264
8265 /* "Isosurface.pyx":110
8266 * self.model = model
8267 * fine_grid = model.levelModelList[-1]
8268 * self.fieldNames = fine_grid.coefficients.variableNames # <<<<<<<<<<<<<<
8269 * self.elementNodesArray = fine_grid.mesh.elementNodesArray
8270 * self.exteriorElementBoundariesArray \
8271*/
8272 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fine_grid, __pyx_mstate_global->__pyx_n_u_coefficients); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error)
8273 __Pyx_GOTREF(__pyx_t_2);
8274 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_variableNames); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error)
8275 __Pyx_GOTREF(__pyx_t_1);
8276 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8277 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_fieldNames, __pyx_t_1) < (0)) __PYX_ERR(0, 110, __pyx_L1_error)
8278 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8279
8280 /* "Isosurface.pyx":111
8281 * fine_grid = model.levelModelList[-1]
8282 * self.fieldNames = fine_grid.coefficients.variableNames
8283 * self.elementNodesArray = fine_grid.mesh.elementNodesArray # <<<<<<<<<<<<<<
8284 * self.exteriorElementBoundariesArray \
8285 * = fine_grid.mesh.exteriorElementBoundariesArray
8286*/
8287 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fine_grid, __pyx_mstate_global->__pyx_n_u_mesh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error)
8288 __Pyx_GOTREF(__pyx_t_1);
8289 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_elementNodesArray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error)
8290 __Pyx_GOTREF(__pyx_t_2);
8291 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8292 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_elementNodesArray, __pyx_t_2) < (0)) __PYX_ERR(0, 111, __pyx_L1_error)
8293 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8294
8295 /* "Isosurface.pyx":113
8296 * self.elementNodesArray = fine_grid.mesh.elementNodesArray
8297 * self.exteriorElementBoundariesArray \
8298 * = fine_grid.mesh.exteriorElementBoundariesArray # <<<<<<<<<<<<<<
8299 * self.elementBoundaryNodesArray \
8300 * = fine_grid.mesh.elementBoundaryNodesArray
8301*/
8302 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fine_grid, __pyx_mstate_global->__pyx_n_u_mesh); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
8303 __Pyx_GOTREF(__pyx_t_2);
8304 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_exteriorElementBoundariesArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
8305 __Pyx_GOTREF(__pyx_t_1);
8306 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8307
8308 /* "Isosurface.pyx":112
8309 * self.fieldNames = fine_grid.coefficients.variableNames
8310 * self.elementNodesArray = fine_grid.mesh.elementNodesArray
8311 * self.exteriorElementBoundariesArray \ # <<<<<<<<<<<<<<
8312 * = fine_grid.mesh.exteriorElementBoundariesArray
8313 * self.elementBoundaryNodesArray \
8314*/
8315 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exteriorElementBoundariesArray, __pyx_t_1) < (0)) __PYX_ERR(0, 112, __pyx_L1_error)
8316 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8317
8318 /* "Isosurface.pyx":115
8319 * = fine_grid.mesh.exteriorElementBoundariesArray
8320 * self.elementBoundaryNodesArray \
8321 * = fine_grid.mesh.elementBoundaryNodesArray # <<<<<<<<<<<<<<
8322 * self.elementBoundaryMaterialTypes \
8323 * = fine_grid.mesh.elementBoundaryMaterialTypes
8324*/
8325 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fine_grid, __pyx_mstate_global->__pyx_n_u_mesh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
8326 __Pyx_GOTREF(__pyx_t_1);
8327 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_elementBoundaryNodesArray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error)
8328 __Pyx_GOTREF(__pyx_t_2);
8329 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8330
8331 /* "Isosurface.pyx":114
8332 * self.exteriorElementBoundariesArray \
8333 * = fine_grid.mesh.exteriorElementBoundariesArray
8334 * self.elementBoundaryNodesArray \ # <<<<<<<<<<<<<<
8335 * = fine_grid.mesh.elementBoundaryNodesArray
8336 * self.elementBoundaryMaterialTypes \
8337*/
8338 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_elementBoundaryNodesArray, __pyx_t_2) < (0)) __PYX_ERR(0, 114, __pyx_L1_error)
8339 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8340
8341 /* "Isosurface.pyx":117
8342 * = fine_grid.mesh.elementBoundaryNodesArray
8343 * self.elementBoundaryMaterialTypes \
8344 * = fine_grid.mesh.elementBoundaryMaterialTypes # <<<<<<<<<<<<<<
8345 * self.boundaryNodes = set(
8346 * self.elementBoundaryNodesArray[
8347*/
8348 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_fine_grid, __pyx_mstate_global->__pyx_n_u_mesh); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error)
8349 __Pyx_GOTREF(__pyx_t_2);
8350 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_elementBoundaryMaterialTypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
8351 __Pyx_GOTREF(__pyx_t_1);
8352 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8353
8354 /* "Isosurface.pyx":116
8355 * self.elementBoundaryNodesArray \
8356 * = fine_grid.mesh.elementBoundaryNodesArray
8357 * self.elementBoundaryMaterialTypes \ # <<<<<<<<<<<<<<
8358 * = fine_grid.mesh.elementBoundaryMaterialTypes
8359 * self.boundaryNodes = set(
8360*/
8361 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_elementBoundaryMaterialTypes, __pyx_t_1) < (0)) __PYX_ERR(0, 116, __pyx_L1_error)
8362 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8363
8364 /* "Isosurface.pyx":119
8365 * = fine_grid.mesh.elementBoundaryMaterialTypes
8366 * self.boundaryNodes = set(
8367 * self.elementBoundaryNodesArray[ # <<<<<<<<<<<<<<
8368 * self.exteriorElementBoundariesArray
8369 * ].flatten())
8370*/
8371 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_elementBoundaryNodesArray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error)
8372 __Pyx_GOTREF(__pyx_t_3);
8373
8374 /* "Isosurface.pyx":120
8375 * self.boundaryNodes = set(
8376 * self.elementBoundaryNodesArray[
8377 * self.exteriorElementBoundariesArray # <<<<<<<<<<<<<<
8378 * ].flatten())
8379 * self.g2b = dict((gn, bn) for bn, gn in enumerate(self.boundaryNodes))
8380*/
8381 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exteriorElementBoundariesArray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 120, __pyx_L1_error)
8382 __Pyx_GOTREF(__pyx_t_4);
8383
8384 /* "Isosurface.pyx":119
8385 * = fine_grid.mesh.elementBoundaryMaterialTypes
8386 * self.boundaryNodes = set(
8387 * self.elementBoundaryNodesArray[ # <<<<<<<<<<<<<<
8388 * self.exteriorElementBoundariesArray
8389 * ].flatten())
8390*/
8391 __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L1_error)
8392 __Pyx_GOTREF(__pyx_t_5);
8393 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8394 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8395 __pyx_t_2 = __pyx_t_5;
8396 __Pyx_INCREF(__pyx_t_2);
8397 __pyx_t_6 = 0;
8398 {
8399 PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
8400 __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_flatten, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
8401 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8402 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8403 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
8404 __Pyx_GOTREF(__pyx_t_1);
8405 }
8406
8407 /* "Isosurface.pyx":118
8408 * self.elementBoundaryMaterialTypes \
8409 * = fine_grid.mesh.elementBoundaryMaterialTypes
8410 * self.boundaryNodes = set( # <<<<<<<<<<<<<<
8411 * self.elementBoundaryNodesArray[
8412 * self.exteriorElementBoundariesArray
8413*/
8414 __pyx_t_5 = PySet_New(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 118, __pyx_L1_error)
8415 __Pyx_GOTREF(__pyx_t_5);
8416 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8417 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_boundaryNodes, __pyx_t_5) < (0)) __PYX_ERR(0, 118, __pyx_L1_error)
8418 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8419
8420 /* "Isosurface.pyx":122
8421 * self.exteriorElementBoundariesArray
8422 * ].flatten())
8423 * self.g2b = dict((gn, bn) for bn, gn in enumerate(self.boundaryNodes)) # <<<<<<<<<<<<<<
8424 * self.nodeArray = fine_grid.mesh.nodeArray
8425 * self.num_owned_elements = fine_grid.mesh.nElements_global
8426*/
8427 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_boundaryNodes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error)
8428 __Pyx_GOTREF(__pyx_t_5);
8429 __pyx_t_1 = __pyx_pf_10Isosurface_10Isosurface_11attachModel_genexpr(NULL, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
8430 __Pyx_GOTREF(__pyx_t_1);
8431 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8432 __pyx_t_5 = __Pyx_Generator_GetInlinedResult(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error)
8433 __Pyx_GOTREF(__pyx_t_5);
8434 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8435 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_g2b, __pyx_t_5) < (0)) __PYX_ERR(0, 122, __pyx_L1_error)
8436 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8437
8438 /* "Isosurface.pyx":123
8439 * ].flatten())
8440 * self.g2b = dict((gn, bn) for bn, gn in enumerate(self.boundaryNodes))
8441 * self.nodeArray = fine_grid.mesh.nodeArray # <<<<<<<<<<<<<<
8442 * self.num_owned_elements = fine_grid.mesh.nElements_global
8443 * self.u = fine_grid.u
8444*/
8445 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_fine_grid, __pyx_mstate_global->__pyx_n_u_mesh); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error)
8446 __Pyx_GOTREF(__pyx_t_5);
8447 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
8448 __Pyx_GOTREF(__pyx_t_1);
8449 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8450 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray, __pyx_t_1) < (0)) __PYX_ERR(0, 123, __pyx_L1_error)
8451 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8452
8453 /* "Isosurface.pyx":124
8454 * self.g2b = dict((gn, bn) for bn, gn in enumerate(self.boundaryNodes))
8455 * self.nodeArray = fine_grid.mesh.nodeArray
8456 * self.num_owned_elements = fine_grid.mesh.nElements_global # <<<<<<<<<<<<<<
8457 * self.u = fine_grid.u
8458 * self.timeIntegration = fine_grid.timeIntegration
8459*/
8460 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_fine_grid, __pyx_mstate_global->__pyx_n_u_mesh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
8461 __Pyx_GOTREF(__pyx_t_1);
8462 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_nElements_global); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L1_error)
8463 __Pyx_GOTREF(__pyx_t_5);
8464 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8465 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_num_owned_elements, __pyx_t_5) < (0)) __PYX_ERR(0, 124, __pyx_L1_error)
8466 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8467
8468 /* "Isosurface.pyx":125
8469 * self.nodeArray = fine_grid.mesh.nodeArray
8470 * self.num_owned_elements = fine_grid.mesh.nElements_global
8471 * self.u = fine_grid.u # <<<<<<<<<<<<<<
8472 * self.timeIntegration = fine_grid.timeIntegration
8473 * self.nFrames = 0
8474*/
8475 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_fine_grid, __pyx_mstate_global->__pyx_n_u_u); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 125, __pyx_L1_error)
8476 __Pyx_GOTREF(__pyx_t_5);
8477 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_u, __pyx_t_5) < (0)) __PYX_ERR(0, 125, __pyx_L1_error)
8478 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8479
8480 /* "Isosurface.pyx":126
8481 * self.num_owned_elements = fine_grid.mesh.nElements_global
8482 * self.u = fine_grid.u
8483 * self.timeIntegration = fine_grid.timeIntegration # <<<<<<<<<<<<<<
8484 * self.nFrames = 0
8485 * self.next_output = 0
8486*/
8487 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_fine_grid, __pyx_mstate_global->__pyx_n_u_timeIntegration); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error)
8488 __Pyx_GOTREF(__pyx_t_5);
8489 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_timeIntegration, __pyx_t_5) < (0)) __PYX_ERR(0, 126, __pyx_L1_error)
8490 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8491
8492 /* "Isosurface.pyx":127
8493 * self.u = fine_grid.u
8494 * self.timeIntegration = fine_grid.timeIntegration
8495 * self.nFrames = 0 # <<<<<<<<<<<<<<
8496 * self.next_output = 0
8497 * self.writeSceneHeader()
8498*/
8499 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nFrames, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(0, 127, __pyx_L1_error)
8500
8501 /* "Isosurface.pyx":128
8502 * self.timeIntegration = fine_grid.timeIntegration
8503 * self.nFrames = 0
8504 * self.next_output = 0 # <<<<<<<<<<<<<<
8505 * self.writeSceneHeader()
8506 * return self
8507*/
8508 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_next_output, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(0, 128, __pyx_L1_error)
8509
8510 /* "Isosurface.pyx":129
8511 * self.nFrames = 0
8512 * self.next_output = 0
8513 * self.writeSceneHeader() # <<<<<<<<<<<<<<
8514 * return self
8515 *
8516*/
8517 __pyx_t_1 = __pyx_v_self;
8518 __Pyx_INCREF(__pyx_t_1);
8519 __pyx_t_6 = 0;
8520 {
8521 PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
8522 __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_writeSceneHeader, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
8523 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8524 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 129, __pyx_L1_error)
8525 __Pyx_GOTREF(__pyx_t_5);
8526 }
8527 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8528
8529 /* "Isosurface.pyx":130
8530 * self.next_output = 0
8531 * self.writeSceneHeader()
8532 * return self # <<<<<<<<<<<<<<
8533 *
8534 * def attachHDF5(self, h5, step, cam=None):
8535*/
8536 {
8537 PyObject *__pyx_temp;
8538 {
8539 __pyx_temp = __pyx_r;
8540 __Pyx_INCREF(__pyx_v_self);
8541 __pyx_r = __pyx_v_self;
8542 }
8543 __Pyx_XDECREF(__pyx_temp);
8544 }
8545 goto __pyx_L0;
8546
8547 /* "Isosurface.pyx":105
8548 * self.fileprefix = 'isosurface'
8549 *
8550 * def attachModel(self, model, ar): # <<<<<<<<<<<<<<
8551 * """ Attach this isosurface to the given simulation model.
8552 * """
8553*/
8554
8555 /* function exit code */
8556 __pyx_L1_error:;
8557 __Pyx_XDECREF(__pyx_t_1);
8558 __Pyx_XDECREF(__pyx_t_2);
8559 __Pyx_XDECREF(__pyx_t_3);
8560 __Pyx_XDECREF(__pyx_t_4);
8561 __Pyx_XDECREF(__pyx_t_5);
8562 __Pyx_AddTraceback("Isosurface.Isosurface.attachModel", __pyx_clineno, __pyx_lineno, __pyx_filename);
8563 __pyx_r = NULL;
8564 __pyx_L0:;
8565 __Pyx_XDECREF(__pyx_v_fine_grid);
8566 __Pyx_XDECREF(__pyx_gb_10Isosurface_10Isosurface_11attachModel_2generator);
8567 __Pyx_XGIVEREF(__pyx_r);
8568 __Pyx_RefNannyFinishContext();
8569 return __pyx_r;
8570}
8571
8572/* "Isosurface.pyx":132
8573 * return self
8574 *
8575 * def attachHDF5(self, h5, step, cam=None): # <<<<<<<<<<<<<<
8576 * """
8577 * Attach this isosurface to and HDF5 archive (an h5py.File)
8578*/
8579
8580/* Python wrapper */
8581static PyObject *__pyx_pw_10Isosurface_10Isosurface_5attachHDF5(PyObject *__pyx_self,
8582#if CYTHON_VECTORCALL
8583PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
8584#else
8585PyObject *__pyx_args, PyObject *__pyx_kwds
8586#endif
8587); /*proto*/
8588PyDoc_STRVAR(__pyx_doc_10Isosurface_10Isosurface_4attachHDF5, "Isosurface.attachHDF5(self, h5, step, cam=None)\n\nAttach this isosurface to and HDF5 archive (an h5py.File)");
8589static PyMethodDef __pyx_mdef_10Isosurface_10Isosurface_5attachHDF5 = {"attachHDF5", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10Isosurface_10Isosurface_5attachHDF5, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10Isosurface_10Isosurface_4attachHDF5};
8590static PyObject *__pyx_pw_10Isosurface_10Isosurface_5attachHDF5(PyObject *__pyx_self,
8591#if CYTHON_VECTORCALL
8592PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
8593#else
8594PyObject *__pyx_args, PyObject *__pyx_kwds
8595#endif
8596) {
8597 PyObject *__pyx_v_self = 0;
8598 PyObject *__pyx_v_h5 = 0;
8599 PyObject *__pyx_v_step = 0;
8600 PyObject *__pyx_v_cam = 0;
8601 #if !CYTHON_VECTORCALL
8602 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
8603 #endif
8604 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8605 PyObject* values[4] = {0,0,0,0};
8606 int __pyx_lineno = 0;
8607 const char *__pyx_filename = NULL;
8608 int __pyx_clineno = 0;
8609 PyObject *__pyx_r = 0;
8610 __Pyx_RefNannyDeclarations
8611 __Pyx_RefNannySetupContext("attachHDF5 (wrapper)", 0);
8612 #if !CYTHON_VECTORCALL
8613 #if CYTHON_ASSUME_SAFE_SIZE
8614 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
8615 #else
8616 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
8617 #endif
8618 #endif
8619 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
8620 {
8621 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_h5,&__pyx_mstate_global->__pyx_n_u_step,&__pyx_mstate_global->__pyx_n_u_cam,0};
8622 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
8623 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 132, __pyx_L3_error)
8624 if (__pyx_kwds_len > 0) {
8625 switch (__pyx_nargs) {
8626 case 4:
8627 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
8628 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 132, __pyx_L3_error)
8629 CYTHON_FALLTHROUGH;
8630 case 3:
8631 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
8632 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 132, __pyx_L3_error)
8633 CYTHON_FALLTHROUGH;
8634 case 2:
8635 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
8636 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 132, __pyx_L3_error)
8637 CYTHON_FALLTHROUGH;
8638 case 1:
8639 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
8640 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 132, __pyx_L3_error)
8641 CYTHON_FALLTHROUGH;
8642 case 0: break;
8643 default: goto __pyx_L5_argtuple_error;
8644 }
8645 const Py_ssize_t kwd_pos_args = __pyx_nargs;
8646 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "attachHDF5", 0) < (0)) __PYX_ERR(0, 132, __pyx_L3_error)
8647 if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
8648 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
8649 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("attachHDF5", 0, 3, 4, i); __PYX_ERR(0, 132, __pyx_L3_error) }
8650 }
8651 } else {
8652 switch (__pyx_nargs) {
8653 case 4:
8654 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
8655 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 132, __pyx_L3_error)
8656 CYTHON_FALLTHROUGH;
8657 case 3:
8658 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
8659 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 132, __pyx_L3_error)
8660 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
8661 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 132, __pyx_L3_error)
8662 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
8663 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 132, __pyx_L3_error)
8664 break;
8665 default: goto __pyx_L5_argtuple_error;
8666 }
8667 if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
8668 }
8669 __pyx_v_self = values[0];
8670 __pyx_v_h5 = values[1];
8671 __pyx_v_step = values[2];
8672 __pyx_v_cam = values[3];
8673 }
8674 goto __pyx_L6_skip;
8675 __pyx_L5_argtuple_error:;
8676 __Pyx_RaiseArgtupleInvalid("attachHDF5", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 132, __pyx_L3_error)
8677 __pyx_L6_skip:;
8678 goto __pyx_L4_argument_unpacking_done;
8679 __pyx_L3_error:;
8680 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
8681 Py_XDECREF(values[__pyx_temp]);
8682 }
8683 __Pyx_AddTraceback("Isosurface.Isosurface.attachHDF5", __pyx_clineno, __pyx_lineno, __pyx_filename);
8684 __Pyx_RefNannyFinishContext();
8685 return NULL;
8686 __pyx_L4_argument_unpacking_done:;
8687 __pyx_r = __pyx_pf_10Isosurface_10Isosurface_4attachHDF5(__pyx_self, __pyx_v_self, __pyx_v_h5, __pyx_v_step, __pyx_v_cam);
8688
8689 /* function exit code */
8690 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
8691 Py_XDECREF(values[__pyx_temp]);
8692 }
8693 __Pyx_RefNannyFinishContext();
8694 return __pyx_r;
8695}
8696
8697static 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) {
8698 PyObject *__pyx_v_namedtuple = NULL;
8699 PyObject *__pyx_v_FemField = NULL;
8700 PyObject *__pyx_v_field_i = NULL;
8701 CYTHON_UNUSED PyObject *__pyx_v_field = NULL;
8702 PyObject *__pyx_8genexpr1__pyx_v_isosurface = NULL;
8703 PyObject *__pyx_r = NULL;
8704 __Pyx_RefNannyDeclarations
8705 PyObject *__pyx_t_1 = NULL;
8706 PyObject *__pyx_t_2 = NULL;
8707 Py_ssize_t __pyx_t_3;
8708 PyObject *__pyx_t_4 = NULL;
8709 PyObject *__pyx_t_5 = NULL;
8710 PyObject *(*__pyx_t_6)(PyObject *);
8711 size_t __pyx_t_7;
8712 PyObject *__pyx_t_8 = NULL;
8713 PyObject *__pyx_t_9 = NULL;
8714 PyObject *__pyx_t_10 = NULL;
8715 PyObject *__pyx_t_11 = NULL;
8716 PyObject *__pyx_t_12 = NULL;
8717 int __pyx_t_13;
8718 int __pyx_lineno = 0;
8719 const char *__pyx_filename = NULL;
8720 int __pyx_clineno = 0;
8721 __Pyx_RefNannySetupContext("attachHDF5", 0);
8722
8723 /* "Isosurface.pyx":136
8724 * Attach this isosurface to and HDF5 archive (an h5py.File)
8725 * """
8726 * from collections import namedtuple # <<<<<<<<<<<<<<
8727 * self.fieldNames = [isosurface[0] for isosurface in self.isosurfaces]
8728 * print("ATTACHING TO HDF5 !!", self.fieldNames)
8729*/
8730 {
8731 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_namedtuple};
8732 __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_collections, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error)
8733 }
8734 __pyx_t_1 = __pyx_t_2;
8735 __Pyx_GOTREF(__pyx_t_1);
8736 {
8737 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_namedtuple};
8738 __pyx_t_3 = 0; {
8739 __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_1, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error)
8740 __Pyx_GOTREF(__pyx_t_4);
8741 switch (__pyx_t_3) {
8742 case 0:
8743 __Pyx_INCREF(__pyx_t_4);
8744 __pyx_v_namedtuple = __pyx_t_4;
8745 break;
8746 default:;
8747 }
8748 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8749 }
8750 }
8751 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8752
8753 /* "Isosurface.pyx":137
8754 * """
8755 * from collections import namedtuple
8756 * self.fieldNames = [isosurface[0] for isosurface in self.isosurfaces] # <<<<<<<<<<<<<<
8757 * print("ATTACHING TO HDF5 !!", self.fieldNames)
8758 * self.elementNodesArray = h5["/elementsSpatial_Domain" + repr(step)][:]
8759*/
8760 { /* enter inner scope */
8761 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L5_error)
8762 __Pyx_GOTREF(__pyx_t_1);
8763 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_isosurfaces); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L5_error)
8764 __Pyx_GOTREF(__pyx_t_4);
8765 if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
8766 __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5);
8767 __pyx_t_3 = 0;
8768 __pyx_t_6 = NULL;
8769 } else {
8770 __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L5_error)
8771 __Pyx_GOTREF(__pyx_t_5);
8772 __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 137, __pyx_L5_error)
8773 }
8774 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8775 for (;;) {
8776 if (likely(!__pyx_t_6)) {
8777 if (likely(PyList_CheckExact(__pyx_t_5))) {
8778 {
8779 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5);
8780 #if !CYTHON_ASSUME_SAFE_SIZE
8781 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 137, __pyx_L5_error)
8782 #endif
8783 if (__pyx_t_3 >= __pyx_temp) break;
8784 }
8785 __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_5, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
8786 ++__pyx_t_3;
8787 } else {
8788 {
8789 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
8790 #if !CYTHON_ASSUME_SAFE_SIZE
8791 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 137, __pyx_L5_error)
8792 #endif
8793 if (__pyx_t_3 >= __pyx_temp) break;
8794 }
8795 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8796 __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3));
8797 #else
8798 __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_3);
8799 #endif
8800 ++__pyx_t_3;
8801 }
8802 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L5_error)
8803 } else {
8804 __pyx_t_4 = __pyx_t_6(__pyx_t_5);
8805 if (unlikely(!__pyx_t_4)) {
8806 PyObject* exc_type = PyErr_Occurred();
8807 if (exc_type) {
8808 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 137, __pyx_L5_error)
8809 PyErr_Clear();
8810 }
8811 break;
8812 }
8813 }
8814 __Pyx_GOTREF(__pyx_t_4);
8815 __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_isosurface, __pyx_t_4);
8816 __pyx_t_4 = 0;
8817 __pyx_t_4 = __Pyx_GetItemInt(__pyx_8genexpr1__pyx_v_isosurface, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L5_error)
8818 __Pyx_GOTREF(__pyx_t_4);
8819 __Pyx_GIVEREF(__pyx_t_4);
8820 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_1, __pyx_t_4))) __PYX_ERR(0, 137, __pyx_L5_error)
8821 __pyx_t_4 = 0;
8822 }
8823 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8824 __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_isosurface); __pyx_8genexpr1__pyx_v_isosurface = 0;
8825 goto __pyx_L9_exit_scope;
8826 __pyx_L5_error:;
8827 __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_isosurface); __pyx_8genexpr1__pyx_v_isosurface = 0;
8828 goto __pyx_L1_error;
8829 __pyx_L9_exit_scope:;
8830 } /* exit inner scope */
8831 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_fieldNames, __pyx_t_1) < (0)) __PYX_ERR(0, 137, __pyx_L1_error)
8832 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8833
8834 /* "Isosurface.pyx":138
8835 * from collections import namedtuple
8836 * self.fieldNames = [isosurface[0] for isosurface in self.isosurfaces]
8837 * print("ATTACHING TO HDF5 !!", self.fieldNames) # <<<<<<<<<<<<<<
8838 * self.elementNodesArray = h5["/elementsSpatial_Domain" + repr(step)][:]
8839 * self.nodeArray = h5["/nodesSpatial_Domain" + repr(step)][:]
8840*/
8841 __pyx_t_5 = NULL;
8842 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_fieldNames); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __pyx_L1_error)
8843 __Pyx_GOTREF(__pyx_t_4);
8844 __pyx_t_7 = 1;
8845 {
8846 PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_ATTACHING_TO_HDF5, __pyx_t_4};
8847 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
8848 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8849 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8850 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error)
8851 __Pyx_GOTREF(__pyx_t_1);
8852 }
8853 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8854
8855 /* "Isosurface.pyx":139
8856 * self.fieldNames = [isosurface[0] for isosurface in self.isosurfaces]
8857 * print("ATTACHING TO HDF5 !!", self.fieldNames)
8858 * self.elementNodesArray = h5["/elementsSpatial_Domain" + repr(step)][:] # <<<<<<<<<<<<<<
8859 * self.nodeArray = h5["/nodesSpatial_Domain" + repr(step)][:]
8860 * self.num_owned_elements = len(self.elementNodesArray)
8861*/
8862 __pyx_t_1 = PyObject_Repr(__pyx_v_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
8863 __Pyx_GOTREF(__pyx_t_1);
8864 __pyx_t_4 = __Pyx_PyUnicode_ConcatSafe(__pyx_mstate_global->__pyx_kp_u_elementsSpatial_Domain, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error)
8865 __Pyx_GOTREF(__pyx_t_4);
8866 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8867 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_h5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
8868 __Pyx_GOTREF(__pyx_t_1);
8869 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8870 __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error)
8871 __Pyx_GOTREF(__pyx_t_4);
8872 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8873 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_elementNodesArray, __pyx_t_4) < (0)) __PYX_ERR(0, 139, __pyx_L1_error)
8874 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8875
8876 /* "Isosurface.pyx":140
8877 * print("ATTACHING TO HDF5 !!", self.fieldNames)
8878 * self.elementNodesArray = h5["/elementsSpatial_Domain" + repr(step)][:]
8879 * self.nodeArray = h5["/nodesSpatial_Domain" + repr(step)][:] # <<<<<<<<<<<<<<
8880 * self.num_owned_elements = len(self.elementNodesArray)
8881 * self.u = {}
8882*/
8883 __pyx_t_4 = PyObject_Repr(__pyx_v_step); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error)
8884 __Pyx_GOTREF(__pyx_t_4);
8885 __pyx_t_1 = __Pyx_PyUnicode_ConcatSafe(__pyx_mstate_global->__pyx_kp_u_nodesSpatial_Domain, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
8886 __Pyx_GOTREF(__pyx_t_1);
8887 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8888 __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_h5, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error)
8889 __Pyx_GOTREF(__pyx_t_4);
8890 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8891 __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
8892 __Pyx_GOTREF(__pyx_t_1);
8893 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8894 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray, __pyx_t_1) < (0)) __PYX_ERR(0, 140, __pyx_L1_error)
8895 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8896
8897 /* "Isosurface.pyx":141
8898 * self.elementNodesArray = h5["/elementsSpatial_Domain" + repr(step)][:]
8899 * self.nodeArray = h5["/nodesSpatial_Domain" + repr(step)][:]
8900 * self.num_owned_elements = len(self.elementNodesArray) # <<<<<<<<<<<<<<
8901 * self.u = {}
8902 * FemField = namedtuple('FemField', ['dof'])
8903*/
8904 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_elementNodesArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
8905 __Pyx_GOTREF(__pyx_t_1);
8906 __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 141, __pyx_L1_error)
8907 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8908 __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
8909 __Pyx_GOTREF(__pyx_t_1);
8910
8911 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_num_owned_elements, __pyx_t_1) < (0)) __PYX_ERR(0, 141, __pyx_L1_error)
8912 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8913
8914 /* "Isosurface.pyx":142
8915 * self.nodeArray = h5["/nodesSpatial_Domain" + repr(step)][:]
8916 * self.num_owned_elements = len(self.elementNodesArray)
8917 * self.u = {} # <<<<<<<<<<<<<<
8918 * FemField = namedtuple('FemField', ['dof'])
8919 * for field_i, field in enumerate(self.fieldNames):
8920*/
8921 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error)
8922 __Pyx_GOTREF(__pyx_t_1);
8923 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_u, __pyx_t_1) < (0)) __PYX_ERR(0, 142, __pyx_L1_error)
8924 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8925
8926 /* "Isosurface.pyx":143
8927 * self.num_owned_elements = len(self.elementNodesArray)
8928 * self.u = {}
8929 * FemField = namedtuple('FemField', ['dof']) # <<<<<<<<<<<<<<
8930 * for field_i, field in enumerate(self.fieldNames):
8931 * self.u[field_i] = FemField(dof=h5["/" +
8932*/
8933 __pyx_t_4 = NULL;
8934 __Pyx_INCREF(__pyx_v_namedtuple);
8935 __pyx_t_5 = __pyx_v_namedtuple;
8936 __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 143, __pyx_L1_error)
8937 __Pyx_GOTREF(__pyx_t_8);
8938 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_dof);
8939 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_dof);
8940 if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_mstate_global->__pyx_n_u_dof) != (0)) __PYX_ERR(0, 143, __pyx_L1_error);
8941 __pyx_t_7 = 1;
8942 #if CYTHON_UNPACK_METHODS
8943 if (unlikely(PyMethod_Check(__pyx_t_5))) {
8944 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
8945 assert(__pyx_t_4);
8946 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
8947 __Pyx_INCREF(__pyx_t_4);
8948 __Pyx_INCREF(__pyx__function);
8949 __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
8950 __pyx_t_7 = 0;
8951 }
8952 #endif
8953 {
8954 PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FemField, __pyx_t_8};
8955 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
8956 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8957 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8958 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8959 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
8960 __Pyx_GOTREF(__pyx_t_1);
8961 }
8962 __pyx_v_FemField = __pyx_t_1;
8963 __pyx_t_1 = 0;
8964
8965 /* "Isosurface.pyx":144
8966 * self.u = {}
8967 * FemField = namedtuple('FemField', ['dof'])
8968 * for field_i, field in enumerate(self.fieldNames): # <<<<<<<<<<<<<<
8969 * self.u[field_i] = FemField(dof=h5["/" +
8970 * self.isosurfaces[0][0] +
8971*/
8972 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
8973 __pyx_t_1 = __pyx_mstate_global->__pyx_int_0;
8974 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_fieldNames); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error)
8975 __Pyx_GOTREF(__pyx_t_5);
8976 if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
8977 __pyx_t_8 = __pyx_t_5; __Pyx_INCREF(__pyx_t_8);
8978 __pyx_t_3 = 0;
8979 __pyx_t_6 = NULL;
8980 } else {
8981 __pyx_t_3 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 144, __pyx_L1_error)
8982 __Pyx_GOTREF(__pyx_t_8);
8983 __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 144, __pyx_L1_error)
8984 }
8985 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8986 for (;;) {
8987 if (likely(!__pyx_t_6)) {
8988 if (likely(PyList_CheckExact(__pyx_t_8))) {
8989 {
8990 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8);
8991 #if !CYTHON_ASSUME_SAFE_SIZE
8992 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 144, __pyx_L1_error)
8993 #endif
8994 if (__pyx_t_3 >= __pyx_temp) break;
8995 }
8996 __pyx_t_5 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_8, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
8997 ++__pyx_t_3;
8998 } else {
8999 {
9000 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8);
9001 #if !CYTHON_ASSUME_SAFE_SIZE
9002 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 144, __pyx_L1_error)
9003 #endif
9004 if (__pyx_t_3 >= __pyx_temp) break;
9005 }
9006 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9007 __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_3));
9008 #else
9009 __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_3);
9010 #endif
9011 ++__pyx_t_3;
9012 }
9013 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error)
9014 } else {
9015 __pyx_t_5 = __pyx_t_6(__pyx_t_8);
9016 if (unlikely(!__pyx_t_5)) {
9017 PyObject* exc_type = PyErr_Occurred();
9018 if (exc_type) {
9019 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 144, __pyx_L1_error)
9020 PyErr_Clear();
9021 }
9022 break;
9023 }
9024 }
9025 __Pyx_GOTREF(__pyx_t_5);
9026 __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_5);
9027 __pyx_t_5 = 0;
9028 __Pyx_INCREF(__pyx_t_1);
9029 __Pyx_XDECREF_SET(__pyx_v_field_i, __pyx_t_1);
9030 __pyx_t_5 = __Pyx_PyLong_AddObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error)
9031 __Pyx_GOTREF(__pyx_t_5);
9032 __Pyx_DECREF(__pyx_t_1);
9033 __pyx_t_1 = __pyx_t_5;
9034 __pyx_t_5 = 0;
9035
9036 /* "Isosurface.pyx":145
9037 * FemField = namedtuple('FemField', ['dof'])
9038 * for field_i, field in enumerate(self.fieldNames):
9039 * self.u[field_i] = FemField(dof=h5["/" + # <<<<<<<<<<<<<<
9040 * self.isosurfaces[0][0] +
9041 * repr(step)][:])
9042*/
9043 __pyx_t_4 = NULL;
9044 __Pyx_INCREF(__pyx_v_FemField);
9045 __pyx_t_9 = __pyx_v_FemField;
9046
9047 /* "Isosurface.pyx":146
9048 * for field_i, field in enumerate(self.fieldNames):
9049 * self.u[field_i] = FemField(dof=h5["/" +
9050 * self.isosurfaces[0][0] + # <<<<<<<<<<<<<<
9051 * repr(step)][:])
9052 * self.nFrames = step
9053*/
9054 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_isosurfaces); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 146, __pyx_L1_error)
9055 __Pyx_GOTREF(__pyx_t_10);
9056 __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 146, __pyx_L1_error)
9057 __Pyx_GOTREF(__pyx_t_11);
9058 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9059 __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_11, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 146, __pyx_L1_error)
9060 __Pyx_GOTREF(__pyx_t_10);
9061 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
9062
9063 /* "Isosurface.pyx":145
9064 * FemField = namedtuple('FemField', ['dof'])
9065 * for field_i, field in enumerate(self.fieldNames):
9066 * self.u[field_i] = FemField(dof=h5["/" + # <<<<<<<<<<<<<<
9067 * self.isosurfaces[0][0] +
9068 * repr(step)][:])
9069*/
9070 __pyx_t_11 = PyNumber_Add(__pyx_mstate_global->__pyx_kp_u__3, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 145, __pyx_L1_error)
9071 __Pyx_GOTREF(__pyx_t_11);
9072 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9073
9074 /* "Isosurface.pyx":147
9075 * self.u[field_i] = FemField(dof=h5["/" +
9076 * self.isosurfaces[0][0] +
9077 * repr(step)][:]) # <<<<<<<<<<<<<<
9078 * self.nFrames = step
9079 * self.next_output = 0
9080*/
9081 __pyx_t_10 = PyObject_Repr(__pyx_v_step); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 147, __pyx_L1_error)
9082 __Pyx_GOTREF(__pyx_t_10);
9083
9084 /* "Isosurface.pyx":146
9085 * for field_i, field in enumerate(self.fieldNames):
9086 * self.u[field_i] = FemField(dof=h5["/" +
9087 * self.isosurfaces[0][0] + # <<<<<<<<<<<<<<
9088 * repr(step)][:])
9089 * self.nFrames = step
9090*/
9091 __pyx_t_12 = PyNumber_Add(__pyx_t_11, __pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 146, __pyx_L1_error)
9092 __Pyx_GOTREF(__pyx_t_12);
9093 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
9094 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9095
9096 /* "Isosurface.pyx":145
9097 * FemField = namedtuple('FemField', ['dof'])
9098 * for field_i, field in enumerate(self.fieldNames):
9099 * self.u[field_i] = FemField(dof=h5["/" + # <<<<<<<<<<<<<<
9100 * self.isosurfaces[0][0] +
9101 * repr(step)][:])
9102*/
9103 __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_v_h5, __pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 145, __pyx_L1_error)
9104 __Pyx_GOTREF(__pyx_t_10);
9105 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
9106
9107 /* "Isosurface.pyx":147
9108 * self.u[field_i] = FemField(dof=h5["/" +
9109 * self.isosurfaces[0][0] +
9110 * repr(step)][:]) # <<<<<<<<<<<<<<
9111 * self.nFrames = step
9112 * self.next_output = 0
9113*/
9114 __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_t_10, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 147, __pyx_L1_error)
9115 __Pyx_GOTREF(__pyx_t_12);
9116 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9117 __pyx_t_7 = 1;
9118 #if CYTHON_UNPACK_METHODS
9119 if (unlikely(PyMethod_Check(__pyx_t_9))) {
9120 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9);
9121 assert(__pyx_t_4);
9122 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
9123 __Pyx_INCREF(__pyx_t_4);
9124 __Pyx_INCREF(__pyx__function);
9125 __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
9126 __pyx_t_7 = 0;
9127 }
9128 #endif
9129 {
9130 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_12};
9131 #if CYTHON_VECTORCALL
9132 __pyx_t_10 = __pyx_mstate_global->__pyx_tuple[2];
9133 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 145, __pyx_L1_error)
9134 __Pyx_INCREF(__pyx_t_10);
9135 #else
9136 {
9137 PyObject *__pyx_temp[1] = {__pyx_mstate_global->__pyx_n_u_dof};
9138 __pyx_t_10 = __Pyx_MakeKwargDict(__pyx_temp, __pyx_callargs+1, 1);
9139 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 145, __pyx_L1_error)
9140 __Pyx_GOTREF(__pyx_t_10);
9141 }
9142 #endif
9143 __pyx_t_5 = __Pyx_Object_VectorcallKwds((PyObject*)__pyx_t_9, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_10);
9144 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9145 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
9146 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
9147 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9148 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 145, __pyx_L1_error)
9149 __Pyx_GOTREF(__pyx_t_5);
9150 }
9151
9152 /* "Isosurface.pyx":145
9153 * FemField = namedtuple('FemField', ['dof'])
9154 * for field_i, field in enumerate(self.fieldNames):
9155 * self.u[field_i] = FemField(dof=h5["/" + # <<<<<<<<<<<<<<
9156 * self.isosurfaces[0][0] +
9157 * repr(step)][:])
9158*/
9159 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_u); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 145, __pyx_L1_error)
9160 __Pyx_GOTREF(__pyx_t_9);
9161 if (unlikely((PyObject_SetItem(__pyx_t_9, __pyx_v_field_i, __pyx_t_5) < 0))) __PYX_ERR(0, 145, __pyx_L1_error)
9162 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9163 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9164
9165 /* "Isosurface.pyx":144
9166 * self.u = {}
9167 * FemField = namedtuple('FemField', ['dof'])
9168 * for field_i, field in enumerate(self.fieldNames): # <<<<<<<<<<<<<<
9169 * self.u[field_i] = FemField(dof=h5["/" +
9170 * self.isosurfaces[0][0] +
9171*/
9172 }
9173 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9174 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9175
9176 /* "Isosurface.pyx":148
9177 * self.isosurfaces[0][0] +
9178 * repr(step)][:])
9179 * self.nFrames = step # <<<<<<<<<<<<<<
9180 * self.next_output = 0
9181 * if step == 0:
9182*/
9183 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nFrames, __pyx_v_step) < (0)) __PYX_ERR(0, 148, __pyx_L1_error)
9184
9185 /* "Isosurface.pyx":149
9186 * repr(step)][:])
9187 * self.nFrames = step
9188 * self.next_output = 0 # <<<<<<<<<<<<<<
9189 * if step == 0:
9190 * self.writeSceneHeader(cam)
9191*/
9192 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_next_output, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(0, 149, __pyx_L1_error)
9193
9194 /* "Isosurface.pyx":150
9195 * self.nFrames = step
9196 * self.next_output = 0
9197 * if step == 0: # <<<<<<<<<<<<<<
9198 * self.writeSceneHeader(cam)
9199 * return self
9200*/
9201 __pyx_t_13 = (__Pyx_PyLong_BoolEqObjC(__pyx_v_step, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 150, __pyx_L1_error)
9202 if (__pyx_t_13) {
9203
9204
9205 /* "Isosurface.pyx":151
9206 * self.next_output = 0
9207 * if step == 0:
9208 * self.writeSceneHeader(cam) # <<<<<<<<<<<<<<
9209 * return self
9210 *
9211*/
9212 __pyx_t_8 = __pyx_v_self;
9213 __Pyx_INCREF(__pyx_t_8);
9214 __pyx_t_7 = 0;
9215 {
9216 PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_cam};
9217 __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_writeSceneHeader, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
9218 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
9219 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
9220 __Pyx_GOTREF(__pyx_t_1);
9221 }
9222 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9223
9224 /* "Isosurface.pyx":150
9225 * self.nFrames = step
9226 * self.next_output = 0
9227 * if step == 0: # <<<<<<<<<<<<<<
9228 * self.writeSceneHeader(cam)
9229 * return self
9230*/
9231 }
9232
9233 /* "Isosurface.pyx":152
9234 * if step == 0:
9235 * self.writeSceneHeader(cam)
9236 * return self # <<<<<<<<<<<<<<
9237 *
9238 * def triangulateIsosurface(self, field, value):
9239*/
9240 {
9241 PyObject *__pyx_temp;
9242 {
9243 __pyx_temp = __pyx_r;
9244 __Pyx_INCREF(__pyx_v_self);
9245 __pyx_r = __pyx_v_self;
9246 }
9247 __Pyx_XDECREF(__pyx_temp);
9248 }
9249 goto __pyx_L0;
9250
9251 /* "Isosurface.pyx":132
9252 * return self
9253 *
9254 * def attachHDF5(self, h5, step, cam=None): # <<<<<<<<<<<<<<
9255 * """
9256 * Attach this isosurface to and HDF5 archive (an h5py.File)
9257*/
9258
9259 /* function exit code */
9260 __pyx_L1_error:;
9261 __Pyx_XDECREF(__pyx_t_1);
9262 __Pyx_XDECREF(__pyx_t_4);
9263 __Pyx_XDECREF(__pyx_t_5);
9264 __Pyx_XDECREF(__pyx_t_8);
9265 __Pyx_XDECREF(__pyx_t_9);
9266 __Pyx_XDECREF(__pyx_t_10);
9267 __Pyx_XDECREF(__pyx_t_11);
9268 __Pyx_XDECREF(__pyx_t_12);
9269 __Pyx_AddTraceback("Isosurface.Isosurface.attachHDF5", __pyx_clineno, __pyx_lineno, __pyx_filename);
9270 __pyx_r = NULL;
9271 __pyx_L0:;
9272 __Pyx_XDECREF(__pyx_v_namedtuple);
9273 __Pyx_XDECREF(__pyx_v_FemField);
9274 __Pyx_XDECREF(__pyx_v_field_i);
9275 __Pyx_XDECREF(__pyx_v_field);
9276 __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_isosurface);
9277 __Pyx_XGIVEREF(__pyx_r);
9278 __Pyx_RefNannyFinishContext();
9279 return __pyx_r;
9280}
9281
9282/* "Isosurface.pyx":154
9283 * return self
9284 *
9285 * def triangulateIsosurface(self, field, value): # <<<<<<<<<<<<<<
9286 * """
9287 * Build a triangular mesh of the isosurface
9288*/
9289
9290/* Python wrapper */
9291static PyObject *__pyx_pw_10Isosurface_10Isosurface_7triangulateIsosurface(PyObject *__pyx_self,
9292#if CYTHON_VECTORCALL
9293PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
9294#else
9295PyObject *__pyx_args, PyObject *__pyx_kwds
9296#endif
9297); /*proto*/
9298PyDoc_STRVAR(__pyx_doc_10Isosurface_10Isosurface_6triangulateIsosurface, "Isosurface.triangulateIsosurface(self, field, value)\n\nBuild a triangular mesh of the isosurface");
9299static PyMethodDef __pyx_mdef_10Isosurface_10Isosurface_7triangulateIsosurface = {"triangulateIsosurface", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10Isosurface_10Isosurface_7triangulateIsosurface, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10Isosurface_10Isosurface_6triangulateIsosurface};
9300static PyObject *__pyx_pw_10Isosurface_10Isosurface_7triangulateIsosurface(PyObject *__pyx_self,
9301#if CYTHON_VECTORCALL
9302PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
9303#else
9304PyObject *__pyx_args, PyObject *__pyx_kwds
9305#endif
9306) {
9307 PyObject *__pyx_v_self = 0;
9308 PyObject *__pyx_v_field = 0;
9309 PyObject *__pyx_v_value = 0;
9310 #if !CYTHON_VECTORCALL
9311 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
9312 #endif
9313 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
9314 PyObject* values[3] = {0,0,0};
9315 int __pyx_lineno = 0;
9316 const char *__pyx_filename = NULL;
9317 int __pyx_clineno = 0;
9318 PyObject *__pyx_r = 0;
9319 __Pyx_RefNannyDeclarations
9320 __Pyx_RefNannySetupContext("triangulateIsosurface (wrapper)", 0);
9321 #if !CYTHON_VECTORCALL
9322 #if CYTHON_ASSUME_SAFE_SIZE
9323 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
9324 #else
9325 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
9326 #endif
9327 #endif
9328 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
9329 {
9330 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_field,&__pyx_mstate_global->__pyx_n_u_value,0};
9331 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
9332 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 154, __pyx_L3_error)
9333 if (__pyx_kwds_len > 0) {
9334 switch (__pyx_nargs) {
9335 case 3:
9336 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
9337 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 154, __pyx_L3_error)
9338 CYTHON_FALLTHROUGH;
9339 case 2:
9340 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
9341 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 154, __pyx_L3_error)
9342 CYTHON_FALLTHROUGH;
9343 case 1:
9344 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
9345 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 154, __pyx_L3_error)
9346 CYTHON_FALLTHROUGH;
9347 case 0: break;
9348 default: goto __pyx_L5_argtuple_error;
9349 }
9350 const Py_ssize_t kwd_pos_args = __pyx_nargs;
9351 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "triangulateIsosurface", 0) < (0)) __PYX_ERR(0, 154, __pyx_L3_error)
9352 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
9353 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("triangulateIsosurface", 1, 3, 3, i); __PYX_ERR(0, 154, __pyx_L3_error) }
9354 }
9355 } else if (unlikely(__pyx_nargs != 3)) {
9356 goto __pyx_L5_argtuple_error;
9357 } else {
9358 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
9359 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 154, __pyx_L3_error)
9360 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
9361 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 154, __pyx_L3_error)
9362 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
9363 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 154, __pyx_L3_error)
9364 }
9365 __pyx_v_self = values[0];
9366 __pyx_v_field = values[1];
9367 __pyx_v_value = values[2];
9368 }
9369 goto __pyx_L6_skip;
9370 __pyx_L5_argtuple_error:;
9371 __Pyx_RaiseArgtupleInvalid("triangulateIsosurface", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 154, __pyx_L3_error)
9372 __pyx_L6_skip:;
9373 goto __pyx_L4_argument_unpacking_done;
9374 __pyx_L3_error:;
9375 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
9376 Py_XDECREF(values[__pyx_temp]);
9377 }
9378 __Pyx_AddTraceback("Isosurface.Isosurface.triangulateIsosurface", __pyx_clineno, __pyx_lineno, __pyx_filename);
9379 __Pyx_RefNannyFinishContext();
9380 return NULL;
9381 __pyx_L4_argument_unpacking_done:;
9382 __pyx_r = __pyx_pf_10Isosurface_10Isosurface_6triangulateIsosurface(__pyx_self, __pyx_v_self, __pyx_v_field, __pyx_v_value);
9383
9384 /* function exit code */
9385 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
9386 Py_XDECREF(values[__pyx_temp]);
9387 }
9388 __Pyx_RefNannyFinishContext();
9389 return __pyx_r;
9390}
9391
9392static PyObject *__pyx_pf_10Isosurface_10Isosurface_6triangulateIsosurface(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_value) {
9393 int __pyx_v_eN;
9394 int __pyx_v_i;
9395 int __pyx_v_J;
9396 int __pyx_v_I;
9397 int __pyx_v_nMinus;
9398 int __pyx_v_nPlus;
9399 int __pyx_v_nZeros;
9400 int __pyx_v_nN_start;
9401 double __pyx_v_eps;
9402 double __pyx_v_s;
9403 PyArrayObject *__pyx_v_x = 0;
9404 PyArrayObject *__pyx_v_normal = 0;
9405 PyObject *__pyx_v_nodes = NULL;
9406 PyObject *__pyx_v_elements = NULL;
9407 PyObject *__pyx_v_normals = NULL;
9408 PyObject *__pyx_v_normal_indices = NULL;
9409 PyObject *__pyx_v_phi = NULL;
9410 PyObject *__pyx_v_plus = NULL;
9411 PyObject *__pyx_v_minus = NULL;
9412 PyObject *__pyx_v_zeros = NULL;
9413 long __pyx_8genexpr2__pyx_v_j;
9414 long __pyx_8genexpr3__pyx_v_j;
9415 long __pyx_8genexpr4__pyx_v_j;
9416 long __pyx_8genexpr5__pyx_v_j;
9417 long __pyx_8genexpr6__pyx_v_j;
9418 long __pyx_8genexpr7__pyx_v_j;
9419 long __pyx_8genexpr8__pyx_v_j;
9420 __Pyx_LocalBuf_ND __pyx_pybuffernd_normal;
9421 __Pyx_Buffer __pyx_pybuffer_normal;
9422 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
9423 __Pyx_Buffer __pyx_pybuffer_x;
9424 PyObject *__pyx_r = NULL;
9425 __Pyx_RefNannyDeclarations
9426 PyObject *__pyx_t_1 = NULL;
9427 PyObject *__pyx_t_2 = NULL;
9428 PyObject *__pyx_t_3 = NULL;
9429 int __pyx_t_4;
9430 size_t __pyx_t_5;
9431 PyObject *__pyx_t_6 = NULL;
9432 Py_ssize_t __pyx_t_7;
9433 Py_ssize_t __pyx_t_8;
9434 int __pyx_t_9;
9435 int __pyx_t_10;
9436 int __pyx_t_11;
9437 int __pyx_t_12;
9438 Py_ssize_t __pyx_t_13;
9439 int __pyx_t_14;
9440 Py_ssize_t __pyx_t_15;
9441 PyObject *__pyx_t_16 = NULL;
9442 PyObject *__pyx_t_17 = NULL;
9443 double __pyx_t_18;
9444 PyObject *__pyx_t_19 = NULL;
9445 PyObject *__pyx_t_20 = NULL;
9446 PyObject *__pyx_t_21 = NULL;
9447 long __pyx_t_22;
9448 int __pyx_lineno = 0;
9449 const char *__pyx_filename = NULL;
9450 int __pyx_clineno = 0;
9451 __Pyx_RefNannySetupContext("triangulateIsosurface", 0);
9452 __pyx_pybuffer_x.pybuffer.buf = NULL;
9453 __pyx_pybuffer_x.refcount = 0;
9454 __pyx_pybuffernd_x.data = NULL;
9455 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
9456 __pyx_pybuffer_normal.pybuffer.buf = NULL;
9457 __pyx_pybuffer_normal.refcount = 0;
9458 __pyx_pybuffernd_normal.data = NULL;
9459 __pyx_pybuffernd_normal.rcbuffer = &__pyx_pybuffer_normal;
9460
9461 /* "Isosurface.pyx":161
9462 * cdef double eps, s
9463 * cdef np.ndarray[np.float64_t, ndim=1] x, normal
9464 * self.nodes[(field, value)] = nodes = [] # <<<<<<<<<<<<<<
9465 * self.elements[(field, value)] = elements = []
9466 * self.normals[(field, value)] = normals = []
9467*/
9468 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
9469 __Pyx_GOTREF(__pyx_t_1);
9470 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error)
9471 __Pyx_GOTREF(__pyx_t_2);
9472 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error)
9473 __Pyx_GOTREF(__pyx_t_3);
9474 __Pyx_INCREF(__pyx_v_field);
9475 __Pyx_GIVEREF(__pyx_v_field);
9476 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_field) != (0)) __PYX_ERR(0, 161, __pyx_L1_error);
9477 __Pyx_INCREF(__pyx_v_value);
9478 __Pyx_GIVEREF(__pyx_v_value);
9479 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_value) != (0)) __PYX_ERR(0, 161, __pyx_L1_error);
9480 if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_t_3, __pyx_t_1) < 0))) __PYX_ERR(0, 161, __pyx_L1_error)
9481 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9482 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9483 __Pyx_INCREF(__pyx_t_1);
9484 __pyx_v_nodes = __pyx_t_1;
9485 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9486
9487 /* "Isosurface.pyx":162
9488 * cdef np.ndarray[np.float64_t, ndim=1] x, normal
9489 * self.nodes[(field, value)] = nodes = []
9490 * self.elements[(field, value)] = elements = [] # <<<<<<<<<<<<<<
9491 * self.normals[(field, value)] = normals = []
9492 * self.normal_indices[(field, value)] = normal_indices = []
9493*/
9494 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
9495 __Pyx_GOTREF(__pyx_t_1);
9496 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_elements); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error)
9497 __Pyx_GOTREF(__pyx_t_3);
9498 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error)
9499 __Pyx_GOTREF(__pyx_t_2);
9500 __Pyx_INCREF(__pyx_v_field);
9501 __Pyx_GIVEREF(__pyx_v_field);
9502 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_field) != (0)) __PYX_ERR(0, 162, __pyx_L1_error);
9503 __Pyx_INCREF(__pyx_v_value);
9504 __Pyx_GIVEREF(__pyx_v_value);
9505 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_value) != (0)) __PYX_ERR(0, 162, __pyx_L1_error);
9506 if (unlikely((PyObject_SetItem(__pyx_t_3, __pyx_t_2, __pyx_t_1) < 0))) __PYX_ERR(0, 162, __pyx_L1_error)
9507 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9508 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9509 __Pyx_INCREF(__pyx_t_1);
9510 __pyx_v_elements = __pyx_t_1;
9511 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9512
9513 /* "Isosurface.pyx":163
9514 * self.nodes[(field, value)] = nodes = []
9515 * self.elements[(field, value)] = elements = []
9516 * self.normals[(field, value)] = normals = [] # <<<<<<<<<<<<<<
9517 * self.normal_indices[(field, value)] = normal_indices = []
9518 * if value != 0.0:
9519*/
9520 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
9521 __Pyx_GOTREF(__pyx_t_1);
9522 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_normals); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
9523 __Pyx_GOTREF(__pyx_t_2);
9524 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
9525 __Pyx_GOTREF(__pyx_t_3);
9526 __Pyx_INCREF(__pyx_v_field);
9527 __Pyx_GIVEREF(__pyx_v_field);
9528 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_field) != (0)) __PYX_ERR(0, 163, __pyx_L1_error);
9529 __Pyx_INCREF(__pyx_v_value);
9530 __Pyx_GIVEREF(__pyx_v_value);
9531 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_value) != (0)) __PYX_ERR(0, 163, __pyx_L1_error);
9532 if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_t_3, __pyx_t_1) < 0))) __PYX_ERR(0, 163, __pyx_L1_error)
9533 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9534 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9535 __Pyx_INCREF(__pyx_t_1);
9536 __pyx_v_normals = __pyx_t_1;
9537 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9538
9539 /* "Isosurface.pyx":164
9540 * self.elements[(field, value)] = elements = []
9541 * self.normals[(field, value)] = normals = []
9542 * self.normal_indices[(field, value)] = normal_indices = [] # <<<<<<<<<<<<<<
9543 * if value != 0.0:
9544 * raise NotImplementedError("Only zero isocontour extraction")
9545*/
9546 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error)
9547 __Pyx_GOTREF(__pyx_t_1);
9548 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_normal_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
9549 __Pyx_GOTREF(__pyx_t_3);
9550 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error)
9551 __Pyx_GOTREF(__pyx_t_2);
9552 __Pyx_INCREF(__pyx_v_field);
9553 __Pyx_GIVEREF(__pyx_v_field);
9554 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_field) != (0)) __PYX_ERR(0, 164, __pyx_L1_error);
9555 __Pyx_INCREF(__pyx_v_value);
9556 __Pyx_GIVEREF(__pyx_v_value);
9557 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_value) != (0)) __PYX_ERR(0, 164, __pyx_L1_error);
9558 if (unlikely((PyObject_SetItem(__pyx_t_3, __pyx_t_2, __pyx_t_1) < 0))) __PYX_ERR(0, 164, __pyx_L1_error)
9559 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9560 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9561 __Pyx_INCREF(__pyx_t_1);
9562 __pyx_v_normal_indices = __pyx_t_1;
9563 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9564
9565 /* "Isosurface.pyx":165
9566 * self.normals[(field, value)] = normals = []
9567 * self.normal_indices[(field, value)] = normal_indices = []
9568 * if value != 0.0: # <<<<<<<<<<<<<<
9569 * raise NotImplementedError("Only zero isocontour extraction")
9570 * phi = self.u[self.fieldNames.index(field)].dof
9571*/
9572 __pyx_t_4 = (__Pyx_PyFloat_BoolNeObjC(__pyx_v_value, __pyx_mstate_global->__pyx_float_0_0, 0.0, 0, 0)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 165, __pyx_L1_error)
9573 if (unlikely(__pyx_t_4)) {
9574
9575
9576 /* "Isosurface.pyx":166
9577 * self.normal_indices[(field, value)] = normal_indices = []
9578 * if value != 0.0:
9579 * raise NotImplementedError("Only zero isocontour extraction") # <<<<<<<<<<<<<<
9580 * phi = self.u[self.fieldNames.index(field)].dof
9581 * for eN in range(self.num_owned_elements):
9582*/
9583 __pyx_t_2 = NULL;
9584 __pyx_t_5 = 1;
9585 {
9586 PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Only_zero_isocontour_extraction};
9587 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_NotImplementedError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
9588 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
9589 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error)
9590 __Pyx_GOTREF(__pyx_t_1);
9591 }
9592 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9593 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9594 __PYX_ERR(0, 166, __pyx_L1_error)
9595
9596 /* "Isosurface.pyx":165
9597 * self.normals[(field, value)] = normals = []
9598 * self.normal_indices[(field, value)] = normal_indices = []
9599 * if value != 0.0: # <<<<<<<<<<<<<<
9600 * raise NotImplementedError("Only zero isocontour extraction")
9601 * phi = self.u[self.fieldNames.index(field)].dof
9602*/
9603 }
9604
9605 /* "Isosurface.pyx":167
9606 * if value != 0.0:
9607 * raise NotImplementedError("Only zero isocontour extraction")
9608 * phi = self.u[self.fieldNames.index(field)].dof # <<<<<<<<<<<<<<
9609 * for eN in range(self.num_owned_elements):
9610 * plus = []
9611*/
9612 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_u); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
9613 __Pyx_GOTREF(__pyx_t_1);
9614 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_fieldNames); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 167, __pyx_L1_error)
9615 __Pyx_GOTREF(__pyx_t_6);
9616 __pyx_t_3 = __pyx_t_6;
9617 __Pyx_INCREF(__pyx_t_3);
9618 __pyx_t_5 = 0;
9619 {
9620 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_field};
9621 __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_index, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
9622 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9623 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9624 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error)
9625 __Pyx_GOTREF(__pyx_t_2);
9626 }
9627 __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 167, __pyx_L1_error)
9628 __Pyx_GOTREF(__pyx_t_6);
9629 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9630 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9631 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_dof); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error)
9632 __Pyx_GOTREF(__pyx_t_2);
9633 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9634 __pyx_v_phi = __pyx_t_2;
9635 __pyx_t_2 = 0;
9636
9637 /* "Isosurface.pyx":168
9638 * raise NotImplementedError("Only zero isocontour extraction")
9639 * phi = self.u[self.fieldNames.index(field)].dof
9640 * for eN in range(self.num_owned_elements): # <<<<<<<<<<<<<<
9641 * plus = []
9642 * minus = []
9643*/
9644 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_num_owned_elements); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error)
9645 __Pyx_GOTREF(__pyx_t_2);
9646 __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 168, __pyx_L1_error)
9647 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9648 __pyx_t_8 = __pyx_t_7;
9649
9650 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
9651 __pyx_v_eN = __pyx_t_9;
9652
9653 /* "Isosurface.pyx":169
9654 * phi = self.u[self.fieldNames.index(field)].dof
9655 * for eN in range(self.num_owned_elements):
9656 * plus = [] # <<<<<<<<<<<<<<
9657 * minus = []
9658 * zeros = []
9659*/
9660 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
9661 __Pyx_GOTREF(__pyx_t_2);
9662 __Pyx_XDECREF_SET(__pyx_v_plus, ((PyObject*)__pyx_t_2));
9663 __pyx_t_2 = 0;
9664
9665 /* "Isosurface.pyx":170
9666 * for eN in range(self.num_owned_elements):
9667 * plus = []
9668 * minus = [] # <<<<<<<<<<<<<<
9669 * zeros = []
9670 * eps = 1.0e-8
9671*/
9672 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error)
9673 __Pyx_GOTREF(__pyx_t_2);
9674 __Pyx_XDECREF_SET(__pyx_v_minus, ((PyObject*)__pyx_t_2));
9675 __pyx_t_2 = 0;
9676
9677 /* "Isosurface.pyx":171
9678 * plus = []
9679 * minus = []
9680 * zeros = [] # <<<<<<<<<<<<<<
9681 * eps = 1.0e-8
9682 * for i in range(4):
9683*/
9684 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
9685 __Pyx_GOTREF(__pyx_t_2);
9686 __Pyx_XDECREF_SET(__pyx_v_zeros, ((PyObject*)__pyx_t_2));
9687 __pyx_t_2 = 0;
9688
9689 /* "Isosurface.pyx":172
9690 * minus = []
9691 * zeros = []
9692 * eps = 1.0e-8 # <<<<<<<<<<<<<<
9693 * for i in range(4):
9694 * I = self.elementNodesArray[eN, i]
9695*/
9696 __pyx_v_eps = 1.0e-8;
9697
9698 /* "Isosurface.pyx":173
9699 * zeros = []
9700 * eps = 1.0e-8
9701 * for i in range(4): # <<<<<<<<<<<<<<
9702 * I = self.elementNodesArray[eN, i]
9703 * if phi[I] > eps:
9704*/
9705 for (__pyx_t_10 = 0; __pyx_t_10 < 4; __pyx_t_10+=1) {
9706 __pyx_v_i = __pyx_t_10;
9707
9708 /* "Isosurface.pyx":174
9709 * eps = 1.0e-8
9710 * for i in range(4):
9711 * I = self.elementNodesArray[eN, i] # <<<<<<<<<<<<<<
9712 * if phi[I] > eps:
9713 * plus.append(I)
9714*/
9715 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_elementNodesArray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
9716 __Pyx_GOTREF(__pyx_t_2);
9717 __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_eN); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 174, __pyx_L1_error)
9718 __Pyx_GOTREF(__pyx_t_6);
9719 __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
9720 __Pyx_GOTREF(__pyx_t_1);
9721 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 174, __pyx_L1_error)
9722 __Pyx_GOTREF(__pyx_t_3);
9723 __Pyx_GIVEREF(__pyx_t_6);
9724 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6) != (0)) __PYX_ERR(0, 174, __pyx_L1_error);
9725 __Pyx_GIVEREF(__pyx_t_1);
9726 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 174, __pyx_L1_error);
9727 __pyx_t_6 = 0;
9728 __pyx_t_1 = 0;
9729 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
9730 __Pyx_GOTREF(__pyx_t_1);
9731 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9732 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9733 __pyx_t_11 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 174, __pyx_L1_error)
9734 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9735 __pyx_v_I = __pyx_t_11;
9736
9737 /* "Isosurface.pyx":175
9738 * for i in range(4):
9739 * I = self.elementNodesArray[eN, i]
9740 * if phi[I] > eps: # <<<<<<<<<<<<<<
9741 * plus.append(I)
9742 * elif phi[I] < -eps:
9743*/
9744 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
9745 __Pyx_GOTREF(__pyx_t_1);
9746 __pyx_t_3 = PyFloat_FromDouble(__pyx_v_eps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error)
9747 __Pyx_GOTREF(__pyx_t_3);
9748 __pyx_t_4 = __Pyx_PyObject_CompareBoolGt_object_float(__pyx_t_1, __pyx_t_3, Py_GT); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 175, __pyx_L1_error)
9749 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9750 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9751 if (__pyx_t_4) {
9752
9753
9754 /* "Isosurface.pyx":176
9755 * I = self.elementNodesArray[eN, i]
9756 * if phi[I] > eps:
9757 * plus.append(I) # <<<<<<<<<<<<<<
9758 * elif phi[I] < -eps:
9759 * minus.append(I)
9760*/
9761 __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_I); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __pyx_L1_error)
9762 __Pyx_GOTREF(__pyx_t_3);
9763 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_plus, __pyx_t_3); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 176, __pyx_L1_error)
9764 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9765
9766
9767 /* "Isosurface.pyx":175
9768 * for i in range(4):
9769 * I = self.elementNodesArray[eN, i]
9770 * if phi[I] > eps: # <<<<<<<<<<<<<<
9771 * plus.append(I)
9772 * elif phi[I] < -eps:
9773*/
9774 goto __pyx_L8;
9775 }
9776
9777 /* "Isosurface.pyx":177
9778 * if phi[I] > eps:
9779 * plus.append(I)
9780 * elif phi[I] < -eps: # <<<<<<<<<<<<<<
9781 * minus.append(I)
9782 * else:
9783*/
9784 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error)
9785 __Pyx_GOTREF(__pyx_t_3);
9786 __pyx_t_1 = PyFloat_FromDouble((-__pyx_v_eps)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error)
9787 __Pyx_GOTREF(__pyx_t_1);
9788 __pyx_t_4 = __Pyx_PyObject_CompareBoolLt_object_float(__pyx_t_3, __pyx_t_1, Py_LT); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 177, __pyx_L1_error)
9789 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9790 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9791 if (__pyx_t_4) {
9792
9793
9794 /* "Isosurface.pyx":178
9795 * plus.append(I)
9796 * elif phi[I] < -eps:
9797 * minus.append(I) # <<<<<<<<<<<<<<
9798 * else:
9799 * zeros.append(I)
9800*/
9801 __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_I); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
9802 __Pyx_GOTREF(__pyx_t_1);
9803 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_minus, __pyx_t_1); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 178, __pyx_L1_error)
9804 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9805
9806
9807 /* "Isosurface.pyx":177
9808 * if phi[I] > eps:
9809 * plus.append(I)
9810 * elif phi[I] < -eps: # <<<<<<<<<<<<<<
9811 * minus.append(I)
9812 * else:
9813*/
9814 goto __pyx_L8;
9815 }
9816
9817 /* "Isosurface.pyx":180
9818 * minus.append(I)
9819 * else:
9820 * zeros.append(I) # <<<<<<<<<<<<<<
9821 * nZeros = len(zeros)
9822 * nMinus = len(minus)
9823*/
9824 /*else*/ {
9825 __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_I); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error)
9826 __Pyx_GOTREF(__pyx_t_1);
9827 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_zeros, __pyx_t_1); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 180, __pyx_L1_error)
9828 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9829
9830 }
9831 __pyx_L8:;
9832 }
9833
9834 /* "Isosurface.pyx":181
9835 * else:
9836 * zeros.append(I)
9837 * nZeros = len(zeros) # <<<<<<<<<<<<<<
9838 * nMinus = len(minus)
9839 * nPlus = len(plus)
9840*/
9841 __pyx_t_13 = __Pyx_PyList_GET_SIZE(__pyx_v_zeros); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 181, __pyx_L1_error)
9842 __pyx_v_nZeros = __pyx_t_13;
9843
9844 /* "Isosurface.pyx":182
9845 * zeros.append(I)
9846 * nZeros = len(zeros)
9847 * nMinus = len(minus) # <<<<<<<<<<<<<<
9848 * nPlus = len(plus)
9849 * assert(nZeros + nMinus + nPlus == 4)
9850*/
9851 __pyx_t_13 = __Pyx_PyList_GET_SIZE(__pyx_v_minus); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 182, __pyx_L1_error)
9852 __pyx_v_nMinus = __pyx_t_13;
9853
9854 /* "Isosurface.pyx":183
9855 * nZeros = len(zeros)
9856 * nMinus = len(minus)
9857 * nPlus = len(plus) # <<<<<<<<<<<<<<
9858 * assert(nZeros + nMinus + nPlus == 4)
9859 * nN_start = len(nodes)
9860*/
9861 __pyx_t_13 = __Pyx_PyList_GET_SIZE(__pyx_v_plus); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 183, __pyx_L1_error)
9862 __pyx_v_nPlus = __pyx_t_13;
9863
9864 /* "Isosurface.pyx":184
9865 * nMinus = len(minus)
9866 * nPlus = len(plus)
9867 * assert(nZeros + nMinus + nPlus == 4) # <<<<<<<<<<<<<<
9868 * nN_start = len(nodes)
9869 * if nMinus == 2 and nPlus == 2: # 4 cut edges
9870*/
9871 #ifndef CYTHON_WITHOUT_ASSERTIONS
9872 if (unlikely(__pyx_assertions_enabled())) {
9873 __pyx_t_4 = (((__pyx_v_nZeros + __pyx_v_nMinus) + __pyx_v_nPlus) == 4);
9874
9875 if (unlikely(!__pyx_t_4)) {
9876 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
9877 __PYX_ERR(0, 184, __pyx_L1_error)
9878 }
9879
9880 }
9881 #else
9882 if ((1)); else __PYX_ERR(0, 184, __pyx_L1_error)
9883 #endif
9884
9885 /* "Isosurface.pyx":185
9886 * nPlus = len(plus)
9887 * assert(nZeros + nMinus + nPlus == 4)
9888 * nN_start = len(nodes) # <<<<<<<<<<<<<<
9889 * if nMinus == 2 and nPlus == 2: # 4 cut edges
9890 * for J in minus:
9891*/
9892 __pyx_t_13 = __Pyx_PyList_GET_SIZE(__pyx_v_nodes); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 185, __pyx_L1_error)
9893 __pyx_v_nN_start = __pyx_t_13;
9894
9895 /* "Isosurface.pyx":186
9896 * assert(nZeros + nMinus + nPlus == 4)
9897 * nN_start = len(nodes)
9898 * if nMinus == 2 and nPlus == 2: # 4 cut edges # <<<<<<<<<<<<<<
9899 * for J in minus:
9900 * for I in plus:
9901*/
9902 __pyx_t_14 = (__pyx_v_nMinus == 2);
9903
9904 if (__pyx_t_14) {
9905
9906 } else {
9907
9908 __pyx_t_4 = __pyx_t_14;
9909
9910 goto __pyx_L10_bool_binop_done;
9911 }
9912 __pyx_t_14 = (__pyx_v_nPlus == 2);
9913
9914
9915 __pyx_t_4 = __pyx_t_14;
9916
9917 __pyx_L10_bool_binop_done:;
9918 if (__pyx_t_4) {
9919
9920
9921 /* "Isosurface.pyx":187
9922 * nN_start = len(nodes)
9923 * if nMinus == 2 and nPlus == 2: # 4 cut edges
9924 * for J in minus: # <<<<<<<<<<<<<<
9925 * for I in plus:
9926 * s = -phi[I] / (phi[J] - phi[I])
9927*/
9928 __pyx_t_1 = __pyx_v_minus; __Pyx_INCREF(__pyx_t_1);
9929 __pyx_t_13 = 0;
9930 for (;;) {
9931 {
9932 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
9933 #if !CYTHON_ASSUME_SAFE_SIZE
9934 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 187, __pyx_L1_error)
9935 #endif
9936 if (__pyx_t_13 >= __pyx_temp) break;
9937 }
9938 __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_13, __Pyx_ReferenceSharing_OwnStrongReference);
9939 ++__pyx_t_13;
9940 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error)
9941 __Pyx_GOTREF(__pyx_t_3);
9942 __pyx_t_10 = __Pyx_PyLong_As_int(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 187, __pyx_L1_error)
9943 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9944 __pyx_v_J = __pyx_t_10;
9945
9946 /* "Isosurface.pyx":188
9947 * if nMinus == 2 and nPlus == 2: # 4 cut edges
9948 * for J in minus:
9949 * for I in plus: # <<<<<<<<<<<<<<
9950 * s = -phi[I] / (phi[J] - phi[I])
9951 * x = s * (self.nodeArray[J] - self.nodeArray[I]) \
9952*/
9953 __pyx_t_3 = __pyx_v_plus; __Pyx_INCREF(__pyx_t_3);
9954 __pyx_t_15 = 0;
9955 for (;;) {
9956 {
9957 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
9958 #if !CYTHON_ASSUME_SAFE_SIZE
9959 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 188, __pyx_L1_error)
9960 #endif
9961 if (__pyx_t_15 >= __pyx_temp) break;
9962 }
9963 __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_15, __Pyx_ReferenceSharing_OwnStrongReference);
9964 ++__pyx_t_15;
9965 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
9966 __Pyx_GOTREF(__pyx_t_2);
9967 __pyx_t_10 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L1_error)
9968 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9969 __pyx_v_I = __pyx_t_10;
9970
9971 /* "Isosurface.pyx":189
9972 * for J in minus:
9973 * for I in plus:
9974 * s = -phi[I] / (phi[J] - phi[I]) # <<<<<<<<<<<<<<
9975 * x = s * (self.nodeArray[J] - self.nodeArray[I]) \
9976 * + self.nodeArray[I]
9977*/
9978 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error)
9979 __Pyx_GOTREF(__pyx_t_2);
9980 __pyx_t_6 = PyNumber_Negative(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 189, __pyx_L1_error)
9981 __Pyx_GOTREF(__pyx_t_6);
9982 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9983 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_J, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error)
9984 __Pyx_GOTREF(__pyx_t_2);
9985 __pyx_t_16 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 189, __pyx_L1_error)
9986 __Pyx_GOTREF(__pyx_t_16);
9987 __pyx_t_17 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_2, __pyx_t_16); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 189, __pyx_L1_error)
9988 __Pyx_GOTREF(__pyx_t_17);
9989 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9990 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
9991 __pyx_t_16 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_t_17); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 189, __pyx_L1_error)
9992 __Pyx_GOTREF(__pyx_t_16);
9993 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9994 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
9995 __pyx_t_18 = __Pyx_PyFloat_AsDouble(__pyx_t_16); if (unlikely((__pyx_t_18 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L1_error)
9996 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
9997 __pyx_v_s = __pyx_t_18;
9998
9999 /* "Isosurface.pyx":190
10000 * for I in plus:
10001 * s = -phi[I] / (phi[J] - phi[I])
10002 * x = s * (self.nodeArray[J] - self.nodeArray[I]) \ # <<<<<<<<<<<<<<
10003 * + self.nodeArray[I]
10004 * nodes.append(x)
10005*/
10006 __pyx_t_16 = PyFloat_FromDouble(__pyx_v_s); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 190, __pyx_L1_error)
10007 __Pyx_GOTREF(__pyx_t_16);
10008 __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 190, __pyx_L1_error)
10009 __Pyx_GOTREF(__pyx_t_17);
10010 __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_17, __pyx_v_J, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error)
10011 __Pyx_GOTREF(__pyx_t_6);
10012 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10013 __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 190, __pyx_L1_error)
10014 __Pyx_GOTREF(__pyx_t_17);
10015 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_17, __pyx_v_I, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error)
10016 __Pyx_GOTREF(__pyx_t_2);
10017 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10018 __pyx_t_17 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 190, __pyx_L1_error)
10019 __Pyx_GOTREF(__pyx_t_17);
10020 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10021 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10022 __pyx_t_2 = __Pyx_PyNumber_Multiply_float_object(__pyx_t_16, __pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error)
10023 __Pyx_GOTREF(__pyx_t_2);
10024 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
10025 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10026
10027 /* "Isosurface.pyx":191
10028 * s = -phi[I] / (phi[J] - phi[I])
10029 * x = s * (self.nodeArray[J] - self.nodeArray[I]) \
10030 * + self.nodeArray[I] # <<<<<<<<<<<<<<
10031 * nodes.append(x)
10032 * elements.append([nN_start + j for j in range(3)])
10033*/
10034 __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 191, __pyx_L1_error)
10035 __Pyx_GOTREF(__pyx_t_17);
10036 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_17, __pyx_v_I, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 191, __pyx_L1_error)
10037 __Pyx_GOTREF(__pyx_t_16);
10038 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10039 __pyx_t_17 = __Pyx_PyNumber_Add_object_object(__pyx_t_2, __pyx_t_16); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 191, __pyx_L1_error)
10040 __Pyx_GOTREF(__pyx_t_17);
10041 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10042 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
10043 if (!(likely(((__pyx_t_17) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_17, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 191, __pyx_L1_error)
10044 {
10045 __Pyx_BufFmt_StackElem __pyx_stack[1];
10046 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
10047 __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_17), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
10048 if (unlikely(__pyx_t_10 < 0)) {
10049 __Pyx_PyErr_FetchException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
10050 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)) {
10051 Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21);
10052 __Pyx_RaiseBufferFallbackError();
10053 } else {
10054 __Pyx_PyErr_RestoreException(__pyx_t_19, __pyx_t_20, __pyx_t_21);
10055 }
10056 __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0;
10057 }
10058 __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];
10059 if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 190, __pyx_L1_error)
10060 }
10061 __Pyx_XDECREF_SET(__pyx_v_x, ((PyArrayObject *)__pyx_t_17));
10062 __pyx_t_17 = 0;
10063
10064 /* "Isosurface.pyx":192
10065 * x = s * (self.nodeArray[J] - self.nodeArray[I]) \
10066 * + self.nodeArray[I]
10067 * nodes.append(x) # <<<<<<<<<<<<<<
10068 * elements.append([nN_start + j for j in range(3)])
10069 * elements.append([nN_start + j + 1 for j in range(3)])
10070*/
10071 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_nodes, ((PyObject *)__pyx_v_x)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 192, __pyx_L1_error)
10072
10073
10074 /* "Isosurface.pyx":188
10075 * if nMinus == 2 and nPlus == 2: # 4 cut edges
10076 * for J in minus:
10077 * for I in plus: # <<<<<<<<<<<<<<
10078 * s = -phi[I] / (phi[J] - phi[I])
10079 * x = s * (self.nodeArray[J] - self.nodeArray[I]) \
10080*/
10081 }
10082 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10083
10084 /* "Isosurface.pyx":187
10085 * nN_start = len(nodes)
10086 * if nMinus == 2 and nPlus == 2: # 4 cut edges
10087 * for J in minus: # <<<<<<<<<<<<<<
10088 * for I in plus:
10089 * s = -phi[I] / (phi[J] - phi[I])
10090*/
10091 }
10092 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10093
10094 /* "Isosurface.pyx":193
10095 * + self.nodeArray[I]
10096 * nodes.append(x)
10097 * elements.append([nN_start + j for j in range(3)]) # <<<<<<<<<<<<<<
10098 * elements.append([nN_start + j + 1 for j in range(3)])
10099 * if etriple(self.nodeArray[plus[0]] - nodes[-4],
10100*/
10101 { /* enter inner scope */
10102 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
10103 __Pyx_GOTREF(__pyx_t_1);
10104 for (__pyx_t_22 = 0; __pyx_t_22 < 3; __pyx_t_22+=1) {
10105 __pyx_8genexpr2__pyx_v_j = __pyx_t_22;
10106 __pyx_t_3 = __Pyx_PyLong_From_long((__pyx_v_nN_start + __pyx_8genexpr2__pyx_v_j)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error)
10107 __Pyx_GOTREF(__pyx_t_3);
10108 __Pyx_GIVEREF(__pyx_t_3);
10109 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_1, __pyx_t_3))) __PYX_ERR(0, 193, __pyx_L1_error)
10110 __pyx_t_3 = 0;
10111 }
10112 } /* exit inner scope */
10113 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_elements, __pyx_t_1); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 193, __pyx_L1_error)
10114 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10115
10116
10117 /* "Isosurface.pyx":194
10118 * nodes.append(x)
10119 * elements.append([nN_start + j for j in range(3)])
10120 * elements.append([nN_start + j + 1 for j in range(3)]) # <<<<<<<<<<<<<<
10121 * if etriple(self.nodeArray[plus[0]] - nodes[-4],
10122 * nodes[-3] - nodes[-4],
10123*/
10124 { /* enter inner scope */
10125 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error)
10126 __Pyx_GOTREF(__pyx_t_1);
10127 for (__pyx_t_22 = 0; __pyx_t_22 < 3; __pyx_t_22+=1) {
10128 __pyx_8genexpr3__pyx_v_j = __pyx_t_22;
10129 __pyx_t_3 = __Pyx_PyLong_From_long(((__pyx_v_nN_start + __pyx_8genexpr3__pyx_v_j) + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error)
10130 __Pyx_GOTREF(__pyx_t_3);
10131 __Pyx_GIVEREF(__pyx_t_3);
10132 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_1, __pyx_t_3))) __PYX_ERR(0, 194, __pyx_L1_error)
10133 __pyx_t_3 = 0;
10134 }
10135 } /* exit inner scope */
10136 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_elements, __pyx_t_1); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 194, __pyx_L1_error)
10137 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10138
10139
10140 /* "Isosurface.pyx":195
10141 * elements.append([nN_start + j for j in range(3)])
10142 * elements.append([nN_start + j + 1 for j in range(3)])
10143 * if etriple(self.nodeArray[plus[0]] - nodes[-4], # <<<<<<<<<<<<<<
10144 * nodes[-3] - nodes[-4],
10145 * nodes[-2] - nodes[-4]) < 0.0:
10146*/
10147 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error)
10148 __Pyx_GOTREF(__pyx_t_1);
10149 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_plus, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error)
10150 __Pyx_GOTREF(__pyx_t_3);
10151 __pyx_t_17 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 195, __pyx_L1_error)
10152 __Pyx_GOTREF(__pyx_t_17);
10153 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10154 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10155 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_nodes, -4L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error)
10156 __Pyx_GOTREF(__pyx_t_3);
10157 __pyx_t_1 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_17, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error)
10158 __Pyx_GOTREF(__pyx_t_1);
10159 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10160 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10161 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 195, __pyx_L1_error)
10162
10163 /* "Isosurface.pyx":196
10164 * elements.append([nN_start + j + 1 for j in range(3)])
10165 * if etriple(self.nodeArray[plus[0]] - nodes[-4],
10166 * nodes[-3] - nodes[-4], # <<<<<<<<<<<<<<
10167 * nodes[-2] - nodes[-4]) < 0.0:
10168 * elements[-2] = [elements[-2][0],
10169*/
10170 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error)
10171 __Pyx_GOTREF(__pyx_t_3);
10172 __pyx_t_17 = __Pyx_GetItemInt_List(__pyx_v_nodes, -4L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 196, __pyx_L1_error)
10173 __Pyx_GOTREF(__pyx_t_17);
10174 __pyx_t_16 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_3, __pyx_t_17); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 196, __pyx_L1_error)
10175 __Pyx_GOTREF(__pyx_t_16);
10176 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10177 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10178 if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 196, __pyx_L1_error)
10179
10180 /* "Isosurface.pyx":197
10181 * if etriple(self.nodeArray[plus[0]] - nodes[-4],
10182 * nodes[-3] - nodes[-4],
10183 * nodes[-2] - nodes[-4]) < 0.0: # <<<<<<<<<<<<<<
10184 * elements[-2] = [elements[-2][0],
10185 * elements[-2][2],
10186*/
10187 __pyx_t_17 = __Pyx_GetItemInt_List(__pyx_v_nodes, -2L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 197, __pyx_L1_error)
10188 __Pyx_GOTREF(__pyx_t_17);
10189 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_nodes, -4L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error)
10190 __Pyx_GOTREF(__pyx_t_3);
10191 __pyx_t_2 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_17, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error)
10192 __Pyx_GOTREF(__pyx_t_2);
10193 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10194 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10195 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 197, __pyx_L1_error)
10196
10197 /* "Isosurface.pyx":195
10198 * elements.append([nN_start + j for j in range(3)])
10199 * elements.append([nN_start + j + 1 for j in range(3)])
10200 * if etriple(self.nodeArray[plus[0]] - nodes[-4], # <<<<<<<<<<<<<<
10201 * nodes[-3] - nodes[-4],
10202 * nodes[-2] - nodes[-4]) < 0.0:
10203*/
10204 __pyx_t_18 = __pyx_f_10Isosurface_etriple(((PyArrayObject *)__pyx_t_1), ((PyArrayObject *)__pyx_t_16), ((PyArrayObject *)__pyx_t_2)); if (unlikely(__pyx_t_18 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 195, __pyx_L1_error)
10205 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10206 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
10207 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10208
10209 /* "Isosurface.pyx":197
10210 * if etriple(self.nodeArray[plus[0]] - nodes[-4],
10211 * nodes[-3] - nodes[-4],
10212 * nodes[-2] - nodes[-4]) < 0.0: # <<<<<<<<<<<<<<
10213 * elements[-2] = [elements[-2][0],
10214 * elements[-2][2],
10215*/
10216 __pyx_t_4 = (__pyx_t_18 < 0.0);
10217
10218
10219
10220 /* "Isosurface.pyx":195
10221 * elements.append([nN_start + j for j in range(3)])
10222 * elements.append([nN_start + j + 1 for j in range(3)])
10223 * if etriple(self.nodeArray[plus[0]] - nodes[-4], # <<<<<<<<<<<<<<
10224 * nodes[-3] - nodes[-4],
10225 * nodes[-2] - nodes[-4]) < 0.0:
10226*/
10227 if (__pyx_t_4) {
10228
10229
10230 /* "Isosurface.pyx":198
10231 * nodes[-3] - nodes[-4],
10232 * nodes[-2] - nodes[-4]) < 0.0:
10233 * elements[-2] = [elements[-2][0], # <<<<<<<<<<<<<<
10234 * elements[-2][2],
10235 * elements[-2][1]]
10236*/
10237 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -2L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error)
10238 __Pyx_GOTREF(__pyx_t_2);
10239 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 198, __pyx_L1_error)
10240 __Pyx_GOTREF(__pyx_t_16);
10241 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10242
10243 /* "Isosurface.pyx":199
10244 * nodes[-2] - nodes[-4]) < 0.0:
10245 * elements[-2] = [elements[-2][0],
10246 * elements[-2][2], # <<<<<<<<<<<<<<
10247 * elements[-2][1]]
10248 * if etriple(self.nodeArray[plus[1]] - nodes[-3],
10249*/
10250 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -2L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error)
10251 __Pyx_GOTREF(__pyx_t_2);
10252 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
10253 __Pyx_GOTREF(__pyx_t_1);
10254 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10255
10256 /* "Isosurface.pyx":200
10257 * elements[-2] = [elements[-2][0],
10258 * elements[-2][2],
10259 * elements[-2][1]] # <<<<<<<<<<<<<<
10260 * if etriple(self.nodeArray[plus[1]] - nodes[-3],
10261 * nodes[-2] - nodes[-3],
10262*/
10263 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -2L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error)
10264 __Pyx_GOTREF(__pyx_t_2);
10265 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error)
10266 __Pyx_GOTREF(__pyx_t_3);
10267 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10268
10269 /* "Isosurface.pyx":198
10270 * nodes[-3] - nodes[-4],
10271 * nodes[-2] - nodes[-4]) < 0.0:
10272 * elements[-2] = [elements[-2][0], # <<<<<<<<<<<<<<
10273 * elements[-2][2],
10274 * elements[-2][1]]
10275*/
10276 __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error)
10277 __Pyx_GOTREF(__pyx_t_2);
10278 __Pyx_GIVEREF(__pyx_t_16);
10279 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_16) != (0)) __PYX_ERR(0, 198, __pyx_L1_error);
10280 __Pyx_GIVEREF(__pyx_t_1);
10281 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 198, __pyx_L1_error);
10282 __Pyx_GIVEREF(__pyx_t_3);
10283 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 198, __pyx_L1_error);
10284 __pyx_t_16 = 0;
10285 __pyx_t_1 = 0;
10286 __pyx_t_3 = 0;
10287 if (unlikely((__Pyx_SetItemInt(__pyx_v_elements, -2L, __pyx_t_2, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 198, __pyx_L1_error)
10288 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10289
10290 /* "Isosurface.pyx":195
10291 * elements.append([nN_start + j for j in range(3)])
10292 * elements.append([nN_start + j + 1 for j in range(3)])
10293 * if etriple(self.nodeArray[plus[0]] - nodes[-4], # <<<<<<<<<<<<<<
10294 * nodes[-3] - nodes[-4],
10295 * nodes[-2] - nodes[-4]) < 0.0:
10296*/
10297 }
10298
10299 /* "Isosurface.pyx":201
10300 * elements[-2][2],
10301 * elements[-2][1]]
10302 * if etriple(self.nodeArray[plus[1]] - nodes[-3], # <<<<<<<<<<<<<<
10303 * nodes[-2] - nodes[-3],
10304 * nodes[-1] - nodes[-3]) < 0.0:
10305*/
10306 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
10307 __Pyx_GOTREF(__pyx_t_2);
10308 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_plus, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error)
10309 __Pyx_GOTREF(__pyx_t_3);
10310 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
10311 __Pyx_GOTREF(__pyx_t_1);
10312 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10313 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10314 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error)
10315 __Pyx_GOTREF(__pyx_t_3);
10316 __pyx_t_2 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
10317 __Pyx_GOTREF(__pyx_t_2);
10318 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10319 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10320 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 201, __pyx_L1_error)
10321
10322 /* "Isosurface.pyx":202
10323 * elements[-2][1]]
10324 * if etriple(self.nodeArray[plus[1]] - nodes[-3],
10325 * nodes[-2] - nodes[-3], # <<<<<<<<<<<<<<
10326 * nodes[-1] - nodes[-3]) < 0.0:
10327 * elements[-1] = [elements[-1][0],
10328*/
10329 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_nodes, -2L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error)
10330 __Pyx_GOTREF(__pyx_t_3);
10331 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error)
10332 __Pyx_GOTREF(__pyx_t_1);
10333 __pyx_t_16 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 202, __pyx_L1_error)
10334 __Pyx_GOTREF(__pyx_t_16);
10335 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10336 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10337 if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 202, __pyx_L1_error)
10338
10339 /* "Isosurface.pyx":203
10340 * if etriple(self.nodeArray[plus[1]] - nodes[-3],
10341 * nodes[-2] - nodes[-3],
10342 * nodes[-1] - nodes[-3]) < 0.0: # <<<<<<<<<<<<<<
10343 * elements[-1] = [elements[-1][0],
10344 * elements[-1][2],
10345*/
10346 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_nodes, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error)
10347 __Pyx_GOTREF(__pyx_t_1);
10348 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error)
10349 __Pyx_GOTREF(__pyx_t_3);
10350 __pyx_t_17 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 203, __pyx_L1_error)
10351 __Pyx_GOTREF(__pyx_t_17);
10352 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10353 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10354 if (!(likely(((__pyx_t_17) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_17, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 203, __pyx_L1_error)
10355
10356 /* "Isosurface.pyx":201
10357 * elements[-2][2],
10358 * elements[-2][1]]
10359 * if etriple(self.nodeArray[plus[1]] - nodes[-3], # <<<<<<<<<<<<<<
10360 * nodes[-2] - nodes[-3],
10361 * nodes[-1] - nodes[-3]) < 0.0:
10362*/
10363 __pyx_t_18 = __pyx_f_10Isosurface_etriple(((PyArrayObject *)__pyx_t_2), ((PyArrayObject *)__pyx_t_16), ((PyArrayObject *)__pyx_t_17)); if (unlikely(__pyx_t_18 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 201, __pyx_L1_error)
10364 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10365 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
10366 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10367
10368 /* "Isosurface.pyx":203
10369 * if etriple(self.nodeArray[plus[1]] - nodes[-3],
10370 * nodes[-2] - nodes[-3],
10371 * nodes[-1] - nodes[-3]) < 0.0: # <<<<<<<<<<<<<<
10372 * elements[-1] = [elements[-1][0],
10373 * elements[-1][2],
10374*/
10375 __pyx_t_4 = (__pyx_t_18 < 0.0);
10376
10377
10378
10379 /* "Isosurface.pyx":201
10380 * elements[-2][2],
10381 * elements[-2][1]]
10382 * if etriple(self.nodeArray[plus[1]] - nodes[-3], # <<<<<<<<<<<<<<
10383 * nodes[-2] - nodes[-3],
10384 * nodes[-1] - nodes[-3]) < 0.0:
10385*/
10386 if (__pyx_t_4) {
10387
10388
10389 /* "Isosurface.pyx":204
10390 * nodes[-2] - nodes[-3],
10391 * nodes[-1] - nodes[-3]) < 0.0:
10392 * elements[-1] = [elements[-1][0], # <<<<<<<<<<<<<<
10393 * elements[-1][2],
10394 * elements[-1][1]]
10395*/
10396 __pyx_t_17 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 204, __pyx_L1_error)
10397 __Pyx_GOTREF(__pyx_t_17);
10398 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_17, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 204, __pyx_L1_error)
10399 __Pyx_GOTREF(__pyx_t_16);
10400 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10401
10402 /* "Isosurface.pyx":205
10403 * nodes[-1] - nodes[-3]) < 0.0:
10404 * elements[-1] = [elements[-1][0],
10405 * elements[-1][2], # <<<<<<<<<<<<<<
10406 * elements[-1][1]]
10407 * normal = ecross(
10408*/
10409 __pyx_t_17 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 205, __pyx_L1_error)
10410 __Pyx_GOTREF(__pyx_t_17);
10411 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_17, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error)
10412 __Pyx_GOTREF(__pyx_t_2);
10413 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10414
10415 /* "Isosurface.pyx":206
10416 * elements[-1] = [elements[-1][0],
10417 * elements[-1][2],
10418 * elements[-1][1]] # <<<<<<<<<<<<<<
10419 * normal = ecross(
10420 * nodes[elements[-2][1]] - nodes[elements[-2][0]],
10421*/
10422 __pyx_t_17 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 206, __pyx_L1_error)
10423 __Pyx_GOTREF(__pyx_t_17);
10424 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_17, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 206, __pyx_L1_error)
10425 __Pyx_GOTREF(__pyx_t_3);
10426 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10427
10428 /* "Isosurface.pyx":204
10429 * nodes[-2] - nodes[-3],
10430 * nodes[-1] - nodes[-3]) < 0.0:
10431 * elements[-1] = [elements[-1][0], # <<<<<<<<<<<<<<
10432 * elements[-1][2],
10433 * elements[-1][1]]
10434*/
10435 __pyx_t_17 = PyList_New(3); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 204, __pyx_L1_error)
10436 __Pyx_GOTREF(__pyx_t_17);
10437 __Pyx_GIVEREF(__pyx_t_16);
10438 if (__Pyx_PyList_SET_ITEM(__pyx_t_17, 0, __pyx_t_16) != (0)) __PYX_ERR(0, 204, __pyx_L1_error);
10439 __Pyx_GIVEREF(__pyx_t_2);
10440 if (__Pyx_PyList_SET_ITEM(__pyx_t_17, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 204, __pyx_L1_error);
10441 __Pyx_GIVEREF(__pyx_t_3);
10442 if (__Pyx_PyList_SET_ITEM(__pyx_t_17, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 204, __pyx_L1_error);
10443 __pyx_t_16 = 0;
10444 __pyx_t_2 = 0;
10445 __pyx_t_3 = 0;
10446 if (unlikely((__Pyx_SetItemInt(__pyx_v_elements, -1L, __pyx_t_17, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 204, __pyx_L1_error)
10447 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10448
10449 /* "Isosurface.pyx":201
10450 * elements[-2][2],
10451 * elements[-2][1]]
10452 * if etriple(self.nodeArray[plus[1]] - nodes[-3], # <<<<<<<<<<<<<<
10453 * nodes[-2] - nodes[-3],
10454 * nodes[-1] - nodes[-3]) < 0.0:
10455*/
10456 }
10457
10458 /* "Isosurface.pyx":208
10459 * elements[-1][1]]
10460 * normal = ecross(
10461 * nodes[elements[-2][1]] - nodes[elements[-2][0]], # <<<<<<<<<<<<<<
10462 * nodes[elements[-2][2]] - nodes[elements[-2][0]])
10463 * normal /= enorm(normal)
10464*/
10465 __pyx_t_17 = __Pyx_GetItemInt_List(__pyx_v_elements, -2L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 208, __pyx_L1_error)
10466 __Pyx_GOTREF(__pyx_t_17);
10467 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_17, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error)
10468 __Pyx_GOTREF(__pyx_t_3);
10469 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10470 __pyx_t_17 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_3); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 208, __pyx_L1_error)
10471 __Pyx_GOTREF(__pyx_t_17);
10472 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10473 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -2L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error)
10474 __Pyx_GOTREF(__pyx_t_3);
10475 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error)
10476 __Pyx_GOTREF(__pyx_t_2);
10477 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10478 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error)
10479 __Pyx_GOTREF(__pyx_t_3);
10480 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10481 __pyx_t_2 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_17, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error)
10482 __Pyx_GOTREF(__pyx_t_2);
10483 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10484 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10485 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 208, __pyx_L1_error)
10486
10487 /* "Isosurface.pyx":209
10488 * normal = ecross(
10489 * nodes[elements[-2][1]] - nodes[elements[-2][0]],
10490 * nodes[elements[-2][2]] - nodes[elements[-2][0]]) # <<<<<<<<<<<<<<
10491 * normal /= enorm(normal)
10492 * normals.append(normal)
10493*/
10494 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -2L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error)
10495 __Pyx_GOTREF(__pyx_t_3);
10496 __pyx_t_17 = __Pyx_GetItemInt(__pyx_t_3, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 209, __pyx_L1_error)
10497 __Pyx_GOTREF(__pyx_t_17);
10498 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10499 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_17); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error)
10500 __Pyx_GOTREF(__pyx_t_3);
10501 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10502 __pyx_t_17 = __Pyx_GetItemInt_List(__pyx_v_elements, -2L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 209, __pyx_L1_error)
10503 __Pyx_GOTREF(__pyx_t_17);
10504 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_17, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 209, __pyx_L1_error)
10505 __Pyx_GOTREF(__pyx_t_16);
10506 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10507 __pyx_t_17 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_16); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 209, __pyx_L1_error)
10508 __Pyx_GOTREF(__pyx_t_17);
10509 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
10510 __pyx_t_16 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_3, __pyx_t_17); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 209, __pyx_L1_error)
10511 __Pyx_GOTREF(__pyx_t_16);
10512 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10513 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10514 if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 209, __pyx_L1_error)
10515
10516 /* "Isosurface.pyx":207
10517 * elements[-1][2],
10518 * elements[-1][1]]
10519 * normal = ecross( # <<<<<<<<<<<<<<
10520 * nodes[elements[-2][1]] - nodes[elements[-2][0]],
10521 * nodes[elements[-2][2]] - nodes[elements[-2][0]])
10522*/
10523 __pyx_t_17 = ((PyObject *)__pyx_f_10Isosurface_ecross(((PyArrayObject *)__pyx_t_2), ((PyArrayObject *)__pyx_t_16))); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 207, __pyx_L1_error)
10524 __Pyx_GOTREF(__pyx_t_17);
10525 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10526 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
10527 {
10528 __Pyx_BufFmt_StackElem __pyx_stack[1];
10529 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
10530 __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_17), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
10531 if (unlikely(__pyx_t_10 < 0)) {
10532 __Pyx_PyErr_FetchException(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
10533 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)) {
10534 Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_19);
10535 __Pyx_RaiseBufferFallbackError();
10536 } else {
10537 __Pyx_PyErr_RestoreException(__pyx_t_21, __pyx_t_20, __pyx_t_19);
10538 }
10539 __pyx_t_21 = __pyx_t_20 = __pyx_t_19 = 0;
10540 }
10541 __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];
10542 if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 207, __pyx_L1_error)
10543 }
10544 __Pyx_XDECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_17));
10545 __pyx_t_17 = 0;
10546
10547 /* "Isosurface.pyx":210
10548 * nodes[elements[-2][1]] - nodes[elements[-2][0]],
10549 * nodes[elements[-2][2]] - nodes[elements[-2][0]])
10550 * normal /= enorm(normal) # <<<<<<<<<<<<<<
10551 * normals.append(normal)
10552 * normals.append(normal)
10553*/
10554 __pyx_t_18 = __pyx_f_10Isosurface_enorm(((PyArrayObject *)__pyx_v_normal)); if (unlikely(__pyx_t_18 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 210, __pyx_L1_error)
10555 __pyx_t_17 = PyFloat_FromDouble(__pyx_t_18); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 210, __pyx_L1_error)
10556 __Pyx_GOTREF(__pyx_t_17);
10557
10558 __pyx_t_16 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_normal), __pyx_t_17); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 210, __pyx_L1_error)
10559 __Pyx_GOTREF(__pyx_t_16);
10560 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10561 if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 210, __pyx_L1_error)
10562 {
10563 __Pyx_BufFmt_StackElem __pyx_stack[1];
10564 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
10565 __pyx_t_10 = __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);
10566 if (unlikely(__pyx_t_10 < 0)) {
10567 __Pyx_PyErr_FetchException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
10568 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)) {
10569 Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21);
10570 __Pyx_RaiseBufferFallbackError();
10571 } else {
10572 __Pyx_PyErr_RestoreException(__pyx_t_19, __pyx_t_20, __pyx_t_21);
10573 }
10574 __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0;
10575 }
10576 __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];
10577 if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 210, __pyx_L1_error)
10578 }
10579 __Pyx_DECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_16));
10580 __pyx_t_16 = 0;
10581
10582 /* "Isosurface.pyx":211
10583 * nodes[elements[-2][2]] - nodes[elements[-2][0]])
10584 * normal /= enorm(normal)
10585 * normals.append(normal) # <<<<<<<<<<<<<<
10586 * normals.append(normal)
10587 * normals.append(normal)
10588*/
10589 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 211, __pyx_L1_error)
10590
10591
10592 /* "Isosurface.pyx":212
10593 * normal /= enorm(normal)
10594 * normals.append(normal)
10595 * normals.append(normal) # <<<<<<<<<<<<<<
10596 * normals.append(normal)
10597 * normal_indices.append(elements[-2])
10598*/
10599 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 212, __pyx_L1_error)
10600
10601
10602 /* "Isosurface.pyx":213
10603 * normals.append(normal)
10604 * normals.append(normal)
10605 * normals.append(normal) # <<<<<<<<<<<<<<
10606 * normal_indices.append(elements[-2])
10607 * normal = ecross(
10608*/
10609 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 213, __pyx_L1_error)
10610
10611
10612 /* "Isosurface.pyx":214
10613 * normals.append(normal)
10614 * normals.append(normal)
10615 * normal_indices.append(elements[-2]) # <<<<<<<<<<<<<<
10616 * normal = ecross(
10617 * nodes[elements[-1][1]] - nodes[elements[-1][0]],
10618*/
10619 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_elements, -2L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 214, __pyx_L1_error)
10620 __Pyx_GOTREF(__pyx_t_16);
10621 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normal_indices, __pyx_t_16); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 214, __pyx_L1_error)
10622 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
10623
10624
10625 /* "Isosurface.pyx":216
10626 * normal_indices.append(elements[-2])
10627 * normal = ecross(
10628 * nodes[elements[-1][1]] - nodes[elements[-1][0]], # <<<<<<<<<<<<<<
10629 * nodes[elements[-1][2]] - nodes[elements[-1][0]])
10630 * normal /= enorm(normal)
10631*/
10632 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 216, __pyx_L1_error)
10633 __Pyx_GOTREF(__pyx_t_16);
10634 __pyx_t_17 = __Pyx_GetItemInt(__pyx_t_16, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 216, __pyx_L1_error)
10635 __Pyx_GOTREF(__pyx_t_17);
10636 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
10637 __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_17); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 216, __pyx_L1_error)
10638 __Pyx_GOTREF(__pyx_t_16);
10639 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10640 __pyx_t_17 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 216, __pyx_L1_error)
10641 __Pyx_GOTREF(__pyx_t_17);
10642 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_17, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error)
10643 __Pyx_GOTREF(__pyx_t_2);
10644 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10645 __pyx_t_17 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 216, __pyx_L1_error)
10646 __Pyx_GOTREF(__pyx_t_17);
10647 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10648 __pyx_t_2 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_16, __pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error)
10649 __Pyx_GOTREF(__pyx_t_2);
10650 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
10651 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10652 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 216, __pyx_L1_error)
10653
10654 /* "Isosurface.pyx":217
10655 * normal = ecross(
10656 * nodes[elements[-1][1]] - nodes[elements[-1][0]],
10657 * nodes[elements[-1][2]] - nodes[elements[-1][0]]) # <<<<<<<<<<<<<<
10658 * normal /= enorm(normal)
10659 * normals.append(normal)
10660*/
10661 __pyx_t_17 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 217, __pyx_L1_error)
10662 __Pyx_GOTREF(__pyx_t_17);
10663 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_17, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 217, __pyx_L1_error)
10664 __Pyx_GOTREF(__pyx_t_16);
10665 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10666 __pyx_t_17 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_16); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 217, __pyx_L1_error)
10667 __Pyx_GOTREF(__pyx_t_17);
10668 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
10669 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 217, __pyx_L1_error)
10670 __Pyx_GOTREF(__pyx_t_16);
10671 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_16, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __pyx_L1_error)
10672 __Pyx_GOTREF(__pyx_t_3);
10673 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
10674 __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 217, __pyx_L1_error)
10675 __Pyx_GOTREF(__pyx_t_16);
10676 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10677 __pyx_t_3 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_17, __pyx_t_16); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __pyx_L1_error)
10678 __Pyx_GOTREF(__pyx_t_3);
10679 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10680 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
10681 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 217, __pyx_L1_error)
10682
10683 /* "Isosurface.pyx":215
10684 * normals.append(normal)
10685 * normal_indices.append(elements[-2])
10686 * normal = ecross( # <<<<<<<<<<<<<<
10687 * nodes[elements[-1][1]] - nodes[elements[-1][0]],
10688 * nodes[elements[-1][2]] - nodes[elements[-1][0]])
10689*/
10690 __pyx_t_16 = ((PyObject *)__pyx_f_10Isosurface_ecross(((PyArrayObject *)__pyx_t_2), ((PyArrayObject *)__pyx_t_3))); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 215, __pyx_L1_error)
10691 __Pyx_GOTREF(__pyx_t_16);
10692 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10693 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10694 {
10695 __Pyx_BufFmt_StackElem __pyx_stack[1];
10696 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
10697 __pyx_t_10 = __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);
10698 if (unlikely(__pyx_t_10 < 0)) {
10699 __Pyx_PyErr_FetchException(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
10700 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)) {
10701 Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_19);
10702 __Pyx_RaiseBufferFallbackError();
10703 } else {
10704 __Pyx_PyErr_RestoreException(__pyx_t_21, __pyx_t_20, __pyx_t_19);
10705 }
10706 __pyx_t_21 = __pyx_t_20 = __pyx_t_19 = 0;
10707 }
10708 __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];
10709 if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 215, __pyx_L1_error)
10710 }
10711 __Pyx_DECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_16));
10712 __pyx_t_16 = 0;
10713
10714 /* "Isosurface.pyx":218
10715 * nodes[elements[-1][1]] - nodes[elements[-1][0]],
10716 * nodes[elements[-1][2]] - nodes[elements[-1][0]])
10717 * normal /= enorm(normal) # <<<<<<<<<<<<<<
10718 * normals.append(normal)
10719 * normals.append(normal)
10720*/
10721 __pyx_t_18 = __pyx_f_10Isosurface_enorm(((PyArrayObject *)__pyx_v_normal)); if (unlikely(__pyx_t_18 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 218, __pyx_L1_error)
10722 __pyx_t_16 = PyFloat_FromDouble(__pyx_t_18); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 218, __pyx_L1_error)
10723 __Pyx_GOTREF(__pyx_t_16);
10724
10725 __pyx_t_3 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_normal), __pyx_t_16); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error)
10726 __Pyx_GOTREF(__pyx_t_3);
10727 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
10728 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 218, __pyx_L1_error)
10729 {
10730 __Pyx_BufFmt_StackElem __pyx_stack[1];
10731 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
10732 __pyx_t_10 = __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);
10733 if (unlikely(__pyx_t_10 < 0)) {
10734 __Pyx_PyErr_FetchException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
10735 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)) {
10736 Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21);
10737 __Pyx_RaiseBufferFallbackError();
10738 } else {
10739 __Pyx_PyErr_RestoreException(__pyx_t_19, __pyx_t_20, __pyx_t_21);
10740 }
10741 __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0;
10742 }
10743 __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];
10744 if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 218, __pyx_L1_error)
10745 }
10746 __Pyx_DECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_3));
10747 __pyx_t_3 = 0;
10748
10749 /* "Isosurface.pyx":219
10750 * nodes[elements[-1][2]] - nodes[elements[-1][0]])
10751 * normal /= enorm(normal)
10752 * normals.append(normal) # <<<<<<<<<<<<<<
10753 * normals.append(normal)
10754 * normals.append(normal)
10755*/
10756 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 219, __pyx_L1_error)
10757
10758
10759 /* "Isosurface.pyx":220
10760 * normal /= enorm(normal)
10761 * normals.append(normal)
10762 * normals.append(normal) # <<<<<<<<<<<<<<
10763 * normals.append(normal)
10764 * normal_indices.append(elements[-1])
10765*/
10766 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 220, __pyx_L1_error)
10767
10768
10769 /* "Isosurface.pyx":221
10770 * normals.append(normal)
10771 * normals.append(normal)
10772 * normals.append(normal) # <<<<<<<<<<<<<<
10773 * normal_indices.append(elements[-1])
10774 * elif nPlus == 3 and nMinus == 1: # 3 cut edges
10775*/
10776 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 221, __pyx_L1_error)
10777
10778
10779 /* "Isosurface.pyx":222
10780 * normals.append(normal)
10781 * normals.append(normal)
10782 * normal_indices.append(elements[-1]) # <<<<<<<<<<<<<<
10783 * elif nPlus == 3 and nMinus == 1: # 3 cut edges
10784 * I = minus[0]
10785*/
10786 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L1_error)
10787 __Pyx_GOTREF(__pyx_t_3);
10788 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normal_indices, __pyx_t_3); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 222, __pyx_L1_error)
10789 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10790
10791
10792 /* "Isosurface.pyx":186
10793 * assert(nZeros + nMinus + nPlus == 4)
10794 * nN_start = len(nodes)
10795 * if nMinus == 2 and nPlus == 2: # 4 cut edges # <<<<<<<<<<<<<<
10796 * for J in minus:
10797 * for I in plus:
10798*/
10799 goto __pyx_L9;
10800 }
10801
10802 /* "Isosurface.pyx":223
10803 * normals.append(normal)
10804 * normal_indices.append(elements[-1])
10805 * elif nPlus == 3 and nMinus == 1: # 3 cut edges # <<<<<<<<<<<<<<
10806 * I = minus[0]
10807 * for J in plus:
10808*/
10809 __pyx_t_14 = (__pyx_v_nPlus == 3);
10810
10811 if (__pyx_t_14) {
10812
10813 } else {
10814
10815 __pyx_t_4 = __pyx_t_14;
10816
10817 goto __pyx_L24_bool_binop_done;
10818 }
10819 __pyx_t_14 = (__pyx_v_nMinus == 1);
10820
10821
10822 __pyx_t_4 = __pyx_t_14;
10823
10824 __pyx_L24_bool_binop_done:;
10825 if (__pyx_t_4) {
10826
10827
10828 /* "Isosurface.pyx":224
10829 * normal_indices.append(elements[-1])
10830 * elif nPlus == 3 and nMinus == 1: # 3 cut edges
10831 * I = minus[0] # <<<<<<<<<<<<<<
10832 * for J in plus:
10833 * s = -phi[I] / (phi[J] - phi[I])
10834*/
10835 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_minus, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 224, __pyx_L1_error)
10836 __Pyx_GOTREF(__pyx_t_3);
10837 __pyx_t_10 = __Pyx_PyLong_As_int(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L1_error)
10838 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10839 __pyx_v_I = __pyx_t_10;
10840
10841 /* "Isosurface.pyx":225
10842 * elif nPlus == 3 and nMinus == 1: # 3 cut edges
10843 * I = minus[0]
10844 * for J in plus: # <<<<<<<<<<<<<<
10845 * s = -phi[I] / (phi[J] - phi[I])
10846 * x = s * (self.nodeArray[J] - self.nodeArray[I]) + \
10847*/
10848 __pyx_t_3 = __pyx_v_plus; __Pyx_INCREF(__pyx_t_3);
10849 __pyx_t_13 = 0;
10850 for (;;) {
10851 {
10852 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
10853 #if !CYTHON_ASSUME_SAFE_SIZE
10854 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 225, __pyx_L1_error)
10855 #endif
10856 if (__pyx_t_13 >= __pyx_temp) break;
10857 }
10858 __pyx_t_16 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_13, __Pyx_ReferenceSharing_OwnStrongReference);
10859 ++__pyx_t_13;
10860 if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 225, __pyx_L1_error)
10861 __Pyx_GOTREF(__pyx_t_16);
10862 __pyx_t_10 = __Pyx_PyLong_As_int(__pyx_t_16); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L1_error)
10863 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
10864 __pyx_v_J = __pyx_t_10;
10865
10866 /* "Isosurface.pyx":226
10867 * I = minus[0]
10868 * for J in plus:
10869 * s = -phi[I] / (phi[J] - phi[I]) # <<<<<<<<<<<<<<
10870 * x = s * (self.nodeArray[J] - self.nodeArray[I]) + \
10871 * self.nodeArray[I]
10872*/
10873 __pyx_t_16 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 226, __pyx_L1_error)
10874 __Pyx_GOTREF(__pyx_t_16);
10875 __pyx_t_2 = PyNumber_Negative(__pyx_t_16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error)
10876 __Pyx_GOTREF(__pyx_t_2);
10877 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
10878 __pyx_t_16 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_J, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 226, __pyx_L1_error)
10879 __Pyx_GOTREF(__pyx_t_16);
10880 __pyx_t_17 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 226, __pyx_L1_error)
10881 __Pyx_GOTREF(__pyx_t_17);
10882 __pyx_t_1 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_16, __pyx_t_17); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
10883 __Pyx_GOTREF(__pyx_t_1);
10884 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
10885 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10886 __pyx_t_17 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 226, __pyx_L1_error)
10887 __Pyx_GOTREF(__pyx_t_17);
10888 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10889 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10890 __pyx_t_18 = __Pyx_PyFloat_AsDouble(__pyx_t_17); if (unlikely((__pyx_t_18 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L1_error)
10891 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10892 __pyx_v_s = __pyx_t_18;
10893
10894 /* "Isosurface.pyx":227
10895 * for J in plus:
10896 * s = -phi[I] / (phi[J] - phi[I])
10897 * x = s * (self.nodeArray[J] - self.nodeArray[I]) + \ # <<<<<<<<<<<<<<
10898 * self.nodeArray[I]
10899 * nodes.append(x)
10900*/
10901 __pyx_t_17 = PyFloat_FromDouble(__pyx_v_s); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 227, __pyx_L1_error)
10902 __Pyx_GOTREF(__pyx_t_17);
10903 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
10904 __Pyx_GOTREF(__pyx_t_1);
10905 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_J, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error)
10906 __Pyx_GOTREF(__pyx_t_2);
10907 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10908 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
10909 __Pyx_GOTREF(__pyx_t_1);
10910 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_I, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 227, __pyx_L1_error)
10911 __Pyx_GOTREF(__pyx_t_16);
10912 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10913 __pyx_t_1 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_2, __pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
10914 __Pyx_GOTREF(__pyx_t_1);
10915 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10916 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
10917 __pyx_t_16 = __Pyx_PyNumber_Multiply_float_object(__pyx_t_17, __pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 227, __pyx_L1_error)
10918 __Pyx_GOTREF(__pyx_t_16);
10919 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10920 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10921
10922 /* "Isosurface.pyx":228
10923 * s = -phi[I] / (phi[J] - phi[I])
10924 * x = s * (self.nodeArray[J] - self.nodeArray[I]) + \
10925 * self.nodeArray[I] # <<<<<<<<<<<<<<
10926 * nodes.append(x)
10927 * elements.append([nN_start + j for j in range(3)])
10928*/
10929 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
10930 __Pyx_GOTREF(__pyx_t_1);
10931 __pyx_t_17 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_I, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 228, __pyx_L1_error)
10932 __Pyx_GOTREF(__pyx_t_17);
10933 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10934
10935 /* "Isosurface.pyx":227
10936 * for J in plus:
10937 * s = -phi[I] / (phi[J] - phi[I])
10938 * x = s * (self.nodeArray[J] - self.nodeArray[I]) + \ # <<<<<<<<<<<<<<
10939 * self.nodeArray[I]
10940 * nodes.append(x)
10941*/
10942 __pyx_t_1 = __Pyx_PyNumber_Add_object_object(__pyx_t_16, __pyx_t_17); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
10943 __Pyx_GOTREF(__pyx_t_1);
10944 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
10945 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
10946 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 227, __pyx_L1_error)
10947 {
10948 __Pyx_BufFmt_StackElem __pyx_stack[1];
10949 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
10950 __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
10951 if (unlikely(__pyx_t_10 < 0)) {
10952 __Pyx_PyErr_FetchException(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
10953 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)) {
10954 Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_19);
10955 __Pyx_RaiseBufferFallbackError();
10956 } else {
10957 __Pyx_PyErr_RestoreException(__pyx_t_21, __pyx_t_20, __pyx_t_19);
10958 }
10959 __pyx_t_21 = __pyx_t_20 = __pyx_t_19 = 0;
10960 }
10961 __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];
10962 if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 227, __pyx_L1_error)
10963 }
10964 __Pyx_XDECREF_SET(__pyx_v_x, ((PyArrayObject *)__pyx_t_1));
10965 __pyx_t_1 = 0;
10966
10967 /* "Isosurface.pyx":229
10968 * x = s * (self.nodeArray[J] - self.nodeArray[I]) + \
10969 * self.nodeArray[I]
10970 * nodes.append(x) # <<<<<<<<<<<<<<
10971 * elements.append([nN_start + j for j in range(3)])
10972 * if etriple(self.nodeArray[minus[0]] - nodes[-3],
10973*/
10974 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_nodes, ((PyObject *)__pyx_v_x)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 229, __pyx_L1_error)
10975
10976
10977 /* "Isosurface.pyx":225
10978 * elif nPlus == 3 and nMinus == 1: # 3 cut edges
10979 * I = minus[0]
10980 * for J in plus: # <<<<<<<<<<<<<<
10981 * s = -phi[I] / (phi[J] - phi[I])
10982 * x = s * (self.nodeArray[J] - self.nodeArray[I]) + \
10983*/
10984 }
10985 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10986
10987 /* "Isosurface.pyx":230
10988 * self.nodeArray[I]
10989 * nodes.append(x)
10990 * elements.append([nN_start + j for j in range(3)]) # <<<<<<<<<<<<<<
10991 * if etriple(self.nodeArray[minus[0]] - nodes[-3],
10992 * nodes[-2] - nodes[-3],
10993*/
10994 { /* enter inner scope */
10995 __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error)
10996 __Pyx_GOTREF(__pyx_t_3);
10997 for (__pyx_t_22 = 0; __pyx_t_22 < 3; __pyx_t_22+=1) {
10998 __pyx_8genexpr4__pyx_v_j = __pyx_t_22;
10999 __pyx_t_1 = __Pyx_PyLong_From_long((__pyx_v_nN_start + __pyx_8genexpr4__pyx_v_j)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
11000 __Pyx_GOTREF(__pyx_t_1);
11001 __Pyx_GIVEREF(__pyx_t_1);
11002 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_3, __pyx_t_1))) __PYX_ERR(0, 230, __pyx_L1_error)
11003 __pyx_t_1 = 0;
11004 }
11005 } /* exit inner scope */
11006 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_elements, __pyx_t_3); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 230, __pyx_L1_error)
11007 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11008
11009
11010 /* "Isosurface.pyx":231
11011 * nodes.append(x)
11012 * elements.append([nN_start + j for j in range(3)])
11013 * if etriple(self.nodeArray[minus[0]] - nodes[-3], # <<<<<<<<<<<<<<
11014 * nodes[-2] - nodes[-3],
11015 * nodes[-1] - nodes[-3]) > 0.0:
11016*/
11017 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error)
11018 __Pyx_GOTREF(__pyx_t_3);
11019 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_minus, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
11020 __Pyx_GOTREF(__pyx_t_1);
11021 __pyx_t_17 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 231, __pyx_L1_error)
11022 __Pyx_GOTREF(__pyx_t_17);
11023 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11024 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11025 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
11026 __Pyx_GOTREF(__pyx_t_1);
11027 __pyx_t_3 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_17, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error)
11028 __Pyx_GOTREF(__pyx_t_3);
11029 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
11030 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11031 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 231, __pyx_L1_error)
11032
11033 /* "Isosurface.pyx":232
11034 * elements.append([nN_start + j for j in range(3)])
11035 * if etriple(self.nodeArray[minus[0]] - nodes[-3],
11036 * nodes[-2] - nodes[-3], # <<<<<<<<<<<<<<
11037 * nodes[-1] - nodes[-3]) > 0.0:
11038 * elements[-1] = [elements[-1][0],
11039*/
11040 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_nodes, -2L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
11041 __Pyx_GOTREF(__pyx_t_1);
11042 __pyx_t_17 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 232, __pyx_L1_error)
11043 __Pyx_GOTREF(__pyx_t_17);
11044 __pyx_t_16 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_1, __pyx_t_17); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 232, __pyx_L1_error)
11045 __Pyx_GOTREF(__pyx_t_16);
11046 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11047 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
11048 if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 232, __pyx_L1_error)
11049
11050 /* "Isosurface.pyx":233
11051 * if etriple(self.nodeArray[minus[0]] - nodes[-3],
11052 * nodes[-2] - nodes[-3],
11053 * nodes[-1] - nodes[-3]) > 0.0: # <<<<<<<<<<<<<<
11054 * elements[-1] = [elements[-1][0],
11055 * elements[-1][2],
11056*/
11057 __pyx_t_17 = __Pyx_GetItemInt_List(__pyx_v_nodes, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 233, __pyx_L1_error)
11058 __Pyx_GOTREF(__pyx_t_17);
11059 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error)
11060 __Pyx_GOTREF(__pyx_t_1);
11061 __pyx_t_2 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_17, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error)
11062 __Pyx_GOTREF(__pyx_t_2);
11063 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
11064 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11065 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 233, __pyx_L1_error)
11066
11067 /* "Isosurface.pyx":231
11068 * nodes.append(x)
11069 * elements.append([nN_start + j for j in range(3)])
11070 * if etriple(self.nodeArray[minus[0]] - nodes[-3], # <<<<<<<<<<<<<<
11071 * nodes[-2] - nodes[-3],
11072 * nodes[-1] - nodes[-3]) > 0.0:
11073*/
11074 __pyx_t_18 = __pyx_f_10Isosurface_etriple(((PyArrayObject *)__pyx_t_3), ((PyArrayObject *)__pyx_t_16), ((PyArrayObject *)__pyx_t_2)); if (unlikely(__pyx_t_18 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 231, __pyx_L1_error)
11075 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11076 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
11077 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11078
11079 /* "Isosurface.pyx":233
11080 * if etriple(self.nodeArray[minus[0]] - nodes[-3],
11081 * nodes[-2] - nodes[-3],
11082 * nodes[-1] - nodes[-3]) > 0.0: # <<<<<<<<<<<<<<
11083 * elements[-1] = [elements[-1][0],
11084 * elements[-1][2],
11085*/
11086 __pyx_t_4 = (__pyx_t_18 > 0.0);
11087
11088
11089
11090 /* "Isosurface.pyx":231
11091 * nodes.append(x)
11092 * elements.append([nN_start + j for j in range(3)])
11093 * if etriple(self.nodeArray[minus[0]] - nodes[-3], # <<<<<<<<<<<<<<
11094 * nodes[-2] - nodes[-3],
11095 * nodes[-1] - nodes[-3]) > 0.0:
11096*/
11097 if (__pyx_t_4) {
11098
11099
11100 /* "Isosurface.pyx":234
11101 * nodes[-2] - nodes[-3],
11102 * nodes[-1] - nodes[-3]) > 0.0:
11103 * elements[-1] = [elements[-1][0], # <<<<<<<<<<<<<<
11104 * elements[-1][2],
11105 * elements[-1][1]]
11106*/
11107 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
11108 __Pyx_GOTREF(__pyx_t_2);
11109 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 234, __pyx_L1_error)
11110 __Pyx_GOTREF(__pyx_t_16);
11111 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11112
11113 /* "Isosurface.pyx":235
11114 * nodes[-1] - nodes[-3]) > 0.0:
11115 * elements[-1] = [elements[-1][0],
11116 * elements[-1][2], # <<<<<<<<<<<<<<
11117 * elements[-1][1]]
11118 * normal = ecross(
11119*/
11120 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error)
11121 __Pyx_GOTREF(__pyx_t_2);
11122 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error)
11123 __Pyx_GOTREF(__pyx_t_3);
11124 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11125
11126 /* "Isosurface.pyx":236
11127 * elements[-1] = [elements[-1][0],
11128 * elements[-1][2],
11129 * elements[-1][1]] # <<<<<<<<<<<<<<
11130 * normal = ecross(
11131 * nodes[elements[-1][1]] - nodes[elements[-1][0]],
11132*/
11133 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
11134 __Pyx_GOTREF(__pyx_t_2);
11135 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error)
11136 __Pyx_GOTREF(__pyx_t_1);
11137 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11138
11139 /* "Isosurface.pyx":234
11140 * nodes[-2] - nodes[-3],
11141 * nodes[-1] - nodes[-3]) > 0.0:
11142 * elements[-1] = [elements[-1][0], # <<<<<<<<<<<<<<
11143 * elements[-1][2],
11144 * elements[-1][1]]
11145*/
11146 __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
11147 __Pyx_GOTREF(__pyx_t_2);
11148 __Pyx_GIVEREF(__pyx_t_16);
11149 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_16) != (0)) __PYX_ERR(0, 234, __pyx_L1_error);
11150 __Pyx_GIVEREF(__pyx_t_3);
11151 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 234, __pyx_L1_error);
11152 __Pyx_GIVEREF(__pyx_t_1);
11153 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_1) != (0)) __PYX_ERR(0, 234, __pyx_L1_error);
11154 __pyx_t_16 = 0;
11155 __pyx_t_3 = 0;
11156 __pyx_t_1 = 0;
11157 if (unlikely((__Pyx_SetItemInt(__pyx_v_elements, -1L, __pyx_t_2, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 234, __pyx_L1_error)
11158 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11159
11160 /* "Isosurface.pyx":231
11161 * nodes.append(x)
11162 * elements.append([nN_start + j for j in range(3)])
11163 * if etriple(self.nodeArray[minus[0]] - nodes[-3], # <<<<<<<<<<<<<<
11164 * nodes[-2] - nodes[-3],
11165 * nodes[-1] - nodes[-3]) > 0.0:
11166*/
11167 }
11168
11169 /* "Isosurface.pyx":238
11170 * elements[-1][1]]
11171 * normal = ecross(
11172 * nodes[elements[-1][1]] - nodes[elements[-1][0]], # <<<<<<<<<<<<<<
11173 * nodes[elements[-1][2]] - nodes[elements[-1][0]])
11174 * normal /= enorm(normal)
11175*/
11176 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error)
11177 __Pyx_GOTREF(__pyx_t_2);
11178 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
11179 __Pyx_GOTREF(__pyx_t_1);
11180 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11181 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error)
11182 __Pyx_GOTREF(__pyx_t_2);
11183 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11184 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
11185 __Pyx_GOTREF(__pyx_t_1);
11186 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error)
11187 __Pyx_GOTREF(__pyx_t_3);
11188 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11189 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
11190 __Pyx_GOTREF(__pyx_t_1);
11191 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11192 __pyx_t_3 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error)
11193 __Pyx_GOTREF(__pyx_t_3);
11194 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11195 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11196 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 238, __pyx_L1_error)
11197
11198 /* "Isosurface.pyx":239
11199 * normal = ecross(
11200 * nodes[elements[-1][1]] - nodes[elements[-1][0]],
11201 * nodes[elements[-1][2]] - nodes[elements[-1][0]]) # <<<<<<<<<<<<<<
11202 * normal /= enorm(normal)
11203 * normals.append(normal)
11204*/
11205 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error)
11206 __Pyx_GOTREF(__pyx_t_1);
11207 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error)
11208 __Pyx_GOTREF(__pyx_t_2);
11209 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11210 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error)
11211 __Pyx_GOTREF(__pyx_t_1);
11212 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11213 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error)
11214 __Pyx_GOTREF(__pyx_t_2);
11215 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 239, __pyx_L1_error)
11216 __Pyx_GOTREF(__pyx_t_16);
11217 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11218 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error)
11219 __Pyx_GOTREF(__pyx_t_2);
11220 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
11221 __pyx_t_16 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 239, __pyx_L1_error)
11222 __Pyx_GOTREF(__pyx_t_16);
11223 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11224 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11225 if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 239, __pyx_L1_error)
11226
11227 /* "Isosurface.pyx":237
11228 * elements[-1][2],
11229 * elements[-1][1]]
11230 * normal = ecross( # <<<<<<<<<<<<<<
11231 * nodes[elements[-1][1]] - nodes[elements[-1][0]],
11232 * nodes[elements[-1][2]] - nodes[elements[-1][0]])
11233*/
11234 __pyx_t_2 = ((PyObject *)__pyx_f_10Isosurface_ecross(((PyArrayObject *)__pyx_t_3), ((PyArrayObject *)__pyx_t_16))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error)
11235 __Pyx_GOTREF(__pyx_t_2);
11236 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11237 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
11238 {
11239 __Pyx_BufFmt_StackElem __pyx_stack[1];
11240 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
11241 __pyx_t_10 = __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);
11242 if (unlikely(__pyx_t_10 < 0)) {
11243 __Pyx_PyErr_FetchException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
11244 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)) {
11245 Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21);
11246 __Pyx_RaiseBufferFallbackError();
11247 } else {
11248 __Pyx_PyErr_RestoreException(__pyx_t_19, __pyx_t_20, __pyx_t_21);
11249 }
11250 __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0;
11251 }
11252 __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];
11253 if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 237, __pyx_L1_error)
11254 }
11255 __Pyx_XDECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_2));
11256 __pyx_t_2 = 0;
11257
11258 /* "Isosurface.pyx":240
11259 * nodes[elements[-1][1]] - nodes[elements[-1][0]],
11260 * nodes[elements[-1][2]] - nodes[elements[-1][0]])
11261 * normal /= enorm(normal) # <<<<<<<<<<<<<<
11262 * normals.append(normal)
11263 * normals.append(normal)
11264*/
11265 __pyx_t_18 = __pyx_f_10Isosurface_enorm(((PyArrayObject *)__pyx_v_normal)); if (unlikely(__pyx_t_18 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 240, __pyx_L1_error)
11266 __pyx_t_2 = PyFloat_FromDouble(__pyx_t_18); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error)
11267 __Pyx_GOTREF(__pyx_t_2);
11268
11269 __pyx_t_16 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_normal), __pyx_t_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 240, __pyx_L1_error)
11270 __Pyx_GOTREF(__pyx_t_16);
11271 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11272 if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 240, __pyx_L1_error)
11273 {
11274 __Pyx_BufFmt_StackElem __pyx_stack[1];
11275 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
11276 __pyx_t_10 = __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);
11277 if (unlikely(__pyx_t_10 < 0)) {
11278 __Pyx_PyErr_FetchException(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
11279 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)) {
11280 Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_19);
11281 __Pyx_RaiseBufferFallbackError();
11282 } else {
11283 __Pyx_PyErr_RestoreException(__pyx_t_21, __pyx_t_20, __pyx_t_19);
11284 }
11285 __pyx_t_21 = __pyx_t_20 = __pyx_t_19 = 0;
11286 }
11287 __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];
11288 if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 240, __pyx_L1_error)
11289 }
11290 __Pyx_DECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_16));
11291 __pyx_t_16 = 0;
11292
11293 /* "Isosurface.pyx":241
11294 * nodes[elements[-1][2]] - nodes[elements[-1][0]])
11295 * normal /= enorm(normal)
11296 * normals.append(normal) # <<<<<<<<<<<<<<
11297 * normals.append(normal)
11298 * normals.append(normal)
11299*/
11300 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 241, __pyx_L1_error)
11301
11302
11303 /* "Isosurface.pyx":242
11304 * normal /= enorm(normal)
11305 * normals.append(normal)
11306 * normals.append(normal) # <<<<<<<<<<<<<<
11307 * normals.append(normal)
11308 * normal_indices.append(elements[-1])
11309*/
11310 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 242, __pyx_L1_error)
11311
11312
11313 /* "Isosurface.pyx":243
11314 * normals.append(normal)
11315 * normals.append(normal)
11316 * normals.append(normal) # <<<<<<<<<<<<<<
11317 * normal_indices.append(elements[-1])
11318 * elif nMinus == 3 and nPlus == 1: # 3 cut edges
11319*/
11320 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 243, __pyx_L1_error)
11321
11322
11323 /* "Isosurface.pyx":244
11324 * normals.append(normal)
11325 * normals.append(normal)
11326 * normal_indices.append(elements[-1]) # <<<<<<<<<<<<<<
11327 * elif nMinus == 3 and nPlus == 1: # 3 cut edges
11328 * I = plus[0]
11329*/
11330 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 244, __pyx_L1_error)
11331 __Pyx_GOTREF(__pyx_t_16);
11332 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normal_indices, __pyx_t_16); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 244, __pyx_L1_error)
11333 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
11334
11335
11336 /* "Isosurface.pyx":223
11337 * normals.append(normal)
11338 * normal_indices.append(elements[-1])
11339 * elif nPlus == 3 and nMinus == 1: # 3 cut edges # <<<<<<<<<<<<<<
11340 * I = minus[0]
11341 * for J in plus:
11342*/
11343 goto __pyx_L9;
11344 }
11345
11346 /* "Isosurface.pyx":245
11347 * normals.append(normal)
11348 * normal_indices.append(elements[-1])
11349 * elif nMinus == 3 and nPlus == 1: # 3 cut edges # <<<<<<<<<<<<<<
11350 * I = plus[0]
11351 * for J in minus:
11352*/
11353 __pyx_t_14 = (__pyx_v_nMinus == 3);
11354
11355 if (__pyx_t_14) {
11356
11357 } else {
11358
11359 __pyx_t_4 = __pyx_t_14;
11360
11361 goto __pyx_L32_bool_binop_done;
11362 }
11363 __pyx_t_14 = (__pyx_v_nPlus == 1);
11364
11365
11366 __pyx_t_4 = __pyx_t_14;
11367
11368 __pyx_L32_bool_binop_done:;
11369 if (__pyx_t_4) {
11370
11371
11372 /* "Isosurface.pyx":246
11373 * normal_indices.append(elements[-1])
11374 * elif nMinus == 3 and nPlus == 1: # 3 cut edges
11375 * I = plus[0] # <<<<<<<<<<<<<<
11376 * for J in minus:
11377 * s = -phi[I] / (phi[J] - phi[I])
11378*/
11379 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_plus, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 246, __pyx_L1_error)
11380 __Pyx_GOTREF(__pyx_t_16);
11381 __pyx_t_10 = __Pyx_PyLong_As_int(__pyx_t_16); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 246, __pyx_L1_error)
11382 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
11383 __pyx_v_I = __pyx_t_10;
11384
11385 /* "Isosurface.pyx":247
11386 * elif nMinus == 3 and nPlus == 1: # 3 cut edges
11387 * I = plus[0]
11388 * for J in minus: # <<<<<<<<<<<<<<
11389 * s = -phi[I] / (phi[J] - phi[I])
11390 * x = s * (self.nodeArray[J] - self.nodeArray[I]) + \
11391*/
11392 __pyx_t_16 = __pyx_v_minus; __Pyx_INCREF(__pyx_t_16);
11393 __pyx_t_13 = 0;
11394 for (;;) {
11395 {
11396 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_16);
11397 #if !CYTHON_ASSUME_SAFE_SIZE
11398 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 247, __pyx_L1_error)
11399 #endif
11400 if (__pyx_t_13 >= __pyx_temp) break;
11401 }
11402 __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_16, __pyx_t_13, __Pyx_ReferenceSharing_OwnStrongReference);
11403 ++__pyx_t_13;
11404 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 247, __pyx_L1_error)
11405 __Pyx_GOTREF(__pyx_t_2);
11406 __pyx_t_10 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 247, __pyx_L1_error)
11407 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11408 __pyx_v_J = __pyx_t_10;
11409
11410 /* "Isosurface.pyx":248
11411 * I = plus[0]
11412 * for J in minus:
11413 * s = -phi[I] / (phi[J] - phi[I]) # <<<<<<<<<<<<<<
11414 * x = s * (self.nodeArray[J] - self.nodeArray[I]) + \
11415 * self.nodeArray[I]
11416*/
11417 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error)
11418 __Pyx_GOTREF(__pyx_t_2);
11419 __pyx_t_3 = PyNumber_Negative(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error)
11420 __Pyx_GOTREF(__pyx_t_3);
11421 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11422 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_J, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error)
11423 __Pyx_GOTREF(__pyx_t_2);
11424 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
11425 __Pyx_GOTREF(__pyx_t_1);
11426 __pyx_t_17 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 248, __pyx_L1_error)
11427 __Pyx_GOTREF(__pyx_t_17);
11428 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11429 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11430 __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_17); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
11431 __Pyx_GOTREF(__pyx_t_1);
11432 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11433 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
11434 __pyx_t_18 = __Pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_18 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 248, __pyx_L1_error)
11435 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11436 __pyx_v_s = __pyx_t_18;
11437
11438 /* "Isosurface.pyx":249
11439 * for J in minus:
11440 * s = -phi[I] / (phi[J] - phi[I])
11441 * x = s * (self.nodeArray[J] - self.nodeArray[I]) + \ # <<<<<<<<<<<<<<
11442 * self.nodeArray[I]
11443 * nodes.append(x)
11444*/
11445 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_s); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error)
11446 __Pyx_GOTREF(__pyx_t_1);
11447 __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 249, __pyx_L1_error)
11448 __Pyx_GOTREF(__pyx_t_17);
11449 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_17, __pyx_v_J, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error)
11450 __Pyx_GOTREF(__pyx_t_3);
11451 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
11452 __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 249, __pyx_L1_error)
11453 __Pyx_GOTREF(__pyx_t_17);
11454 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_17, __pyx_v_I, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error)
11455 __Pyx_GOTREF(__pyx_t_2);
11456 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
11457 __pyx_t_17 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 249, __pyx_L1_error)
11458 __Pyx_GOTREF(__pyx_t_17);
11459 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11460 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11461 __pyx_t_2 = __Pyx_PyNumber_Multiply_float_object(__pyx_t_1, __pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error)
11462 __Pyx_GOTREF(__pyx_t_2);
11463 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11464 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
11465
11466 /* "Isosurface.pyx":250
11467 * s = -phi[I] / (phi[J] - phi[I])
11468 * x = s * (self.nodeArray[J] - self.nodeArray[I]) + \
11469 * self.nodeArray[I] # <<<<<<<<<<<<<<
11470 * nodes.append(x)
11471 * elements.append([nN_start + j for j in range(3)])
11472*/
11473 __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 250, __pyx_L1_error)
11474 __Pyx_GOTREF(__pyx_t_17);
11475 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_17, __pyx_v_I, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error)
11476 __Pyx_GOTREF(__pyx_t_1);
11477 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
11478
11479 /* "Isosurface.pyx":249
11480 * for J in minus:
11481 * s = -phi[I] / (phi[J] - phi[I])
11482 * x = s * (self.nodeArray[J] - self.nodeArray[I]) + \ # <<<<<<<<<<<<<<
11483 * self.nodeArray[I]
11484 * nodes.append(x)
11485*/
11486 __pyx_t_17 = __Pyx_PyNumber_Add_object_object(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 249, __pyx_L1_error)
11487 __Pyx_GOTREF(__pyx_t_17);
11488 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11489 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11490 if (!(likely(((__pyx_t_17) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_17, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 249, __pyx_L1_error)
11491 {
11492 __Pyx_BufFmt_StackElem __pyx_stack[1];
11493 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
11494 __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_17), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
11495 if (unlikely(__pyx_t_10 < 0)) {
11496 __Pyx_PyErr_FetchException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
11497 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)) {
11498 Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21);
11499 __Pyx_RaiseBufferFallbackError();
11500 } else {
11501 __Pyx_PyErr_RestoreException(__pyx_t_19, __pyx_t_20, __pyx_t_21);
11502 }
11503 __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0;
11504 }
11505 __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];
11506 if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 249, __pyx_L1_error)
11507 }
11508 __Pyx_XDECREF_SET(__pyx_v_x, ((PyArrayObject *)__pyx_t_17));
11509 __pyx_t_17 = 0;
11510
11511 /* "Isosurface.pyx":251
11512 * x = s * (self.nodeArray[J] - self.nodeArray[I]) + \
11513 * self.nodeArray[I]
11514 * nodes.append(x) # <<<<<<<<<<<<<<
11515 * elements.append([nN_start + j for j in range(3)])
11516 * if etriple(self.nodeArray[plus[0]] - nodes[-3],
11517*/
11518 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_nodes, ((PyObject *)__pyx_v_x)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 251, __pyx_L1_error)
11519
11520
11521 /* "Isosurface.pyx":247
11522 * elif nMinus == 3 and nPlus == 1: # 3 cut edges
11523 * I = plus[0]
11524 * for J in minus: # <<<<<<<<<<<<<<
11525 * s = -phi[I] / (phi[J] - phi[I])
11526 * x = s * (self.nodeArray[J] - self.nodeArray[I]) + \
11527*/
11528 }
11529 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
11530
11531 /* "Isosurface.pyx":252
11532 * self.nodeArray[I]
11533 * nodes.append(x)
11534 * elements.append([nN_start + j for j in range(3)]) # <<<<<<<<<<<<<<
11535 * if etriple(self.nodeArray[plus[0]] - nodes[-3],
11536 * nodes[-2] - nodes[-3],
11537*/
11538 { /* enter inner scope */
11539 __pyx_t_16 = PyList_New(0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 252, __pyx_L1_error)
11540 __Pyx_GOTREF(__pyx_t_16);
11541 for (__pyx_t_22 = 0; __pyx_t_22 < 3; __pyx_t_22+=1) {
11542 __pyx_8genexpr5__pyx_v_j = __pyx_t_22;
11543 __pyx_t_17 = __Pyx_PyLong_From_long((__pyx_v_nN_start + __pyx_8genexpr5__pyx_v_j)); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 252, __pyx_L1_error)
11544 __Pyx_GOTREF(__pyx_t_17);
11545 __Pyx_GIVEREF(__pyx_t_17);
11546 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_16, __pyx_t_17))) __PYX_ERR(0, 252, __pyx_L1_error)
11547 __pyx_t_17 = 0;
11548 }
11549 } /* exit inner scope */
11550 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_elements, __pyx_t_16); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 252, __pyx_L1_error)
11551 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
11552
11553
11554 /* "Isosurface.pyx":253
11555 * nodes.append(x)
11556 * elements.append([nN_start + j for j in range(3)])
11557 * if etriple(self.nodeArray[plus[0]] - nodes[-3], # <<<<<<<<<<<<<<
11558 * nodes[-2] - nodes[-3],
11559 * nodes[-1] - nodes[-3]) < 0.0:
11560*/
11561 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 253, __pyx_L1_error)
11562 __Pyx_GOTREF(__pyx_t_16);
11563 __pyx_t_17 = __Pyx_GetItemInt_List(__pyx_v_plus, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 253, __pyx_L1_error)
11564 __Pyx_GOTREF(__pyx_t_17);
11565 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_16, __pyx_t_17); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error)
11566 __Pyx_GOTREF(__pyx_t_1);
11567 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
11568 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
11569 __pyx_t_17 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 253, __pyx_L1_error)
11570 __Pyx_GOTREF(__pyx_t_17);
11571 __pyx_t_16 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_1, __pyx_t_17); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 253, __pyx_L1_error)
11572 __Pyx_GOTREF(__pyx_t_16);
11573 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11574 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
11575 if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 253, __pyx_L1_error)
11576
11577 /* "Isosurface.pyx":254
11578 * elements.append([nN_start + j for j in range(3)])
11579 * if etriple(self.nodeArray[plus[0]] - nodes[-3],
11580 * nodes[-2] - nodes[-3], # <<<<<<<<<<<<<<
11581 * nodes[-1] - nodes[-3]) < 0.0:
11582 * elements[-1] = [elements[-1][0],
11583*/
11584 __pyx_t_17 = __Pyx_GetItemInt_List(__pyx_v_nodes, -2L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 254, __pyx_L1_error)
11585 __Pyx_GOTREF(__pyx_t_17);
11586 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error)
11587 __Pyx_GOTREF(__pyx_t_1);
11588 __pyx_t_2 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_17, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error)
11589 __Pyx_GOTREF(__pyx_t_2);
11590 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
11591 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11592 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 254, __pyx_L1_error)
11593
11594 /* "Isosurface.pyx":255
11595 * if etriple(self.nodeArray[plus[0]] - nodes[-3],
11596 * nodes[-2] - nodes[-3],
11597 * nodes[-1] - nodes[-3]) < 0.0: # <<<<<<<<<<<<<<
11598 * elements[-1] = [elements[-1][0],
11599 * elements[-1][2],
11600*/
11601 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_nodes, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error)
11602 __Pyx_GOTREF(__pyx_t_1);
11603 __pyx_t_17 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 255, __pyx_L1_error)
11604 __Pyx_GOTREF(__pyx_t_17);
11605 __pyx_t_3 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_1, __pyx_t_17); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 255, __pyx_L1_error)
11606 __Pyx_GOTREF(__pyx_t_3);
11607 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11608 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
11609 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 255, __pyx_L1_error)
11610
11611 /* "Isosurface.pyx":253
11612 * nodes.append(x)
11613 * elements.append([nN_start + j for j in range(3)])
11614 * if etriple(self.nodeArray[plus[0]] - nodes[-3], # <<<<<<<<<<<<<<
11615 * nodes[-2] - nodes[-3],
11616 * nodes[-1] - nodes[-3]) < 0.0:
11617*/
11618 __pyx_t_18 = __pyx_f_10Isosurface_etriple(((PyArrayObject *)__pyx_t_16), ((PyArrayObject *)__pyx_t_2), ((PyArrayObject *)__pyx_t_3)); if (unlikely(__pyx_t_18 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 253, __pyx_L1_error)
11619 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
11620 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11621 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11622
11623 /* "Isosurface.pyx":255
11624 * if etriple(self.nodeArray[plus[0]] - nodes[-3],
11625 * nodes[-2] - nodes[-3],
11626 * nodes[-1] - nodes[-3]) < 0.0: # <<<<<<<<<<<<<<
11627 * elements[-1] = [elements[-1][0],
11628 * elements[-1][2],
11629*/
11630 __pyx_t_4 = (__pyx_t_18 < 0.0);
11631
11632
11633
11634 /* "Isosurface.pyx":253
11635 * nodes.append(x)
11636 * elements.append([nN_start + j for j in range(3)])
11637 * if etriple(self.nodeArray[plus[0]] - nodes[-3], # <<<<<<<<<<<<<<
11638 * nodes[-2] - nodes[-3],
11639 * nodes[-1] - nodes[-3]) < 0.0:
11640*/
11641 if (__pyx_t_4) {
11642
11643
11644 /* "Isosurface.pyx":256
11645 * nodes[-2] - nodes[-3],
11646 * nodes[-1] - nodes[-3]) < 0.0:
11647 * elements[-1] = [elements[-1][0], # <<<<<<<<<<<<<<
11648 * elements[-1][2],
11649 * elements[-1][1]]
11650*/
11651 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error)
11652 __Pyx_GOTREF(__pyx_t_3);
11653 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error)
11654 __Pyx_GOTREF(__pyx_t_2);
11655 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11656
11657 /* "Isosurface.pyx":257
11658 * nodes[-1] - nodes[-3]) < 0.0:
11659 * elements[-1] = [elements[-1][0],
11660 * elements[-1][2], # <<<<<<<<<<<<<<
11661 * elements[-1][1]]
11662 * normal = ecross(
11663*/
11664 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error)
11665 __Pyx_GOTREF(__pyx_t_3);
11666 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_3, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 257, __pyx_L1_error)
11667 __Pyx_GOTREF(__pyx_t_16);
11668 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11669
11670 /* "Isosurface.pyx":258
11671 * elements[-1] = [elements[-1][0],
11672 * elements[-1][2],
11673 * elements[-1][1]] # <<<<<<<<<<<<<<
11674 * normal = ecross(
11675 * nodes[elements[-1][1]] - nodes[elements[-1][0]],
11676*/
11677 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error)
11678 __Pyx_GOTREF(__pyx_t_3);
11679 __pyx_t_17 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 258, __pyx_L1_error)
11680 __Pyx_GOTREF(__pyx_t_17);
11681 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11682
11683 /* "Isosurface.pyx":256
11684 * nodes[-2] - nodes[-3],
11685 * nodes[-1] - nodes[-3]) < 0.0:
11686 * elements[-1] = [elements[-1][0], # <<<<<<<<<<<<<<
11687 * elements[-1][2],
11688 * elements[-1][1]]
11689*/
11690 __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error)
11691 __Pyx_GOTREF(__pyx_t_3);
11692 __Pyx_GIVEREF(__pyx_t_2);
11693 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 256, __pyx_L1_error);
11694 __Pyx_GIVEREF(__pyx_t_16);
11695 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_16) != (0)) __PYX_ERR(0, 256, __pyx_L1_error);
11696 __Pyx_GIVEREF(__pyx_t_17);
11697 if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_t_17) != (0)) __PYX_ERR(0, 256, __pyx_L1_error);
11698 __pyx_t_2 = 0;
11699 __pyx_t_16 = 0;
11700 __pyx_t_17 = 0;
11701 if (unlikely((__Pyx_SetItemInt(__pyx_v_elements, -1L, __pyx_t_3, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 256, __pyx_L1_error)
11702 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11703
11704 /* "Isosurface.pyx":253
11705 * nodes.append(x)
11706 * elements.append([nN_start + j for j in range(3)])
11707 * if etriple(self.nodeArray[plus[0]] - nodes[-3], # <<<<<<<<<<<<<<
11708 * nodes[-2] - nodes[-3],
11709 * nodes[-1] - nodes[-3]) < 0.0:
11710*/
11711 }
11712
11713 /* "Isosurface.pyx":260
11714 * elements[-1][1]]
11715 * normal = ecross(
11716 * nodes[elements[-1][1]] - nodes[elements[-1][0]], # <<<<<<<<<<<<<<
11717 * nodes[elements[-1][2]] - nodes[elements[-1][0]])
11718 * normal /= enorm(normal)
11719*/
11720 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error)
11721 __Pyx_GOTREF(__pyx_t_3);
11722 __pyx_t_17 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 260, __pyx_L1_error)
11723 __Pyx_GOTREF(__pyx_t_17);
11724 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11725 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_17); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error)
11726 __Pyx_GOTREF(__pyx_t_3);
11727 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
11728 __pyx_t_17 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 260, __pyx_L1_error)
11729 __Pyx_GOTREF(__pyx_t_17);
11730 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_17, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 260, __pyx_L1_error)
11731 __Pyx_GOTREF(__pyx_t_16);
11732 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
11733 __pyx_t_17 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_16); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 260, __pyx_L1_error)
11734 __Pyx_GOTREF(__pyx_t_17);
11735 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
11736 __pyx_t_16 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_3, __pyx_t_17); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 260, __pyx_L1_error)
11737 __Pyx_GOTREF(__pyx_t_16);
11738 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11739 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
11740 if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 260, __pyx_L1_error)
11741
11742 /* "Isosurface.pyx":261
11743 * normal = ecross(
11744 * nodes[elements[-1][1]] - nodes[elements[-1][0]],
11745 * nodes[elements[-1][2]] - nodes[elements[-1][0]]) # <<<<<<<<<<<<<<
11746 * normal /= enorm(normal)
11747 * normals.append(normal)
11748*/
11749 __pyx_t_17 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 261, __pyx_L1_error)
11750 __Pyx_GOTREF(__pyx_t_17);
11751 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_17, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error)
11752 __Pyx_GOTREF(__pyx_t_3);
11753 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
11754 __pyx_t_17 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_3); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 261, __pyx_L1_error)
11755 __Pyx_GOTREF(__pyx_t_17);
11756 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11757 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error)
11758 __Pyx_GOTREF(__pyx_t_3);
11759 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error)
11760 __Pyx_GOTREF(__pyx_t_2);
11761 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11762 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error)
11763 __Pyx_GOTREF(__pyx_t_3);
11764 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11765 __pyx_t_2 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_17, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error)
11766 __Pyx_GOTREF(__pyx_t_2);
11767 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
11768 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11769 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 261, __pyx_L1_error)
11770
11771 /* "Isosurface.pyx":259
11772 * elements[-1][2],
11773 * elements[-1][1]]
11774 * normal = ecross( # <<<<<<<<<<<<<<
11775 * nodes[elements[-1][1]] - nodes[elements[-1][0]],
11776 * nodes[elements[-1][2]] - nodes[elements[-1][0]])
11777*/
11778 __pyx_t_3 = ((PyObject *)__pyx_f_10Isosurface_ecross(((PyArrayObject *)__pyx_t_16), ((PyArrayObject *)__pyx_t_2))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error)
11779 __Pyx_GOTREF(__pyx_t_3);
11780 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
11781 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11782 {
11783 __Pyx_BufFmt_StackElem __pyx_stack[1];
11784 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
11785 __pyx_t_10 = __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);
11786 if (unlikely(__pyx_t_10 < 0)) {
11787 __Pyx_PyErr_FetchException(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
11788 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)) {
11789 Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_19);
11790 __Pyx_RaiseBufferFallbackError();
11791 } else {
11792 __Pyx_PyErr_RestoreException(__pyx_t_21, __pyx_t_20, __pyx_t_19);
11793 }
11794 __pyx_t_21 = __pyx_t_20 = __pyx_t_19 = 0;
11795 }
11796 __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];
11797 if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 259, __pyx_L1_error)
11798 }
11799 __Pyx_XDECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_3));
11800 __pyx_t_3 = 0;
11801
11802 /* "Isosurface.pyx":262
11803 * nodes[elements[-1][1]] - nodes[elements[-1][0]],
11804 * nodes[elements[-1][2]] - nodes[elements[-1][0]])
11805 * normal /= enorm(normal) # <<<<<<<<<<<<<<
11806 * normals.append(normal)
11807 * normals.append(normal)
11808*/
11809 __pyx_t_18 = __pyx_f_10Isosurface_enorm(((PyArrayObject *)__pyx_v_normal)); if (unlikely(__pyx_t_18 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 262, __pyx_L1_error)
11810 __pyx_t_3 = PyFloat_FromDouble(__pyx_t_18); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error)
11811 __Pyx_GOTREF(__pyx_t_3);
11812
11813 __pyx_t_2 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_normal), __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error)
11814 __Pyx_GOTREF(__pyx_t_2);
11815 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11816 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 262, __pyx_L1_error)
11817 {
11818 __Pyx_BufFmt_StackElem __pyx_stack[1];
11819 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
11820 __pyx_t_10 = __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);
11821 if (unlikely(__pyx_t_10 < 0)) {
11822 __Pyx_PyErr_FetchException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
11823 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)) {
11824 Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21);
11825 __Pyx_RaiseBufferFallbackError();
11826 } else {
11827 __Pyx_PyErr_RestoreException(__pyx_t_19, __pyx_t_20, __pyx_t_21);
11828 }
11829 __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0;
11830 }
11831 __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];
11832 if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 262, __pyx_L1_error)
11833 }
11834 __Pyx_DECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_2));
11835 __pyx_t_2 = 0;
11836
11837 /* "Isosurface.pyx":263
11838 * nodes[elements[-1][2]] - nodes[elements[-1][0]])
11839 * normal /= enorm(normal)
11840 * normals.append(normal) # <<<<<<<<<<<<<<
11841 * normals.append(normal)
11842 * normals.append(normal)
11843*/
11844 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 263, __pyx_L1_error)
11845
11846
11847 /* "Isosurface.pyx":264
11848 * normal /= enorm(normal)
11849 * normals.append(normal)
11850 * normals.append(normal) # <<<<<<<<<<<<<<
11851 * normals.append(normal)
11852 * normal_indices.append(elements[-1])
11853*/
11854 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 264, __pyx_L1_error)
11855
11856
11857 /* "Isosurface.pyx":265
11858 * normals.append(normal)
11859 * normals.append(normal)
11860 * normals.append(normal) # <<<<<<<<<<<<<<
11861 * normal_indices.append(elements[-1])
11862 * elif nZeros == 1 and ((nPlus == 2 and nMinus == 1) or
11863*/
11864 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 265, __pyx_L1_error)
11865
11866
11867 /* "Isosurface.pyx":266
11868 * normals.append(normal)
11869 * normals.append(normal)
11870 * normal_indices.append(elements[-1]) # <<<<<<<<<<<<<<
11871 * elif nZeros == 1 and ((nPlus == 2 and nMinus == 1) or
11872 * (nPlus == 1 and nMinus == 2)):
11873*/
11874 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error)
11875 __Pyx_GOTREF(__pyx_t_2);
11876 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normal_indices, __pyx_t_2); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 266, __pyx_L1_error)
11877 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11878
11879
11880 /* "Isosurface.pyx":245
11881 * normals.append(normal)
11882 * normal_indices.append(elements[-1])
11883 * elif nMinus == 3 and nPlus == 1: # 3 cut edges # <<<<<<<<<<<<<<
11884 * I = plus[0]
11885 * for J in minus:
11886*/
11887 goto __pyx_L9;
11888 }
11889
11890 /* "Isosurface.pyx":267
11891 * normals.append(normal)
11892 * normal_indices.append(elements[-1])
11893 * elif nZeros == 1 and ((nPlus == 2 and nMinus == 1) or # <<<<<<<<<<<<<<
11894 * (nPlus == 1 and nMinus == 2)):
11895 * # 2 cut edges, 1 vertex lies in plane
11896*/
11897 __pyx_t_14 = (__pyx_v_nZeros == 1);
11898
11899 if (__pyx_t_14) {
11900
11901 } else {
11902
11903 __pyx_t_4 = __pyx_t_14;
11904
11905 goto __pyx_L40_bool_binop_done;
11906 }
11907 __pyx_t_14 = (__pyx_v_nPlus == 2);
11908
11909 if (!__pyx_t_14) {
11910
11911 goto __pyx_L42_next_or;
11912 } else {
11913
11914 }
11915 __pyx_t_14 = (__pyx_v_nMinus == 1);
11916
11917 if (!__pyx_t_14) {
11918
11919 } else {
11920
11921 __pyx_t_4 = __pyx_t_14;
11922
11923 goto __pyx_L40_bool_binop_done;
11924 }
11925 __pyx_L42_next_or:;
11926
11927 /* "Isosurface.pyx":268
11928 * normal_indices.append(elements[-1])
11929 * elif nZeros == 1 and ((nPlus == 2 and nMinus == 1) or
11930 * (nPlus == 1 and nMinus == 2)): # <<<<<<<<<<<<<<
11931 * # 2 cut edges, 1 vertex lies in plane
11932 * nodes.append(self.nodeArray[zeros[0]])
11933*/
11934 __pyx_t_14 = (__pyx_v_nPlus == 1);
11935
11936 if (__pyx_t_14) {
11937
11938 } else {
11939
11940 __pyx_t_4 = __pyx_t_14;
11941
11942 goto __pyx_L40_bool_binop_done;
11943 }
11944 __pyx_t_14 = (__pyx_v_nMinus == 2);
11945
11946
11947 __pyx_t_4 = __pyx_t_14;
11948
11949 __pyx_L40_bool_binop_done:;
11950
11951 /* "Isosurface.pyx":267
11952 * normals.append(normal)
11953 * normal_indices.append(elements[-1])
11954 * elif nZeros == 1 and ((nPlus == 2 and nMinus == 1) or # <<<<<<<<<<<<<<
11955 * (nPlus == 1 and nMinus == 2)):
11956 * # 2 cut edges, 1 vertex lies in plane
11957*/
11958 if (__pyx_t_4) {
11959
11960
11961 /* "Isosurface.pyx":270
11962 * (nPlus == 1 and nMinus == 2)):
11963 * # 2 cut edges, 1 vertex lies in plane
11964 * nodes.append(self.nodeArray[zeros[0]]) # <<<<<<<<<<<<<<
11965 * for J in minus:
11966 * for I in plus:
11967*/
11968 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __pyx_L1_error)
11969 __Pyx_GOTREF(__pyx_t_2);
11970 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_zeros, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error)
11971 __Pyx_GOTREF(__pyx_t_3);
11972 __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 270, __pyx_L1_error)
11973 __Pyx_GOTREF(__pyx_t_16);
11974 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11975 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11976 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_nodes, __pyx_t_16); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 270, __pyx_L1_error)
11977 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
11978
11979
11980 /* "Isosurface.pyx":271
11981 * # 2 cut edges, 1 vertex lies in plane
11982 * nodes.append(self.nodeArray[zeros[0]])
11983 * for J in minus: # <<<<<<<<<<<<<<
11984 * for I in plus:
11985 * s = -phi[I] / (phi[J] - phi[I])
11986*/
11987 __pyx_t_16 = __pyx_v_minus; __Pyx_INCREF(__pyx_t_16);
11988 __pyx_t_13 = 0;
11989 for (;;) {
11990 {
11991 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_16);
11992 #if !CYTHON_ASSUME_SAFE_SIZE
11993 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 271, __pyx_L1_error)
11994 #endif
11995 if (__pyx_t_13 >= __pyx_temp) break;
11996 }
11997 __pyx_t_3 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_16, __pyx_t_13, __Pyx_ReferenceSharing_OwnStrongReference);
11998 ++__pyx_t_13;
11999 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 271, __pyx_L1_error)
12000 __Pyx_GOTREF(__pyx_t_3);
12001 __pyx_t_10 = __Pyx_PyLong_As_int(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L1_error)
12002 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12003 __pyx_v_J = __pyx_t_10;
12004
12005 /* "Isosurface.pyx":272
12006 * nodes.append(self.nodeArray[zeros[0]])
12007 * for J in minus:
12008 * for I in plus: # <<<<<<<<<<<<<<
12009 * s = -phi[I] / (phi[J] - phi[I])
12010 * x = s * (self.nodeArray[J] - self.nodeArray[I]) \
12011*/
12012 __pyx_t_3 = __pyx_v_plus; __Pyx_INCREF(__pyx_t_3);
12013 __pyx_t_15 = 0;
12014 for (;;) {
12015 {
12016 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
12017 #if !CYTHON_ASSUME_SAFE_SIZE
12018 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 272, __pyx_L1_error)
12019 #endif
12020 if (__pyx_t_15 >= __pyx_temp) break;
12021 }
12022 __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_3, __pyx_t_15, __Pyx_ReferenceSharing_OwnStrongReference);
12023 ++__pyx_t_15;
12024 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
12025 __Pyx_GOTREF(__pyx_t_2);
12026 __pyx_t_10 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L1_error)
12027 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12028 __pyx_v_I = __pyx_t_10;
12029
12030 /* "Isosurface.pyx":273
12031 * for J in minus:
12032 * for I in plus:
12033 * s = -phi[I] / (phi[J] - phi[I]) # <<<<<<<<<<<<<<
12034 * x = s * (self.nodeArray[J] - self.nodeArray[I]) \
12035 * + self.nodeArray[I]
12036*/
12037 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error)
12038 __Pyx_GOTREF(__pyx_t_2);
12039 __pyx_t_17 = PyNumber_Negative(__pyx_t_2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 273, __pyx_L1_error)
12040 __Pyx_GOTREF(__pyx_t_17);
12041 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12042 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_J, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error)
12043 __Pyx_GOTREF(__pyx_t_2);
12044 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error)
12045 __Pyx_GOTREF(__pyx_t_1);
12046 __pyx_t_6 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 273, __pyx_L1_error)
12047 __Pyx_GOTREF(__pyx_t_6);
12048 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12049 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12050 __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_17, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error)
12051 __Pyx_GOTREF(__pyx_t_1);
12052 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
12053 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12054 __pyx_t_18 = __Pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_18 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L1_error)
12055 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12056 __pyx_v_s = __pyx_t_18;
12057
12058 /* "Isosurface.pyx":274
12059 * for I in plus:
12060 * s = -phi[I] / (phi[J] - phi[I])
12061 * x = s * (self.nodeArray[J] - self.nodeArray[I]) \ # <<<<<<<<<<<<<<
12062 * + self.nodeArray[I]
12063 * nodes.append(x)
12064*/
12065 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_s); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
12066 __Pyx_GOTREF(__pyx_t_1);
12067 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 274, __pyx_L1_error)
12068 __Pyx_GOTREF(__pyx_t_6);
12069 __pyx_t_17 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_J, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 274, __pyx_L1_error)
12070 __Pyx_GOTREF(__pyx_t_17);
12071 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12072 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 274, __pyx_L1_error)
12073 __Pyx_GOTREF(__pyx_t_6);
12074 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_I, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error)
12075 __Pyx_GOTREF(__pyx_t_2);
12076 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12077 __pyx_t_6 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_17, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 274, __pyx_L1_error)
12078 __Pyx_GOTREF(__pyx_t_6);
12079 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
12080 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12081 __pyx_t_2 = __Pyx_PyNumber_Multiply_float_object(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 274, __pyx_L1_error)
12082 __Pyx_GOTREF(__pyx_t_2);
12083 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12084 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12085
12086 /* "Isosurface.pyx":275
12087 * s = -phi[I] / (phi[J] - phi[I])
12088 * x = s * (self.nodeArray[J] - self.nodeArray[I]) \
12089 * + self.nodeArray[I] # <<<<<<<<<<<<<<
12090 * nodes.append(x)
12091 * elements.append([nN_start + j for j in range(3)])
12092*/
12093 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 275, __pyx_L1_error)
12094 __Pyx_GOTREF(__pyx_t_6);
12095 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_I, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error)
12096 __Pyx_GOTREF(__pyx_t_1);
12097 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12098 __pyx_t_6 = __Pyx_PyNumber_Add_object_object(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 275, __pyx_L1_error)
12099 __Pyx_GOTREF(__pyx_t_6);
12100 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12101 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12102 if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 275, __pyx_L1_error)
12103 {
12104 __Pyx_BufFmt_StackElem __pyx_stack[1];
12105 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
12106 __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_6), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
12107 if (unlikely(__pyx_t_10 < 0)) {
12108 __Pyx_PyErr_FetchException(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
12109 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)) {
12110 Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_19);
12111 __Pyx_RaiseBufferFallbackError();
12112 } else {
12113 __Pyx_PyErr_RestoreException(__pyx_t_21, __pyx_t_20, __pyx_t_19);
12114 }
12115 __pyx_t_21 = __pyx_t_20 = __pyx_t_19 = 0;
12116 }
12117 __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];
12118 if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 274, __pyx_L1_error)
12119 }
12120 __Pyx_XDECREF_SET(__pyx_v_x, ((PyArrayObject *)__pyx_t_6));
12121 __pyx_t_6 = 0;
12122
12123 /* "Isosurface.pyx":276
12124 * x = s * (self.nodeArray[J] - self.nodeArray[I]) \
12125 * + self.nodeArray[I]
12126 * nodes.append(x) # <<<<<<<<<<<<<<
12127 * elements.append([nN_start + j for j in range(3)])
12128 * if etriple(self.nodeArray[plus[0]] - nodes[-3],
12129*/
12130 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_nodes, ((PyObject *)__pyx_v_x)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 276, __pyx_L1_error)
12131
12132
12133 /* "Isosurface.pyx":272
12134 * nodes.append(self.nodeArray[zeros[0]])
12135 * for J in minus:
12136 * for I in plus: # <<<<<<<<<<<<<<
12137 * s = -phi[I] / (phi[J] - phi[I])
12138 * x = s * (self.nodeArray[J] - self.nodeArray[I]) \
12139*/
12140 }
12141 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12142
12143 /* "Isosurface.pyx":271
12144 * # 2 cut edges, 1 vertex lies in plane
12145 * nodes.append(self.nodeArray[zeros[0]])
12146 * for J in minus: # <<<<<<<<<<<<<<
12147 * for I in plus:
12148 * s = -phi[I] / (phi[J] - phi[I])
12149*/
12150 }
12151 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
12152
12153 /* "Isosurface.pyx":277
12154 * + self.nodeArray[I]
12155 * nodes.append(x)
12156 * elements.append([nN_start + j for j in range(3)]) # <<<<<<<<<<<<<<
12157 * if etriple(self.nodeArray[plus[0]] - nodes[-3],
12158 * nodes[-2] - nodes[-3],
12159*/
12160 { /* enter inner scope */
12161 __pyx_t_16 = PyList_New(0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 277, __pyx_L1_error)
12162 __Pyx_GOTREF(__pyx_t_16);
12163 for (__pyx_t_22 = 0; __pyx_t_22 < 3; __pyx_t_22+=1) {
12164 __pyx_8genexpr6__pyx_v_j = __pyx_t_22;
12165 __pyx_t_3 = __Pyx_PyLong_From_long((__pyx_v_nN_start + __pyx_8genexpr6__pyx_v_j)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error)
12166 __Pyx_GOTREF(__pyx_t_3);
12167 __Pyx_GIVEREF(__pyx_t_3);
12168 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_16, __pyx_t_3))) __PYX_ERR(0, 277, __pyx_L1_error)
12169 __pyx_t_3 = 0;
12170 }
12171 } /* exit inner scope */
12172 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_elements, __pyx_t_16); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 277, __pyx_L1_error)
12173 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
12174
12175
12176 /* "Isosurface.pyx":278
12177 * nodes.append(x)
12178 * elements.append([nN_start + j for j in range(3)])
12179 * if etriple(self.nodeArray[plus[0]] - nodes[-3], # <<<<<<<<<<<<<<
12180 * nodes[-2] - nodes[-3],
12181 * nodes[-1] - nodes[-3]) < 0.0:
12182*/
12183 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 278, __pyx_L1_error)
12184 __Pyx_GOTREF(__pyx_t_16);
12185 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_plus, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error)
12186 __Pyx_GOTREF(__pyx_t_3);
12187 __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_16, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error)
12188 __Pyx_GOTREF(__pyx_t_6);
12189 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
12190 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12191 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error)
12192 __Pyx_GOTREF(__pyx_t_3);
12193 __pyx_t_16 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 278, __pyx_L1_error)
12194 __Pyx_GOTREF(__pyx_t_16);
12195 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12196 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12197 if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 278, __pyx_L1_error)
12198
12199 /* "Isosurface.pyx":279
12200 * elements.append([nN_start + j for j in range(3)])
12201 * if etriple(self.nodeArray[plus[0]] - nodes[-3],
12202 * nodes[-2] - nodes[-3], # <<<<<<<<<<<<<<
12203 * nodes[-1] - nodes[-3]) < 0.0:
12204 * elements[-1] = [elements[-1][0],
12205*/
12206 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_nodes, -2L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
12207 __Pyx_GOTREF(__pyx_t_3);
12208 __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 279, __pyx_L1_error)
12209 __Pyx_GOTREF(__pyx_t_6);
12210 __pyx_t_1 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
12211 __Pyx_GOTREF(__pyx_t_1);
12212 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12213 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12214 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 279, __pyx_L1_error)
12215
12216 /* "Isosurface.pyx":280
12217 * if etriple(self.nodeArray[plus[0]] - nodes[-3],
12218 * nodes[-2] - nodes[-3],
12219 * nodes[-1] - nodes[-3]) < 0.0: # <<<<<<<<<<<<<<
12220 * elements[-1] = [elements[-1][0],
12221 * elements[-1][2],
12222*/
12223 __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_nodes, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 280, __pyx_L1_error)
12224 __Pyx_GOTREF(__pyx_t_6);
12225 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error)
12226 __Pyx_GOTREF(__pyx_t_3);
12227 __pyx_t_2 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 280, __pyx_L1_error)
12228 __Pyx_GOTREF(__pyx_t_2);
12229 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12230 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12231 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 280, __pyx_L1_error)
12232
12233 /* "Isosurface.pyx":278
12234 * nodes.append(x)
12235 * elements.append([nN_start + j for j in range(3)])
12236 * if etriple(self.nodeArray[plus[0]] - nodes[-3], # <<<<<<<<<<<<<<
12237 * nodes[-2] - nodes[-3],
12238 * nodes[-1] - nodes[-3]) < 0.0:
12239*/
12240 __pyx_t_18 = __pyx_f_10Isosurface_etriple(((PyArrayObject *)__pyx_t_16), ((PyArrayObject *)__pyx_t_1), ((PyArrayObject *)__pyx_t_2)); if (unlikely(__pyx_t_18 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 278, __pyx_L1_error)
12241 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
12242 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12243 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12244
12245 /* "Isosurface.pyx":280
12246 * if etriple(self.nodeArray[plus[0]] - nodes[-3],
12247 * nodes[-2] - nodes[-3],
12248 * nodes[-1] - nodes[-3]) < 0.0: # <<<<<<<<<<<<<<
12249 * elements[-1] = [elements[-1][0],
12250 * elements[-1][2],
12251*/
12252 __pyx_t_4 = (__pyx_t_18 < 0.0);
12253
12254
12255
12256 /* "Isosurface.pyx":278
12257 * nodes.append(x)
12258 * elements.append([nN_start + j for j in range(3)])
12259 * if etriple(self.nodeArray[plus[0]] - nodes[-3], # <<<<<<<<<<<<<<
12260 * nodes[-2] - nodes[-3],
12261 * nodes[-1] - nodes[-3]) < 0.0:
12262*/
12263 if (__pyx_t_4) {
12264
12265
12266 /* "Isosurface.pyx":281
12267 * nodes[-2] - nodes[-3],
12268 * nodes[-1] - nodes[-3]) < 0.0:
12269 * elements[-1] = [elements[-1][0], # <<<<<<<<<<<<<<
12270 * elements[-1][2],
12271 * elements[-1][1]]
12272*/
12273 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error)
12274 __Pyx_GOTREF(__pyx_t_2);
12275 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error)
12276 __Pyx_GOTREF(__pyx_t_1);
12277 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12278
12279 /* "Isosurface.pyx":282
12280 * nodes[-1] - nodes[-3]) < 0.0:
12281 * elements[-1] = [elements[-1][0],
12282 * elements[-1][2], # <<<<<<<<<<<<<<
12283 * elements[-1][1]]
12284 * normal = ecross(
12285*/
12286 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error)
12287 __Pyx_GOTREF(__pyx_t_2);
12288 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_2, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 282, __pyx_L1_error)
12289 __Pyx_GOTREF(__pyx_t_16);
12290 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12291
12292 /* "Isosurface.pyx":283
12293 * elements[-1] = [elements[-1][0],
12294 * elements[-1][2],
12295 * elements[-1][1]] # <<<<<<<<<<<<<<
12296 * normal = ecross(
12297 * nodes[elements[-1][1]] - nodes[elements[-1][0]],
12298*/
12299 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error)
12300 __Pyx_GOTREF(__pyx_t_2);
12301 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error)
12302 __Pyx_GOTREF(__pyx_t_3);
12303 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12304
12305 /* "Isosurface.pyx":281
12306 * nodes[-2] - nodes[-3],
12307 * nodes[-1] - nodes[-3]) < 0.0:
12308 * elements[-1] = [elements[-1][0], # <<<<<<<<<<<<<<
12309 * elements[-1][2],
12310 * elements[-1][1]]
12311*/
12312 __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error)
12313 __Pyx_GOTREF(__pyx_t_2);
12314 __Pyx_GIVEREF(__pyx_t_1);
12315 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 281, __pyx_L1_error);
12316 __Pyx_GIVEREF(__pyx_t_16);
12317 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_16) != (0)) __PYX_ERR(0, 281, __pyx_L1_error);
12318 __Pyx_GIVEREF(__pyx_t_3);
12319 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 281, __pyx_L1_error);
12320 __pyx_t_1 = 0;
12321 __pyx_t_16 = 0;
12322 __pyx_t_3 = 0;
12323 if (unlikely((__Pyx_SetItemInt(__pyx_v_elements, -1L, __pyx_t_2, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 281, __pyx_L1_error)
12324 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12325
12326 /* "Isosurface.pyx":278
12327 * nodes.append(x)
12328 * elements.append([nN_start + j for j in range(3)])
12329 * if etriple(self.nodeArray[plus[0]] - nodes[-3], # <<<<<<<<<<<<<<
12330 * nodes[-2] - nodes[-3],
12331 * nodes[-1] - nodes[-3]) < 0.0:
12332*/
12333 }
12334
12335 /* "Isosurface.pyx":285
12336 * elements[-1][1]]
12337 * normal = ecross(
12338 * nodes[elements[-1][1]] - nodes[elements[-1][0]], # <<<<<<<<<<<<<<
12339 * nodes[elements[-1][2]] - nodes[elements[-1][0]])
12340 * normal /= enorm(normal)
12341*/
12342 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error)
12343 __Pyx_GOTREF(__pyx_t_2);
12344 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error)
12345 __Pyx_GOTREF(__pyx_t_3);
12346 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12347 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error)
12348 __Pyx_GOTREF(__pyx_t_2);
12349 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12350 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error)
12351 __Pyx_GOTREF(__pyx_t_3);
12352 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 285, __pyx_L1_error)
12353 __Pyx_GOTREF(__pyx_t_16);
12354 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12355 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_16); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error)
12356 __Pyx_GOTREF(__pyx_t_3);
12357 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
12358 __pyx_t_16 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 285, __pyx_L1_error)
12359 __Pyx_GOTREF(__pyx_t_16);
12360 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12361 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12362 if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 285, __pyx_L1_error)
12363
12364 /* "Isosurface.pyx":286
12365 * normal = ecross(
12366 * nodes[elements[-1][1]] - nodes[elements[-1][0]],
12367 * nodes[elements[-1][2]] - nodes[elements[-1][0]]) # <<<<<<<<<<<<<<
12368 * normal /= enorm(normal)
12369 * normals.append(normal)
12370*/
12371 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error)
12372 __Pyx_GOTREF(__pyx_t_3);
12373 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error)
12374 __Pyx_GOTREF(__pyx_t_2);
12375 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12376 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error)
12377 __Pyx_GOTREF(__pyx_t_3);
12378 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12379 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error)
12380 __Pyx_GOTREF(__pyx_t_2);
12381 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error)
12382 __Pyx_GOTREF(__pyx_t_1);
12383 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12384 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error)
12385 __Pyx_GOTREF(__pyx_t_2);
12386 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12387 __pyx_t_1 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error)
12388 __Pyx_GOTREF(__pyx_t_1);
12389 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12390 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12391 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 286, __pyx_L1_error)
12392
12393 /* "Isosurface.pyx":284
12394 * elements[-1][2],
12395 * elements[-1][1]]
12396 * normal = ecross( # <<<<<<<<<<<<<<
12397 * nodes[elements[-1][1]] - nodes[elements[-1][0]],
12398 * nodes[elements[-1][2]] - nodes[elements[-1][0]])
12399*/
12400 __pyx_t_2 = ((PyObject *)__pyx_f_10Isosurface_ecross(((PyArrayObject *)__pyx_t_16), ((PyArrayObject *)__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error)
12401 __Pyx_GOTREF(__pyx_t_2);
12402 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
12403 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12404 {
12405 __Pyx_BufFmt_StackElem __pyx_stack[1];
12406 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
12407 __pyx_t_10 = __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);
12408 if (unlikely(__pyx_t_10 < 0)) {
12409 __Pyx_PyErr_FetchException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
12410 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)) {
12411 Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21);
12412 __Pyx_RaiseBufferFallbackError();
12413 } else {
12414 __Pyx_PyErr_RestoreException(__pyx_t_19, __pyx_t_20, __pyx_t_21);
12415 }
12416 __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0;
12417 }
12418 __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];
12419 if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 284, __pyx_L1_error)
12420 }
12421 __Pyx_XDECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_2));
12422 __pyx_t_2 = 0;
12423
12424 /* "Isosurface.pyx":287
12425 * nodes[elements[-1][1]] - nodes[elements[-1][0]],
12426 * nodes[elements[-1][2]] - nodes[elements[-1][0]])
12427 * normal /= enorm(normal) # <<<<<<<<<<<<<<
12428 * normals.append(normal)
12429 * normals.append(normal)
12430*/
12431 __pyx_t_18 = __pyx_f_10Isosurface_enorm(((PyArrayObject *)__pyx_v_normal)); if (unlikely(__pyx_t_18 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 287, __pyx_L1_error)
12432 __pyx_t_2 = PyFloat_FromDouble(__pyx_t_18); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 287, __pyx_L1_error)
12433 __Pyx_GOTREF(__pyx_t_2);
12434
12435 __pyx_t_1 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_normal), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
12436 __Pyx_GOTREF(__pyx_t_1);
12437 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12438 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 287, __pyx_L1_error)
12439 {
12440 __Pyx_BufFmt_StackElem __pyx_stack[1];
12441 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
12442 __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
12443 if (unlikely(__pyx_t_10 < 0)) {
12444 __Pyx_PyErr_FetchException(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
12445 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)) {
12446 Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_19);
12447 __Pyx_RaiseBufferFallbackError();
12448 } else {
12449 __Pyx_PyErr_RestoreException(__pyx_t_21, __pyx_t_20, __pyx_t_19);
12450 }
12451 __pyx_t_21 = __pyx_t_20 = __pyx_t_19 = 0;
12452 }
12453 __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];
12454 if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 287, __pyx_L1_error)
12455 }
12456 __Pyx_DECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_1));
12457 __pyx_t_1 = 0;
12458
12459 /* "Isosurface.pyx":288
12460 * nodes[elements[-1][2]] - nodes[elements[-1][0]])
12461 * normal /= enorm(normal)
12462 * normals.append(normal) # <<<<<<<<<<<<<<
12463 * normals.append(normal)
12464 * normals.append(normal)
12465*/
12466 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 288, __pyx_L1_error)
12467
12468
12469 /* "Isosurface.pyx":289
12470 * normal /= enorm(normal)
12471 * normals.append(normal)
12472 * normals.append(normal) # <<<<<<<<<<<<<<
12473 * normals.append(normal)
12474 * normal_indices.append(elements[-1])
12475*/
12476 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 289, __pyx_L1_error)
12477
12478
12479 /* "Isosurface.pyx":290
12480 * normals.append(normal)
12481 * normals.append(normal)
12482 * normals.append(normal) # <<<<<<<<<<<<<<
12483 * normal_indices.append(elements[-1])
12484 * elif nZeros == 2 and nPlus == 1 and nMinus == 1:
12485*/
12486 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 290, __pyx_L1_error)
12487
12488
12489 /* "Isosurface.pyx":291
12490 * normals.append(normal)
12491 * normals.append(normal)
12492 * normal_indices.append(elements[-1]) # <<<<<<<<<<<<<<
12493 * elif nZeros == 2 and nPlus == 1 and nMinus == 1:
12494 * # 1 cut edge, 2 vertices lie in plane
12495*/
12496 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error)
12497 __Pyx_GOTREF(__pyx_t_1);
12498 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normal_indices, __pyx_t_1); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 291, __pyx_L1_error)
12499 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12500
12501
12502 /* "Isosurface.pyx":267
12503 * normals.append(normal)
12504 * normal_indices.append(elements[-1])
12505 * elif nZeros == 1 and ((nPlus == 2 and nMinus == 1) or # <<<<<<<<<<<<<<
12506 * (nPlus == 1 and nMinus == 2)):
12507 * # 2 cut edges, 1 vertex lies in plane
12508*/
12509 goto __pyx_L9;
12510 }
12511
12512 /* "Isosurface.pyx":292
12513 * normals.append(normal)
12514 * normal_indices.append(elements[-1])
12515 * elif nZeros == 2 and nPlus == 1 and nMinus == 1: # <<<<<<<<<<<<<<
12516 * # 1 cut edge, 2 vertices lie in plane
12517 * for I in zeros:
12518*/
12519 __pyx_t_14 = (__pyx_v_nZeros == 2);
12520
12521 if (__pyx_t_14) {
12522
12523 } else {
12524
12525 __pyx_t_4 = __pyx_t_14;
12526
12527 goto __pyx_L54_bool_binop_done;
12528 }
12529 __pyx_t_14 = (__pyx_v_nPlus == 1);
12530
12531 if (__pyx_t_14) {
12532
12533 } else {
12534
12535 __pyx_t_4 = __pyx_t_14;
12536
12537 goto __pyx_L54_bool_binop_done;
12538 }
12539 __pyx_t_14 = (__pyx_v_nMinus == 1);
12540
12541
12542 __pyx_t_4 = __pyx_t_14;
12543
12544 __pyx_L54_bool_binop_done:;
12545 if (__pyx_t_4) {
12546
12547
12548 /* "Isosurface.pyx":294
12549 * elif nZeros == 2 and nPlus == 1 and nMinus == 1:
12550 * # 1 cut edge, 2 vertices lie in plane
12551 * for I in zeros: # <<<<<<<<<<<<<<
12552 * nodes.append(self.nodeArray[I])
12553 * I = plus[0]
12554*/
12555 __pyx_t_1 = __pyx_v_zeros; __Pyx_INCREF(__pyx_t_1);
12556 __pyx_t_13 = 0;
12557 for (;;) {
12558 {
12559 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
12560 #if !CYTHON_ASSUME_SAFE_SIZE
12561 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 294, __pyx_L1_error)
12562 #endif
12563 if (__pyx_t_13 >= __pyx_temp) break;
12564 }
12565 __pyx_t_2 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_13, __Pyx_ReferenceSharing_OwnStrongReference);
12566 ++__pyx_t_13;
12567 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 294, __pyx_L1_error)
12568 __Pyx_GOTREF(__pyx_t_2);
12569 __pyx_t_10 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 294, __pyx_L1_error)
12570 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12571 __pyx_v_I = __pyx_t_10;
12572
12573 /* "Isosurface.pyx":295
12574 * # 1 cut edge, 2 vertices lie in plane
12575 * for I in zeros:
12576 * nodes.append(self.nodeArray[I]) # <<<<<<<<<<<<<<
12577 * I = plus[0]
12578 * J = minus[0]
12579*/
12580 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error)
12581 __Pyx_GOTREF(__pyx_t_2);
12582 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_I, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 295, __pyx_L1_error)
12583 __Pyx_GOTREF(__pyx_t_16);
12584 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12585 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_nodes, __pyx_t_16); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 295, __pyx_L1_error)
12586 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
12587
12588
12589 /* "Isosurface.pyx":294
12590 * elif nZeros == 2 and nPlus == 1 and nMinus == 1:
12591 * # 1 cut edge, 2 vertices lie in plane
12592 * for I in zeros: # <<<<<<<<<<<<<<
12593 * nodes.append(self.nodeArray[I])
12594 * I = plus[0]
12595*/
12596 }
12597 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12598
12599 /* "Isosurface.pyx":296
12600 * for I in zeros:
12601 * nodes.append(self.nodeArray[I])
12602 * I = plus[0] # <<<<<<<<<<<<<<
12603 * J = minus[0]
12604 * s = -phi[I] / (phi[J] - phi[I])
12605*/
12606 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_plus, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
12607 __Pyx_GOTREF(__pyx_t_1);
12608 __pyx_t_10 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 296, __pyx_L1_error)
12609 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12610 __pyx_v_I = __pyx_t_10;
12611
12612 /* "Isosurface.pyx":297
12613 * nodes.append(self.nodeArray[I])
12614 * I = plus[0]
12615 * J = minus[0] # <<<<<<<<<<<<<<
12616 * s = -phi[I] / (phi[J] - phi[I])
12617 * x = s * (self.nodeArray[J] - self.nodeArray[I]) \
12618*/
12619 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_minus, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
12620 __Pyx_GOTREF(__pyx_t_1);
12621 __pyx_t_10 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 297, __pyx_L1_error)
12622 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12623 __pyx_v_J = __pyx_t_10;
12624
12625 /* "Isosurface.pyx":298
12626 * I = plus[0]
12627 * J = minus[0]
12628 * s = -phi[I] / (phi[J] - phi[I]) # <<<<<<<<<<<<<<
12629 * x = s * (self.nodeArray[J] - self.nodeArray[I]) \
12630 * + self.nodeArray[I]
12631*/
12632 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error)
12633 __Pyx_GOTREF(__pyx_t_1);
12634 __pyx_t_16 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 298, __pyx_L1_error)
12635 __Pyx_GOTREF(__pyx_t_16);
12636 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12637 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_J, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error)
12638 __Pyx_GOTREF(__pyx_t_1);
12639 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_phi, __pyx_v_I, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error)
12640 __Pyx_GOTREF(__pyx_t_2);
12641 __pyx_t_3 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error)
12642 __Pyx_GOTREF(__pyx_t_3);
12643 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12644 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12645 __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_16, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error)
12646 __Pyx_GOTREF(__pyx_t_2);
12647 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
12648 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12649 __pyx_t_18 = __Pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_18 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 298, __pyx_L1_error)
12650 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12651 __pyx_v_s = __pyx_t_18;
12652
12653 /* "Isosurface.pyx":299
12654 * J = minus[0]
12655 * s = -phi[I] / (phi[J] - phi[I])
12656 * x = s * (self.nodeArray[J] - self.nodeArray[I]) \ # <<<<<<<<<<<<<<
12657 * + self.nodeArray[I]
12658 * nodes.append(x)
12659*/
12660 __pyx_t_2 = PyFloat_FromDouble(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error)
12661 __Pyx_GOTREF(__pyx_t_2);
12662 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 299, __pyx_L1_error)
12663 __Pyx_GOTREF(__pyx_t_3);
12664 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_J, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 299, __pyx_L1_error)
12665 __Pyx_GOTREF(__pyx_t_16);
12666 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12667 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 299, __pyx_L1_error)
12668 __Pyx_GOTREF(__pyx_t_3);
12669 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_I, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error)
12670 __Pyx_GOTREF(__pyx_t_1);
12671 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12672 __pyx_t_3 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_16, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 299, __pyx_L1_error)
12673 __Pyx_GOTREF(__pyx_t_3);
12674 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
12675 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12676 __pyx_t_1 = __Pyx_PyNumber_Multiply_float_object(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error)
12677 __Pyx_GOTREF(__pyx_t_1);
12678 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12679 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12680
12681 /* "Isosurface.pyx":300
12682 * s = -phi[I] / (phi[J] - phi[I])
12683 * x = s * (self.nodeArray[J] - self.nodeArray[I]) \
12684 * + self.nodeArray[I] # <<<<<<<<<<<<<<
12685 * nodes.append(x)
12686 * elements.append([nN_start + j for j in range(3)])
12687*/
12688 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error)
12689 __Pyx_GOTREF(__pyx_t_3);
12690 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_I, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error)
12691 __Pyx_GOTREF(__pyx_t_2);
12692 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12693 __pyx_t_3 = __Pyx_PyNumber_Add_object_object(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error)
12694 __Pyx_GOTREF(__pyx_t_3);
12695 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12696 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12697 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 300, __pyx_L1_error)
12698 {
12699 __Pyx_BufFmt_StackElem __pyx_stack[1];
12700 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
12701 __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
12702 if (unlikely(__pyx_t_10 < 0)) {
12703 __Pyx_PyErr_FetchException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
12704 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)) {
12705 Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21);
12706 __Pyx_RaiseBufferFallbackError();
12707 } else {
12708 __Pyx_PyErr_RestoreException(__pyx_t_19, __pyx_t_20, __pyx_t_21);
12709 }
12710 __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0;
12711 }
12712 __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];
12713 if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 299, __pyx_L1_error)
12714 }
12715 __Pyx_XDECREF_SET(__pyx_v_x, ((PyArrayObject *)__pyx_t_3));
12716 __pyx_t_3 = 0;
12717
12718 /* "Isosurface.pyx":301
12719 * x = s * (self.nodeArray[J] - self.nodeArray[I]) \
12720 * + self.nodeArray[I]
12721 * nodes.append(x) # <<<<<<<<<<<<<<
12722 * elements.append([nN_start + j for j in range(3)])
12723 * if etriple(self.nodeArray[plus[0]] - nodes[-3],
12724*/
12725 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_nodes, ((PyObject *)__pyx_v_x)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 301, __pyx_L1_error)
12726
12727
12728 /* "Isosurface.pyx":302
12729 * + self.nodeArray[I]
12730 * nodes.append(x)
12731 * elements.append([nN_start + j for j in range(3)]) # <<<<<<<<<<<<<<
12732 * if etriple(self.nodeArray[plus[0]] - nodes[-3],
12733 * nodes[-2] - nodes[-3],
12734*/
12735 { /* enter inner scope */
12736 __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 302, __pyx_L1_error)
12737 __Pyx_GOTREF(__pyx_t_3);
12738 for (__pyx_t_22 = 0; __pyx_t_22 < 3; __pyx_t_22+=1) {
12739 __pyx_8genexpr7__pyx_v_j = __pyx_t_22;
12740 __pyx_t_2 = __Pyx_PyLong_From_long((__pyx_v_nN_start + __pyx_8genexpr7__pyx_v_j)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error)
12741 __Pyx_GOTREF(__pyx_t_2);
12742 __Pyx_GIVEREF(__pyx_t_2);
12743 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_3, __pyx_t_2))) __PYX_ERR(0, 302, __pyx_L1_error)
12744 __pyx_t_2 = 0;
12745 }
12746 } /* exit inner scope */
12747 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_elements, __pyx_t_3); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 302, __pyx_L1_error)
12748 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12749
12750
12751 /* "Isosurface.pyx":303
12752 * nodes.append(x)
12753 * elements.append([nN_start + j for j in range(3)])
12754 * if etriple(self.nodeArray[plus[0]] - nodes[-3], # <<<<<<<<<<<<<<
12755 * nodes[-2] - nodes[-3],
12756 * nodes[-1] - nodes[-3]) < 0.0:
12757*/
12758 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error)
12759 __Pyx_GOTREF(__pyx_t_3);
12760 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_plus, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error)
12761 __Pyx_GOTREF(__pyx_t_2);
12762 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
12763 __Pyx_GOTREF(__pyx_t_1);
12764 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12765 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12766 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error)
12767 __Pyx_GOTREF(__pyx_t_2);
12768 __pyx_t_3 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error)
12769 __Pyx_GOTREF(__pyx_t_3);
12770 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12771 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12772 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 303, __pyx_L1_error)
12773
12774 /* "Isosurface.pyx":304
12775 * elements.append([nN_start + j for j in range(3)])
12776 * if etriple(self.nodeArray[plus[0]] - nodes[-3],
12777 * nodes[-2] - nodes[-3], # <<<<<<<<<<<<<<
12778 * nodes[-1] - nodes[-3]) < 0.0:
12779 * elements[-1] = [elements[-1][0],
12780*/
12781 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_nodes, -2L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error)
12782 __Pyx_GOTREF(__pyx_t_2);
12783 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
12784 __Pyx_GOTREF(__pyx_t_1);
12785 __pyx_t_16 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 304, __pyx_L1_error)
12786 __Pyx_GOTREF(__pyx_t_16);
12787 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12788 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12789 if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 304, __pyx_L1_error)
12790
12791 /* "Isosurface.pyx":305
12792 * if etriple(self.nodeArray[plus[0]] - nodes[-3],
12793 * nodes[-2] - nodes[-3],
12794 * nodes[-1] - nodes[-3]) < 0.0: # <<<<<<<<<<<<<<
12795 * elements[-1] = [elements[-1][0],
12796 * elements[-1][2],
12797*/
12798 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_nodes, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error)
12799 __Pyx_GOTREF(__pyx_t_1);
12800 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error)
12801 __Pyx_GOTREF(__pyx_t_2);
12802 __pyx_t_6 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 305, __pyx_L1_error)
12803 __Pyx_GOTREF(__pyx_t_6);
12804 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12805 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12806 if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 305, __pyx_L1_error)
12807
12808 /* "Isosurface.pyx":303
12809 * nodes.append(x)
12810 * elements.append([nN_start + j for j in range(3)])
12811 * if etriple(self.nodeArray[plus[0]] - nodes[-3], # <<<<<<<<<<<<<<
12812 * nodes[-2] - nodes[-3],
12813 * nodes[-1] - nodes[-3]) < 0.0:
12814*/
12815 __pyx_t_18 = __pyx_f_10Isosurface_etriple(((PyArrayObject *)__pyx_t_3), ((PyArrayObject *)__pyx_t_16), ((PyArrayObject *)__pyx_t_6)); if (unlikely(__pyx_t_18 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 303, __pyx_L1_error)
12816 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12817 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
12818 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12819
12820 /* "Isosurface.pyx":305
12821 * if etriple(self.nodeArray[plus[0]] - nodes[-3],
12822 * nodes[-2] - nodes[-3],
12823 * nodes[-1] - nodes[-3]) < 0.0: # <<<<<<<<<<<<<<
12824 * elements[-1] = [elements[-1][0],
12825 * elements[-1][2],
12826*/
12827 __pyx_t_4 = (__pyx_t_18 < 0.0);
12828
12829
12830
12831 /* "Isosurface.pyx":303
12832 * nodes.append(x)
12833 * elements.append([nN_start + j for j in range(3)])
12834 * if etriple(self.nodeArray[plus[0]] - nodes[-3], # <<<<<<<<<<<<<<
12835 * nodes[-2] - nodes[-3],
12836 * nodes[-1] - nodes[-3]) < 0.0:
12837*/
12838 if (__pyx_t_4) {
12839
12840
12841 /* "Isosurface.pyx":306
12842 * nodes[-2] - nodes[-3],
12843 * nodes[-1] - nodes[-3]) < 0.0:
12844 * elements[-1] = [elements[-1][0], # <<<<<<<<<<<<<<
12845 * elements[-1][2],
12846 * elements[-1][1]]
12847*/
12848 __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 306, __pyx_L1_error)
12849 __Pyx_GOTREF(__pyx_t_6);
12850 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 306, __pyx_L1_error)
12851 __Pyx_GOTREF(__pyx_t_16);
12852 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12853
12854 /* "Isosurface.pyx":307
12855 * nodes[-1] - nodes[-3]) < 0.0:
12856 * elements[-1] = [elements[-1][0],
12857 * elements[-1][2], # <<<<<<<<<<<<<<
12858 * elements[-1][1]]
12859 * normal = ecross(
12860*/
12861 __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 307, __pyx_L1_error)
12862 __Pyx_GOTREF(__pyx_t_6);
12863 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error)
12864 __Pyx_GOTREF(__pyx_t_3);
12865 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12866
12867 /* "Isosurface.pyx":308
12868 * elements[-1] = [elements[-1][0],
12869 * elements[-1][2],
12870 * elements[-1][1]] # <<<<<<<<<<<<<<
12871 * normal = ecross(
12872 * nodes[elements[-1][1]] - nodes[elements[-1][0]],
12873*/
12874 __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 308, __pyx_L1_error)
12875 __Pyx_GOTREF(__pyx_t_6);
12876 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L1_error)
12877 __Pyx_GOTREF(__pyx_t_2);
12878 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12879
12880 /* "Isosurface.pyx":306
12881 * nodes[-2] - nodes[-3],
12882 * nodes[-1] - nodes[-3]) < 0.0:
12883 * elements[-1] = [elements[-1][0], # <<<<<<<<<<<<<<
12884 * elements[-1][2],
12885 * elements[-1][1]]
12886*/
12887 __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 306, __pyx_L1_error)
12888 __Pyx_GOTREF(__pyx_t_6);
12889 __Pyx_GIVEREF(__pyx_t_16);
12890 if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_16) != (0)) __PYX_ERR(0, 306, __pyx_L1_error);
12891 __Pyx_GIVEREF(__pyx_t_3);
12892 if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 306, __pyx_L1_error);
12893 __Pyx_GIVEREF(__pyx_t_2);
12894 if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 2, __pyx_t_2) != (0)) __PYX_ERR(0, 306, __pyx_L1_error);
12895 __pyx_t_16 = 0;
12896 __pyx_t_3 = 0;
12897 __pyx_t_2 = 0;
12898 if (unlikely((__Pyx_SetItemInt(__pyx_v_elements, -1L, __pyx_t_6, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 306, __pyx_L1_error)
12899 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12900
12901 /* "Isosurface.pyx":303
12902 * nodes.append(x)
12903 * elements.append([nN_start + j for j in range(3)])
12904 * if etriple(self.nodeArray[plus[0]] - nodes[-3], # <<<<<<<<<<<<<<
12905 * nodes[-2] - nodes[-3],
12906 * nodes[-1] - nodes[-3]) < 0.0:
12907*/
12908 }
12909
12910 /* "Isosurface.pyx":310
12911 * elements[-1][1]]
12912 * normal = ecross(
12913 * nodes[elements[-1][1]] - nodes[elements[-1][0]], # <<<<<<<<<<<<<<
12914 * nodes[elements[-1][2]] - nodes[elements[-1][0]])
12915 * normal /= enorm(normal)
12916*/
12917 __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 310, __pyx_L1_error)
12918 __Pyx_GOTREF(__pyx_t_6);
12919 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error)
12920 __Pyx_GOTREF(__pyx_t_2);
12921 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12922 __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 310, __pyx_L1_error)
12923 __Pyx_GOTREF(__pyx_t_6);
12924 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12925 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error)
12926 __Pyx_GOTREF(__pyx_t_2);
12927 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error)
12928 __Pyx_GOTREF(__pyx_t_3);
12929 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12930 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error)
12931 __Pyx_GOTREF(__pyx_t_2);
12932 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12933 __pyx_t_3 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error)
12934 __Pyx_GOTREF(__pyx_t_3);
12935 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12936 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12937 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 310, __pyx_L1_error)
12938
12939 /* "Isosurface.pyx":311
12940 * normal = ecross(
12941 * nodes[elements[-1][1]] - nodes[elements[-1][0]],
12942 * nodes[elements[-1][2]] - nodes[elements[-1][0]]) # <<<<<<<<<<<<<<
12943 * normal /= enorm(normal)
12944 * normals.append(normal)
12945*/
12946 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error)
12947 __Pyx_GOTREF(__pyx_t_2);
12948 __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
12949 __Pyx_GOTREF(__pyx_t_6);
12950 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12951 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error)
12952 __Pyx_GOTREF(__pyx_t_2);
12953 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12954 __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
12955 __Pyx_GOTREF(__pyx_t_6);
12956 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 311, __pyx_L1_error)
12957 __Pyx_GOTREF(__pyx_t_16);
12958 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12959 __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
12960 __Pyx_GOTREF(__pyx_t_6);
12961 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
12962 __pyx_t_16 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 311, __pyx_L1_error)
12963 __Pyx_GOTREF(__pyx_t_16);
12964 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12965 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12966 if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 311, __pyx_L1_error)
12967
12968 /* "Isosurface.pyx":309
12969 * elements[-1][2],
12970 * elements[-1][1]]
12971 * normal = ecross( # <<<<<<<<<<<<<<
12972 * nodes[elements[-1][1]] - nodes[elements[-1][0]],
12973 * nodes[elements[-1][2]] - nodes[elements[-1][0]])
12974*/
12975 __pyx_t_6 = ((PyObject *)__pyx_f_10Isosurface_ecross(((PyArrayObject *)__pyx_t_3), ((PyArrayObject *)__pyx_t_16))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error)
12976 __Pyx_GOTREF(__pyx_t_6);
12977 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12978 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
12979 {
12980 __Pyx_BufFmt_StackElem __pyx_stack[1];
12981 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
12982 __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_6), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
12983 if (unlikely(__pyx_t_10 < 0)) {
12984 __Pyx_PyErr_FetchException(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
12985 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)) {
12986 Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_19);
12987 __Pyx_RaiseBufferFallbackError();
12988 } else {
12989 __Pyx_PyErr_RestoreException(__pyx_t_21, __pyx_t_20, __pyx_t_19);
12990 }
12991 __pyx_t_21 = __pyx_t_20 = __pyx_t_19 = 0;
12992 }
12993 __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];
12994 if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 309, __pyx_L1_error)
12995 }
12996 __Pyx_XDECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_6));
12997 __pyx_t_6 = 0;
12998
12999 /* "Isosurface.pyx":312
13000 * nodes[elements[-1][1]] - nodes[elements[-1][0]],
13001 * nodes[elements[-1][2]] - nodes[elements[-1][0]])
13002 * normal /= enorm(normal) # <<<<<<<<<<<<<<
13003 * normals.append(normal)
13004 * normals.append(normal)
13005*/
13006 __pyx_t_18 = __pyx_f_10Isosurface_enorm(((PyArrayObject *)__pyx_v_normal)); if (unlikely(__pyx_t_18 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error)
13007 __pyx_t_6 = PyFloat_FromDouble(__pyx_t_18); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L1_error)
13008 __Pyx_GOTREF(__pyx_t_6);
13009
13010 __pyx_t_16 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_normal), __pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 312, __pyx_L1_error)
13011 __Pyx_GOTREF(__pyx_t_16);
13012 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13013 if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 312, __pyx_L1_error)
13014 {
13015 __Pyx_BufFmt_StackElem __pyx_stack[1];
13016 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
13017 __pyx_t_10 = __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);
13018 if (unlikely(__pyx_t_10 < 0)) {
13019 __Pyx_PyErr_FetchException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
13020 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)) {
13021 Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21);
13022 __Pyx_RaiseBufferFallbackError();
13023 } else {
13024 __Pyx_PyErr_RestoreException(__pyx_t_19, __pyx_t_20, __pyx_t_21);
13025 }
13026 __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0;
13027 }
13028 __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];
13029 if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 312, __pyx_L1_error)
13030 }
13031 __Pyx_DECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_16));
13032 __pyx_t_16 = 0;
13033
13034 /* "Isosurface.pyx":313
13035 * nodes[elements[-1][2]] - nodes[elements[-1][0]])
13036 * normal /= enorm(normal)
13037 * normals.append(normal) # <<<<<<<<<<<<<<
13038 * normals.append(normal)
13039 * normals.append(normal)
13040*/
13041 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 313, __pyx_L1_error)
13042
13043
13044 /* "Isosurface.pyx":314
13045 * normal /= enorm(normal)
13046 * normals.append(normal)
13047 * normals.append(normal) # <<<<<<<<<<<<<<
13048 * normals.append(normal)
13049 * normal_indices.append(elements[-1])
13050*/
13051 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 314, __pyx_L1_error)
13052
13053
13054 /* "Isosurface.pyx":315
13055 * normals.append(normal)
13056 * normals.append(normal)
13057 * normals.append(normal) # <<<<<<<<<<<<<<
13058 * normal_indices.append(elements[-1])
13059 * elif nZeros == 3: # 3 vertices lie in plane
13060*/
13061 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 315, __pyx_L1_error)
13062
13063
13064 /* "Isosurface.pyx":316
13065 * normals.append(normal)
13066 * normals.append(normal)
13067 * normal_indices.append(elements[-1]) # <<<<<<<<<<<<<<
13068 * elif nZeros == 3: # 3 vertices lie in plane
13069 * for I in zeros:
13070*/
13071 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 316, __pyx_L1_error)
13072 __Pyx_GOTREF(__pyx_t_16);
13073 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normal_indices, __pyx_t_16); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 316, __pyx_L1_error)
13074 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
13075
13076
13077 /* "Isosurface.pyx":292
13078 * normals.append(normal)
13079 * normal_indices.append(elements[-1])
13080 * elif nZeros == 2 and nPlus == 1 and nMinus == 1: # <<<<<<<<<<<<<<
13081 * # 1 cut edge, 2 vertices lie in plane
13082 * for I in zeros:
13083*/
13084 goto __pyx_L9;
13085 }
13086
13087 /* "Isosurface.pyx":317
13088 * normals.append(normal)
13089 * normal_indices.append(elements[-1])
13090 * elif nZeros == 3: # 3 vertices lie in plane # <<<<<<<<<<<<<<
13091 * for I in zeros:
13092 * nodes.append(self.nodeArray[I])
13093*/
13094 __pyx_t_4 = (__pyx_v_nZeros == 3);
13095
13096 if (__pyx_t_4) {
13097
13098
13099 /* "Isosurface.pyx":318
13100 * normal_indices.append(elements[-1])
13101 * elif nZeros == 3: # 3 vertices lie in plane
13102 * for I in zeros: # <<<<<<<<<<<<<<
13103 * nodes.append(self.nodeArray[I])
13104 * elements.append([nN_start + j for j in range(3)])
13105*/
13106 __pyx_t_16 = __pyx_v_zeros; __Pyx_INCREF(__pyx_t_16);
13107 __pyx_t_13 = 0;
13108 for (;;) {
13109 {
13110 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_16);
13111 #if !CYTHON_ASSUME_SAFE_SIZE
13112 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 318, __pyx_L1_error)
13113 #endif
13114 if (__pyx_t_13 >= __pyx_temp) break;
13115 }
13116 __pyx_t_6 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_16, __pyx_t_13, __Pyx_ReferenceSharing_OwnStrongReference);
13117 ++__pyx_t_13;
13118 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 318, __pyx_L1_error)
13119 __Pyx_GOTREF(__pyx_t_6);
13120 __pyx_t_10 = __Pyx_PyLong_As_int(__pyx_t_6); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 318, __pyx_L1_error)
13121 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13122 __pyx_v_I = __pyx_t_10;
13123
13124 /* "Isosurface.pyx":319
13125 * elif nZeros == 3: # 3 vertices lie in plane
13126 * for I in zeros:
13127 * nodes.append(self.nodeArray[I]) # <<<<<<<<<<<<<<
13128 * elements.append([nN_start + j for j in range(3)])
13129 * if nPlus == 1:
13130*/
13131 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 319, __pyx_L1_error)
13132 __Pyx_GOTREF(__pyx_t_6);
13133 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_I, int, 1, __Pyx_PyLong_From_int, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error)
13134 __Pyx_GOTREF(__pyx_t_3);
13135 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13136 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_nodes, __pyx_t_3); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 319, __pyx_L1_error)
13137 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13138
13139
13140 /* "Isosurface.pyx":318
13141 * normal_indices.append(elements[-1])
13142 * elif nZeros == 3: # 3 vertices lie in plane
13143 * for I in zeros: # <<<<<<<<<<<<<<
13144 * nodes.append(self.nodeArray[I])
13145 * elements.append([nN_start + j for j in range(3)])
13146*/
13147 }
13148 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
13149
13150 /* "Isosurface.pyx":320
13151 * for I in zeros:
13152 * nodes.append(self.nodeArray[I])
13153 * elements.append([nN_start + j for j in range(3)]) # <<<<<<<<<<<<<<
13154 * if nPlus == 1:
13155 * if etriple(self.nodeArray[plus[0]] - nodes[-3],
13156*/
13157 { /* enter inner scope */
13158 __pyx_t_16 = PyList_New(0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 320, __pyx_L1_error)
13159 __Pyx_GOTREF(__pyx_t_16);
13160 for (__pyx_t_22 = 0; __pyx_t_22 < 3; __pyx_t_22+=1) {
13161 __pyx_8genexpr8__pyx_v_j = __pyx_t_22;
13162 __pyx_t_3 = __Pyx_PyLong_From_long((__pyx_v_nN_start + __pyx_8genexpr8__pyx_v_j)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 320, __pyx_L1_error)
13163 __Pyx_GOTREF(__pyx_t_3);
13164 __Pyx_GIVEREF(__pyx_t_3);
13165 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_16, __pyx_t_3))) __PYX_ERR(0, 320, __pyx_L1_error)
13166 __pyx_t_3 = 0;
13167 }
13168 } /* exit inner scope */
13169 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_elements, __pyx_t_16); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 320, __pyx_L1_error)
13170 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
13171
13172
13173 /* "Isosurface.pyx":321
13174 * nodes.append(self.nodeArray[I])
13175 * elements.append([nN_start + j for j in range(3)])
13176 * if nPlus == 1: # <<<<<<<<<<<<<<
13177 * if etriple(self.nodeArray[plus[0]] - nodes[-3],
13178 * nodes[-2] - nodes[-3],
13179*/
13180 __pyx_t_4 = (__pyx_v_nPlus == 1);
13181
13182 if (__pyx_t_4) {
13183
13184
13185 /* "Isosurface.pyx":322
13186 * elements.append([nN_start + j for j in range(3)])
13187 * if nPlus == 1:
13188 * if etriple(self.nodeArray[plus[0]] - nodes[-3], # <<<<<<<<<<<<<<
13189 * nodes[-2] - nodes[-3],
13190 * nodes[-1] - nodes[-3]) < 0.0:
13191*/
13192 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 322, __pyx_L1_error)
13193 __Pyx_GOTREF(__pyx_t_16);
13194 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_plus, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error)
13195 __Pyx_GOTREF(__pyx_t_3);
13196 __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_16, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 322, __pyx_L1_error)
13197 __Pyx_GOTREF(__pyx_t_6);
13198 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
13199 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13200 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error)
13201 __Pyx_GOTREF(__pyx_t_3);
13202 __pyx_t_16 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 322, __pyx_L1_error)
13203 __Pyx_GOTREF(__pyx_t_16);
13204 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13205 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13206 if (!(likely(((__pyx_t_16) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_16, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 322, __pyx_L1_error)
13207
13208 /* "Isosurface.pyx":323
13209 * if nPlus == 1:
13210 * if etriple(self.nodeArray[plus[0]] - nodes[-3],
13211 * nodes[-2] - nodes[-3], # <<<<<<<<<<<<<<
13212 * nodes[-1] - nodes[-3]) < 0.0:
13213 * elements[-1] = [elements[-1][0],
13214*/
13215 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_nodes, -2L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error)
13216 __Pyx_GOTREF(__pyx_t_3);
13217 __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 323, __pyx_L1_error)
13218 __Pyx_GOTREF(__pyx_t_6);
13219 __pyx_t_2 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 323, __pyx_L1_error)
13220 __Pyx_GOTREF(__pyx_t_2);
13221 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13222 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13223 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 323, __pyx_L1_error)
13224
13225 /* "Isosurface.pyx":324
13226 * if etriple(self.nodeArray[plus[0]] - nodes[-3],
13227 * nodes[-2] - nodes[-3],
13228 * nodes[-1] - nodes[-3]) < 0.0: # <<<<<<<<<<<<<<
13229 * elements[-1] = [elements[-1][0],
13230 * elements[-1][2],
13231*/
13232 __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_nodes, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 324, __pyx_L1_error)
13233 __Pyx_GOTREF(__pyx_t_6);
13234 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L1_error)
13235 __Pyx_GOTREF(__pyx_t_3);
13236 __pyx_t_1 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error)
13237 __Pyx_GOTREF(__pyx_t_1);
13238 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13239 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13240 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 324, __pyx_L1_error)
13241
13242 /* "Isosurface.pyx":322
13243 * elements.append([nN_start + j for j in range(3)])
13244 * if nPlus == 1:
13245 * if etriple(self.nodeArray[plus[0]] - nodes[-3], # <<<<<<<<<<<<<<
13246 * nodes[-2] - nodes[-3],
13247 * nodes[-1] - nodes[-3]) < 0.0:
13248*/
13249 __pyx_t_18 = __pyx_f_10Isosurface_etriple(((PyArrayObject *)__pyx_t_16), ((PyArrayObject *)__pyx_t_2), ((PyArrayObject *)__pyx_t_1)); if (unlikely(__pyx_t_18 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 322, __pyx_L1_error)
13250 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
13251 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13252 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13253
13254 /* "Isosurface.pyx":324
13255 * if etriple(self.nodeArray[plus[0]] - nodes[-3],
13256 * nodes[-2] - nodes[-3],
13257 * nodes[-1] - nodes[-3]) < 0.0: # <<<<<<<<<<<<<<
13258 * elements[-1] = [elements[-1][0],
13259 * elements[-1][2],
13260*/
13261 __pyx_t_4 = (__pyx_t_18 < 0.0);
13262
13263
13264
13265 /* "Isosurface.pyx":322
13266 * elements.append([nN_start + j for j in range(3)])
13267 * if nPlus == 1:
13268 * if etriple(self.nodeArray[plus[0]] - nodes[-3], # <<<<<<<<<<<<<<
13269 * nodes[-2] - nodes[-3],
13270 * nodes[-1] - nodes[-3]) < 0.0:
13271*/
13272 if (__pyx_t_4) {
13273
13274
13275 /* "Isosurface.pyx":325
13276 * nodes[-2] - nodes[-3],
13277 * nodes[-1] - nodes[-3]) < 0.0:
13278 * elements[-1] = [elements[-1][0], # <<<<<<<<<<<<<<
13279 * elements[-1][2],
13280 * elements[-1][1]]
13281*/
13282 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error)
13283 __Pyx_GOTREF(__pyx_t_1);
13284 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error)
13285 __Pyx_GOTREF(__pyx_t_2);
13286 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13287
13288 /* "Isosurface.pyx":326
13289 * nodes[-1] - nodes[-3]) < 0.0:
13290 * elements[-1] = [elements[-1][0],
13291 * elements[-1][2], # <<<<<<<<<<<<<<
13292 * elements[-1][1]]
13293 * else:
13294*/
13295 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error)
13296 __Pyx_GOTREF(__pyx_t_1);
13297 __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 326, __pyx_L1_error)
13298 __Pyx_GOTREF(__pyx_t_16);
13299 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13300
13301 /* "Isosurface.pyx":327
13302 * elements[-1] = [elements[-1][0],
13303 * elements[-1][2],
13304 * elements[-1][1]] # <<<<<<<<<<<<<<
13305 * else:
13306 * if etriple(self.nodeArray[minus[0]] - nodes[-3],
13307*/
13308 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error)
13309 __Pyx_GOTREF(__pyx_t_1);
13310 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 327, __pyx_L1_error)
13311 __Pyx_GOTREF(__pyx_t_3);
13312 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13313
13314 /* "Isosurface.pyx":325
13315 * nodes[-2] - nodes[-3],
13316 * nodes[-1] - nodes[-3]) < 0.0:
13317 * elements[-1] = [elements[-1][0], # <<<<<<<<<<<<<<
13318 * elements[-1][2],
13319 * elements[-1][1]]
13320*/
13321 __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error)
13322 __Pyx_GOTREF(__pyx_t_1);
13323 __Pyx_GIVEREF(__pyx_t_2);
13324 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 325, __pyx_L1_error);
13325 __Pyx_GIVEREF(__pyx_t_16);
13326 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_16) != (0)) __PYX_ERR(0, 325, __pyx_L1_error);
13327 __Pyx_GIVEREF(__pyx_t_3);
13328 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 325, __pyx_L1_error);
13329 __pyx_t_2 = 0;
13330 __pyx_t_16 = 0;
13331 __pyx_t_3 = 0;
13332 if (unlikely((__Pyx_SetItemInt(__pyx_v_elements, -1L, __pyx_t_1, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 325, __pyx_L1_error)
13333 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13334
13335 /* "Isosurface.pyx":322
13336 * elements.append([nN_start + j for j in range(3)])
13337 * if nPlus == 1:
13338 * if etriple(self.nodeArray[plus[0]] - nodes[-3], # <<<<<<<<<<<<<<
13339 * nodes[-2] - nodes[-3],
13340 * nodes[-1] - nodes[-3]) < 0.0:
13341*/
13342 }
13343
13344 /* "Isosurface.pyx":321
13345 * nodes.append(self.nodeArray[I])
13346 * elements.append([nN_start + j for j in range(3)])
13347 * if nPlus == 1: # <<<<<<<<<<<<<<
13348 * if etriple(self.nodeArray[plus[0]] - nodes[-3],
13349 * nodes[-2] - nodes[-3],
13350*/
13351 goto __pyx_L68;
13352 }
13353
13354 /* "Isosurface.pyx":329
13355 * elements[-1][1]]
13356 * else:
13357 * if etriple(self.nodeArray[minus[0]] - nodes[-3], # <<<<<<<<<<<<<<
13358 * nodes[-2] - nodes[-3],
13359 * nodes[-1] - nodes[-3]) > 0.0:
13360*/
13361 /*else*/ {
13362 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
13363 __Pyx_GOTREF(__pyx_t_1);
13364 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_minus, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L1_error)
13365 __Pyx_GOTREF(__pyx_t_3);
13366 __pyx_t_16 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 329, __pyx_L1_error)
13367 __Pyx_GOTREF(__pyx_t_16);
13368 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13369 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13370 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L1_error)
13371 __Pyx_GOTREF(__pyx_t_3);
13372 __pyx_t_1 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_16, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
13373 __Pyx_GOTREF(__pyx_t_1);
13374 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
13375 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13376 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 329, __pyx_L1_error)
13377
13378 /* "Isosurface.pyx":330
13379 * else:
13380 * if etriple(self.nodeArray[minus[0]] - nodes[-3],
13381 * nodes[-2] - nodes[-3], # <<<<<<<<<<<<<<
13382 * nodes[-1] - nodes[-3]) > 0.0:
13383 * elements[-1] = [elements[-1][0],
13384*/
13385 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_nodes, -2L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 330, __pyx_L1_error)
13386 __Pyx_GOTREF(__pyx_t_3);
13387 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 330, __pyx_L1_error)
13388 __Pyx_GOTREF(__pyx_t_16);
13389 __pyx_t_2 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_3, __pyx_t_16); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error)
13390 __Pyx_GOTREF(__pyx_t_2);
13391 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13392 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
13393 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 330, __pyx_L1_error)
13394
13395 /* "Isosurface.pyx":331
13396 * if etriple(self.nodeArray[minus[0]] - nodes[-3],
13397 * nodes[-2] - nodes[-3],
13398 * nodes[-1] - nodes[-3]) > 0.0: # <<<<<<<<<<<<<<
13399 * elements[-1] = [elements[-1][0],
13400 * elements[-1][2],
13401*/
13402 __pyx_t_16 = __Pyx_GetItemInt_List(__pyx_v_nodes, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 331, __pyx_L1_error)
13403 __Pyx_GOTREF(__pyx_t_16);
13404 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_nodes, -3L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
13405 __Pyx_GOTREF(__pyx_t_3);
13406 __pyx_t_6 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_16, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error)
13407 __Pyx_GOTREF(__pyx_t_6);
13408 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
13409 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13410 if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 331, __pyx_L1_error)
13411
13412 /* "Isosurface.pyx":329
13413 * elements[-1][1]]
13414 * else:
13415 * if etriple(self.nodeArray[minus[0]] - nodes[-3], # <<<<<<<<<<<<<<
13416 * nodes[-2] - nodes[-3],
13417 * nodes[-1] - nodes[-3]) > 0.0:
13418*/
13419 __pyx_t_18 = __pyx_f_10Isosurface_etriple(((PyArrayObject *)__pyx_t_1), ((PyArrayObject *)__pyx_t_2), ((PyArrayObject *)__pyx_t_6)); if (unlikely(__pyx_t_18 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 329, __pyx_L1_error)
13420 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13421 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13422 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13423
13424 /* "Isosurface.pyx":331
13425 * if etriple(self.nodeArray[minus[0]] - nodes[-3],
13426 * nodes[-2] - nodes[-3],
13427 * nodes[-1] - nodes[-3]) > 0.0: # <<<<<<<<<<<<<<
13428 * elements[-1] = [elements[-1][0],
13429 * elements[-1][2],
13430*/
13431 __pyx_t_4 = (__pyx_t_18 > 0.0);
13432
13433
13434
13435 /* "Isosurface.pyx":329
13436 * elements[-1][1]]
13437 * else:
13438 * if etriple(self.nodeArray[minus[0]] - nodes[-3], # <<<<<<<<<<<<<<
13439 * nodes[-2] - nodes[-3],
13440 * nodes[-1] - nodes[-3]) > 0.0:
13441*/
13442 if (__pyx_t_4) {
13443
13444
13445 /* "Isosurface.pyx":332
13446 * nodes[-2] - nodes[-3],
13447 * nodes[-1] - nodes[-3]) > 0.0:
13448 * elements[-1] = [elements[-1][0], # <<<<<<<<<<<<<<
13449 * elements[-1][2],
13450 * elements[-1][1]]
13451*/
13452 __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __pyx_L1_error)
13453 __Pyx_GOTREF(__pyx_t_6);
13454 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
13455 __Pyx_GOTREF(__pyx_t_2);
13456 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13457
13458 /* "Isosurface.pyx":333
13459 * nodes[-1] - nodes[-3]) > 0.0:
13460 * elements[-1] = [elements[-1][0],
13461 * elements[-1][2], # <<<<<<<<<<<<<<
13462 * elements[-1][1]]
13463 * normal = ecross(
13464*/
13465 __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L1_error)
13466 __Pyx_GOTREF(__pyx_t_6);
13467 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_6, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error)
13468 __Pyx_GOTREF(__pyx_t_1);
13469 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13470
13471 /* "Isosurface.pyx":334
13472 * elements[-1] = [elements[-1][0],
13473 * elements[-1][2],
13474 * elements[-1][1]] # <<<<<<<<<<<<<<
13475 * normal = ecross(
13476 * nodes[elements[-1][1]] - nodes[elements[-1][0]],
13477*/
13478 __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error)
13479 __Pyx_GOTREF(__pyx_t_6);
13480 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L1_error)
13481 __Pyx_GOTREF(__pyx_t_3);
13482 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13483
13484 /* "Isosurface.pyx":332
13485 * nodes[-2] - nodes[-3],
13486 * nodes[-1] - nodes[-3]) > 0.0:
13487 * elements[-1] = [elements[-1][0], # <<<<<<<<<<<<<<
13488 * elements[-1][2],
13489 * elements[-1][1]]
13490*/
13491 __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __pyx_L1_error)
13492 __Pyx_GOTREF(__pyx_t_6);
13493 __Pyx_GIVEREF(__pyx_t_2);
13494 if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 332, __pyx_L1_error);
13495 __Pyx_GIVEREF(__pyx_t_1);
13496 if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 332, __pyx_L1_error);
13497 __Pyx_GIVEREF(__pyx_t_3);
13498 if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 332, __pyx_L1_error);
13499 __pyx_t_2 = 0;
13500 __pyx_t_1 = 0;
13501 __pyx_t_3 = 0;
13502 if (unlikely((__Pyx_SetItemInt(__pyx_v_elements, -1L, __pyx_t_6, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 332, __pyx_L1_error)
13503 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13504
13505 /* "Isosurface.pyx":329
13506 * elements[-1][1]]
13507 * else:
13508 * if etriple(self.nodeArray[minus[0]] - nodes[-3], # <<<<<<<<<<<<<<
13509 * nodes[-2] - nodes[-3],
13510 * nodes[-1] - nodes[-3]) > 0.0:
13511*/
13512 }
13513 }
13514 __pyx_L68:;
13515
13516 /* "Isosurface.pyx":336
13517 * elements[-1][1]]
13518 * normal = ecross(
13519 * nodes[elements[-1][1]] - nodes[elements[-1][0]], # <<<<<<<<<<<<<<
13520 * nodes[elements[-1][2]] - nodes[elements[-1][0]])
13521 * normal /= enorm(normal)
13522*/
13523 __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 336, __pyx_L1_error)
13524 __Pyx_GOTREF(__pyx_t_6);
13525 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error)
13526 __Pyx_GOTREF(__pyx_t_3);
13527 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13528 __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 336, __pyx_L1_error)
13529 __Pyx_GOTREF(__pyx_t_6);
13530 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13531 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error)
13532 __Pyx_GOTREF(__pyx_t_3);
13533 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error)
13534 __Pyx_GOTREF(__pyx_t_1);
13535 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13536 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error)
13537 __Pyx_GOTREF(__pyx_t_3);
13538 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13539 __pyx_t_1 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error)
13540 __Pyx_GOTREF(__pyx_t_1);
13541 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13542 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13543 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 336, __pyx_L1_error)
13544
13545 /* "Isosurface.pyx":337
13546 * normal = ecross(
13547 * nodes[elements[-1][1]] - nodes[elements[-1][0]],
13548 * nodes[elements[-1][2]] - nodes[elements[-1][0]]) # <<<<<<<<<<<<<<
13549 * normal /= enorm(normal)
13550 * normals.append(normal)
13551*/
13552 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error)
13553 __Pyx_GOTREF(__pyx_t_3);
13554 __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_3, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error)
13555 __Pyx_GOTREF(__pyx_t_6);
13556 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13557 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error)
13558 __Pyx_GOTREF(__pyx_t_3);
13559 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13560 __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error)
13561 __Pyx_GOTREF(__pyx_t_6);
13562 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
13563 __Pyx_GOTREF(__pyx_t_2);
13564 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13565 __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_nodes, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error)
13566 __Pyx_GOTREF(__pyx_t_6);
13567 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13568 __pyx_t_2 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
13569 __Pyx_GOTREF(__pyx_t_2);
13570 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13571 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13572 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 337, __pyx_L1_error)
13573
13574 /* "Isosurface.pyx":335
13575 * elements[-1][2],
13576 * elements[-1][1]]
13577 * normal = ecross( # <<<<<<<<<<<<<<
13578 * nodes[elements[-1][1]] - nodes[elements[-1][0]],
13579 * nodes[elements[-1][2]] - nodes[elements[-1][0]])
13580*/
13581 __pyx_t_6 = ((PyObject *)__pyx_f_10Isosurface_ecross(((PyArrayObject *)__pyx_t_1), ((PyArrayObject *)__pyx_t_2))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 335, __pyx_L1_error)
13582 __Pyx_GOTREF(__pyx_t_6);
13583 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13584 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13585 {
13586 __Pyx_BufFmt_StackElem __pyx_stack[1];
13587 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
13588 __pyx_t_10 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_6), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
13589 if (unlikely(__pyx_t_10 < 0)) {
13590 __Pyx_PyErr_FetchException(&__pyx_t_21, &__pyx_t_20, &__pyx_t_19);
13591 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)) {
13592 Py_XDECREF(__pyx_t_21); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_19);
13593 __Pyx_RaiseBufferFallbackError();
13594 } else {
13595 __Pyx_PyErr_RestoreException(__pyx_t_21, __pyx_t_20, __pyx_t_19);
13596 }
13597 __pyx_t_21 = __pyx_t_20 = __pyx_t_19 = 0;
13598 }
13599 __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];
13600 if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 335, __pyx_L1_error)
13601 }
13602 __Pyx_XDECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_6));
13603 __pyx_t_6 = 0;
13604
13605 /* "Isosurface.pyx":338
13606 * nodes[elements[-1][1]] - nodes[elements[-1][0]],
13607 * nodes[elements[-1][2]] - nodes[elements[-1][0]])
13608 * normal /= enorm(normal) # <<<<<<<<<<<<<<
13609 * normals.append(normal)
13610 * normals.append(normal)
13611*/
13612 __pyx_t_18 = __pyx_f_10Isosurface_enorm(((PyArrayObject *)__pyx_v_normal)); if (unlikely(__pyx_t_18 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
13613 __pyx_t_6 = PyFloat_FromDouble(__pyx_t_18); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 338, __pyx_L1_error)
13614 __Pyx_GOTREF(__pyx_t_6);
13615
13616 __pyx_t_2 = __Pyx_PyNumber_InPlaceDivide(((PyObject *)__pyx_v_normal), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __pyx_L1_error)
13617 __Pyx_GOTREF(__pyx_t_2);
13618 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13619 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 338, __pyx_L1_error)
13620 {
13621 __Pyx_BufFmt_StackElem __pyx_stack[1];
13622 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
13623 __pyx_t_10 = __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);
13624 if (unlikely(__pyx_t_10 < 0)) {
13625 __Pyx_PyErr_FetchException(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
13626 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)) {
13627 Py_XDECREF(__pyx_t_19); Py_XDECREF(__pyx_t_20); Py_XDECREF(__pyx_t_21);
13628 __Pyx_RaiseBufferFallbackError();
13629 } else {
13630 __Pyx_PyErr_RestoreException(__pyx_t_19, __pyx_t_20, __pyx_t_21);
13631 }
13632 __pyx_t_19 = __pyx_t_20 = __pyx_t_21 = 0;
13633 }
13634 __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];
13635 if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 338, __pyx_L1_error)
13636 }
13637 __Pyx_DECREF_SET(__pyx_v_normal, ((PyArrayObject *)__pyx_t_2));
13638 __pyx_t_2 = 0;
13639
13640 /* "Isosurface.pyx":339
13641 * nodes[elements[-1][2]] - nodes[elements[-1][0]])
13642 * normal /= enorm(normal)
13643 * normals.append(normal) # <<<<<<<<<<<<<<
13644 * normals.append(normal)
13645 * normals.append(normal)
13646*/
13647 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 339, __pyx_L1_error)
13648
13649
13650 /* "Isosurface.pyx":340
13651 * normal /= enorm(normal)
13652 * normals.append(normal)
13653 * normals.append(normal) # <<<<<<<<<<<<<<
13654 * normals.append(normal)
13655 * normal_indices.append(elements[-1])
13656*/
13657 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 340, __pyx_L1_error)
13658
13659
13660 /* "Isosurface.pyx":341
13661 * normals.append(normal)
13662 * normals.append(normal)
13663 * normals.append(normal) # <<<<<<<<<<<<<<
13664 * normal_indices.append(elements[-1])
13665 *
13666*/
13667 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normals, ((PyObject *)__pyx_v_normal)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 341, __pyx_L1_error)
13668
13669
13670 /* "Isosurface.pyx":342
13671 * normals.append(normal)
13672 * normals.append(normal)
13673 * normal_indices.append(elements[-1]) # <<<<<<<<<<<<<<
13674 *
13675 * def writeIsosurfaceMesh(self, field, value, frame):
13676*/
13677 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_elements, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
13678 __Pyx_GOTREF(__pyx_t_2);
13679 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normal_indices, __pyx_t_2); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 342, __pyx_L1_error)
13680 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13681
13682
13683 /* "Isosurface.pyx":317
13684 * normals.append(normal)
13685 * normal_indices.append(elements[-1])
13686 * elif nZeros == 3: # 3 vertices lie in plane # <<<<<<<<<<<<<<
13687 * for I in zeros:
13688 * nodes.append(self.nodeArray[I])
13689*/
13690 }
13691 __pyx_L9:;
13692 }
13693
13694
13695
13696 /* "Isosurface.pyx":154
13697 * return self
13698 *
13699 * def triangulateIsosurface(self, field, value): # <<<<<<<<<<<<<<
13700 * """
13701 * Build a triangular mesh of the isosurface
13702*/
13703
13704 /* function exit code */
13705 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13706 goto __pyx_L0;
13707 __pyx_L1_error:;
13708 __Pyx_XDECREF(__pyx_t_1);
13709 __Pyx_XDECREF(__pyx_t_2);
13710 __Pyx_XDECREF(__pyx_t_3);
13711 __Pyx_XDECREF(__pyx_t_6);
13712 __Pyx_XDECREF(__pyx_t_16);
13713 __Pyx_XDECREF(__pyx_t_17);
13714 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
13715 __Pyx_PyThreadState_declare
13716 __Pyx_PyThreadState_assign
13717 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
13718 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
13719 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
13720 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
13721 __Pyx_AddTraceback("Isosurface.Isosurface.triangulateIsosurface", __pyx_clineno, __pyx_lineno, __pyx_filename);
13722 __pyx_r = NULL;
13723 goto __pyx_L2;
13724 __pyx_L0:;
13725 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_normal.rcbuffer->pybuffer);
13726 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
13727 __pyx_L2:;
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738 __Pyx_XDECREF((PyObject *)__pyx_v_x);
13739 __Pyx_XDECREF((PyObject *)__pyx_v_normal);
13740 __Pyx_XDECREF(__pyx_v_nodes);
13741 __Pyx_XDECREF(__pyx_v_elements);
13742 __Pyx_XDECREF(__pyx_v_normals);
13743 __Pyx_XDECREF(__pyx_v_normal_indices);
13744 __Pyx_XDECREF(__pyx_v_phi);
13745 __Pyx_XDECREF(__pyx_v_plus);
13746 __Pyx_XDECREF(__pyx_v_minus);
13747 __Pyx_XDECREF(__pyx_v_zeros);
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759 __Pyx_XGIVEREF(__pyx_r);
13760 __Pyx_RefNannyFinishContext();
13761 return __pyx_r;
13762}
13763
13764/* "Isosurface.pyx":344
13765 * normal_indices.append(elements[-1])
13766 *
13767 * def writeIsosurfaceMesh(self, field, value, frame): # <<<<<<<<<<<<<<
13768 * if self.format == 'pov':
13769 * log("Writing pov frame " + repr(frame))
13770*/
13771
13772/* Python wrapper */
13773static PyObject *__pyx_pw_10Isosurface_10Isosurface_9writeIsosurfaceMesh(PyObject *__pyx_self,
13774#if CYTHON_VECTORCALL
13775PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
13776#else
13777PyObject *__pyx_args, PyObject *__pyx_kwds
13778#endif
13779); /*proto*/
13780PyDoc_STRVAR(__pyx_doc_10Isosurface_10Isosurface_8writeIsosurfaceMesh, "Isosurface.writeIsosurfaceMesh(self, field, value, frame)");
13781static PyMethodDef __pyx_mdef_10Isosurface_10Isosurface_9writeIsosurfaceMesh = {"writeIsosurfaceMesh", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10Isosurface_10Isosurface_9writeIsosurfaceMesh, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10Isosurface_10Isosurface_8writeIsosurfaceMesh};
13782static PyObject *__pyx_pw_10Isosurface_10Isosurface_9writeIsosurfaceMesh(PyObject *__pyx_self,
13783#if CYTHON_VECTORCALL
13784PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
13785#else
13786PyObject *__pyx_args, PyObject *__pyx_kwds
13787#endif
13788) {
13789 PyObject *__pyx_v_self = 0;
13790 PyObject *__pyx_v_field = 0;
13791 PyObject *__pyx_v_value = 0;
13792 PyObject *__pyx_v_frame = 0;
13793 #if !CYTHON_VECTORCALL
13794 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
13795 #endif
13796 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
13797 PyObject* values[4] = {0,0,0,0};
13798 int __pyx_lineno = 0;
13799 const char *__pyx_filename = NULL;
13800 int __pyx_clineno = 0;
13801 PyObject *__pyx_r = 0;
13802 __Pyx_RefNannyDeclarations
13803 __Pyx_RefNannySetupContext("writeIsosurfaceMesh (wrapper)", 0);
13804 #if !CYTHON_VECTORCALL
13805 #if CYTHON_ASSUME_SAFE_SIZE
13806 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
13807 #else
13808 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
13809 #endif
13810 #endif
13811 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
13812 {
13813 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_field,&__pyx_mstate_global->__pyx_n_u_value,&__pyx_mstate_global->__pyx_n_u_frame,0};
13814 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
13815 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 344, __pyx_L3_error)
13816 if (__pyx_kwds_len > 0) {
13817 switch (__pyx_nargs) {
13818 case 4:
13819 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
13820 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 344, __pyx_L3_error)
13821 CYTHON_FALLTHROUGH;
13822 case 3:
13823 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
13824 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 344, __pyx_L3_error)
13825 CYTHON_FALLTHROUGH;
13826 case 2:
13827 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
13828 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 344, __pyx_L3_error)
13829 CYTHON_FALLTHROUGH;
13830 case 1:
13831 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
13832 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 344, __pyx_L3_error)
13833 CYTHON_FALLTHROUGH;
13834 case 0: break;
13835 default: goto __pyx_L5_argtuple_error;
13836 }
13837 const Py_ssize_t kwd_pos_args = __pyx_nargs;
13838 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "writeIsosurfaceMesh", 0) < (0)) __PYX_ERR(0, 344, __pyx_L3_error)
13839 for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
13840 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("writeIsosurfaceMesh", 1, 4, 4, i); __PYX_ERR(0, 344, __pyx_L3_error) }
13841 }
13842 } else if (unlikely(__pyx_nargs != 4)) {
13843 goto __pyx_L5_argtuple_error;
13844 } else {
13845 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
13846 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 344, __pyx_L3_error)
13847 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
13848 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 344, __pyx_L3_error)
13849 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
13850 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 344, __pyx_L3_error)
13851 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
13852 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 344, __pyx_L3_error)
13853 }
13854 __pyx_v_self = values[0];
13855 __pyx_v_field = values[1];
13856 __pyx_v_value = values[2];
13857 __pyx_v_frame = values[3];
13858 }
13859 goto __pyx_L6_skip;
13860 __pyx_L5_argtuple_error:;
13861 __Pyx_RaiseArgtupleInvalid("writeIsosurfaceMesh", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 344, __pyx_L3_error)
13862 __pyx_L6_skip:;
13863 goto __pyx_L4_argument_unpacking_done;
13864 __pyx_L3_error:;
13865 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
13866 Py_XDECREF(values[__pyx_temp]);
13867 }
13868 __Pyx_AddTraceback("Isosurface.Isosurface.writeIsosurfaceMesh", __pyx_clineno, __pyx_lineno, __pyx_filename);
13869 __Pyx_RefNannyFinishContext();
13870 return NULL;
13871 __pyx_L4_argument_unpacking_done:;
13872 __pyx_r = __pyx_pf_10Isosurface_10Isosurface_8writeIsosurfaceMesh(__pyx_self, __pyx_v_self, __pyx_v_field, __pyx_v_value, __pyx_v_frame);
13873
13874 /* function exit code */
13875 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
13876 Py_XDECREF(values[__pyx_temp]);
13877 }
13878 __Pyx_RefNannyFinishContext();
13879 return __pyx_r;
13880}
13881
13882static 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) {
13883 PyObject *__pyx_r = NULL;
13884 __Pyx_RefNannyDeclarations
13885 PyObject *__pyx_t_1 = NULL;
13886 int __pyx_t_2;
13887 PyObject *__pyx_t_3 = NULL;
13888 PyObject *__pyx_t_4 = NULL;
13889 PyObject *__pyx_t_5 = NULL;
13890 PyObject *__pyx_t_6 = NULL;
13891 size_t __pyx_t_7;
13892 int __pyx_lineno = 0;
13893 const char *__pyx_filename = NULL;
13894 int __pyx_clineno = 0;
13895 __Pyx_RefNannySetupContext("writeIsosurfaceMesh", 0);
13896
13897 /* "Isosurface.pyx":345
13898 *
13899 * def writeIsosurfaceMesh(self, field, value, frame):
13900 * if self.format == 'pov': # <<<<<<<<<<<<<<
13901 * log("Writing pov frame " + repr(frame))
13902 * self.writeIsosurfaceMesh_povray(field, value, frame)
13903*/
13904 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error)
13905 __Pyx_GOTREF(__pyx_t_1);
13906 __pyx_t_2 = __Pyx_PyObject_CompareBoolEq_object_str(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_pov, Py_EQ); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 345, __pyx_L1_error)
13907 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13908 if (__pyx_t_2) {
13909
13910
13911 /* "Isosurface.pyx":346
13912 * def writeIsosurfaceMesh(self, field, value, frame):
13913 * if self.format == 'pov':
13914 * log("Writing pov frame " + repr(frame)) # <<<<<<<<<<<<<<
13915 * self.writeIsosurfaceMesh_povray(field, value, frame)
13916 * elif self.format == 'h5':
13917*/
13918 __pyx_t_3 = NULL;
13919 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_log); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 346, __pyx_L1_error)
13920 __Pyx_GOTREF(__pyx_t_4);
13921 __pyx_t_5 = PyObject_Repr(__pyx_v_frame); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 346, __pyx_L1_error)
13922 __Pyx_GOTREF(__pyx_t_5);
13923 __pyx_t_6 = __Pyx_PyUnicode_ConcatSafe(__pyx_mstate_global->__pyx_kp_u_Writing_pov_frame, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 346, __pyx_L1_error)
13924 __Pyx_GOTREF(__pyx_t_6);
13925 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13926 __pyx_t_7 = 1;
13927 #if CYTHON_UNPACK_METHODS
13928 if (unlikely(PyMethod_Check(__pyx_t_4))) {
13929 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
13930 assert(__pyx_t_3);
13931 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
13932 __Pyx_INCREF(__pyx_t_3);
13933 __Pyx_INCREF(__pyx__function);
13934 __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
13935 __pyx_t_7 = 0;
13936 }
13937 #endif
13938 {
13939 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_6};
13940 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
13941 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13942 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13943 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13944 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error)
13945 __Pyx_GOTREF(__pyx_t_1);
13946 }
13947 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13948
13949 /* "Isosurface.pyx":347
13950 * if self.format == 'pov':
13951 * log("Writing pov frame " + repr(frame))
13952 * self.writeIsosurfaceMesh_povray(field, value, frame) # <<<<<<<<<<<<<<
13953 * elif self.format == 'h5':
13954 * self.writeIsosurfaceMesh_h5(field, value, frame)
13955*/
13956 __pyx_t_4 = __pyx_v_self;
13957 __Pyx_INCREF(__pyx_t_4);
13958 __pyx_t_7 = 0;
13959 {
13960 PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_field, __pyx_v_value, __pyx_v_frame};
13961 __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_writeIsosurfaceMesh_povray, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
13962 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13963 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error)
13964 __Pyx_GOTREF(__pyx_t_1);
13965 }
13966 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13967
13968 /* "Isosurface.pyx":345
13969 *
13970 * def writeIsosurfaceMesh(self, field, value, frame):
13971 * if self.format == 'pov': # <<<<<<<<<<<<<<
13972 * log("Writing pov frame " + repr(frame))
13973 * self.writeIsosurfaceMesh_povray(field, value, frame)
13974*/
13975 goto __pyx_L3;
13976 }
13977
13978 /* "Isosurface.pyx":348
13979 * log("Writing pov frame " + repr(frame))
13980 * self.writeIsosurfaceMesh_povray(field, value, frame)
13981 * elif self.format == 'h5': # <<<<<<<<<<<<<<
13982 * self.writeIsosurfaceMesh_h5(field, value, frame)
13983 * elif self.format is None:
13984*/
13985 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error)
13986 __Pyx_GOTREF(__pyx_t_1);
13987 __pyx_t_2 = __Pyx_PyObject_CompareBoolEq_object_str(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_h5, Py_EQ); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 348, __pyx_L1_error)
13988 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13989 if (__pyx_t_2) {
13990
13991
13992 /* "Isosurface.pyx":349
13993 * self.writeIsosurfaceMesh_povray(field, value, frame)
13994 * elif self.format == 'h5':
13995 * self.writeIsosurfaceMesh_h5(field, value, frame) # <<<<<<<<<<<<<<
13996 * elif self.format is None:
13997 * pass
13998*/
13999 __pyx_t_4 = __pyx_v_self;
14000 __Pyx_INCREF(__pyx_t_4);
14001 __pyx_t_7 = 0;
14002 {
14003 PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_field, __pyx_v_value, __pyx_v_frame};
14004 __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_writeIsosurfaceMesh_h5, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
14005 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14006 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error)
14007 __Pyx_GOTREF(__pyx_t_1);
14008 }
14009 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14010
14011 /* "Isosurface.pyx":348
14012 * log("Writing pov frame " + repr(frame))
14013 * self.writeIsosurfaceMesh_povray(field, value, frame)
14014 * elif self.format == 'h5': # <<<<<<<<<<<<<<
14015 * self.writeIsosurfaceMesh_h5(field, value, frame)
14016 * elif self.format is None:
14017*/
14018 goto __pyx_L3;
14019 }
14020
14021 /* "Isosurface.pyx":350
14022 * elif self.format == 'h5':
14023 * self.writeIsosurfaceMesh_h5(field, value, frame)
14024 * elif self.format is None: # <<<<<<<<<<<<<<
14025 * pass
14026 * else:
14027*/
14028 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error)
14029 __Pyx_GOTREF(__pyx_t_1);
14030 __pyx_t_2 = (__pyx_t_1 == Py_None);
14031 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14032 if (__pyx_t_2) {
14033
14034 goto __pyx_L3;
14035 }
14036
14037 /* "Isosurface.pyx":353
14038 * pass
14039 * else:
14040 * log("Isosurface file format not recognized") # <<<<<<<<<<<<<<
14041 *
14042 * def writeIsosurfaceMesh_h5(self, field, value, frame):
14043*/
14044 /*else*/ {
14045 __pyx_t_4 = NULL;
14046 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_log); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 353, __pyx_L1_error)
14047 __Pyx_GOTREF(__pyx_t_6);
14048 __pyx_t_7 = 1;
14049 #if CYTHON_UNPACK_METHODS
14050 if (unlikely(PyMethod_Check(__pyx_t_6))) {
14051 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
14052 assert(__pyx_t_4);
14053 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
14054 __Pyx_INCREF(__pyx_t_4);
14055 __Pyx_INCREF(__pyx__function);
14056 __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
14057 __pyx_t_7 = 0;
14058 }
14059 #endif
14060 {
14061 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Isosurface_file_format_not_recog};
14062 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
14063 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14064 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14065 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error)
14066 __Pyx_GOTREF(__pyx_t_1);
14067 }
14068 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14069 }
14070 __pyx_L3:;
14071
14072 /* "Isosurface.pyx":344
14073 * normal_indices.append(elements[-1])
14074 *
14075 * def writeIsosurfaceMesh(self, field, value, frame): # <<<<<<<<<<<<<<
14076 * if self.format == 'pov':
14077 * log("Writing pov frame " + repr(frame))
14078*/
14079
14080 /* function exit code */
14081 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14082 goto __pyx_L0;
14083 __pyx_L1_error:;
14084 __Pyx_XDECREF(__pyx_t_1);
14085 __Pyx_XDECREF(__pyx_t_3);
14086 __Pyx_XDECREF(__pyx_t_4);
14087 __Pyx_XDECREF(__pyx_t_5);
14088 __Pyx_XDECREF(__pyx_t_6);
14089 __Pyx_AddTraceback("Isosurface.Isosurface.writeIsosurfaceMesh", __pyx_clineno, __pyx_lineno, __pyx_filename);
14090 __pyx_r = NULL;
14091 __pyx_L0:;
14092 __Pyx_XGIVEREF(__pyx_r);
14093 __Pyx_RefNannyFinishContext();
14094 return __pyx_r;
14095}
14096
14097/* "Isosurface.pyx":355
14098 * log("Isosurface file format not recognized")
14099 *
14100 * def writeIsosurfaceMesh_h5(self, field, value, frame): # <<<<<<<<<<<<<<
14101 * import h5py
14102 * nodes = self.nodes[(field, value)]
14103*/
14104
14105/* Python wrapper */
14106static PyObject *__pyx_pw_10Isosurface_10Isosurface_11writeIsosurfaceMesh_h5(PyObject *__pyx_self,
14107#if CYTHON_VECTORCALL
14108PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14109#else
14110PyObject *__pyx_args, PyObject *__pyx_kwds
14111#endif
14112); /*proto*/
14113PyDoc_STRVAR(__pyx_doc_10Isosurface_10Isosurface_10writeIsosurfaceMesh_h5, "Isosurface.writeIsosurfaceMesh_h5(self, field, value, frame)");
14114static PyMethodDef __pyx_mdef_10Isosurface_10Isosurface_11writeIsosurfaceMesh_h5 = {"writeIsosurfaceMesh_h5", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10Isosurface_10Isosurface_11writeIsosurfaceMesh_h5, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10Isosurface_10Isosurface_10writeIsosurfaceMesh_h5};
14115static PyObject *__pyx_pw_10Isosurface_10Isosurface_11writeIsosurfaceMesh_h5(PyObject *__pyx_self,
14116#if CYTHON_VECTORCALL
14117PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14118#else
14119PyObject *__pyx_args, PyObject *__pyx_kwds
14120#endif
14121) {
14122 PyObject *__pyx_v_self = 0;
14123 PyObject *__pyx_v_field = 0;
14124 PyObject *__pyx_v_value = 0;
14125 CYTHON_UNUSED PyObject *__pyx_v_frame = 0;
14126 #if !CYTHON_VECTORCALL
14127 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
14128 #endif
14129 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
14130 PyObject* values[4] = {0,0,0,0};
14131 int __pyx_lineno = 0;
14132 const char *__pyx_filename = NULL;
14133 int __pyx_clineno = 0;
14134 PyObject *__pyx_r = 0;
14135 __Pyx_RefNannyDeclarations
14136 __Pyx_RefNannySetupContext("writeIsosurfaceMesh_h5 (wrapper)", 0);
14137 #if !CYTHON_VECTORCALL
14138 #if CYTHON_ASSUME_SAFE_SIZE
14139 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
14140 #else
14141 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
14142 #endif
14143 #endif
14144 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
14145 {
14146 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_field,&__pyx_mstate_global->__pyx_n_u_value,&__pyx_mstate_global->__pyx_n_u_frame,0};
14147 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
14148 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 355, __pyx_L3_error)
14149 if (__pyx_kwds_len > 0) {
14150 switch (__pyx_nargs) {
14151 case 4:
14152 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
14153 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 355, __pyx_L3_error)
14154 CYTHON_FALLTHROUGH;
14155 case 3:
14156 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
14157 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 355, __pyx_L3_error)
14158 CYTHON_FALLTHROUGH;
14159 case 2:
14160 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
14161 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 355, __pyx_L3_error)
14162 CYTHON_FALLTHROUGH;
14163 case 1:
14164 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
14165 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 355, __pyx_L3_error)
14166 CYTHON_FALLTHROUGH;
14167 case 0: break;
14168 default: goto __pyx_L5_argtuple_error;
14169 }
14170 const Py_ssize_t kwd_pos_args = __pyx_nargs;
14171 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "writeIsosurfaceMesh_h5", 0) < (0)) __PYX_ERR(0, 355, __pyx_L3_error)
14172 for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
14173 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("writeIsosurfaceMesh_h5", 1, 4, 4, i); __PYX_ERR(0, 355, __pyx_L3_error) }
14174 }
14175 } else if (unlikely(__pyx_nargs != 4)) {
14176 goto __pyx_L5_argtuple_error;
14177 } else {
14178 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
14179 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 355, __pyx_L3_error)
14180 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
14181 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 355, __pyx_L3_error)
14182 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
14183 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 355, __pyx_L3_error)
14184 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
14185 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 355, __pyx_L3_error)
14186 }
14187 __pyx_v_self = values[0];
14188 __pyx_v_field = values[1];
14189 __pyx_v_value = values[2];
14190 __pyx_v_frame = values[3];
14191 }
14192 goto __pyx_L6_skip;
14193 __pyx_L5_argtuple_error:;
14194 __Pyx_RaiseArgtupleInvalid("writeIsosurfaceMesh_h5", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 355, __pyx_L3_error)
14195 __pyx_L6_skip:;
14196 goto __pyx_L4_argument_unpacking_done;
14197 __pyx_L3_error:;
14198 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
14199 Py_XDECREF(values[__pyx_temp]);
14200 }
14201 __Pyx_AddTraceback("Isosurface.Isosurface.writeIsosurfaceMesh_h5", __pyx_clineno, __pyx_lineno, __pyx_filename);
14202 __Pyx_RefNannyFinishContext();
14203 return NULL;
14204 __pyx_L4_argument_unpacking_done:;
14205 __pyx_r = __pyx_pf_10Isosurface_10Isosurface_10writeIsosurfaceMesh_h5(__pyx_self, __pyx_v_self, __pyx_v_field, __pyx_v_value, __pyx_v_frame);
14206
14207 /* function exit code */
14208 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
14209 Py_XDECREF(values[__pyx_temp]);
14210 }
14211 __Pyx_RefNannyFinishContext();
14212 return __pyx_r;
14213}
14214
14215static 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) {
14216 PyObject *__pyx_v_h5py = NULL;
14217 PyObject *__pyx_v_nodes = NULL;
14218 PyObject *__pyx_v_elements = NULL;
14219 PyObject *__pyx_v_normals = NULL;
14220 PyObject *__pyx_v_normal_indices = NULL;
14221 PyObject *__pyx_v_filename = NULL;
14222 PyObject *__pyx_v_f = NULL;
14223 CYTHON_UNUSED PyObject *__pyx_v_dset = NULL;
14224 PyObject *__pyx_r = NULL;
14225 __Pyx_RefNannyDeclarations
14226 PyObject *__pyx_t_1 = NULL;
14227 PyObject *__pyx_t_2 = NULL;
14228 PyObject *__pyx_t_3 = NULL;
14229 PyObject *__pyx_t_4 = NULL;
14230 PyObject *__pyx_t_5 = NULL;
14231 PyObject *__pyx_t_6 = NULL;
14232 PyObject *__pyx_t_7 = NULL;
14233 PyObject *__pyx_t_8 = NULL;
14234 PyObject *__pyx_t_9 = NULL;
14235 size_t __pyx_t_10;
14236 int __pyx_t_11;
14237 int __pyx_lineno = 0;
14238 const char *__pyx_filename = NULL;
14239 int __pyx_clineno = 0;
14240 __Pyx_RefNannySetupContext("writeIsosurfaceMesh_h5", 0);
14241
14242 /* "Isosurface.pyx":356
14243 *
14244 * def writeIsosurfaceMesh_h5(self, field, value, frame):
14245 * import h5py # <<<<<<<<<<<<<<
14246 * nodes = self.nodes[(field, value)]
14247 * elements = self.elements[(field, value)]
14248*/
14249 __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_h5py, 0, 0, NULL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error)
14250 __pyx_t_1 = __pyx_t_2;
14251 __Pyx_GOTREF(__pyx_t_1);
14252 __pyx_v_h5py = __pyx_t_1;
14253 __pyx_t_1 = 0;
14254
14255 /* "Isosurface.pyx":357
14256 * def writeIsosurfaceMesh_h5(self, field, value, frame):
14257 * import h5py
14258 * nodes = self.nodes[(field, value)] # <<<<<<<<<<<<<<
14259 * elements = self.elements[(field, value)]
14260 * normals = self.normals[(field, value)]
14261*/
14262 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error)
14263 __Pyx_GOTREF(__pyx_t_1);
14264 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error)
14265 __Pyx_GOTREF(__pyx_t_3);
14266 __Pyx_INCREF(__pyx_v_field);
14267 __Pyx_GIVEREF(__pyx_v_field);
14268 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_field) != (0)) __PYX_ERR(0, 357, __pyx_L1_error);
14269 __Pyx_INCREF(__pyx_v_value);
14270 __Pyx_GIVEREF(__pyx_v_value);
14271 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_value) != (0)) __PYX_ERR(0, 357, __pyx_L1_error);
14272 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 357, __pyx_L1_error)
14273 __Pyx_GOTREF(__pyx_t_4);
14274 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14275 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14276 __pyx_v_nodes = __pyx_t_4;
14277 __pyx_t_4 = 0;
14278
14279 /* "Isosurface.pyx":358
14280 * import h5py
14281 * nodes = self.nodes[(field, value)]
14282 * elements = self.elements[(field, value)] # <<<<<<<<<<<<<<
14283 * normals = self.normals[(field, value)]
14284 * normal_indices = self.normal_indices[(field, value)]
14285*/
14286 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_elements); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 358, __pyx_L1_error)
14287 __Pyx_GOTREF(__pyx_t_4);
14288 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L1_error)
14289 __Pyx_GOTREF(__pyx_t_3);
14290 __Pyx_INCREF(__pyx_v_field);
14291 __Pyx_GIVEREF(__pyx_v_field);
14292 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_field) != (0)) __PYX_ERR(0, 358, __pyx_L1_error);
14293 __Pyx_INCREF(__pyx_v_value);
14294 __Pyx_GIVEREF(__pyx_v_value);
14295 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_value) != (0)) __PYX_ERR(0, 358, __pyx_L1_error);
14296 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error)
14297 __Pyx_GOTREF(__pyx_t_1);
14298 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14299 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14300 __pyx_v_elements = __pyx_t_1;
14301 __pyx_t_1 = 0;
14302
14303 /* "Isosurface.pyx":359
14304 * nodes = self.nodes[(field, value)]
14305 * elements = self.elements[(field, value)]
14306 * normals = self.normals[(field, value)] # <<<<<<<<<<<<<<
14307 * normal_indices = self.normal_indices[(field, value)]
14308 * filename = os.path.join(Profiling.logDir, self.fileprefix+str(self.comm.rank())+'.h5')
14309*/
14310 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_normals); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error)
14311 __Pyx_GOTREF(__pyx_t_1);
14312 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 359, __pyx_L1_error)
14313 __Pyx_GOTREF(__pyx_t_3);
14314 __Pyx_INCREF(__pyx_v_field);
14315 __Pyx_GIVEREF(__pyx_v_field);
14316 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_field) != (0)) __PYX_ERR(0, 359, __pyx_L1_error);
14317 __Pyx_INCREF(__pyx_v_value);
14318 __Pyx_GIVEREF(__pyx_v_value);
14319 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_value) != (0)) __PYX_ERR(0, 359, __pyx_L1_error);
14320 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __pyx_L1_error)
14321 __Pyx_GOTREF(__pyx_t_4);
14322 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14323 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14324 __pyx_v_normals = __pyx_t_4;
14325 __pyx_t_4 = 0;
14326
14327 /* "Isosurface.pyx":360
14328 * elements = self.elements[(field, value)]
14329 * normals = self.normals[(field, value)]
14330 * normal_indices = self.normal_indices[(field, value)] # <<<<<<<<<<<<<<
14331 * filename = os.path.join(Profiling.logDir, self.fileprefix+str(self.comm.rank())+'.h5')
14332 * if self.nFrames == 0:
14333*/
14334 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_normal_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 360, __pyx_L1_error)
14335 __Pyx_GOTREF(__pyx_t_4);
14336 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 360, __pyx_L1_error)
14337 __Pyx_GOTREF(__pyx_t_3);
14338 __Pyx_INCREF(__pyx_v_field);
14339 __Pyx_GIVEREF(__pyx_v_field);
14340 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_field) != (0)) __PYX_ERR(0, 360, __pyx_L1_error);
14341 __Pyx_INCREF(__pyx_v_value);
14342 __Pyx_GIVEREF(__pyx_v_value);
14343 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_value) != (0)) __PYX_ERR(0, 360, __pyx_L1_error);
14344 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error)
14345 __Pyx_GOTREF(__pyx_t_1);
14346 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14347 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14348 __pyx_v_normal_indices = __pyx_t_1;
14349 __pyx_t_1 = 0;
14350
14351 /* "Isosurface.pyx":361
14352 * normals = self.normals[(field, value)]
14353 * normal_indices = self.normal_indices[(field, value)]
14354 * filename = os.path.join(Profiling.logDir, self.fileprefix+str(self.comm.rank())+'.h5') # <<<<<<<<<<<<<<
14355 * if self.nFrames == 0:
14356 * f = h5py.File(filename, "w")
14357*/
14358 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error)
14359 __Pyx_GOTREF(__pyx_t_4);
14360 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 361, __pyx_L1_error)
14361 __Pyx_GOTREF(__pyx_t_5);
14362 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14363 __pyx_t_3 = __pyx_t_5;
14364 __Pyx_INCREF(__pyx_t_3);
14365 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Profiling); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error)
14366 __Pyx_GOTREF(__pyx_t_4);
14367 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_logDir); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 361, __pyx_L1_error)
14368 __Pyx_GOTREF(__pyx_t_6);
14369 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14370 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_fileprefix); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error)
14371 __Pyx_GOTREF(__pyx_t_4);
14372 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_comm); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 361, __pyx_L1_error)
14373 __Pyx_GOTREF(__pyx_t_9);
14374 __pyx_t_8 = __pyx_t_9;
14375 __Pyx_INCREF(__pyx_t_8);
14376 __pyx_t_10 = 0;
14377 {
14378 PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
14379 __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_rank, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
14380 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
14381 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14382 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 361, __pyx_L1_error)
14383 __Pyx_GOTREF(__pyx_t_7);
14384 }
14385 __pyx_t_9 = __Pyx_PyObject_Unicode(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 361, __pyx_L1_error)
14386 __Pyx_GOTREF(__pyx_t_9);
14387 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14388 __pyx_t_7 = PyNumber_Add(__pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 361, __pyx_L1_error)
14389 __Pyx_GOTREF(__pyx_t_7);
14390 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14391 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14392 __pyx_t_9 = PyNumber_Add(__pyx_t_7, __pyx_mstate_global->__pyx_kp_u_h5_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 361, __pyx_L1_error)
14393 __Pyx_GOTREF(__pyx_t_9);
14394 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14395 __pyx_t_10 = 0;
14396 {
14397 PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_6, __pyx_t_9};
14398 __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_join, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
14399 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14400 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14401 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14402 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14403 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error)
14404 __Pyx_GOTREF(__pyx_t_1);
14405 }
14406 __pyx_v_filename = __pyx_t_1;
14407 __pyx_t_1 = 0;
14408
14409 /* "Isosurface.pyx":362
14410 * normal_indices = self.normal_indices[(field, value)]
14411 * filename = os.path.join(Profiling.logDir, self.fileprefix+str(self.comm.rank())+'.h5')
14412 * if self.nFrames == 0: # <<<<<<<<<<<<<<
14413 * f = h5py.File(filename, "w")
14414 * else:
14415*/
14416 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nFrames); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
14417 __Pyx_GOTREF(__pyx_t_1);
14418 __pyx_t_11 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 362, __pyx_L1_error)
14419 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14420 if (__pyx_t_11) {
14421
14422
14423 /* "Isosurface.pyx":363
14424 * filename = os.path.join(Profiling.logDir, self.fileprefix+str(self.comm.rank())+'.h5')
14425 * if self.nFrames == 0:
14426 * f = h5py.File(filename, "w") # <<<<<<<<<<<<<<
14427 * else:
14428 * f = h5py.File(filename, "a")
14429*/
14430 __pyx_t_5 = __pyx_v_h5py;
14431 __Pyx_INCREF(__pyx_t_5);
14432 __pyx_t_10 = 0;
14433 {
14434 PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_filename, __pyx_mstate_global->__pyx_n_u_w};
14435 __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_File, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
14436 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14437 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
14438 __Pyx_GOTREF(__pyx_t_1);
14439 }
14440 __pyx_v_f = __pyx_t_1;
14441 __pyx_t_1 = 0;
14442
14443 /* "Isosurface.pyx":362
14444 * normal_indices = self.normal_indices[(field, value)]
14445 * filename = os.path.join(Profiling.logDir, self.fileprefix+str(self.comm.rank())+'.h5')
14446 * if self.nFrames == 0: # <<<<<<<<<<<<<<
14447 * f = h5py.File(filename, "w")
14448 * else:
14449*/
14450 goto __pyx_L3;
14451 }
14452
14453 /* "Isosurface.pyx":365
14454 * f = h5py.File(filename, "w")
14455 * else:
14456 * f = h5py.File(filename, "a") # <<<<<<<<<<<<<<
14457 * dset = f.create_dataset('nodes'+str(self.nFrames), data=nodes)
14458 * dset = f.create_dataset('elems'+str(self.nFrames), data=elements)
14459*/
14460 /*else*/ {
14461 __pyx_t_5 = __pyx_v_h5py;
14462 __Pyx_INCREF(__pyx_t_5);
14463 __pyx_t_10 = 0;
14464 {
14465 PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_filename, __pyx_mstate_global->__pyx_n_u_a};
14466 __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_File, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
14467 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14468 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
14469 __Pyx_GOTREF(__pyx_t_1);
14470 }
14471 __pyx_v_f = __pyx_t_1;
14472 __pyx_t_1 = 0;
14473 }
14474 __pyx_L3:;
14475
14476 /* "Isosurface.pyx":366
14477 * else:
14478 * f = h5py.File(filename, "a")
14479 * dset = f.create_dataset('nodes'+str(self.nFrames), data=nodes) # <<<<<<<<<<<<<<
14480 * dset = f.create_dataset('elems'+str(self.nFrames), data=elements)
14481 * dset = f.create_dataset('normals'+str(self.nFrames), data=normals)
14482*/
14483 __pyx_t_5 = __pyx_v_f;
14484 __Pyx_INCREF(__pyx_t_5);
14485 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nFrames); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 366, __pyx_L1_error)
14486 __Pyx_GOTREF(__pyx_t_9);
14487 __pyx_t_6 = __Pyx_PyObject_Unicode(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 366, __pyx_L1_error)
14488 __Pyx_GOTREF(__pyx_t_6);
14489 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14490 __pyx_t_9 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_n_u_nodes, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 366, __pyx_L1_error)
14491 __Pyx_GOTREF(__pyx_t_9);
14492 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14493 __pyx_t_10 = 0;
14494 {
14495 PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_9, __pyx_v_nodes};
14496 #if CYTHON_VECTORCALL
14497 __pyx_t_6 = __pyx_mstate_global->__pyx_tuple[3];
14498 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 366, __pyx_L1_error)
14499 __Pyx_INCREF(__pyx_t_6);
14500 #else
14501 {
14502 PyObject *__pyx_temp[1] = {__pyx_mstate_global->__pyx_n_u_data};
14503 __pyx_t_6 = __Pyx_MakeKwargDict(__pyx_temp, __pyx_callargs+2, 1);
14504 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 366, __pyx_L1_error)
14505 __Pyx_GOTREF(__pyx_t_6);
14506 }
14507 #endif
14508 __pyx_t_1 = __Pyx_Object_VectorcallMethodKwds((PyObject*)__pyx_mstate_global->__pyx_n_u_create_dataset, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
14509 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14510 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14511 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14512 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error)
14513 __Pyx_GOTREF(__pyx_t_1);
14514 }
14515 __pyx_v_dset = __pyx_t_1;
14516 __pyx_t_1 = 0;
14517
14518 /* "Isosurface.pyx":367
14519 * f = h5py.File(filename, "a")
14520 * dset = f.create_dataset('nodes'+str(self.nFrames), data=nodes)
14521 * dset = f.create_dataset('elems'+str(self.nFrames), data=elements) # <<<<<<<<<<<<<<
14522 * dset = f.create_dataset('normals'+str(self.nFrames), data=normals)
14523 * dset = f.create_dataset('normal_indices'+str(self.nFrames), data=normal_indices)
14524*/
14525 __pyx_t_6 = __pyx_v_f;
14526 __Pyx_INCREF(__pyx_t_6);
14527 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nFrames); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 367, __pyx_L1_error)
14528 __Pyx_GOTREF(__pyx_t_9);
14529 __pyx_t_5 = __Pyx_PyObject_Unicode(__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 367, __pyx_L1_error)
14530 __Pyx_GOTREF(__pyx_t_5);
14531 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14532 __pyx_t_9 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_n_u_elems, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 367, __pyx_L1_error)
14533 __Pyx_GOTREF(__pyx_t_9);
14534 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14535 __pyx_t_10 = 0;
14536 {
14537 PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_9, __pyx_v_elements};
14538 #if CYTHON_VECTORCALL
14539 __pyx_t_5 = __pyx_mstate_global->__pyx_tuple[3];
14540 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 367, __pyx_L1_error)
14541 __Pyx_INCREF(__pyx_t_5);
14542 #else
14543 {
14544 PyObject *__pyx_temp[1] = {__pyx_mstate_global->__pyx_n_u_data};
14545 __pyx_t_5 = __Pyx_MakeKwargDict(__pyx_temp, __pyx_callargs+2, 1);
14546 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 367, __pyx_L1_error)
14547 __Pyx_GOTREF(__pyx_t_5);
14548 }
14549 #endif
14550 __pyx_t_1 = __Pyx_Object_VectorcallMethodKwds((PyObject*)__pyx_mstate_global->__pyx_n_u_create_dataset, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
14551 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
14552 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14553 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14554 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error)
14555 __Pyx_GOTREF(__pyx_t_1);
14556 }
14557 __Pyx_DECREF_SET(__pyx_v_dset, __pyx_t_1);
14558 __pyx_t_1 = 0;
14559
14560 /* "Isosurface.pyx":368
14561 * dset = f.create_dataset('nodes'+str(self.nFrames), data=nodes)
14562 * dset = f.create_dataset('elems'+str(self.nFrames), data=elements)
14563 * dset = f.create_dataset('normals'+str(self.nFrames), data=normals) # <<<<<<<<<<<<<<
14564 * dset = f.create_dataset('normal_indices'+str(self.nFrames), data=normal_indices)
14565 * f.close()
14566*/
14567 __pyx_t_5 = __pyx_v_f;
14568 __Pyx_INCREF(__pyx_t_5);
14569 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nFrames); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 368, __pyx_L1_error)
14570 __Pyx_GOTREF(__pyx_t_9);
14571 __pyx_t_6 = __Pyx_PyObject_Unicode(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 368, __pyx_L1_error)
14572 __Pyx_GOTREF(__pyx_t_6);
14573 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14574 __pyx_t_9 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_n_u_normals, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 368, __pyx_L1_error)
14575 __Pyx_GOTREF(__pyx_t_9);
14576 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14577 __pyx_t_10 = 0;
14578 {
14579 PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_9, __pyx_v_normals};
14580 #if CYTHON_VECTORCALL
14581 __pyx_t_6 = __pyx_mstate_global->__pyx_tuple[3];
14582 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 368, __pyx_L1_error)
14583 __Pyx_INCREF(__pyx_t_6);
14584 #else
14585 {
14586 PyObject *__pyx_temp[1] = {__pyx_mstate_global->__pyx_n_u_data};
14587 __pyx_t_6 = __Pyx_MakeKwargDict(__pyx_temp, __pyx_callargs+2, 1);
14588 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 368, __pyx_L1_error)
14589 __Pyx_GOTREF(__pyx_t_6);
14590 }
14591 #endif
14592 __pyx_t_1 = __Pyx_Object_VectorcallMethodKwds((PyObject*)__pyx_mstate_global->__pyx_n_u_create_dataset, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_6);
14593 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14594 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14595 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14596 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error)
14597 __Pyx_GOTREF(__pyx_t_1);
14598 }
14599 __Pyx_DECREF_SET(__pyx_v_dset, __pyx_t_1);
14600 __pyx_t_1 = 0;
14601
14602 /* "Isosurface.pyx":369
14603 * dset = f.create_dataset('elems'+str(self.nFrames), data=elements)
14604 * dset = f.create_dataset('normals'+str(self.nFrames), data=normals)
14605 * dset = f.create_dataset('normal_indices'+str(self.nFrames), data=normal_indices) # <<<<<<<<<<<<<<
14606 * f.close()
14607 *
14608*/
14609 __pyx_t_6 = __pyx_v_f;
14610 __Pyx_INCREF(__pyx_t_6);
14611 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nFrames); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 369, __pyx_L1_error)
14612 __Pyx_GOTREF(__pyx_t_9);
14613 __pyx_t_5 = __Pyx_PyObject_Unicode(__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 369, __pyx_L1_error)
14614 __Pyx_GOTREF(__pyx_t_5);
14615 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14616 __pyx_t_9 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_n_u_normal_indices, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 369, __pyx_L1_error)
14617 __Pyx_GOTREF(__pyx_t_9);
14618 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14619 __pyx_t_10 = 0;
14620 {
14621 PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_9, __pyx_v_normal_indices};
14622 #if CYTHON_VECTORCALL
14623 __pyx_t_5 = __pyx_mstate_global->__pyx_tuple[3];
14624 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 369, __pyx_L1_error)
14625 __Pyx_INCREF(__pyx_t_5);
14626 #else
14627 {
14628 PyObject *__pyx_temp[1] = {__pyx_mstate_global->__pyx_n_u_data};
14629 __pyx_t_5 = __Pyx_MakeKwargDict(__pyx_temp, __pyx_callargs+2, 1);
14630 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 369, __pyx_L1_error)
14631 __Pyx_GOTREF(__pyx_t_5);
14632 }
14633 #endif
14634 __pyx_t_1 = __Pyx_Object_VectorcallMethodKwds((PyObject*)__pyx_mstate_global->__pyx_n_u_create_dataset, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
14635 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
14636 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14637 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14638 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error)
14639 __Pyx_GOTREF(__pyx_t_1);
14640 }
14641 __Pyx_DECREF_SET(__pyx_v_dset, __pyx_t_1);
14642 __pyx_t_1 = 0;
14643
14644 /* "Isosurface.pyx":370
14645 * dset = f.create_dataset('normals'+str(self.nFrames), data=normals)
14646 * dset = f.create_dataset('normal_indices'+str(self.nFrames), data=normal_indices)
14647 * f.close() # <<<<<<<<<<<<<<
14648 *
14649 * def writeIsosurfaceMesh_povray(self, field, value, frame):
14650*/
14651 __pyx_t_5 = __pyx_v_f;
14652 __Pyx_INCREF(__pyx_t_5);
14653 __pyx_t_10 = 0;
14654 {
14655 PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
14656 __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_close, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
14657 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14658 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
14659 __Pyx_GOTREF(__pyx_t_1);
14660 }
14661 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14662
14663 /* "Isosurface.pyx":355
14664 * log("Isosurface file format not recognized")
14665 *
14666 * def writeIsosurfaceMesh_h5(self, field, value, frame): # <<<<<<<<<<<<<<
14667 * import h5py
14668 * nodes = self.nodes[(field, value)]
14669*/
14670
14671 /* function exit code */
14672 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14673 goto __pyx_L0;
14674 __pyx_L1_error:;
14675 __Pyx_XDECREF(__pyx_t_1);
14676 __Pyx_XDECREF(__pyx_t_3);
14677 __Pyx_XDECREF(__pyx_t_4);
14678 __Pyx_XDECREF(__pyx_t_5);
14679 __Pyx_XDECREF(__pyx_t_6);
14680 __Pyx_XDECREF(__pyx_t_7);
14681 __Pyx_XDECREF(__pyx_t_8);
14682 __Pyx_XDECREF(__pyx_t_9);
14683 __Pyx_AddTraceback("Isosurface.Isosurface.writeIsosurfaceMesh_h5", __pyx_clineno, __pyx_lineno, __pyx_filename);
14684 __pyx_r = NULL;
14685 __pyx_L0:;
14686 __Pyx_XDECREF(__pyx_v_h5py);
14687 __Pyx_XDECREF(__pyx_v_nodes);
14688 __Pyx_XDECREF(__pyx_v_elements);
14689 __Pyx_XDECREF(__pyx_v_normals);
14690 __Pyx_XDECREF(__pyx_v_normal_indices);
14691 __Pyx_XDECREF(__pyx_v_filename);
14692 __Pyx_XDECREF(__pyx_v_f);
14693 __Pyx_XDECREF(__pyx_v_dset);
14694 __Pyx_XGIVEREF(__pyx_r);
14695 __Pyx_RefNannyFinishContext();
14696 return __pyx_r;
14697}
14698
14699/* "Isosurface.pyx":372
14700 * f.close()
14701 *
14702 * def writeIsosurfaceMesh_povray(self, field, value, frame): # <<<<<<<<<<<<<<
14703 * """
14704 * Write the triangular mesh to a povray file
14705*/
14706
14707/* Python wrapper */
14708static PyObject *__pyx_pw_10Isosurface_10Isosurface_13writeIsosurfaceMesh_povray(PyObject *__pyx_self,
14709#if CYTHON_VECTORCALL
14710PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14711#else
14712PyObject *__pyx_args, PyObject *__pyx_kwds
14713#endif
14714); /*proto*/
14715PyDoc_STRVAR(__pyx_doc_10Isosurface_10Isosurface_12writeIsosurfaceMesh_povray, "Isosurface.writeIsosurfaceMesh_povray(self, field, value, frame)\n\nWrite the triangular mesh to a povray file");
14716static PyMethodDef __pyx_mdef_10Isosurface_10Isosurface_13writeIsosurfaceMesh_povray = {"writeIsosurfaceMesh_povray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10Isosurface_10Isosurface_13writeIsosurfaceMesh_povray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10Isosurface_10Isosurface_12writeIsosurfaceMesh_povray};
14717static PyObject *__pyx_pw_10Isosurface_10Isosurface_13writeIsosurfaceMesh_povray(PyObject *__pyx_self,
14718#if CYTHON_VECTORCALL
14719PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14720#else
14721PyObject *__pyx_args, PyObject *__pyx_kwds
14722#endif
14723) {
14724 PyObject *__pyx_v_self = 0;
14725 PyObject *__pyx_v_field = 0;
14726 PyObject *__pyx_v_value = 0;
14727 CYTHON_UNUSED PyObject *__pyx_v_frame = 0;
14728 #if !CYTHON_VECTORCALL
14729 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
14730 #endif
14731 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
14732 PyObject* values[4] = {0,0,0,0};
14733 int __pyx_lineno = 0;
14734 const char *__pyx_filename = NULL;
14735 int __pyx_clineno = 0;
14736 PyObject *__pyx_r = 0;
14737 __Pyx_RefNannyDeclarations
14738 __Pyx_RefNannySetupContext("writeIsosurfaceMesh_povray (wrapper)", 0);
14739 #if !CYTHON_VECTORCALL
14740 #if CYTHON_ASSUME_SAFE_SIZE
14741 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
14742 #else
14743 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
14744 #endif
14745 #endif
14746 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
14747 {
14748 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_field,&__pyx_mstate_global->__pyx_n_u_value,&__pyx_mstate_global->__pyx_n_u_frame,0};
14749 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
14750 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 372, __pyx_L3_error)
14751 if (__pyx_kwds_len > 0) {
14752 switch (__pyx_nargs) {
14753 case 4:
14754 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
14755 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 372, __pyx_L3_error)
14756 CYTHON_FALLTHROUGH;
14757 case 3:
14758 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
14759 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 372, __pyx_L3_error)
14760 CYTHON_FALLTHROUGH;
14761 case 2:
14762 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
14763 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 372, __pyx_L3_error)
14764 CYTHON_FALLTHROUGH;
14765 case 1:
14766 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
14767 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 372, __pyx_L3_error)
14768 CYTHON_FALLTHROUGH;
14769 case 0: break;
14770 default: goto __pyx_L5_argtuple_error;
14771 }
14772 const Py_ssize_t kwd_pos_args = __pyx_nargs;
14773 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "writeIsosurfaceMesh_povray", 0) < (0)) __PYX_ERR(0, 372, __pyx_L3_error)
14774 for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
14775 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("writeIsosurfaceMesh_povray", 1, 4, 4, i); __PYX_ERR(0, 372, __pyx_L3_error) }
14776 }
14777 } else if (unlikely(__pyx_nargs != 4)) {
14778 goto __pyx_L5_argtuple_error;
14779 } else {
14780 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
14781 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 372, __pyx_L3_error)
14782 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
14783 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 372, __pyx_L3_error)
14784 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
14785 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 372, __pyx_L3_error)
14786 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
14787 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 372, __pyx_L3_error)
14788 }
14789 __pyx_v_self = values[0];
14790 __pyx_v_field = values[1];
14791 __pyx_v_value = values[2];
14792 __pyx_v_frame = values[3];
14793 }
14794 goto __pyx_L6_skip;
14795 __pyx_L5_argtuple_error:;
14796 __Pyx_RaiseArgtupleInvalid("writeIsosurfaceMesh_povray", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 372, __pyx_L3_error)
14797 __pyx_L6_skip:;
14798 goto __pyx_L4_argument_unpacking_done;
14799 __pyx_L3_error:;
14800 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
14801 Py_XDECREF(values[__pyx_temp]);
14802 }
14803 __Pyx_AddTraceback("Isosurface.Isosurface.writeIsosurfaceMesh_povray", __pyx_clineno, __pyx_lineno, __pyx_filename);
14804 __Pyx_RefNannyFinishContext();
14805 return NULL;
14806 __pyx_L4_argument_unpacking_done:;
14807 __pyx_r = __pyx_pf_10Isosurface_10Isosurface_12writeIsosurfaceMesh_povray(__pyx_self, __pyx_v_self, __pyx_v_field, __pyx_v_value, __pyx_v_frame);
14808
14809 /* function exit code */
14810 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
14811 Py_XDECREF(values[__pyx_temp]);
14812 }
14813 __Pyx_RefNannyFinishContext();
14814 return __pyx_r;
14815}
14816
14817static 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) {
14818 PyObject *__pyx_v_Template = NULL;
14819 PyObject *__pyx_v_nodes = NULL;
14820 PyObject *__pyx_v_elements = NULL;
14821 PyObject *__pyx_v_normals = NULL;
14822 PyObject *__pyx_v_normal_indices = NULL;
14823 PyObject *__pyx_v_pov_filename = NULL;
14824 PyObject *__pyx_v_pov = NULL;
14825 PyObject *__pyx_v_dx = NULL;
14826 PyObject *__pyx_v_nll = NULL;
14827 PyObject *__pyx_v_fur = NULL;
14828 PyObject *__pyx_v_povScene = NULL;
14829 PyObject *__pyx_v_n = NULL;
14830 PyObject *__pyx_v_ebN = NULL;
14831 PyObject *__pyx_v_bnt = NULL;
14832 PyObject *__pyx_v_e = NULL;
14833 PyObject *__pyx_v_ni = NULL;
14834 PyObject *__pyx_8genexpr9__pyx_v_n = NULL;
14835 PyObject *__pyx_r = NULL;
14836 __Pyx_RefNannyDeclarations
14837 PyObject *__pyx_t_1 = NULL;
14838 PyObject *__pyx_t_2 = NULL;
14839 Py_ssize_t __pyx_t_3;
14840 PyObject *__pyx_t_4 = NULL;
14841 PyObject *__pyx_t_5 = NULL;
14842 size_t __pyx_t_6;
14843 PyObject *__pyx_t_7 = NULL;
14844 int __pyx_t_8;
14845 PyObject *__pyx_t_9 = NULL;
14846 int __pyx_t_10;
14847 PyObject *__pyx_t_11 = NULL;
14848 PyObject *__pyx_t_12 = NULL;
14849 PyObject *__pyx_t_13 = NULL;
14850 PyObject *__pyx_t_14 = NULL;
14851 PyObject *__pyx_t_15 = NULL;
14852 PyObject *__pyx_t_16 = NULL;
14853 PyObject *__pyx_t_17 = NULL;
14854 PyObject *__pyx_t_18 = NULL;
14855 PyObject *__pyx_t_19 = NULL;
14856 PyObject *__pyx_t_20 = NULL;
14857 PyObject *__pyx_t_21 = NULL;
14858 PyObject *__pyx_t_22 = NULL;
14859 PyObject *__pyx_t_23 = NULL;
14860 PyObject *(*__pyx_t_24)(PyObject *);
14861 Py_ssize_t __pyx_t_25;
14862 PyObject *(*__pyx_t_26)(PyObject *);
14863 int __pyx_lineno = 0;
14864 const char *__pyx_filename = NULL;
14865 int __pyx_clineno = 0;
14866 __Pyx_RefNannySetupContext("writeIsosurfaceMesh_povray", 0);
14867
14868 /* "Isosurface.pyx":376
14869 * Write the triangular mesh to a povray file
14870 * """
14871 * from string import Template # <<<<<<<<<<<<<<
14872 * nodes = self.nodes[(field, value)]
14873 * elements = self.elements[(field, value)]
14874*/
14875 {
14876 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Template};
14877 __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_string, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error)
14878 }
14879 __pyx_t_1 = __pyx_t_2;
14880 __Pyx_GOTREF(__pyx_t_1);
14881 {
14882 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Template};
14883 __pyx_t_3 = 0; {
14884 __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_1, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 376, __pyx_L1_error)
14885 __Pyx_GOTREF(__pyx_t_4);
14886 switch (__pyx_t_3) {
14887 case 0:
14888 __Pyx_INCREF(__pyx_t_4);
14889 __pyx_v_Template = __pyx_t_4;
14890 break;
14891 default:;
14892 }
14893 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14894 }
14895 }
14896 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14897
14898 /* "Isosurface.pyx":377
14899 * """
14900 * from string import Template
14901 * nodes = self.nodes[(field, value)] # <<<<<<<<<<<<<<
14902 * elements = self.elements[(field, value)]
14903 * normals = self.normals[(field, value)]
14904*/
14905 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error)
14906 __Pyx_GOTREF(__pyx_t_1);
14907 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 377, __pyx_L1_error)
14908 __Pyx_GOTREF(__pyx_t_4);
14909 __Pyx_INCREF(__pyx_v_field);
14910 __Pyx_GIVEREF(__pyx_v_field);
14911 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_field) != (0)) __PYX_ERR(0, 377, __pyx_L1_error);
14912 __Pyx_INCREF(__pyx_v_value);
14913 __Pyx_GIVEREF(__pyx_v_value);
14914 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_value) != (0)) __PYX_ERR(0, 377, __pyx_L1_error);
14915 __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 377, __pyx_L1_error)
14916 __Pyx_GOTREF(__pyx_t_5);
14917 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14918 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14919 __pyx_v_nodes = __pyx_t_5;
14920 __pyx_t_5 = 0;
14921
14922 /* "Isosurface.pyx":378
14923 * from string import Template
14924 * nodes = self.nodes[(field, value)]
14925 * elements = self.elements[(field, value)] # <<<<<<<<<<<<<<
14926 * normals = self.normals[(field, value)]
14927 * normal_indices = self.normal_indices[(field, value)]
14928*/
14929 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_elements); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 378, __pyx_L1_error)
14930 __Pyx_GOTREF(__pyx_t_5);
14931 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 378, __pyx_L1_error)
14932 __Pyx_GOTREF(__pyx_t_4);
14933 __Pyx_INCREF(__pyx_v_field);
14934 __Pyx_GIVEREF(__pyx_v_field);
14935 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_field) != (0)) __PYX_ERR(0, 378, __pyx_L1_error);
14936 __Pyx_INCREF(__pyx_v_value);
14937 __Pyx_GIVEREF(__pyx_v_value);
14938 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_value) != (0)) __PYX_ERR(0, 378, __pyx_L1_error);
14939 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error)
14940 __Pyx_GOTREF(__pyx_t_1);
14941 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14942 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14943 __pyx_v_elements = __pyx_t_1;
14944 __pyx_t_1 = 0;
14945
14946 /* "Isosurface.pyx":379
14947 * nodes = self.nodes[(field, value)]
14948 * elements = self.elements[(field, value)]
14949 * normals = self.normals[(field, value)] # <<<<<<<<<<<<<<
14950 * normal_indices = self.normal_indices[(field, value)]
14951 * pov_filename = "{field:s}_{value:f}_{frame:04d}.pov".format(
14952*/
14953 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_normals); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
14954 __Pyx_GOTREF(__pyx_t_1);
14955 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 379, __pyx_L1_error)
14956 __Pyx_GOTREF(__pyx_t_4);
14957 __Pyx_INCREF(__pyx_v_field);
14958 __Pyx_GIVEREF(__pyx_v_field);
14959 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_field) != (0)) __PYX_ERR(0, 379, __pyx_L1_error);
14960 __Pyx_INCREF(__pyx_v_value);
14961 __Pyx_GIVEREF(__pyx_v_value);
14962 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_value) != (0)) __PYX_ERR(0, 379, __pyx_L1_error);
14963 __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 379, __pyx_L1_error)
14964 __Pyx_GOTREF(__pyx_t_5);
14965 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14966 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14967 __pyx_v_normals = __pyx_t_5;
14968 __pyx_t_5 = 0;
14969
14970 /* "Isosurface.pyx":380
14971 * elements = self.elements[(field, value)]
14972 * normals = self.normals[(field, value)]
14973 * normal_indices = self.normal_indices[(field, value)] # <<<<<<<<<<<<<<
14974 * pov_filename = "{field:s}_{value:f}_{frame:04d}.pov".format(
14975 * field=field,
14976*/
14977 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_normal_indices); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 380, __pyx_L1_error)
14978 __Pyx_GOTREF(__pyx_t_5);
14979 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 380, __pyx_L1_error)
14980 __Pyx_GOTREF(__pyx_t_4);
14981 __Pyx_INCREF(__pyx_v_field);
14982 __Pyx_GIVEREF(__pyx_v_field);
14983 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_field) != (0)) __PYX_ERR(0, 380, __pyx_L1_error);
14984 __Pyx_INCREF(__pyx_v_value);
14985 __Pyx_GIVEREF(__pyx_v_value);
14986 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_value) != (0)) __PYX_ERR(0, 380, __pyx_L1_error);
14987 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
14988 __Pyx_GOTREF(__pyx_t_1);
14989 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14990 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14991 __pyx_v_normal_indices = __pyx_t_1;
14992 __pyx_t_1 = 0;
14993
14994 /* "Isosurface.pyx":381
14995 * normals = self.normals[(field, value)]
14996 * normal_indices = self.normal_indices[(field, value)]
14997 * pov_filename = "{field:s}_{value:f}_{frame:04d}.pov".format( # <<<<<<<<<<<<<<
14998 * field=field,
14999 * value=value,
15000*/
15001 __pyx_t_4 = __pyx_mstate_global->__pyx_kp_u_field_s___value_f___frame_04d_p;
15002 __Pyx_INCREF(__pyx_t_4);
15003
15004 /* "Isosurface.pyx":384
15005 * field=field,
15006 * value=value,
15007 * frame=self.nFrames) # <<<<<<<<<<<<<<
15008 * self.comm.beginSequential()
15009 * if self.comm.isMaster():
15010*/
15011 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nFrames); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 384, __pyx_L1_error)
15012 __Pyx_GOTREF(__pyx_t_5);
15013 __pyx_t_6 = 0;
15014 {
15015 PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_field, __pyx_v_value, __pyx_t_5};
15016 #if CYTHON_VECTORCALL
15017 __pyx_t_7 = __pyx_mstate_global->__pyx_tuple[4];
15018 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 381, __pyx_L1_error)
15019 __Pyx_INCREF(__pyx_t_7);
15020 #else
15021 {
15022 PyObject *__pyx_temp[3] = {__pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_value, __pyx_mstate_global->__pyx_n_u_frame};
15023 __pyx_t_7 = __Pyx_MakeKwargDict(__pyx_temp, __pyx_callargs+1, 3);
15024 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 381, __pyx_L1_error)
15025 __Pyx_GOTREF(__pyx_t_7);
15026 }
15027 #endif
15028 __pyx_t_1 = __Pyx_Object_VectorcallMethodKwds((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_7);
15029 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15030 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15031 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15032 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error)
15033 __Pyx_GOTREF(__pyx_t_1);
15034 }
15035
15036 /* "Isosurface.pyx":381
15037 * normals = self.normals[(field, value)]
15038 * normal_indices = self.normal_indices[(field, value)]
15039 * pov_filename = "{field:s}_{value:f}_{frame:04d}.pov".format( # <<<<<<<<<<<<<<
15040 * field=field,
15041 * value=value,
15042*/
15043 if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 381, __pyx_L1_error)
15044 __pyx_v_pov_filename = ((PyObject*)__pyx_t_1);
15045 __pyx_t_1 = 0;
15046
15047 /* "Isosurface.pyx":385
15048 * value=value,
15049 * frame=self.nFrames)
15050 * self.comm.beginSequential() # <<<<<<<<<<<<<<
15051 * if self.comm.isMaster():
15052 * pov = open(pov_filename, "w")
15053*/
15054 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_comm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 385, __pyx_L1_error)
15055 __Pyx_GOTREF(__pyx_t_5);
15056 __pyx_t_7 = __pyx_t_5;
15057 __Pyx_INCREF(__pyx_t_7);
15058 __pyx_t_6 = 0;
15059 {
15060 PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
15061 __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_beginSequential, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
15062 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15063 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15064 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error)
15065 __Pyx_GOTREF(__pyx_t_1);
15066 }
15067 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15068
15069 /* "Isosurface.pyx":386
15070 * frame=self.nFrames)
15071 * self.comm.beginSequential()
15072 * if self.comm.isMaster(): # <<<<<<<<<<<<<<
15073 * pov = open(pov_filename, "w")
15074 * dx = np.array(self.domain.L) * 0.02
15075*/
15076 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_comm); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 386, __pyx_L1_error)
15077 __Pyx_GOTREF(__pyx_t_7);
15078 __pyx_t_5 = __pyx_t_7;
15079 __Pyx_INCREF(__pyx_t_5);
15080 __pyx_t_6 = 0;
15081 {
15082 PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
15083 __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_isMaster, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
15084 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15085 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15086 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error)
15087 __Pyx_GOTREF(__pyx_t_1);
15088 }
15089 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 386, __pyx_L1_error)
15090 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15091 if (__pyx_t_8) {
15092
15093
15094 /* "Isosurface.pyx":387
15095 * self.comm.beginSequential()
15096 * if self.comm.isMaster():
15097 * pov = open(pov_filename, "w") # <<<<<<<<<<<<<<
15098 * dx = np.array(self.domain.L) * 0.02
15099 * nll = np.array(self.domain.x) - dx
15100*/
15101 __pyx_t_7 = NULL;
15102 __pyx_t_6 = 1;
15103 {
15104 PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_pov_filename, __pyx_mstate_global->__pyx_n_u_w};
15105 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
15106 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15107 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __pyx_L1_error)
15108 __Pyx_GOTREF(__pyx_t_1);
15109 }
15110 __pyx_v_pov = __pyx_t_1;
15111 __pyx_t_1 = 0;
15112
15113 /* "Isosurface.pyx":388
15114 * if self.comm.isMaster():
15115 * pov = open(pov_filename, "w")
15116 * dx = np.array(self.domain.L) * 0.02 # <<<<<<<<<<<<<<
15117 * nll = np.array(self.domain.x) - dx
15118 * fur = np.array(self.domain.L) + dx
15119*/
15120 __pyx_t_7 = NULL;
15121 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 388, __pyx_L1_error)
15122 __Pyx_GOTREF(__pyx_t_5);
15123 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 388, __pyx_L1_error)
15124 __Pyx_GOTREF(__pyx_t_4);
15125 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15126 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 388, __pyx_L1_error)
15127 __Pyx_GOTREF(__pyx_t_5);
15128 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_L); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 388, __pyx_L1_error)
15129 __Pyx_GOTREF(__pyx_t_9);
15130 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15131 __pyx_t_6 = 1;
15132 #if CYTHON_UNPACK_METHODS
15133 if (unlikely(PyMethod_Check(__pyx_t_4))) {
15134 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
15135 assert(__pyx_t_7);
15136 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
15137 __Pyx_INCREF(__pyx_t_7);
15138 __Pyx_INCREF(__pyx__function);
15139 __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
15140 __pyx_t_6 = 0;
15141 }
15142 #endif
15143 {
15144 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_9};
15145 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
15146 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15147 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15148 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15149 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error)
15150 __Pyx_GOTREF(__pyx_t_1);
15151 }
15152 __pyx_t_4 = __Pyx_PyNumber_Multiply_object_float(__pyx_t_1, __pyx_mstate_global->__pyx_float_0_02); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 388, __pyx_L1_error)
15153 __Pyx_GOTREF(__pyx_t_4);
15154 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15155 __pyx_v_dx = __pyx_t_4;
15156 __pyx_t_4 = 0;
15157
15158 /* "Isosurface.pyx":389
15159 * pov = open(pov_filename, "w")
15160 * dx = np.array(self.domain.L) * 0.02
15161 * nll = np.array(self.domain.x) - dx # <<<<<<<<<<<<<<
15162 * fur = np.array(self.domain.L) + dx
15163 * fur[2] = self.domain.L[2] - dx[2] # clip the top off
15164*/
15165 __pyx_t_1 = NULL;
15166 __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 389, __pyx_L1_error)
15167 __Pyx_GOTREF(__pyx_t_9);
15168 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 389, __pyx_L1_error)
15169 __Pyx_GOTREF(__pyx_t_7);
15170 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15171 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 389, __pyx_L1_error)
15172 __Pyx_GOTREF(__pyx_t_9);
15173 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 389, __pyx_L1_error)
15174 __Pyx_GOTREF(__pyx_t_5);
15175 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15176 __pyx_t_6 = 1;
15177 #if CYTHON_UNPACK_METHODS
15178 if (unlikely(PyMethod_Check(__pyx_t_7))) {
15179 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
15180 assert(__pyx_t_1);
15181 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
15182 __Pyx_INCREF(__pyx_t_1);
15183 __Pyx_INCREF(__pyx__function);
15184 __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
15185 __pyx_t_6 = 0;
15186 }
15187 #endif
15188 {
15189 PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5};
15190 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
15191 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
15192 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15193 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15194 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 389, __pyx_L1_error)
15195 __Pyx_GOTREF(__pyx_t_4);
15196 }
15197 __pyx_t_7 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_4, __pyx_v_dx); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 389, __pyx_L1_error)
15198 __Pyx_GOTREF(__pyx_t_7);
15199 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15200 __pyx_v_nll = __pyx_t_7;
15201 __pyx_t_7 = 0;
15202
15203 /* "Isosurface.pyx":390
15204 * dx = np.array(self.domain.L) * 0.02
15205 * nll = np.array(self.domain.x) - dx
15206 * fur = np.array(self.domain.L) + dx # <<<<<<<<<<<<<<
15207 * fur[2] = self.domain.L[2] - dx[2] # clip the top off
15208 * pov.write("""#version 3.7;
15209*/
15210 __pyx_t_4 = NULL;
15211 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 390, __pyx_L1_error)
15212 __Pyx_GOTREF(__pyx_t_5);
15213 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error)
15214 __Pyx_GOTREF(__pyx_t_1);
15215 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15216 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 390, __pyx_L1_error)
15217 __Pyx_GOTREF(__pyx_t_5);
15218 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_L); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 390, __pyx_L1_error)
15219 __Pyx_GOTREF(__pyx_t_9);
15220 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15221 __pyx_t_6 = 1;
15222 #if CYTHON_UNPACK_METHODS
15223 if (unlikely(PyMethod_Check(__pyx_t_1))) {
15224 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
15225 assert(__pyx_t_4);
15226 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
15227 __Pyx_INCREF(__pyx_t_4);
15228 __Pyx_INCREF(__pyx__function);
15229 __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
15230 __pyx_t_6 = 0;
15231 }
15232 #endif
15233 {
15234 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_9};
15235 __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_1, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
15236 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15237 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15238 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15239 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 390, __pyx_L1_error)
15240 __Pyx_GOTREF(__pyx_t_7);
15241 }
15242 __pyx_t_1 = __Pyx_PyNumber_Add_object_object(__pyx_t_7, __pyx_v_dx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error)
15243 __Pyx_GOTREF(__pyx_t_1);
15244 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15245 __pyx_v_fur = __pyx_t_1;
15246 __pyx_t_1 = 0;
15247
15248 /* "Isosurface.pyx":391
15249 * nll = np.array(self.domain.x) - dx
15250 * fur = np.array(self.domain.L) + dx
15251 * fur[2] = self.domain.L[2] - dx[2] # clip the top off # <<<<<<<<<<<<<<
15252 * pov.write("""#version 3.7;
15253 * #include "proteus.inc"
15254*/
15255 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error)
15256 __Pyx_GOTREF(__pyx_t_1);
15257 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_L); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 391, __pyx_L1_error)
15258 __Pyx_GOTREF(__pyx_t_7);
15259 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15260 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_7, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error)
15261 __Pyx_GOTREF(__pyx_t_1);
15262 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15263 __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_dx, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 391, __pyx_L1_error)
15264 __Pyx_GOTREF(__pyx_t_7);
15265 __pyx_t_9 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 391, __pyx_L1_error)
15266 __Pyx_GOTREF(__pyx_t_9);
15267 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15268 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15269 if (unlikely((__Pyx_SetItemInt(__pyx_v_fur, 2, __pyx_t_9, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 391, __pyx_L1_error)
15270 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15271
15272 /* "Isosurface.pyx":392
15273 * fur = np.array(self.domain.L) + dx
15274 * fur[2] = self.domain.L[2] - dx[2] # clip the top off
15275 * pov.write("""#version 3.7; # <<<<<<<<<<<<<<
15276 * #include "proteus.inc"
15277 * """)
15278*/
15279 __pyx_t_7 = __pyx_v_pov;
15280 __Pyx_INCREF(__pyx_t_7);
15281 __pyx_t_6 = 0;
15282 {
15283 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_u_version_3_7_include_proteus_inc};
15284 __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
15285 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15286 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 392, __pyx_L1_error)
15287 __Pyx_GOTREF(__pyx_t_9);
15288 }
15289 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15290
15291 /* "Isosurface.pyx":395
15292 * #include "proteus.inc"
15293 * """)
15294 * if not self.writeBoundary: # <<<<<<<<<<<<<<
15295 * pov.write(Template("""
15296 * object
15297*/
15298 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_writeBoundary); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 395, __pyx_L1_error)
15299 __Pyx_GOTREF(__pyx_t_9);
15300 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 395, __pyx_L1_error)
15301 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15302 __pyx_t_10 = (!__pyx_t_8);
15303
15304
15305 if (__pyx_t_10) {
15306
15307
15308 /* "Isosurface.pyx":396
15309 * """)
15310 * if not self.writeBoundary:
15311 * pov.write(Template(""" # <<<<<<<<<<<<<<
15312 * object
15313 * {
15314*/
15315 __pyx_t_7 = __pyx_v_pov;
15316 __Pyx_INCREF(__pyx_t_7);
15317
15318 /* "Isosurface.pyx":416
15319 * tank_material()
15320 * }//object
15321 * """).substitute(nll_x=nll[0], # <<<<<<<<<<<<<<
15322 * nll_y=nll[1],
15323 * nll_z=nll[2],
15324*/
15325 __pyx_t_11 = NULL;
15326
15327 /* "Isosurface.pyx":396
15328 * """)
15329 * if not self.writeBoundary:
15330 * pov.write(Template(""" # <<<<<<<<<<<<<<
15331 * object
15332 * {
15333*/
15334 __Pyx_INCREF(__pyx_v_Template);
15335 __pyx_t_12 = __pyx_v_Template;
15336 __pyx_t_6 = 1;
15337 #if CYTHON_UNPACK_METHODS
15338 if (unlikely(PyMethod_Check(__pyx_t_12))) {
15339 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
15340 assert(__pyx_t_11);
15341 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
15342 __Pyx_INCREF(__pyx_t_11);
15343 __Pyx_INCREF(__pyx__function);
15344 __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
15345 __pyx_t_6 = 0;
15346 }
15347 #endif
15348 {
15349 PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_object_difference_box_nll_x_nll};
15350 __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
15351 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
15352 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15353 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 396, __pyx_L1_error)
15354 __Pyx_GOTREF(__pyx_t_5);
15355 }
15356 __pyx_t_4 = __pyx_t_5;
15357 __Pyx_INCREF(__pyx_t_4);
15358
15359 /* "Isosurface.pyx":416
15360 * tank_material()
15361 * }//object
15362 * """).substitute(nll_x=nll[0], # <<<<<<<<<<<<<<
15363 * nll_y=nll[1],
15364 * nll_z=nll[2],
15365*/
15366 __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_nll, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 416, __pyx_L1_error)
15367 __Pyx_GOTREF(__pyx_t_12);
15368
15369 /* "Isosurface.pyx":417
15370 * }//object
15371 * """).substitute(nll_x=nll[0],
15372 * nll_y=nll[1], # <<<<<<<<<<<<<<
15373 * nll_z=nll[2],
15374 * fur_x=fur[0],
15375*/
15376 __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_nll, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 417, __pyx_L1_error)
15377 __Pyx_GOTREF(__pyx_t_11);
15378
15379 /* "Isosurface.pyx":418
15380 * """).substitute(nll_x=nll[0],
15381 * nll_y=nll[1],
15382 * nll_z=nll[2], # <<<<<<<<<<<<<<
15383 * fur_x=fur[0],
15384 * fur_y=fur[1],
15385*/
15386 __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_nll, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 418, __pyx_L1_error)
15387 __Pyx_GOTREF(__pyx_t_13);
15388
15389 /* "Isosurface.pyx":419
15390 * nll_y=nll[1],
15391 * nll_z=nll[2],
15392 * fur_x=fur[0], # <<<<<<<<<<<<<<
15393 * fur_y=fur[1],
15394 * fur_z=fur[2],
15395*/
15396 __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_fur, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 419, __pyx_L1_error)
15397 __Pyx_GOTREF(__pyx_t_14);
15398
15399 /* "Isosurface.pyx":420
15400 * nll_z=nll[2],
15401 * fur_x=fur[0],
15402 * fur_y=fur[1], # <<<<<<<<<<<<<<
15403 * fur_z=fur[2],
15404 * domain_nll_x=self.domain.x[0],
15405*/
15406 __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_fur, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 420, __pyx_L1_error)
15407 __Pyx_GOTREF(__pyx_t_15);
15408
15409 /* "Isosurface.pyx":421
15410 * fur_x=fur[0],
15411 * fur_y=fur[1],
15412 * fur_z=fur[2], # <<<<<<<<<<<<<<
15413 * domain_nll_x=self.domain.x[0],
15414 * domain_nll_y=self.domain.x[1],
15415*/
15416 __pyx_t_16 = __Pyx_GetItemInt(__pyx_v_fur, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 421, __pyx_L1_error)
15417 __Pyx_GOTREF(__pyx_t_16);
15418
15419 /* "Isosurface.pyx":422
15420 * fur_y=fur[1],
15421 * fur_z=fur[2],
15422 * domain_nll_x=self.domain.x[0], # <<<<<<<<<<<<<<
15423 * domain_nll_y=self.domain.x[1],
15424 * domain_nll_z=self.domain.x[2],
15425*/
15426 __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 422, __pyx_L1_error)
15427 __Pyx_GOTREF(__pyx_t_17);
15428 __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 422, __pyx_L1_error)
15429 __Pyx_GOTREF(__pyx_t_18);
15430 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
15431 __pyx_t_17 = __Pyx_GetItemInt(__pyx_t_18, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 422, __pyx_L1_error)
15432 __Pyx_GOTREF(__pyx_t_17);
15433 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15434
15435 /* "Isosurface.pyx":423
15436 * fur_z=fur[2],
15437 * domain_nll_x=self.domain.x[0],
15438 * domain_nll_y=self.domain.x[1], # <<<<<<<<<<<<<<
15439 * domain_nll_z=self.domain.x[2],
15440 * domain_fur_x=self.domain.L[0],
15441*/
15442 __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 423, __pyx_L1_error)
15443 __Pyx_GOTREF(__pyx_t_18);
15444 __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 423, __pyx_L1_error)
15445 __Pyx_GOTREF(__pyx_t_19);
15446 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15447 __pyx_t_18 = __Pyx_GetItemInt(__pyx_t_19, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 423, __pyx_L1_error)
15448 __Pyx_GOTREF(__pyx_t_18);
15449 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
15450
15451 /* "Isosurface.pyx":424
15452 * domain_nll_x=self.domain.x[0],
15453 * domain_nll_y=self.domain.x[1],
15454 * domain_nll_z=self.domain.x[2], # <<<<<<<<<<<<<<
15455 * domain_fur_x=self.domain.L[0],
15456 * domain_fur_y=self.domain.L[1],
15457*/
15458 __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 424, __pyx_L1_error)
15459 __Pyx_GOTREF(__pyx_t_19);
15460 __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 424, __pyx_L1_error)
15461 __Pyx_GOTREF(__pyx_t_20);
15462 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
15463 __pyx_t_19 = __Pyx_GetItemInt(__pyx_t_20, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 424, __pyx_L1_error)
15464 __Pyx_GOTREF(__pyx_t_19);
15465 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
15466
15467 /* "Isosurface.pyx":425
15468 * domain_nll_y=self.domain.x[1],
15469 * domain_nll_z=self.domain.x[2],
15470 * domain_fur_x=self.domain.L[0], # <<<<<<<<<<<<<<
15471 * domain_fur_y=self.domain.L[1],
15472 * domain_fur_z=self.domain.L[2]))
15473*/
15474 __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 425, __pyx_L1_error)
15475 __Pyx_GOTREF(__pyx_t_20);
15476 __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_mstate_global->__pyx_n_u_L); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 425, __pyx_L1_error)
15477 __Pyx_GOTREF(__pyx_t_21);
15478 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
15479 __pyx_t_20 = __Pyx_GetItemInt(__pyx_t_21, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 425, __pyx_L1_error)
15480 __Pyx_GOTREF(__pyx_t_20);
15481 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
15482
15483 /* "Isosurface.pyx":426
15484 * domain_nll_z=self.domain.x[2],
15485 * domain_fur_x=self.domain.L[0],
15486 * domain_fur_y=self.domain.L[1], # <<<<<<<<<<<<<<
15487 * domain_fur_z=self.domain.L[2]))
15488 * pov.flush()
15489*/
15490 __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 426, __pyx_L1_error)
15491 __Pyx_GOTREF(__pyx_t_21);
15492 __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_L); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 426, __pyx_L1_error)
15493 __Pyx_GOTREF(__pyx_t_22);
15494 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
15495 __pyx_t_21 = __Pyx_GetItemInt(__pyx_t_22, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 426, __pyx_L1_error)
15496 __Pyx_GOTREF(__pyx_t_21);
15497 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
15498
15499 /* "Isosurface.pyx":427
15500 * domain_fur_x=self.domain.L[0],
15501 * domain_fur_y=self.domain.L[1],
15502 * domain_fur_z=self.domain.L[2])) # <<<<<<<<<<<<<<
15503 * pov.flush()
15504 * if self.writeBoundary:
15505*/
15506 __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 427, __pyx_L1_error)
15507 __Pyx_GOTREF(__pyx_t_22);
15508 __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_t_22, __pyx_mstate_global->__pyx_n_u_L); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 427, __pyx_L1_error)
15509 __Pyx_GOTREF(__pyx_t_23);
15510 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
15511 __pyx_t_22 = __Pyx_GetItemInt(__pyx_t_23, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 427, __pyx_L1_error)
15512 __Pyx_GOTREF(__pyx_t_22);
15513 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
15514 __pyx_t_6 = 0;
15515 {
15516 PyObject *__pyx_callargs[13] = {__pyx_t_4, __pyx_t_12, __pyx_t_11, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_t_19, __pyx_t_20, __pyx_t_21, __pyx_t_22};
15517 #if CYTHON_VECTORCALL
15518 __pyx_t_23 = __pyx_mstate_global->__pyx_tuple[5];
15519 if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 416, __pyx_L1_error)
15520 __Pyx_INCREF(__pyx_t_23);
15521 #else
15522 {
15523 PyObject *__pyx_temp[12] = {__pyx_mstate_global->__pyx_n_u_nll_x, __pyx_mstate_global->__pyx_n_u_nll_y, __pyx_mstate_global->__pyx_n_u_nll_z, __pyx_mstate_global->__pyx_n_u_fur_x, __pyx_mstate_global->__pyx_n_u_fur_y, __pyx_mstate_global->__pyx_n_u_fur_z, __pyx_mstate_global->__pyx_n_u_domain_nll_x, __pyx_mstate_global->__pyx_n_u_domain_nll_y, __pyx_mstate_global->__pyx_n_u_domain_nll_z, __pyx_mstate_global->__pyx_n_u_domain_fur_x, __pyx_mstate_global->__pyx_n_u_domain_fur_y, __pyx_mstate_global->__pyx_n_u_domain_fur_z};
15524 __pyx_t_23 = __Pyx_MakeKwargDict(__pyx_temp, __pyx_callargs+1, 12);
15525 if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 416, __pyx_L1_error)
15526 __Pyx_GOTREF(__pyx_t_23);
15527 }
15528 #endif
15529 __pyx_t_1 = __Pyx_Object_VectorcallMethodKwds((PyObject*)__pyx_mstate_global->__pyx_n_u_substitute, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_23);
15530 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
15531 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
15532 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
15533 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
15534 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
15535 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
15536 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
15537 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
15538 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15539 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
15540 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
15541 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
15542 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
15543 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
15544 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15545 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error)
15546 __Pyx_GOTREF(__pyx_t_1);
15547 }
15548 __pyx_t_6 = 0;
15549 {
15550 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_1};
15551 __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
15552 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15553 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15554 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 396, __pyx_L1_error)
15555 __Pyx_GOTREF(__pyx_t_9);
15556 }
15557 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15558
15559 /* "Isosurface.pyx":428
15560 * domain_fur_y=self.domain.L[1],
15561 * domain_fur_z=self.domain.L[2]))
15562 * pov.flush() # <<<<<<<<<<<<<<
15563 * if self.writeBoundary:
15564 * pov.write(Template("""
15565*/
15566 __pyx_t_1 = __pyx_v_pov;
15567 __Pyx_INCREF(__pyx_t_1);
15568 __pyx_t_6 = 0;
15569 {
15570 PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
15571 __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_flush, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
15572 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
15573 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 428, __pyx_L1_error)
15574 __Pyx_GOTREF(__pyx_t_9);
15575 }
15576 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15577
15578 /* "Isosurface.pyx":395
15579 * #include "proteus.inc"
15580 * """)
15581 * if not self.writeBoundary: # <<<<<<<<<<<<<<
15582 * pov.write(Template("""
15583 * object
15584*/
15585 }
15586
15587 /* "Isosurface.pyx":429
15588 * domain_fur_z=self.domain.L[2]))
15589 * pov.flush()
15590 * if self.writeBoundary: # <<<<<<<<<<<<<<
15591 * pov.write(Template("""
15592 * object
15593*/
15594 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_writeBoundary); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 429, __pyx_L1_error)
15595 __Pyx_GOTREF(__pyx_t_9);
15596 __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 429, __pyx_L1_error)
15597 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15598 if (__pyx_t_10) {
15599
15600
15601 /* "Isosurface.pyx":430
15602 * pov.flush()
15603 * if self.writeBoundary:
15604 * pov.write(Template(""" # <<<<<<<<<<<<<<
15605 * object
15606 * {
15607*/
15608 __pyx_t_1 = __pyx_v_pov;
15609 __Pyx_INCREF(__pyx_t_1);
15610
15611 /* "Isosurface.pyx":441
15612 * union
15613 * {
15614 * """).substitute(nll_x=nll[0], # <<<<<<<<<<<<<<
15615 * nll_y=nll[1],
15616 * nll_z=nll[2],
15617*/
15618 __pyx_t_22 = NULL;
15619
15620 /* "Isosurface.pyx":430
15621 * pov.flush()
15622 * if self.writeBoundary:
15623 * pov.write(Template(""" # <<<<<<<<<<<<<<
15624 * object
15625 * {
15626*/
15627 __Pyx_INCREF(__pyx_v_Template);
15628 __pyx_t_21 = __pyx_v_Template;
15629 __pyx_t_6 = 1;
15630 #if CYTHON_UNPACK_METHODS
15631 if (unlikely(PyMethod_Check(__pyx_t_21))) {
15632 __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_21);
15633 assert(__pyx_t_22);
15634 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_21);
15635 __Pyx_INCREF(__pyx_t_22);
15636 __Pyx_INCREF(__pyx__function);
15637 __Pyx_DECREF_SET(__pyx_t_21, __pyx__function);
15638 __pyx_t_6 = 0;
15639 }
15640 #endif
15641 {
15642 PyObject *__pyx_callargs[2] = {__pyx_t_22, __pyx_mstate_global->__pyx_kp_u_object_difference_box_nll_x_nll_2};
15643 __pyx_t_23 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_21, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
15644 __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
15645 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
15646 if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 430, __pyx_L1_error)
15647 __Pyx_GOTREF(__pyx_t_23);
15648 }
15649 __pyx_t_5 = __pyx_t_23;
15650 __Pyx_INCREF(__pyx_t_5);
15651
15652 /* "Isosurface.pyx":441
15653 * union
15654 * {
15655 * """).substitute(nll_x=nll[0], # <<<<<<<<<<<<<<
15656 * nll_y=nll[1],
15657 * nll_z=nll[2],
15658*/
15659 __pyx_t_21 = __Pyx_GetItemInt(__pyx_v_nll, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 441, __pyx_L1_error)
15660 __Pyx_GOTREF(__pyx_t_21);
15661
15662 /* "Isosurface.pyx":442
15663 * {
15664 * """).substitute(nll_x=nll[0],
15665 * nll_y=nll[1], # <<<<<<<<<<<<<<
15666 * nll_z=nll[2],
15667 * fur_x=fur[0],
15668*/
15669 __pyx_t_22 = __Pyx_GetItemInt(__pyx_v_nll, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 442, __pyx_L1_error)
15670 __Pyx_GOTREF(__pyx_t_22);
15671
15672 /* "Isosurface.pyx":443
15673 * """).substitute(nll_x=nll[0],
15674 * nll_y=nll[1],
15675 * nll_z=nll[2], # <<<<<<<<<<<<<<
15676 * fur_x=fur[0],
15677 * fur_y=fur[1],
15678*/
15679 __pyx_t_20 = __Pyx_GetItemInt(__pyx_v_nll, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 443, __pyx_L1_error)
15680 __Pyx_GOTREF(__pyx_t_20);
15681
15682 /* "Isosurface.pyx":444
15683 * nll_y=nll[1],
15684 * nll_z=nll[2],
15685 * fur_x=fur[0], # <<<<<<<<<<<<<<
15686 * fur_y=fur[1],
15687 * fur_z=fur[2]))
15688*/
15689 __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_fur, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 444, __pyx_L1_error)
15690 __Pyx_GOTREF(__pyx_t_19);
15691
15692 /* "Isosurface.pyx":445
15693 * nll_z=nll[2],
15694 * fur_x=fur[0],
15695 * fur_y=fur[1], # <<<<<<<<<<<<<<
15696 * fur_z=fur[2]))
15697 * pov.flush()
15698*/
15699 __pyx_t_18 = __Pyx_GetItemInt(__pyx_v_fur, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 445, __pyx_L1_error)
15700 __Pyx_GOTREF(__pyx_t_18);
15701
15702 /* "Isosurface.pyx":446
15703 * fur_x=fur[0],
15704 * fur_y=fur[1],
15705 * fur_z=fur[2])) # <<<<<<<<<<<<<<
15706 * pov.flush()
15707 * else:
15708*/
15709 __pyx_t_17 = __Pyx_GetItemInt(__pyx_v_fur, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 446, __pyx_L1_error)
15710 __Pyx_GOTREF(__pyx_t_17);
15711 __pyx_t_6 = 0;
15712 {
15713 PyObject *__pyx_callargs[7] = {__pyx_t_5, __pyx_t_21, __pyx_t_22, __pyx_t_20, __pyx_t_19, __pyx_t_18, __pyx_t_17};
15714 #if CYTHON_VECTORCALL
15715 __pyx_t_16 = __pyx_mstate_global->__pyx_tuple[6];
15716 if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 441, __pyx_L1_error)
15717 __Pyx_INCREF(__pyx_t_16);
15718 #else
15719 {
15720 PyObject *__pyx_temp[6] = {__pyx_mstate_global->__pyx_n_u_nll_x, __pyx_mstate_global->__pyx_n_u_nll_y, __pyx_mstate_global->__pyx_n_u_nll_z, __pyx_mstate_global->__pyx_n_u_fur_x, __pyx_mstate_global->__pyx_n_u_fur_y, __pyx_mstate_global->__pyx_n_u_fur_z};
15721 __pyx_t_16 = __Pyx_MakeKwargDict(__pyx_temp, __pyx_callargs+1, 6);
15722 if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 441, __pyx_L1_error)
15723 __Pyx_GOTREF(__pyx_t_16);
15724 }
15725 #endif
15726 __pyx_t_7 = __Pyx_Object_VectorcallMethodKwds((PyObject*)__pyx_mstate_global->__pyx_n_u_substitute, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_16);
15727 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15728 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
15729 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
15730 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
15731 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
15732 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
15733 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
15734 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
15735 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
15736 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 441, __pyx_L1_error)
15737 __Pyx_GOTREF(__pyx_t_7);
15738 }
15739 __pyx_t_6 = 0;
15740 {
15741 PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_7};
15742 __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
15743 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
15744 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15745 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 430, __pyx_L1_error)
15746 __Pyx_GOTREF(__pyx_t_9);
15747 }
15748 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15749
15750 /* "Isosurface.pyx":429
15751 * domain_fur_z=self.domain.L[2]))
15752 * pov.flush()
15753 * if self.writeBoundary: # <<<<<<<<<<<<<<
15754 * pov.write(Template("""
15755 * object
15756*/
15757 }
15758
15759 /* "Isosurface.pyx":447
15760 * fur_y=fur[1],
15761 * fur_z=fur[2]))
15762 * pov.flush() # <<<<<<<<<<<<<<
15763 * else:
15764 * pov = open(pov_filename, "a")
15765*/
15766 __pyx_t_7 = __pyx_v_pov;
15767 __Pyx_INCREF(__pyx_t_7);
15768 __pyx_t_6 = 0;
15769 {
15770 PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
15771 __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_flush, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
15772 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15773 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 447, __pyx_L1_error)
15774 __Pyx_GOTREF(__pyx_t_9);
15775 }
15776 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15777
15778 /* "Isosurface.pyx":386
15779 * frame=self.nFrames)
15780 * self.comm.beginSequential()
15781 * if self.comm.isMaster(): # <<<<<<<<<<<<<<
15782 * pov = open(pov_filename, "w")
15783 * dx = np.array(self.domain.L) * 0.02
15784*/
15785 goto __pyx_L3;
15786 }
15787
15788 /* "Isosurface.pyx":449
15789 * pov.flush()
15790 * else:
15791 * pov = open(pov_filename, "a") # <<<<<<<<<<<<<<
15792 * if self.writeBoundary:
15793 * povScene = """mesh2 {
15794*/
15795 /*else*/ {
15796 __pyx_t_7 = NULL;
15797 __pyx_t_6 = 1;
15798 {
15799 PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_pov_filename, __pyx_mstate_global->__pyx_n_u_a};
15800 __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
15801 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15802 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 449, __pyx_L1_error)
15803 __Pyx_GOTREF(__pyx_t_9);
15804 }
15805 __pyx_v_pov = __pyx_t_9;
15806 __pyx_t_9 = 0;
15807 }
15808 __pyx_L3:;
15809
15810 /* "Isosurface.pyx":450
15811 * else:
15812 * pov = open(pov_filename, "a")
15813 * if self.writeBoundary: # <<<<<<<<<<<<<<
15814 * povScene = """mesh2 {
15815 * vertex_vectors {"""
15816*/
15817 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_writeBoundary); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 450, __pyx_L1_error)
15818 __Pyx_GOTREF(__pyx_t_9);
15819 __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 450, __pyx_L1_error)
15820 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15821 if (__pyx_t_10) {
15822
15823
15824 /* "Isosurface.pyx":451
15825 * pov = open(pov_filename, "a")
15826 * if self.writeBoundary:
15827 * povScene = """mesh2 { # <<<<<<<<<<<<<<
15828 * vertex_vectors {"""
15829 * pov.write(povScene)
15830*/
15831 __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_mesh2_vertex_vectors);
15832 __pyx_v_povScene = __pyx_mstate_global->__pyx_kp_u_mesh2_vertex_vectors;
15833
15834 /* "Isosurface.pyx":453
15835 * povScene = """mesh2 {
15836 * vertex_vectors {"""
15837 * pov.write(povScene) # <<<<<<<<<<<<<<
15838 * pov.write("{0:d},\n".format(len(self.boundaryNodes)))
15839 * for n in self.boundaryNodes:
15840*/
15841 __pyx_t_7 = __pyx_v_pov;
15842 __Pyx_INCREF(__pyx_t_7);
15843 __pyx_t_6 = 0;
15844 {
15845 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_povScene};
15846 __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
15847 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15848 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 453, __pyx_L1_error)
15849 __Pyx_GOTREF(__pyx_t_9);
15850 }
15851 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15852
15853 /* "Isosurface.pyx":454
15854 * vertex_vectors {"""
15855 * pov.write(povScene)
15856 * pov.write("{0:d},\n".format(len(self.boundaryNodes))) # <<<<<<<<<<<<<<
15857 * for n in self.boundaryNodes:
15858 * pov.write("<{0:f}, {1:f}, {2:f}>,\n".format(
15859*/
15860 __pyx_t_7 = __pyx_v_pov;
15861 __Pyx_INCREF(__pyx_t_7);
15862 __pyx_t_23 = __pyx_mstate_global->__pyx_kp_u_0_d;
15863 __Pyx_INCREF(__pyx_t_23);
15864 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_boundaryNodes); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 454, __pyx_L1_error)
15865 __Pyx_GOTREF(__pyx_t_16);
15866 __pyx_t_3 = PyObject_Length(__pyx_t_16); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 454, __pyx_L1_error)
15867 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
15868 __pyx_t_16 = PyLong_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 454, __pyx_L1_error)
15869 __Pyx_GOTREF(__pyx_t_16);
15870
15871 __pyx_t_6 = 0;
15872 {
15873 PyObject *__pyx_callargs[2] = {__pyx_t_23, __pyx_t_16};
15874 __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
15875 __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
15876 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
15877 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error)
15878 __Pyx_GOTREF(__pyx_t_1);
15879 }
15880 if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 454, __pyx_L1_error)
15881 __pyx_t_6 = 0;
15882 {
15883 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_1};
15884 __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
15885 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15886 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15887 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 454, __pyx_L1_error)
15888 __Pyx_GOTREF(__pyx_t_9);
15889 }
15890 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15891
15892 /* "Isosurface.pyx":455
15893 * pov.write(povScene)
15894 * pov.write("{0:d},\n".format(len(self.boundaryNodes)))
15895 * for n in self.boundaryNodes: # <<<<<<<<<<<<<<
15896 * pov.write("<{0:f}, {1:f}, {2:f}>,\n".format(
15897 * *self.nodeArray[n]))
15898*/
15899 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_boundaryNodes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 455, __pyx_L1_error)
15900 __Pyx_GOTREF(__pyx_t_9);
15901 if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
15902 __pyx_t_1 = __pyx_t_9; __Pyx_INCREF(__pyx_t_1);
15903 __pyx_t_3 = 0;
15904 __pyx_t_24 = NULL;
15905 } else {
15906 __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error)
15907 __Pyx_GOTREF(__pyx_t_1);
15908 __pyx_t_24 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 455, __pyx_L1_error)
15909 }
15910 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15911 for (;;) {
15912 if (likely(!__pyx_t_24)) {
15913 if (likely(PyList_CheckExact(__pyx_t_1))) {
15914 {
15915 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
15916 #if !CYTHON_ASSUME_SAFE_SIZE
15917 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 455, __pyx_L1_error)
15918 #endif
15919 if (__pyx_t_3 >= __pyx_temp) break;
15920 }
15921 __pyx_t_9 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
15922 ++__pyx_t_3;
15923 } else {
15924 {
15925 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
15926 #if !CYTHON_ASSUME_SAFE_SIZE
15927 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 455, __pyx_L1_error)
15928 #endif
15929 if (__pyx_t_3 >= __pyx_temp) break;
15930 }
15931 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15932 __pyx_t_9 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3));
15933 #else
15934 __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3);
15935 #endif
15936 ++__pyx_t_3;
15937 }
15938 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 455, __pyx_L1_error)
15939 } else {
15940 __pyx_t_9 = __pyx_t_24(__pyx_t_1);
15941 if (unlikely(!__pyx_t_9)) {
15942 PyObject* exc_type = PyErr_Occurred();
15943 if (exc_type) {
15944 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 455, __pyx_L1_error)
15945 PyErr_Clear();
15946 }
15947 break;
15948 }
15949 }
15950 __Pyx_GOTREF(__pyx_t_9);
15951 __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_9);
15952 __pyx_t_9 = 0;
15953
15954 /* "Isosurface.pyx":456
15955 * pov.write("{0:d},\n".format(len(self.boundaryNodes)))
15956 * for n in self.boundaryNodes:
15957 * pov.write("<{0:f}, {1:f}, {2:f}>,\n".format( # <<<<<<<<<<<<<<
15958 * *self.nodeArray[n]))
15959 * pov.write("}\n")
15960*/
15961 __pyx_t_7 = __pyx_v_pov;
15962 __Pyx_INCREF(__pyx_t_7);
15963 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_mstate_global->__pyx_kp_u_0_f_1_f_2_f, __pyx_mstate_global->__pyx_n_u_format); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 456, __pyx_L1_error)
15964 __Pyx_GOTREF(__pyx_t_16);
15965
15966 /* "Isosurface.pyx":457
15967 * for n in self.boundaryNodes:
15968 * pov.write("<{0:f}, {1:f}, {2:f}>,\n".format(
15969 * *self.nodeArray[n])) # <<<<<<<<<<<<<<
15970 * pov.write("}\n")
15971 * pov.write("""face_indices {
15972*/
15973 __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nodeArray); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 457, __pyx_L1_error)
15974 __Pyx_GOTREF(__pyx_t_23);
15975 __pyx_t_17 = __Pyx_PyObject_GetItem(__pyx_t_23, __pyx_v_n); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 457, __pyx_L1_error)
15976 __Pyx_GOTREF(__pyx_t_17);
15977 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
15978
15979 /* "Isosurface.pyx":456
15980 * pov.write("{0:d},\n".format(len(self.boundaryNodes)))
15981 * for n in self.boundaryNodes:
15982 * pov.write("<{0:f}, {1:f}, {2:f}>,\n".format( # <<<<<<<<<<<<<<
15983 * *self.nodeArray[n]))
15984 * pov.write("}\n")
15985*/
15986 __pyx_t_23 = __Pyx_PySequence_Tuple(__pyx_t_17); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 456, __pyx_L1_error)
15987 __Pyx_GOTREF(__pyx_t_23);
15988 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
15989 __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_23, NULL); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 456, __pyx_L1_error)
15990 __Pyx_GOTREF(__pyx_t_17);
15991 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
15992 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
15993 if (!(likely(PyUnicode_CheckExact(__pyx_t_17)) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_17))) __PYX_ERR(0, 456, __pyx_L1_error)
15994 __pyx_t_6 = 0;
15995 {
15996 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_17};
15997 __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
15998 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
15999 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
16000 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 456, __pyx_L1_error)
16001 __Pyx_GOTREF(__pyx_t_9);
16002 }
16003 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16004
16005 /* "Isosurface.pyx":455
16006 * pov.write(povScene)
16007 * pov.write("{0:d},\n".format(len(self.boundaryNodes)))
16008 * for n in self.boundaryNodes: # <<<<<<<<<<<<<<
16009 * pov.write("<{0:f}, {1:f}, {2:f}>,\n".format(
16010 * *self.nodeArray[n]))
16011*/
16012 }
16013 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16014
16015 /* "Isosurface.pyx":458
16016 * pov.write("<{0:f}, {1:f}, {2:f}>,\n".format(
16017 * *self.nodeArray[n]))
16018 * pov.write("}\n") # <<<<<<<<<<<<<<
16019 * pov.write("""face_indices {
16020 * """)
16021*/
16022 __pyx_t_9 = __pyx_v_pov;
16023 __Pyx_INCREF(__pyx_t_9);
16024 __pyx_t_6 = 0;
16025 {
16026 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u__4};
16027 __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16028 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16029 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error)
16030 __Pyx_GOTREF(__pyx_t_1);
16031 }
16032 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16033
16034 /* "Isosurface.pyx":459
16035 * *self.nodeArray[n]))
16036 * pov.write("}\n")
16037 * pov.write("""face_indices { # <<<<<<<<<<<<<<
16038 * """)
16039 * pov.write("{0:d},\n".format(
16040*/
16041 __pyx_t_9 = __pyx_v_pov;
16042 __Pyx_INCREF(__pyx_t_9);
16043 __pyx_t_6 = 0;
16044 {
16045 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_face_indices};
16046 __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16047 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16048 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error)
16049 __Pyx_GOTREF(__pyx_t_1);
16050 }
16051 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16052
16053 /* "Isosurface.pyx":461
16054 * pov.write("""face_indices {
16055 * """)
16056 * pov.write("{0:d},\n".format( # <<<<<<<<<<<<<<
16057 * np.count_nonzero(self.elementBoundaryMaterialTypes)))
16058 * for ebN in self.exteriorElementBoundariesArray:
16059*/
16060 __pyx_t_9 = __pyx_v_pov;
16061 __Pyx_INCREF(__pyx_t_9);
16062 __pyx_t_7 = __pyx_mstate_global->__pyx_kp_u_0_d;
16063 __Pyx_INCREF(__pyx_t_7);
16064
16065 /* "Isosurface.pyx":462
16066 * """)
16067 * pov.write("{0:d},\n".format(
16068 * np.count_nonzero(self.elementBoundaryMaterialTypes))) # <<<<<<<<<<<<<<
16069 * for ebN in self.exteriorElementBoundariesArray:
16070 * if self.elementBoundaryMaterialTypes[ebN] > 0:
16071*/
16072 __pyx_t_16 = NULL;
16073 __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 462, __pyx_L1_error)
16074 __Pyx_GOTREF(__pyx_t_18);
16075 __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_count_nonzero); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 462, __pyx_L1_error)
16076 __Pyx_GOTREF(__pyx_t_19);
16077 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
16078 __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_elementBoundaryMaterialTypes); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 462, __pyx_L1_error)
16079 __Pyx_GOTREF(__pyx_t_18);
16080 __pyx_t_6 = 1;
16081 #if CYTHON_UNPACK_METHODS
16082 if (unlikely(PyMethod_Check(__pyx_t_19))) {
16083 __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_19);
16084 assert(__pyx_t_16);
16085 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_19);
16086 __Pyx_INCREF(__pyx_t_16);
16087 __Pyx_INCREF(__pyx__function);
16088 __Pyx_DECREF_SET(__pyx_t_19, __pyx__function);
16089 __pyx_t_6 = 0;
16090 }
16091 #endif
16092 {
16093 PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_t_18};
16094 __pyx_t_23 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_19, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16095 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
16096 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
16097 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
16098 if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 462, __pyx_L1_error)
16099 __Pyx_GOTREF(__pyx_t_23);
16100 }
16101 __pyx_t_6 = 0;
16102 {
16103 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_23};
16104 __pyx_t_17 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16105 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16106 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
16107 if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 461, __pyx_L1_error)
16108 __Pyx_GOTREF(__pyx_t_17);
16109 }
16110
16111 /* "Isosurface.pyx":461
16112 * pov.write("""face_indices {
16113 * """)
16114 * pov.write("{0:d},\n".format( # <<<<<<<<<<<<<<
16115 * np.count_nonzero(self.elementBoundaryMaterialTypes)))
16116 * for ebN in self.exteriorElementBoundariesArray:
16117*/
16118 if (!(likely(PyUnicode_CheckExact(__pyx_t_17))||((__pyx_t_17) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_17))) __PYX_ERR(0, 461, __pyx_L1_error)
16119 __pyx_t_6 = 0;
16120 {
16121 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_17};
16122 __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16123 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16124 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
16125 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error)
16126 __Pyx_GOTREF(__pyx_t_1);
16127 }
16128 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16129
16130 /* "Isosurface.pyx":463
16131 * pov.write("{0:d},\n".format(
16132 * np.count_nonzero(self.elementBoundaryMaterialTypes)))
16133 * for ebN in self.exteriorElementBoundariesArray: # <<<<<<<<<<<<<<
16134 * if self.elementBoundaryMaterialTypes[ebN] > 0:
16135 * bnt = tuple(
16136*/
16137 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_exteriorElementBoundariesArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
16138 __Pyx_GOTREF(__pyx_t_1);
16139 if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
16140 __pyx_t_17 = __pyx_t_1; __Pyx_INCREF(__pyx_t_17);
16141 __pyx_t_3 = 0;
16142 __pyx_t_24 = NULL;
16143 } else {
16144 __pyx_t_3 = -1; __pyx_t_17 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 463, __pyx_L1_error)
16145 __Pyx_GOTREF(__pyx_t_17);
16146 __pyx_t_24 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_17); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 463, __pyx_L1_error)
16147 }
16148 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16149 for (;;) {
16150 if (likely(!__pyx_t_24)) {
16151 if (likely(PyList_CheckExact(__pyx_t_17))) {
16152 {
16153 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_17);
16154 #if !CYTHON_ASSUME_SAFE_SIZE
16155 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 463, __pyx_L1_error)
16156 #endif
16157 if (__pyx_t_3 >= __pyx_temp) break;
16158 }
16159 __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_17, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
16160 ++__pyx_t_3;
16161 } else {
16162 {
16163 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_17);
16164 #if !CYTHON_ASSUME_SAFE_SIZE
16165 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 463, __pyx_L1_error)
16166 #endif
16167 if (__pyx_t_3 >= __pyx_temp) break;
16168 }
16169 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16170 __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_17, __pyx_t_3));
16171 #else
16172 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_17, __pyx_t_3);
16173 #endif
16174 ++__pyx_t_3;
16175 }
16176 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
16177 } else {
16178 __pyx_t_1 = __pyx_t_24(__pyx_t_17);
16179 if (unlikely(!__pyx_t_1)) {
16180 PyObject* exc_type = PyErr_Occurred();
16181 if (exc_type) {
16182 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 463, __pyx_L1_error)
16183 PyErr_Clear();
16184 }
16185 break;
16186 }
16187 }
16188 __Pyx_GOTREF(__pyx_t_1);
16189 __Pyx_XDECREF_SET(__pyx_v_ebN, __pyx_t_1);
16190 __pyx_t_1 = 0;
16191
16192 /* "Isosurface.pyx":464
16193 * np.count_nonzero(self.elementBoundaryMaterialTypes)))
16194 * for ebN in self.exteriorElementBoundariesArray:
16195 * if self.elementBoundaryMaterialTypes[ebN] > 0: # <<<<<<<<<<<<<<
16196 * bnt = tuple(
16197 * [self.g2b[n] for n
16198*/
16199 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_elementBoundaryMaterialTypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
16200 __Pyx_GOTREF(__pyx_t_1);
16201 __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_ebN); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 464, __pyx_L1_error)
16202 __Pyx_GOTREF(__pyx_t_9);
16203 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16204 __pyx_t_10 = __Pyx_PyObject_CompareBoolGt_object_int(__pyx_t_9, __pyx_mstate_global->__pyx_int_0, Py_GT); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 464, __pyx_L1_error)
16205 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16206 if (__pyx_t_10) {
16207
16208
16209 /* "Isosurface.pyx":465
16210 * for ebN in self.exteriorElementBoundariesArray:
16211 * if self.elementBoundaryMaterialTypes[ebN] > 0:
16212 * bnt = tuple( # <<<<<<<<<<<<<<
16213 * [self.g2b[n] for n
16214 * in self.elementBoundaryNodesArray[ebN]])
16215*/
16216 { /* enter inner scope */
16217
16218 /* "Isosurface.pyx":466
16219 * if self.elementBoundaryMaterialTypes[ebN] > 0:
16220 * bnt = tuple(
16221 * [self.g2b[n] for n # <<<<<<<<<<<<<<
16222 * in self.elementBoundaryNodesArray[ebN]])
16223 * pov.write("<{0:d},{1:d},{2:d}>,\n".format(*bnt))
16224*/
16225 __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 466, __pyx_L15_error)
16226 __Pyx_GOTREF(__pyx_t_9);
16227
16228 /* "Isosurface.pyx":467
16229 * bnt = tuple(
16230 * [self.g2b[n] for n
16231 * in self.elementBoundaryNodesArray[ebN]]) # <<<<<<<<<<<<<<
16232 * pov.write("<{0:d},{1:d},{2:d}>,\n".format(*bnt))
16233 * pov.write("}\n")
16234*/
16235 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_elementBoundaryNodesArray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L15_error)
16236 __Pyx_GOTREF(__pyx_t_1);
16237 __pyx_t_23 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_ebN); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 467, __pyx_L15_error)
16238 __Pyx_GOTREF(__pyx_t_23);
16239 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16240 if (likely(PyList_CheckExact(__pyx_t_23)) || PyTuple_CheckExact(__pyx_t_23)) {
16241 __pyx_t_1 = __pyx_t_23; __Pyx_INCREF(__pyx_t_1);
16242 __pyx_t_25 = 0;
16243 __pyx_t_26 = NULL;
16244 } else {
16245 __pyx_t_25 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_23); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L15_error)
16246 __Pyx_GOTREF(__pyx_t_1);
16247 __pyx_t_26 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 467, __pyx_L15_error)
16248 }
16249 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
16250 for (;;) {
16251 if (likely(!__pyx_t_26)) {
16252 if (likely(PyList_CheckExact(__pyx_t_1))) {
16253 {
16254 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
16255 #if !CYTHON_ASSUME_SAFE_SIZE
16256 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 467, __pyx_L15_error)
16257 #endif
16258 if (__pyx_t_25 >= __pyx_temp) break;
16259 }
16260 __pyx_t_23 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_1, __pyx_t_25, __Pyx_ReferenceSharing_OwnStrongReference);
16261 ++__pyx_t_25;
16262 } else {
16263 {
16264 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
16265 #if !CYTHON_ASSUME_SAFE_SIZE
16266 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 467, __pyx_L15_error)
16267 #endif
16268 if (__pyx_t_25 >= __pyx_temp) break;
16269 }
16270 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16271 __pyx_t_23 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_25));
16272 #else
16273 __pyx_t_23 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_25);
16274 #endif
16275 ++__pyx_t_25;
16276 }
16277 if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 467, __pyx_L15_error)
16278 } else {
16279 __pyx_t_23 = __pyx_t_26(__pyx_t_1);
16280 if (unlikely(!__pyx_t_23)) {
16281 PyObject* exc_type = PyErr_Occurred();
16282 if (exc_type) {
16283 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 467, __pyx_L15_error)
16284 PyErr_Clear();
16285 }
16286 break;
16287 }
16288 }
16289 __Pyx_GOTREF(__pyx_t_23);
16290 __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_n, __pyx_t_23);
16291 __pyx_t_23 = 0;
16292
16293 /* "Isosurface.pyx":466
16294 * if self.elementBoundaryMaterialTypes[ebN] > 0:
16295 * bnt = tuple(
16296 * [self.g2b[n] for n # <<<<<<<<<<<<<<
16297 * in self.elementBoundaryNodesArray[ebN]])
16298 * pov.write("<{0:d},{1:d},{2:d}>,\n".format(*bnt))
16299*/
16300 __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_g2b); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 466, __pyx_L15_error)
16301 __Pyx_GOTREF(__pyx_t_23);
16302 __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_23, __pyx_8genexpr9__pyx_v_n); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 466, __pyx_L15_error)
16303 __Pyx_GOTREF(__pyx_t_7);
16304 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
16305 __Pyx_GIVEREF(__pyx_t_7);
16306 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_9, __pyx_t_7))) __PYX_ERR(0, 466, __pyx_L15_error)
16307 __pyx_t_7 = 0;
16308 }
16309 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16310 __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_n); __pyx_8genexpr9__pyx_v_n = 0;
16311 goto __pyx_L19_exit_scope;
16312 __pyx_L15_error:;
16313 __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_n); __pyx_8genexpr9__pyx_v_n = 0;
16314 goto __pyx_L1_error;
16315 __pyx_L19_exit_scope:;
16316 } /* exit inner scope */
16317
16318 /* "Isosurface.pyx":465
16319 * for ebN in self.exteriorElementBoundariesArray:
16320 * if self.elementBoundaryMaterialTypes[ebN] > 0:
16321 * bnt = tuple( # <<<<<<<<<<<<<<
16322 * [self.g2b[n] for n
16323 * in self.elementBoundaryNodesArray[ebN]])
16324*/
16325 __pyx_t_1 = PyList_AsTuple(((PyObject*)__pyx_t_9)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error)
16326 __Pyx_GOTREF(__pyx_t_1);
16327 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16328 __Pyx_XDECREF_SET(__pyx_v_bnt, ((PyObject*)__pyx_t_1));
16329 __pyx_t_1 = 0;
16330
16331 /* "Isosurface.pyx":468
16332 * [self.g2b[n] for n
16333 * in self.elementBoundaryNodesArray[ebN]])
16334 * pov.write("<{0:d},{1:d},{2:d}>,\n".format(*bnt)) # <<<<<<<<<<<<<<
16335 * pov.write("}\n")
16336 * pov.write("//inside_vector on\n}//mesh\n")
16337*/
16338 __pyx_t_9 = __pyx_v_pov;
16339 __Pyx_INCREF(__pyx_t_9);
16340 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_mstate_global->__pyx_kp_u_0_d_1_d_2_d, __pyx_mstate_global->__pyx_n_u_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 468, __pyx_L1_error)
16341 __Pyx_GOTREF(__pyx_t_7);
16342 __pyx_t_23 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_v_bnt, NULL); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 468, __pyx_L1_error)
16343 __Pyx_GOTREF(__pyx_t_23);
16344 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16345 if (!(likely(PyUnicode_CheckExact(__pyx_t_23)) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_23))) __PYX_ERR(0, 468, __pyx_L1_error)
16346 __pyx_t_6 = 0;
16347 {
16348 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_23};
16349 __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16350 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16351 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
16352 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error)
16353 __Pyx_GOTREF(__pyx_t_1);
16354 }
16355 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16356
16357 /* "Isosurface.pyx":464
16358 * np.count_nonzero(self.elementBoundaryMaterialTypes)))
16359 * for ebN in self.exteriorElementBoundariesArray:
16360 * if self.elementBoundaryMaterialTypes[ebN] > 0: # <<<<<<<<<<<<<<
16361 * bnt = tuple(
16362 * [self.g2b[n] for n
16363*/
16364 }
16365
16366 /* "Isosurface.pyx":463
16367 * pov.write("{0:d},\n".format(
16368 * np.count_nonzero(self.elementBoundaryMaterialTypes)))
16369 * for ebN in self.exteriorElementBoundariesArray: # <<<<<<<<<<<<<<
16370 * if self.elementBoundaryMaterialTypes[ebN] > 0:
16371 * bnt = tuple(
16372*/
16373 }
16374 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
16375
16376 /* "Isosurface.pyx":469
16377 * in self.elementBoundaryNodesArray[ebN]])
16378 * pov.write("<{0:d},{1:d},{2:d}>,\n".format(*bnt))
16379 * pov.write("}\n") # <<<<<<<<<<<<<<
16380 * pov.write("//inside_vector on\n}//mesh\n")
16381 * pov.flush()
16382*/
16383 __pyx_t_1 = __pyx_v_pov;
16384 __Pyx_INCREF(__pyx_t_1);
16385 __pyx_t_6 = 0;
16386 {
16387 PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u__4};
16388 __pyx_t_17 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16389 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
16390 if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 469, __pyx_L1_error)
16391 __Pyx_GOTREF(__pyx_t_17);
16392 }
16393 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
16394
16395 /* "Isosurface.pyx":470
16396 * pov.write("<{0:d},{1:d},{2:d}>,\n".format(*bnt))
16397 * pov.write("}\n")
16398 * pov.write("//inside_vector on\n}//mesh\n") # <<<<<<<<<<<<<<
16399 * pov.flush()
16400 * pov.close()
16401*/
16402 __pyx_t_1 = __pyx_v_pov;
16403 __Pyx_INCREF(__pyx_t_1);
16404 __pyx_t_6 = 0;
16405 {
16406 PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_inside_vector_on_mesh};
16407 __pyx_t_17 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16408 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
16409 if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 470, __pyx_L1_error)
16410 __Pyx_GOTREF(__pyx_t_17);
16411 }
16412 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
16413
16414 /* "Isosurface.pyx":471
16415 * pov.write("}\n")
16416 * pov.write("//inside_vector on\n}//mesh\n")
16417 * pov.flush() # <<<<<<<<<<<<<<
16418 * pov.close()
16419 * self.comm.endSequential()
16420*/
16421 __pyx_t_1 = __pyx_v_pov;
16422 __Pyx_INCREF(__pyx_t_1);
16423 __pyx_t_6 = 0;
16424 {
16425 PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
16426 __pyx_t_17 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_flush, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16427 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
16428 if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 471, __pyx_L1_error)
16429 __Pyx_GOTREF(__pyx_t_17);
16430 }
16431 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
16432
16433 /* "Isosurface.pyx":472
16434 * pov.write("//inside_vector on\n}//mesh\n")
16435 * pov.flush()
16436 * pov.close() # <<<<<<<<<<<<<<
16437 * self.comm.endSequential()
16438 * self.comm.barrier()
16439*/
16440 __pyx_t_1 = __pyx_v_pov;
16441 __Pyx_INCREF(__pyx_t_1);
16442 __pyx_t_6 = 0;
16443 {
16444 PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
16445 __pyx_t_17 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_close, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16446 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
16447 if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 472, __pyx_L1_error)
16448 __Pyx_GOTREF(__pyx_t_17);
16449 }
16450 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
16451
16452 /* "Isosurface.pyx":473
16453 * pov.flush()
16454 * pov.close()
16455 * self.comm.endSequential() # <<<<<<<<<<<<<<
16456 * self.comm.barrier()
16457 * self.comm.beginSequential()
16458*/
16459 __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_comm); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 473, __pyx_L1_error)
16460 __Pyx_GOTREF(__pyx_t_23);
16461 __pyx_t_1 = __pyx_t_23;
16462 __Pyx_INCREF(__pyx_t_1);
16463 __pyx_t_6 = 0;
16464 {
16465 PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
16466 __pyx_t_17 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_endSequential, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16467 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
16468 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
16469 if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 473, __pyx_L1_error)
16470 __Pyx_GOTREF(__pyx_t_17);
16471 }
16472 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
16473
16474 /* "Isosurface.pyx":474
16475 * pov.close()
16476 * self.comm.endSequential()
16477 * self.comm.barrier() # <<<<<<<<<<<<<<
16478 * self.comm.beginSequential()
16479 * pov = open(pov_filename, "a")
16480*/
16481 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_comm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
16482 __Pyx_GOTREF(__pyx_t_1);
16483 __pyx_t_23 = __pyx_t_1;
16484 __Pyx_INCREF(__pyx_t_23);
16485 __pyx_t_6 = 0;
16486 {
16487 PyObject *__pyx_callargs[2] = {__pyx_t_23, NULL};
16488 __pyx_t_17 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_barrier, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16489 __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
16490 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16491 if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 474, __pyx_L1_error)
16492 __Pyx_GOTREF(__pyx_t_17);
16493 }
16494 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
16495
16496 /* "Isosurface.pyx":475
16497 * self.comm.endSequential()
16498 * self.comm.barrier()
16499 * self.comm.beginSequential() # <<<<<<<<<<<<<<
16500 * pov = open(pov_filename, "a")
16501 * if self.comm.isMaster():
16502*/
16503 __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_comm); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 475, __pyx_L1_error)
16504 __Pyx_GOTREF(__pyx_t_23);
16505 __pyx_t_1 = __pyx_t_23;
16506 __Pyx_INCREF(__pyx_t_1);
16507 __pyx_t_6 = 0;
16508 {
16509 PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
16510 __pyx_t_17 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_beginSequential, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16511 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
16512 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
16513 if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 475, __pyx_L1_error)
16514 __Pyx_GOTREF(__pyx_t_17);
16515 }
16516 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
16517
16518 /* "Isosurface.pyx":476
16519 * self.comm.barrier()
16520 * self.comm.beginSequential()
16521 * pov = open(pov_filename, "a") # <<<<<<<<<<<<<<
16522 * if self.comm.isMaster():
16523 * pov.write("""}//union of meshes
16524*/
16525 __pyx_t_23 = NULL;
16526 __pyx_t_6 = 1;
16527 {
16528 PyObject *__pyx_callargs[3] = {__pyx_t_23, __pyx_v_pov_filename, __pyx_mstate_global->__pyx_n_u_a};
16529 __pyx_t_17 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16530 __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
16531 if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 476, __pyx_L1_error)
16532 __Pyx_GOTREF(__pyx_t_17);
16533 }
16534 __Pyx_DECREF_SET(__pyx_v_pov, __pyx_t_17);
16535 __pyx_t_17 = 0;
16536
16537 /* "Isosurface.pyx":477
16538 * self.comm.beginSequential()
16539 * pov = open(pov_filename, "a")
16540 * if self.comm.isMaster(): # <<<<<<<<<<<<<<
16541 * pov.write("""}//union of meshes
16542 * //}//difference of perturbed bounding box and boundary
16543*/
16544 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_comm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
16545 __Pyx_GOTREF(__pyx_t_1);
16546 __pyx_t_23 = __pyx_t_1;
16547 __Pyx_INCREF(__pyx_t_23);
16548 __pyx_t_6 = 0;
16549 {
16550 PyObject *__pyx_callargs[2] = {__pyx_t_23, NULL};
16551 __pyx_t_17 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_isMaster, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16552 __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
16553 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16554 if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 477, __pyx_L1_error)
16555 __Pyx_GOTREF(__pyx_t_17);
16556 }
16557 __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 477, __pyx_L1_error)
16558 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
16559 if (__pyx_t_10) {
16560
16561
16562 /* "Isosurface.pyx":478
16563 * pov = open(pov_filename, "a")
16564 * if self.comm.isMaster():
16565 * pov.write("""}//union of meshes # <<<<<<<<<<<<<<
16566 * //}//difference of perturbed bounding box and boundary
16567 * matrix < 1.000000, 0.000000, 0.000000,
16568*/
16569 __pyx_t_1 = __pyx_v_pov;
16570 __Pyx_INCREF(__pyx_t_1);
16571 __pyx_t_6 = 0;
16572 {
16573 PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_union_of_meshes_difference_of_p};
16574 __pyx_t_17 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16575 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
16576 if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 478, __pyx_L1_error)
16577 __Pyx_GOTREF(__pyx_t_17);
16578 }
16579 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
16580
16581 /* "Isosurface.pyx":477
16582 * self.comm.beginSequential()
16583 * pov = open(pov_filename, "a")
16584 * if self.comm.isMaster(): # <<<<<<<<<<<<<<
16585 * pov.write("""}//union of meshes
16586 * //}//difference of perturbed bounding box and boundary
16587*/
16588 }
16589
16590 /* "Isosurface.pyx":450
16591 * else:
16592 * pov = open(pov_filename, "a")
16593 * if self.writeBoundary: # <<<<<<<<<<<<<<
16594 * povScene = """mesh2 {
16595 * vertex_vectors {"""
16596*/
16597 }
16598
16599 /* "Isosurface.pyx":487
16600 * }//object
16601 * """)
16602 * povScene = """mesh2 { # <<<<<<<<<<<<<<
16603 * vertex_vectors {"""
16604 * pov.write(povScene)
16605*/
16606 __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_mesh2_vertex_vectors);
16607 __Pyx_XDECREF_SET(__pyx_v_povScene, __pyx_mstate_global->__pyx_kp_u_mesh2_vertex_vectors);
16608
16609 /* "Isosurface.pyx":489
16610 * povScene = """mesh2 {
16611 * vertex_vectors {"""
16612 * pov.write(povScene) # <<<<<<<<<<<<<<
16613 * pov.write("{0:d},\n".format(len(nodes)))
16614 * for n in nodes:
16615*/
16616 __pyx_t_1 = __pyx_v_pov;
16617 __Pyx_INCREF(__pyx_t_1);
16618 __pyx_t_6 = 0;
16619 {
16620 PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_povScene};
16621 __pyx_t_17 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16622 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
16623 if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 489, __pyx_L1_error)
16624 __Pyx_GOTREF(__pyx_t_17);
16625 }
16626 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
16627
16628 /* "Isosurface.pyx":490
16629 * vertex_vectors {"""
16630 * pov.write(povScene)
16631 * pov.write("{0:d},\n".format(len(nodes))) # <<<<<<<<<<<<<<
16632 * for n in nodes:
16633 * pov.write("<{0:f}, {1:f}, {2:f}>,\n".format(*n))
16634*/
16635 __pyx_t_1 = __pyx_v_pov;
16636 __Pyx_INCREF(__pyx_t_1);
16637 __pyx_t_9 = __pyx_mstate_global->__pyx_kp_u_0_d;
16638 __Pyx_INCREF(__pyx_t_9);
16639 __pyx_t_3 = PyObject_Length(__pyx_v_nodes); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 490, __pyx_L1_error)
16640 __pyx_t_7 = PyLong_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 490, __pyx_L1_error)
16641 __Pyx_GOTREF(__pyx_t_7);
16642
16643 __pyx_t_6 = 0;
16644 {
16645 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_7};
16646 __pyx_t_23 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16647 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
16648 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16649 if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 490, __pyx_L1_error)
16650 __Pyx_GOTREF(__pyx_t_23);
16651 }
16652 if (!(likely(PyUnicode_CheckExact(__pyx_t_23))||((__pyx_t_23) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_23))) __PYX_ERR(0, 490, __pyx_L1_error)
16653 __pyx_t_6 = 0;
16654 {
16655 PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_23};
16656 __pyx_t_17 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16657 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
16658 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
16659 if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 490, __pyx_L1_error)
16660 __Pyx_GOTREF(__pyx_t_17);
16661 }
16662 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
16663
16664 /* "Isosurface.pyx":491
16665 * pov.write(povScene)
16666 * pov.write("{0:d},\n".format(len(nodes)))
16667 * for n in nodes: # <<<<<<<<<<<<<<
16668 * pov.write("<{0:f}, {1:f}, {2:f}>,\n".format(*n))
16669 * pov.write(""" }
16670*/
16671 if (likely(PyList_CheckExact(__pyx_v_nodes)) || PyTuple_CheckExact(__pyx_v_nodes)) {
16672 __pyx_t_17 = __pyx_v_nodes; __Pyx_INCREF(__pyx_t_17);
16673 __pyx_t_3 = 0;
16674 __pyx_t_24 = NULL;
16675 } else {
16676 __pyx_t_3 = -1; __pyx_t_17 = PyObject_GetIter(__pyx_v_nodes); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 491, __pyx_L1_error)
16677 __Pyx_GOTREF(__pyx_t_17);
16678 __pyx_t_24 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_17); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 491, __pyx_L1_error)
16679 }
16680 for (;;) {
16681 if (likely(!__pyx_t_24)) {
16682 if (likely(PyList_CheckExact(__pyx_t_17))) {
16683 {
16684 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_17);
16685 #if !CYTHON_ASSUME_SAFE_SIZE
16686 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 491, __pyx_L1_error)
16687 #endif
16688 if (__pyx_t_3 >= __pyx_temp) break;
16689 }
16690 __pyx_t_23 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_17, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
16691 ++__pyx_t_3;
16692 } else {
16693 {
16694 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_17);
16695 #if !CYTHON_ASSUME_SAFE_SIZE
16696 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 491, __pyx_L1_error)
16697 #endif
16698 if (__pyx_t_3 >= __pyx_temp) break;
16699 }
16700 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16701 __pyx_t_23 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_17, __pyx_t_3));
16702 #else
16703 __pyx_t_23 = __Pyx_PySequence_ITEM(__pyx_t_17, __pyx_t_3);
16704 #endif
16705 ++__pyx_t_3;
16706 }
16707 if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 491, __pyx_L1_error)
16708 } else {
16709 __pyx_t_23 = __pyx_t_24(__pyx_t_17);
16710 if (unlikely(!__pyx_t_23)) {
16711 PyObject* exc_type = PyErr_Occurred();
16712 if (exc_type) {
16713 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 491, __pyx_L1_error)
16714 PyErr_Clear();
16715 }
16716 break;
16717 }
16718 }
16719 __Pyx_GOTREF(__pyx_t_23);
16720 __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_23);
16721 __pyx_t_23 = 0;
16722
16723 /* "Isosurface.pyx":492
16724 * pov.write("{0:d},\n".format(len(nodes)))
16725 * for n in nodes:
16726 * pov.write("<{0:f}, {1:f}, {2:f}>,\n".format(*n)) # <<<<<<<<<<<<<<
16727 * pov.write(""" }
16728 * normal_vectors {
16729*/
16730 __pyx_t_1 = __pyx_v_pov;
16731 __Pyx_INCREF(__pyx_t_1);
16732 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_mstate_global->__pyx_kp_u_0_f_1_f_2_f, __pyx_mstate_global->__pyx_n_u_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 492, __pyx_L1_error)
16733 __Pyx_GOTREF(__pyx_t_7);
16734 __pyx_t_9 = __Pyx_PySequence_Tuple(__pyx_v_n); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 492, __pyx_L1_error)
16735 __Pyx_GOTREF(__pyx_t_9);
16736 __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 492, __pyx_L1_error)
16737 __Pyx_GOTREF(__pyx_t_19);
16738 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16739 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16740 if (!(likely(PyUnicode_CheckExact(__pyx_t_19)) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_19))) __PYX_ERR(0, 492, __pyx_L1_error)
16741 __pyx_t_6 = 0;
16742 {
16743 PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_19};
16744 __pyx_t_23 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16745 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
16746 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
16747 if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 492, __pyx_L1_error)
16748 __Pyx_GOTREF(__pyx_t_23);
16749 }
16750 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
16751
16752 /* "Isosurface.pyx":491
16753 * pov.write(povScene)
16754 * pov.write("{0:d},\n".format(len(nodes)))
16755 * for n in nodes: # <<<<<<<<<<<<<<
16756 * pov.write("<{0:f}, {1:f}, {2:f}>,\n".format(*n))
16757 * pov.write(""" }
16758*/
16759 }
16760 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
16761
16762 /* "Isosurface.pyx":493
16763 * for n in nodes:
16764 * pov.write("<{0:f}, {1:f}, {2:f}>,\n".format(*n))
16765 * pov.write(""" } # <<<<<<<<<<<<<<
16766 * normal_vectors {
16767 * """)
16768*/
16769 __pyx_t_23 = __pyx_v_pov;
16770 __Pyx_INCREF(__pyx_t_23);
16771 __pyx_t_6 = 0;
16772 {
16773 PyObject *__pyx_callargs[2] = {__pyx_t_23, __pyx_mstate_global->__pyx_kp_u_normal_vectors};
16774 __pyx_t_17 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16775 __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
16776 if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 493, __pyx_L1_error)
16777 __Pyx_GOTREF(__pyx_t_17);
16778 }
16779 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
16780
16781 /* "Isosurface.pyx":496
16782 * normal_vectors {
16783 * """)
16784 * pov.write("{0:d},\n".format((len(normals)))) # <<<<<<<<<<<<<<
16785 * for n in normals:
16786 * pov.write("<{0:f}, {1:f}, {2:f}>,\n".format(*n))
16787*/
16788 __pyx_t_23 = __pyx_v_pov;
16789 __Pyx_INCREF(__pyx_t_23);
16790 __pyx_t_1 = __pyx_mstate_global->__pyx_kp_u_0_d;
16791 __Pyx_INCREF(__pyx_t_1);
16792 __pyx_t_3 = PyObject_Length(__pyx_v_normals); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 496, __pyx_L1_error)
16793 __pyx_t_9 = PyLong_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 496, __pyx_L1_error)
16794 __Pyx_GOTREF(__pyx_t_9);
16795
16796 __pyx_t_6 = 0;
16797 {
16798 PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_9};
16799 __pyx_t_19 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16800 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
16801 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16802 if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 496, __pyx_L1_error)
16803 __Pyx_GOTREF(__pyx_t_19);
16804 }
16805 if (!(likely(PyUnicode_CheckExact(__pyx_t_19))||((__pyx_t_19) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_19))) __PYX_ERR(0, 496, __pyx_L1_error)
16806 __pyx_t_6 = 0;
16807 {
16808 PyObject *__pyx_callargs[2] = {__pyx_t_23, __pyx_t_19};
16809 __pyx_t_17 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16810 __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
16811 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
16812 if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 496, __pyx_L1_error)
16813 __Pyx_GOTREF(__pyx_t_17);
16814 }
16815 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
16816
16817 /* "Isosurface.pyx":497
16818 * """)
16819 * pov.write("{0:d},\n".format((len(normals))))
16820 * for n in normals: # <<<<<<<<<<<<<<
16821 * pov.write("<{0:f}, {1:f}, {2:f}>,\n".format(*n))
16822 * pov.write(""" }
16823*/
16824 if (likely(PyList_CheckExact(__pyx_v_normals)) || PyTuple_CheckExact(__pyx_v_normals)) {
16825 __pyx_t_17 = __pyx_v_normals; __Pyx_INCREF(__pyx_t_17);
16826 __pyx_t_3 = 0;
16827 __pyx_t_24 = NULL;
16828 } else {
16829 __pyx_t_3 = -1; __pyx_t_17 = PyObject_GetIter(__pyx_v_normals); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 497, __pyx_L1_error)
16830 __Pyx_GOTREF(__pyx_t_17);
16831 __pyx_t_24 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_17); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 497, __pyx_L1_error)
16832 }
16833 for (;;) {
16834 if (likely(!__pyx_t_24)) {
16835 if (likely(PyList_CheckExact(__pyx_t_17))) {
16836 {
16837 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_17);
16838 #if !CYTHON_ASSUME_SAFE_SIZE
16839 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 497, __pyx_L1_error)
16840 #endif
16841 if (__pyx_t_3 >= __pyx_temp) break;
16842 }
16843 __pyx_t_19 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_17, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
16844 ++__pyx_t_3;
16845 } else {
16846 {
16847 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_17);
16848 #if !CYTHON_ASSUME_SAFE_SIZE
16849 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 497, __pyx_L1_error)
16850 #endif
16851 if (__pyx_t_3 >= __pyx_temp) break;
16852 }
16853 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16854 __pyx_t_19 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_17, __pyx_t_3));
16855 #else
16856 __pyx_t_19 = __Pyx_PySequence_ITEM(__pyx_t_17, __pyx_t_3);
16857 #endif
16858 ++__pyx_t_3;
16859 }
16860 if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 497, __pyx_L1_error)
16861 } else {
16862 __pyx_t_19 = __pyx_t_24(__pyx_t_17);
16863 if (unlikely(!__pyx_t_19)) {
16864 PyObject* exc_type = PyErr_Occurred();
16865 if (exc_type) {
16866 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 497, __pyx_L1_error)
16867 PyErr_Clear();
16868 }
16869 break;
16870 }
16871 }
16872 __Pyx_GOTREF(__pyx_t_19);
16873 __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_19);
16874 __pyx_t_19 = 0;
16875
16876 /* "Isosurface.pyx":498
16877 * pov.write("{0:d},\n".format((len(normals))))
16878 * for n in normals:
16879 * pov.write("<{0:f}, {1:f}, {2:f}>,\n".format(*n)) # <<<<<<<<<<<<<<
16880 * pov.write(""" }
16881 * face_indices {
16882*/
16883 __pyx_t_23 = __pyx_v_pov;
16884 __Pyx_INCREF(__pyx_t_23);
16885 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_mstate_global->__pyx_kp_u_0_f_1_f_2_f, __pyx_mstate_global->__pyx_n_u_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 498, __pyx_L1_error)
16886 __Pyx_GOTREF(__pyx_t_9);
16887 __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error)
16888 __Pyx_GOTREF(__pyx_t_1);
16889 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 498, __pyx_L1_error)
16890 __Pyx_GOTREF(__pyx_t_7);
16891 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
16892 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16893 if (!(likely(PyUnicode_CheckExact(__pyx_t_7)) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_7))) __PYX_ERR(0, 498, __pyx_L1_error)
16894 __pyx_t_6 = 0;
16895 {
16896 PyObject *__pyx_callargs[2] = {__pyx_t_23, __pyx_t_7};
16897 __pyx_t_19 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16898 __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
16899 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16900 if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 498, __pyx_L1_error)
16901 __Pyx_GOTREF(__pyx_t_19);
16902 }
16903 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
16904
16905 /* "Isosurface.pyx":497
16906 * """)
16907 * pov.write("{0:d},\n".format((len(normals))))
16908 * for n in normals: # <<<<<<<<<<<<<<
16909 * pov.write("<{0:f}, {1:f}, {2:f}>,\n".format(*n))
16910 * pov.write(""" }
16911*/
16912 }
16913 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
16914
16915 /* "Isosurface.pyx":499
16916 * for n in normals:
16917 * pov.write("<{0:f}, {1:f}, {2:f}>,\n".format(*n))
16918 * pov.write(""" } # <<<<<<<<<<<<<<
16919 * face_indices {
16920 * """)
16921*/
16922 __pyx_t_19 = __pyx_v_pov;
16923 __Pyx_INCREF(__pyx_t_19);
16924 __pyx_t_6 = 0;
16925 {
16926 PyObject *__pyx_callargs[2] = {__pyx_t_19, __pyx_mstate_global->__pyx_kp_u_face_indices_2};
16927 __pyx_t_17 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16928 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
16929 if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 499, __pyx_L1_error)
16930 __Pyx_GOTREF(__pyx_t_17);
16931 }
16932 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
16933
16934 /* "Isosurface.pyx":502
16935 * face_indices {
16936 * """)
16937 * pov.write("{0:d},\n".format(len(elements))) # <<<<<<<<<<<<<<
16938 * for e in elements:
16939 * pov.write("<{0:d}, {1:d}, {2:d}>,\n".format(*e))
16940*/
16941 __pyx_t_19 = __pyx_v_pov;
16942 __Pyx_INCREF(__pyx_t_19);
16943 __pyx_t_23 = __pyx_mstate_global->__pyx_kp_u_0_d;
16944 __Pyx_INCREF(__pyx_t_23);
16945 __pyx_t_3 = PyObject_Length(__pyx_v_elements); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 502, __pyx_L1_error)
16946 __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error)
16947 __Pyx_GOTREF(__pyx_t_1);
16948
16949 __pyx_t_6 = 0;
16950 {
16951 PyObject *__pyx_callargs[2] = {__pyx_t_23, __pyx_t_1};
16952 __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16953 __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
16954 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16955 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 502, __pyx_L1_error)
16956 __Pyx_GOTREF(__pyx_t_7);
16957 }
16958 if (!(likely(PyUnicode_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_7))) __PYX_ERR(0, 502, __pyx_L1_error)
16959 __pyx_t_6 = 0;
16960 {
16961 PyObject *__pyx_callargs[2] = {__pyx_t_19, __pyx_t_7};
16962 __pyx_t_17 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
16963 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
16964 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16965 if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 502, __pyx_L1_error)
16966 __Pyx_GOTREF(__pyx_t_17);
16967 }
16968 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
16969
16970 /* "Isosurface.pyx":503
16971 * """)
16972 * pov.write("{0:d},\n".format(len(elements)))
16973 * for e in elements: # <<<<<<<<<<<<<<
16974 * pov.write("<{0:d}, {1:d}, {2:d}>,\n".format(*e))
16975 * pov.write(""" }
16976*/
16977 if (likely(PyList_CheckExact(__pyx_v_elements)) || PyTuple_CheckExact(__pyx_v_elements)) {
16978 __pyx_t_17 = __pyx_v_elements; __Pyx_INCREF(__pyx_t_17);
16979 __pyx_t_3 = 0;
16980 __pyx_t_24 = NULL;
16981 } else {
16982 __pyx_t_3 = -1; __pyx_t_17 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 503, __pyx_L1_error)
16983 __Pyx_GOTREF(__pyx_t_17);
16984 __pyx_t_24 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_17); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 503, __pyx_L1_error)
16985 }
16986 for (;;) {
16987 if (likely(!__pyx_t_24)) {
16988 if (likely(PyList_CheckExact(__pyx_t_17))) {
16989 {
16990 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_17);
16991 #if !CYTHON_ASSUME_SAFE_SIZE
16992 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 503, __pyx_L1_error)
16993 #endif
16994 if (__pyx_t_3 >= __pyx_temp) break;
16995 }
16996 __pyx_t_7 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_17, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
16997 ++__pyx_t_3;
16998 } else {
16999 {
17000 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_17);
17001 #if !CYTHON_ASSUME_SAFE_SIZE
17002 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 503, __pyx_L1_error)
17003 #endif
17004 if (__pyx_t_3 >= __pyx_temp) break;
17005 }
17006 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17007 __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_17, __pyx_t_3));
17008 #else
17009 __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_17, __pyx_t_3);
17010 #endif
17011 ++__pyx_t_3;
17012 }
17013 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 503, __pyx_L1_error)
17014 } else {
17015 __pyx_t_7 = __pyx_t_24(__pyx_t_17);
17016 if (unlikely(!__pyx_t_7)) {
17017 PyObject* exc_type = PyErr_Occurred();
17018 if (exc_type) {
17019 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 503, __pyx_L1_error)
17020 PyErr_Clear();
17021 }
17022 break;
17023 }
17024 }
17025 __Pyx_GOTREF(__pyx_t_7);
17026 __Pyx_XDECREF_SET(__pyx_v_e, __pyx_t_7);
17027 __pyx_t_7 = 0;
17028
17029 /* "Isosurface.pyx":504
17030 * pov.write("{0:d},\n".format(len(elements)))
17031 * for e in elements:
17032 * pov.write("<{0:d}, {1:d}, {2:d}>,\n".format(*e)) # <<<<<<<<<<<<<<
17033 * pov.write(""" }
17034 * normal_indices {
17035*/
17036 __pyx_t_19 = __pyx_v_pov;
17037 __Pyx_INCREF(__pyx_t_19);
17038 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_mstate_global->__pyx_kp_u_0_d_1_d_2_d_2, __pyx_mstate_global->__pyx_n_u_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
17039 __Pyx_GOTREF(__pyx_t_1);
17040 __pyx_t_23 = __Pyx_PySequence_Tuple(__pyx_v_e); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 504, __pyx_L1_error)
17041 __Pyx_GOTREF(__pyx_t_23);
17042 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_23, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 504, __pyx_L1_error)
17043 __Pyx_GOTREF(__pyx_t_9);
17044 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17045 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
17046 if (!(likely(PyUnicode_CheckExact(__pyx_t_9)) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_9))) __PYX_ERR(0, 504, __pyx_L1_error)
17047 __pyx_t_6 = 0;
17048 {
17049 PyObject *__pyx_callargs[2] = {__pyx_t_19, __pyx_t_9};
17050 __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
17051 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
17052 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17053 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 504, __pyx_L1_error)
17054 __Pyx_GOTREF(__pyx_t_7);
17055 }
17056 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17057
17058 /* "Isosurface.pyx":503
17059 * """)
17060 * pov.write("{0:d},\n".format(len(elements)))
17061 * for e in elements: # <<<<<<<<<<<<<<
17062 * pov.write("<{0:d}, {1:d}, {2:d}>,\n".format(*e))
17063 * pov.write(""" }
17064*/
17065 }
17066 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
17067
17068 /* "Isosurface.pyx":505
17069 * for e in elements:
17070 * pov.write("<{0:d}, {1:d}, {2:d}>,\n".format(*e))
17071 * pov.write(""" } # <<<<<<<<<<<<<<
17072 * normal_indices {
17073 * """)
17074*/
17075 __pyx_t_7 = __pyx_v_pov;
17076 __Pyx_INCREF(__pyx_t_7);
17077 __pyx_t_6 = 0;
17078 {
17079 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_u_normal_indices_2};
17080 __pyx_t_17 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
17081 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
17082 if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 505, __pyx_L1_error)
17083 __Pyx_GOTREF(__pyx_t_17);
17084 }
17085 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
17086
17087 /* "Isosurface.pyx":508
17088 * normal_indices {
17089 * """)
17090 * pov.write("{0:d},\n".format(len(normal_indices))) # <<<<<<<<<<<<<<
17091 * for ni in normal_indices:
17092 * pov.write("<{0:d}, {1:d}, {2:d}>,\n".format(*ni))
17093*/
17094 __pyx_t_7 = __pyx_v_pov;
17095 __Pyx_INCREF(__pyx_t_7);
17096 __pyx_t_19 = __pyx_mstate_global->__pyx_kp_u_0_d;
17097 __Pyx_INCREF(__pyx_t_19);
17098 __pyx_t_3 = PyObject_Length(__pyx_v_normal_indices); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 508, __pyx_L1_error)
17099 __pyx_t_23 = PyLong_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 508, __pyx_L1_error)
17100 __Pyx_GOTREF(__pyx_t_23);
17101
17102 __pyx_t_6 = 0;
17103 {
17104 PyObject *__pyx_callargs[2] = {__pyx_t_19, __pyx_t_23};
17105 __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
17106 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
17107 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
17108 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 508, __pyx_L1_error)
17109 __Pyx_GOTREF(__pyx_t_9);
17110 }
17111 if (!(likely(PyUnicode_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_9))) __PYX_ERR(0, 508, __pyx_L1_error)
17112 __pyx_t_6 = 0;
17113 {
17114 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_9};
17115 __pyx_t_17 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
17116 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
17117 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17118 if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 508, __pyx_L1_error)
17119 __Pyx_GOTREF(__pyx_t_17);
17120 }
17121 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
17122
17123 /* "Isosurface.pyx":509
17124 * """)
17125 * pov.write("{0:d},\n".format(len(normal_indices)))
17126 * for ni in normal_indices: # <<<<<<<<<<<<<<
17127 * pov.write("<{0:d}, {1:d}, {2:d}>,\n".format(*ni))
17128 * pov.write(""" }
17129*/
17130 if (likely(PyList_CheckExact(__pyx_v_normal_indices)) || PyTuple_CheckExact(__pyx_v_normal_indices)) {
17131 __pyx_t_17 = __pyx_v_normal_indices; __Pyx_INCREF(__pyx_t_17);
17132 __pyx_t_3 = 0;
17133 __pyx_t_24 = NULL;
17134 } else {
17135 __pyx_t_3 = -1; __pyx_t_17 = PyObject_GetIter(__pyx_v_normal_indices); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 509, __pyx_L1_error)
17136 __Pyx_GOTREF(__pyx_t_17);
17137 __pyx_t_24 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_17); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 509, __pyx_L1_error)
17138 }
17139 for (;;) {
17140 if (likely(!__pyx_t_24)) {
17141 if (likely(PyList_CheckExact(__pyx_t_17))) {
17142 {
17143 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_17);
17144 #if !CYTHON_ASSUME_SAFE_SIZE
17145 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 509, __pyx_L1_error)
17146 #endif
17147 if (__pyx_t_3 >= __pyx_temp) break;
17148 }
17149 __pyx_t_9 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_17, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
17150 ++__pyx_t_3;
17151 } else {
17152 {
17153 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_17);
17154 #if !CYTHON_ASSUME_SAFE_SIZE
17155 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 509, __pyx_L1_error)
17156 #endif
17157 if (__pyx_t_3 >= __pyx_temp) break;
17158 }
17159 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17160 __pyx_t_9 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_17, __pyx_t_3));
17161 #else
17162 __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_17, __pyx_t_3);
17163 #endif
17164 ++__pyx_t_3;
17165 }
17166 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 509, __pyx_L1_error)
17167 } else {
17168 __pyx_t_9 = __pyx_t_24(__pyx_t_17);
17169 if (unlikely(!__pyx_t_9)) {
17170 PyObject* exc_type = PyErr_Occurred();
17171 if (exc_type) {
17172 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 509, __pyx_L1_error)
17173 PyErr_Clear();
17174 }
17175 break;
17176 }
17177 }
17178 __Pyx_GOTREF(__pyx_t_9);
17179 __Pyx_XDECREF_SET(__pyx_v_ni, __pyx_t_9);
17180 __pyx_t_9 = 0;
17181
17182 /* "Isosurface.pyx":510
17183 * pov.write("{0:d},\n".format(len(normal_indices)))
17184 * for ni in normal_indices:
17185 * pov.write("<{0:d}, {1:d}, {2:d}>,\n".format(*ni)) # <<<<<<<<<<<<<<
17186 * pov.write(""" }
17187 * matrix < 1.000000, 0.000000, 0.000000,
17188*/
17189 __pyx_t_7 = __pyx_v_pov;
17190 __Pyx_INCREF(__pyx_t_7);
17191 __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_mstate_global->__pyx_kp_u_0_d_1_d_2_d_2, __pyx_mstate_global->__pyx_n_u_format); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 510, __pyx_L1_error)
17192 __Pyx_GOTREF(__pyx_t_23);
17193 __pyx_t_19 = __Pyx_PySequence_Tuple(__pyx_v_ni); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 510, __pyx_L1_error)
17194 __Pyx_GOTREF(__pyx_t_19);
17195 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_23, __pyx_t_19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error)
17196 __Pyx_GOTREF(__pyx_t_1);
17197 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
17198 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
17199 if (!(likely(PyUnicode_CheckExact(__pyx_t_1)) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 510, __pyx_L1_error)
17200 __pyx_t_6 = 0;
17201 {
17202 PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_1};
17203 __pyx_t_9 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
17204 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
17205 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17206 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 510, __pyx_L1_error)
17207 __Pyx_GOTREF(__pyx_t_9);
17208 }
17209 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17210
17211 /* "Isosurface.pyx":509
17212 * """)
17213 * pov.write("{0:d},\n".format(len(normal_indices)))
17214 * for ni in normal_indices: # <<<<<<<<<<<<<<
17215 * pov.write("<{0:d}, {1:d}, {2:d}>,\n".format(*ni))
17216 * pov.write(""" }
17217*/
17218 }
17219 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
17220
17221 /* "Isosurface.pyx":511
17222 * for ni in normal_indices:
17223 * pov.write("<{0:d}, {1:d}, {2:d}>,\n".format(*ni))
17224 * pov.write(""" } # <<<<<<<<<<<<<<
17225 * matrix < 1.000000, 0.000000, 0.000000,
17226 * 0.000000, 1.000000, 0.000000,
17227*/
17228 __pyx_t_9 = __pyx_v_pov;
17229 __Pyx_INCREF(__pyx_t_9);
17230 __pyx_t_6 = 0;
17231 {
17232 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_matrix_1_000000_0_000000_0_0000};
17233 __pyx_t_17 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
17234 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
17235 if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 511, __pyx_L1_error)
17236 __Pyx_GOTREF(__pyx_t_17);
17237 }
17238 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
17239
17240 /* "Isosurface.pyx":519
17241 * }
17242 * """)
17243 * pov.flush() # <<<<<<<<<<<<<<
17244 * pov.close()
17245 * self.comm.endSequential()
17246*/
17247 __pyx_t_9 = __pyx_v_pov;
17248 __Pyx_INCREF(__pyx_t_9);
17249 __pyx_t_6 = 0;
17250 {
17251 PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
17252 __pyx_t_17 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_flush, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
17253 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
17254 if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 519, __pyx_L1_error)
17255 __Pyx_GOTREF(__pyx_t_17);
17256 }
17257 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
17258
17259 /* "Isosurface.pyx":520
17260 * """)
17261 * pov.flush()
17262 * pov.close() # <<<<<<<<<<<<<<
17263 * self.comm.endSequential()
17264 *
17265*/
17266 __pyx_t_9 = __pyx_v_pov;
17267 __Pyx_INCREF(__pyx_t_9);
17268 __pyx_t_6 = 0;
17269 {
17270 PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
17271 __pyx_t_17 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_close, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
17272 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
17273 if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 520, __pyx_L1_error)
17274 __Pyx_GOTREF(__pyx_t_17);
17275 }
17276 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
17277
17278 /* "Isosurface.pyx":521
17279 * pov.flush()
17280 * pov.close()
17281 * self.comm.endSequential() # <<<<<<<<<<<<<<
17282 *
17283 * def calculate(self, checkTime=True):
17284*/
17285 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_comm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 521, __pyx_L1_error)
17286 __Pyx_GOTREF(__pyx_t_1);
17287 __pyx_t_9 = __pyx_t_1;
17288 __Pyx_INCREF(__pyx_t_9);
17289 __pyx_t_6 = 0;
17290 {
17291 PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
17292 __pyx_t_17 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_endSequential, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
17293 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
17294 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17295 if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 521, __pyx_L1_error)
17296 __Pyx_GOTREF(__pyx_t_17);
17297 }
17298 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
17299
17300 /* "Isosurface.pyx":372
17301 * f.close()
17302 *
17303 * def writeIsosurfaceMesh_povray(self, field, value, frame): # <<<<<<<<<<<<<<
17304 * """
17305 * Write the triangular mesh to a povray file
17306*/
17307
17308 /* function exit code */
17309 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17310 goto __pyx_L0;
17311 __pyx_L1_error:;
17312 __Pyx_XDECREF(__pyx_t_1);
17313 __Pyx_XDECREF(__pyx_t_4);
17314 __Pyx_XDECREF(__pyx_t_5);
17315 __Pyx_XDECREF(__pyx_t_7);
17316 __Pyx_XDECREF(__pyx_t_9);
17317 __Pyx_XDECREF(__pyx_t_11);
17318 __Pyx_XDECREF(__pyx_t_12);
17319 __Pyx_XDECREF(__pyx_t_13);
17320 __Pyx_XDECREF(__pyx_t_14);
17321 __Pyx_XDECREF(__pyx_t_15);
17322 __Pyx_XDECREF(__pyx_t_16);
17323 __Pyx_XDECREF(__pyx_t_17);
17324 __Pyx_XDECREF(__pyx_t_18);
17325 __Pyx_XDECREF(__pyx_t_19);
17326 __Pyx_XDECREF(__pyx_t_20);
17327 __Pyx_XDECREF(__pyx_t_21);
17328 __Pyx_XDECREF(__pyx_t_22);
17329 __Pyx_XDECREF(__pyx_t_23);
17330 __Pyx_AddTraceback("Isosurface.Isosurface.writeIsosurfaceMesh_povray", __pyx_clineno, __pyx_lineno, __pyx_filename);
17331 __pyx_r = NULL;
17332 __pyx_L0:;
17333 __Pyx_XDECREF(__pyx_v_Template);
17334 __Pyx_XDECREF(__pyx_v_nodes);
17335 __Pyx_XDECREF(__pyx_v_elements);
17336 __Pyx_XDECREF(__pyx_v_normals);
17337 __Pyx_XDECREF(__pyx_v_normal_indices);
17338 __Pyx_XDECREF(__pyx_v_pov_filename);
17339 __Pyx_XDECREF(__pyx_v_pov);
17340 __Pyx_XDECREF(__pyx_v_dx);
17341 __Pyx_XDECREF(__pyx_v_nll);
17342 __Pyx_XDECREF(__pyx_v_fur);
17343 __Pyx_XDECREF(__pyx_v_povScene);
17344 __Pyx_XDECREF(__pyx_v_n);
17345 __Pyx_XDECREF(__pyx_v_ebN);
17346 __Pyx_XDECREF(__pyx_v_bnt);
17347 __Pyx_XDECREF(__pyx_v_e);
17348 __Pyx_XDECREF(__pyx_v_ni);
17349 __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_n);
17350 __Pyx_XGIVEREF(__pyx_r);
17351 __Pyx_RefNannyFinishContext();
17352 return __pyx_r;
17353}
17354
17355/* "Isosurface.pyx":523
17356 * self.comm.endSequential()
17357 *
17358 * def calculate(self, checkTime=True): # <<<<<<<<<<<<<<
17359 * """Extracts isosourfaces at current time and update open output files
17360 * """
17361*/
17362
17363/* Python wrapper */
17364static PyObject *__pyx_pw_10Isosurface_10Isosurface_15calculate(PyObject *__pyx_self,
17365#if CYTHON_VECTORCALL
17366PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
17367#else
17368PyObject *__pyx_args, PyObject *__pyx_kwds
17369#endif
17370); /*proto*/
17371PyDoc_STRVAR(__pyx_doc_10Isosurface_10Isosurface_14calculate, "Isosurface.calculate(self, checkTime=True)\n\nExtracts isosourfaces at current time and update open output files\n ");
17372static PyMethodDef __pyx_mdef_10Isosurface_10Isosurface_15calculate = {"calculate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10Isosurface_10Isosurface_15calculate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10Isosurface_10Isosurface_14calculate};
17373static PyObject *__pyx_pw_10Isosurface_10Isosurface_15calculate(PyObject *__pyx_self,
17374#if CYTHON_VECTORCALL
17375PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
17376#else
17377PyObject *__pyx_args, PyObject *__pyx_kwds
17378#endif
17379) {
17380 PyObject *__pyx_v_self = 0;
17381 PyObject *__pyx_v_checkTime = 0;
17382 #if !CYTHON_VECTORCALL
17383 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
17384 #endif
17385 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
17386 PyObject* values[2] = {0,0};
17387 int __pyx_lineno = 0;
17388 const char *__pyx_filename = NULL;
17389 int __pyx_clineno = 0;
17390 PyObject *__pyx_r = 0;
17391 __Pyx_RefNannyDeclarations
17392 __Pyx_RefNannySetupContext("calculate (wrapper)", 0);
17393 #if !CYTHON_VECTORCALL
17394 #if CYTHON_ASSUME_SAFE_SIZE
17395 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
17396 #else
17397 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
17398 #endif
17399 #endif
17400 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
17401 {
17402 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_checkTime,0};
17403 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
17404 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 523, __pyx_L3_error)
17405 if (__pyx_kwds_len > 0) {
17406 switch (__pyx_nargs) {
17407 case 2:
17408 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
17409 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 523, __pyx_L3_error)
17410 CYTHON_FALLTHROUGH;
17411 case 1:
17412 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
17413 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 523, __pyx_L3_error)
17414 CYTHON_FALLTHROUGH;
17415 case 0: break;
17416 default: goto __pyx_L5_argtuple_error;
17417 }
17418 const Py_ssize_t kwd_pos_args = __pyx_nargs;
17419 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "calculate", 0) < (0)) __PYX_ERR(0, 523, __pyx_L3_error)
17420 if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True)));
17421 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
17422 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("calculate", 0, 1, 2, i); __PYX_ERR(0, 523, __pyx_L3_error) }
17423 }
17424 } else {
17425 switch (__pyx_nargs) {
17426 case 2:
17427 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
17428 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 523, __pyx_L3_error)
17429 CYTHON_FALLTHROUGH;
17430 case 1:
17431 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
17432 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 523, __pyx_L3_error)
17433 break;
17434 default: goto __pyx_L5_argtuple_error;
17435 }
17436 if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)((PyObject*)Py_True)));
17437 }
17438 __pyx_v_self = values[0];
17439 __pyx_v_checkTime = values[1];
17440 }
17441 goto __pyx_L6_skip;
17442 __pyx_L5_argtuple_error:;
17443 __Pyx_RaiseArgtupleInvalid("calculate", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 523, __pyx_L3_error)
17444 __pyx_L6_skip:;
17445 goto __pyx_L4_argument_unpacking_done;
17446 __pyx_L3_error:;
17447 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
17448 Py_XDECREF(values[__pyx_temp]);
17449 }
17450 __Pyx_AddTraceback("Isosurface.Isosurface.calculate", __pyx_clineno, __pyx_lineno, __pyx_filename);
17451 __Pyx_RefNannyFinishContext();
17452 return NULL;
17453 __pyx_L4_argument_unpacking_done:;
17454 __pyx_r = __pyx_pf_10Isosurface_10Isosurface_14calculate(__pyx_self, __pyx_v_self, __pyx_v_checkTime);
17455
17456 /* function exit code */
17457 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
17458 Py_XDECREF(values[__pyx_temp]);
17459 }
17460 __Pyx_RefNannyFinishContext();
17461 return __pyx_r;
17462}
17463
17464static PyObject *__pyx_pf_10Isosurface_10Isosurface_14calculate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_checkTime) {
17465 CYTHON_UNUSED PyObject *__pyx_v_Template = NULL;
17466 PyObject *__pyx_v_time = NULL;
17467 PyObject *__pyx_v_field = NULL;
17468 PyObject *__pyx_v_values = NULL;
17469 PyObject *__pyx_v_v = NULL;
17470 PyObject *__pyx_r = NULL;
17471 __Pyx_RefNannyDeclarations
17472 PyObject *__pyx_t_1 = NULL;
17473 PyObject *__pyx_t_2 = NULL;
17474 Py_ssize_t __pyx_t_3;
17475 PyObject *__pyx_t_4 = NULL;
17476 int __pyx_t_5;
17477 PyObject *__pyx_t_6 = NULL;
17478 PyObject *__pyx_t_7 = NULL;
17479 PyObject *__pyx_t_8 = NULL;
17480 size_t __pyx_t_9;
17481 int __pyx_t_10;
17482 PyObject *(*__pyx_t_11)(PyObject *);
17483 PyObject *(*__pyx_t_12)(PyObject *);
17484 Py_ssize_t __pyx_t_13;
17485 PyObject *(*__pyx_t_14)(PyObject *);
17486 int __pyx_lineno = 0;
17487 const char *__pyx_filename = NULL;
17488 int __pyx_clineno = 0;
17489 __Pyx_RefNannySetupContext("calculate", 0);
17490
17491 /* "Isosurface.pyx":526
17492 * """Extracts isosourfaces at current time and update open output files
17493 * """
17494 * from string import Template # <<<<<<<<<<<<<<
17495 * if checkTime:
17496 * time = self.timeIntegration.tLast
17497*/
17498 {
17499 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Template};
17500 __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_string, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 526, __pyx_L1_error)
17501 }
17502 __pyx_t_1 = __pyx_t_2;
17503 __Pyx_GOTREF(__pyx_t_1);
17504 {
17505 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Template};
17506 __pyx_t_3 = 0; {
17507 __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_1, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 526, __pyx_L1_error)
17508 __Pyx_GOTREF(__pyx_t_4);
17509 switch (__pyx_t_3) {
17510 case 0:
17511 __Pyx_INCREF(__pyx_t_4);
17512 __pyx_v_Template = __pyx_t_4;
17513 break;
17514 default:;
17515 }
17516 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17517 }
17518 }
17519 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17520
17521 /* "Isosurface.pyx":527
17522 * """
17523 * from string import Template
17524 * if checkTime: # <<<<<<<<<<<<<<
17525 * time = self.timeIntegration.tLast
17526 * log("Calculate called at time " + repr(time))
17527*/
17528 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_checkTime); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 527, __pyx_L1_error)
17529 if (__pyx_t_5) {
17530
17531
17532 /* "Isosurface.pyx":528
17533 * from string import Template
17534 * if checkTime:
17535 * time = self.timeIntegration.tLast # <<<<<<<<<<<<<<
17536 * log("Calculate called at time " + repr(time))
17537 * # check that gauge is in its active time region
17538*/
17539 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_timeIntegration); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 528, __pyx_L1_error)
17540 __Pyx_GOTREF(__pyx_t_1);
17541 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_tLast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 528, __pyx_L1_error)
17542 __Pyx_GOTREF(__pyx_t_4);
17543 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17544 __pyx_v_time = __pyx_t_4;
17545 __pyx_t_4 = 0;
17546
17547 /* "Isosurface.pyx":529
17548 * if checkTime:
17549 * time = self.timeIntegration.tLast
17550 * log("Calculate called at time " + repr(time)) # <<<<<<<<<<<<<<
17551 * # check that gauge is in its active time region
17552 * if self.activeTime is not None and (self.activeTime[0] > time or
17553*/
17554 __pyx_t_1 = NULL;
17555 __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_log); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 529, __pyx_L1_error)
17556 __Pyx_GOTREF(__pyx_t_6);
17557 __pyx_t_7 = PyObject_Repr(__pyx_v_time); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 529, __pyx_L1_error)
17558 __Pyx_GOTREF(__pyx_t_7);
17559 __pyx_t_8 = __Pyx_PyUnicode_ConcatSafe(__pyx_mstate_global->__pyx_kp_u_Calculate_called_at_time, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 529, __pyx_L1_error)
17560 __Pyx_GOTREF(__pyx_t_8);
17561 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17562 __pyx_t_9 = 1;
17563 #if CYTHON_UNPACK_METHODS
17564 if (unlikely(PyMethod_Check(__pyx_t_6))) {
17565 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
17566 assert(__pyx_t_1);
17567 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
17568 __Pyx_INCREF(__pyx_t_1);
17569 __Pyx_INCREF(__pyx__function);
17570 __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
17571 __pyx_t_9 = 0;
17572 }
17573 #endif
17574 {
17575 PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_8};
17576 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
17577 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
17578 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17579 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17580 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error)
17581 __Pyx_GOTREF(__pyx_t_4);
17582 }
17583 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17584
17585 /* "Isosurface.pyx":531
17586 * log("Calculate called at time " + repr(time))
17587 * # check that gauge is in its active time region
17588 * if self.activeTime is not None and (self.activeTime[0] > time or # <<<<<<<<<<<<<<
17589 * self.activeTime[1] < time):
17590 * return
17591*/
17592 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_activeTime); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error)
17593 __Pyx_GOTREF(__pyx_t_4);
17594 __pyx_t_10 = (__pyx_t_4 != Py_None);
17595 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17596 if (__pyx_t_10) {
17597
17598 } else {
17599
17600 __pyx_t_5 = __pyx_t_10;
17601
17602 goto __pyx_L5_bool_binop_done;
17603 }
17604 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_activeTime); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __pyx_L1_error)
17605 __Pyx_GOTREF(__pyx_t_4);
17606 __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 531, __pyx_L1_error)
17607 __Pyx_GOTREF(__pyx_t_6);
17608 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17609 __pyx_t_10 = __Pyx_PyObject_CompareBoolGt_object_object(__pyx_t_6, __pyx_v_time, Py_GT); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 531, __pyx_L1_error)
17610 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17611 if (!__pyx_t_10) {
17612
17613 } else {
17614
17615 __pyx_t_5 = __pyx_t_10;
17616
17617 goto __pyx_L5_bool_binop_done;
17618 }
17619
17620 /* "Isosurface.pyx":532
17621 * # check that gauge is in its active time region
17622 * if self.activeTime is not None and (self.activeTime[0] > time or
17623 * self.activeTime[1] < time): # <<<<<<<<<<<<<<
17624 * return
17625 *
17626*/
17627 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_activeTime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 532, __pyx_L1_error)
17628 __Pyx_GOTREF(__pyx_t_6);
17629 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 532, __pyx_L1_error)
17630 __Pyx_GOTREF(__pyx_t_4);
17631 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17632 __pyx_t_10 = __Pyx_PyObject_CompareBoolLt_object_object(__pyx_t_4, __pyx_v_time, Py_LT); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 532, __pyx_L1_error)
17633 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17634
17635 __pyx_t_5 = __pyx_t_10;
17636
17637 __pyx_L5_bool_binop_done:;
17638
17639 /* "Isosurface.pyx":531
17640 * log("Calculate called at time " + repr(time))
17641 * # check that gauge is in its active time region
17642 * if self.activeTime is not None and (self.activeTime[0] > time or # <<<<<<<<<<<<<<
17643 * self.activeTime[1] < time):
17644 * return
17645*/
17646 if (__pyx_t_5) {
17647
17648
17649 /* "Isosurface.pyx":533
17650 * if self.activeTime is not None and (self.activeTime[0] > time or
17651 * self.activeTime[1] < time):
17652 * return # <<<<<<<<<<<<<<
17653 *
17654 * # check that gauge is ready to be sampled again
17655*/
17656 {
17657 PyObject *__pyx_temp;
17658 {
17659 __pyx_temp = __pyx_r;
17660 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17661 }
17662 __Pyx_XDECREF(__pyx_temp);
17663 }
17664 goto __pyx_L0;
17665
17666 /* "Isosurface.pyx":531
17667 * log("Calculate called at time " + repr(time))
17668 * # check that gauge is in its active time region
17669 * if self.activeTime is not None and (self.activeTime[0] > time or # <<<<<<<<<<<<<<
17670 * self.activeTime[1] < time):
17671 * return
17672*/
17673 }
17674
17675 /* "Isosurface.pyx":536
17676 *
17677 * # check that gauge is ready to be sampled again
17678 * if (time < self.next_output): # <<<<<<<<<<<<<<
17679 * return
17680 * assert self.elementNodesArray.shape[1] == 4, \
17681*/
17682 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_next_output); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 536, __pyx_L1_error)
17683 __Pyx_GOTREF(__pyx_t_4);
17684 __pyx_t_5 = __Pyx_PyObject_CompareBoolLt_object_object(__pyx_v_time, __pyx_t_4, Py_LT); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 536, __pyx_L1_error)
17685 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17686 if (__pyx_t_5) {
17687
17688
17689 /* "Isosurface.pyx":537
17690 * # check that gauge is ready to be sampled again
17691 * if (time < self.next_output):
17692 * return # <<<<<<<<<<<<<<
17693 * assert self.elementNodesArray.shape[1] == 4, \
17694 * "Elements have {0:d} vertices but algorithm is for tets".format(
17695*/
17696 {
17697 PyObject *__pyx_temp;
17698 {
17699 __pyx_temp = __pyx_r;
17700 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17701 }
17702 __Pyx_XDECREF(__pyx_temp);
17703 }
17704 goto __pyx_L0;
17705
17706 /* "Isosurface.pyx":536
17707 *
17708 * # check that gauge is ready to be sampled again
17709 * if (time < self.next_output): # <<<<<<<<<<<<<<
17710 * return
17711 * assert self.elementNodesArray.shape[1] == 4, \
17712*/
17713 }
17714
17715 /* "Isosurface.pyx":527
17716 * """
17717 * from string import Template
17718 * if checkTime: # <<<<<<<<<<<<<<
17719 * time = self.timeIntegration.tLast
17720 * log("Calculate called at time " + repr(time))
17721*/
17722 }
17723
17724 /* "Isosurface.pyx":538
17725 * if (time < self.next_output):
17726 * return
17727 * assert self.elementNodesArray.shape[1] == 4, \ # <<<<<<<<<<<<<<
17728 * "Elements have {0:d} vertices but algorithm is for tets".format(
17729 * self.elementNodesArray.shape[1])
17730*/
17731 #ifndef CYTHON_WITHOUT_ASSERTIONS
17732 if (unlikely(__pyx_assertions_enabled())) {
17733 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_elementNodesArray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 538, __pyx_L1_error)
17734 __Pyx_GOTREF(__pyx_t_4);
17735 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 538, __pyx_L1_error)
17736 __Pyx_GOTREF(__pyx_t_6);
17737 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17738 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 538, __pyx_L1_error)
17739 __Pyx_GOTREF(__pyx_t_4);
17740 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17741 __pyx_t_5 = (__Pyx_PyLong_BoolEqObjC(__pyx_t_4, __pyx_mstate_global->__pyx_int_4, 4, 0)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 538, __pyx_L1_error)
17742 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17743 if (unlikely(!__pyx_t_5)) {
17744
17745 /* "Isosurface.pyx":539
17746 * return
17747 * assert self.elementNodesArray.shape[1] == 4, \
17748 * "Elements have {0:d} vertices but algorithm is for tets".format( # <<<<<<<<<<<<<<
17749 * self.elementNodesArray.shape[1])
17750 * for field, values in self.isosurfaces:
17751*/
17752 __pyx_t_6 = __pyx_mstate_global->__pyx_kp_u_Elements_have_0_d_vertices_but_a;
17753 __Pyx_INCREF(__pyx_t_6);
17754
17755 /* "Isosurface.pyx":540
17756 * assert self.elementNodesArray.shape[1] == 4, \
17757 * "Elements have {0:d} vertices but algorithm is for tets".format(
17758 * self.elementNodesArray.shape[1]) # <<<<<<<<<<<<<<
17759 * for field, values in self.isosurfaces:
17760 * for v in values:
17761*/
17762 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_elementNodesArray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 540, __pyx_L1_error)
17763 __Pyx_GOTREF(__pyx_t_8);
17764 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error)
17765 __Pyx_GOTREF(__pyx_t_1);
17766 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17767 __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 540, __pyx_L1_error)
17768 __Pyx_GOTREF(__pyx_t_8);
17769 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17770 __pyx_t_9 = 0;
17771 {
17772 PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_8};
17773 __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
17774 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
17775 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17776 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 539, __pyx_L1_error)
17777 __Pyx_GOTREF(__pyx_t_4);
17778 }
17779
17780 /* "Isosurface.pyx":539
17781 * return
17782 * assert self.elementNodesArray.shape[1] == 4, \
17783 * "Elements have {0:d} vertices but algorithm is for tets".format( # <<<<<<<<<<<<<<
17784 * self.elementNodesArray.shape[1])
17785 * for field, values in self.isosurfaces:
17786*/
17787 if (!(likely(PyUnicode_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_4))) __PYX_ERR(0, 539, __pyx_L1_error)
17788 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_t_4, 0, 0);
17789 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17790 __PYX_ERR(0, 538, __pyx_L1_error)
17791 }
17792
17793 }
17794 #else
17795 if ((1)); else __PYX_ERR(0, 538, __pyx_L1_error)
17796 #endif
17797
17798 /* "Isosurface.pyx":541
17799 * "Elements have {0:d} vertices but algorithm is for tets".format(
17800 * self.elementNodesArray.shape[1])
17801 * for field, values in self.isosurfaces: # <<<<<<<<<<<<<<
17802 * for v in values:
17803 * self.triangulateIsosurface(field, v)
17804*/
17805 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_isosurfaces); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error)
17806 __Pyx_GOTREF(__pyx_t_4);
17807 if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
17808 __pyx_t_8 = __pyx_t_4; __Pyx_INCREF(__pyx_t_8);
17809 __pyx_t_3 = 0;
17810 __pyx_t_11 = NULL;
17811 } else {
17812 __pyx_t_3 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 541, __pyx_L1_error)
17813 __Pyx_GOTREF(__pyx_t_8);
17814 __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 541, __pyx_L1_error)
17815 }
17816 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17817 for (;;) {
17818 if (likely(!__pyx_t_11)) {
17819 if (likely(PyList_CheckExact(__pyx_t_8))) {
17820 {
17821 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8);
17822 #if !CYTHON_ASSUME_SAFE_SIZE
17823 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 541, __pyx_L1_error)
17824 #endif
17825 if (__pyx_t_3 >= __pyx_temp) break;
17826 }
17827 __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_8, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
17828 ++__pyx_t_3;
17829 } else {
17830 {
17831 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8);
17832 #if !CYTHON_ASSUME_SAFE_SIZE
17833 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 541, __pyx_L1_error)
17834 #endif
17835 if (__pyx_t_3 >= __pyx_temp) break;
17836 }
17837 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17838 __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_3));
17839 #else
17840 __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_3);
17841 #endif
17842 ++__pyx_t_3;
17843 }
17844 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error)
17845 } else {
17846 __pyx_t_4 = __pyx_t_11(__pyx_t_8);
17847 if (unlikely(!__pyx_t_4)) {
17848 PyObject* exc_type = PyErr_Occurred();
17849 if (exc_type) {
17850 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 541, __pyx_L1_error)
17851 PyErr_Clear();
17852 }
17853 break;
17854 }
17855 }
17856 __Pyx_GOTREF(__pyx_t_4);
17857 if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
17858 PyObject* sequence = __pyx_t_4;
17859 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
17860 if (unlikely(size != 2)) {
17861 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
17862 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
17863 __PYX_ERR(0, 541, __pyx_L1_error)
17864 }
17865 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17866 if (likely(PyTuple_CheckExact(sequence))) {
17867 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
17868 __Pyx_INCREF(__pyx_t_6);
17869 __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
17870 __Pyx_INCREF(__pyx_t_1);
17871 } else {
17872 __pyx_t_6 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
17873 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 541, __pyx_L1_error)
17874 __Pyx_XGOTREF(__pyx_t_6);
17875 __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
17876 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
17877 __Pyx_XGOTREF(__pyx_t_1);
17878 }
17879 #else
17880 __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 541, __pyx_L1_error)
17881 __Pyx_GOTREF(__pyx_t_6);
17882 __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
17883 __Pyx_GOTREF(__pyx_t_1);
17884 #endif
17885 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17886 } else {
17887 Py_ssize_t index = -1;
17888 __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 541, __pyx_L1_error)
17889 __Pyx_GOTREF(__pyx_t_7);
17890 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17891 __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
17892 index = 0; __pyx_t_6 = __pyx_t_12(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L11_unpacking_failed;
17893 __Pyx_GOTREF(__pyx_t_6);
17894 index = 1; __pyx_t_1 = __pyx_t_12(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L11_unpacking_failed;
17895 __Pyx_GOTREF(__pyx_t_1);
17896 if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_7), 2) < (0)) __PYX_ERR(0, 541, __pyx_L1_error)
17897 __pyx_t_12 = NULL;
17898 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17899 goto __pyx_L12_unpacking_done;
17900 __pyx_L11_unpacking_failed:;
17901 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17902 __pyx_t_12 = NULL;
17903 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
17904 __PYX_ERR(0, 541, __pyx_L1_error)
17905 __pyx_L12_unpacking_done:;
17906 }
17907 __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_6);
17908 __pyx_t_6 = 0;
17909 __Pyx_XDECREF_SET(__pyx_v_values, __pyx_t_1);
17910 __pyx_t_1 = 0;
17911
17912 /* "Isosurface.pyx":542
17913 * self.elementNodesArray.shape[1])
17914 * for field, values in self.isosurfaces:
17915 * for v in values: # <<<<<<<<<<<<<<
17916 * self.triangulateIsosurface(field, v)
17917 * self.writeIsosurfaceMesh(field, v, self.nFrames)
17918*/
17919 if (likely(PyList_CheckExact(__pyx_v_values)) || PyTuple_CheckExact(__pyx_v_values)) {
17920 __pyx_t_4 = __pyx_v_values; __Pyx_INCREF(__pyx_t_4);
17921 __pyx_t_13 = 0;
17922 __pyx_t_14 = NULL;
17923 } else {
17924 __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_values); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L1_error)
17925 __Pyx_GOTREF(__pyx_t_4);
17926 __pyx_t_14 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 542, __pyx_L1_error)
17927 }
17928 for (;;) {
17929 if (likely(!__pyx_t_14)) {
17930 if (likely(PyList_CheckExact(__pyx_t_4))) {
17931 {
17932 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
17933 #if !CYTHON_ASSUME_SAFE_SIZE
17934 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 542, __pyx_L1_error)
17935 #endif
17936 if (__pyx_t_13 >= __pyx_temp) break;
17937 }
17938 __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_13, __Pyx_ReferenceSharing_OwnStrongReference);
17939 ++__pyx_t_13;
17940 } else {
17941 {
17942 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
17943 #if !CYTHON_ASSUME_SAFE_SIZE
17944 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 542, __pyx_L1_error)
17945 #endif
17946 if (__pyx_t_13 >= __pyx_temp) break;
17947 }
17948 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17949 __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_13));
17950 #else
17951 __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13);
17952 #endif
17953 ++__pyx_t_13;
17954 }
17955 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error)
17956 } else {
17957 __pyx_t_1 = __pyx_t_14(__pyx_t_4);
17958 if (unlikely(!__pyx_t_1)) {
17959 PyObject* exc_type = PyErr_Occurred();
17960 if (exc_type) {
17961 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 542, __pyx_L1_error)
17962 PyErr_Clear();
17963 }
17964 break;
17965 }
17966 }
17967 __Pyx_GOTREF(__pyx_t_1);
17968 __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_1);
17969 __pyx_t_1 = 0;
17970
17971 /* "Isosurface.pyx":543
17972 * for field, values in self.isosurfaces:
17973 * for v in values:
17974 * self.triangulateIsosurface(field, v) # <<<<<<<<<<<<<<
17975 * self.writeIsosurfaceMesh(field, v, self.nFrames)
17976 * self.nFrames += 1
17977*/
17978 __pyx_t_6 = __pyx_v_self;
17979 __Pyx_INCREF(__pyx_t_6);
17980 __pyx_t_9 = 0;
17981 {
17982 PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_field, __pyx_v_v};
17983 __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_triangulateIsosurface, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
17984 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
17985 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error)
17986 __Pyx_GOTREF(__pyx_t_1);
17987 }
17988 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17989
17990 /* "Isosurface.pyx":544
17991 * for v in values:
17992 * self.triangulateIsosurface(field, v)
17993 * self.writeIsosurfaceMesh(field, v, self.nFrames) # <<<<<<<<<<<<<<
17994 * self.nFrames += 1
17995 * if checkTime and time != 0:
17996*/
17997 __pyx_t_6 = __pyx_v_self;
17998 __Pyx_INCREF(__pyx_t_6);
17999 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nFrames); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 544, __pyx_L1_error)
18000 __Pyx_GOTREF(__pyx_t_7);
18001 __pyx_t_9 = 0;
18002 {
18003 PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_v_field, __pyx_v_v, __pyx_t_7};
18004 __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_writeIsosurfaceMesh, __pyx_callargs+__pyx_t_9, (4-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
18005 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
18006 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18007 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error)
18008 __Pyx_GOTREF(__pyx_t_1);
18009 }
18010 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18011
18012 /* "Isosurface.pyx":542
18013 * self.elementNodesArray.shape[1])
18014 * for field, values in self.isosurfaces:
18015 * for v in values: # <<<<<<<<<<<<<<
18016 * self.triangulateIsosurface(field, v)
18017 * self.writeIsosurfaceMesh(field, v, self.nFrames)
18018*/
18019 }
18020 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18021
18022 /* "Isosurface.pyx":541
18023 * "Elements have {0:d} vertices but algorithm is for tets".format(
18024 * self.elementNodesArray.shape[1])
18025 * for field, values in self.isosurfaces: # <<<<<<<<<<<<<<
18026 * for v in values:
18027 * self.triangulateIsosurface(field, v)
18028*/
18029 }
18030 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18031
18032 /* "Isosurface.pyx":545
18033 * self.triangulateIsosurface(field, v)
18034 * self.writeIsosurfaceMesh(field, v, self.nFrames)
18035 * self.nFrames += 1 # <<<<<<<<<<<<<<
18036 * if checkTime and time != 0:
18037 * self.next_output += self.sampleRate
18038*/
18039 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nFrames); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 545, __pyx_L1_error)
18040 __Pyx_GOTREF(__pyx_t_8);
18041 __pyx_t_4 = __Pyx_PyLong_AddObjC(__pyx_t_8, __pyx_mstate_global->__pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 545, __pyx_L1_error)
18042 __Pyx_GOTREF(__pyx_t_4);
18043 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18044 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_nFrames, __pyx_t_4) < (0)) __PYX_ERR(0, 545, __pyx_L1_error)
18045 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18046
18047 /* "Isosurface.pyx":546
18048 * self.writeIsosurfaceMesh(field, v, self.nFrames)
18049 * self.nFrames += 1
18050 * if checkTime and time != 0: # <<<<<<<<<<<<<<
18051 * self.next_output += self.sampleRate
18052 *
18053*/
18054 __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_checkTime); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 546, __pyx_L1_error)
18055 if (__pyx_t_10) {
18056
18057 } else {
18058
18059 __pyx_t_5 = __pyx_t_10;
18060
18061 goto __pyx_L18_bool_binop_done;
18062 }
18063 if (unlikely(!__pyx_v_time)) { __Pyx_RaiseUnboundLocalError("time"); __PYX_ERR(0, 546, __pyx_L1_error) }
18064 __pyx_t_10 = (__Pyx_PyLong_BoolNeObjC(__pyx_v_time, __pyx_mstate_global->__pyx_int_0, 0, 0)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 546, __pyx_L1_error)
18065
18066 __pyx_t_5 = __pyx_t_10;
18067
18068 __pyx_L18_bool_binop_done:;
18069 if (__pyx_t_5) {
18070
18071
18072 /* "Isosurface.pyx":547
18073 * self.nFrames += 1
18074 * if checkTime and time != 0:
18075 * self.next_output += self.sampleRate # <<<<<<<<<<<<<<
18076 *
18077 * def writeSceneHeader(self, cam = None):
18078*/
18079 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_next_output); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error)
18080 __Pyx_GOTREF(__pyx_t_4);
18081 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_sampleRate); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 547, __pyx_L1_error)
18082 __Pyx_GOTREF(__pyx_t_8);
18083 __pyx_t_1 = __Pyx_PyNumber_InPlaceAdd_object_object(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
18084 __Pyx_GOTREF(__pyx_t_1);
18085 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18086 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18087 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_next_output, __pyx_t_1) < (0)) __PYX_ERR(0, 547, __pyx_L1_error)
18088 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18089
18090 /* "Isosurface.pyx":546
18091 * self.writeIsosurfaceMesh(field, v, self.nFrames)
18092 * self.nFrames += 1
18093 * if checkTime and time != 0: # <<<<<<<<<<<<<<
18094 * self.next_output += self.sampleRate
18095 *
18096*/
18097 }
18098
18099 /* "Isosurface.pyx":523
18100 * self.comm.endSequential()
18101 *
18102 * def calculate(self, checkTime=True): # <<<<<<<<<<<<<<
18103 * """Extracts isosourfaces at current time and update open output files
18104 * """
18105*/
18106
18107 /* function exit code */
18108 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18109 goto __pyx_L0;
18110 __pyx_L1_error:;
18111 __Pyx_XDECREF(__pyx_t_1);
18112 __Pyx_XDECREF(__pyx_t_4);
18113 __Pyx_XDECREF(__pyx_t_6);
18114 __Pyx_XDECREF(__pyx_t_7);
18115 __Pyx_XDECREF(__pyx_t_8);
18116 __Pyx_AddTraceback("Isosurface.Isosurface.calculate", __pyx_clineno, __pyx_lineno, __pyx_filename);
18117 __pyx_r = NULL;
18118 __pyx_L0:;
18119 __Pyx_XDECREF(__pyx_v_Template);
18120 __Pyx_XDECREF(__pyx_v_time);
18121 __Pyx_XDECREF(__pyx_v_field);
18122 __Pyx_XDECREF(__pyx_v_values);
18123 __Pyx_XDECREF(__pyx_v_v);
18124 __Pyx_XGIVEREF(__pyx_r);
18125 __Pyx_RefNannyFinishContext();
18126 return __pyx_r;
18127}
18128
18129/* "Isosurface.pyx":549
18130 * self.next_output += self.sampleRate
18131 *
18132 * def writeSceneHeader(self, cam = None): # <<<<<<<<<<<<<<
18133 * """
18134 * Write a scene description (can be modified before running povray)
18135*/
18136
18137/* Python wrapper */
18138static PyObject *__pyx_pw_10Isosurface_10Isosurface_17writeSceneHeader(PyObject *__pyx_self,
18139#if CYTHON_VECTORCALL
18140PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
18141#else
18142PyObject *__pyx_args, PyObject *__pyx_kwds
18143#endif
18144); /*proto*/
18145PyDoc_STRVAR(__pyx_doc_10Isosurface_10Isosurface_16writeSceneHeader, "Isosurface.writeSceneHeader(self, cam=None)\n\nWrite a scene description (can be modified before running povray)");
18146static PyMethodDef __pyx_mdef_10Isosurface_10Isosurface_17writeSceneHeader = {"writeSceneHeader", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10Isosurface_10Isosurface_17writeSceneHeader, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10Isosurface_10Isosurface_16writeSceneHeader};
18147static PyObject *__pyx_pw_10Isosurface_10Isosurface_17writeSceneHeader(PyObject *__pyx_self,
18148#if CYTHON_VECTORCALL
18149PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
18150#else
18151PyObject *__pyx_args, PyObject *__pyx_kwds
18152#endif
18153) {
18154 PyObject *__pyx_v_self = 0;
18155 PyObject *__pyx_v_cam = 0;
18156 #if !CYTHON_VECTORCALL
18157 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
18158 #endif
18159 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
18160 PyObject* values[2] = {0,0};
18161 int __pyx_lineno = 0;
18162 const char *__pyx_filename = NULL;
18163 int __pyx_clineno = 0;
18164 PyObject *__pyx_r = 0;
18165 __Pyx_RefNannyDeclarations
18166 __Pyx_RefNannySetupContext("writeSceneHeader (wrapper)", 0);
18167 #if !CYTHON_VECTORCALL
18168 #if CYTHON_ASSUME_SAFE_SIZE
18169 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
18170 #else
18171 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
18172 #endif
18173 #endif
18174 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
18175 {
18176 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_cam,0};
18177 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
18178 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 549, __pyx_L3_error)
18179 if (__pyx_kwds_len > 0) {
18180 switch (__pyx_nargs) {
18181 case 2:
18182 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
18183 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 549, __pyx_L3_error)
18184 CYTHON_FALLTHROUGH;
18185 case 1:
18186 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
18187 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 549, __pyx_L3_error)
18188 CYTHON_FALLTHROUGH;
18189 case 0: break;
18190 default: goto __pyx_L5_argtuple_error;
18191 }
18192 const Py_ssize_t kwd_pos_args = __pyx_nargs;
18193 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "writeSceneHeader", 0) < (0)) __PYX_ERR(0, 549, __pyx_L3_error)
18194 if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
18195 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
18196 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("writeSceneHeader", 0, 1, 2, i); __PYX_ERR(0, 549, __pyx_L3_error) }
18197 }
18198 } else {
18199 switch (__pyx_nargs) {
18200 case 2:
18201 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
18202 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 549, __pyx_L3_error)
18203 CYTHON_FALLTHROUGH;
18204 case 1:
18205 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
18206 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 549, __pyx_L3_error)
18207 break;
18208 default: goto __pyx_L5_argtuple_error;
18209 }
18210 if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
18211 }
18212 __pyx_v_self = values[0];
18213 __pyx_v_cam = values[1];
18214 }
18215 goto __pyx_L6_skip;
18216 __pyx_L5_argtuple_error:;
18217 __Pyx_RaiseArgtupleInvalid("writeSceneHeader", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 549, __pyx_L3_error)
18218 __pyx_L6_skip:;
18219 goto __pyx_L4_argument_unpacking_done;
18220 __pyx_L3_error:;
18221 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
18222 Py_XDECREF(values[__pyx_temp]);
18223 }
18224 __Pyx_AddTraceback("Isosurface.Isosurface.writeSceneHeader", __pyx_clineno, __pyx_lineno, __pyx_filename);
18225 __Pyx_RefNannyFinishContext();
18226 return NULL;
18227 __pyx_L4_argument_unpacking_done:;
18228 __pyx_r = __pyx_pf_10Isosurface_10Isosurface_16writeSceneHeader(__pyx_self, __pyx_v_self, __pyx_v_cam);
18229
18230 /* function exit code */
18231 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
18232 Py_XDECREF(values[__pyx_temp]);
18233 }
18234 __Pyx_RefNannyFinishContext();
18235 return __pyx_r;
18236}
18237
18238static PyObject *__pyx_pf_10Isosurface_10Isosurface_16writeSceneHeader(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cam) {
18239 PyObject *__pyx_v_Template = NULL;
18240 PyObject *__pyx_v_look_at = NULL;
18241 PyObject *__pyx_v_light = NULL;
18242 PyObject *__pyx_v_light_dx = NULL;
18243 PyObject *__pyx_v_light_dy = NULL;
18244 PyObject *__pyx_v_floor_z = NULL;
18245 PyObject *__pyx_v_wall_y = NULL;
18246 PyObject *__pyx_v_sky_z = NULL;
18247 PyObject *__pyx_v_pov = NULL;
18248 PyObject *__pyx_v_povSceneTemplate = NULL;
18249 PyObject *__pyx_9genexpr10__pyx_v_x = NULL;
18250 PyObject *__pyx_9genexpr10__pyx_v_L = NULL;
18251 PyObject *__pyx_9genexpr11__pyx_v_x = NULL;
18252 PyObject *__pyx_9genexpr11__pyx_v_L = NULL;
18253 PyObject *__pyx_r = NULL;
18254 __Pyx_RefNannyDeclarations
18255 PyObject *__pyx_t_1 = NULL;
18256 PyObject *__pyx_t_2 = NULL;
18257 Py_ssize_t __pyx_t_3;
18258 PyObject *__pyx_t_4 = NULL;
18259 PyObject *__pyx_t_5 = NULL;
18260 size_t __pyx_t_6;
18261 int __pyx_t_7;
18262 PyObject *__pyx_t_8 = NULL;
18263 PyObject *__pyx_t_9 = NULL;
18264 PyObject *__pyx_t_10 = NULL;
18265 PyObject *(*__pyx_t_11)(PyObject *);
18266 PyObject *(*__pyx_t_12)(PyObject *);
18267 PyObject *__pyx_t_13 = NULL;
18268 PyObject *__pyx_t_14 = NULL;
18269 PyObject *__pyx_t_15 = NULL;
18270 PyObject *__pyx_t_16 = NULL;
18271 PyObject *__pyx_t_17 = NULL;
18272 PyObject *__pyx_t_18 = NULL;
18273 PyObject *__pyx_t_19 = NULL;
18274 PyObject *__pyx_t_20 = NULL;
18275 int __pyx_lineno = 0;
18276 const char *__pyx_filename = NULL;
18277 int __pyx_clineno = 0;
18278 __Pyx_RefNannySetupContext("writeSceneHeader", 0);
18279 __Pyx_INCREF(__pyx_v_cam);
18280
18281 /* "Isosurface.pyx":553
18282 * Write a scene description (can be modified before running povray)
18283 * """
18284 * from string import Template # <<<<<<<<<<<<<<
18285 * if self.comm.isMaster():
18286 * look_at = [0.5 * (x + L)
18287*/
18288 {
18289 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Template};
18290 __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_string, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 553, __pyx_L1_error)
18291 }
18292 __pyx_t_1 = __pyx_t_2;
18293 __Pyx_GOTREF(__pyx_t_1);
18294 {
18295 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Template};
18296 __pyx_t_3 = 0; {
18297 __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_1, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error)
18298 __Pyx_GOTREF(__pyx_t_4);
18299 switch (__pyx_t_3) {
18300 case 0:
18301 __Pyx_INCREF(__pyx_t_4);
18302 __pyx_v_Template = __pyx_t_4;
18303 break;
18304 default:;
18305 }
18306 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18307 }
18308 }
18309 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18310
18311 /* "Isosurface.pyx":554
18312 * """
18313 * from string import Template
18314 * if self.comm.isMaster(): # <<<<<<<<<<<<<<
18315 * look_at = [0.5 * (x + L)
18316 * for x, L in zip(self.domain.x, self.domain.L)]
18317*/
18318 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_comm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 554, __pyx_L1_error)
18319 __Pyx_GOTREF(__pyx_t_5);
18320 __pyx_t_4 = __pyx_t_5;
18321 __Pyx_INCREF(__pyx_t_4);
18322 __pyx_t_6 = 0;
18323 {
18324 PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
18325 __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_isMaster, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
18326 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
18327 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18328 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error)
18329 __Pyx_GOTREF(__pyx_t_1);
18330 }
18331 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 554, __pyx_L1_error)
18332 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18333 if (__pyx_t_7) {
18334
18335
18336 /* "Isosurface.pyx":555
18337 * from string import Template
18338 * if self.comm.isMaster():
18339 * look_at = [0.5 * (x + L) # <<<<<<<<<<<<<<
18340 * for x, L in zip(self.domain.x, self.domain.L)]
18341 * if cam is None:
18342*/
18343 { /* enter inner scope */
18344 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 555, __pyx_L6_error)
18345 __Pyx_GOTREF(__pyx_t_1);
18346
18347 /* "Isosurface.pyx":556
18348 * if self.comm.isMaster():
18349 * look_at = [0.5 * (x + L)
18350 * for x, L in zip(self.domain.x, self.domain.L)] # <<<<<<<<<<<<<<
18351 * if cam is None:
18352 * cam = [0.5*(self.domain.x[0] + self.domain.L[0]),
18353*/
18354 __pyx_t_4 = NULL;
18355 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 556, __pyx_L6_error)
18356 __Pyx_GOTREF(__pyx_t_8);
18357 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 556, __pyx_L6_error)
18358 __Pyx_GOTREF(__pyx_t_9);
18359 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18360 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 556, __pyx_L6_error)
18361 __Pyx_GOTREF(__pyx_t_8);
18362 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_L); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 556, __pyx_L6_error)
18363 __Pyx_GOTREF(__pyx_t_10);
18364 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18365 __pyx_t_6 = 1;
18366 {
18367 PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_9, __pyx_t_10};
18368 __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
18369 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
18370 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18371 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
18372 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 556, __pyx_L6_error)
18373 __Pyx_GOTREF(__pyx_t_5);
18374 }
18375 if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
18376 __pyx_t_10 = __pyx_t_5; __Pyx_INCREF(__pyx_t_10);
18377 __pyx_t_3 = 0;
18378 __pyx_t_11 = NULL;
18379 } else {
18380 __pyx_t_3 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 556, __pyx_L6_error)
18381 __Pyx_GOTREF(__pyx_t_10);
18382 __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 556, __pyx_L6_error)
18383 }
18384 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18385 for (;;) {
18386 if (likely(!__pyx_t_11)) {
18387 if (likely(PyList_CheckExact(__pyx_t_10))) {
18388 {
18389 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10);
18390 #if !CYTHON_ASSUME_SAFE_SIZE
18391 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 556, __pyx_L6_error)
18392 #endif
18393 if (__pyx_t_3 >= __pyx_temp) break;
18394 }
18395 __pyx_t_5 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_10, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
18396 ++__pyx_t_3;
18397 } else {
18398 {
18399 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_10);
18400 #if !CYTHON_ASSUME_SAFE_SIZE
18401 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 556, __pyx_L6_error)
18402 #endif
18403 if (__pyx_t_3 >= __pyx_temp) break;
18404 }
18405 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18406 __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_3));
18407 #else
18408 __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_3);
18409 #endif
18410 ++__pyx_t_3;
18411 }
18412 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 556, __pyx_L6_error)
18413 } else {
18414 __pyx_t_5 = __pyx_t_11(__pyx_t_10);
18415 if (unlikely(!__pyx_t_5)) {
18416 PyObject* exc_type = PyErr_Occurred();
18417 if (exc_type) {
18418 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 556, __pyx_L6_error)
18419 PyErr_Clear();
18420 }
18421 break;
18422 }
18423 }
18424 __Pyx_GOTREF(__pyx_t_5);
18425 if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
18426 PyObject* sequence = __pyx_t_5;
18427 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
18428 if (unlikely(size != 2)) {
18429 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
18430 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
18431 __PYX_ERR(0, 556, __pyx_L6_error)
18432 }
18433 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18434 if (likely(PyTuple_CheckExact(sequence))) {
18435 __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0);
18436 __Pyx_INCREF(__pyx_t_9);
18437 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
18438 __Pyx_INCREF(__pyx_t_4);
18439 } else {
18440 __pyx_t_9 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
18441 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 556, __pyx_L6_error)
18442 __Pyx_XGOTREF(__pyx_t_9);
18443 __pyx_t_4 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
18444 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 556, __pyx_L6_error)
18445 __Pyx_XGOTREF(__pyx_t_4);
18446 }
18447 #else
18448 __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 556, __pyx_L6_error)
18449 __Pyx_GOTREF(__pyx_t_9);
18450 __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 556, __pyx_L6_error)
18451 __Pyx_GOTREF(__pyx_t_4);
18452 #endif
18453 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18454 } else {
18455 Py_ssize_t index = -1;
18456 __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 556, __pyx_L6_error)
18457 __Pyx_GOTREF(__pyx_t_8);
18458 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18459 __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
18460 index = 0; __pyx_t_9 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_9)) goto __pyx_L9_unpacking_failed;
18461 __Pyx_GOTREF(__pyx_t_9);
18462 index = 1; __pyx_t_4 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L9_unpacking_failed;
18463 __Pyx_GOTREF(__pyx_t_4);
18464 if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_8), 2) < (0)) __PYX_ERR(0, 556, __pyx_L6_error)
18465 __pyx_t_12 = NULL;
18466 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18467 goto __pyx_L10_unpacking_done;
18468 __pyx_L9_unpacking_failed:;
18469 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18470 __pyx_t_12 = NULL;
18471 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
18472 __PYX_ERR(0, 556, __pyx_L6_error)
18473 __pyx_L10_unpacking_done:;
18474 }
18475 __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_x, __pyx_t_9);
18476 __pyx_t_9 = 0;
18477 __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_L, __pyx_t_4);
18478 __pyx_t_4 = 0;
18479
18480 /* "Isosurface.pyx":555
18481 * from string import Template
18482 * if self.comm.isMaster():
18483 * look_at = [0.5 * (x + L) # <<<<<<<<<<<<<<
18484 * for x, L in zip(self.domain.x, self.domain.L)]
18485 * if cam is None:
18486*/
18487 __pyx_t_5 = __Pyx_PyNumber_Add_object_object(__pyx_9genexpr10__pyx_v_x, __pyx_9genexpr10__pyx_v_L); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 555, __pyx_L6_error)
18488 __Pyx_GOTREF(__pyx_t_5);
18489 __pyx_t_4 = __Pyx_PyNumber_Multiply_float_object(__pyx_mstate_global->__pyx_float_0_5, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 555, __pyx_L6_error)
18490 __Pyx_GOTREF(__pyx_t_4);
18491 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18492 __Pyx_GIVEREF(__pyx_t_4);
18493 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_1, __pyx_t_4))) __PYX_ERR(0, 555, __pyx_L6_error)
18494 __pyx_t_4 = 0;
18495
18496 /* "Isosurface.pyx":556
18497 * if self.comm.isMaster():
18498 * look_at = [0.5 * (x + L)
18499 * for x, L in zip(self.domain.x, self.domain.L)] # <<<<<<<<<<<<<<
18500 * if cam is None:
18501 * cam = [0.5*(self.domain.x[0] + self.domain.L[0]),
18502*/
18503 }
18504 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
18505 __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_L); __pyx_9genexpr10__pyx_v_L = 0;
18506 __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_x); __pyx_9genexpr10__pyx_v_x = 0;
18507 goto __pyx_L12_exit_scope;
18508 __pyx_L6_error:;
18509 __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_L); __pyx_9genexpr10__pyx_v_L = 0;
18510 __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_x); __pyx_9genexpr10__pyx_v_x = 0;
18511 goto __pyx_L1_error;
18512 __pyx_L12_exit_scope:;
18513 } /* exit inner scope */
18514 __pyx_v_look_at = ((PyObject*)__pyx_t_1);
18515 __pyx_t_1 = 0;
18516
18517 /* "Isosurface.pyx":557
18518 * look_at = [0.5 * (x + L)
18519 * for x, L in zip(self.domain.x, self.domain.L)]
18520 * if cam is None: # <<<<<<<<<<<<<<
18521 * cam = [0.5*(self.domain.x[0] + self.domain.L[0]),
18522 * self.domain.x[1] - 2*self.domain.L[1],
18523*/
18524 __pyx_t_7 = (__pyx_v_cam == Py_None);
18525 if (__pyx_t_7) {
18526
18527
18528 /* "Isosurface.pyx":558
18529 * for x, L in zip(self.domain.x, self.domain.L)]
18530 * if cam is None:
18531 * cam = [0.5*(self.domain.x[0] + self.domain.L[0]), # <<<<<<<<<<<<<<
18532 * self.domain.x[1] - 2*self.domain.L[1],
18533 * self.domain.x[2] + 0.85*(self.domain.L[2] + self.domain.x[2])]
18534*/
18535 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error)
18536 __Pyx_GOTREF(__pyx_t_1);
18537 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 558, __pyx_L1_error)
18538 __Pyx_GOTREF(__pyx_t_10);
18539 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18540 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error)
18541 __Pyx_GOTREF(__pyx_t_1);
18542 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
18543 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 558, __pyx_L1_error)
18544 __Pyx_GOTREF(__pyx_t_10);
18545 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_L); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 558, __pyx_L1_error)
18546 __Pyx_GOTREF(__pyx_t_4);
18547 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
18548 __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 558, __pyx_L1_error)
18549 __Pyx_GOTREF(__pyx_t_10);
18550 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18551 __pyx_t_4 = __Pyx_PyNumber_Add_object_object(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 558, __pyx_L1_error)
18552 __Pyx_GOTREF(__pyx_t_4);
18553 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18554 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
18555 __pyx_t_10 = __Pyx_PyNumber_Multiply_float_object(__pyx_mstate_global->__pyx_float_0_5, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 558, __pyx_L1_error)
18556 __Pyx_GOTREF(__pyx_t_10);
18557 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18558
18559 /* "Isosurface.pyx":559
18560 * if cam is None:
18561 * cam = [0.5*(self.domain.x[0] + self.domain.L[0]),
18562 * self.domain.x[1] - 2*self.domain.L[1], # <<<<<<<<<<<<<<
18563 * self.domain.x[2] + 0.85*(self.domain.L[2] + self.domain.x[2])]
18564 * light = [0.5 * (x + L)
18565*/
18566 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 559, __pyx_L1_error)
18567 __Pyx_GOTREF(__pyx_t_4);
18568 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
18569 __Pyx_GOTREF(__pyx_t_1);
18570 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18571 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 559, __pyx_L1_error)
18572 __Pyx_GOTREF(__pyx_t_4);
18573 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18574 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
18575 __Pyx_GOTREF(__pyx_t_1);
18576 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_L); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 559, __pyx_L1_error)
18577 __Pyx_GOTREF(__pyx_t_5);
18578 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18579 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
18580 __Pyx_GOTREF(__pyx_t_1);
18581 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18582 __pyx_t_5 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_2, __pyx_t_1, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 559, __pyx_L1_error)
18583 __Pyx_GOTREF(__pyx_t_5);
18584 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18585 __pyx_t_1 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
18586 __Pyx_GOTREF(__pyx_t_1);
18587 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18588 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18589
18590 /* "Isosurface.pyx":560
18591 * cam = [0.5*(self.domain.x[0] + self.domain.L[0]),
18592 * self.domain.x[1] - 2*self.domain.L[1],
18593 * self.domain.x[2] + 0.85*(self.domain.L[2] + self.domain.x[2])] # <<<<<<<<<<<<<<
18594 * light = [0.5 * (x + L)
18595 * for x, L in zip(self.domain.x, self.domain.L)]
18596*/
18597 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 560, __pyx_L1_error)
18598 __Pyx_GOTREF(__pyx_t_5);
18599 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 560, __pyx_L1_error)
18600 __Pyx_GOTREF(__pyx_t_4);
18601 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18602 __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 560, __pyx_L1_error)
18603 __Pyx_GOTREF(__pyx_t_5);
18604 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18605 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 560, __pyx_L1_error)
18606 __Pyx_GOTREF(__pyx_t_4);
18607 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_L); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 560, __pyx_L1_error)
18608 __Pyx_GOTREF(__pyx_t_9);
18609 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18610 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_9, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 560, __pyx_L1_error)
18611 __Pyx_GOTREF(__pyx_t_4);
18612 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18613 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 560, __pyx_L1_error)
18614 __Pyx_GOTREF(__pyx_t_9);
18615 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 560, __pyx_L1_error)
18616 __Pyx_GOTREF(__pyx_t_8);
18617 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18618 __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 560, __pyx_L1_error)
18619 __Pyx_GOTREF(__pyx_t_9);
18620 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18621 __pyx_t_8 = __Pyx_PyNumber_Add_object_object(__pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 560, __pyx_L1_error)
18622 __Pyx_GOTREF(__pyx_t_8);
18623 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18624 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18625 __pyx_t_9 = __Pyx_PyNumber_Multiply_float_object(__pyx_mstate_global->__pyx_float_0_85, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 560, __pyx_L1_error)
18626 __Pyx_GOTREF(__pyx_t_9);
18627 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18628 __pyx_t_8 = __Pyx_PyNumber_Add_object_object(__pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 560, __pyx_L1_error)
18629 __Pyx_GOTREF(__pyx_t_8);
18630 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18631 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18632
18633 /* "Isosurface.pyx":558
18634 * for x, L in zip(self.domain.x, self.domain.L)]
18635 * if cam is None:
18636 * cam = [0.5*(self.domain.x[0] + self.domain.L[0]), # <<<<<<<<<<<<<<
18637 * self.domain.x[1] - 2*self.domain.L[1],
18638 * self.domain.x[2] + 0.85*(self.domain.L[2] + self.domain.x[2])]
18639*/
18640 __pyx_t_9 = PyList_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 558, __pyx_L1_error)
18641 __Pyx_GOTREF(__pyx_t_9);
18642 __Pyx_GIVEREF(__pyx_t_10);
18643 if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_10) != (0)) __PYX_ERR(0, 558, __pyx_L1_error);
18644 __Pyx_GIVEREF(__pyx_t_1);
18645 if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 558, __pyx_L1_error);
18646 __Pyx_GIVEREF(__pyx_t_8);
18647 if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 2, __pyx_t_8) != (0)) __PYX_ERR(0, 558, __pyx_L1_error);
18648 __pyx_t_10 = 0;
18649 __pyx_t_1 = 0;
18650 __pyx_t_8 = 0;
18651 __Pyx_DECREF_SET(__pyx_v_cam, __pyx_t_9);
18652 __pyx_t_9 = 0;
18653
18654 /* "Isosurface.pyx":557
18655 * look_at = [0.5 * (x + L)
18656 * for x, L in zip(self.domain.x, self.domain.L)]
18657 * if cam is None: # <<<<<<<<<<<<<<
18658 * cam = [0.5*(self.domain.x[0] + self.domain.L[0]),
18659 * self.domain.x[1] - 2*self.domain.L[1],
18660*/
18661 }
18662
18663 /* "Isosurface.pyx":561
18664 * self.domain.x[1] - 2*self.domain.L[1],
18665 * self.domain.x[2] + 0.85*(self.domain.L[2] + self.domain.x[2])]
18666 * light = [0.5 * (x + L) # <<<<<<<<<<<<<<
18667 * for x, L in zip(self.domain.x, self.domain.L)]
18668 * light[2] = self.domain.x[2] + 5 * self.domain.L[2]
18669*/
18670 { /* enter inner scope */
18671 __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 561, __pyx_L16_error)
18672 __Pyx_GOTREF(__pyx_t_9);
18673
18674 /* "Isosurface.pyx":562
18675 * self.domain.x[2] + 0.85*(self.domain.L[2] + self.domain.x[2])]
18676 * light = [0.5 * (x + L)
18677 * for x, L in zip(self.domain.x, self.domain.L)] # <<<<<<<<<<<<<<
18678 * light[2] = self.domain.x[2] + 5 * self.domain.L[2]
18679 * light_dx, light_dy = (self.domain.x[0] - light[0],
18680*/
18681 __pyx_t_1 = NULL;
18682 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 562, __pyx_L16_error)
18683 __Pyx_GOTREF(__pyx_t_10);
18684 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 562, __pyx_L16_error)
18685 __Pyx_GOTREF(__pyx_t_5);
18686 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
18687 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 562, __pyx_L16_error)
18688 __Pyx_GOTREF(__pyx_t_10);
18689 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_L); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 562, __pyx_L16_error)
18690 __Pyx_GOTREF(__pyx_t_4);
18691 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
18692 __pyx_t_6 = 1;
18693 {
18694 PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_5, __pyx_t_4};
18695 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_zip, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
18696 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
18697 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18698 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18699 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 562, __pyx_L16_error)
18700 __Pyx_GOTREF(__pyx_t_8);
18701 }
18702 if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
18703 __pyx_t_4 = __pyx_t_8; __Pyx_INCREF(__pyx_t_4);
18704 __pyx_t_3 = 0;
18705 __pyx_t_11 = NULL;
18706 } else {
18707 __pyx_t_3 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 562, __pyx_L16_error)
18708 __Pyx_GOTREF(__pyx_t_4);
18709 __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 562, __pyx_L16_error)
18710 }
18711 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18712 for (;;) {
18713 if (likely(!__pyx_t_11)) {
18714 if (likely(PyList_CheckExact(__pyx_t_4))) {
18715 {
18716 Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
18717 #if !CYTHON_ASSUME_SAFE_SIZE
18718 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 562, __pyx_L16_error)
18719 #endif
18720 if (__pyx_t_3 >= __pyx_temp) break;
18721 }
18722 __pyx_t_8 = __Pyx_PyList_GET_ITEM_REF(__pyx_t_4, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
18723 ++__pyx_t_3;
18724 } else {
18725 {
18726 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
18727 #if !CYTHON_ASSUME_SAFE_SIZE
18728 if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 562, __pyx_L16_error)
18729 #endif
18730 if (__pyx_t_3 >= __pyx_temp) break;
18731 }
18732 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18733 __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_3));
18734 #else
18735 __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_3);
18736 #endif
18737 ++__pyx_t_3;
18738 }
18739 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 562, __pyx_L16_error)
18740 } else {
18741 __pyx_t_8 = __pyx_t_11(__pyx_t_4);
18742 if (unlikely(!__pyx_t_8)) {
18743 PyObject* exc_type = PyErr_Occurred();
18744 if (exc_type) {
18745 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 562, __pyx_L16_error)
18746 PyErr_Clear();
18747 }
18748 break;
18749 }
18750 }
18751 __Pyx_GOTREF(__pyx_t_8);
18752 if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
18753 PyObject* sequence = __pyx_t_8;
18754 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
18755 if (unlikely(size != 2)) {
18756 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
18757 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
18758 __PYX_ERR(0, 562, __pyx_L16_error)
18759 }
18760 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18761 if (likely(PyTuple_CheckExact(sequence))) {
18762 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
18763 __Pyx_INCREF(__pyx_t_5);
18764 __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
18765 __Pyx_INCREF(__pyx_t_1);
18766 } else {
18767 __pyx_t_5 = __Pyx_PyList_GET_ITEM_REF(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
18768 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 562, __pyx_L16_error)
18769 __Pyx_XGOTREF(__pyx_t_5);
18770 __pyx_t_1 = __Pyx_PyList_GET_ITEM_REF(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
18771 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L16_error)
18772 __Pyx_XGOTREF(__pyx_t_1);
18773 }
18774 #else
18775 __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 562, __pyx_L16_error)
18776 __Pyx_GOTREF(__pyx_t_5);
18777 __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L16_error)
18778 __Pyx_GOTREF(__pyx_t_1);
18779 #endif
18780 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18781 } else {
18782 Py_ssize_t index = -1;
18783 __pyx_t_10 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 562, __pyx_L16_error)
18784 __Pyx_GOTREF(__pyx_t_10);
18785 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18786 __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10);
18787 index = 0; __pyx_t_5 = __pyx_t_12(__pyx_t_10); if (unlikely(!__pyx_t_5)) goto __pyx_L19_unpacking_failed;
18788 __Pyx_GOTREF(__pyx_t_5);
18789 index = 1; __pyx_t_1 = __pyx_t_12(__pyx_t_10); if (unlikely(!__pyx_t_1)) goto __pyx_L19_unpacking_failed;
18790 __Pyx_GOTREF(__pyx_t_1);
18791 if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_10), 2) < (0)) __PYX_ERR(0, 562, __pyx_L16_error)
18792 __pyx_t_12 = NULL;
18793 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
18794 goto __pyx_L20_unpacking_done;
18795 __pyx_L19_unpacking_failed:;
18796 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
18797 __pyx_t_12 = NULL;
18798 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
18799 __PYX_ERR(0, 562, __pyx_L16_error)
18800 __pyx_L20_unpacking_done:;
18801 }
18802 __Pyx_XDECREF_SET(__pyx_9genexpr11__pyx_v_x, __pyx_t_5);
18803 __pyx_t_5 = 0;
18804 __Pyx_XDECREF_SET(__pyx_9genexpr11__pyx_v_L, __pyx_t_1);
18805 __pyx_t_1 = 0;
18806
18807 /* "Isosurface.pyx":561
18808 * self.domain.x[1] - 2*self.domain.L[1],
18809 * self.domain.x[2] + 0.85*(self.domain.L[2] + self.domain.x[2])]
18810 * light = [0.5 * (x + L) # <<<<<<<<<<<<<<
18811 * for x, L in zip(self.domain.x, self.domain.L)]
18812 * light[2] = self.domain.x[2] + 5 * self.domain.L[2]
18813*/
18814 __pyx_t_8 = __Pyx_PyNumber_Add_object_object(__pyx_9genexpr11__pyx_v_x, __pyx_9genexpr11__pyx_v_L); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 561, __pyx_L16_error)
18815 __Pyx_GOTREF(__pyx_t_8);
18816 __pyx_t_1 = __Pyx_PyNumber_Multiply_float_object(__pyx_mstate_global->__pyx_float_0_5, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L16_error)
18817 __Pyx_GOTREF(__pyx_t_1);
18818 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18819 __Pyx_GIVEREF(__pyx_t_1);
18820 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_9, __pyx_t_1))) __PYX_ERR(0, 561, __pyx_L16_error)
18821 __pyx_t_1 = 0;
18822
18823 /* "Isosurface.pyx":562
18824 * self.domain.x[2] + 0.85*(self.domain.L[2] + self.domain.x[2])]
18825 * light = [0.5 * (x + L)
18826 * for x, L in zip(self.domain.x, self.domain.L)] # <<<<<<<<<<<<<<
18827 * light[2] = self.domain.x[2] + 5 * self.domain.L[2]
18828 * light_dx, light_dy = (self.domain.x[0] - light[0],
18829*/
18830 }
18831 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18832 __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_L); __pyx_9genexpr11__pyx_v_L = 0;
18833 __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_x); __pyx_9genexpr11__pyx_v_x = 0;
18834 goto __pyx_L22_exit_scope;
18835 __pyx_L16_error:;
18836 __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_L); __pyx_9genexpr11__pyx_v_L = 0;
18837 __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_x); __pyx_9genexpr11__pyx_v_x = 0;
18838 goto __pyx_L1_error;
18839 __pyx_L22_exit_scope:;
18840 } /* exit inner scope */
18841 __pyx_v_light = ((PyObject*)__pyx_t_9);
18842 __pyx_t_9 = 0;
18843
18844 /* "Isosurface.pyx":563
18845 * light = [0.5 * (x + L)
18846 * for x, L in zip(self.domain.x, self.domain.L)]
18847 * light[2] = self.domain.x[2] + 5 * self.domain.L[2] # <<<<<<<<<<<<<<
18848 * light_dx, light_dy = (self.domain.x[0] - light[0],
18849 * self.domain.x[1] - light[1])
18850*/
18851 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 563, __pyx_L1_error)
18852 __Pyx_GOTREF(__pyx_t_9);
18853 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 563, __pyx_L1_error)
18854 __Pyx_GOTREF(__pyx_t_4);
18855 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18856 __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_4, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 563, __pyx_L1_error)
18857 __Pyx_GOTREF(__pyx_t_9);
18858 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18859 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 563, __pyx_L1_error)
18860 __Pyx_GOTREF(__pyx_t_4);
18861 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __pyx_L1_error)
18862 __Pyx_GOTREF(__pyx_t_1);
18863 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18864 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 563, __pyx_L1_error)
18865 __Pyx_GOTREF(__pyx_t_4);
18866 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18867 __pyx_t_1 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_5, __pyx_t_4, 5, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __pyx_L1_error)
18868 __Pyx_GOTREF(__pyx_t_1);
18869 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18870 __pyx_t_4 = __Pyx_PyNumber_Add_object_object(__pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 563, __pyx_L1_error)
18871 __Pyx_GOTREF(__pyx_t_4);
18872 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18873 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18874 if (unlikely((__Pyx_SetItemInt(__pyx_v_light, 2, __pyx_t_4, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(0, 563, __pyx_L1_error)
18875 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18876
18877 /* "Isosurface.pyx":564
18878 * for x, L in zip(self.domain.x, self.domain.L)]
18879 * light[2] = self.domain.x[2] + 5 * self.domain.L[2]
18880 * light_dx, light_dy = (self.domain.x[0] - light[0], # <<<<<<<<<<<<<<
18881 * self.domain.x[1] - light[1])
18882 * floor_z = self.domain.x[2] - 0.01 * \
18883*/
18884 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 564, __pyx_L1_error)
18885 __Pyx_GOTREF(__pyx_t_4);
18886 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error)
18887 __Pyx_GOTREF(__pyx_t_1);
18888 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18889 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 564, __pyx_L1_error)
18890 __Pyx_GOTREF(__pyx_t_4);
18891 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18892 __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_light, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error)
18893 __Pyx_GOTREF(__pyx_t_1);
18894 __pyx_t_9 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 564, __pyx_L1_error)
18895 __Pyx_GOTREF(__pyx_t_9);
18896 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18897 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18898
18899 /* "Isosurface.pyx":565
18900 * light[2] = self.domain.x[2] + 5 * self.domain.L[2]
18901 * light_dx, light_dy = (self.domain.x[0] - light[0],
18902 * self.domain.x[1] - light[1]) # <<<<<<<<<<<<<<
18903 * floor_z = self.domain.x[2] - 0.01 * \
18904 * self.domain.L[2] # offset slightly
18905*/
18906 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error)
18907 __Pyx_GOTREF(__pyx_t_1);
18908 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 565, __pyx_L1_error)
18909 __Pyx_GOTREF(__pyx_t_4);
18910 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18911 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 565, __pyx_L1_error)
18912 __Pyx_GOTREF(__pyx_t_1);
18913 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18914 __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_light, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 565, __pyx_L1_error)
18915 __Pyx_GOTREF(__pyx_t_4);
18916 __pyx_t_8 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 565, __pyx_L1_error)
18917 __Pyx_GOTREF(__pyx_t_8);
18918 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18919 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18920 __pyx_v_light_dx = __pyx_t_9;
18921 __pyx_t_9 = 0;
18922 __pyx_v_light_dy = __pyx_t_8;
18923 __pyx_t_8 = 0;
18924
18925 /* "Isosurface.pyx":566
18926 * light_dx, light_dy = (self.domain.x[0] - light[0],
18927 * self.domain.x[1] - light[1])
18928 * floor_z = self.domain.x[2] - 0.01 * \ # <<<<<<<<<<<<<<
18929 * self.domain.L[2] # offset slightly
18930 * wall_y = self.domain.x[1] - 2.0 * \
18931*/
18932 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 566, __pyx_L1_error)
18933 __Pyx_GOTREF(__pyx_t_8);
18934 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 566, __pyx_L1_error)
18935 __Pyx_GOTREF(__pyx_t_9);
18936 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18937 __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_9, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 566, __pyx_L1_error)
18938 __Pyx_GOTREF(__pyx_t_8);
18939 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18940
18941 /* "Isosurface.pyx":567
18942 * self.domain.x[1] - light[1])
18943 * floor_z = self.domain.x[2] - 0.01 * \
18944 * self.domain.L[2] # offset slightly # <<<<<<<<<<<<<<
18945 * wall_y = self.domain.x[1] - 2.0 * \
18946 * self.domain.L[1] # offset slightly
18947*/
18948 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 567, __pyx_L1_error)
18949 __Pyx_GOTREF(__pyx_t_9);
18950 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_L); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 567, __pyx_L1_error)
18951 __Pyx_GOTREF(__pyx_t_4);
18952 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18953 __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_4, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 567, __pyx_L1_error)
18954 __Pyx_GOTREF(__pyx_t_9);
18955 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18956
18957 /* "Isosurface.pyx":566
18958 * light_dx, light_dy = (self.domain.x[0] - light[0],
18959 * self.domain.x[1] - light[1])
18960 * floor_z = self.domain.x[2] - 0.01 * \ # <<<<<<<<<<<<<<
18961 * self.domain.L[2] # offset slightly
18962 * wall_y = self.domain.x[1] - 2.0 * \
18963*/
18964 __pyx_t_4 = __Pyx_PyNumber_Multiply_float_object(__pyx_mstate_global->__pyx_float_0_01, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 566, __pyx_L1_error)
18965 __Pyx_GOTREF(__pyx_t_4);
18966 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18967 __pyx_t_9 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 566, __pyx_L1_error)
18968 __Pyx_GOTREF(__pyx_t_9);
18969 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18970 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18971 __pyx_v_floor_z = __pyx_t_9;
18972 __pyx_t_9 = 0;
18973
18974 /* "Isosurface.pyx":568
18975 * floor_z = self.domain.x[2] - 0.01 * \
18976 * self.domain.L[2] # offset slightly
18977 * wall_y = self.domain.x[1] - 2.0 * \ # <<<<<<<<<<<<<<
18978 * self.domain.L[1] # offset slightly
18979 * sky_z = self.domain.x[2] + 10 * self.domain.L[2]
18980*/
18981 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 568, __pyx_L1_error)
18982 __Pyx_GOTREF(__pyx_t_9);
18983 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error)
18984 __Pyx_GOTREF(__pyx_t_4);
18985 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18986 __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 568, __pyx_L1_error)
18987 __Pyx_GOTREF(__pyx_t_9);
18988 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18989
18990 /* "Isosurface.pyx":569
18991 * self.domain.L[2] # offset slightly
18992 * wall_y = self.domain.x[1] - 2.0 * \
18993 * self.domain.L[1] # offset slightly # <<<<<<<<<<<<<<
18994 * sky_z = self.domain.x[2] + 10 * self.domain.L[2]
18995 * pov = open("proteus.inc", "w")
18996*/
18997 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 569, __pyx_L1_error)
18998 __Pyx_GOTREF(__pyx_t_4);
18999 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_L); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 569, __pyx_L1_error)
19000 __Pyx_GOTREF(__pyx_t_8);
19001 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19002 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 569, __pyx_L1_error)
19003 __Pyx_GOTREF(__pyx_t_4);
19004 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
19005
19006 /* "Isosurface.pyx":568
19007 * floor_z = self.domain.x[2] - 0.01 * \
19008 * self.domain.L[2] # offset slightly
19009 * wall_y = self.domain.x[1] - 2.0 * \ # <<<<<<<<<<<<<<
19010 * self.domain.L[1] # offset slightly
19011 * sky_z = self.domain.x[2] + 10 * self.domain.L[2]
19012*/
19013 __pyx_t_8 = __Pyx_PyNumber_Multiply_float_object(__pyx_mstate_global->__pyx_float_2_0, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 568, __pyx_L1_error)
19014 __Pyx_GOTREF(__pyx_t_8);
19015 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19016 __pyx_t_4 = __Pyx_PyNumber_Subtract_object_object(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error)
19017 __Pyx_GOTREF(__pyx_t_4);
19018 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19019 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
19020 __pyx_v_wall_y = __pyx_t_4;
19021 __pyx_t_4 = 0;
19022
19023 /* "Isosurface.pyx":570
19024 * wall_y = self.domain.x[1] - 2.0 * \
19025 * self.domain.L[1] # offset slightly
19026 * sky_z = self.domain.x[2] + 10 * self.domain.L[2] # <<<<<<<<<<<<<<
19027 * pov = open("proteus.inc", "w")
19028 * povSceneTemplate = Template("""#include "colors.inc"
19029*/
19030 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error)
19031 __Pyx_GOTREF(__pyx_t_4);
19032 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 570, __pyx_L1_error)
19033 __Pyx_GOTREF(__pyx_t_8);
19034 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19035 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_8, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error)
19036 __Pyx_GOTREF(__pyx_t_4);
19037 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
19038 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_domain); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 570, __pyx_L1_error)
19039 __Pyx_GOTREF(__pyx_t_8);
19040 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_L); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 570, __pyx_L1_error)
19041 __Pyx_GOTREF(__pyx_t_9);
19042 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
19043 __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_9, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 570, __pyx_L1_error)
19044 __Pyx_GOTREF(__pyx_t_8);
19045 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19046 __pyx_t_9 = __Pyx_PyLong_MultiplyCObj(__pyx_mstate_global->__pyx_int_10, __pyx_t_8, 10, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 570, __pyx_L1_error)
19047 __Pyx_GOTREF(__pyx_t_9);
19048 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
19049 __pyx_t_8 = __Pyx_PyNumber_Add_object_object(__pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 570, __pyx_L1_error)
19050 __Pyx_GOTREF(__pyx_t_8);
19051 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19052 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19053 __pyx_v_sky_z = __pyx_t_8;
19054 __pyx_t_8 = 0;
19055
19056 /* "Isosurface.pyx":571
19057 * self.domain.L[1] # offset slightly
19058 * sky_z = self.domain.x[2] + 10 * self.domain.L[2]
19059 * pov = open("proteus.inc", "w") # <<<<<<<<<<<<<<
19060 * povSceneTemplate = Template("""#include "colors.inc"
19061 * #include "textures.inc"
19062*/
19063 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_mstate_global->__pyx_tuple[7], NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 571, __pyx_L1_error)
19064 __Pyx_GOTREF(__pyx_t_8);
19065 __pyx_v_pov = __pyx_t_8;
19066 __pyx_t_8 = 0;
19067
19068 /* "Isosurface.pyx":572
19069 * sky_z = self.domain.x[2] + 10 * self.domain.L[2]
19070 * pov = open("proteus.inc", "w")
19071 * povSceneTemplate = Template("""#include "colors.inc" # <<<<<<<<<<<<<<
19072 * #include "textures.inc"
19073 * #include "glass.inc"
19074*/
19075 __pyx_t_9 = NULL;
19076 __Pyx_INCREF(__pyx_v_Template);
19077 __pyx_t_4 = __pyx_v_Template;
19078 __pyx_t_6 = 1;
19079 #if CYTHON_UNPACK_METHODS
19080 if (unlikely(PyMethod_Check(__pyx_t_4))) {
19081 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
19082 assert(__pyx_t_9);
19083 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
19084 __Pyx_INCREF(__pyx_t_9);
19085 __Pyx_INCREF(__pyx__function);
19086 __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
19087 __pyx_t_6 = 0;
19088 }
19089 #endif
19090 {
19091 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_include_colors_inc_include_text};
19092 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
19093 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
19094 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19095 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 572, __pyx_L1_error)
19096 __Pyx_GOTREF(__pyx_t_8);
19097 }
19098 __pyx_v_povSceneTemplate = __pyx_t_8;
19099 __pyx_t_8 = 0;
19100
19101 /* "Isosurface.pyx":714
19102 * #end
19103 * """)
19104 * pov.write(povSceneTemplate.substitute(look_at_x=look_at[0], # <<<<<<<<<<<<<<
19105 * look_at_y=look_at[1],
19106 * look_at_z=look_at[2],
19107*/
19108 __pyx_t_4 = __pyx_v_pov;
19109 __Pyx_INCREF(__pyx_t_4);
19110 __pyx_t_1 = __pyx_v_povSceneTemplate;
19111 __Pyx_INCREF(__pyx_t_1);
19112 __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_look_at, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 714, __pyx_L1_error)
19113 __Pyx_GOTREF(__pyx_t_5);
19114
19115 /* "Isosurface.pyx":715
19116 * """)
19117 * pov.write(povSceneTemplate.substitute(look_at_x=look_at[0],
19118 * look_at_y=look_at[1], # <<<<<<<<<<<<<<
19119 * look_at_z=look_at[2],
19120 * cam_x=cam[0],
19121*/
19122 __pyx_t_10 = __Pyx_GetItemInt_List(__pyx_v_look_at, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 715, __pyx_L1_error)
19123 __Pyx_GOTREF(__pyx_t_10);
19124
19125 /* "Isosurface.pyx":716
19126 * pov.write(povSceneTemplate.substitute(look_at_x=look_at[0],
19127 * look_at_y=look_at[1],
19128 * look_at_z=look_at[2], # <<<<<<<<<<<<<<
19129 * cam_x=cam[0],
19130 * cam_y=cam[1],
19131*/
19132 __pyx_t_13 = __Pyx_GetItemInt_List(__pyx_v_look_at, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 716, __pyx_L1_error)
19133 __Pyx_GOTREF(__pyx_t_13);
19134
19135 /* "Isosurface.pyx":717
19136 * look_at_y=look_at[1],
19137 * look_at_z=look_at[2],
19138 * cam_x=cam[0], # <<<<<<<<<<<<<<
19139 * cam_y=cam[1],
19140 * cam_z=cam[2],
19141*/
19142 __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_cam, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 717, __pyx_L1_error)
19143 __Pyx_GOTREF(__pyx_t_14);
19144
19145 /* "Isosurface.pyx":718
19146 * look_at_z=look_at[2],
19147 * cam_x=cam[0],
19148 * cam_y=cam[1], # <<<<<<<<<<<<<<
19149 * cam_z=cam[2],
19150 * light_x=light[0],
19151*/
19152 __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_cam, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 718, __pyx_L1_error)
19153 __Pyx_GOTREF(__pyx_t_15);
19154
19155 /* "Isosurface.pyx":719
19156 * cam_x=cam[0],
19157 * cam_y=cam[1],
19158 * cam_z=cam[2], # <<<<<<<<<<<<<<
19159 * light_x=light[0],
19160 * light_y=light[1],
19161*/
19162 __pyx_t_16 = __Pyx_GetItemInt(__pyx_v_cam, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 719, __pyx_L1_error)
19163 __Pyx_GOTREF(__pyx_t_16);
19164
19165 /* "Isosurface.pyx":720
19166 * cam_y=cam[1],
19167 * cam_z=cam[2],
19168 * light_x=light[0], # <<<<<<<<<<<<<<
19169 * light_y=light[1],
19170 * light_z=light[2],
19171*/
19172 __pyx_t_17 = __Pyx_GetItemInt_List(__pyx_v_light, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 720, __pyx_L1_error)
19173 __Pyx_GOTREF(__pyx_t_17);
19174
19175 /* "Isosurface.pyx":721
19176 * cam_z=cam[2],
19177 * light_x=light[0],
19178 * light_y=light[1], # <<<<<<<<<<<<<<
19179 * light_z=light[2],
19180 * light_dx=light_dx,
19181*/
19182 __pyx_t_18 = __Pyx_GetItemInt_List(__pyx_v_light, 1, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 721, __pyx_L1_error)
19183 __Pyx_GOTREF(__pyx_t_18);
19184
19185 /* "Isosurface.pyx":722
19186 * light_x=light[0],
19187 * light_y=light[1],
19188 * light_z=light[2], # <<<<<<<<<<<<<<
19189 * light_dx=light_dx,
19190 * light_dy=light_dy,
19191*/
19192 __pyx_t_19 = __Pyx_GetItemInt_List(__pyx_v_light, 2, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 722, __pyx_L1_error)
19193 __Pyx_GOTREF(__pyx_t_19);
19194
19195 /* "Isosurface.pyx":727
19196 * floor_z=floor_z,
19197 * wall_y=wall_y,
19198 * sky_z=sky_z # <<<<<<<<<<<<<<
19199 * )
19200 * )
19201*/
19202 __pyx_t_6 = 0;
19203 {
19204 PyObject *__pyx_callargs[15] = {__pyx_t_1, __pyx_t_5, __pyx_t_10, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_t_19, __pyx_v_light_dx, __pyx_v_light_dy, __pyx_v_floor_z, __pyx_v_wall_y, __pyx_v_sky_z};
19205 #if CYTHON_VECTORCALL
19206 __pyx_t_20 = __pyx_mstate_global->__pyx_tuple[8];
19207 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 714, __pyx_L1_error)
19208 __Pyx_INCREF(__pyx_t_20);
19209 #else
19210 {
19211 PyObject *__pyx_temp[14] = {__pyx_mstate_global->__pyx_n_u_look_at_x, __pyx_mstate_global->__pyx_n_u_look_at_y, __pyx_mstate_global->__pyx_n_u_look_at_z, __pyx_mstate_global->__pyx_n_u_cam_x, __pyx_mstate_global->__pyx_n_u_cam_y, __pyx_mstate_global->__pyx_n_u_cam_z, __pyx_mstate_global->__pyx_n_u_light_x, __pyx_mstate_global->__pyx_n_u_light_y, __pyx_mstate_global->__pyx_n_u_light_z, __pyx_mstate_global->__pyx_n_u_light_dx, __pyx_mstate_global->__pyx_n_u_light_dy, __pyx_mstate_global->__pyx_n_u_floor_z, __pyx_mstate_global->__pyx_n_u_wall_y, __pyx_mstate_global->__pyx_n_u_sky_z};
19212 __pyx_t_20 = __Pyx_MakeKwargDict(__pyx_temp, __pyx_callargs+1, 14);
19213 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 714, __pyx_L1_error)
19214 __Pyx_GOTREF(__pyx_t_20);
19215 }
19216 #endif
19217 __pyx_t_9 = __Pyx_Object_VectorcallMethodKwds((PyObject*)__pyx_mstate_global->__pyx_n_u_substitute, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_20);
19218 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
19219 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19220 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
19221 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
19222 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
19223 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
19224 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
19225 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
19226 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
19227 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
19228 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
19229 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 714, __pyx_L1_error)
19230 __Pyx_GOTREF(__pyx_t_9);
19231 }
19232 __pyx_t_6 = 0;
19233 {
19234 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_9};
19235 __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
19236 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
19237 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19238 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 714, __pyx_L1_error)
19239 __Pyx_GOTREF(__pyx_t_8);
19240 }
19241 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
19242
19243 /* "Isosurface.pyx":730
19244 * )
19245 * )
19246 * pov.close() # <<<<<<<<<<<<<<
19247*/
19248 __pyx_t_9 = __pyx_v_pov;
19249 __Pyx_INCREF(__pyx_t_9);
19250 __pyx_t_6 = 0;
19251 {
19252 PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
19253 __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_close, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
19254 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
19255 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 730, __pyx_L1_error)
19256 __Pyx_GOTREF(__pyx_t_8);
19257 }
19258 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
19259
19260 /* "Isosurface.pyx":554
19261 * """
19262 * from string import Template
19263 * if self.comm.isMaster(): # <<<<<<<<<<<<<<
19264 * look_at = [0.5 * (x + L)
19265 * for x, L in zip(self.domain.x, self.domain.L)]
19266*/
19267 }
19268
19269 /* "Isosurface.pyx":549
19270 * self.next_output += self.sampleRate
19271 *
19272 * def writeSceneHeader(self, cam = None): # <<<<<<<<<<<<<<
19273 * """
19274 * Write a scene description (can be modified before running povray)
19275*/
19276
19277 /* function exit code */
19278 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19279 goto __pyx_L0;
19280 __pyx_L1_error:;
19281 __Pyx_XDECREF(__pyx_t_1);
19282 __Pyx_XDECREF(__pyx_t_4);
19283 __Pyx_XDECREF(__pyx_t_5);
19284 __Pyx_XDECREF(__pyx_t_8);
19285 __Pyx_XDECREF(__pyx_t_9);
19286 __Pyx_XDECREF(__pyx_t_10);
19287 __Pyx_XDECREF(__pyx_t_13);
19288 __Pyx_XDECREF(__pyx_t_14);
19289 __Pyx_XDECREF(__pyx_t_15);
19290 __Pyx_XDECREF(__pyx_t_16);
19291 __Pyx_XDECREF(__pyx_t_17);
19292 __Pyx_XDECREF(__pyx_t_18);
19293 __Pyx_XDECREF(__pyx_t_19);
19294 __Pyx_XDECREF(__pyx_t_20);
19295 __Pyx_AddTraceback("Isosurface.Isosurface.writeSceneHeader", __pyx_clineno, __pyx_lineno, __pyx_filename);
19296 __pyx_r = NULL;
19297 __pyx_L0:;
19298 __Pyx_XDECREF(__pyx_v_Template);
19299 __Pyx_XDECREF(__pyx_v_look_at);
19300 __Pyx_XDECREF(__pyx_v_light);
19301 __Pyx_XDECREF(__pyx_v_light_dx);
19302 __Pyx_XDECREF(__pyx_v_light_dy);
19303 __Pyx_XDECREF(__pyx_v_floor_z);
19304 __Pyx_XDECREF(__pyx_v_wall_y);
19305 __Pyx_XDECREF(__pyx_v_sky_z);
19306 __Pyx_XDECREF(__pyx_v_pov);
19307 __Pyx_XDECREF(__pyx_v_povSceneTemplate);
19308 __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_x);
19309 __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_L);
19310 __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_x);
19311 __Pyx_XDECREF(__pyx_9genexpr11__pyx_v_L);
19312 __Pyx_XDECREF(__pyx_v_cam);
19313 __Pyx_XGIVEREF(__pyx_r);
19314 __Pyx_RefNannyFinishContext();
19315 return __pyx_r;
19316}
19317/* #### Code section: module_exttypes ### */
19318
19319static PyObject *__pyx_tp_new__initialisation_10Isosurface___pyx_scope_struct__genexpr(PyObject *o,
19320#if CYTHON_VECTORCALL_TPNEW
19321 CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
19322#else
19323 CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
19324#endif
19325) {
19326 return o;
19327}
19328
19329static PyObject *__pyx_tp_new_vectorcall_10Isosurface___pyx_scope_struct__genexpr(PyTypeObject *t,
19330#if CYTHON_VECTORCALL_TPNEW
19331 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
19332#else
19333 PyObject *a, PyObject *k
19334#endif
19335) {
19336 PyObject *o;
19337 #if CYTHON_USE_FREELISTS
19338 if (likely((int)(__pyx_mstate_global->__pyx_freecount_10Isosurface___pyx_scope_struct__genexpr > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_10Isosurface___pyx_scope_struct__genexpr, sizeof(struct __pyx_obj_10Isosurface___pyx_scope_struct__genexpr))))
19339 {
19340 o = (PyObject*)__pyx_mstate_global->__pyx_freelist_10Isosurface___pyx_scope_struct__genexpr[--__pyx_mstate_global->__pyx_freecount_10Isosurface___pyx_scope_struct__genexpr];
19341 #if CYTHON_USE_TYPE_SPECS
19342 Py_DECREF(Py_TYPE(o));
19343 #endif
19344 memset(o, 0, sizeof(struct __pyx_obj_10Isosurface___pyx_scope_struct__genexpr));
19345 #if CYTHON_COMPILING_IN_LIMITED_API
19346 (void) PyObject_Init(o, t);
19347 #else
19348 (void) PyObject_INIT(o, t);
19349 #endif
19350 PyObject_GC_Track(o);
19351 } else
19352 #endif
19353 {
19354 o = __Pyx_AllocateExtensionType(t, 1);
19355 }
19356 if (unlikely(!o)) return 0;
19357 return __pyx_tp_new__initialisation_10Isosurface___pyx_scope_struct__genexpr(o,
19358#if CYTHON_VECTORCALL_TPNEW
19359 args, nargs, kwnames
19360#else
19361 a, k
19362#endif
19363);
19364}
19365
19366#if CYTHON_VECTORCALL_TPNEW
19367static PyObject *__pyx_tp_new_10Isosurface___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k) {
19368 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_10Isosurface___pyx_scope_struct__genexpr, t, a, k);
19369}
19370#endif
19371
19372#if CYTHON_VECTORCALL_TPNEW
19373static PyObject *__pyx_tp_vectorcall_10Isosurface___pyx_scope_struct__genexpr(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
19374 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_ptype_10Isosurface___pyx_scope_struct__genexpr || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
19375 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
19376 }
19377 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
19378 PyObject *o = __pyx_tp_new_vectorcall_10Isosurface___pyx_scope_struct__genexpr((PyTypeObject*)t, args, nargs, kwnames);
19379 return o;
19380}
19381#endif
19382
19383static void __pyx_tp_dealloc_10Isosurface___pyx_scope_struct__genexpr(PyObject *o) {
19384 struct __pyx_obj_10Isosurface___pyx_scope_struct__genexpr *p = (struct __pyx_obj_10Isosurface___pyx_scope_struct__genexpr *)o;
19385 #if CYTHON_USE_TP_FINALIZE
19386 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
19387 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10Isosurface___pyx_scope_struct__genexpr) {
19388 if (PyObject_CallFinalizerFromDealloc(o)) return;
19389 }
19390 }
19391 #endif
19392 PyObject_GC_UnTrack(o);
19393 Py_CLEAR(p->__pyx_genexpr_arg_0);
19394 Py_CLEAR(p->__pyx_v_bn);
19395 Py_CLEAR(p->__pyx_v_gn);
19396 #if CYTHON_USE_FREELISTS
19397 if (likely((int)(__pyx_mstate_global->__pyx_freecount_10Isosurface___pyx_scope_struct__genexpr < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_10Isosurface___pyx_scope_struct__genexpr, sizeof(struct __pyx_obj_10Isosurface___pyx_scope_struct__genexpr))))
19398 {
19399 __pyx_mstate_global->__pyx_freelist_10Isosurface___pyx_scope_struct__genexpr[__pyx_mstate_global->__pyx_freecount_10Isosurface___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_10Isosurface___pyx_scope_struct__genexpr *)o);
19400 } else
19401 #endif
19402 {
19403 PyTypeObject *tp = Py_TYPE(o);
19404 #if CYTHON_USE_TYPE_SLOTS
19405 (*tp->tp_free)(o);
19406 #else
19407 {
19408 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
19409 if (tp_free) tp_free(o);
19410 }
19411 #endif
19412 #if CYTHON_USE_TYPE_SPECS
19413 Py_DECREF(tp);
19414 #endif
19415 }
19416}
19417
19418static int __pyx_tp_traverse_10Isosurface___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) {
19419 int e;
19420 struct __pyx_obj_10Isosurface___pyx_scope_struct__genexpr *p = (struct __pyx_obj_10Isosurface___pyx_scope_struct__genexpr *)o;
19421 {
19422 e = __Pyx_call_type_traverse(o, 1, v, a);
19423 if (e) return e;
19424 }
19425 if (p->__pyx_genexpr_arg_0) {
19426 e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
19427 }
19428 if (p->__pyx_v_bn) {
19429 e = (*v)(p->__pyx_v_bn, a); if (e) return e;
19430 }
19431 if (p->__pyx_v_gn) {
19432 e = (*v)(p->__pyx_v_gn, a); if (e) return e;
19433 }
19434 return 0;
19435}
19436#if CYTHON_USE_TYPE_SPECS
19437static PyType_Slot __pyx_type_10Isosurface___pyx_scope_struct__genexpr_slots[] = {
19438 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10Isosurface___pyx_scope_struct__genexpr},
19439 {Py_tp_traverse, (void *)__pyx_tp_traverse_10Isosurface___pyx_scope_struct__genexpr},
19440 {Py_tp_new, (void *)__pyx_tp_new_10Isosurface___pyx_scope_struct__genexpr},
19441 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
19442 #if CYTHON_VECTORCALL_TPNEW
19443 {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_10Isosurface___pyx_scope_struct__genexpr},
19444 #endif
19445 #endif
19446 {0, 0},
19447};
19448static PyType_Spec __pyx_type_10Isosurface___pyx_scope_struct__genexpr_spec = {
19449 "Isosurface.__pyx_scope_struct__genexpr",
19450 sizeof(struct __pyx_obj_10Isosurface___pyx_scope_struct__genexpr),
19451 0,
19452 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_HAVE_GC,
19453 __pyx_type_10Isosurface___pyx_scope_struct__genexpr_slots,
19454};
19455#else
19456
19457static PyTypeObject __pyx_type_10Isosurface___pyx_scope_struct__genexpr = {
19458 PyVarObject_HEAD_INIT(0, 0)
19459 "Isosurface.""__pyx_scope_struct__genexpr", /*tp_name*/
19460 sizeof(struct __pyx_obj_10Isosurface___pyx_scope_struct__genexpr), /*tp_basicsize*/
19461 0, /*tp_itemsize*/
19462 __pyx_tp_dealloc_10Isosurface___pyx_scope_struct__genexpr, /*tp_dealloc*/
19463 0, /*tp_vectorcall_offset*/
19464 0, /*tp_getattr*/
19465 0, /*tp_setattr*/
19466 0, /*tp_as_async*/
19467 0, /*tp_repr*/
19468 0, /*tp_as_number*/
19469 0, /*tp_as_sequence*/
19470 0, /*tp_as_mapping*/
19471 0, /*tp_hash*/
19472 0, /*tp_call*/
19473 0, /*tp_str*/
19474 0, /*tp_getattro*/
19475 0, /*tp_setattro*/
19476 0, /*tp_as_buffer*/
19477 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
19478 0, /*tp_doc*/
19479 __pyx_tp_traverse_10Isosurface___pyx_scope_struct__genexpr, /*tp_traverse*/
19480 0, /*tp_clear*/
19481 0, /*tp_richcompare*/
19482 0, /*tp_weaklistoffset*/
19483 0, /*tp_iter*/
19484 0, /*tp_iternext*/
19485 0, /*tp_methods*/
19486 0, /*tp_members*/
19487 0, /*tp_getset*/
19488 0, /*tp_base*/
19489 0, /*tp_dict*/
19490 0, /*tp_descr_get*/
19491 0, /*tp_descr_set*/
19492 #if !CYTHON_USE_TYPE_SPECS
19493 0, /*tp_dictoffset*/
19494 #endif
19495 0, /*tp_init*/
19496 0, /*tp_alloc*/
19497 __pyx_tp_new_10Isosurface___pyx_scope_struct__genexpr, /*tp_new*/
19498 0, /*tp_free*/
19499 0, /*tp_is_gc*/
19500 0, /*tp_bases*/
19501 0, /*tp_mro*/
19502 0, /*tp_cache*/
19503 0, /*tp_subclasses*/
19504 0, /*tp_weaklist*/
19505 0, /*tp_del*/
19506 0, /*tp_version_tag*/
19507 #if CYTHON_USE_TP_FINALIZE
19508 0, /*tp_finalize*/
19509 #else
19510 NULL, /*tp_finalize*/
19511 #endif
19512 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
19513 #if CYTHON_VECTORCALL_TPNEW
19514 __pyx_tp_vectorcall_10Isosurface___pyx_scope_struct__genexpr, /*tp_vectorcall*/
19515 #else
19516 NULL, /*tp_vectorcall*/
19517 #endif
19518 #endif
19519 #if __PYX_NEED_TP_PRINT_SLOT == 1
19520 0, /*tp_print*/
19521 #endif
19522 #if PY_VERSION_HEX >= 0x030C0000
19523 0, /*tp_watched*/
19524 #endif
19525 #if PY_VERSION_HEX >= 0x030d00A4
19526 0, /*tp_versions_used*/
19527 #endif
19528 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
19529 0, /*tp_pypy_flags*/
19530 #endif
19531};
19532#endif
19533
19534static PyMethodDef __pyx_methods[] = {
19535 {0, 0, 0, 0}
19536};
19537/* #### Code section: initfunc_declarations ### */
19538static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/
19539static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
19540static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/
19541static CYTHON_SMALL_CODE int __Pyx_InitAfterSharedUtility(void); /*proto*/
19542static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
19543static CYTHON_SMALL_CODE int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
19544static CYTHON_SMALL_CODE int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
19545static CYTHON_SMALL_CODE int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
19546static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_obj_10Isosurface___pyx_scope_struct__genexpr(__pyx_mstatetype *__pyx_mstate); /*proto*/
19547static CYTHON_SMALL_CODE int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
19548static CYTHON_SMALL_CODE int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
19549static CYTHON_SMALL_CODE int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
19550static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/
19551/* #### Code section: init_module ### */
19552
19553static int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate) {
19554 __Pyx_RefNannyDeclarations
19555 CYTHON_UNUSED_VAR(__pyx_mstate);
19556 __Pyx_RefNannySetupContext("__Pyx_modinit_Global_init_code", 0);
19557 /*--- Global init code ---*/
19558 __Pyx_RefNannyFinishContext();
19559 return 0;
19560}
19561
19562static int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate) {
19563 __Pyx_RefNannyDeclarations
19564 CYTHON_UNUSED_VAR(__pyx_mstate);
19565 __Pyx_RefNannySetupContext("__Pyx_modinit_Variable_export_code", 0);
19566 /*--- Variable export code ---*/
19567 __Pyx_RefNannyFinishContext();
19568 return 0;
19569}
19570
19571static int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate) {
19572 __Pyx_RefNannyDeclarations
19573 CYTHON_UNUSED_VAR(__pyx_mstate);
19574 __Pyx_RefNannySetupContext("__Pyx_modinit_Function_export_code", 0);
19575 /*--- Function export code ---*/
19576 __Pyx_RefNannyFinishContext();
19577 return 0;
19578}
19579
19580static int __Pyx_modinit_Exttype___pyx_obj_10Isosurface___pyx_scope_struct__genexpr(__pyx_mstatetype *__pyx_mstate) {
19581 __Pyx_RefNannyDeclarations
19582 int __pyx_lineno = 0;
19583 const char *__pyx_filename = NULL;
19584 int __pyx_clineno = 0;
19585 CYTHON_UNUSED_VAR(__pyx_mstate);
19586 __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_obj_10Isosurface___pyx_scope_struct__genexpr", 0);
19587 /*--- Exttype __pyx_obj_10Isosurface___pyx_scope_struct__genexpr ---*/
19588 #if CYTHON_USE_TYPE_SPECS
19589 __pyx_mstate->__pyx_ptype_10Isosurface___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10Isosurface___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_10Isosurface___pyx_scope_struct__genexpr)) __PYX_ERR(0, 122, __pyx_L1_error)
19590 #else
19591 __pyx_mstate->__pyx_ptype_10Isosurface___pyx_scope_struct__genexpr = &__pyx_type_10Isosurface___pyx_scope_struct__genexpr;
19592 #endif
19593 #if !CYTHON_COMPILING_IN_LIMITED_API
19594 #endif
19595 #if !CYTHON_USE_TYPE_SPECS
19596 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_10Isosurface___pyx_scope_struct__genexpr) < (0)) __PYX_ERR(0, 122, __pyx_L1_error)
19597 #endif
19598 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
19599 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_10Isosurface___pyx_scope_struct__genexpr);
19600 #endif
19601 #if !CYTHON_COMPILING_IN_LIMITED_API
19602 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_10Isosurface___pyx_scope_struct__genexpr->tp_dictoffset && __pyx_mstate->__pyx_ptype_10Isosurface___pyx_scope_struct__genexpr->tp_getattro == PyObject_GenericGetAttr)) {
19603 __pyx_mstate->__pyx_ptype_10Isosurface___pyx_scope_struct__genexpr->tp_getattro = PyObject_GenericGetAttr;
19604 }
19605 #endif
19606 __Pyx_RefNannyFinishContext();
19607 return 0;
19608 __pyx_L1_error:;
19609 __Pyx_RefNannyFinishContext();
19610 return -1;
19611}
19612
19613static int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate) {
19614 __Pyx_RefNannyDeclarations
19615 PyObject *__pyx_t_1 = NULL;
19616 int __pyx_lineno = 0;
19617 const char *__pyx_filename = NULL;
19618 int __pyx_clineno = 0;
19619 CYTHON_UNUSED_VAR(__pyx_mstate);
19620 __Pyx_RefNannySetupContext("__Pyx_modinit_Type_import_code", 0);
19621 /*--- Type import code ---*/
19622 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
19623 __Pyx_GOTREF(__pyx_t_1);
19624 __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_3_0(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
19625 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
19626 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyTypeObject),
19627 #elif CYTHON_COMPILING_IN_LIMITED_API
19628 0, 0,
19629 #else
19630 sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyHeapTypeObject),
19631 #endif
19632 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
19633 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19634 __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 229, __pyx_L1_error)
19635 __Pyx_GOTREF(__pyx_t_1);
19636 __pyx_mstate->__pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "dtype",
19637 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
19638 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
19639 #elif CYTHON_COMPILING_IN_LIMITED_API
19640 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
19641 #else
19642 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
19643 #endif
19644 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_dtype) __PYX_ERR(1, 229, __pyx_L1_error)
19645 __pyx_mstate->__pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "flatiter",
19646 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
19647 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
19648 #elif CYTHON_COMPILING_IN_LIMITED_API
19649 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
19650 #else
19651 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
19652 #endif
19653 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_flatiter) __PYX_ERR(1, 286, __pyx_L1_error)
19654 __pyx_mstate->__pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "broadcast",
19655 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
19656 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
19657 #elif CYTHON_COMPILING_IN_LIMITED_API
19658 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
19659 #else
19660 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
19661 #endif
19662 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_broadcast) __PYX_ERR(1, 290, __pyx_L1_error)
19663 __pyx_mstate->__pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "ndarray",
19664 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
19665 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
19666 #elif CYTHON_COMPILING_IN_LIMITED_API
19667 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
19668 #else
19669 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
19670 #endif
19671 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_ndarray) __PYX_ERR(1, 329, __pyx_L1_error)
19672 __pyx_mstate->__pyx_ptype_5numpy_generic = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "generic",
19673 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
19674 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19675 #elif CYTHON_COMPILING_IN_LIMITED_API
19676 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19677 #else
19678 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19679 #endif
19680 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_generic) __PYX_ERR(1, 847, __pyx_L1_error)
19681 __pyx_mstate->__pyx_ptype_5numpy_number = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "number",
19682 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
19683 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19684 #elif CYTHON_COMPILING_IN_LIMITED_API
19685 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19686 #else
19687 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19688 #endif
19689 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_number) __PYX_ERR(1, 849, __pyx_L1_error)
19690 __pyx_mstate->__pyx_ptype_5numpy_integer = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "integer",
19691 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
19692 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19693 #elif CYTHON_COMPILING_IN_LIMITED_API
19694 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19695 #else
19696 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19697 #endif
19698 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_integer) __PYX_ERR(1, 851, __pyx_L1_error)
19699 __pyx_mstate->__pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "signedinteger",
19700 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
19701 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19702 #elif CYTHON_COMPILING_IN_LIMITED_API
19703 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19704 #else
19705 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19706 #endif
19707 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_signedinteger) __PYX_ERR(1, 853, __pyx_L1_error)
19708 __pyx_mstate->__pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "unsignedinteger",
19709 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
19710 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19711 #elif CYTHON_COMPILING_IN_LIMITED_API
19712 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19713 #else
19714 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19715 #endif
19716 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(1, 855, __pyx_L1_error)
19717 __pyx_mstate->__pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "inexact",
19718 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
19719 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19720 #elif CYTHON_COMPILING_IN_LIMITED_API
19721 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19722 #else
19723 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19724 #endif
19725 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_inexact) __PYX_ERR(1, 857, __pyx_L1_error)
19726 __pyx_mstate->__pyx_ptype_5numpy_floating = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "floating",
19727 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
19728 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19729 #elif CYTHON_COMPILING_IN_LIMITED_API
19730 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19731 #else
19732 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19733 #endif
19734 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_floating) __PYX_ERR(1, 859, __pyx_L1_error)
19735 __pyx_mstate->__pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "complexfloating",
19736 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
19737 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19738 #elif CYTHON_COMPILING_IN_LIMITED_API
19739 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19740 #else
19741 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19742 #endif
19743 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_complexfloating) __PYX_ERR(1, 861, __pyx_L1_error)
19744 __pyx_mstate->__pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "flexible",
19745 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
19746 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19747 #elif CYTHON_COMPILING_IN_LIMITED_API
19748 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19749 #else
19750 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19751 #endif
19752 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_flexible) __PYX_ERR(1, 863, __pyx_L1_error)
19753 __pyx_mstate->__pyx_ptype_5numpy_character = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "character",
19754 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
19755 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19756 #elif CYTHON_COMPILING_IN_LIMITED_API
19757 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19758 #else
19759 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
19760 #endif
19761 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_character) __PYX_ERR(1, 865, __pyx_L1_error)
19762 __pyx_mstate->__pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "ufunc",
19763 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
19764 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
19765 #elif CYTHON_COMPILING_IN_LIMITED_API
19766 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
19767 #else
19768 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
19769 #endif
19770 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_ufunc) __PYX_ERR(1, 946, __pyx_L1_error)
19771 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19772 __Pyx_RefNannyFinishContext();
19773 return 0;
19774 __pyx_L1_error:;
19775 __Pyx_XDECREF(__pyx_t_1);
19776 __Pyx_RefNannyFinishContext();
19777 return -1;
19778}
19779
19780static int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate) {
19781 __Pyx_RefNannyDeclarations
19782 CYTHON_UNUSED_VAR(__pyx_mstate);
19783 __Pyx_RefNannySetupContext("__Pyx_modinit_Variable_import_code", 0);
19784 /*--- Variable import code ---*/
19785 __Pyx_RefNannyFinishContext();
19786 return 0;
19787}
19788
19789static int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate) {
19790 __Pyx_RefNannyDeclarations
19791 CYTHON_UNUSED_VAR(__pyx_mstate);
19792 __Pyx_RefNannySetupContext("__Pyx_modinit_Function_import_code", 0);
19793 /*--- Function import code ---*/
19794 __Pyx_RefNannyFinishContext();
19795 return 0;
19796}
19797
19798#if CYTHON_PEP489_MULTI_PHASE_INIT
19799static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
19800static int __pyx_pymod_exec_Isosurface(PyObject* module); /*proto*/
19801static PyModuleDef_Slot __pyx_moduledef_slots[] = {
19802 {Py_mod_create, (void*)__pyx_pymod_create},
19803 {Py_mod_exec, (void*)__pyx_pymod_exec_Isosurface},
19804 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
19805 {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE},
19806 #endif
19807 #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
19808 {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
19809 #endif
19810 {0, NULL}
19811};
19812#endif
19813
19814#ifdef __cplusplus
19815namespace {
19816 struct PyModuleDef __pyx_moduledef =
19817 #else
19818 static struct PyModuleDef __pyx_moduledef =
19819 #endif
19820 {
19821 PyModuleDef_HEAD_INIT,
19822 "Isosurface",
19823 __pyx_k_AuxiliaryVariables_subclasses_f, /* m_doc */
19824 #if CYTHON_USE_MODULE_STATE
19825 sizeof(__pyx_mstatetype), /* m_size */
19826 #else
19827 (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */
19828 #endif
19829 __pyx_methods /* m_methods */,
19830 #if CYTHON_PEP489_MULTI_PHASE_INIT
19831 __pyx_moduledef_slots, /* m_slots */
19832 #else
19833 NULL, /* m_reload */
19834 #endif
19835 #if CYTHON_USE_MODULE_STATE
19836 __pyx_m_traverse, /* m_traverse */
19837 __pyx_m_clear, /* m_clear */
19838 NULL /* m_free */
19839 #else
19840 NULL, /* m_traverse */
19841 NULL, /* m_clear */
19842 NULL /* m_free */
19843 #endif
19844 };
19845 #ifdef __cplusplus
19846} /* anonymous namespace */
19847#endif
19848
19849/* PyModInitFuncType */
19850#ifndef CYTHON_NO_PYINIT_EXPORT
19851 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
19852#else
19853 #ifdef __cplusplus
19854 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
19855 #else
19856 #define __Pyx_PyMODINIT_FUNC PyObject *
19857 #endif
19858#endif
19859
19860__Pyx_PyMODINIT_FUNC PyInit_Isosurface(void) CYTHON_SMALL_CODE; /*proto*/
19861__Pyx_PyMODINIT_FUNC PyInit_Isosurface(void)
19862#if CYTHON_PEP489_MULTI_PHASE_INIT
19863{
19864 return PyModuleDef_Init(&__pyx_moduledef);
19865}
19866/* ModuleCreationPEP489 */
19867#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
19868 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
19869static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) {
19870 {
19871 PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think
19872 if (!module) {
19873 if (!PyErr_ExceptionMatches(PyExc_Exception)) {
19874 goto bad; // BaseException
19875 }
19876 PyErr_Clear(); // just try the 3.8-3.12 version
19877 module = PyImport_ImportModule("_xxsubinterpreters");
19878 if (!module) goto bad;
19879 }
19880 PyObject *current = PyObject_CallMethod(module, "get_current", NULL);
19881 Py_DECREF(module);
19882 if (!current) goto bad;
19883 if (PyTuple_Check(current)) {
19884 PyObject *new_current = PySequence_GetItem(current, 0);
19885 Py_DECREF(current);
19886 current = new_current;
19887 if (!new_current) goto bad;
19888 }
19889 long long as_c_int = PyLong_AsLongLong(current);
19890 Py_DECREF(current);
19891 return as_c_int;
19892 }
19893 bad:
19894 PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
19895 return -1;
19896}
19897#endif
19898#if !CYTHON_USE_MODULE_STATE
19899static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
19900 static PY_INT64_T main_interpreter_id = -1;
19901#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
19902 PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
19903#elif CYTHON_COMPILING_IN_GRAAL
19904 PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
19905#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
19906 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
19907 PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
19908#elif CYTHON_COMPILING_IN_LIMITED_API
19909 PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
19910#else
19911 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
19912#endif
19913 if (unlikely(current_id == -1)) {
19914 return -1;
19915 }
19916 if (main_interpreter_id == -1) {
19917 main_interpreter_id = current_id;
19918 return 0;
19919 } else if (unlikely(main_interpreter_id != current_id)) {
19920 PyErr_SetString(
19921 PyExc_ImportError,
19922 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
19923 return -1;
19924 }
19925 return 0;
19926}
19927#endif
19928static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
19929{
19930 PyObject *value = PyObject_GetAttrString(spec, from_name);
19931 int result = 0;
19932 if (likely(value)) {
19933 if (allow_none || value != Py_None) {
19934 result = PyDict_SetItemString(moddict, to_name, value);
19935 }
19936 Py_DECREF(value);
19937 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
19938 PyErr_Clear();
19939 } else {
19940 result = -1;
19941 }
19942 return result;
19943}
19944static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
19945 PyObject *module = NULL, *moddict, *modname;
19946 CYTHON_UNUSED_VAR(def);
19947 #if !CYTHON_USE_MODULE_STATE
19948 if (__Pyx_check_single_interpreter())
19949 return NULL;
19950 #endif
19951 if (__pyx_m)
19952 return __Pyx_NewRef(__pyx_m);
19953 modname = PyObject_GetAttrString(spec, "name");
19954 if (unlikely(!modname)) goto bad;
19955 module = PyModule_NewObject(modname);
19956 Py_DECREF(modname);
19957 if (unlikely(!module)) goto bad;
19958 moddict = PyModule_GetDict(module);
19959 if (unlikely(!moddict)) goto bad;
19960 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
19961 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
19962 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
19963 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
19964 return module;
19965bad:
19966 Py_XDECREF(module);
19967 return NULL;
19968}
19969
19970
19971static CYTHON_SMALL_CODE int __pyx_pymod_exec_Isosurface(PyObject *__pyx_pyinit_module)
19972#endif
19973{
19974 int stringtab_initialized = 0;
19975 #if CYTHON_USE_MODULE_STATE
19976 int pystate_addmodule_run = 0;
19977 #endif
19978 __pyx_mstatetype *__pyx_mstate = NULL;
19979 PyObject *__pyx_t_1 = NULL;
19980 PyObject *__pyx_t_2 = NULL;
19981 Py_ssize_t __pyx_t_3;
19982 PyObject *__pyx_t_4 = NULL;
19983 PyObject *__pyx_t_5 = NULL;
19984 PyObject *__pyx_t_6 = NULL;
19985 int __pyx_lineno = 0;
19986 const char *__pyx_filename = NULL;
19987 int __pyx_clineno = 0;
19988 __Pyx_RefNannyDeclarations
19989 #if CYTHON_PEP489_MULTI_PHASE_INIT
19990 if (__pyx_m) {
19991 if (__pyx_m == __pyx_pyinit_module) return 0;
19992 PyErr_SetString(PyExc_RuntimeError, "Module 'Isosurface' has already been imported. Re-initialisation is not supported.");
19993 return -1;
19994 }
19995 #else
19996 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
19997 #endif
19998 /*--- Module creation code ---*/
19999 #if CYTHON_PEP489_MULTI_PHASE_INIT
20000 __pyx_t_1 = __pyx_pyinit_module;
20001 Py_INCREF(__pyx_t_1);
20002 #else
20003 __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
20004 #endif
20005 #if CYTHON_USE_MODULE_STATE
20006 {
20007 int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
20008 __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "Isosurface" pseudovariable */
20009 if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
20010 pystate_addmodule_run = 1;
20011 }
20012 #else
20013 __pyx_m = __pyx_t_1;
20014 #endif
20015 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
20016 PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
20017 #endif
20018 __pyx_mstate = __pyx_mstate_global;
20019 CYTHON_UNUSED_VAR(__pyx_t_1);
20020 __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
20021 Py_INCREF(__pyx_mstate->__pyx_d);
20022 __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
20023 __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
20024 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20025 /* ImportRefnannyAPI */
20026 #if CYTHON_REFNANNY
20027 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
20028 if (!__Pyx_RefNanny) {
20029 if (PyErr_ExceptionMatches(PyExc_Exception)) {
20030 PyErr_Clear();
20031 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
20032 }
20033 if (!__Pyx_RefNanny)
20034 Py_FatalError("failed to import 'refnanny' module");
20035 }
20036 #endif
20037
20038__Pyx_RefNannySetupContext("PyInit_Isosurface", 0);
20039 __Pyx_init_runtime_version();
20040 if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
20041 __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
20042 __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
20043 __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
20044 /*--- Library function declarations ---*/
20045 /*--- Initialize various global constants etc. ---*/
20046 if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
20047 stringtab_initialized = 1;
20048 if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
20049 if (__pyx_module_is_main_Isosurface) {
20050 if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
20051 }
20052 {
20053 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
20054 if (!PyDict_GetItemString(modules, "Isosurface")) {
20055 if (unlikely((PyDict_SetItemString(modules, "Isosurface", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
20056 }
20057 }
20058 /*--- Builtin init code ---*/
20059 if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
20060 /*--- Constants init code ---*/
20061 if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
20062 if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
20063 /*--- Global type/function init code ---*/
20064 (void)__Pyx_modinit_Global_init_code(__pyx_mstate);
20065 (void)__Pyx_modinit_Variable_export_code(__pyx_mstate);
20066 (void)__Pyx_modinit_Function_export_code(__pyx_mstate);
20067 /*--- Type init code ---*/
20068 if (unlikely((__Pyx_modinit_Exttype___pyx_obj_10Isosurface___pyx_scope_struct__genexpr(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
20069 if (unlikely((__Pyx_modinit_Type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
20070 (void)__Pyx_modinit_Variable_import_code(__pyx_mstate);
20071 (void)__Pyx_modinit_Function_import_code(__pyx_mstate);
20072 if (__Pyx_InitAfterSharedUtility() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
20073 /*--- Execution code ---*/
20074
20075 /* "Isosurface.pyx":7
20076 * AuxiliaryVariables subclasses for extracting isosurfaces and contours
20077 * """
20078 * from collections import defaultdict, OrderedDict # <<<<<<<<<<<<<<
20079 * from itertools import product
20080 * import os
20081*/
20082 {
20083 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_defaultdict,__pyx_mstate_global->__pyx_n_u_OrderedDict};
20084 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_collections, __pyx_imported_names, 2, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
20085 }
20086 __pyx_t_2 = __pyx_t_1;
20087 __Pyx_GOTREF(__pyx_t_2);
20088 {
20089 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_defaultdict,__pyx_mstate_global->__pyx_n_u_OrderedDict};
20090 for (__pyx_t_3=0; __pyx_t_3 < 2; __pyx_t_3++) {
20091 __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 7, __pyx_L1_error)
20092 __Pyx_GOTREF(__pyx_t_4);
20093 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 7, __pyx_L1_error)
20094 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20095 }
20096 }
20097 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20098
20099 /* "Isosurface.pyx":8
20100 * """
20101 * from collections import defaultdict, OrderedDict
20102 * from itertools import product # <<<<<<<<<<<<<<
20103 * import os
20104 * #from proteus.EGeometry import etriple, ecross, enorm, edot
20105*/
20106 {
20107 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_product};
20108 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_itertools, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
20109 }
20110 __pyx_t_2 = __pyx_t_1;
20111 __Pyx_GOTREF(__pyx_t_2);
20112 {
20113 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_product};
20114 __pyx_t_3 = 0; {
20115 __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 8, __pyx_L1_error)
20116 __Pyx_GOTREF(__pyx_t_4);
20117 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 8, __pyx_L1_error)
20118 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20119 }
20120 }
20121 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20122
20123 /* "Isosurface.pyx":9
20124 * from collections import defaultdict, OrderedDict
20125 * from itertools import product
20126 * import os # <<<<<<<<<<<<<<
20127 * #from proteus.EGeometry import etriple, ecross, enorm, edot
20128 *
20129*/
20130 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_os, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
20131 __pyx_t_2 = __pyx_t_1;
20132 __Pyx_GOTREF(__pyx_t_2);
20133 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_os, __pyx_t_2) < (0)) __PYX_ERR(0, 9, __pyx_L1_error)
20134 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20135
20136 /* "Isosurface.pyx":12
20137 * #from proteus.EGeometry import etriple, ecross, enorm, edot
20138 *
20139 * from mpi4py import MPI # <<<<<<<<<<<<<<
20140 * from petsc4py import PETSc
20141 * import numpy as np
20142*/
20143 {
20144 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_MPI};
20145 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_mpi4py, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
20146 }
20147 __pyx_t_2 = __pyx_t_1;
20148 __Pyx_GOTREF(__pyx_t_2);
20149 {
20150 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_MPI};
20151 __pyx_t_3 = 0; {
20152 __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 12, __pyx_L1_error)
20153 __Pyx_GOTREF(__pyx_t_4);
20154 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 12, __pyx_L1_error)
20155 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20156 }
20157 }
20158 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20159
20160 /* "Isosurface.pyx":13
20161 *
20162 * from mpi4py import MPI
20163 * from petsc4py import PETSc # <<<<<<<<<<<<<<
20164 * import numpy as np
20165 * cimport numpy as np
20166*/
20167 {
20168 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_PETSc};
20169 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_petsc4py, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
20170 }
20171 __pyx_t_2 = __pyx_t_1;
20172 __Pyx_GOTREF(__pyx_t_2);
20173 {
20174 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_PETSc};
20175 __pyx_t_3 = 0; {
20176 __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 13, __pyx_L1_error)
20177 __Pyx_GOTREF(__pyx_t_4);
20178 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 13, __pyx_L1_error)
20179 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20180 }
20181 }
20182 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20183
20184 /* "Isosurface.pyx":14
20185 * from mpi4py import MPI
20186 * from petsc4py import PETSc
20187 * import numpy as np # <<<<<<<<<<<<<<
20188 * cimport numpy as np
20189 * from numpy.linalg import norm
20190*/
20191 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_numpy, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
20192 __pyx_t_2 = __pyx_t_1;
20193 __Pyx_GOTREF(__pyx_t_2);
20194 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_np, __pyx_t_2) < (0)) __PYX_ERR(0, 14, __pyx_L1_error)
20195 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20196
20197 /* "Isosurface.pyx":16
20198 * import numpy as np
20199 * cimport numpy as np
20200 * from numpy.linalg import norm # <<<<<<<<<<<<<<
20201 *
20202 * from . import Comm
20203*/
20204 {
20205 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_norm};
20206 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_numpy_linalg, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
20207 }
20208 __pyx_t_2 = __pyx_t_1;
20209 __Pyx_GOTREF(__pyx_t_2);
20210 {
20211 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_norm};
20212 __pyx_t_3 = 0; {
20213 __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 16, __pyx_L1_error)
20214 __Pyx_GOTREF(__pyx_t_4);
20215 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 16, __pyx_L1_error)
20216 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20217 }
20218 }
20219 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20220
20221 /* "Isosurface.pyx":18
20222 * from numpy.linalg import norm
20223 *
20224 * from . import Comm # <<<<<<<<<<<<<<
20225 * from .AuxiliaryVariables import AV_base
20226 * from proteus import Profiling
20227*/
20228 {
20229 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Comm};
20230 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u__5, __pyx_imported_names, 1, __pyx_mstate_global->__pyx_kp_u__2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
20231 }
20232 __pyx_t_2 = __pyx_t_1;
20233 __Pyx_GOTREF(__pyx_t_2);
20234 {
20235 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Comm};
20236 __pyx_t_3 = 0; {
20237 __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 18, __pyx_L1_error)
20238 __Pyx_GOTREF(__pyx_t_4);
20239 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 18, __pyx_L1_error)
20240 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20241 }
20242 }
20243 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20244
20245 /* "Isosurface.pyx":19
20246 *
20247 * from . import Comm
20248 * from .AuxiliaryVariables import AV_base # <<<<<<<<<<<<<<
20249 * from proteus import Profiling
20250 * from .Profiling import logEvent as log
20251*/
20252 {
20253 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_AV_base};
20254 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_AuxiliaryVariables, __pyx_imported_names, 1, __pyx_mstate_global->__pyx_kp_u_AuxiliaryVariables_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
20255 }
20256 __pyx_t_2 = __pyx_t_1;
20257 __Pyx_GOTREF(__pyx_t_2);
20258 {
20259 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_AV_base};
20260 __pyx_t_3 = 0; {
20261 __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 19, __pyx_L1_error)
20262 __Pyx_GOTREF(__pyx_t_4);
20263 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 19, __pyx_L1_error)
20264 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20265 }
20266 }
20267 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20268
20269 /* "Isosurface.pyx":20
20270 * from . import Comm
20271 * from .AuxiliaryVariables import AV_base
20272 * from proteus import Profiling # <<<<<<<<<<<<<<
20273 * from .Profiling import logEvent as log
20274 *
20275*/
20276 {
20277 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Profiling};
20278 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_proteus, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
20279 }
20280 __pyx_t_2 = __pyx_t_1;
20281 __Pyx_GOTREF(__pyx_t_2);
20282 {
20283 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Profiling};
20284 __pyx_t_3 = 0; {
20285 __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 20, __pyx_L1_error)
20286 __Pyx_GOTREF(__pyx_t_4);
20287 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 20, __pyx_L1_error)
20288 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20289 }
20290 }
20291 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20292
20293 /* "Isosurface.pyx":21
20294 * from .AuxiliaryVariables import AV_base
20295 * from proteus import Profiling
20296 * from .Profiling import logEvent as log # <<<<<<<<<<<<<<
20297 *
20298 * from libc.math cimport sqrt
20299*/
20300 {
20301 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_logEvent};
20302 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_Profiling, __pyx_imported_names, 1, __pyx_mstate_global->__pyx_kp_u_Profiling_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
20303 }
20304 __pyx_t_2 = __pyx_t_1;
20305 __Pyx_GOTREF(__pyx_t_2);
20306 {
20307 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_logEvent};
20308 __pyx_t_3 = 0; {
20309 __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 21, __pyx_L1_error)
20310 __Pyx_GOTREF(__pyx_t_4);
20311 switch (__pyx_t_3) {
20312 case 0:
20313 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_log, __pyx_t_4) < (0)) __PYX_ERR(0, 21, __pyx_L1_error)
20314 break;
20315 default:;
20316 }
20317 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20318 }
20319 }
20320 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20321
20322 /* "Isosurface.pyx":47
20323 *
20324 *
20325 * class Isosurface(AV_base): # <<<<<<<<<<<<<<
20326 *
20327 * """Extract isosurfaces"""
20328*/
20329 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_AV_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
20330 __Pyx_GOTREF(__pyx_t_2);
20331 {
20332 PyObject* __pyx_temp[1] = {__pyx_t_2};
20333 __pyx_t_4 = __Pyx_PyTuple_FromArray(__pyx_temp, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 47, __pyx_L1_error)
20334 __Pyx_GOTREF(__pyx_t_4);
20335 }
20336 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20337 __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
20338 __Pyx_GOTREF(__pyx_t_2);
20339 __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 47, __pyx_L1_error)
20340 __Pyx_GOTREF(__pyx_t_5);
20341 __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_Isosurface, __pyx_mstate_global->__pyx_n_u_Isosurface, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_Isosurface, __pyx_mstate_global->__pyx_kp_u_Extract_isosurfaces); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 47, __pyx_L1_error)
20342 __Pyx_GOTREF(__pyx_t_6);
20343 if (__pyx_t_2 != __pyx_t_4) {
20344 if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 47, __pyx_L1_error)
20345 }
20346 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20347
20348 /* "Isosurface.pyx":51
20349 * """Extract isosurfaces"""
20350 *
20351 * def __init__(self, isosurfaces, domain, activeTime=None, # <<<<<<<<<<<<<<
20352 * sampleRate=0, format='pov', writeBoundary=True):
20353 * """Create a set of isosurfaces that will be extracted and serialized
20354*/
20355 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10Isosurface_10Isosurface_1__init__, 0, __pyx_mstate_global->__pyx_n_u_Isosurface___init, NULL, __pyx_mstate_global->__pyx_n_u_Isosurface, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 51, __pyx_L1_error)
20356 __Pyx_GOTREF(__pyx_t_4);
20357 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
20358 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
20359 #endif
20360 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[9]);
20361 if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < (0)) __PYX_ERR(0, 51, __pyx_L1_error)
20362 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20363
20364 /* "Isosurface.pyx":105
20365 * self.fileprefix = 'isosurface'
20366 *
20367 * def attachModel(self, model, ar): # <<<<<<<<<<<<<<
20368 * """ Attach this isosurface to the given simulation model.
20369 * """
20370*/
20371 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10Isosurface_10Isosurface_3attachModel, 0, __pyx_mstate_global->__pyx_n_u_Isosurface_attachModel, NULL, __pyx_mstate_global->__pyx_n_u_Isosurface, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error)
20372 __Pyx_GOTREF(__pyx_t_4);
20373 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
20374 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
20375 #endif
20376 if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_attachModel, __pyx_t_4) < (0)) __PYX_ERR(0, 105, __pyx_L1_error)
20377 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20378
20379 /* "Isosurface.pyx":132
20380 * return self
20381 *
20382 * def attachHDF5(self, h5, step, cam=None): # <<<<<<<<<<<<<<
20383 * """
20384 * Attach this isosurface to and HDF5 archive (an h5py.File)
20385*/
20386 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10Isosurface_10Isosurface_5attachHDF5, 0, __pyx_mstate_global->__pyx_n_u_Isosurface_attachHDF5, NULL, __pyx_mstate_global->__pyx_n_u_Isosurface, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 132, __pyx_L1_error)
20387 __Pyx_GOTREF(__pyx_t_4);
20388 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
20389 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
20390 #endif
20391 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[10]);
20392 if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_attachHDF5, __pyx_t_4) < (0)) __PYX_ERR(0, 132, __pyx_L1_error)
20393 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20394
20395 /* "Isosurface.pyx":154
20396 * return self
20397 *
20398 * def triangulateIsosurface(self, field, value): # <<<<<<<<<<<<<<
20399 * """
20400 * Build a triangular mesh of the isosurface
20401*/
20402 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10Isosurface_10Isosurface_7triangulateIsosurface, 0, __pyx_mstate_global->__pyx_n_u_Isosurface_triangulateIsosurface, NULL, __pyx_mstate_global->__pyx_n_u_Isosurface, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 154, __pyx_L1_error)
20403 __Pyx_GOTREF(__pyx_t_4);
20404 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
20405 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
20406 #endif
20407 if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_triangulateIsosurface, __pyx_t_4) < (0)) __PYX_ERR(0, 154, __pyx_L1_error)
20408 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20409
20410 /* "Isosurface.pyx":344
20411 * normal_indices.append(elements[-1])
20412 *
20413 * def writeIsosurfaceMesh(self, field, value, frame): # <<<<<<<<<<<<<<
20414 * if self.format == 'pov':
20415 * log("Writing pov frame " + repr(frame))
20416*/
20417 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10Isosurface_10Isosurface_9writeIsosurfaceMesh, 0, __pyx_mstate_global->__pyx_n_u_Isosurface_writeIsosurfaceMesh, NULL, __pyx_mstate_global->__pyx_n_u_Isosurface, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error)
20418 __Pyx_GOTREF(__pyx_t_4);
20419 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
20420 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
20421 #endif
20422 if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_writeIsosurfaceMesh, __pyx_t_4) < (0)) __PYX_ERR(0, 344, __pyx_L1_error)
20423 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20424
20425 /* "Isosurface.pyx":355
20426 * log("Isosurface file format not recognized")
20427 *
20428 * def writeIsosurfaceMesh_h5(self, field, value, frame): # <<<<<<<<<<<<<<
20429 * import h5py
20430 * nodes = self.nodes[(field, value)]
20431*/
20432 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10Isosurface_10Isosurface_11writeIsosurfaceMesh_h5, 0, __pyx_mstate_global->__pyx_n_u_Isosurface_writeIsosurfaceMesh_h, NULL, __pyx_mstate_global->__pyx_n_u_Isosurface, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 355, __pyx_L1_error)
20433 __Pyx_GOTREF(__pyx_t_4);
20434 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
20435 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
20436 #endif
20437 if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_writeIsosurfaceMesh_h5, __pyx_t_4) < (0)) __PYX_ERR(0, 355, __pyx_L1_error)
20438 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20439
20440 /* "Isosurface.pyx":372
20441 * f.close()
20442 *
20443 * def writeIsosurfaceMesh_povray(self, field, value, frame): # <<<<<<<<<<<<<<
20444 * """
20445 * Write the triangular mesh to a povray file
20446*/
20447 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10Isosurface_10Isosurface_13writeIsosurfaceMesh_povray, 0, __pyx_mstate_global->__pyx_n_u_Isosurface_writeIsosurfaceMesh_p, NULL, __pyx_mstate_global->__pyx_n_u_Isosurface, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 372, __pyx_L1_error)
20448 __Pyx_GOTREF(__pyx_t_4);
20449 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
20450 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
20451 #endif
20452 if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_writeIsosurfaceMesh_povray, __pyx_t_4) < (0)) __PYX_ERR(0, 372, __pyx_L1_error)
20453 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20454
20455 /* "Isosurface.pyx":523
20456 * self.comm.endSequential()
20457 *
20458 * def calculate(self, checkTime=True): # <<<<<<<<<<<<<<
20459 * """Extracts isosourfaces at current time and update open output files
20460 * """
20461*/
20462 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10Isosurface_10Isosurface_15calculate, 0, __pyx_mstate_global->__pyx_n_u_Isosurface_calculate, NULL, __pyx_mstate_global->__pyx_n_u_Isosurface, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L1_error)
20463 __Pyx_GOTREF(__pyx_t_4);
20464 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
20465 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
20466 #endif
20467 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[11]);
20468 if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_calculate, __pyx_t_4) < (0)) __PYX_ERR(0, 523, __pyx_L1_error)
20469 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20470
20471 /* "Isosurface.pyx":549
20472 * self.next_output += self.sampleRate
20473 *
20474 * def writeSceneHeader(self, cam = None): # <<<<<<<<<<<<<<
20475 * """
20476 * Write a scene description (can be modified before running povray)
20477*/
20478 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10Isosurface_10Isosurface_17writeSceneHeader, 0, __pyx_mstate_global->__pyx_n_u_Isosurface_writeSceneHeader, NULL, __pyx_mstate_global->__pyx_n_u_Isosurface, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 549, __pyx_L1_error)
20479 __Pyx_GOTREF(__pyx_t_4);
20480 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
20481 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
20482 #endif
20483 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[10]);
20484 if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_writeSceneHeader, __pyx_t_4) < (0)) __PYX_ERR(0, 549, __pyx_L1_error)
20485 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20486
20487 /* "Isosurface.pyx":47
20488 *
20489 *
20490 * class Isosurface(AV_base): # <<<<<<<<<<<<<<
20491 *
20492 * """Extract isosurfaces"""
20493*/
20494 __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Isosurface, __pyx_t_2, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 47, __pyx_L1_error)
20495 __Pyx_GOTREF(__pyx_t_4);
20496 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
20497 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
20498 #endif
20499 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Isosurface, __pyx_t_4) < (0)) __PYX_ERR(0, 47, __pyx_L1_error)
20500 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20501 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20502 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20503 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20504
20505 /* "Isosurface.pyx":1
20506 * #!python # <<<<<<<<<<<<<<
20507 * # cython: language_level=3
20508 * # cython: embedsignature=True
20509*/
20510 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
20511 __Pyx_GOTREF(__pyx_t_2);
20512 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_2) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
20513 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20514
20515 /*--- Wrapped vars code ---*/
20516
20517 goto __pyx_L0;
20518 __pyx_L1_error:;
20519 __Pyx_XDECREF(__pyx_t_2);
20520 __Pyx_XDECREF(__pyx_t_4);
20521 __Pyx_XDECREF(__pyx_t_5);
20522 __Pyx_XDECREF(__pyx_t_6);
20523 if (__pyx_m) {
20524 if (__pyx_mstate->__pyx_d && stringtab_initialized) {
20525 __Pyx_AddTraceback("init Isosurface", __pyx_clineno, __pyx_lineno, __pyx_filename);
20526 }
20527 #if !CYTHON_USE_MODULE_STATE
20528 Py_CLEAR(__pyx_m);
20529 #else
20530 Py_DECREF(__pyx_m);
20531 if (pystate_addmodule_run) {
20532 PyObject *tp, *value, *tb;
20533 __Pyx_PyErr_FetchException(&tp, &value, &tb);
20534 __Pyx_State_RemoveModule(&__pyx_moduledef);
20535 __Pyx_PyErr_RestoreException(tp, value, tb);
20536 }
20537 #endif
20538 } else if (!PyErr_Occurred()) {
20539 PyErr_SetString(PyExc_ImportError, "init Isosurface");
20540 }
20541 __pyx_L0:;
20542 __Pyx_RefNannyFinishContext();
20543 #if CYTHON_PEP489_MULTI_PHASE_INIT
20544 return (__pyx_m != NULL) ? 0 : -1;
20545 #else
20546 return __pyx_m;
20547 #endif
20548}
20549/* #### Code section: pystring_table ### */
20550/* #### Code section: cached_builtins ### */
20551
20552static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
20553 int __pyx_lineno = 0;
20554 const char *__pyx_filename = NULL;
20555 int __pyx_clineno = 0;
20556 CYTHON_UNUSED_VAR(__pyx_mstate);
20557 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 122, __pyx_L1_error)
20558 __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_print); if (!__pyx_builtin_print) __PYX_ERR(0, 138, __pyx_L1_error)
20559 __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_open); if (!__pyx_builtin_open) __PYX_ERR(0, 387, __pyx_L1_error)
20560 __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 556, __pyx_L1_error)
20561
20562 /* Cached unbound methods */
20563 __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
20564 __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items;
20565 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
20566 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
20567 __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
20568 __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values;
20569 return 0;
20570 __pyx_L1_error:;
20571 return -1;
20572}
20573/* #### Code section: cached_constants ### */
20574
20575static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
20576 __Pyx_RefNannyDeclarations
20577 int __pyx_lineno = 0;
20578 const char *__pyx_filename = NULL;
20579 int __pyx_clineno = 0;
20580 CYTHON_UNUSED_VAR(__pyx_mstate);
20581 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
20582
20583 /* "Isosurface.pyx":26
20584 *
20585 * cdef np.ndarray[np.float64_t,ndim=1] EVec(double x=0.0, double y=0.0, double z=0.0):
20586 * cdef np.ndarray [np.float64_t, ndim=1] v = np.zeros((3,),'d') # <<<<<<<<<<<<<<
20587 * v[0] = x
20588 * v[1] = y
20589*/
20590 {
20591 PyObject* __pyx_temp[1] = {__pyx_mstate_global->__pyx_int_3};
20592 __pyx_mstate_global->__pyx_tuple[0] = __Pyx_PyTuple_FromArray(__pyx_temp, 1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 26, __pyx_L1_error)
20593 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
20594 }
20595 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);
20596 {
20597 PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_tuple[0], __pyx_mstate_global->__pyx_n_u_d};
20598 __pyx_mstate_global->__pyx_tuple[1] = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 26, __pyx_L1_error)
20599 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
20600 }
20601 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);
20602
20603 /* "Isosurface.pyx":139
20604 * self.fieldNames = [isosurface[0] for isosurface in self.isosurfaces]
20605 * print("ATTACHING TO HDF5 !!", self.fieldNames)
20606 * self.elementNodesArray = h5["/elementsSpatial_Domain" + repr(step)][:] # <<<<<<<<<<<<<<
20607 * self.nodeArray = h5["/nodesSpatial_Domain" + repr(step)][:]
20608 * self.num_owned_elements = len(self.elementNodesArray)
20609*/
20610 __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(0, 139, __pyx_L1_error)
20611 __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]);
20612 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
20613
20614 /* "Isosurface.pyx":145
20615 * FemField = namedtuple('FemField', ['dof'])
20616 * for field_i, field in enumerate(self.fieldNames):
20617 * self.u[field_i] = FemField(dof=h5["/" + # <<<<<<<<<<<<<<
20618 * self.isosurfaces[0][0] +
20619 * repr(step)][:])
20620*/
20621 {
20622 PyObject* __pyx_temp[1] = {__pyx_mstate_global->__pyx_n_u_dof};
20623 __pyx_mstate_global->__pyx_tuple[2] = __Pyx_PyTuple_FromArray(__pyx_temp, 1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 145, __pyx_L1_error)
20624 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]);
20625 }
20626 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);
20627
20628 /* "Isosurface.pyx":366
20629 * else:
20630 * f = h5py.File(filename, "a")
20631 * dset = f.create_dataset('nodes'+str(self.nFrames), data=nodes) # <<<<<<<<<<<<<<
20632 * dset = f.create_dataset('elems'+str(self.nFrames), data=elements)
20633 * dset = f.create_dataset('normals'+str(self.nFrames), data=normals)
20634*/
20635 {
20636 PyObject* __pyx_temp[1] = {__pyx_mstate_global->__pyx_n_u_data};
20637 __pyx_mstate_global->__pyx_tuple[3] = __Pyx_PyTuple_FromArray(__pyx_temp, 1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 366, __pyx_L1_error)
20638 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]);
20639 }
20640 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]);
20641
20642 /* "Isosurface.pyx":381
20643 * normals = self.normals[(field, value)]
20644 * normal_indices = self.normal_indices[(field, value)]
20645 * pov_filename = "{field:s}_{value:f}_{frame:04d}.pov".format( # <<<<<<<<<<<<<<
20646 * field=field,
20647 * value=value,
20648*/
20649 {
20650 PyObject* __pyx_temp[3] = {__pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_value, __pyx_mstate_global->__pyx_n_u_frame};
20651 __pyx_mstate_global->__pyx_tuple[4] = __Pyx_PyTuple_FromArray(__pyx_temp, 3); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(0, 381, __pyx_L1_error)
20652 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]);
20653 }
20654 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);
20655
20656 /* "Isosurface.pyx":416
20657 * tank_material()
20658 * }//object
20659 * """).substitute(nll_x=nll[0], # <<<<<<<<<<<<<<
20660 * nll_y=nll[1],
20661 * nll_z=nll[2],
20662*/
20663 {
20664 PyObject* __pyx_temp[12] = {__pyx_mstate_global->__pyx_n_u_nll_x, __pyx_mstate_global->__pyx_n_u_nll_y, __pyx_mstate_global->__pyx_n_u_nll_z, __pyx_mstate_global->__pyx_n_u_fur_x, __pyx_mstate_global->__pyx_n_u_fur_y, __pyx_mstate_global->__pyx_n_u_fur_z, __pyx_mstate_global->__pyx_n_u_domain_nll_x, __pyx_mstate_global->__pyx_n_u_domain_nll_y, __pyx_mstate_global->__pyx_n_u_domain_nll_z, __pyx_mstate_global->__pyx_n_u_domain_fur_x, __pyx_mstate_global->__pyx_n_u_domain_fur_y, __pyx_mstate_global->__pyx_n_u_domain_fur_z};
20665 __pyx_mstate_global->__pyx_tuple[5] = __Pyx_PyTuple_FromArray(__pyx_temp, 12); if (unlikely(!__pyx_mstate_global->__pyx_tuple[5])) __PYX_ERR(0, 416, __pyx_L1_error)
20666 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[5]);
20667 }
20668 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[5]);
20669
20670 /* "Isosurface.pyx":441
20671 * union
20672 * {
20673 * """).substitute(nll_x=nll[0], # <<<<<<<<<<<<<<
20674 * nll_y=nll[1],
20675 * nll_z=nll[2],
20676*/
20677 {
20678 PyObject* __pyx_temp[6] = {__pyx_mstate_global->__pyx_n_u_nll_x, __pyx_mstate_global->__pyx_n_u_nll_y, __pyx_mstate_global->__pyx_n_u_nll_z, __pyx_mstate_global->__pyx_n_u_fur_x, __pyx_mstate_global->__pyx_n_u_fur_y, __pyx_mstate_global->__pyx_n_u_fur_z};
20679 __pyx_mstate_global->__pyx_tuple[6] = __Pyx_PyTuple_FromArray(__pyx_temp, 6); if (unlikely(!__pyx_mstate_global->__pyx_tuple[6])) __PYX_ERR(0, 441, __pyx_L1_error)
20680 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[6]);
20681 }
20682 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[6]);
20683
20684 /* "Isosurface.pyx":571
20685 * self.domain.L[1] # offset slightly
20686 * sky_z = self.domain.x[2] + 10 * self.domain.L[2]
20687 * pov = open("proteus.inc", "w") # <<<<<<<<<<<<<<
20688 * povSceneTemplate = Template("""#include "colors.inc"
20689 * #include "textures.inc"
20690*/
20691 {
20692 PyObject* __pyx_temp[2] = {__pyx_mstate_global->__pyx_kp_u_proteus_inc, __pyx_mstate_global->__pyx_n_u_w};
20693 __pyx_mstate_global->__pyx_tuple[7] = __Pyx_PyTuple_FromArray(__pyx_temp, 2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[7])) __PYX_ERR(0, 571, __pyx_L1_error)
20694 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[7]);
20695 }
20696 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[7]);
20697
20698 /* "Isosurface.pyx":714
20699 * #end
20700 * """)
20701 * pov.write(povSceneTemplate.substitute(look_at_x=look_at[0], # <<<<<<<<<<<<<<
20702 * look_at_y=look_at[1],
20703 * look_at_z=look_at[2],
20704*/
20705 {
20706 PyObject* __pyx_temp[14] = {__pyx_mstate_global->__pyx_n_u_look_at_x, __pyx_mstate_global->__pyx_n_u_look_at_y, __pyx_mstate_global->__pyx_n_u_look_at_z, __pyx_mstate_global->__pyx_n_u_cam_x, __pyx_mstate_global->__pyx_n_u_cam_y, __pyx_mstate_global->__pyx_n_u_cam_z, __pyx_mstate_global->__pyx_n_u_light_x, __pyx_mstate_global->__pyx_n_u_light_y, __pyx_mstate_global->__pyx_n_u_light_z, __pyx_mstate_global->__pyx_n_u_light_dx, __pyx_mstate_global->__pyx_n_u_light_dy, __pyx_mstate_global->__pyx_n_u_floor_z, __pyx_mstate_global->__pyx_n_u_wall_y, __pyx_mstate_global->__pyx_n_u_sky_z};
20707 __pyx_mstate_global->__pyx_tuple[8] = __Pyx_PyTuple_FromArray(__pyx_temp, 14); if (unlikely(!__pyx_mstate_global->__pyx_tuple[8])) __PYX_ERR(0, 714, __pyx_L1_error)
20708 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[8]);
20709 }
20710 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[8]);
20711
20712 /* "Isosurface.pyx":51
20713 * """Extract isosurfaces"""
20714 *
20715 * def __init__(self, isosurfaces, domain, activeTime=None, # <<<<<<<<<<<<<<
20716 * sampleRate=0, format='pov', writeBoundary=True):
20717 * """Create a set of isosurfaces that will be extracted and serialized
20718*/
20719 {
20720 PyObject* __pyx_temp[4] = {Py_None, ((PyObject*)__pyx_mstate_global->__pyx_int_0), ((PyObject*)__pyx_mstate_global->__pyx_n_u_pov), ((PyObject*)Py_True)};
20721 __pyx_mstate_global->__pyx_tuple[9] = __Pyx_PyTuple_FromArray(__pyx_temp, 4); if (unlikely(!__pyx_mstate_global->__pyx_tuple[9])) __PYX_ERR(0, 51, __pyx_L1_error)
20722 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[9]);
20723 }
20724 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[9]);
20725
20726 /* "Isosurface.pyx":132
20727 * return self
20728 *
20729 * def attachHDF5(self, h5, step, cam=None): # <<<<<<<<<<<<<<
20730 * """
20731 * Attach this isosurface to and HDF5 archive (an h5py.File)
20732*/
20733 {
20734 PyObject* __pyx_temp[1] = {Py_None};
20735 __pyx_mstate_global->__pyx_tuple[10] = __Pyx_PyTuple_FromArray(__pyx_temp, 1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[10])) __PYX_ERR(0, 132, __pyx_L1_error)
20736 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[10]);
20737 }
20738 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[10]);
20739
20740 /* "Isosurface.pyx":523
20741 * self.comm.endSequential()
20742 *
20743 * def calculate(self, checkTime=True): # <<<<<<<<<<<<<<
20744 * """Extracts isosourfaces at current time and update open output files
20745 * """
20746*/
20747 {
20748 PyObject* __pyx_temp[1] = {((PyObject*)Py_True)};
20749 __pyx_mstate_global->__pyx_tuple[11] = __Pyx_PyTuple_FromArray(__pyx_temp, 1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[11])) __PYX_ERR(0, 523, __pyx_L1_error)
20750 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[11]);
20751 }
20752 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[11]);
20753 #if CYTHON_IMMORTAL_CONSTANTS
20754 {
20755 PyObject **table = __pyx_mstate->__pyx_tuple;
20756 for (Py_ssize_t i=0; i<12; ++i) {
20757 #if PY_VERSION_HEX >= 0x030F0000
20758 PyUnstable_SetImmortal(table[i]);
20759 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
20760 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
20761 #if PY_VERSION_HEX < 0x030E0000
20762 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
20763 #else
20764 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
20765 #endif
20766 {
20767 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
20768 }
20769 #else
20770 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
20771 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
20772 #endif
20773 }
20774 }
20775 #endif
20776 #if CYTHON_IMMORTAL_CONSTANTS
20777 {
20778 PyObject **table = __pyx_mstate->__pyx_slice;
20779 for (Py_ssize_t i=0; i<1; ++i) {
20780 #if PY_VERSION_HEX >= 0x030F0000
20781 PyUnstable_SetImmortal(table[i]);
20782 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
20783 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
20784 #if PY_VERSION_HEX < 0x030E0000
20785 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
20786 #else
20787 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
20788 #endif
20789 {
20790 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
20791 }
20792 #else
20793 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
20794 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
20795 #endif
20796 }
20797 }
20798 #endif
20799 __Pyx_RefNannyFinishContext();
20800 return 0;
20801 __pyx_L1_error:;
20802 __Pyx_RefNannyFinishContext();
20803 return -1;
20804}
20805/* #### Code section: init_constants ### */
20806
20807static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
20808 int __pyx_lineno = 0;
20809 const char *__pyx_filename = NULL;
20810 int __pyx_clineno = 0;
20811 CYTHON_UNUSED_VAR(__pyx_mstate);
20812 {
20813 const struct { const unsigned int length: 12; } str_length_index[] = {{166},{645},{307},{67},{69},{67},{3869},{38},{1},{19},{10},{3},{1},{27},{23},{20},{23},{21},{23},{1},{20},{25},{54},{19},{37},{31},{18},{7},{6},{44},{2},{9},{24},{39},{34},{47},{11},{22},{7},{35},{2},{357},{0},{7},{18},{4},{8},{4},{1},{10},{19},{21},{22},{39},{20},{32},{30},{33},{37},{27},{1},{1},{3},{11},{5},{9},{8},{20},{12},{17},{7},{8},{8},{8},{13},{10},{15},{8},{11},{12},{8},{13},{1},{10},{2},{5},{18},{10},{11},{7},{15},{2},{3},{13},{9},{3},{5},{5},{5},{9},{18},{5},{12},{11},{4},{13},{14},{1},{4},{11},{3},{6},{12},{12},{12},{12},{12},{12},{4},{2},{1},{2},{3},{28},{25},{17},{8},{5},{13},{9},{3},{30},{1},{5},{10},{7},{8},{10},{9},{7},{7},{5},{6},{5},{3},{5},{5},{5},{3},{7},{3},{2},{2},{4},{1},{5},{8},{10},{11},{5},{9},{1},{4},{14},{5},{8},{8},{7},{7},{7},{3},{6},{8},{7},{9},{9},{9},{4},{5},{5},{6},{1},{16},{7},{6},{8},{5},{6},{10},{4},{11},{2},{3},{5},{5},{5},{9},{5},{4},{6},{14},{7},{2},{18},{5},{12},{4},{2},{4},{8},{3},{4},{3},{3},{8},{16},{12},{5},{7},{7},{4},{1},{10},{4},{4},{10},{5},{5},{4},{6},{10},{5},{5},{4},{15},{21},{1},{1},{5},{6},{13},{1},{6},{5},{13},{19},{22},{26},{16},{1},{5},{3}};
20814 const struct { const unsigned int length: 12; } bytes_length_index[] = {{84},{242},{187},{1011},{2717},{2},{217},{524},{227},{135}};
20815 #ifndef CYTHON_COMPRESS_STRINGS
20816 #define CYTHON_COMPRESS_STRINGS 90
20817 #endif
20818 #if (CYTHON_COMPRESS_STRINGS) == 3 && __PYX_LIMITED_VERSION_HEX >= 0x030e0000 /* compression: zstd (4482 bytes) */
20819static const char cstring[] = "(\265/\375`c3\305\213\000Z\232\224 H\340\3208\0070\3143\004\306\363\004B`|\204\2010\020\006\314\016\263#\214\261H\023\364\333\203H\221\266EZimo.)\317\372\017\002\376\325>\004~\034\345\037\002\335\270\274\352w 2\244\216\276DO\240\333j\267#\364}\327\001\325\001\016\002\236\026\277\355tz\030&\273\377\252O\306W\034\375\214da\376\373\335\363\344\327\267\216\177\301\312\342S\277G\324\335V\303\213[Z\377m\205\030J\324\217\340g\325\366\272li\361\212\340\226\002\243R\311\240\301\364\002\252@Q\313\337v\343la\027~Tc\214J~\030\336\267\274\227\331\261\266\266\010\353\301#xRUN>\243\024(.\200\370\273o\362\263]\330`6\013\247\025-2\230N*\333\313^\341C\352\032\253\342g}v(\2227U%\207\002\316\236u\231\214T\250P\333I\014\001\216\366f\303i\343P\177\264\236N\376\255mN\035\275\377LF\372\276K\374\352_;\222\365\373l\313\227\256 \256///\027.\\PQ\355+\342\215I\255B\231P)0\031>\013\277\305\326\t\231O}/\227Xw\262m;\0308U\177\014/\013\013Y\252d0t\217\314zx|\236\047\265\315\357\262\036\214\006T\n\225\252*-\0324h\330XL\047\237\232C\030\236e\215F?#T\265.\227\r\273\357]\245i{\251\2540\327\261\333\367E\226\313\356\375\232\205\307p\004\352ksk\333\213\305\355\335\022D=i[\030\303\376\342\255\277\021\217v\277K\3331\374\330\357Q\211i\304^I\375\257\034\275+\232d\3143ZW\306\327\247\352\367\304\237\367,\230K\215\265\370S\201\302h\305\374\035\214k7L\335NU\345d\332\352K\215\211y[W\035\311\262\2756\274\342w\313\357Y\271\334\025\304\365G\326]\321\272\360w\261x\313\321O+\0243I\22655\227`\376\233\261W7\370\017\303c\315\366qjU\201\351\221\251\304\272q\274\047/5\206Y\365\275\373\371AP\374VVF>\243\355\375\013\026\036\005\235\276WF\246D\322\345\322\345\025]=\262}\237\207&\2133!\036{dZ\0141>\317\217W\304/^\350\021k\021Z\214\275(#U-U\353\206,T\330\322\345\010\336\337\340\047\346\020\214e\362\212\235\306\001E\232\330k\362\363\277\346\364\223\262\035\02118\254\307\371\217\311zd \376\276\357\333\257\355\266\337g\357\342\333m\317\345\022=\021\004\037{\257\361\350}\347\365\310\\\326\3238\373\262.\353~\371z\235+\206/\262\264""\t\213\336\225i\233\355\216\265\177\305]b\275\365\3571[\3623\351\262\367\357w8\377X~\330\356\367\360\347\332\037v\336\306\367\332\256\003?g\307\036\247\213\311Ht\035\351\372\035Og\207\206\304\366\304\231\357\363\010\017$D\204\370\220\377\263\177\343\351\250Z\235\0101\303\302\273\275L\306\376~h\202\321x|1\215\"Z\236\335\333v\335\026;\01755\256\257q\271\260\314k\313\352Lp\372M?_\352\344\342\323}9Z\036\237\356G\273|\343\213\240\317(&#M+0|g\304z\302\255rgL\272\266(\263y\217\245\313\364\331$#]\345\215=\352\323\242\027\336\267<\047\276\346\022\357\357\251\262\361\216\370n\210\275\317u\343[\277z\320\333\263y\307h\364\256\256\214\303\321\326]\262v\255\317c[\225\246\276K\334u\333\261\376\036\255L\251TU537u\304N\265\301\361p#\303\355\354p\035@\020\034\251\300\2406\237\252\362\363\271\234|^\376\303we\246\333\226\324\321?\376\312\250\245\337\365\237\250\257\270\262\262\242j\231\302\013\342L\302\244\177dY\023\262l\305Q\214\225\234\311T\376\306\231,\251\033ZL,:?\217\t\013\013J\245A\303h4\032\215\002iF\t\240\247\0054\222LO!\231\030\2026\023\304\000\000\217\032\335\000Wu\224\020\032G\261u\027\2574\047\rQ\014\020h+\316c\212\200\224R\227J\253\016j$\223N\352;#5.-IK\244Dh\251\215o\223\300*\324M\246G\220\335:\003N\022R\333R\0334\305\200Fz\021\3642E8j\257\240\005\233=\321Az\311\362\0257\341\014@H\3343\007\010\000@\241\306F\341\243#enk\256L\036Vg\351%\021\276c\n\340\316\222\363\3530\236\342\245\222\323\343\334\351!?\301`z\230\244\036\303\364`\226\244^\"\321l\311\364\340\250m3\233\364E\204&\342\002(\201\001\000\005V\033\037\021:e<B\211\223\2304@\252\263B/A\351$\\\004\211g\023D\010\202\032g\202t\244\204\272\016\177P\232\"\tj\334\353D9Iz\211\203\026B9\364\n\034\007\210\343\014pF\0001=\000!00\343\005\264\000\310\000\r\232Y\203t\007\345\320\0174\204\236*\2554+\221Z@\277su\232\234\244\320L\225\036@g6N\005f\020\327S8\211\323l|\203\313R\240\240\2418A;\261C+i\240\320\370f\253\231\311\2144\203\201\236\240$\247\201\376\342(\274\204\211Z\241\341\031sv\034\204\223\024\250\275:\201\316\342-\363\304""\364(P#\235\023z\200.3S\346G\201\332\326mx\t\2571EfG\201Z\207\202\220\371\002\352@\000`@\r\213\302N\002\347\253O\340\037|\304$!\250\225\322\026\324\306B\007\255\203\243\306\235\333\271{NG\351\240\275\200\024p\324J\\\2331\240\024\320\201\0025n\006)\366\350\030\214G\363\2249\374}=\300pn\355\020\373w\271\305\255Ye\336Z\203\333\346\274\325:o/\223\373\212\035\211IRl\221O\222\032\337\047\277\373\376\302pG^}\307\273K\262\333#Y\356O\253\030I\334\235\355\326\035\316\025qs\315\r%\216#\272\t\311\246\310\252\007H\206CXY\363C\350\246\306\352\214\301#\220TD\245\315\3340U\251\004n\3661s\200n\027j-\276\301,\231\001^]\344)F\027\023\t,\016h\033\36701c\2450\047\264\322\371u\t\th+ \004\251\324\305\t\262*\205zE@\333\272\211\210\224j@\271lp\331H3\274\240l\322\024\030]\202\210E\215\030\217\320e\344d\356\024\205\240\354\031\342\321\047\360OBI\211\260\237\364\321\243d\223L\022\001\321\316G\247!a\345\254h+\0224\026\r\330,5\363\230y\251\r\253\224\352t\256\245%\047w\324f\023\322\017=\331\337@\244\306\342,\326\\\360\342\021D4\256\213z\355\240y<\304%\304Cl\240\"\024RV.\246\rw\202]\002\010\215\206\315l\206C\233\350(\037\264\034\022)u\252\225h\224\230\241f\033 P\321\277\004m\034\265MD\232\345\024%\r\220\316|\320\211B\001\224\221Z(e\225T\336I\004V\032\222r\351\033CmK\341\237\271`K\031\240; 1\234\3462:&\027\n*\245z\246\204\222P\032\216\2370C:\202\270\n&2\351G:\341\343\304\320M\314,@\215\220V\217\306\240\"\224\0173\221\n\024\004\315\333\311\300\204\007\010\311h\226\276Q\3423\"\244V\310!\300L\221\336\021\232\241\322\014h\t-q\242\316\335m\217\351%\0138\211\312I\350\346AJliR\033\354\223\236\226\331\007H\271\264DQbHz\007\367\340\344\316\224\376q\010\016j\334l\2331@\275N\025\035\244{\034\272\241\033(\253t\352\217\316q\007#\002x<`\332\236,\247\211\226\220\214\216\031\022D\022\341$\334\362\230\020\037\t\251\205\010\360\021\315\222J\031\241\315l%\314\017\021\177\231(%\264\245\2467\340>\240\004\335\203f~t0\321>\364\023\034EB{\272\n\036\2321\346\315\206\0368_p\230\231s\242\350.\334\246&\001\207\320Q\023:u:""\212#\204R\250c\326\233*%B\245j\244I*\031\306\323`(@(\023\013H%z\367\001\243U\332<\024\221 \007\r!F\031B\210H \"\"\"\"\022H \"\222\244\r\337a\374\314\233 \373DTe_jN\026Fx\235\252\372\005\260\3540\244\020h\"\024\001\202;\3421\352<u\347\246\226l\002qe\355Lf~D)1\\z\225\047\230;\020b`\014\022\362\240\267\300\240@\314\227\313\302\227\251\200:\220\203Y\353\t(\226\021\002\021\020\365\2405\035\276\201\024\272\262\340-\234\010D\033\221\350Y\255dls\310Z\r\027y\321\203H\236]\233=n\366\020\010O\353\031#p.s\027?\366w\372\341<\330PPa)\311\251J#\260\351\236RXE\n\376o_p\323\276T\016\234W\203\2540!\021\307\177\213\332\366\242\314\nF\257\026\r\047O+`\346B\275|\357\005\033\031.M-\212L\2218\030\335\370*\022m\223N\n\207\325\253<\3077\361\267\355\342\265/\323\2612pX\203zSu]K\007+\021\342\244\361n\022\242\320!\241\013\037\207\375\366\nn\307pU\346gl\033^\354W\231\201\355\3224\250=\047\343\n\306\013\327\343~%:\317\260Eo\007d\047ko\351o\340w\222\253m\250\000+\301`\271\306p\314q\000\331\230\257#\254\372,[Ku\322*\247\004\030&\240\027\224\"\031\027\315:\036\036\256\367\242\260:\005;\246\020w\007\221[\342\364M}L\337\324K)\356\272G\276\230\204\216\316GtVF\225Z9\030+\326\364\002fxg\306\030X\375\235\225\247\3714\352\2249Y\336\3452\025\007\016!\003\212\361aLn\262+\036\212\267\310\313\377\375\337\217\260K\001gh\013\272\237\327\366:x\263\234\213\236\037 \231\372\t\355A\343\323\201\213CL\245\224[V\313\275\322\343\225Sw;\261.\004\350$\tM\371\225\242\325\327\352\215$\370\326\306\224\213\305\374\275\037\276\332\022\025\374)\246\376B\235&\\T\325\344\207\245\376~\255W\342\234\304\007\014\306\002\3222/\223h\377\201\354_.\372\262,\376\222n%q#\342H\017_?N\363$;\343\245\273\266\230\2029v\020\261\230\"\320\223\363\251\330\261\252\013\231\230\364\351\264\301\034\322\326\313\200\271\0339\303+\020>\037w}\010\220L\247o5\303\303\252R=\177\202b\331Mz\332\327\rz\352\363\272\313\035cR\037mC\247\234M\023\266\030\326\336\340\006\367\\X\200\312\013\302b\266)\352\270\325\310\223Ql\274\035\003\320\326\013\255\355;Ll\251r>a""\200\244 \264\023\337q\222\204\354K*s\306I\225\330\315\236\231\2119pH\202\300ND\002\331\335\306a\003\237\321\375[(\031z2\267\325\304rl_)Md\224H\322\211\201o\346\315?\320Wj\030Me\305\035\320_\004\300|\375\n\233\253v,~\332\217\204\326.\361\263\207@\236\316mq\013\367}\000\305\t\026\335\327\260\340\216F\302[\307\224\250a\005p\000:q\005Cd\323r\314W#\355\003\266!\323\302\357\243\3302\021&\023\246\264C\367]\333\257Y\344\013\374\375\225,\232g\255\337\030\233\263\252t({\020<a\252\331\021&,\244M8\014&\310\202\345?\"\370\003P\232\244`\362\275E\240<\325]\373k^|\34196\323K\307>u$/\2332\313\210\236A\357\371w\204qU\340[\356\222h\220\314\005/\313/\340\233\203)6\247\353\275\3407\026\263!\213\366\250e\306\255\262%r\351}4\332@\300\271\275IYO\240{\276M\263\254dg\322\026n\227\037$*\270t\326\350\203\312\211c\365[nL\347\n\254\217c\002\304!\317^E!\200T\217\2317\251\251\323;\026\032l\037\220\260Se\036\273\t\3324\272\246\360\356:\323rXT\027\275\2716\234Rq\216\003\235m\331\216r\236\246\004\234\017\000\200\353x\204`\006\253\302\210\332\241\225\014\240q\337\322\013\347\267\314\0346\206\307\331;=\350\034\020\215\244\2272\214\335A=\341\n\200:<\253\350\361\321(I\367\250<\234\3773\006\324\016Q\"\343\273X)\207\245\253e)\241X\334\353\020%\360\"\213Qq\214\331]\336\366\250\2071*/\030\314!N\242\305\035\201U\364z\251g\031f\353G\240\251\270\210\341\302\363\374\010\200}\031 \026\301d\324@H\237ms\303\206K\335\366\217@D\256\313\362\234\301\302U\036j)\257\026\352\"p\346\223^\221O|\013/_\020\272\245\200n%\3226\t\020SN\006\225|\343dp\036\366\026\326%\233\335\372\217I\223|\213\220\340\214\032\330\363\005s\314c3\225\277iR\325\214F\037\264>\264\225o\017\350r\235t\374\344\246\030\021X4\273\205{:\025e\337\264B\207\262\361\242\314\237\010\256\367\332\005G\250\203v\217\241Qw\036\377\367j\240J\t\232\310\027\301\362\274\300\341\274\006\221\213,\343\242\343S\312\312\"2\203f\331\310\367\2736[\036y\275@$\354M\361<r?V\375\322Lv]\203\333\325\037\326\270IV\342^\326\t\013\312\306\214\207=\241\241\212g\014\030?\212XA\225)\240N""\223\004\351\362}\261$PZ\001?E\251\3302\313N\n\010bzm\255\262\212\334\337\216Z\017\204H\32314[\024\022\224\"1R\n(E\237\373Q\346\207\325T\375\267\342\254\274\"\211\324\300D\031DXQ\350\014Q\373.\234\303 \363\2442\211w\246|\236\205J>\\;\312{\0064D\010\000m\230\231\024\027\235\265\217\314B\014<\302\352\320i\000\036\262I\250\332xN\330~n\346i\263E-5\047\305L\r\300\352\023\341\013\006\304\302\010\301\345\"\345\022\343\026\344WEnp\047s\023\263\274T@\326\361\251\204\023\025\211\0022\355\202\367\375\004\346\234\211\207\0264\303\207\010 \217\301\332\013\"s\360F\025\\DB\244\037\326\260\324\n\313\207\351\0372n\211\301u\001\321\"\314\226\325)\030\333\323\240\375\235\000\340KwQb\230~Jk\202U\321\201*\331\364 \037]\322\324q\222Ei\344\034\374hYM\367Pu\223\210\262\222<\341\0471tx\017\261!\1770~\022t\307\344\231\345h\016\350\0259\336\257v,\256\0018\014\310\3768B\245#\232\004\311\215\000\212(@\177Upf\231\260\205\276\300\005\244\004\341Dv\351\010)\3060\201\016n\262\300q\257K+g\205\"+CW\0370\333H\352sGC\035\373\374_\345O^\216N\371SU6\367x0\240\312b\327\r}\332\t?\214B\001\023\351\303\3040_\266U\"\362?\265\020K\215\032\210\246Mf4\261\221\271\006\204[\334\204\214\334\201\377v\266\"\304\047\017\215\363\025\200\345\311\367&\225\006\233\3642\336\037\0107\252\273\215\000\336\353\016\300\305\336u\266\177\035}\373l$\213\331\275\030){\216\210\214?\367BjD\013\241;\205\277$\262\252\263]\002\004\006\223a,\242\337\301\210\364Q-\373}\326\004\241`\243W[\212&\275\217R\376\021XQ\331\022\350AE\014\r\267\373C\204\275=T\211]\254\344jri@\300\201x\324w;\262\251\3560\303[/h\351\376\004\266\204:v\310G\325Cf9\200\377*\353\275\276PP\374I\025\377\222\005\364\321i\227\310\376;\027\014x;\237\007D\203%\207ml\213\310\3407\000M\002p\021;\232\331\376V\335\236\351\016\213\t\350^\231]F\306>\260\360\260\0302\216\016\225n\036#\031\r\227\037`\021y\261\374=\277i\047\275F\365\235\342\303#U\274\033\200\316\261t\345\3524\270_\2023\335\232\351\030\315\343H\362\266\0054qk(\03465\2367\226\027\002\3016\276\367@\256\206\036\363\322e""\252\230\000\036\374\355)\000\014\344:\016\200\303\215%\360\240s\345\317\030\356\245*\024\327\032\006\013\306\273D\331\016:\264=\026B\354C\336\3630xR\337\027V\004D\234?\017\343\324\334T\260\047\323\251\007\262aY\260\326\264\226\263\200k\202=N<z\265HO\340\367\200n\272\"\027|(&\335*\\\\\047*Q!\226h\001\006u\264d/\307\226\222nv`+a\2533Z$s\271 `\321F\237\014\321\247\240\211\025\221\222\370\233u[\267\246\303\365\255c\260;*3g\250\235Q-L\362\356W\241\031)\364\r\340ri\221\010\0160M\233\r5o\255\013T\375Q\370\026\r\200T2i\266^\222\372\347)\245\205\000Q\371\372\225\264\337|\350\t\256\342\362\307K\201\323\010\035\344\365l#\266\004\255\236-\247gO\354\307G\306\373\324\303$\237M:\300\031\002\027\372gN\006\351y\001AAD6h<e\047u\337\047\342+\340r6\017\003qs\242LN`\3623\317\032\221\256\210J\303\310\014\325d8\001\230G\272";
20820 PyObject *data = __Pyx_DecompressString(cstring, 4482, 3);
20821 #define __Pyx_DecompressString_LZSS_UNUSED
20822 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
20823 const char* const bytes = __Pyx_PyBytes_AsString(data);
20824 #if !CYTHON_ASSUME_SAFE_MACROS
20825 if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
20826 #endif
20827 #elif (CYTHON_COMPRESS_STRINGS) == 1 /* compression: zlib (4525 bytes) */
20828static const char cstring[] = "x\332\355YKw\323X\266\256@\252\001\023\252\342<\010P4\310y\000\005!\330N\302\253\322\3642IxT\003EBx\024}oy\311\322\261-\220%G\222\223\230\254\364\355a\206\032j\250\241\206\032z\350!C\017=\344\047\360\023\356\267\217dG\211\315\233Uu\273o\033b\035\235\347>{\177\347\333{\037\307\364\334\013&Y\261\315\330\245K\262\222\3173\203i\022\303\013U\0109}C\340\005|\346\3065U\315nL\362G5x\274\2721)\010h~\300DCP\365u\206o\226\267\004I74f\264\007\346+\006\r\244G5x\274\272!\360\201\2670\256R.c\234\241\024\212{\006n\305*\232\242k\220-\326\2262\"\343f,\020\3573\205\373L\321\002\301\242+\313zIT\264l(@\344\255\272\353\355\243\304\t\373\207RE\336\252\273\336>J\306\255\250E\005=/\240\237U1rL\206]+\232\254h\005n`Q\013+D\243\312\207\356\375\224D\313P6\2049!5\225\344\237I!\331Y\352:\264\375\331\031\220\372\374\241]&\371\364\241\255\222p\243\353XK\324^f\261cf(\242z\356G\322b\010\276V\217\255\377(I1u\263b\344E\211EU\265\267\327\326\373T\306\007+@\241\304\314\360(\275\367\323e\nM7J\242\372e\223\204s\254\301\300\272\361\2769\306\024MR+2\023F%]E\327)\274\217\306vj-\266\201\303\305:\352\013\252hvT\226\230%\252\235]uU\356\2504-]\353\234u]\327\273t-\212e\366\216\332\364\336\352|E\223,\260k\247l\242U\354\330\234!jf\036\252\n{\307\n\252\236\203\332LfY\240\221\250\336\304RNa\232\225UCB\202\256\004\243\220\023\346\200F\016I\376\265\003+h\247Rbr\266 \226J\242\220\216m\305b9QzY0\210\221\204\315\350\014\311\251\351\324\265k\327\256\020<\247g\200\3164\225f\322\250\273v\003\343$\261\304\0141\"\013\010\317,\303\262\312\032k\327\251\272$\322\276A\266\350O,K\217j\360x\265#\227\371\262J+\006gaR\230\215\312\\)\243\t\r\330\312Ne\300\300\330\346\3644o\212\356Q+\250L\230\231\r\017UD\026\375eV\304\240\361\260D\342\264\212\325\235\"\304\302\366\270F\263\246^1@\347\233\030\303\337i\004/T[\0058\207@iO\213\212\305:\006\266Wo\317p!,\310;s\265\253\"\263\266\007\006\263C9\320\373U\256 ^\210\224n\234OO\245gw\355\325,\353\026\237i\307:\272\002\234\320\366\223S\263\223\301_\262\313N?J\340\213\377\247\005\276\370/,\360\205N|""\375~r\"\306\t\231\340\342\227~0\327\007\373\314\315\315\tmNC\304d\256VD\003\361RY\0255&\310J\211i&qflLf\222\212&aY4\341\377\036I\"\016\370_\260\353T\362\247\275\215wD5\177O\301x\336!\231J\317\276\263\313\363H\227\217\020\367\243\267>V\022%C\017\027;\267\314\305\235\024\356\320\222m\267]V\n\330\236\265\t\205\2132Q\270\260!\230|_A\377\016\317\310\215\017\377_\336\374;\017\027\332x\000Y[s\251I\372\007\373\047\247\256\376\367{<\363\337\223\027\270\034_wl\352\306{\307\245.~\345q\037!k\352\003:\332\242\350d\214i20\017\350u\265\325En\307\257\n\r:b\273a\376\354\327XP\330$/\227\204N&\205\361<|\021\362\016!\310;\202\366u\305*\n\252Xe4\266\025\377\264U\020V`\226\026\262\244\"\223^\"W\211x\247\311\360\345\246\n\237\337\031\235\005\370k3%\3644\333\352\264\025\025\362\"i\021R\256\213\224v}\231\220Q\327\371\356\370\321\320-\004\276\\?mG\277\265[o\027\271\342\020G|\251\332B\rU>C\240OG\212\000\004vR\337\263\347-\016\331\233\037\265\212p\"\241\350\344N\332d\002\234\347\347\246\256]\235l\375\001\352\2637\316\247H\360\274\242)f\021;\rcF\242\276\350\016){\255\230\214Xu6Zo\260\274\312x\360\212\246t\264\205\242\275\nx\025\365\227w\215\320+\205\"\302h\223\0476\321\311\310*E\035\231p\252Ke\326T^!nK&\337\261\372&M7\315\003Z!\017#jL\025P\275c\024~\217!\301a0c\215e\031r\363B$\305\246~[\324\047Ty\250\277\030\252\341\017\241U\335\330\024\360\205\371w\355\037\271\223\314\262e~\205\220J&S\235m\262b\302N\022\251\256\313\310\266\327\346\326\240\277h\226\027\225\250%F,\026\213V\267l\036#\272\212\265\220\321=)\374t|\\#>\2746\373%\010\371t\034`w\2358hU~\014\016\322\357\201\301\207@\360\261(\230\236\376\275`\320\025\004\357\206\300\330\0322-\322\304\364\324\225\237v\362Fa\264\014Zb\2250k\234\232\312T6\024U\021\215\352\023\021\203s*\262\325\207\206\236G\235V\230*\316^\272tIA\200\005\331\202|\034Z\244\373\227\0223\213\261KLe\004\031\363Q\031\371\033r\317\005~\035vI\323e\266\247nn3y]\336\232\0246S\301#\215\307\215\311XX\035\324F+\363A\337|\3207O\325\177\315\254\254d\346\357\334}p[X\371E\270\263pkVH$\346E""\225Pe\301\377\303\317\200\033\021\261Z\210\t\205\305P4\241(\256\201\271i\031\001\032\261\370\265D\256b\t\242Z\320\r\320~\t\207D@\036\r#[\346\342\006\322j\311\212\234\033\363n\273\010\350\303\363Q\312\215E4\335\002\334$\275\240\001\207\362/\232Z\025^\261\340\304\001W\026\242x\201\005\223\301\006O\261\020]\355\225\3655\240\021)1N\211I\272f\032}\177\312\275KAR\314`\224L6H\243?m\213m\354\334\227h\225R\271:\005,\031l\252TQa\005\303\020\253\000\230B\n\262 c\251\254\033V\264[\205n\030:z\350\264+\024\003U\242\205\324\224\214(\0078\024\246\027x\265\246\257G\200\025\026/\355(o\252\\\335\010\214\035\333\314+L\225\257\233[\331\3155\021.\024\346\315nr\265\\O\316\310[S\320\022\277)\3457\315\034\330\330(\334\361\245K\377\271>\375\272\327\247\231\047\331\234h\262N\n\230\327K\245[\254t\213\014u\013\240\270\273c\310\210I\263\000\255be\263\221*\321\262D\251H\207\263\243\362>XA\355^;5GW@\252yc\252\000.\336(\033\221nR\353\204G\352`<Q+\354\251\215\264\257\343\274E\336\357\003?\357o\315\026g?\320\001\240\304!\332\333\351\221\004y\3570P\267\361\363\275\373\017\357\376b\310\024B.(\222\365pq\345\221\324f\322\025\206c\004q\263\331\207\325\r\374Q\217\354\0030\3042\313g\263\242\246\361P1\213\217D\227\223\331\002\2630}\211*d]\242\007]\016\3223Py6\313\177x\240\047\203\032\371\030z\321\345\212\312\247)\031:\374\032\024\305x\203\206\323E\317\262\301\312\210!\251\210`RmU[\314\244I\025\223\350@\257\200\254\230(\362K\272\025\220\251hp\006\021\315\252&)\372T\273\213\271c\355\2101s\350\2540\034\312\202\242=b\253\025H\001\334\345\264\234f\265\316\344\003r\020m\303Jb\211_\373\361K?~\345\307\263\022ZY\202\356\210\032\263\304\244\214.!%U7A\273,\237W$\n?L\270\314\320\347\243X*IX\302\312j\272Fl,\031\214\264*\213\026Pn\311\364\224\301\266\340Dp\255%\353\371\340\367\233\350/<\321\337w\242\277\356D\177Q\212\376\236\024\3755I\246E6\030{\300r\017B\327x3\334\361\375\360\370\255T\313\314\334\323\306\265\221!\r\207\r\035\025|\004h_\336\321\047\003}3\003\263\262\262\t\030\361h`q\327\274J8G\236\323-\377z\000s\233\274""\224U\310\231\221\371\351\tT\344\225\215<\351\272`(r\036V\261\230\026\346\227y\265b\026\003\257\307I\032\352\340\232\342*\342\272)\244s\341\271\005l\013Zq\2668[\256*\320+\333P\314\373<i\336\361\031\021\327J\010\247/x\032]5_\274\320\025MekL\3450\272\207@\211\047\231\255[\257V\306\031^\207\2057`\341\375\227\252\027\360\177A1\360\275\270\006%\204\367\264\355K\334\366\025n\373\002\227\274JI\321*f\211\226+\225\225\231rU\323ZqC6\270N\327n\321\226M\355>u\324\036d\021\274\301s>\204J\264\347\000\230I\032\224\255\n\\$\366o\321_\026g\243\\\2614\354E\345h\3410\341\370\240\270\210\233\204\007H\3643G\360S\307\356\037M\2027S+\303\302Y}]cr\266\005\003\356\262\003\277\215\203A\021L\231i\272\211H\253XF\364\"a\007\345\242R\206te\275\014\306\302\177\316P\255g\213\205\360\236m\331\277l \230\204\277\226+\222\025\272m\003\016\3034Er\374\313\350\r\364\345\t|\204\356\340\364\004\277_P\026\r\333\226M\260\214V0+9\023\234UA\030u\017&\267\212\206\276N\221\030\375\335E\364P0\370\035\177W\352\256\254\361@\200\177\231k\241\023\342`]\017\256\0178\331\362\257\326\241\351\302\321\335y\375\335d\276\227\3017\2102\314WJ\371\237\231\346\301\303\3333\333\033\266\351$\232}\337o\2576\372\047\334e\327\362R^\246\331\327\337\350\277\200\322m\377J-\321<\022\267\2179\203NP}\326]\365\016x\353\276\330\256~\373\247o\216\364o\257\332=\230\363\373\376\346\301~\273\327\276\345\214:\267\335T\363\340\240=cW\335}\356Y/\336<8`\217\333E\047\347\036pW\233\007\217;CN\326\273\351\025\374%\352\226\266\037;\023\316\252{\310;\356\217\373/\353\361\372X}\251.\277\236x]i\254<m<}\326x\366k r\325\331\357\244 \013\226Yt\342\316y7\363&\372\322<\210\315\330\337c*,\343\355\307.\026\374\303\265\331z\317G4\034\362\342\336\230\267\344\311\376\205\332\343z\242\335\320\020\222~\217?\350g\374\225\332\017\365\305\327\330\313\241\355\243\333\253\377\244\315\037:\262}\327\306\036\206 \301io\237\207a}\333\017\234\037\335\277\370\230\272\257\321\227p\217{\023\336*Ug\232\337\215\330\025\250\362\335\345F\337\237\235Gn\017W\366yL\326?dg\232G\206i\205""\276\355\277\331\206\023\247\302}\347\270;AjD\377Q\367Go\226\257\265\275h\037w\022\274\362\264S\365z\202!|\345_\240\263`\362%\276-\210~\360\233C\337m\377F\365\237c\262\221\306\310\\\355v\035\226\030\260\023\355\257q[\344r4\342\t7\036\330\253b\337\305\232A\233\375\017\027\305\270=`_\206\265\306\235\202\273\342\rx|\216QH\220pf\234uW\366F\t\203]\252\310\034\337\332+\316\010\304K\270\323n\216\324M\303\277\337^\263\227l1\200\242\205\r\2546\373\007\371\032\347\3201\365\366\3347\337\022D\377dK\250J4\207N8c\316\222#~\\!\341\016\271O\261m\0216\374\342\227@,\222\330\262S\273\205<\372\005B\006\032x\023\3212\327\375j\263o\304^}\323\322OKQ/\"G\200\220\306\225\032\017\245i\234\230\361o\327R\315\341\343\316\t7\345f\232{G\213o\242\3234\373\007\354)\267\007[\\\242\231\016\330\226\303\3675\323\030\231\301\201y\\\033\255eHN\034\356\3461B\320\212\033w\307`\367x\363\244\320\020\256\327\022Xkh\304^s\226\032\247.\373\205\332rm\265s\311\260\320~\220\310\277\271\251\240\360\314\tj\032\303\023\356n\244\221\226g\235CnkoN\342\355\3007\207\206\354\324\033\250\347\262\035\007h\303\302y\002\277;\017\265\204\007)\036\256\3258\232\364\017\370F-\336\352\231\2403\337\327\036\224v\037y=^\374\323\006}\326J\221A\267\354\304\273\007\365\207\203\302\232`\221S\016\035\371\357\210\255n\341`\335v\256\273\317<\316)w\355e{\335y\341\035\366\211!\266\357\3307\355\202\363\334}\345\307\003\336H;O\335\237\033S\177\205Y\370\204\2036\035\316\306\000t\355\342\260\177\267-c\276\014\000\364\203{\013\247\361\212\237\010$\234\260W\235^\362\032\203\000z\037\261X\360\305\231\202\314\366\030\207;E\374\266\3208\006\246\363f\202\3431\r\343\231 #\240\346\230s\000\254\334\323\034>\346\364\300\325\334tD\200h\3508\316\177\217\033\177\323*4\373\206\355G\350\020-\014\331\363X\276\207\026\277\302\211-\355>\361\246=\221\316\203\311\327\205\372\326q\322\006\300/kdB\022\004.\204\026\375\026x:v\322\311\020\017\273\203\320\272\t\351\246\275\234\277\337O\371\031j\272\351H\000\374so\025Ui8\205\023\365T=\323<y\312\221\335\363^\006z=\366gh-""\003\010\366\207{\200\017\030\005\005\310\376\204_\251ej\035\r9\177\037\374\036#\177T\347h\275\302\251\357\025<\3228\210\303\3022\301Q\372A\000\371\215\301UW\210Qv\277\312\376(\344\033\"\371\030\340r\207\317\333\003C\216Ov+\376N\253\034w\216\006f#\242\033uo\272\"\302\214\264\367\330O\370Wki:\357\360\301\037h\356\347\004\002(\364\217\000\254\004\203.\205S\360\047Kn\221\326\375\203V\215\217p\350.\200\030\315\300w/r.\337\301\026\341\230\200\265\037\356KD\247Qo\036(\352\241\246}\340\362\025\367\004Xy\3363\374!\3779d\350\255s\274\375\214\276;\310\177\017\250\242\026E\314\341\367\3727\001\2524\232\376\345-\032?\206\300/\r\r\035m\351v\201\237\365?D\267\377f\247%\324\355\023\367\2627\310e>[\033\254\315\203\361\307~\214Td\336\364\017\333O\241\342@\223\213~\334O\374\356\264\371\357o\205\000\341\243\210\315\016\370f-\361\246\245\341\000\241\201\376z\366\342? \231\014\367\177\203\316\274c\206\001\362~\236\320\241\351&\234\335\020\374:\305}io\305?QKQ`v\324\226)k\"\225\007\266\375\377\254\373T\363\035\272~\217F.\363\324x(\230\324r\257\363\3641\341\317 &\033\256\345 \312\351q\310(!\315\231\205\213O\354~\035\367s\265\236\3461\322\026\2629\357 \252\240+\244W\347\222]\212ov\255\302p\252\026j\373j\0235\003\021\303\327[\345\2171\000\362\216^08E\274aRzx;E\341\033\362\210\263\356jxE1\311\265\237\360Soxh?\207\324\220a\213\275\376\337\260\350\376z\272\376\370u\242\231\234i\277b3qJ\n\343\0107\227\203\314$N\351\257\325\030\234@@H\336\300\204\266\372\026\352\267_\223\361\033Cg\334<g\"\204\260\267\355\353\224\254\004\301\352\022o=\037\006\270T>\207\260\177\004D6\343\363\004\373\036\242M\310|\035\201\3600h.\316\023x\301\355u3\215\336\323\316j$\333\216$\305G\021\353Z\3164\022l$\264\315\221\037Pd\334yYXf\334\227kg\353a\256\210\250\270\331\1774\014\215)\2760\370]\3052\316\340\025:\201\000#\206_\201=2\210fyZ\314\t\004\231A-\261\273i\034\372\356E\212\207\250\240&\325\007\3523\365\365\327\271\306\303\245\306\3222\017\321\261\003\212\265s\024x\037Gq\021d\236A\3026\202Q\013\265\003\224\236\305\221hL@""\362\235IGC/1\300i\005\033S\335q\267\000\371\002\256\177\314\323\274\3213\035U}D@g\335\001\236\335\030\3360\310\003g\3606h\220\247\265\303\273\262\375\336\200\312\332\255D\201\007\034\203\047\224\313m\316\014\266\034\246\201\377\203\034\245\357\264\263A\231\323\333\377\352\245\373\001\2365\235q_\302}\235\247\033\014\270\240\364\\G\341jm?\337J\227\302u\2349\302x\227\302O\330R\360\205\304\266\231\276\206\274\014\343z\202\213\tZ\270w\014\231>a\241qDp{\202\253\242\004\222\261%\234\326!\357\267\332\014\245YG\266\227\032\337\235qe/\021^ A=\215\361\033\240\023\304,\365\047\257S\301\025\320\200\223j\234\234\346\2364^;S\357\to\203\3060Y0\224\047\227\007\007\201\343%G\3457%<\337\373\325Q\240\216^~\321g\357\263\023\366ON1<\304\234\274\232\027S\376I\200\003\354U\037\204.\360\032\367\317\324:\256\223\016o\317\332\373)\271\003\322\0230Bpa\326\350\235\304\314\361\323\316?\274\245\267wz(\343\014.\237\266\177\016.\207\356\006wY\374\300\264&l\364\235rx\343\374\366+\270\251\245\366\241\033\261\215\200`\207C]E\036\341|w\200\202\336\366\335\331R\330\341\177\001\314/\344|";
20829 PyObject *data = __Pyx_DecompressString(cstring, 4525, 1);
20830 #define __Pyx_DecompressString_LZSS_UNUSED
20831 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
20832 const char* const bytes = __Pyx_PyBytes_AsString(data);
20833 #if !CYTHON_ASSUME_SAFE_MACROS
20834 if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
20835 #endif
20836 #elif (CYTHON_COMPRESS_STRINGS) > 0 && (CYTHON_COMPRESS_STRINGS) <= 90 /* compression: lzss (6113 bytes) */
20837static const char cstring[] = "\377\nobject\n\377{\n//diff?erence\n\000\r\001\337 box \004\002 \377 <$nll_x\365,\002\002y\001\003z>, \377 // Near\337 lowe\003\000ef\377t corner:P\000 4\002fur5\001\003\001\\6\000\n\001z> 4\002F5\000\367upp5\000righ\376*\014}\nunionX\231\000\234\007\231\010{\n\231\003 g3\364d4\316\001}m\ndoma\007in_\227$\003\010\242 \021\010\215<\200\244#E\004\252$\003\010B\007\234\201 \236\003}\336\306I of \344 tu\357rbed\325@und\267ing\334Ban\n\004a\207ry\n\255A\261A\000\005\275Am\377atrix < \3371.000\000\000, A0\000\007\014\005&\022F\006\047\0071\0017\3302\020N%\237\017 >\330\022ta\367nk_\357\000eria\217l()\n\303 \234\205\004\223%}\376#\377isosurf\007ace\237)\254m\237\047\24008\002\377indices \361{\237{\356\205\003\212\204\016norm\347al_\010:=\004vec\367torm\031#inc\377lude \"co\265l(\000.\r\000\"\n\014\007t\177extures\010\r\357glas\004\016met\273al\031\017old/\016swtonD\017woo\030\020Whapo\017s\021\0022\240\r\377function\356\212\017ath\314\016ran\363sf\354 \330\004\nglo\375b\370 settin\375g\265Iambien\347t_l\311\212\004\251 rg\177b <1.0,\276\207\001\370\000\002\362\205\007\233 umed_\377gamma 2\n\377}\n\nbackg\377round { \374\351\"<\0030.3199\37397\373\207\00134000m2\205\210\00142\021\0009>5\000\277camera\302hp\337erspe\344\000ve\336\320\210\006loca\364\001 <\261$-\000\314\214\001\003\001y,\t\002z~\212\207\007sky <0\260\001n\000\0025.0\246\207\007up\030\000\303, \314\001\273\207\007\273\214\003\344\00033\374\026\002%\010angle \36345\270\211\004\201\010ok_a?t <$lo\005\002\333\215\001\206\003\005y,\r\006\224\000\224 \315\"_\377source {\3001\000\256\215\001-\002\004\002,\001\r\002z>>\256$White(\016\332\212\006v9\006+$U\003dx,\003\004\201y\n\006K\010\223\213\006\215C\232 \212@8\346\322@0.\004\002\000\0070>*\3172.25\251\213\001\310\213\006spsot\217b\332\213\006poi\245`^\373\0010.5,\000\0010\341!\022{3-\274\005\034\222-\320/\010\246\226e\356\225\202r// \203\207\004---\340\000\000\000\003\000\t\000\025\037\016\n//\336#\036<<< \313\210\006of\377 squared\377 plane d\337imens\260\211""\001\n#\357decl\030\000 Ra\377sterScal\377e = 0.10\375;\r\rHalfLi\274=\000\034\0020125\n\026Z\370\030\010\214\200 \354\200%\n#mac\333ro\246\004(R\252\002, uH\222\001)\353\222\005pig\334\000\333t{\356 ad\277\212\001 x\303 s\323\002*\003\212\223\016\203\215\002_moap{[\212\223\002 \243\212\007\377t<1,1,1,\1770>*0.8]\201\223\030\307[0+\203\002\0009f\0171>\006W\0321-]\024\0005\305\200 \270\225\002\2118\377} }\n #enGd//\251\226\001\323c\235L-\303Bq\n\317\202I\241\232\001\331\204\013XY\n\352\204\003\375{\342\214\0010,1>, \377$floor_z\371 \261\232\003\212\205\003with \017laye\237\205\001\370\220\005\271\227\006\212\221\004\367 { \322echec\327ker\222\214\t,\331\216\004Bl\207ack\307\225\017\372c\322\212\006\311`5\312\366\225\005}\231\t-\346a\243\000waOll_yg;\332\222\001 \264\215\004\376\270\224\027rotate<\3170,0,\220\217\006\206\n0,\235-\264\"sky\367\200=\215\002B\207lue\350\227\017\202\230\007{\023\223\207/ \032\377` \352\210\016XZ\274\207\005\220\231\r\243\231\005\307{\n \374\224\004\311\226\001\304\207\006rg\177bf<.98,\000\001\376\004\0010.85>*1\376\301\231\001finish \303{ \255\223\004\322\233\001\365\233\t\214\240\001us\365e\322\211\0015\215\234\trefl~\322\222\001on 0.2\247\234\t\376\352\222\001ular 0.\3756%\noughne\363ss\264\234\002A\t// p?hong 1\360\234\010\r\005\377_size 40\3250g\024{\204\235\0013\321\224\002 f\177resnel \222\000\366\227\233\007//\220\211\002nser\377ve_energ\304\330\235\010\305\233\001}\273\241\001\354$\274\227\004\n\n\377 interi\357or{ \002\000 1.\376\363\n fade_p\256\352\241\002100\256\t \026\003d?istanc\267!\047\020^\267\222\0068,0.\000\0018\377\234\t\234\206\t\177\005\n\n\n\235\t\227\235\005\n\242\253\210\001\n\326\213\005\377\232\023\356\202/9\260\213\001995\346\2029\326\202/ //\366O\r\005\322\344\202!2\354X\345] \337\202$33\360\223\242\n\254\202X\360R\351W#ver\276\225\221\001 3.7;\213\235\007 \177\"proteu\216\235\004\377..Auxili\377aryVaria\377bles.Pro\375f\021\000ng.h5/\377//inside\335_\212\236\003 on\374\241\001me\177sh\n/ele\234\220\001\377s""Spatial\373_D\362\245\002/node\376\005\014<{0:d},\327 {1\001\0032\013\000>,)\n\020\004\020\003{\n\010f&\003\002\002\3572:f})\000?AT\377TACHING \377TO HDF5 \377!!Calcul\377ate call\377ed at ti\357me E\224\004 haWve y\002 \217 t\327\240\002\377but algo\377rithm is\377 for tet\377sExtract\255 \303\241\007sI\317\241\006 \222 e\376\047\001mat not\377 recogni\377zedOnly \357zero6\001con\277tour eG\003i\347onWf\000\327\246\001pov\357 fra\234\000dis\346\350!en\356!\314\241)gci\365s0\003d\200A2 {\n\356\323\001ex_\247\241\006num\377py._core\357.mul\227@rra_y fai\235!t\241\000\337mport\033\tum\327ath\021\016o\322\001im\255p\340Ced\242\"0\222( \337in 3D\271\"no\351w\316h\335d/\263\047.py\375x\376C\n{fiel\377d:s}_{va\267lue\334@_{\222\":_04d}.\243 }\340\246\001\370\345\253\002\241\251\001\351aes\n//\360\275\247\377\322\252\021\361\252\006\216\251.AV_b\367ase\361\206\017Comm\257FemF\245AF\264`I\374\374\204\007\310H__init\373__\333Hattac\371h\231\206\001\004\016Model\366\000\023.<\377\242\001ls>.\177genexpr\255h\371c\332\206\005\301htrian\371g\363\206\002\204\022write\236\257\206\007Mesh\377h\013\020_\373h5\002\034povra\375y6\rSceneH\377eaderJLM\357PIOr\007\000edD\377ictPETSc\336\301\211\006Temp\243\210\001__\347Pyx\001\000\036\001_Ne\377xtRef__a\373nn\267\224\002____c\376\231\250\001_getite\035m\r\001doc\024\001\231\247\001\034\001\006\355#__\334\260\002.\000\264\250\001.\003\t\001\337oduleC\001mr\377o_entrie\335sR\001nam\022\002pr\357epar\035\002qua\335l\017\005tes\305@_i\375s\262\207\001outine\373aa\240\246\002Timea\373ra\276\207\001async\277io.cor\035\003s\350\344G\362C\336Bb*\000ier\377beginSeq\367uen\230\213\001bnbn{tb\275\247\001aryN\235\213\001\216\320Fcam\362\246\002\360\246\002\375\246\001z\374\221\230\002v\001cline_\327in_\223\212\001e\201\250\001cl\377osecoeff{ic\321\250\001scol\363\223\004\376\010\000mmcount\357_non\212\212\001cre\377ate_data\357setd\004\001def\337aultd\237@do!f\242\263\003\326\262\t\324\262\t\357\262\010z\306\263\t\304\263\t\372\302\263\tda\001xeeNek""bN\224\215\004B\353\004Ma\271\223\001\177alTypes\r\014\302\211\"A\240\212\001\311\215\004\000\016-\002se\273nd\306\047enu\326\251\001t?eepsex\224\224\003\355\214\004\310m\004\367@P\002f\352\211\002\357\211\002Na7mes\371\211\002_i\311\214\001\222a\274\321\214\001\223`fixf\350!g\377ridflatt\373en\331\233\004flushv\345\253\001at\267\214\002fur\270\267\002\334\266\267\002\264\267\002g2b\261\206\004ge\377tgnh5h5p\377yiindexi\303sM\211\242\002\224\260\007\320\215\010\336\204\001si\377tertools\377jjoinlev;el\245\207\002Lis\227\250\003\201\251\005\312\212\251\004y\356\251\003x\365\251\003\007\004zl\273og\000\000Dir\006\000E\017vent\267\252\004\274\252\006\272\252\006\317\252\005\375z\277\220\001minusm\376\225\210\001mpi4pyn\265n\260\217\005_\311\255\003nF\253\216\001s\373nM%\001nN_st\337artnP\220 nZ\357eros\324\205\001dtu\373pl\264\210\001tnext\377_outputnR\311\000l\231\272\002\237\272\001y\244\272\001z\224\221\001\300\343B\234\221\002\247\261\001\251\261\003\247\261\013\275\261\003sn\377pnum_own\307ed_\340\221\005\325\216\002\331\216\003li\375n\276\220\001penosp\377athpetsc\336\277\000phip\256@po\177ppovpov\235\210\002\274\000\005\376\207\005pov_\370Ep\377rintprod\367uct\224\223\004rankwssa\365\216\001Rat\254\204\001\301f\371a\277\205\001\270\205\003\272\260\003\302\235\001st\372\375`t@\000gsubs\377titutetL\377astthrow\374\206\222\001\212\222\001Integr\314\337\256\002\246\212\022uv\204\217\002\211\217\002sv\004\201\224\004\250\204\002w\271\237\003\314\212\002\321\212\002\311\205\005\320\212\020\240\302\212\023\332\212\021\307\212\003\241\213\002\267\212\010x\275\222\001s\377zip\200A\330\010\013\377\2104\210x\220s\230!\377\330\014\017\210q\320\020%\377\240R\240t\2501\250A\277\330\014\020\320\020+\007\000G\377\2607\270!\330\r\021\220\357\030\230\023\230\021\003\047\240q\277\250\007\250w\260a\016\006\360\377\006\000\r\020\210q\220\001\376Q\000\017\020\330\010\020\220\004\377\220F\230\"\230G\2401\377\330\010\023\2204\220y\240\377\002\240\047\250\021\330\010\022\377\220$\220h""\230b\240\007\377\240q\330\010\031\230\024\230\177_\250B\250g\260Q#\001\3772\220U\230%\230q\240\377\t\250\031\260$\260k\300\377\021\300#\300Q\300d\310\377%\310u\320TW\320W\357X\320XY\255\003y\230\003\363\2301\240\000d\000E\230\021\230\277*\240A\340\014\020\003\007\330\315\010\312\000\220\017H\000d\000\250\003\376\315\000D\260\013\2705\300\001\374\000\026(\007\t\250\021\250#\250\377Q\250d\260+\270U\300\375!B\006\320 0\260\001\260\377\023\260A\260T\270\033\300\373E\310\311\000\t\210\026\210q\373\200A\372\000\t\r\210I\220\376\301\000\024\220E\230\037\250\002\375\2504\000\014\210N\230)\240\373=\260q\000\014\320\014!\240\357\031\250%\250\360\000\014\210A_\330\016\027\220u\310 \010\000\t\376\013\n\320\014\035\230S\240\001\372\377\"*J\000\020\024\220A\330\373\r\025^\001\014\210K\220r\375\230\306 \014\210M\230\031\240\371%\303!]\000\"\240)\2505^g\002\210E\220\031\314@\010r\000\217\037\230y\250{\0010\000u\002O\234\261 \024\001\035\230Q\235\"\270\000\010\237\000\t\016\210^\024\001\377\2011\027\277\320\027<\270G\300\207@\022\261\220\277`\000\002\335Aa\330\331\000E\337\320\021!\240\021\335cu\220\365Iq\000\014\027\002\220~\240Q\177\330\014\021\220\022\2206\270@\377$\230g\240T\250\022\250\372?\002\"\262`!\2304\230wo\240d\250\"\200\204\001\022\220\002\016\276\326A\005\220T\230\027\317`!\317\2403\240b\353!;\001\017\210_v\220Q\220a\205\204\003t\361`\357q\330\020\023_\002(\240!\277\2401\360(\000\005\237\204\001\006\373\220c\257`!\330\024\032\230\037#\230Q\230a\000\006\000\017\031\010\377!\240\024\240W\250B\250\005a\301@\024\000\n\000\027\033\026\221\003\356\205\001Wt\2201\227\013\026j8\014\375\002\371\340\333(\332\206\002q\330\014\027\220\273q\340\030\003\220a\330\002\004j\251\240\222\205\007\346a\220\321!\021\254$\320\377\0324\260G\2701\330\025\377\031\230\032\2401\240A\330\366.\ra\340;\t\330\020\022\220\347.\240\001\241 \327@\020\220\007\367\220t\230\323\0024\320\0274\377\260A\260U\270\"\270A\276\355!%\230q\330\030\361\206\001T\357\240\021\240#\365@\021\330\034\277 \320 :\270!i""\000\024\377\027\220v\230Q\320\0366?\260g\270R\270qa\017\263\004\274\272\004\372\206\001\005\220^\240\202\207\002\005\373\220X\334a\020\220\005\320\025\371%\333a\337h\017\210t\2205\367\230\t\240\324\005\230!\360\022\377\000\t\024\2201\340\010\013\177\2106\220\021\220!\330\002\004\275*\254\210\001\240C\240q\260\205\003E\373\220\021\246$\320\0260\260\007\257\260r\270\021\"\005!\360\206\001\014|9\0021\0012\240S\250\001\332\210\001K\014\210\013\047161*\010F\357\205\001\034\360\204\002\214\020\020\000\t\232\002\324\004\213\206\002\367\220\036\230\252\210\001\016\000\t\r\377\210F\220\"\220G\230:\357\240X\250Q\250\206\001I\220R\377\220w\230j\250\013\2601\376\267\206\001H\220B\220g\230Z\367\240z\260\344\207\002O\2302\230?W\240J\320.?\224@\260\"\377\023\220A\330\014\022\320\022\376\351 \240a\330\010\016\210d\377\220\"\220A\220T\230\033\177\240F\250!\2507\260\374\210\002\177F\220%\220q\230\004\262\213\001\237\023\2201\330\014\302\210\001\000\002\014\274\252\207\002\253@\220U\230!\247a\024\337\220D\320\030*7\0004\250\376\261\206\0023\220a\220s\230\"\375\230\263`\030\230\007\230q\240\377\001\330\025\030\230\001\230\023\357\230B\230a\302`\024\031\230\355\027\355`\021\340\001\005\330\014\025K\220S\036\000\021\000\006k\001C|\000\277\001\330\014\023\2207\207\214\0022\277\240V\2503\250a\214\205\001s\376s\002\014\017\210w\220c\230\337\022\2304\230v\277A\330\020\376\275\212\001\021\330\024\030\230\005\230\277Q\330\030\034\230A\204\212\001\240\365\023\222`s\325\0003\250b\260\337\003\2601\260A\027\001B\230\177c\240\024\240Z\250q\020\000\3772\260T\270\032\3001\300\377A\330\034\036\230d\240*\333\250A\325 \030\035\263 A\240\367Q\330\020\275\004\240\031\250\"\377\250B\250d\260%\260u\367\270A\270\010\016b\260\002\260W$\260e\245\214\001\300\205\206\0027\233 \3774\230z\250\021\250$\250\337a\250t\2602\304\205\004\033 \377\240\002\240#\240R\240u\272\217\210\001\330\002\nd\260\"\235\000\024\375\034\247 e\2401\240H\2505B\262\000\001\306@$,\000\010\r\006q\020\231!\360\211\001\010[\031\230\026\261C""\377\021\230(\240\"\240B\240\377a\240t\2502\250U\260\337!\2608\2702\354\206\001\300\001\331\330\323@\003\031\020\032\231\217\002\001\330\217\020\027\220w\202b\000\006\010\007\036\277\230g\240Q\240h\360\001\330\355\020\001r\021\027\266\204\002D\240\007\023\240s\266\216\003\237\220\001!\321h\304\204\001\325a\367\003\2403\205 s\250\"\250\371C\303`\375\000\030\230\002\230#\277\230T\240\032\2501\020\000r\377\260\024\260Z\270q\300\0045\300\353bJ\261 q\330\350\204\006\273w\376\306I%\250q\260\004\260B\342\322`2\355`\354\202I\346\200s\030\230\003+\2302\237 \026\324%D\360\206\002\256\206\007\370\361\200h\272\205W\340\200yV\2406\250\023\376\241\210\002\047\270\023\270C\270q\367\330#)\006\010A\340\020\025\357\220W\230A\237\204\004E\260\021\323\260!\306\210n\331\206\330\021\326\204\t\"\250\377D\260\007\260s\270!\340H\221\214\005\362\214\003\361\213\003\001\253\214\001\364\204\t\230\340\207\002\375A\204\215\002\023\230C\230s\240\364\233\225\003\375\230\001A\330\214\001B\220c\230\377\024\230Z\240q\250\003\250\1772\250T\260\032\2701\225\222\001\007\026\220d\277\231\001\246\214\001\326C\227\214\031\234\200\335C1\330\3254\254\216\026\341\227\001\227\235\001\024\221\214\003\367t\240:\272\233\002!\2604\260\377r\270\025\270b\300\001\330\377\037$\240B\240c\250\022\277\2505\260\002\260!\001\013$\277\260b\270\001\330\030\317\216\001%\277\240q\250\010\260\002\276\216\001\260OQ\330(0\000\010\016\005\340Y\n\377e\2601\260D\270\002\270\237%\270r\300\021\033H\305\214s\230?\021\320\004\030\230\001\314\235\001\216\234\004\367\013\2101\273\222\0014\320\027\047\363\240q\234\240\004\303\220\001d\260!\260\3751\317\230\001t\220<\230w\240\377e\2505\260\004\260K\270\377q\300\003\3002\300U\310\357!\33004\006\006Q\330\020}\021\234\240\001\021\220\005\220R\224\230\003\375\021\235\237\001t\320\023%\240V\376\345\215\002s\260!\330\014D\300\373G\310\371A\320\024&\240f\376\274\222\002\010\014\210G\220:\230\367T\240\021\347\227\003Q\330\020\024\347\320\024*\332\224\004\010\001(\250\001\317\250\027\260\003\347@""\326\236\002L\230\375\001\317\241\001:\220T\230\025\230\375c2\002\320\020 \240\004\240\177A\320\004\037\230q\360\344\235\007\374\364\241\001\216\235\004\026\220a\220t\230w3\230b\315\234\001\330\027\033\010\000\375e\224\217\002t\2507\260$\260\357d\270\047\300\203\230\002t\2203\237\220a\330\020\026\224\225\004\334\217\001r\276\247\240\002R\250t\2607\337\231\001\270\375Q;\0017\240\"\240A\240\371S\221\235\003\274\207\002r\270\021\270!\376\r\013$\250b\260\004\260G\377\2702\270Q\270c\300\022\377\3004\300w\310b\320PoQ\320QR\243\226\002\220T\347\225\002\375b\365\225\001\031\230\023\230E\240U\023R\000T\352\000\004\356`\007\233\232\001\377\021\220\021\220%\220t\230\334f\007\327\224\003\047\270\022\322\207\002\014\026\377\220l\240$\240g\250R\232\234\225\004U\342\232\002\"&\002\016\047\000d\337\230\047\240\022\240\217\231\001r\250\373\025\250\344\000\024\220G\23026\233\236\002\014\025\341\236\n\004\250\306\210\002\025\006\177\024\220D\230\007\230r\314\233\002\253R\240\311\221\001D\246\232\003\270\215\240\002$\377\220a\220\177\240a\330\014w\037\230x\325\232\001\360\\\004\247\244\001\377v\220Q\320\026&\240k\357\260\021\260*\276\240\001\300A\330s2<\000\006\n\0058\270\003\235\211\002\3712\000\006\t\006:\270%\270q\317\300\001\3302\000\006\t\006;\270\3671\3302\000\002:\270!\330_29\270\021\330>\000\001\236\245\003\336u\001\004#\2401\207b\320\r\373 \240\234\242\002N\230!\230:\377\240Q\240c\250\024\250^\373\2704\343\231\001\r\210Q\320\016\307&\240d\307\243\002\275\243\001\234 \320$w>\270b\214\223\001\300V\310\244\232\002\377M\230\022\2301\320\0343\275\260\375\227\001\021\270&\300\350\243\003\"\317\240#\240Q4\004\215\234\002\010\023\377\220:\230Q\230l\250!\375\250\334\232\002I\220Y\230i\240\373q\250\311!\014\020\220\002\220\237!\220;\230h\216\226\004\370\244\001!\337\330-1\260\034\232`b\300\337\001\300\023\300A\013\001\021\260\373&\270\276\243\016\013\2105\220\003\376\331\232\001\020\320\020!\240\021\240\376\253\245\003\320\004,\250A\330\021\377\037\230~\250Q\360H\001\234\356\233\001""\367\243\003\210J\220\230\243\002\251\245\002\014\365\210\254\205\002\014\231\244\004\320\014\036\230\276\265\243\002C\210z\230\024\311\236\004\220\265Q\353\226\001r\367\247\002\024\025\324\243\001N\021\230\327\245\004\340\245\002I\004H\203`\345\233\001\326\244\006\002\373\245\001!";
20838 PyObject *data = __Pyx_DecompressString_LZSS(cstring, 6113, 13411);
20839 #define __Pyx_DecompressString_UNUSED
20840 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
20841 const char* const bytes = __Pyx_PyBytes_AsString(data);
20842 #if !CYTHON_ASSUME_SAFE_MACROS
20843 if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
20844 #endif
20845 #else /* compression: none (13411 bytes) */
20846static const char bytes[] = "\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\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 }\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 }\n face_indices {\n }\n normal_indices {\n }\n normal_vectors {\n #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.0000""00\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 interior\n} // end of material\n#end\n#version 3.7;\n#include \"proteus.inc\"\n..AuxiliaryVariables.Profiling.h5///inside_vector on\n}//mesh\n/elementsSpatial_Domain/nodesSpatial_Domain<{0:d}, {1:d}, {2:d}>,\n<{0:d},{1:d},{2:d}>,\n<{0:f}, {1:f}, {2:f}>,\n?ATTACHING TO HDF5 !!Calculate called at time Elements have {0:d} vertices but algorithm is for tetsExtract isosurfacesIsosurface file format not recognizedOnly zero isocontour extractionWriting pov frame disableenableface_indices {\n gcisenabledmesh2 {\nvertex_vectors {numpy._core.multiarray failed to importnumpy._core.umath failed to importonly implem""ented for 0 isosurface in 3D for nowproteus.incproteus/Isosurface.pyx{0:d},\n{field:s}_{value:f}_{frame:04d}.pov}\n}//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\nAV_baseAuxiliaryVariablesCommFemFieldFileIIsosurfaceIsosurface.__init__Isosurface.attachHDF5Isosurface.attachModelIsosurface.attachModel.<locals>.genexprIsosurface.calculateIsosurface.triangulateIsosurfaceIsosurface.writeIsosurfaceMeshIsosurface.writeIsosurfaceMesh_h5Isosurface.writeIsosurfaceMesh_povrayIsosurface.writeSceneHeaderJLMPIOrderedDictPETScProfilingTemplate__Pyx_PyDict_NextRef__annotate____class_getitem____doc____func____init____main____metaclass____module____mro_entries____name____prepare____qualname____test___is_coroutineaactiveTimeararrayasyncio.coroutinesattachHDF5attachModelbarrierbeginSequentialbnbntboundaryNodescalculatecamcam_xcam_ycam_zcheckTimecline_in_tracebackclosecoefficientscollectionscommcount_nonzerocreate_datasetddatadefaultdictdofdomaindomain_fur_xdomain_fur_ydomain_fur_zdomain_nll_xdomain_nll_ydomain_nll_zdsetdxeeNebNelementBoundaryMaterialTypeselementBoundaryNodesArrayelementNodesArrayelementselemsendSequentialenumerateepsexteriorElementBoundariesArrayffieldfieldNamesfield_ifilenamefileprefixfine_gridflattenfloor_zflushformatframefurfur_xfur_yfur_zg2bgenexprgetgnh5h5pyiindexisMasterisosurfaceisosurfacesitemsitertoolsjjoinlevelModelListlightlight_dxlight_dylight_xlight_ylight_zloglogDirlogEventlook_atlook_at_xlook_at_ylook_at_zmeshminusmodelmpi4pynnElements_globalnFramesnMinusnN_startnPlusnZerosnamedtuplenextnext_outputninllnll_xnll_ynll_znodeArraynodesnormnormalnormal_indicesnormalsnpnum_owned_elementsnumpynumpy.linalgopenospathpetsc4pyphipluspoppovpovScenepovScene""Templatepov_filenameprintproductproteusrankssampleRateselfsendsetdefaultshapesky_zstepstringsubstitutetLastthrowtimetimeIntegrationtriangulateIsosurfaceuvvaluevaluesvariableNameswwall_ywritewriteBoundarywriteIsosurfaceMeshwriteIsosurfaceMesh_h5writeIsosurfaceMesh_povraywriteSceneHeaderxzeroszip\200A\330\010\013\2104\210x\220s\230!\330\014\017\210q\320\020%\240R\240t\2501\250A\330\014\020\320\020+\2501\250G\2607\270!\330\r\021\220\030\230\023\230A\330\014\020\320\020\047\240q\250\007\250w\260a\330\r\021\220\030\230\023\230A\360\006\000\r\020\210q\220\001\200A\330\017\020\330\010\020\220\004\220F\230\"\230G\2401\330\010\023\2204\220y\240\002\240\047\250\021\330\010\022\220$\220h\230b\240\007\240q\330\010\031\230\024\230_\250B\250g\260Q\330\010\023\2202\220U\230%\230q\240\t\250\031\260$\260k\300\021\300#\300Q\300d\310%\310u\320TW\320WX\320XY\330\010\013\2104\210y\230\003\2301\330\014\020\220\004\220E\230\021\230*\240A\340\014\020\220\004\220E\230\021\230*\240A\330\010\017\210q\220\017\230q\240\007\240q\250\003\2501\250D\260\013\2705\300\001\330\010\017\210q\220\017\230q\240\007\240q\250\003\2501\250D\260\013\2705\300\001\330\010\017\210q\220\017\230q\240\t\250\021\250#\250Q\250d\260+\270U\300!\330\010\017\210q\220\017\230q\320 0\260\001\260\023\260A\260T\270\033\300E\310\021\330\010\t\210\026\210q\200A\360\006\000\t\r\210I\220Q\330\010\024\220E\230\037\250\002\250!\330\010\014\210N\230)\240=\260\001\330\010\014\320\014!\240\031\250%\250q\330\010\014\210A\330\016\027\220u\230A\330\010\014\210A\330\016\027\220u\230A\330\010\014\210A\330\016\027\220u\230A\330\010\014\320\014\035\230S\240\001\330\014\020\320\020*\250!\330\020\024\220A\330\r\025\220Q\330\010\014\210K\220r\230\021\330\010\014\210M\230\031\240%\240q\330\010\014\320\014\"\240)\2505\260\001\330\010\014\210E\220\031\230!\330\010\014\320\014\037\230y\250\001\330\010\014\210K\220q\330\010\014\210O\2301\330\010\014\320\014\035\230Q\330\010\017\210q\200A\360\010\000\t\016\210^\2301\330\010\020\220\004\220F\230\"""\230G\2401\330\010\023\2204\220y\240\002\240\047\250\021\330\010\022\220$\220h\230b\240\007\240q\330\010\031\230\024\230_\250B\250g\260Q\330\010\027\320\027<\270G\3001\330\014\022\220!\330\014\022\220!\330\014\022\220$\220a\330\010\014\210E\320\021!\240\021\330\010\013\2104\210u\220I\230Q\330\014\022\220$\220a\220~\240Q\330\014\021\220\022\2206\230\021\230$\230g\240T\250\022\2501\330\014\022\220\"\220F\230!\2304\230w\240d\250\"\250A\330\014\022\220\"\220F\230!\2304\230w\240d\250\"\250A\330\014\017\210q\220\005\220T\230\027\240\002\240!\2403\240b\250\002\250!\2501\330\014\017\210v\220Q\220a\360\006\000\r\020\210t\2204\220q\330\020\023\2206\230\021\230(\240!\2401\360(\000\005\020\210q\220\006\220c\230\021\230!\330\024\032\230#\230Q\230a\330\024\032\230#\230Q\230a\330\024\032\230#\230Q\230a\330\024\032\230#\230Q\230a\330\024\032\230#\230Q\230a\330\024!\240\024\240W\250B\250a\250q\330\024!\240\024\240W\250B\250a\250q\330\024!\240\024\240W\250B\250a\250q\330\024!\240\024\240W\250B\250a\250q\330\024!\240\024\240W\250B\250a\250q\330\024!\240\024\240W\250B\250a\250q\330\020\023\2206\230\021\330\014\017\210t\2201\330\020\023\2206\230\021\230(\240!\2401\360\026\000\005\020\210q\220\006\220c\230\021\230!\330\024\032\230#\230Q\230a\330\024\032\230#\230Q\230a\330\024\032\230#\230Q\230a\330\024\032\230#\230Q\230a\330\024\032\230#\230Q\230a\330\014\017\210v\220Q\340\014\022\220$\220a\220~\240Q\330\010\013\2104\210q\330\014\027\220q\340\014\017\210v\220Q\220a\330\014\017\210v\220Q\220j\240\007\240q\250\003\2501\250D\260\001\330\014\020\220\005\220T\230\021\330\020\023\2206\230\021\320\0324\260G\2701\330\025\031\230\032\2401\240A\330\014\017\210v\220Q\220a\330\014\017\210v\220Q\220a\340\014\017\210v\220Q\220j\240\007\240q\330\020\022\220.\240\001\240\024\240Q\330\014\020\220\007\220t\2301\330\020\023\2204\320\0274\260A\260U\270\"\270A\330\024\032\230%\230q\330\030\031\230\024\230T\240\021\240#\240T\250\021\330\034 \320 :\270!\2701\330\024\027\220v\230Q\320\0366\260g\270R\270q\330""\014\017\210v\220Q\220a\330\014\017\210v\220Q\220a\330\014\017\210v\220Q\330\014\017\210v\220Q\330\014\020\220\005\220^\2401\330\014\020\220\005\220X\230Q\330\014\020\220\005\320\025%\240Q\330\014\022\220$\220a\220~\240Q\330\014\017\210t\2205\230\t\240\021\330\020\023\2206\230\021\230!\360\022\000\t\024\2201\340\010\013\2106\220\021\220!\330\010\013\2106\220\021\220*\230G\2401\240C\240q\250\001\330\010\014\210E\220\021\330\014\017\210v\220Q\320\0260\260\007\260r\270\021\330\010\013\2106\220\021\220!\360\006\000\t\014\2106\220\021\220*\230G\2402\240S\250\001\250\021\330\010\014\210E\220\021\330\014\017\210v\220Q\320\0260\260\007\260r\270\021\330\010\013\2106\220\021\220!\360\006\000\t\014\2106\220\021\220*\230G\2401\240C\240q\250\001\330\010\014\210E\220\021\330\014\017\210v\220Q\320\0260\260\007\260r\270\021\330\010\013\2106\220\021\220!\360\006\000\t\014\2106\220\021\220*\230G\2401\240C\240q\250\001\330\010\014\210F\220!\330\014\017\210v\220Q\320\0260\260\007\260r\270\021\330\010\013\2106\220\021\220!\360\020\000\t\014\2106\220\021\330\010\013\2106\220\021\330\010\014\210E\220\036\230q\200A\360\016\000\t\r\210F\220\"\220G\230:\240X\250Q\330\010\014\210I\220R\220w\230j\250\013\2601\330\010\014\210H\220B\220g\230Z\240z\260\021\330\010\014\210O\2302\230W\240J\320.?\270q\330\010\013\2106\220\023\220A\330\014\022\320\022%\240Q\240a\330\010\016\210d\220\"\220A\220T\230\033\240F\250!\2507\260!\330\010\014\210F\220%\220q\230\004\230A\330\014\023\2201\330\014\024\220A\330\014\024\220A\330\014\022\220!\330\014\020\220\005\220U\230!\2301\330\020\024\220D\320\030*\250!\2504\250q\330\020\023\2203\220a\220s\230\"\230A\330\024\030\230\007\230q\240\001\330\025\030\230\001\230\023\230B\230a\230q\330\024\031\230\027\240\001\240\021\340\024\031\230\027\240\001\240\021\330\014\025\220S\230\001\230\021\330\014\025\220S\230\001\230\021\330\014\024\220C\220q\230\001\330\014\023\2207\230\"\230G\2402\240V\2503\250a\330\014\027\220s\230!\2301\330\014\017\210w\220c\230\022\2304\230v\240S""\250\001\330\020\024\220E\230\021\330\024\030\230\005\230Q\330\030\034\230A\230S\240\001\240\023\240C\240s\250!\2503\250b\260\003\2601\260A\330\030\034\230B\230c\240\024\240Z\250q\260\003\2602\260T\270\032\3001\300A\330\034\036\230d\240*\250A\250Q\330\030\035\230W\240A\240Q\330\020\030\230\007\230q\240\001\240\031\250\"\250B\250d\260%\260u\270A\270Q\330\020\030\230\007\230q\240\001\240\031\250\"\250B\250b\260\002\260$\260e\2705\300\001\300\021\330\020\023\2207\230!\2304\230z\250\021\250$\250a\250t\2602\260U\270\"\270A\330\033 \240\002\240#\240R\240u\250B\250a\330\033 \240\002\240#\240R\240u\250B\250d\260\"\260A\330\024\034\230B\230e\2401\240H\250B\250b\260\001\260\021\330$,\250B\250b\260\001\260\021\330$,\250B\250b\260\001\260\021\330\020\023\2207\230!\2304\230z\250\021\250$\250a\250t\2602\260U\270\"\270A\330\033 \240\002\240#\240R\240u\250B\250a\330\033 \240\002\240#\240R\240u\250B\250d\260\"\260A\330\024\034\230B\230e\2401\240H\250B\250b\260\001\260\021\330$,\250B\250b\260\001\260\021\330$,\250B\250b\260\001\260\021\330\020\031\230\026\230q\330\024\031\230\021\230(\240\"\240B\240a\240t\2502\250U\260!\2608\2702\270R\270q\300\001\330\024\031\230\021\230(\240\"\240B\240a\240t\2502\250U\260!\2608\2702\270R\270q\300\001\330\020\032\230%\230q\240\001\330\020\027\220w\230a\230q\330\020\027\220w\230a\230q\330\020\027\220w\230a\230q\330\020\036\230g\240Q\240h\250b\260\001\330\020\031\230\026\230q\330\024\031\230\021\230(\240\"\240B\240a\240t\2502\250U\260!\2608\2702\270R\270q\300\001\330\024\031\230\021\230(\240\"\240B\240a\240t\2502\250U\260!\2608\2702\270R\270q\300\001\330\020\032\230%\230q\240\001\330\020\027\220w\230a\230q\330\020\027\220w\230a\230q\330\020\027\220w\230a\230q\330\020\036\230g\240Q\240h\250b\260\001\330\021\027\220s\230\"\230D\240\007\240s\250!\330\020\024\220E\230\021\230!\330\020\024\220E\230\021\330\024\030\230\001\230\023\230A\230S\240\003\2403\240a\240s\250\"\250C\250q\260\001\330\024\030\230\002\230#\230T\240\032\2501\250C\250r\260\024\260Z\270q""\300\004\300A\330\030\034\230J\240a\240q\330\024\031\230\027\240\001\240\021\330\020\030\230\007\230q\240\001\240\031\250\"\250B\250d\260%\260u\270A\270Q\330\020\023\2207\230!\2304\230z\250\021\250%\250q\260\004\260B\260e\2702\270Q\330\033 \240\002\240#\240R\240u\250B\250a\330\033 \240\002\240#\240R\240u\250B\250d\260\"\260A\330\024\034\230B\230e\2401\240H\250B\250b\260\001\260\021\330$,\250B\250b\260\001\260\021\330$,\250B\250b\260\001\260\021\330\020\031\230\026\230q\330\024\031\230\021\230(\240\"\240B\240a\240t\2502\250U\260!\2608\2702\270R\270q\300\001\330\024\031\230\021\230(\240\"\240B\240a\240t\2502\250U\260!\2608\2702\270R\270q\300\001\330\020\032\230%\230q\240\001\330\020\027\220w\230a\230q\330\020\027\220w\230a\230q\330\020\027\220w\230a\230q\330\020\036\230g\240Q\240h\250b\260\001\330\021\030\230\003\2302\230T\240\026\240s\250!\330\020\024\220D\230\001\230\021\330\020\024\220E\230\021\330\024\030\230\001\230\023\230A\230S\240\003\2403\240a\240s\250\"\250C\250q\260\001\330\024\030\230\002\230#\230T\240\032\2501\250C\250r\260\024\260Z\270q\300\004\300A\330\030\034\230J\240a\240q\330\024\031\230\027\240\001\240\021\330\020\030\230\007\230q\240\001\240\031\250\"\250B\250d\260%\260u\270A\270Q\330\020\023\2207\230!\2304\230z\250\021\250$\250a\250t\2602\260U\270\"\270A\330\033 \240\002\240#\240R\240u\250B\250a\330\033 \240\002\240#\240R\240u\250B\250d\260\"\260A\330\024\034\230B\230e\2401\240H\250B\250b\260\001\260\021\330$,\250B\250b\260\001\260\021\330$,\250B\250b\260\001\260\021\330\020\031\230\026\230q\330\024\031\230\021\230(\240\"\240B\240a\240t\2502\250U\260!\2608\2702\270R\270q\300\001\330\024\031\230\021\230(\240\"\240B\240a\240t\2502\250U\260!\2608\2702\270R\270q\300\001\330\020\032\230%\230q\240\001\330\020\027\220w\230a\230q\330\020\027\220w\230a\230q\330\020\027\220w\230a\230q\330\020\036\230g\240Q\240h\250b\260\001\330\021\030\230\003\2302\230V\2406\250\023\250B\250d\260\047\270\023\270C\270q\330#)\250\023\250B\250d\260\047\270\023\270A\340\020""\025\220W\230A\230T\240\032\2501\250E\260\021\260!\330\020\024\220E\230\021\330\024\030\230\005\230Q\330\030\034\230A\230S\240\001\240\023\240C\240s\250!\2503\250b\260\003\2601\260A\330\030\034\230B\230c\240\024\240Z\250q\260\003\2602\260T\270\032\3001\300A\330\034\036\230d\240*\250A\250Q\330\030\035\230W\240A\240Q\330\020\030\230\007\230q\240\001\240\031\250\"\250B\250d\260%\260u\270A\270Q\330\020\023\2207\230!\2304\230z\250\021\250$\250a\250t\2602\260U\270\"\270A\330\033 \240\002\240#\240R\240u\250B\250a\330\033 \240\002\240#\240R\240u\250B\250d\260\"\260A\330\024\034\230B\230e\2401\240H\250B\250b\260\001\260\021\330$,\250B\250b\260\001\260\021\330$,\250B\250b\260\001\260\021\330\020\031\230\026\230q\330\024\031\230\021\230(\240\"\240B\240a\240t\2502\250U\260!\2608\2702\270R\270q\300\001\330\024\031\230\021\230(\240\"\240B\240a\240t\2502\250U\260!\2608\2702\270R\270q\300\001\330\020\032\230%\230q\240\001\330\020\027\220w\230a\230q\330\020\027\220w\230a\230q\330\020\027\220w\230a\230q\330\020\036\230g\240Q\240h\250b\260\001\330\021\030\230\003\2302\230T\240\026\240s\250\"\250D\260\007\260s\270!\340\020\024\220E\230\021\330\024\031\230\027\240\001\240\024\240Z\250q\260\001\330\020\024\220D\230\001\230\021\330\020\024\220E\230\021\230!\330\020\024\220A\220S\230\001\230\023\230C\230s\240!\2403\240b\250\003\2501\250A\330\020\024\220B\220c\230\024\230Z\240q\250\003\2502\250T\260\032\2701\270A\330\024\026\220d\230*\240A\240Q\330\020\025\220W\230A\230Q\330\020\030\230\007\230q\240\001\240\031\250\"\250B\250d\260%\260u\270A\270Q\330\020\023\2207\230!\2304\230z\250\021\250$\250a\250t\2602\260U\270\"\270A\330\033 \240\002\240#\240R\240u\250B\250a\330\033 \240\002\240#\240R\240u\250B\250d\260\"\260A\330\024\034\230B\230e\2401\240H\250B\250b\260\001\260\021\330$,\250B\250b\260\001\260\021\330$,\250B\250b\260\001\260\021\330\020\031\230\026\230q\330\024\031\230\021\230(\240\"\240B\240a\240t\2502\250U\260!\2608\2702\270R\270q\300\001\330\024\031\230\021\230(\240\"\240B\240a\240t""\2502\250U\260!\2608\2702\270R\270q\300\001\330\020\032\230%\230q\240\001\330\020\027\220w\230a\230q\330\020\027\220w\230a\230q\330\020\027\220w\230a\230q\330\020\036\230g\240Q\240h\250b\260\001\330\021\030\230\003\2301\330\020\024\220E\230\021\330\024\031\230\027\240\001\240\024\240Z\250q\260\001\330\020\030\230\007\230q\240\001\240\031\250\"\250B\250d\260%\260u\270A\270Q\330\020\023\2206\230\023\230A\330\024\027\220w\230a\230t\240:\250Q\250d\260!\2604\260r\270\025\270b\300\001\330\037$\240B\240c\250\022\2505\260\002\260!\330\037$\240B\240c\250\022\2505\260\002\260$\260b\270\001\330\030 \240\002\240%\240q\250\010\260\002\260\"\260A\260Q\330(0\260\002\260\"\260A\260Q\330(0\260\002\260\"\260A\260Q\340\024\027\220w\230a\230t\240:\250Q\250e\2601\260D\270\002\270%\270r\300\021\330\037$\240B\240c\250\022\2505\260\002\260!\330\037$\240B\240c\250\022\2505\260\002\260$\260b\270\001\330\030 \240\002\240%\240q\250\010\260\002\260\"\260A\260Q\330(0\260\002\260\"\260A\260Q\330(0\260\002\260\"\260A\260Q\330\020\031\230\026\230q\330\024\031\230\021\230(\240\"\240B\240a\240t\2502\250U\260!\2608\2702\270R\270q\300\001\330\024\031\230\021\230(\240\"\240B\240a\240t\2502\250U\260!\2608\2702\270R\270q\300\001\330\020\032\230%\230q\240\001\330\020\027\220w\230a\230q\330\020\027\220w\230a\230q\330\020\027\220w\230a\230q\330\020\036\230g\240Q\240h\250b\260\001\230\021\320\004\030\230\001\360\006\000\t\016\210^\2301\330\010\013\2101\330\014\023\2204\320\027\047\240q\330\014\017\210q\320\020,\250B\250d\260!\2601\340\014\017\210t\220<\230w\240e\2505\260\004\260K\270q\300\003\3002\300U\310!\33004\260K\270q\300\003\3002\300Q\330\020\021\360\006\000\r\021\220\005\220R\220t\2301\330\020\021\330\010\017\210t\320\023%\240V\2501\250C\250s\260!\330\014D\300G\3101\330\020\024\320\024&\240f\250A\250Q\330\010\014\210G\220:\230T\240\021\330\014\020\220\005\220Q\330\020\024\320\024*\250!\2507\260!\330\020\024\320\024(\250\001\250\027\260\003\2604\260q\330\010\014\210L\230\001\330\010\013\210:\220T\230""\025\230c\240\021\330\014\020\320\020 \240\004\240A\320\004\037\230q\360\010\000\t\016\210^\2301\330\010\013\2104\210u\220I\230Q\330\014\026\220a\220t\2303\230b\240\002\240!\330\027\033\2303\230e\2403\240a\240t\2507\260$\260d\270\047\300\021\330\014\017\210t\2203\220a\330\020\026\220a\220s\230\"\230D\240\007\240r\250\021\250#\250R\250t\2607\270\"\270A\270Q\330\027\033\2307\240\"\240A\240S\250\002\250!\2501\250D\260\007\260r\270\021\270!\330\027\033\2307\240\"\240A\240S\250\002\250$\250b\260\004\260G\2702\270Q\270c\300\022\3004\300w\310b\320PQ\320QR\330\014\024\220A\220T\230\023\230B\230b\240\001\330\025\031\230\023\230E\240\023\240A\240T\250\027\260\004\260D\270\007\270q\330\014\021\220\021\220%\220t\2307\240\"\240A\240S\250\002\250\"\250B\250d\260\047\270\022\2701\270A\330\014\026\220l\240$\240g\250R\250q\260\003\2602\260U\270!\2701\330\"&\240g\250R\250q\260\003\2602\260U\270!\2701\330\014\026\220d\230\047\240\022\2401\240C\240r\250\025\250a\330\020\024\220G\2302\230Q\230a\330\014\025\220T\230\027\240\002\240!\2403\240b\250\004\250A\330\020\024\220G\2302\230Q\230a\330\014\024\220D\230\007\230r\240\021\240#\240R\240s\250\"\250D\260\007\260r\270\021\270!\330\014\022\220$\220a\220\177\240a\330\014\037\230x\240q\250\001\360\\\004\000\r\020\210v\220Q\320\026&\240k\260\021\260*\270G\3001\300A\3302<\270G\3001\300A\3302<\270G\3001\300A\33028\270\003\2701\270A\33028\270\003\2701\270A\33028\270\003\2701\270A\3302:\270%\270q\300\001\3302:\270%\270q\300\001\3302:\270%\270q\300\001\3302;\2701\3302;\2701\3302:\270!\33029\270\021\33028\270\001\360\006\000\r\020\210v\220Q\320\004#\2401\360\010\000\t\016\320\r \240\001\330\010\014\210N\230!\230:\240Q\240c\250\024\250^\2704\270q\330\010\r\210Q\320\016&\240d\250!\330\010\014\320\014!\240\022\2401\320$>\270b\300\004\300A\300V\3101\330\010\014\210M\230\022\2301\320\0343\2602\260T\270\021\270&\300\001\330\010\014\320\014\"\240#\240Q\240d\250!\330\010\014\210E\220\021\330\010\023\220:\230Q\230l\250!\2501\330\010\014\210I\220Y\230i\240q""\250\004\250A\330\014\020\220\002\220!\220;\230h\240a\240t\2502\250Q\250d\260!\330-1\260\034\270Q\270b\300\001\300\023\300A\330-1\260\021\260&\270\001\330\010\014\210K\220q\330\010\014\210O\2301\330\010\013\2105\220\003\2201\330\014\020\320\020!\240\021\240!\330\010\017\210q\320\004,\250A\330\021\037\230~\250Q\360H\001\000\t\r\210O\2301\330\010\014\210J\220a\330\010\014\210I\220Q\330\010\014\210L\230\001\330\010\014\210K\220q\330\010\014\320\014\036\230a\330\010\014\210C\210z\230\024\230Q\330\014\020\220\005\220Q\330\020\027\220r\230\023\230A\330\024\025\330\010\014\210N\230!\330\010\014\210N\230!\330\010\014\210J\220a\330\010\014\210H\220D\230\004\230A\330\010\014\320\014\035\230Q\330\010\014\210N\230!";
20847 PyObject *data = NULL;
20848 #define __Pyx_DecompressString_UNUSED
20849 #define __Pyx_DecompressString_LZSS_UNUSED
20850 #endif
20851 PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
20852 Py_ssize_t pos = 0;
20853 for (int i = 0; i < 252; i++) {
20854 Py_ssize_t bytes_length = str_length_index[i].length;
20855 PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
20856 if (likely(string) && i >= 42) PyUnicode_InternInPlace(&string);
20857 if (unlikely(!string)) {
20858 Py_XDECREF(data);
20859 __PYX_ERR(0, 1, __pyx_L1_error)
20860 }
20861 stringtab[i] = string;
20862 pos += bytes_length;
20863 }
20864 for (int i = 252; i < 262; i++) {
20865 Py_ssize_t bytes_length = bytes_length_index[i-252].length;
20866 PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length);
20867 stringtab[i] = string;
20868 pos += bytes_length;
20869 if (unlikely(!string)) {
20870 Py_XDECREF(data);
20871 __PYX_ERR(0, 1, __pyx_L1_error)
20872 }
20873 }
20874 Py_XDECREF(data);
20875 for (Py_ssize_t i = 0; i < 262; i++) {
20876 if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
20877 __PYX_ERR(0, 1, __pyx_L1_error)
20878 }
20879 }
20880 #if CYTHON_IMMORTAL_CONSTANTS
20881 {
20882 PyObject **table = stringtab + 252;
20883 for (Py_ssize_t i=0; i<10; ++i) {
20884 #if PY_VERSION_HEX >= 0x030F0000
20885 PyUnstable_SetImmortal(table[i]);
20886 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
20887 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
20888 #if PY_VERSION_HEX < 0x030E0000
20889 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
20890 #else
20891 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
20892 #endif
20893 {
20894 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
20895 }
20896 #else
20897 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
20898 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
20899 #endif
20900 }
20901 }
20902 #endif
20903 }
20904 {
20905 PyObject **numbertab = __pyx_mstate->__pyx_number_tab;
20906 double const c_constants[] = {0.0,0.5,2.0,0.01,0.02,0.85};
20907 for (int i = 0; i < 6; i++) {
20908 numbertab[i] = PyFloat_FromDouble(c_constants[i]);
20909 if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
20910 }
20911 }
20912 {
20913 PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 6;
20914 int8_t const cint_constants_1[] = {0,1,2,3,4,5,10};
20915 for (int i = 0; i < 7; i++) {
20916 numbertab[i] = PyLong_FromLong(cint_constants_1[i - 0]);
20917 if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
20918 }
20919 }
20920 #if CYTHON_IMMORTAL_CONSTANTS
20921 {
20922 PyObject **table = __pyx_mstate->__pyx_number_tab;
20923 for (Py_ssize_t i=0; i<13; ++i) {
20924 #if PY_VERSION_HEX >= 0x030F0000
20925 PyUnstable_SetImmortal(table[i]);
20926 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
20927 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
20928 #if PY_VERSION_HEX < 0x030E0000
20929 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
20930 #else
20931 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
20932 #endif
20933 {
20934 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
20935 }
20936 #else
20937 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
20938 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
20939 #endif
20940 }
20941 }
20942 #endif
20943 return 0;
20944 __pyx_L1_error:;
20945 return -1;
20946}
20947/* #### Code section: init_codeobjects ### */
20948#ifdef __cplusplus
20949namespace {
20950#endif
20951typedef struct {
20952 unsigned int argcount : 3;
20953 unsigned int num_posonly_args : 1;
20954 unsigned int num_kwonly_args : 1;
20955 unsigned int nlocals : 5;
20956 unsigned int flags : 10;
20957 unsigned int first_line : 10;
20958} __Pyx_PyCode_New_function_description;
20959#ifdef __cplusplus
20960} /* anonymous namespace */
20961#endif
20962/* NewCodeObj.proto */
20963static PyObject* __Pyx_PyCode_New(
20964 const __Pyx_PyCode_New_function_description descr,
20965 PyObject * const *varnames,
20966 PyObject *filename,
20967 PyObject *funcname,
20968 PyObject *line_table,
20969 PyObject *tuple_dedup_map
20970);
20971
20972
20973static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
20974 PyObject* tuple_dedup_map = PyDict_New();
20975 if (unlikely(!tuple_dedup_map)) return -1;
20976 {
20977 const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_GENERATOR), 122};
20978 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_bn, __pyx_mstate->__pyx_n_u_gn};
20979 __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_Isosurface_pyx, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_kp_b_iso88591__6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad;
20980 }
20981 {
20982 const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 51};
20983 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_isosurfaces, __pyx_mstate->__pyx_n_u_domain, __pyx_mstate->__pyx_n_u_activeTime, __pyx_mstate->__pyx_n_u_sampleRate, __pyx_mstate->__pyx_n_u_format, __pyx_mstate->__pyx_n_u_writeBoundary, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_values, __pyx_mstate->__pyx_n_u_v};
20984 __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_Isosurface_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_A_QH_O1_Ja_IQ_L_Kq_a_Cz_Q_Q_r_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad;
20985 }
20986 {
20987 const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 105};
20988 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_model, __pyx_mstate->__pyx_n_u_ar, __pyx_mstate->__pyx_n_u_fine_grid, __pyx_mstate->__pyx_n_u_genexpr, __pyx_mstate->__pyx_n_u_genexpr};
20989 __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_Isosurface_pyx, __pyx_mstate->__pyx_n_u_attachModel, __pyx_mstate->__pyx_kp_b_iso88591_A_IQ_E_N_q_A_uA_A_uA_A_uA_S_A_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad;
20990 }
20991 {
20992 const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 132};
20993 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_h5, __pyx_mstate->__pyx_n_u_step, __pyx_mstate->__pyx_n_u_cam, __pyx_mstate->__pyx_n_u_namedtuple, __pyx_mstate->__pyx_n_u_FemField, __pyx_mstate->__pyx_n_u_field_i, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_isosurface};
20994 __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_Isosurface_pyx, __pyx_mstate->__pyx_n_u_attachHDF5, __pyx_mstate->__pyx_kp_b_iso88591_1_N_Qc_4q_Q_d_1_b_AV1_M_1_32T_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad;
20995 }
20996 {
20997 const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 30, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 154};
20998 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_eN, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_I, __pyx_mstate->__pyx_n_u_nMinus, __pyx_mstate->__pyx_n_u_nPlus, __pyx_mstate->__pyx_n_u_nZeros, __pyx_mstate->__pyx_n_u_nN_start, __pyx_mstate->__pyx_n_u_eps, __pyx_mstate->__pyx_n_u_s, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_normal, __pyx_mstate->__pyx_n_u_nodes, __pyx_mstate->__pyx_n_u_elements, __pyx_mstate->__pyx_n_u_normals, __pyx_mstate->__pyx_n_u_normal_indices, __pyx_mstate->__pyx_n_u_phi, __pyx_mstate->__pyx_n_u_plus, __pyx_mstate->__pyx_n_u_minus, __pyx_mstate->__pyx_n_u_zeros, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_j};
20999 __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_Isosurface_pyx, __pyx_mstate->__pyx_n_u_triangulateIsosurface, __pyx_mstate->__pyx_kp_b_iso88591_A_F_G_XQ_IRwj_1_HBgZz_O2WJ_q_6_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad;
21000 }
21001 {
21002 const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 344};
21003 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_frame};
21004 __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_Isosurface_pyx, __pyx_mstate->__pyx_n_u_writeIsosurfaceMesh, __pyx_mstate->__pyx_kp_b_iso88591_A_4xs_q_Rt1A_1G7_A_q_wa_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad;
21005 }
21006 {
21007 const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 355};
21008 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_frame, __pyx_mstate->__pyx_n_u_h5py, __pyx_mstate->__pyx_n_u_nodes, __pyx_mstate->__pyx_n_u_elements, __pyx_mstate->__pyx_n_u_normals, __pyx_mstate->__pyx_n_u_normal_indices, __pyx_mstate->__pyx_n_u_filename, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_dset};
21009 __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_Isosurface_pyx, __pyx_mstate->__pyx_n_u_writeIsosurfaceMesh_h5, __pyx_mstate->__pyx_kp_b_iso88591_A_F_G1_4y_hb_q__BgQ_2U_q_k_Qd_uT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad;
21010 }
21011 {
21012 const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 21, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 372};
21013 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_frame, __pyx_mstate->__pyx_n_u_Template, __pyx_mstate->__pyx_n_u_nodes, __pyx_mstate->__pyx_n_u_elements, __pyx_mstate->__pyx_n_u_normals, __pyx_mstate->__pyx_n_u_normal_indices, __pyx_mstate->__pyx_n_u_pov_filename, __pyx_mstate->__pyx_n_u_pov, __pyx_mstate->__pyx_n_u_dx, __pyx_mstate->__pyx_n_u_nll, __pyx_mstate->__pyx_n_u_fur, __pyx_mstate->__pyx_n_u_povScene, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_ebN, __pyx_mstate->__pyx_n_u_bnt, __pyx_mstate->__pyx_n_u_e, __pyx_mstate->__pyx_n_u_ni, __pyx_mstate->__pyx_n_u_n};
21014 __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_Isosurface_pyx, __pyx_mstate->__pyx_n_u_writeIsosurfaceMesh_povray, __pyx_mstate->__pyx_kp_b_iso88591_A_1_F_G1_4y_hb_q__BgQ_G1_a_E_4uI, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad;
21015 }
21016 {
21017 const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 523};
21018 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_checkTime, __pyx_mstate->__pyx_n_u_Template, __pyx_mstate->__pyx_n_u_time, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_values, __pyx_mstate->__pyx_n_u_v};
21019 __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_Isosurface_pyx, __pyx_mstate->__pyx_n_u_calculate, __pyx_mstate->__pyx_kp_b_iso88591_1_1_4_q_q_Bd_1_t_we5_Kq_2U_04Kq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad;
21020 }
21021 {
21022 const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 549};
21023 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cam, __pyx_mstate->__pyx_n_u_Template, __pyx_mstate->__pyx_n_u_look_at, __pyx_mstate->__pyx_n_u_light, __pyx_mstate->__pyx_n_u_light_dx, __pyx_mstate->__pyx_n_u_light_dy, __pyx_mstate->__pyx_n_u_floor_z, __pyx_mstate->__pyx_n_u_wall_y, __pyx_mstate->__pyx_n_u_sky_z, __pyx_mstate->__pyx_n_u_pov, __pyx_mstate->__pyx_n_u_povSceneTemplate, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_L, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_L};
21024 __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_Isosurface_pyx, __pyx_mstate->__pyx_n_u_writeSceneHeader, __pyx_mstate->__pyx_kp_b_iso88591_q_1_4uIQ_at3b_3e3at7_d_t3a_as_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad;
21025 }
21026 Py_DECREF(tuple_dedup_map);
21027 return 0;
21028 bad:
21029 Py_DECREF(tuple_dedup_map);
21030 return -1;
21031}
21032/* #### Code section: init_globals ### */
21033
21034static int __Pyx_InitGlobals(void) {
21035 int __pyx_lineno = 0;
21036 const char *__pyx_filename = NULL;
21037 int __pyx_clineno = 0;
21038 /* PythonCompatibility.init */
21039 if (likely(__Pyx_init_co_variables() == 0 && __Pyx_init_tpflags_variables() == 0)); else
21040
21041 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
21042
21043 /* AssertionsEnabled.init */
21044 if (likely(__Pyx_init_assertions_enabled() == 0)); else
21045
21046 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
21047
21048 /* PyFrozenDict.init */
21049 #if CYTHON_COMPILING_IN_LIMITED_API
21050 {
21051 PyObject *builtins = PyEval_GetBuiltins(); // borrowed
21052 if (likely(builtins)) {
21053 PyObject *type_name = PyUnicode_FromStringAndSize("frozendict", sizeof("frozendict")-1);
21054 if (likely(type_name)) {
21055 PyObject *frozendict_type = PyObject_GetItem(builtins, type_name);
21056 Py_DECREF(type_name);
21057 if (!frozendict_type && PyErr_ExceptionMatches(PyExc_KeyError)) {
21058 PyErr_Clear();
21059 frozendict_type = (PyObject*) &PyDict_Type;
21060 Py_INCREF(frozendict_type);
21061 }
21062 __pyx_mstate_global->__Pyx_PyFrozenDictType = frozendict_type;
21063 }
21064 }
21065 } // error handling follows
21066 #endif
21067
21068 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
21069
21070 /* NumpyImportArray.init */
21071 /*
21072 * Cython has automatically inserted a call to _import_array since
21073 * you didn't include one when you cimported numpy. To disable this
21074 * add the line
21075 * <void>numpy._import_array
21076 */
21077 #ifdef NPY_FEATURE_VERSION
21078 #ifndef NO_IMPORT_ARRAY
21079 if (unlikely(_import_array() == -1)) {
21080 PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import "
21081 "(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; "
21082 "use '<void>numpy._import_array' to disable if you are certain you don't need it).");
21083 }
21084 #endif
21085 #endif
21086
21087 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
21088
21089 /* CommonTypesMetaclass.init */
21090 if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else
21091
21092 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
21093
21094 /* CachedMethodType.init */
21095 #if CYTHON_COMPILING_IN_LIMITED_API
21096 {
21097 PyObject *typesModule=NULL;
21098 typesModule = PyImport_ImportModule("types");
21099 if (typesModule) {
21100 __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType");
21101 Py_DECREF(typesModule);
21102 }
21103 } // error handling follows
21104 #endif
21105
21106 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
21107
21108 /* Generator.init */
21109 if (likely(__pyx_Generator_init(__pyx_m) == 0)); else
21110
21111 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
21112
21113 return 0;
21114 __pyx_L1_error:;
21115 return -1;
21116}
21117/* #### Code section: init_after_shared_utility ### */
21118
21119static int __Pyx_InitAfterSharedUtility(void) {
21120 int __pyx_lineno = 0;
21121 const char *__pyx_filename = NULL;
21122 int __pyx_clineno = 0;
21123 /* CythonFunctionPerModule.init */
21124 if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else
21125
21126 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
21127
21128 return 0;
21129 __pyx_L1_error:;
21130 return -1;
21131}
21132/* #### Code section: cleanup_globals ### */
21133/* #### Code section: cleanup_module ### */
21134/* #### Code section: main_method ### */
21135/* #### Code section: utility_code_pragmas ### */
21136#ifdef _MSC_VER
21137#pragma warning( push )
21138/* Warning 4127: conditional expression is constant
21139 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
21140 * compile-time, so this warning is not useful
21141 */
21142#pragma warning( disable : 4127 )
21143#endif
21144
21145
21146
21147/* #### Code section: utility_code_def ### */
21148
21149/* --- Runtime support code --- */
21150/* Refnanny */
21151#if CYTHON_REFNANNY
21152static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
21153 PyObject *m = NULL, *p = NULL;
21154 void *r = NULL;
21155 m = PyImport_ImportModule(modname);
21156 if (!m) goto end;
21157 p = PyObject_GetAttrString(m, "RefNannyAPI");
21158 if (!p) goto end;
21159 r = PyLong_AsVoidPtr(p);
21160end:
21161 Py_XDECREF(p);
21162 Py_XDECREF(m);
21163 return (__Pyx_RefNannyAPIStruct *)r;
21164}
21165#endif
21166
21167/* FastTypeChecks (used by GivenExceptionMatches) */
21168#if CYTHON_COMPILING_IN_CPYTHON
21169static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
21170 while (a) {
21171 a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
21172 if (a == b)
21173 return 1;
21174 }
21175 return b == &PyBaseObject_Type;
21176}
21177static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
21178 PyObject *mro;
21179 if (a == b) return 1;
21180 mro = a->tp_mro;
21181 if (likely(mro)) {
21182 Py_ssize_t i, n;
21183 n = PyTuple_GET_SIZE(mro);
21184 for (i = 0; i < n; i++) {
21185 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
21186 return 1;
21187 }
21188 return 0;
21189 }
21190 return __Pyx_InBases(a, b);
21191}
21192static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
21193 PyObject *mro;
21194 if (cls == a || cls == b) return 1;
21195 mro = cls->tp_mro;
21196 if (likely(mro)) {
21197 Py_ssize_t i, n;
21198 n = PyTuple_GET_SIZE(mro);
21199 for (i = 0; i < n; i++) {
21200 PyObject *base = PyTuple_GET_ITEM(mro, i);
21201 if (base == (PyObject *)a || base == (PyObject *)b)
21202 return 1;
21203 }
21204 return 0;
21205 }
21206 return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
21207}
21208#endif
21209
21210/* PyErrFetchRestore (used by GivenExceptionMatches) */
21211#if CYTHON_FAST_THREAD_STATE
21212static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
21213#if PY_VERSION_HEX >= 0x030C00A6
21214 PyObject *tmp_value;
21215 assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
21216 if (value) {
21217 #if CYTHON_COMPILING_IN_CPYTHON
21218 if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
21219 #endif
21220 PyException_SetTraceback(value, tb);
21221 }
21222 tmp_value = tstate->current_exception;
21223 tstate->current_exception = value;
21224 Py_XDECREF(tmp_value);
21225 Py_XDECREF(type);
21226 Py_XDECREF(tb);
21227#else
21228 PyObject *tmp_type, *tmp_value, *tmp_tb;
21229 tmp_type = tstate->curexc_type;
21230 tmp_value = tstate->curexc_value;
21231 tmp_tb = tstate->curexc_traceback;
21232 tstate->curexc_type = type;
21233 tstate->curexc_value = value;
21234 tstate->curexc_traceback = tb;
21235 Py_XDECREF(tmp_type);
21236 Py_XDECREF(tmp_value);
21237 Py_XDECREF(tmp_tb);
21238#endif
21239}
21240static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
21241#if PY_VERSION_HEX >= 0x030C00A6
21242 PyObject* exc_value;
21243 exc_value = tstate->current_exception;
21244 tstate->current_exception = 0;
21245 *value = exc_value;
21246 *type = NULL;
21247 *tb = NULL;
21248 if (exc_value) {
21249 *type = (PyObject*) Py_TYPE(exc_value);
21250 Py_INCREF(*type);
21251 #if CYTHON_COMPILING_IN_CPYTHON
21252 *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
21253 Py_XINCREF(*tb);
21254 #else
21255 *tb = PyException_GetTraceback(exc_value);
21256 #endif
21257 }
21258#else
21259 *type = tstate->curexc_type;
21260 *value = tstate->curexc_value;
21261 *tb = tstate->curexc_traceback;
21262 tstate->curexc_type = 0;
21263 tstate->curexc_value = 0;
21264 tstate->curexc_traceback = 0;
21265#endif
21266}
21267#endif
21268
21269/* GivenExceptionMatches (used by PyErrExceptionMatches) */
21270#if CYTHON_COMPILING_IN_CPYTHON
21271static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
21272 if (exc_type1) {
21273 return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
21274 } else {
21275 return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
21276 }
21277}
21278static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
21279 Py_ssize_t i, n;
21280 assert(PyExceptionClass_Check(exc_type));
21281 n = PyTuple_GET_SIZE(tuple);
21282 for (i=0; i<n; i++) {
21283 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
21284 }
21285 for (i=0; i<n; i++) {
21286 PyObject *t = PyTuple_GET_ITEM(tuple, i);
21287 if (likely(PyExceptionClass_Check(t))) {
21288 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
21289 } else {
21290 }
21291 }
21292 return 0;
21293}
21294static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
21295 if (likely(err == exc_type)) return 1;
21296 if (likely(PyExceptionClass_Check(err))) {
21297 if (likely(PyExceptionClass_Check(exc_type))) {
21298 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
21299 } else if (likely(PyTuple_Check(exc_type))) {
21300 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
21301 } else {
21302 }
21303 }
21304 return PyErr_GivenExceptionMatches(err, exc_type);
21305}
21306static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
21307 assert(PyExceptionClass_Check(exc_type1));
21308 assert(PyExceptionClass_Check(exc_type2));
21309 if (likely(err == exc_type1 || err == exc_type2)) return 1;
21310 if (likely(PyExceptionClass_Check(err))) {
21311 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
21312 }
21313 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
21314}
21315#endif
21316
21317/* PyErrExceptionMatches (used by PyObjectGetAttrStrNoError) */
21318#if CYTHON_FAST_THREAD_STATE
21319static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
21320 Py_ssize_t i, n;
21321 n = PyTuple_GET_SIZE(tuple);
21322 for (i=0; i<n; i++) {
21323 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
21324 }
21325 for (i=0; i<n; i++) {
21326 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
21327 }
21328 return 0;
21329}
21330static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
21331 int result;
21332 PyObject *exc_type;
21333#if PY_VERSION_HEX >= 0x030C00A6
21334 PyObject *current_exception = tstate->current_exception;
21335 if (unlikely(!current_exception)) return 0;
21336 exc_type = (PyObject*) Py_TYPE(current_exception);
21337 if (exc_type == err) return 1;
21338#else
21339 exc_type = tstate->curexc_type;
21340 if (exc_type == err) return 1;
21341 if (unlikely(!exc_type)) return 0;
21342#endif
21343 #if CYTHON_AVOID_BORROWED_REFS
21344 Py_INCREF(exc_type);
21345 #endif
21346 if (unlikely(PyTuple_Check(err))) {
21347 result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
21348 } else {
21349 result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
21350 }
21351 #if CYTHON_AVOID_BORROWED_REFS
21352 Py_DECREF(exc_type);
21353 #endif
21354 return result;
21355}
21356#endif
21357
21358/* PyObjectGetAttrStr (used by PyObjectGetAttrStrNoError) */
21359#if CYTHON_USE_TYPE_SLOTS
21360static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
21361 PyTypeObject* tp = Py_TYPE(obj);
21362 if (likely(tp->tp_getattro))
21363 return tp->tp_getattro(obj, attr_name);
21364 return PyObject_GetAttr(obj, attr_name);
21365}
21366#endif
21367
21368/* PyObjectGetAttrStrNoError (used by GetBuiltinName) */
21369#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
21370static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
21371 __Pyx_PyThreadState_declare
21372 __Pyx_PyThreadState_assign
21373 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
21374 __Pyx_PyErr_Clear();
21375}
21376#endif
21377static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
21378 PyObject *result;
21379#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
21380 (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
21381 return result;
21382#else
21383#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
21384 PyTypeObject* tp = Py_TYPE(obj);
21385 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
21386 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
21387 }
21388#endif
21389 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
21390 if (unlikely(!result)) {
21391 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
21392 }
21393 return result;
21394#endif
21395}
21396
21397/* GetBuiltinName */
21398static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
21399 PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name);
21400 if (unlikely(!result) && !PyErr_Occurred()) {
21401 PyErr_Format(PyExc_NameError,
21402 "name '%U' is not defined", name);
21403 }
21404 return result;
21405}
21406
21407/* GetTopmostException (used by SaveResetException) */
21408#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
21409static _PyErr_StackItem *
21410__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
21411{
21412 _PyErr_StackItem *exc_info = tstate->exc_info;
21413 while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
21414 exc_info->previous_item != NULL)
21415 {
21416 exc_info = exc_info->previous_item;
21417 }
21418 return exc_info;
21419}
21420#endif
21421
21422/* SaveResetException */
21423#if CYTHON_FAST_THREAD_STATE
21424static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
21425 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
21426 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
21427 PyObject *exc_value = exc_info->exc_value;
21428 if (exc_value == NULL || exc_value == Py_None) {
21429 *value = NULL;
21430 *type = NULL;
21431 *tb = NULL;
21432 } else {
21433 *value = exc_value;
21434 Py_INCREF(*value);
21435 *type = (PyObject*) Py_TYPE(exc_value);
21436 Py_INCREF(*type);
21437 *tb = PyException_GetTraceback(exc_value);
21438 }
21439 #elif CYTHON_USE_EXC_INFO_STACK
21440 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
21441 *type = exc_info->exc_type;
21442 *value = exc_info->exc_value;
21443 *tb = exc_info->exc_traceback;
21444 Py_XINCREF(*type);
21445 Py_XINCREF(*value);
21446 Py_XINCREF(*tb);
21447 #else
21448 *type = tstate->exc_type;
21449 *value = tstate->exc_value;
21450 *tb = tstate->exc_traceback;
21451 Py_XINCREF(*type);
21452 Py_XINCREF(*value);
21453 Py_XINCREF(*tb);
21454 #endif
21455}
21456static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
21457 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
21458 _PyErr_StackItem *exc_info = tstate->exc_info;
21459 PyObject *tmp_value = exc_info->exc_value;
21460 exc_info->exc_value = value;
21461 Py_XDECREF(tmp_value);
21462 Py_XDECREF(type);
21463 Py_XDECREF(tb);
21464 #else
21465 PyObject *tmp_type, *tmp_value, *tmp_tb;
21466 #if CYTHON_USE_EXC_INFO_STACK
21467 _PyErr_StackItem *exc_info = tstate->exc_info;
21468 tmp_type = exc_info->exc_type;
21469 tmp_value = exc_info->exc_value;
21470 tmp_tb = exc_info->exc_traceback;
21471 exc_info->exc_type = type;
21472 exc_info->exc_value = value;
21473 exc_info->exc_traceback = tb;
21474 #else
21475 tmp_type = tstate->exc_type;
21476 tmp_value = tstate->exc_value;
21477 tmp_tb = tstate->exc_traceback;
21478 tstate->exc_type = type;
21479 tstate->exc_value = value;
21480 tstate->exc_traceback = tb;
21481 #endif
21482 Py_XDECREF(tmp_type);
21483 Py_XDECREF(tmp_value);
21484 Py_XDECREF(tmp_tb);
21485 #endif
21486}
21487#endif
21488
21489/* GetException */
21490#if CYTHON_FAST_THREAD_STATE
21491static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
21492#else
21493static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
21494#endif
21495{
21496 PyObject *local_type = NULL, *local_value, *local_tb = NULL;
21497#if CYTHON_FAST_THREAD_STATE
21498 PyObject *tmp_type, *tmp_value, *tmp_tb;
21499 #if PY_VERSION_HEX >= 0x030C0000
21500 local_value = tstate->current_exception;
21501 tstate->current_exception = 0;
21502 #else
21503 local_type = tstate->curexc_type;
21504 local_value = tstate->curexc_value;
21505 local_tb = tstate->curexc_traceback;
21506 tstate->curexc_type = 0;
21507 tstate->curexc_value = 0;
21508 tstate->curexc_traceback = 0;
21509 #endif
21510#elif __PYX_LIMITED_VERSION_HEX >= 0x030C0000
21511 local_value = PyErr_GetRaisedException();
21512#else
21513 PyErr_Fetch(&local_type, &local_value, &local_tb);
21514#endif
21515#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
21516 if (likely(local_value)) {
21517 local_type = (PyObject*) Py_TYPE(local_value);
21518 Py_INCREF(local_type);
21519 local_tb = PyException_GetTraceback(local_value);
21520 }
21521#else
21522 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
21523#if CYTHON_FAST_THREAD_STATE
21524 if (unlikely(tstate->curexc_type))
21525#else
21526 if (unlikely(PyErr_Occurred()))
21527#endif
21528 goto bad;
21529 if (local_tb) {
21530 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
21531 goto bad;
21532 }
21533#endif // __PYX_LIMITED_VERSION_HEX >= 0x030C0000
21534 Py_XINCREF(local_tb);
21535 Py_XINCREF(local_type);
21536 Py_XINCREF(local_value);
21537 *type = local_type;
21538 *value = local_value;
21539 *tb = local_tb;
21540#if CYTHON_FAST_THREAD_STATE
21541 #if CYTHON_USE_EXC_INFO_STACK
21542 {
21543 _PyErr_StackItem *exc_info = tstate->exc_info;
21544 #if PY_VERSION_HEX >= 0x030B00a4
21545 tmp_value = exc_info->exc_value;
21546 exc_info->exc_value = local_value;
21547 tmp_type = NULL;
21548 tmp_tb = NULL;
21549 Py_XDECREF(local_type);
21550 Py_XDECREF(local_tb);
21551 #else
21552 tmp_type = exc_info->exc_type;
21553 tmp_value = exc_info->exc_value;
21554 tmp_tb = exc_info->exc_traceback;
21555 exc_info->exc_type = local_type;
21556 exc_info->exc_value = local_value;
21557 exc_info->exc_traceback = local_tb;
21558 #endif
21559 }
21560 #else
21561 tmp_type = tstate->exc_type;
21562 tmp_value = tstate->exc_value;
21563 tmp_tb = tstate->exc_traceback;
21564 tstate->exc_type = local_type;
21565 tstate->exc_value = local_value;
21566 tstate->exc_traceback = local_tb;
21567 #endif
21568 Py_XDECREF(tmp_type);
21569 Py_XDECREF(tmp_value);
21570 Py_XDECREF(tmp_tb);
21571#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000
21572 PyErr_SetHandledException(local_value);
21573 Py_XDECREF(local_value);
21574 Py_XDECREF(local_type);
21575 Py_XDECREF(local_tb);
21576#else
21577 PyErr_SetExcInfo(local_type, local_value, local_tb);
21578#endif
21579 return 0;
21580#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
21581bad:
21582 *type = 0;
21583 *value = 0;
21584 *tb = 0;
21585 Py_XDECREF(local_type);
21586 Py_XDECREF(local_value);
21587 Py_XDECREF(local_tb);
21588 return -1;
21589#endif
21590}
21591
21592/* PyObjectCall (used by PyObjectFastCall) */
21593#if CYTHON_COMPILING_IN_CPYTHON
21594static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
21595 PyObject *result;
21596 ternaryfunc call = Py_TYPE(func)->tp_call;
21597 if (unlikely(!call))
21598 return PyObject_Call(func, arg, kw);
21599 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
21600 return NULL;
21601 result = (*call)(func, arg, kw);
21602 Py_LeaveRecursiveCall();
21603 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
21604 PyErr_SetString(
21605 PyExc_SystemError,
21606 "NULL result without error in PyObject_Call");
21607 }
21608 return result;
21609}
21610#endif
21611
21612/* PyObjectCallMethO (used by PyObjectFastCall) */
21613#if CYTHON_COMPILING_IN_CPYTHON
21614static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
21615 PyObject *self, *result;
21616 PyCFunction cfunc;
21617 cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
21618 self = __Pyx_CyOrPyCFunction_GET_SELF(func);
21619 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
21620 return NULL;
21621 result = cfunc(self, arg);
21622 Py_LeaveRecursiveCall();
21623 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
21624 PyErr_SetString(
21625 PyExc_SystemError,
21626 "NULL result without error in PyObject_Call");
21627 }
21628 return result;
21629}
21630#endif
21631
21632/* PyObjectFastCall */
21633#if CYTHON_COMPILING_IN_LIMITED_API
21634static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) {
21635 PyObject *argstuple;
21636 PyObject *result = 0;
21637 size_t i;
21638 argstuple = PyTuple_New((Py_ssize_t)nargs);
21639 if (unlikely(!argstuple)) return NULL;
21640 for (i = 0; i < nargs; i++) {
21641 Py_INCREF(args[i]);
21642 if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad;
21643 }
21644 result = __Pyx_PyObject_Call(func, argstuple, kwargs);
21645 bad:
21646 Py_DECREF(argstuple);
21647 return result;
21648}
21649#endif
21650#if CYTHON_VECTORCALL && !(CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY)
21651 #if CYTHON_COMPILING_IN_CPYTHON
21652static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
21653 PyTypeObject *tp = Py_TYPE(callable);
21654 #if defined(__Pyx_CyFunction_USED)
21655 if (__Pyx_CyFunction_CheckExact(callable)) {
21656 return __Pyx_CyFunction_func_vectorcall(callable);
21657 }
21658 #endif
21659 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
21660 return NULL;
21661 }
21662 assert(PyCallable_Check(callable));
21663 Py_ssize_t offset = tp->tp_vectorcall_offset;
21664 assert(offset > 0);
21665 vectorcallfunc ptr;
21666 memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
21667 return ptr;
21668}
21669 #else
21670 #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
21671 #endif
21672#endif
21673static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwargs) {
21674 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
21675#if CYTHON_COMPILING_IN_CPYTHON
21676 if (nargs == 0 && kwargs == NULL) {
21677 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
21678 return __Pyx_PyObject_CallMethO(func, NULL);
21679 }
21680 else if (nargs == 1 && kwargs == NULL) {
21681 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
21682 return __Pyx_PyObject_CallMethO(func, args[0]);
21683 }
21684#endif
21685 if (kwargs == NULL) {
21686 #if CYTHON_VECTORCALL
21687 #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
21688 return PyObject_Vectorcall(func, args, nargsf, NULL);
21689 #else
21690 vectorcallfunc f = __Pyx_PyVectorcall_Function(func);
21691 if (f) {
21692 return f(func, args, nargsf, NULL);
21693 }
21694 #endif
21695 #endif
21696 }
21697 if (nargs == 0) {
21698 return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
21699 }
21700 #if CYTHON_COMPILING_IN_LIMITED_API
21701 return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
21702 #elif CYTHON_COMPILING_IN_PYPY
21703 return PyObject_VectorcallDict(func, args, (size_t) nargs, kwargs);
21704 #else
21705 return PyObject_VectorcallDict(func, args, nargsf, kwargs);
21706 #endif
21707}
21708
21709/* RaiseException */
21710static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
21711 PyObject* owned_instance = NULL;
21712 if (tb == Py_None) {
21713 tb = 0;
21714 } else if (tb && !PyTraceBack_Check(tb)) {
21715 PyErr_SetString(PyExc_TypeError,
21716 "raise: arg 3 must be a traceback or None");
21717 goto bad;
21718 }
21719 if (value == Py_None)
21720 value = 0;
21721 if (PyExceptionInstance_Check(type)) {
21722 if (value) {
21723 PyErr_SetString(PyExc_TypeError,
21724 "instance exception may not have a separate value");
21725 goto bad;
21726 }
21727 value = type;
21728 type = (PyObject*) Py_TYPE(value);
21729 } else if (PyExceptionClass_Check(type)) {
21730 PyObject *instance_class = NULL;
21731 if (value && PyExceptionInstance_Check(value)) {
21732 instance_class = (PyObject*) Py_TYPE(value);
21733 if (instance_class != type) {
21734 int is_subclass = PyObject_IsSubclass(instance_class, type);
21735 if (!is_subclass) {
21736 instance_class = NULL;
21737 } else if (unlikely(is_subclass == -1)) {
21738 goto bad;
21739 } else {
21740 type = instance_class;
21741 }
21742 }
21743 }
21744 if (!instance_class) {
21745 PyObject *args;
21746 if (!value)
21747 args = PyTuple_New(0);
21748 else if (PyTuple_Check(value)) {
21749 Py_INCREF(value);
21750 args = value;
21751 } else
21752 args = PyTuple_Pack(1, value);
21753 if (!args)
21754 goto bad;
21755 owned_instance = PyObject_Call(type, args, NULL);
21756 Py_DECREF(args);
21757 if (!owned_instance)
21758 goto bad;
21759 value = owned_instance;
21760 if (!PyExceptionInstance_Check(value)) {
21761 PyErr_Format(PyExc_TypeError,
21762 "calling %R should have returned an instance of "
21763 "BaseException, not %R",
21764 type, Py_TYPE(value));
21765 goto bad;
21766 }
21767 }
21768 } else {
21769 PyErr_SetString(PyExc_TypeError,
21770 "raise: exception class must be a subclass of BaseException");
21771 goto bad;
21772 }
21773 if (cause) {
21774 PyObject *fixed_cause;
21775 if (cause == Py_None) {
21776 fixed_cause = NULL;
21777 } else if (PyExceptionClass_Check(cause)) {
21778 fixed_cause = PyObject_CallObject(cause, NULL);
21779 if (fixed_cause == NULL)
21780 goto bad;
21781 } else if (PyExceptionInstance_Check(cause)) {
21782 fixed_cause = cause;
21783 Py_INCREF(fixed_cause);
21784 } else {
21785 PyErr_SetString(PyExc_TypeError,
21786 "exception causes must derive from "
21787 "BaseException");
21788 goto bad;
21789 }
21790 PyException_SetCause(value, fixed_cause);
21791 }
21792 PyErr_SetObject(type, value);
21793 if (tb) {
21794#if PY_VERSION_HEX >= 0x030C00A6
21795 PyException_SetTraceback(value, tb);
21796#elif CYTHON_FAST_THREAD_STATE
21797 PyThreadState *tstate = __Pyx_PyThreadState_Current;
21798 PyObject* tmp_tb = tstate->curexc_traceback;
21799 if (tb != tmp_tb) {
21800 Py_INCREF(tb);
21801 tstate->curexc_traceback = tb;
21802 Py_XDECREF(tmp_tb);
21803 }
21804#else
21805 PyObject *tmp_type, *tmp_value, *tmp_tb;
21806 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
21807 Py_INCREF(tb);
21808 PyErr_Restore(tmp_type, tmp_value, tb);
21809 Py_XDECREF(tmp_tb);
21810#endif
21811 }
21812bad:
21813 Py_XDECREF(owned_instance);
21814 return;
21815}
21816
21817/* IgnoreException (used by GetModuleGlobalName) */
21818static CYTHON_INLINE int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception) {
21819 if (PyErr_GivenExceptionMatches(given_exception ? given_exception : PyErr_Occurred(), ignorable_exception)) {
21820 PyErr_Clear();
21821 return 1;
21822 }
21823 return 0;
21824}
21825
21826/* PyDictVersioning (used by GetModuleGlobalName) */
21827#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
21828static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
21829 PyObject *dict = Py_TYPE(obj)->tp_dict;
21830 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
21831}
21832static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
21833 PyObject **dictptr = NULL;
21834 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
21835 if (offset) {
21836#if CYTHON_COMPILING_IN_CPYTHON
21837 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
21838#else
21839 dictptr = _PyObject_GetDictPtr(obj);
21840#endif
21841 }
21842 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
21843}
21844static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
21845 PyObject *dict = Py_TYPE(obj)->tp_dict;
21846 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
21847 return 0;
21848 return obj_dict_version == __Pyx_get_object_dict_version(obj);
21849}
21850#endif
21851
21852/* GetModuleGlobalName */
21853#if CYTHON_USE_DICT_VERSIONS
21854static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
21855#else
21856static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
21857#endif
21858{
21859 PyObject *result;
21860#if CYTHON_COMPILING_IN_LIMITED_API
21861 if (unlikely(!__pyx_m)) {
21862 if (!PyErr_Occurred())
21863 PyErr_SetNone(PyExc_NameError);
21864 return NULL;
21865 }
21866 result = PyObject_GetAttr(__pyx_m, name);
21867 if (likely(result)) {
21868 return result;
21869 }
21870 if (!__Pyx_IgnoreException(PyExc_Exception)) {
21871 return NULL; // BaseException
21872 }
21873#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
21874 if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) {
21875 if (!__Pyx_IgnoreException(PyExc_Exception)) {
21876 return NULL; // BaseException
21877 }
21878 }
21879 __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
21880 if (likely(result)) {
21881 return result;
21882 }
21883#else
21884 result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash);
21885 __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
21886 if (likely(result)) {
21887 return __Pyx_NewRef(result);
21888 }
21889 PyObject *exc = PyErr_Occurred();
21890 if (unlikely(exc) && !__Pyx_IgnoreGivenException(exc, PyExc_Exception)) {
21891 return NULL; // BaseException
21892 }
21893#endif
21894 return __Pyx_GetBuiltinName(name);
21895}
21896
21897/* CopyObjectArray (used by TupleOrListFromArrayImpl) */
21898#if CYTHON_COMPILING_IN_CPYTHON
21899static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
21900 PyObject *v;
21901 Py_ssize_t i;
21902 for (i = 0; i < length; i++) {
21903 v = dest[i] = src[i];
21904 Py_INCREF(v);
21905 }
21906}
21907#endif
21908
21909/* TupleOrListFromArrayImpl (used by TupleFromArray) */
21910#if !(PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API)
21911CYTHON_UNUSED static PyObject *
21912__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) {
21913 if (n <= 0) {
21914 return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
21915 }
21916 PyObject *res = PyTuple_New(n);
21917 if (unlikely(res == NULL)) return NULL;
21918 #if CYTHON_COMPILING_IN_CPYTHON
21919 __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
21920 #else
21921 Py_ssize_t i;
21922 for (i = 0; i < n; i++) {
21923 Py_INCREF(src[i]);
21924 if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
21925 Py_DECREF(res);
21926 return NULL;
21927 }
21928 }
21929 #endif
21930 return res;
21931}
21932#endif
21933
21934/* FormatTypeName (used by RaiseErrorWithObjectTypes) */
21935#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
21936static __Pyx_TypeName
21937__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
21938{
21939 PyObject *module = NULL, *name = NULL, *result = NULL;
21940 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
21941 name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
21942 __pyx_mstate_global->__pyx_n_u_qualname);
21943 #else
21944 name = PyType_GetQualName(tp);
21945 #endif
21946 if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad;
21947 module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
21948 __pyx_mstate_global->__pyx_n_u_module);
21949 if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad;
21950 if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) {
21951 result = name;
21952 name = NULL;
21953 goto done;
21954 }
21955 result = PyUnicode_FromFormat("%U.%U", module, name);
21956 if (unlikely(result == NULL)) goto bad;
21957 done:
21958 Py_XDECREF(name);
21959 Py_XDECREF(module);
21960 return result;
21961 bad:
21962 PyErr_Clear();
21963 if (name) {
21964 result = name;
21965 name = NULL;
21966 } else {
21967 result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u_);
21968 }
21969 goto done;
21970}
21971#endif
21972
21973/* RaiseErrorWithObjectTypes (used by ExtTypeTest) */
21974static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type, const char *message, const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2) {
21975 __Pyx_TypeName type_name1 = __Pyx_PyType_GetFullyQualifiedName(type_obj1);
21976 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
21977 if (unlikely(!type_name1)) return;
21978 #endif
21979 __Pyx_TypeName type_name2 = __Pyx_PyType_GetFullyQualifiedName(type_obj2);
21980 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
21981 if (unlikely(!type_name2)) goto type2_failed;
21982 #endif
21983 PyErr_Format(exc_type, message, arg, type_name1, type_name2);
21984 __Pyx_DECREF_TypeName(type_name2);
21985#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
21986type2_failed:
21987#endif
21988 __Pyx_DECREF_TypeName(type_name1);
21989}
21990
21991/* ExtTypeTest */
21992static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
21993 if (unlikely(!type)) {
21994 PyErr_SetString(PyExc_SystemError, "Missing type object");
21995 return 0;
21996 }
21997 if (likely(__Pyx_TypeCheck(obj, type)))
21998 return 1;
21999 __Pyx_RaiseTypeErrorWithTypes(
22000 "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
22001 Py_TYPE(obj), type);
22002 return 0;
22003}
22004
22005/* IsLittleEndian (used by BufferFormatCheck) */
22006static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
22007{
22008 union {
22009 uint32_t u32;
22010 uint8_t u8[4];
22011 } S;
22012 S.u32 = 0x01020304;
22013 return S.u8[0] == 4;
22014}
22015
22016/* BufferFormatCheck (used by BufferGetAndValidate) */
22017static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
22018 __Pyx_BufFmt_StackElem* stack,
22019 const __Pyx_TypeInfo* type) {
22020 stack[0].field = &ctx->root;
22021 stack[0].parent_offset = 0;
22022 ctx->root.type = type;
22023 ctx->root.name = "buffer dtype";
22024 ctx->root.offset = 0;
22025 ctx->head = stack;
22026 ctx->head->field = &ctx->root;
22027 ctx->fmt_offset = 0;
22028 ctx->head->parent_offset = 0;
22029 ctx->new_packmode = '@';
22030 ctx->enc_packmode = '@';
22031 ctx->new_count = 1;
22032 ctx->enc_count = 0;
22033 ctx->enc_type = 0;
22034 ctx->is_complex = 0;
22035 ctx->is_valid_array = 0;
22036 ctx->struct_alignment = 0;
22037 while (type->typegroup == 'S') {
22038 ++ctx->head;
22039 ctx->head->field = type->fields;
22040 ctx->head->parent_offset = 0;
22041 type = type->fields->type;
22042 }
22043}
22044static int __Pyx_BufFmt_ParseNumber(const char** ts) {
22045 int count;
22046 const char* t = *ts;
22047 if (*t < '0' || *t > '9') {
22048 return -1;
22049 } else {
22050 count = *t++ - '0';
22051 while (*t >= '0' && *t <= '9') {
22052 count *= 10;
22053 count += *t++ - '0';
22054 }
22055 }
22056 *ts = t;
22057 return count;
22058}
22059static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
22060 int number = __Pyx_BufFmt_ParseNumber(ts);
22061 if (number == -1)
22062 PyErr_Format(PyExc_ValueError,\
22063 "Does not understand character buffer dtype format string ('%c')", **ts);
22064 return number;
22065}
22066static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
22067 PyErr_Format(PyExc_ValueError,
22068 "Unexpected format string character: '%c'", ch);
22069}
22070static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
22071 switch (ch) {
22072 case '?': return "'bool'";
22073 case 'c': return "'char'";
22074 case 'b': return "'signed char'";
22075 case 'B': return "'unsigned char'";
22076 case 'h': return "'short'";
22077 case 'H': return "'unsigned short'";
22078 case 'i': return "'int'";
22079 case 'I': return "'unsigned int'";
22080 case 'l': return "'long'";
22081 case 'L': return "'unsigned long'";
22082 case 'q': return "'long long'";
22083 case 'Q': return "'unsigned long long'";
22084 case 'f': return (is_complex ? "'complex float'" : "'float'");
22085 case 'd': return (is_complex ? "'complex double'" : "'double'");
22086 case 'g': return (is_complex ? "'complex long double'" : "'long double'");
22087 case 'T': return "a struct";
22088 case 'O': return "Python object";
22089 case 'P': return "a pointer";
22090 case 's': case 'p': return "a string";
22091 case 0: return "end";
22092 default: return "unparsable format string";
22093 }
22094}
22095static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
22096 switch (ch) {
22097 case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
22098 case 'h': case 'H': return 2;
22099 case 'i': case 'I': case 'l': case 'L': return 4;
22100 case 'q': case 'Q': return 8;
22101 case 'f': return (is_complex ? 8 : 4);
22102 case 'd': return (is_complex ? 16 : 8);
22103 case 'g': {
22104 PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
22105 return 0;
22106 }
22107 case 'O': case 'P': return sizeof(void*);
22108 default:
22109 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
22110 return 0;
22111 }
22112}
22113static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
22114 switch (ch) {
22115 case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
22116 case 'h': case 'H': return sizeof(short);
22117 case 'i': case 'I': return sizeof(int);
22118 case 'l': case 'L': return sizeof(long);
22119 case 'q': case 'Q': return sizeof(PY_LONG_LONG);
22120 case 'f': return sizeof(float) * (is_complex ? 2 : 1);
22121 case 'd': return sizeof(double) * (is_complex ? 2 : 1);
22122 case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
22123 case 'O': case 'P': return sizeof(void*);
22124 default: {
22125 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
22126 return 0;
22127 }
22128 }
22129}
22130typedef struct { char c; short x; } __Pyx_st_short;
22131typedef struct { char c; int x; } __Pyx_st_int;
22132typedef struct { char c; long x; } __Pyx_st_long;
22133typedef struct { char c; float x; } __Pyx_st_float;
22134typedef struct { char c; double x; } __Pyx_st_double;
22135typedef struct { char c; long double x; } __Pyx_st_longdouble;
22136typedef struct { char c; void *x; } __Pyx_st_void_p;
22137typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
22138static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) {
22139 CYTHON_UNUSED_VAR(is_complex);
22140 switch (ch) {
22141 case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
22142 case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
22143 case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
22144 case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
22145 case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
22146 case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
22147 case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
22148 case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
22149 case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
22150 default:
22151 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
22152 return 0;
22153 }
22154}
22155/* These are for computing the padding at the end of the struct to align
22156 on the first member of the struct. This will probably the same as above,
22157 but we don't have any guarantees.
22158 */
22159typedef struct { short x; char c; } __Pyx_pad_short;
22160typedef struct { int x; char c; } __Pyx_pad_int;
22161typedef struct { long x; char c; } __Pyx_pad_long;
22162typedef struct { float x; char c; } __Pyx_pad_float;
22163typedef struct { double x; char c; } __Pyx_pad_double;
22164typedef struct { long double x; char c; } __Pyx_pad_longdouble;
22165typedef struct { void *x; char c; } __Pyx_pad_void_p;
22166typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
22167static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, int is_complex) {
22168 CYTHON_UNUSED_VAR(is_complex);
22169 switch (ch) {
22170 case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
22171 case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
22172 case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
22173 case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
22174 case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
22175 case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
22176 case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
22177 case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
22178 case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
22179 default:
22180 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
22181 return 0;
22182 }
22183}
22184static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
22185 switch (ch) {
22186 case 'c':
22187 return 'H';
22188 case 'b': case 'h': case 'i':
22189 case 'l': case 'q': case 's': case 'p':
22190 return 'I';
22191 case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
22192 return 'U';
22193 case 'f': case 'd': case 'g':
22194 return (is_complex ? 'C' : 'R');
22195 case 'O':
22196 return 'O';
22197 case 'P':
22198 return 'P';
22199 default: {
22200 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
22201 return 0;
22202 }
22203 }
22204}
22205static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
22206 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
22207 const char* expected;
22208 const char* quote;
22209 if (ctx->head == NULL) {
22210 expected = "end";
22211 quote = "";
22212 } else {
22213 expected = ctx->head->field->type->name;
22214 quote = "'";
22215 }
22216 PyErr_Format(PyExc_ValueError,
22217 "Buffer dtype mismatch, expected %s%s%s but got %s",
22218 quote, expected, quote,
22219 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
22220 } else {
22221 const __Pyx_StructField* field = ctx->head->field;
22222 const __Pyx_StructField* parent = (ctx->head - 1)->field;
22223 PyErr_Format(PyExc_ValueError,
22224 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
22225 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
22226 parent->type->name, field->name);
22227 }
22228}
22229static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
22230 char group;
22231 size_t size, offset, arraysize = 1;
22232 if (ctx->enc_type == 0) return 0;
22233 if (ctx->head->field->type->arraysize[0]) {
22234 int i, ndim = 0;
22235 if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
22236 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
22237 ndim = 1;
22238 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
22239 PyErr_Format(PyExc_ValueError,
22240 "Expected a dimension of size %zu, got %zu",
22241 ctx->head->field->type->arraysize[0], ctx->enc_count);
22242 return -1;
22243 }
22244 }
22245 if (!ctx->is_valid_array) {
22246 PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
22247 ctx->head->field->type->ndim, ndim);
22248 return -1;
22249 }
22250 for (i = 0; i < ctx->head->field->type->ndim; i++) {
22251 arraysize *= ctx->head->field->type->arraysize[i];
22252 }
22253 ctx->is_valid_array = 0;
22254 ctx->enc_count = 1;
22255 }
22256 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
22257 do {
22258 const __Pyx_StructField* field = ctx->head->field;
22259 const __Pyx_TypeInfo* type = field->type;
22260 if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
22261 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
22262 } else {
22263 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
22264 }
22265 if (ctx->enc_packmode == '@') {
22266 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
22267 size_t align_mod_offset;
22268 if (align_at == 0) return -1;
22269 align_mod_offset = ctx->fmt_offset % align_at;
22270 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
22271 if (ctx->struct_alignment == 0)
22272 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
22273 ctx->is_complex);
22274 }
22275 if (type->size != size || type->typegroup != group) {
22276 if (type->typegroup == 'C' && type->fields != NULL) {
22277 size_t parent_offset = ctx->head->parent_offset + field->offset;
22278 ++ctx->head;
22279 ctx->head->field = type->fields;
22280 ctx->head->parent_offset = parent_offset;
22281 continue;
22282 }
22283 if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
22284 } else {
22285 __Pyx_BufFmt_RaiseExpected(ctx);
22286 return -1;
22287 }
22288 }
22289 offset = ctx->head->parent_offset + field->offset;
22290 if (ctx->fmt_offset != offset) {
22291 PyErr_Format(PyExc_ValueError,
22292 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
22293 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
22294 return -1;
22295 }
22296 ctx->fmt_offset += size;
22297 if (arraysize)
22298 ctx->fmt_offset += (arraysize - 1) * size;
22299 --ctx->enc_count;
22300 while (1) {
22301 if (field == &ctx->root) {
22302 ctx->head = NULL;
22303 if (ctx->enc_count != 0) {
22304 __Pyx_BufFmt_RaiseExpected(ctx);
22305 return -1;
22306 }
22307 break;
22308 }
22309 ctx->head->field = ++field;
22310 if (field->type == NULL) {
22311 --ctx->head;
22312 field = ctx->head->field;
22313 continue;
22314 } else if (field->type->typegroup == 'S') {
22315 size_t parent_offset = ctx->head->parent_offset + field->offset;
22316 if (field->type->fields->type == NULL) continue;
22317 field = field->type->fields;
22318 ++ctx->head;
22319 ctx->head->field = field;
22320 ctx->head->parent_offset = parent_offset;
22321 break;
22322 } else {
22323 break;
22324 }
22325 }
22326 } while (ctx->enc_count);
22327 ctx->enc_type = 0;
22328 ctx->is_complex = 0;
22329 return 0;
22330}
22331static int
22332__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
22333{
22334 const char *ts = *tsp;
22335 int i = 0, number, ndim;
22336 ++ts;
22337 if (ctx->new_count != 1) {
22338 PyErr_SetString(PyExc_ValueError,
22339 "Cannot handle repeated arrays in format string");
22340 return -1;
22341 }
22342 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return -1;
22343 ndim = ctx->head->field->type->ndim;
22344 while (*ts && *ts != ')') {
22345 switch (*ts) {
22346 case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
22347 default: break;
22348 }
22349 number = __Pyx_BufFmt_ExpectNumber(&ts);
22350 if (number == -1) return -1;
22351 if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) {
22352 PyErr_Format(PyExc_ValueError,
22353 "Expected a dimension of size %zu, got %d",
22354 ctx->head->field->type->arraysize[i], number);
22355 return -1;
22356 }
22357 if (*ts != ',' && *ts != ')') {
22358 PyErr_Format(PyExc_ValueError,
22359 "Expected a comma in format string, got '%c'", *ts);
22360 return -1;
22361 }
22362 if (*ts == ',') ts++;
22363 i++;
22364 }
22365 if (i != ndim) {
22366 PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
22367 ctx->head->field->type->ndim, i);
22368 return -1;
22369 }
22370 if (!*ts) {
22371 PyErr_SetString(PyExc_ValueError,
22372 "Unexpected end of format string, expected ')'");
22373 return -1;
22374 }
22375 ctx->is_valid_array = 1;
22376 ctx->new_count = 1;
22377 *tsp = ++ts;
22378 return 0;
22379}
22380static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
22381 int got_Z = 0;
22382 while (1) {
22383 switch(*ts) {
22384 case 0:
22385 if (ctx->enc_type != 0 && ctx->head == NULL) {
22386 __Pyx_BufFmt_RaiseExpected(ctx);
22387 return NULL;
22388 }
22389 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
22390 if (ctx->head != NULL) {
22391 __Pyx_BufFmt_RaiseExpected(ctx);
22392 return NULL;
22393 }
22394 return ts;
22395 case ' ':
22396 case '\r':
22397 case '\n':
22398 ++ts;
22399 break;
22400 case '<':
22401 if (!__Pyx_Is_Little_Endian()) {
22402 PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
22403 return NULL;
22404 }
22405 ctx->new_packmode = '=';
22406 ++ts;
22407 break;
22408 case '>':
22409 case '!':
22410 if (__Pyx_Is_Little_Endian()) {
22411 PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
22412 return NULL;
22413 }
22414 ctx->new_packmode = '=';
22415 ++ts;
22416 break;
22417 case '=':
22418 case '@':
22419 case '^':
22420 ctx->new_packmode = *ts++;
22421 break;
22422 case 'T':
22423 {
22424 const char* ts_after_sub;
22425 size_t i, struct_count = ctx->new_count;
22426 size_t struct_alignment = ctx->struct_alignment;
22427 ctx->new_count = 1;
22428 ++ts;
22429 if (*ts != '\x7B') {
22430 PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '\x7B' after 'T'");
22431 return NULL;
22432 }
22433 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
22434 ctx->enc_type = 0;
22435 ctx->enc_count = 0;
22436 ctx->struct_alignment = 0;
22437 ++ts;
22438 ts_after_sub = ts;
22439 for (i = 0; i != struct_count; ++i) {
22440 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
22441 if (!ts_after_sub) return NULL;
22442 }
22443 ts = ts_after_sub;
22444 if (struct_alignment) ctx->struct_alignment = struct_alignment;
22445 }
22446 break;
22447 case '\x7D':
22448 {
22449 size_t alignment = ctx->struct_alignment;
22450 ++ts;
22451 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
22452 ctx->enc_type = 0;
22453 if (alignment && ctx->fmt_offset % alignment) {
22454 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
22455 }
22456 }
22457 return ts;
22458 case 'x':
22459 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
22460 ctx->fmt_offset += ctx->new_count;
22461 ctx->new_count = 1;
22462 ctx->enc_count = 0;
22463 ctx->enc_type = 0;
22464 ctx->enc_packmode = ctx->new_packmode;
22465 ++ts;
22466 break;
22467 case 'Z':
22468 got_Z = 1;
22469 ++ts;
22470 if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
22471 __Pyx_BufFmt_RaiseUnexpectedChar('Z');
22472 return NULL;
22473 }
22474 CYTHON_FALLTHROUGH;
22475 case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
22476 case 'l': case 'L': case 'q': case 'Q':
22477 case 'f': case 'd': case 'g':
22478 case 'O': case 'p':
22479 if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
22480 (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
22481 ctx->enc_count += ctx->new_count;
22482 ctx->new_count = 1;
22483 got_Z = 0;
22484 ++ts;
22485 break;
22486 }
22487 CYTHON_FALLTHROUGH;
22488 case 's':
22489 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
22490 ctx->enc_count = ctx->new_count;
22491 ctx->enc_packmode = ctx->new_packmode;
22492 ctx->enc_type = *ts;
22493 ctx->is_complex = got_Z;
22494 ++ts;
22495 ctx->new_count = 1;
22496 got_Z = 0;
22497 break;
22498 case ':':
22499 ++ts;
22500 while(*ts != ':') ++ts;
22501 ++ts;
22502 break;
22503 case '(':
22504 if (__pyx_buffmt_parse_array(ctx, &ts) < 0) return NULL;
22505 break;
22506 default:
22507 {
22508 int number = __Pyx_BufFmt_ExpectNumber(&ts);
22509 if (number == -1) return NULL;
22510 ctx->new_count = (size_t)number;
22511 }
22512 }
22513 }
22514}
22515
22516/* BufferGetAndValidate */
22517static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
22518 if (unlikely(info->buf == NULL)) return;
22519 if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
22520 PyBuffer_Release(info);
22521}
22522static void __Pyx_ZeroBuffer(Py_buffer* buf) {
22523 buf->buf = NULL;
22524 buf->obj = NULL;
22525 buf->strides = __Pyx_zeros;
22526 buf->shape = __Pyx_zeros;
22527 buf->suboffsets = __Pyx_minusones;
22528}
22529static int __Pyx__GetBufferAndValidate(
22530 Py_buffer* buf, PyObject* obj, const __Pyx_TypeInfo* dtype, int flags,
22531 int nd, int cast, __Pyx_BufFmt_StackElem* stack)
22532{
22533 buf->buf = NULL;
22534 if (unlikely(PyObject_GetBuffer(obj, buf, flags) == -1)) {
22535 __Pyx_ZeroBuffer(buf);
22536 return -1;
22537 }
22538 if (unlikely(buf->ndim != nd)) {
22539 PyErr_Format(PyExc_ValueError,
22540 "Buffer has wrong number of dimensions (expected %d, got %d)",
22541 nd, buf->ndim);
22542 goto fail;
22543 }
22544 if (!cast) {
22545 __Pyx_BufFmt_Context ctx;
22546 __Pyx_BufFmt_Init(&ctx, stack, dtype);
22547 if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
22548 }
22549 if (unlikely((size_t)buf->itemsize != dtype->size)) {
22550 PyErr_Format(PyExc_ValueError,
22551 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
22552 buf->itemsize, (buf->itemsize > 1) ? "s" : "",
22553 dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
22554 goto fail;
22555 }
22556 if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
22557 return 0;
22558fail:;
22559 __Pyx_SafeReleaseBuffer(buf);
22560 return -1;
22561}
22562
22563/* BufferIndexError */
22564static void __Pyx_RaiseBufferIndexError(int axis) {
22565 PyErr_Format(PyExc_IndexError,
22566 "Out of bounds on buffer access (axis %d)", axis);
22567}
22568
22569/* PyObjectCompare (used by UnicodeEquals) */
22570#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
22571#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
22572static CYTHON_INLINE int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
22573 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
22574 int result = PyUnicode_Equal(s1, s2);
22575 #if !CYTHON_COMPILING_IN_CPYTHON
22576 if (unlikely(result == -1)) return -1;
22577 #endif
22578 if (result == 0) goto __pyx_return_false; else goto __pyx_return_true;
22579 #else
22580 int result = PyUnicode_Compare(s1, s2);
22581 if (unlikely((result == -1) && PyErr_Occurred())) return -1;
22582 if (result == 0) goto __pyx_return_true; else goto __pyx_return_false;
22583 #endif
22584__pyx_return_true:
22585 return 1;
22586__pyx_return_false:
22587 return 0;
22588}
22589#endif
22590static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2, int pyop) {
22591 CYTHON_UNUSED_VAR(pyop);
22592 if (unlikely(op1 == Py_None)) {
22593 if (op2 == Py_None) goto __pyx_return_true; else goto __pyx_return_false;
22594 }
22595 if (unlikely(op2 == Py_None)) {
22596 if (op1 == Py_None) goto __pyx_return_true; else goto __pyx_return_false;
22597 }
22598
22599 if (likely(op1 != Py_None)) {
22600 if (op1 == op2) goto __pyx_return_true;
22601 if (likely(op2 != Py_None)) {
22602 return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
22603 }
22604 goto __pyx_richcmp;
22605 }
22606
22607 if ((0)) goto __pyx_richcmp;
22608 if ((0)) goto __pyx_return_true;
22609 if ((0)) goto __pyx_return_false;
22610__pyx_richcmp:
22611 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
22612__pyx_return_true:
22613 return 1;
22614__pyx_return_false:
22615 return 0;
22616}
22617
22618/* fastcall */
22619#if CYTHON_VECTORCALL
22620static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
22621{
22622 Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames);
22623 #if !CYTHON_ASSUME_SAFE_SIZE
22624 if (unlikely(n == -1)) return NULL;
22625 #endif
22626 for (i = 0; i < n; i++)
22627 {
22628 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
22629 #if !CYTHON_ASSUME_SAFE_MACROS
22630 if (unlikely(!namei)) return NULL;
22631 #endif
22632 if (s == namei) return kwvalues[i];
22633 }
22634 for (i = 0; i < n; i++)
22635 {
22636 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
22637 #if !CYTHON_ASSUME_SAFE_MACROS
22638 if (unlikely(!namei)) return NULL;
22639 #endif
22640 int eq = __Pyx_PyUnicode_Equals(s, namei);
22641 if (unlikely(eq != 0)) {
22642 if (unlikely(eq < 0)) return NULL;
22643 return kwvalues[i];
22644 }
22645 }
22646 return NULL;
22647}
22648#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
22649CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
22650 Py_ssize_t i, nkwargs;
22651 PyObject *dict;
22652#if !CYTHON_ASSUME_SAFE_SIZE
22653 nkwargs = PyTuple_Size(kwnames);
22654 if (unlikely(nkwargs < 0)) return NULL;
22655#else
22656 nkwargs = PyTuple_GET_SIZE(kwnames);
22657#endif
22658 dict = PyDict_New();
22659 if (unlikely(!dict))
22660 return NULL;
22661 for (i=0; i<nkwargs; i++) {
22662#if !CYTHON_ASSUME_SAFE_MACROS
22663 PyObject *key = PyTuple_GetItem(kwnames, i);
22664 if (!key) goto bad;
22665#else
22666 PyObject *key = PyTuple_GET_ITEM(kwnames, i);
22667#endif
22668 if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
22669 goto bad;
22670 }
22671 return dict;
22672bad:
22673 Py_DECREF(dict);
22674 return NULL;
22675}
22676#endif
22677#endif
22678
22679/* PyObjectCallOneArg (used by CallUnboundCMethod0) */
22680static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
22681 PyObject *args[2] = {NULL, arg};
22682 return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
22683}
22684
22685/* UnpackUnboundCMethod_impl (used by UnpackUnboundCMethod) */
22686#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
22687static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
22688 PyObject *result;
22689 PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
22690 if (unlikely(!selfless_args)) return NULL;
22691 result = PyObject_Call(method, selfless_args, kwargs);
22692 Py_DECREF(selfless_args);
22693 return result;
22694}
22695#else
22696static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) {
22697 return PyObject_Vectorcall(method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames);
22698}
22699#endif
22700static PyMethodDef __Pyx_UnboundCMethod_Def = {
22701 "CythonUnboundCMethod",
22702 __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
22703#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
22704 METH_VARARGS | METH_KEYWORDS,
22705#else
22706 METH_FASTCALL | METH_KEYWORDS,
22707#endif
22708 NULL
22709};
22710static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
22711 PyObject *method, *result=NULL;
22712 method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
22713 if (unlikely(!method))
22714 return -1;
22715 result = method;
22716#if CYTHON_COMPILING_IN_CPYTHON
22717 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
22718 {
22719 PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
22720 target->func = descr->d_method->ml_meth;
22721 target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
22722 } else
22723#endif
22724#if CYTHON_COMPILING_IN_PYPY
22725#else
22726 if (PyCFunction_Check(method))
22727#endif
22728 {
22729 PyObject *self;
22730 int self_found;
22731#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
22732 self = PyObject_GetAttrString(method, "__self__");
22733 if (!self && !__Pyx_IgnoreException(PyExc_AttributeError)) {
22734 return -1;
22735 }
22736#else
22737 self = PyCFunction_GET_SELF(method);
22738#endif
22739 self_found = (self && self != Py_None);
22740#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
22741 Py_XDECREF(self);
22742#endif
22743 if (self_found) {
22744 PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
22745 if (unlikely(!unbound_method)) return -1;
22746 Py_DECREF(method);
22747 result = unbound_method;
22748 }
22749 }
22750#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
22751 if (unlikely(target->method)) {
22752 Py_DECREF(result);
22753 } else
22754#endif
22755 target->method = result;
22756 return 0;
22757}
22758
22759/* CallUnboundCMethod0 */
22760#if CYTHON_COMPILING_IN_CPYTHON
22761static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
22762 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
22763 if (likely(was_initialized == 2 && cfunc->func)) {
22764 if (likely(cfunc->flag == METH_NOARGS))
22765 return __Pyx_CallCFunction(cfunc, self, NULL);
22766 if (likely(cfunc->flag == METH_FASTCALL))
22767 return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
22768 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
22769 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
22770 if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
22771 return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
22772 if (cfunc->flag == METH_VARARGS)
22773 return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
22774 return __Pyx__CallUnboundCMethod0(cfunc, self);
22775 }
22776#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
22777 else if (unlikely(was_initialized == 1)) {
22778 __Pyx_CachedCFunction tmp_cfunc = {
22779#ifndef __cplusplus
22780 0
22781#endif
22782 };
22783 tmp_cfunc.type = cfunc->type;
22784 tmp_cfunc.method_name = cfunc->method_name;
22785 return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
22786 }
22787#endif
22788 PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
22789 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
22790 return result;
22791}
22792#endif
22793static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
22794 PyObject *result;
22795 if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
22796 result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
22797 return result;
22798}
22799
22800/* py_dict_items (used by OwnedDictNext) */
22801static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
22802 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
22803}
22804
22805/* py_dict_values (used by OwnedDictNext) */
22806static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
22807 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
22808}
22809
22810/* OwnedDictNext (used by ParseKeywordsImpl) */
22811#if CYTHON_AVOID_BORROWED_REFS
22812static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
22813 PyObject *next = NULL;
22814 if (!*ppos) {
22815 if (pvalue) {
22816 PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p);
22817 if (unlikely(!dictview)) goto bad;
22818 *ppos = PyObject_GetIter(dictview);
22819 Py_DECREF(dictview);
22820 } else {
22821 *ppos = PyObject_GetIter(p);
22822 }
22823 if (unlikely(!*ppos)) goto bad;
22824 }
22825 next = PyIter_Next(*ppos);
22826 if (!next) {
22827 if (PyErr_Occurred()) goto bad;
22828 return 0;
22829 }
22830 if (pkey && pvalue) {
22831 *pkey = __Pyx_PySequence_ITEM(next, 0);
22832 if (unlikely(*pkey)) goto bad;
22833 *pvalue = __Pyx_PySequence_ITEM(next, 1);
22834 if (unlikely(*pvalue)) goto bad;
22835 Py_DECREF(next);
22836 } else if (pkey) {
22837 *pkey = next;
22838 } else {
22839 assert(pvalue);
22840 *pvalue = next;
22841 }
22842 return 1;
22843 bad:
22844 Py_XDECREF(next);
22845#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
22846 PyErr_FormatUnraisable("Exception ignored in __Pyx_PyDict_NextRef");
22847#else
22848 PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
22849#endif
22850 if (pkey) *pkey = NULL;
22851 if (pvalue) *pvalue = NULL;
22852 return 0;
22853}
22854#else // !CYTHON_AVOID_BORROWED_REFS
22855static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) {
22856 int result = PyDict_Next(p, ppos, pkey, pvalue);
22857 if (likely(result == 1)) {
22858 if (pkey) Py_INCREF(*pkey);
22859 if (pvalue) Py_INCREF(*pvalue);
22860 }
22861 return result;
22862}
22863#endif
22864
22865/* RaiseDoubleKeywords (used by ParseKeywordsImpl) */
22866static void __Pyx_RaiseDoubleKeywordsError(
22867 const char* func_name,
22868 PyObject* kw_name)
22869{
22870 PyErr_Format(PyExc_TypeError,
22871 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
22872}
22873
22874/* CallUnboundCMethod2 */
22875#if CYTHON_COMPILING_IN_CPYTHON
22876static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
22877 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
22878 if (likely(was_initialized == 2 && cfunc->func)) {
22879 PyObject *args[2] = {arg1, arg2};
22880 if (cfunc->flag == METH_FASTCALL) {
22881 return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
22882 }
22883 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
22884 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
22885 }
22886#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
22887 else if (unlikely(was_initialized == 1)) {
22888 __Pyx_CachedCFunction tmp_cfunc = {
22889#ifndef __cplusplus
22890 0
22891#endif
22892 };
22893 tmp_cfunc.type = cfunc->type;
22894 tmp_cfunc.method_name = cfunc->method_name;
22895 return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
22896 }
22897#endif
22898 PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
22899 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
22900 return result;
22901}
22902#endif
22903static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
22904 if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
22905#if CYTHON_COMPILING_IN_CPYTHON
22906 if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
22907 PyObject *result = NULL;
22908 PyObject *args = PyTuple_New(2);
22909 if (unlikely(!args)) return NULL;
22910 Py_INCREF(arg1);
22911 PyTuple_SET_ITEM(args, 0, arg1);
22912 Py_INCREF(arg2);
22913 PyTuple_SET_ITEM(args, 1, arg2);
22914 if (cfunc->flag & METH_KEYWORDS)
22915 result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
22916 else
22917 result = __Pyx_CallCFunction(cfunc, self, args);
22918 Py_DECREF(args);
22919 return result;
22920 }
22921#endif
22922 {
22923 PyObject *args[4] = {NULL, self, arg1, arg2};
22924 return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
22925 }
22926}
22927
22928/* ParseKeywordsImpl (used by ParseKeywords) */
22929static int __Pyx_ValidateDuplicatePosArgs(
22930 PyObject *kwds,
22931 PyObject ** const argnames[],
22932 PyObject ** const *first_kw_arg,
22933 const char* function_name)
22934{
22935 PyObject ** const *name = argnames;
22936 while (name != first_kw_arg) {
22937 PyObject *key = **name;
22938 int found = PyDict_Contains(kwds, key);
22939 if (unlikely(found)) {
22940 if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
22941 goto bad;
22942 }
22943 name++;
22944 }
22945 return 0;
22946bad:
22947 return -1;
22948}
22949#if CYTHON_USE_UNICODE_INTERNALS
22950static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
22951 int kind;
22952 Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
22953 if (len != PyUnicode_GET_LENGTH(s2)) return 0;
22954 kind = PyUnicode_KIND(s1);
22955 if (kind != PyUnicode_KIND(s2)) return 0;
22956 const void *data1 = PyUnicode_DATA(s1);
22957 const void *data2 = PyUnicode_DATA(s2);
22958 return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0);
22959}
22960#endif
22961static int __Pyx_MatchKeywordArg_str(
22962 PyObject *key,
22963 PyObject ** const argnames[],
22964 PyObject ** const *first_kw_arg,
22965 size_t *index_found,
22966 const char *function_name)
22967{
22968 PyObject ** const *name;
22969 #if CYTHON_USE_UNICODE_INTERNALS
22970 Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
22971 if (unlikely(key_hash == -1)) {
22972 key_hash = PyObject_Hash(key);
22973 if (unlikely(key_hash == -1))
22974 goto bad;
22975 }
22976 #endif
22977 name = first_kw_arg;
22978 while (*name) {
22979 PyObject *name_str = **name;
22980 #if CYTHON_USE_UNICODE_INTERNALS
22981 if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
22982 *index_found = (size_t) (name - argnames);
22983 return 1;
22984 }
22985 #else
22986 #if CYTHON_ASSUME_SAFE_SIZE
22987 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
22988 #endif
22989 {
22990 int cmp = PyUnicode_Compare(name_str, key);
22991 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
22992 if (cmp == 0) {
22993 *index_found = (size_t) (name - argnames);
22994 return 1;
22995 }
22996 }
22997 #endif
22998 name++;
22999 }
23000 name = argnames;
23001 while (name != first_kw_arg) {
23002 PyObject *name_str = **name;
23003 #if CYTHON_USE_UNICODE_INTERNALS
23004 if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
23005 if (__Pyx_UnicodeKeywordsEqual(name_str, key))
23006 goto arg_passed_twice;
23007 }
23008 #else
23009 #if CYTHON_ASSUME_SAFE_SIZE
23010 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
23011 #endif
23012 {
23013 if (unlikely(name_str == key)) goto arg_passed_twice;
23014 int cmp = PyUnicode_Compare(name_str, key);
23015 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23016 if (cmp == 0) goto arg_passed_twice;
23017 }
23018 #endif
23019 name++;
23020 }
23021 return 0;
23022arg_passed_twice:
23023 __Pyx_RaiseDoubleKeywordsError(function_name, key);
23024 goto bad;
23025bad:
23026 return -1;
23027}
23028static int __Pyx_MatchKeywordArg_nostr(
23029 PyObject *key,
23030 PyObject ** const argnames[],
23031 PyObject ** const *first_kw_arg,
23032 size_t *index_found,
23033 const char *function_name)
23034{
23035 PyObject ** const *name;
23036 if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type;
23037 name = first_kw_arg;
23038 while (*name) {
23039 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
23040 if (cmp == 1) {
23041 *index_found = (size_t) (name - argnames);
23042 return 1;
23043 }
23044 if (unlikely(cmp == -1)) goto bad;
23045 name++;
23046 }
23047 name = argnames;
23048 while (name != first_kw_arg) {
23049 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
23050 if (unlikely(cmp != 0)) {
23051 if (cmp == 1) goto arg_passed_twice;
23052 else goto bad;
23053 }
23054 name++;
23055 }
23056 return 0;
23057arg_passed_twice:
23058 __Pyx_RaiseDoubleKeywordsError(function_name, key);
23059 goto bad;
23060invalid_keyword_type:
23061 PyErr_Format(PyExc_TypeError,
23062 "%.200s() keywords must be strings", function_name);
23063 goto bad;
23064bad:
23065 return -1;
23066}
23067static CYTHON_INLINE int __Pyx_MatchKeywordArg(
23068 PyObject *key,
23069 PyObject ** const argnames[],
23070 PyObject ** const *first_kw_arg,
23071 size_t *index_found,
23072 const char *function_name)
23073{
23074 return likely(PyUnicode_CheckExact(key)) ?
23075 __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
23076 __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
23077}
23078static void __Pyx_RejectUnknownKeyword(
23079 PyObject *kwds,
23080 PyObject ** const argnames[],
23081 PyObject ** const *first_kw_arg,
23082 const char *function_name)
23083{
23084 #if CYTHON_AVOID_BORROWED_REFS
23085 PyObject *pos = NULL;
23086 #else
23087 Py_ssize_t pos = 0;
23088 #endif
23089 PyObject *key = NULL;
23090 __Pyx_BEGIN_CRITICAL_SECTION(kwds);
23091 #if CYTHON_AVOID_BORROWED_REFS
23092 while (__Pyx_PyDict_NextRef(kwds, &pos, &key, NULL))
23093 #else
23094 (void) __Pyx_PyDict_NextRef;
23095 while (PyDict_Next(kwds, &pos, &key, NULL))
23096 #endif
23097 {
23098 PyObject** const *name = first_kw_arg;
23099 while (*name && (**name != key)) name++;
23100 if (!*name) {
23101 size_t index_found = 0;
23102 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
23103 if (cmp != 1) {
23104 if (cmp == 0) {
23105 PyErr_Format(PyExc_TypeError,
23106 "%s() got an unexpected keyword argument '%U'",
23107 function_name, key);
23108 }
23109 #if CYTHON_AVOID_BORROWED_REFS
23110 Py_DECREF(key);
23111 #endif
23112 break;
23113 }
23114 }
23115 #if CYTHON_AVOID_BORROWED_REFS
23116 Py_DECREF(key);
23117 #endif
23118 }
23119 __Pyx_END_CRITICAL_SECTION();
23120 #if CYTHON_AVOID_BORROWED_REFS
23121 Py_XDECREF(pos);
23122 #endif
23123 assert(PyErr_Occurred());
23124}
23125static int __Pyx_ParseKeywordDict(
23126 PyObject *kwds,
23127 PyObject ** const argnames[],
23128 PyObject *values[],
23129 Py_ssize_t num_pos_args,
23130 Py_ssize_t num_kwargs,
23131 const char* function_name,
23132 int ignore_unknown_kwargs)
23133{
23134 PyObject** const *name;
23135 PyObject** const *first_kw_arg = argnames + num_pos_args;
23136 Py_ssize_t extracted = 0;
23137#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
23138 if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
23139#endif
23140 name = first_kw_arg;
23141 while (*name && num_kwargs > extracted) {
23142 PyObject * key = **name;
23143 PyObject *value;
23144 int found = 0;
23145 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
23146 found = PyDict_GetItemRef(kwds, key, &value);
23147 #else
23148 value = PyDict_GetItemWithError(kwds, key);
23149 if (value) {
23150 Py_INCREF(value);
23151 found = 1;
23152 } else {
23153 if (unlikely(PyErr_Occurred())) goto bad;
23154 }
23155 #endif
23156 if (found) {
23157 if (unlikely(found < 0)) goto bad;
23158 values[name-argnames] = value;
23159 extracted++;
23160 }
23161 name++;
23162 }
23163 if (num_kwargs > extracted) {
23164 if (ignore_unknown_kwargs) {
23165 if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
23166 goto bad;
23167 } else {
23168 __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
23169 goto bad;
23170 }
23171 }
23172 return 0;
23173bad:
23174 return -1;
23175}
23176static int __Pyx_ParseKeywordDictToDict(
23177 PyObject *kwds,
23178 PyObject ** const argnames[],
23179 PyObject *kwds2,
23180 PyObject *values[],
23181 Py_ssize_t num_pos_args,
23182 const char* function_name)
23183{
23184 PyObject** const *name;
23185 PyObject** const *first_kw_arg = argnames + num_pos_args;
23186 Py_ssize_t len;
23187#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
23188 if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
23189#endif
23190 if (PyDict_Update(kwds2, kwds) < 0) goto bad;
23191 name = first_kw_arg;
23192 while (*name) {
23193 PyObject *key = **name;
23194 PyObject *value;
23195#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
23196 int found = PyDict_Pop(kwds2, key, &value);
23197 if (found) {
23198 if (unlikely(found < 0)) goto bad;
23199 values[name-argnames] = value;
23200 }
23201#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
23202 int found = PyDict_GetItemRef(kwds2, key, &value);
23203 if (found) {
23204 if (unlikely(found < 0)) goto bad;
23205 values[name-argnames] = value;
23206 if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad;
23207 }
23208#else
23209 #if CYTHON_COMPILING_IN_CPYTHON
23210 value = _PyDict_Pop(kwds2, key, kwds2);
23211 #else
23212 value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
23213 #endif
23214 if (value == kwds2) {
23215 Py_DECREF(value);
23216 } else {
23217 if (unlikely(!value)) goto bad;
23218 values[name-argnames] = value;
23219 }
23220#endif
23221 name++;
23222 }
23223 len = PyDict_Size(kwds2);
23224 if (len > 0) {
23225 return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
23226 } else if (unlikely(len == -1)) {
23227 goto bad;
23228 }
23229 return 0;
23230bad:
23231 return -1;
23232}
23233static int __Pyx_ParseKeywordsTuple(
23234 PyObject *kwds,
23235 PyObject * const *kwvalues,
23236 PyObject ** const argnames[],
23237 PyObject *kwds2,
23238 PyObject *values[],
23239 Py_ssize_t num_pos_args,
23240 Py_ssize_t num_kwargs,
23241 const char* function_name,
23242 int ignore_unknown_kwargs)
23243{
23244 PyObject *key = NULL;
23245 PyObject** const * name;
23246 PyObject** const *first_kw_arg = argnames + num_pos_args;
23247 for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
23248#if CYTHON_AVOID_BORROWED_REFS
23249 key = __Pyx_PySequence_ITEM(kwds, pos);
23250#else
23251 key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
23252#endif
23253#if !CYTHON_ASSUME_SAFE_MACROS
23254 if (unlikely(!key)) goto bad;
23255#endif
23256 name = first_kw_arg;
23257 while (*name && (**name != key)) name++;
23258 if (*name) {
23259 PyObject *value = kwvalues[pos];
23260 values[name-argnames] = __Pyx_NewRef(value);
23261 } else {
23262 size_t index_found = 0;
23263 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
23264 if (cmp == 1) {
23265 PyObject *value = kwvalues[pos];
23266 values[index_found] = __Pyx_NewRef(value);
23267 } else {
23268 if (unlikely(cmp == -1)) goto bad;
23269 if (kwds2) {
23270 PyObject *value = kwvalues[pos];
23271 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
23272 } else if (!ignore_unknown_kwargs) {
23273 goto invalid_keyword;
23274 }
23275 }
23276 }
23277 #if CYTHON_AVOID_BORROWED_REFS
23278 Py_DECREF(key);
23279 key = NULL;
23280 #endif
23281 }
23282 return 0;
23283invalid_keyword:
23284 PyErr_Format(PyExc_TypeError,
23285 "%s() got an unexpected keyword argument '%U'",
23286 function_name, key);
23287 goto bad;
23288bad:
23289 #if CYTHON_AVOID_BORROWED_REFS
23290 Py_XDECREF(key);
23291 #endif
23292 return -1;
23293}
23294
23295/* ParseKeywords */
23296static int __Pyx_ParseKeywords(
23297 PyObject *kwds,
23298 PyObject * const *kwvalues,
23299 PyObject ** const argnames[],
23300 PyObject *kwds2,
23301 PyObject *values[],
23302 Py_ssize_t num_pos_args,
23303 Py_ssize_t num_kwargs,
23304 const char* function_name,
23305 int ignore_unknown_kwargs)
23306{
23307 if (CYTHON_VECTORCALL && likely(PyTuple_Check(kwds)))
23308 return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
23309 else if (kwds2)
23310 return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
23311 else
23312 return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
23313}
23314
23315/* RaiseArgTupleInvalid */
23316static void __Pyx_RaiseArgtupleInvalid(
23317 const char* func_name,
23318 int exact,
23319 Py_ssize_t num_min,
23320 Py_ssize_t num_max,
23321 Py_ssize_t num_found)
23322{
23323 Py_ssize_t num_expected;
23324 const char *more_or_less;
23325 if (num_found < num_min) {
23326 num_expected = num_min;
23327 more_or_less = "at least";
23328 } else {
23329 num_expected = num_max;
23330 more_or_less = "at most";
23331 }
23332 if (exact) {
23333 more_or_less = "exactly";
23334 }
23335 PyErr_Format(PyExc_TypeError,
23336 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
23337 func_name, more_or_less, num_expected,
23338 (num_expected == 1) ? "" : "s", num_found);
23339}
23340
23341/* PyObjectSetAttrStr */
23342#if CYTHON_USE_TYPE_SLOTS
23343static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
23344 PyTypeObject* tp = Py_TYPE(obj);
23345 if (likely(tp->tp_setattro))
23346 return tp->tp_setattro(obj, attr_name, value);
23347 return PyObject_SetAttr(obj, attr_name, value);
23348}
23349#endif
23350
23351/* RaiseTooManyValuesToUnpack */
23352static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
23353 PyErr_Format(PyExc_ValueError,
23354 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
23355}
23356
23357/* RaiseNeedMoreValuesToUnpack */
23358static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
23359 PyErr_Format(PyExc_ValueError,
23360 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
23361 index, (index == 1) ? "" : "s");
23362}
23363
23364/* IterFinish */
23365static CYTHON_INLINE int __Pyx_IterFinish(void) {
23366 PyObject* exc_type;
23367 __Pyx_PyThreadState_declare
23368 __Pyx_PyThreadState_assign
23369 exc_type = __Pyx_PyErr_CurrentExceptionType();
23370 if (unlikely(exc_type)) {
23371 if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
23372 return -1;
23373 __Pyx_PyErr_Clear();
23374 return 0;
23375 }
23376 return 0;
23377}
23378
23379/* UnpackItemEndCheck */
23380static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
23381 if (unlikely(retval)) {
23382 Py_DECREF(retval);
23383 __Pyx_RaiseTooManyValuesError(expected);
23384 return -1;
23385 }
23386 return __Pyx_IterFinish();
23387}
23388
23389/* PyFloatBinop */
23390#if !CYTHON_COMPILING_IN_PYPY
23391static int __Pyx_PyFloat_BoolEqObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) {
23392 const double b = floatval;
23393 double a;
23394 CYTHON_UNUSED_VAR(inplace);
23395 CYTHON_UNUSED_VAR(zerodivision_check);
23396 if (op1 == op2) {
23397 return 1;
23398 }
23399 if (likely(PyFloat_CheckExact(op1))) {
23400 a = __Pyx_PyFloat_AS_DOUBLE(op1);
23401
23402 } else
23403 if (likely(PyLong_CheckExact(op1))) {
23404 #if CYTHON_USE_PYLONG_INTERNALS
23405 if (__Pyx_PyLong_IsZero(op1)) {
23406 a = 0.0;
23407
23408 goto digits_done;
23409 } else if (__Pyx_PyLong_IsCompact(op1)) {
23410 a = (double) __Pyx_PyLong_CompactValue(op1);
23411 goto digits_done;
23412 } else {
23413 const digit* digits = __Pyx_PyLong_Digits(op1);
23414 const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
23415 if (size <= 2 && (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53)))) {
23416 a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23417 if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
23418 if (__Pyx_PyLong_IsNeg(op1)) a = -a;
23419 goto digits_done;
23420 }
23421 }
23422 if (size <= 3 && (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53)))) {
23423 a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23424 if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
23425 if (__Pyx_PyLong_IsNeg(op1)) a = -a;
23426 goto digits_done;
23427 }
23428 }
23429 if (size <= 4 && (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53)))) {
23430 a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23431 if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
23432 if (__Pyx_PyLong_IsNeg(op1)) a = -a;
23433 goto digits_done;
23434 }
23435 }
23436 }
23437 #endif
23438 {
23439 PyObject *res =
23440 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
23441 __Pyx_PyType_GetSlot((&PyFloat_Type), tp_richcompare, richcmpfunc)
23442 #else
23443 PyObject_RichCompare
23444 #endif
23445 (op2, op1,
23446 Py_EQ);
23447 return __Pyx_PyObject_IsTrueAndDecref(res);
23448 }
23449 } else {
23450 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
23451 }
23452#if CYTHON_USE_PYLONG_INTERNALS
23453digits_done:;
23454#endif
23455 if (a == b) {
23456 return 1;
23457 } else {
23458 return 0;
23459 }
23460}
23461#endif
23462
23463/* RaiseUnboundLocalError */
23464static void __Pyx_RaiseUnboundLocalError(const char *varname) {
23465 PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
23466}
23467
23468/* PyLongBinop */
23469#if !CYTHON_COMPILING_IN_PYPY
23470static PyObject* __Pyx_Fallback___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, int inplace) {
23471 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
23472}
23473#if CYTHON_USE_PYLONG_INTERNALS
23474static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
23475 CYTHON_MAYBE_UNUSED_VAR(inplace);
23476 CYTHON_UNUSED_VAR(zerodivision_check);
23477 const long b = intval;
23478 long a;
23479 const PY_LONG_LONG llb = intval;
23480 PY_LONG_LONG lla;
23481 if (unlikely(__Pyx_PyLong_IsZero(op1))) {
23482 return __Pyx_NewRef(op2);
23483 }
23484 const int is_positive = __Pyx_PyLong_IsPos(op1);
23485 const digit* digits = __Pyx_PyLong_Digits(op1);
23486 const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
23487 if (likely(size == 1)) {
23488 a = (long) digits[0];
23489 if (!is_positive) a *= -1;
23490 } else {
23491 if (size == 2 && 8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
23492 a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23493 if (!is_positive) a *= -1;
23494 goto calculate_long;
23495 } else if (size == 2 && 8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
23496 lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
23497 if (!is_positive) lla *= -1;
23498 goto calculate_long_long;
23499 } else
23500 if (size == 3 && 8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
23501 a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23502 if (!is_positive) a *= -1;
23503 goto calculate_long;
23504 } else if (size == 3 && 8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
23505 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]));
23506 if (!is_positive) lla *= -1;
23507 goto calculate_long_long;
23508 } else
23509 if (size == 4 && 8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
23510 a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
23511 if (!is_positive) a *= -1;
23512 goto calculate_long;
23513 } else if (size == 4 && 8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
23514 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]));
23515 if (!is_positive) lla *= -1;
23516 goto calculate_long_long;
23517 } else
23518 {}
23519 return PyLong_Type.tp_as_number->nb_add(op1, op2);
23520 }
23521 calculate_long:
23522 {
23523 long x;
23524 x = a + b;
23525 return PyLong_FromLong(x);
23526 }
23527 calculate_long_long:
23528 {
23529 PY_LONG_LONG llx;
23530 llx = lla + llb;
23531 return PyLong_FromLongLong(llx);
23532 }
23533
23534}
23535#endif
23536static PyObject* __Pyx_Float___Pyx_PyLong_AddObjC(PyObject *float_val, long intval, int zerodivision_check) {
23537 CYTHON_UNUSED_VAR(zerodivision_check);
23538 const long b = intval;
23539 double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
23540 double result;
23541
23542 result = ((double)a) + (double)b;
23543 return PyFloat_FromDouble(result);
23544}
23545static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
23546 CYTHON_MAYBE_UNUSED_VAR(intval);
23547 CYTHON_UNUSED_VAR(zerodivision_check);
23548 #if CYTHON_USE_PYLONG_INTERNALS
23549 if (likely(PyLong_CheckExact(op1))) {
23550 return __Pyx_Unpacked___Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check);
23551 }
23552 #endif
23553 if (PyFloat_CheckExact(op1)) {
23554 return __Pyx_Float___Pyx_PyLong_AddObjC(op1, intval, zerodivision_check);
23555 }
23556 return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace);
23557}
23558#endif
23559
23560/* pep479 */
23561static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) {
23562 PyObject *exc, *val, *tb, *cur_exc, *new_exc;
23563 __Pyx_PyThreadState_declare
23564 int is_async_stopiteration = 0;
23565 CYTHON_MAYBE_UNUSED_VAR(in_async_gen);
23566 __Pyx_PyThreadState_assign
23567 cur_exc = __Pyx_PyErr_CurrentExceptionType();
23568 if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) {
23569 if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopAsyncIteration))) {
23570 is_async_stopiteration = 1;
23571 } else {
23572 return;
23573 }
23574 }
23575 __Pyx_GetException(&exc, &val, &tb);
23576 Py_XDECREF(exc);
23577 Py_XDECREF(tb);
23578 new_exc = PyObject_CallFunction(PyExc_RuntimeError, "s",
23579 is_async_stopiteration ? "async generator raised StopAsyncIteration" :
23580 in_async_gen ? "async generator raised StopIteration" :
23581 "generator raised StopIteration");
23582 if (!new_exc) {
23583 Py_XDECREF(val);
23584 return;
23585 }
23586 PyException_SetCause(new_exc, val); // steals ref to val
23587 PyErr_SetObject(PyExc_RuntimeError, new_exc);
23588 Py_DECREF(new_exc);
23589}
23590
23591/* PyFrozenDict (used by GetItemInt) */
23592#if CYTHON_COMPILING_IN_LIMITED_API
23593static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it) {
23594 return PyObject_CallFunctionObjArgs(frozendict_type, it, NULL);
23595}
23596#endif
23597
23598/* GettItemInt_wraparound (used by GetItemInt) */
23599#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
23600static int __Pyx_GetItemInt_wraparound(PyObject *o, PySequenceMethods *sm, Py_ssize_t *i) {
23601 assert(*i < 0);
23602 if (likely(sm->sq_length)) {
23603 Py_ssize_t l = sm->sq_length(o);
23604 if (likely(l >= 0)) {
23605 *i += l;
23606 } else {
23607 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
23608 return -1;
23609 PyErr_Clear();
23610 }
23611 }
23612 return 0;
23613}
23614#endif
23615
23616/* GetItemInt */
23617static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
23618 PyObject *r;
23619 if (unlikely(!j)) return NULL;
23620 r = PyObject_GetItem(o, j);
23621 Py_DECREF(j);
23622 return r;
23623}
23624static PyObject *__Pyx_GetItemInt_Generic_size(PyObject *o, Py_ssize_t i) {
23625 return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
23626}
23627static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
23628 int wraparound, int boundscheck, int unsafe_shared) {
23629 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
23630#if CYTHON_AVOID_BORROWED_REFS
23631 CYTHON_UNUSED_VAR(boundscheck);
23632 Py_ssize_t wrapped_i = i;
23633 if (wraparound & unlikely(i < 0)) {
23634 Py_ssize_t size = __Pyx_PyList_GET_SIZE(o);
23635 #if !CYTHON_ASSUME_SAFE_SIZE
23636 if (unlikely(size < 0)) return NULL;
23637 #endif
23638 wrapped_i += size;
23639 }
23640 return __Pyx_PyList_GetItemRef(o, wrapped_i);
23641#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
23642 Py_ssize_t wrapped_i = i;
23643 Py_ssize_t size = (wraparound | boundscheck) ? PyList_GET_SIZE(o) : -1;
23644 if (wraparound & unlikely(i < 0)) {
23645 wrapped_i += size;
23646 }
23647 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
23648 return __Pyx_PyList_GET_ITEM_REF(o, wrapped_i, unsafe_shared);
23649 }
23650 return __Pyx_GetItemInt_Generic_size(o, i);
23651#else
23652 (void)wraparound;
23653 (void)boundscheck;
23654 return PySequence_GetItem(o, i);
23655#endif
23656}
23657static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
23658 int wraparound, int boundscheck, int unsafe_shared) {
23659 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
23660#if CYTHON_AVOID_BORROWED_REFS
23661 CYTHON_UNUSED_VAR(boundscheck);
23662 Py_ssize_t wrapped_i = i;
23663 if (wraparound & unlikely(i < 0)) {
23664 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(o);
23665 #if !CYTHON_ASSUME_SAFE_SIZE
23666 if (unlikely(size < 0)) return NULL;
23667 #endif
23668 wrapped_i += size;
23669 }
23670 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_LIMITED_API
23671 return PySequence_ITEM(o, wrapped_i);
23672 #else
23673 if (unlikely(wrapped_i < 0)) {
23674 PyErr_SetString(PyExc_IndexError, "tuple index out of range");
23675 return NULL;
23676 }
23677 return PySequence_GetItem(o, wrapped_i);
23678 #endif
23679#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
23680 Py_ssize_t wrapped_i = i;
23681 Py_ssize_t size = (wraparound | boundscheck) ? PyTuple_GET_SIZE(o) : -1;
23682 if (wraparound & unlikely(i < 0)) {
23683 wrapped_i += size;
23684 }
23685 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
23686 return __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(o, wrapped_i));
23687 }
23688 return __Pyx_GetItemInt_Generic_size(o, i);
23689#else
23690 (void)wraparound;
23691 (void)boundscheck;
23692 return PySequence_GetItem(o, i);
23693#endif
23694}
23695#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
23696static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast_mapping(PyObject *o, binaryfunc getitem, Py_ssize_t i) {
23697 PyObject *r, *key = PyLong_FromSsize_t(i);
23698 if (unlikely(!key)) return NULL;
23699 r = getitem(o, key);
23700 Py_DECREF(key);
23701 return r;
23702}
23703#endif
23704static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
23705 int wraparound, int boundscheck, int unsafe_shared) {
23706 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
23707#if CYTHON_ASSUME_SAFE_SIZE
23708 if (PyList_CheckExact(o)) {
23709 return __Pyx_GetItemInt_List_Fast(o, i, wraparound, boundscheck, unsafe_shared);
23710 } else
23711 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23712 if (PyTuple_CheckExact(o)) {
23713 return __Pyx_GetItemInt_Tuple_Fast(o, i, wraparound, boundscheck, unsafe_shared);
23714 } else
23715 #endif
23716#else
23717 if ((!wraparound || i >= 0) & PyList_CheckExact(o)) {
23718 return boundscheck ? __Pyx_PyList_GetItemRef(o, i) : __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared);
23719 } else
23720#endif
23721#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
23722 if (PyDict_CheckExact(o)) {
23723 return __Pyx_GetItemInt_Fast_mapping(o, PyDict_Type.tp_as_mapping->mp_subscript, i);
23724 #if defined(PyFrozenDict_CheckExact)
23725 } else if (PyFrozenDict_CheckExact(o)) {
23726 return __Pyx_GetItemInt_Fast_mapping(o, PyFrozenDict_Type.tp_as_mapping->mp_subscript, i);
23727 #endif
23728 } else
23729 {
23730 PyTypeObject *obj_type = Py_TYPE(o);
23731 int seq_or_mapping = __Pyx_PyType_GetFlags(obj_type) & (Py_TPFLAGS_SEQUENCE|Py_TPFLAGS_MAPPING);
23732 if (seq_or_mapping != Py_TPFLAGS_SEQUENCE) {
23733 PyMappingMethods *mm = obj_type->tp_as_mapping;
23734 if (mm && mm->mp_subscript)
23735 return __Pyx_GetItemInt_Fast_mapping(o, mm->mp_subscript, i);
23736 }
23737 PySequenceMethods *sm = obj_type->tp_as_sequence;
23738 if (likely(sm && sm->sq_item)) {
23739 if (wraparound && (i < 0) && unlikely(__Pyx_GetItemInt_wraparound(o, sm, &i) == -1))
23740 return NULL;
23741 return sm->sq_item(o, i);
23742 }
23743 if (seq_or_mapping == Py_TPFLAGS_SEQUENCE) {
23744 PyMappingMethods *mm = obj_type->tp_as_mapping;
23745 if (likely(mm && mm->mp_subscript))
23746 return __Pyx_GetItemInt_Fast_mapping(o, mm->mp_subscript, i);
23747 }
23748 }
23749#else
23750 if (!PyMapping_Check(o)) {
23751 return PySequence_GetItem(o, i);
23752 }
23753#endif
23754 (void)wraparound;
23755 (void)boundscheck;
23756 return __Pyx_GetItemInt_Generic_size(o, i);
23757}
23758
23759/* RaiseErrorWithObjectType (used by ObjectGetItem) */
23760static void __Pyx_RaiseErrorWithType(PyObject* exc_type, const char* message, PyTypeObject *type_obj) {
23761 __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(type_obj);
23762 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
23763 if (unlikely(!type_name)) return;
23764 #endif
23765 PyErr_Format(exc_type, message, type_name);
23766 __Pyx_DECREF_TypeName(type_name);
23767}
23768
23769/* ObjectGetItem */
23770#if CYTHON_USE_TYPE_SLOTS
23771static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
23772 PyObject *runerr = NULL;
23773 Py_ssize_t key_value;
23774 key_value = __Pyx_PyIndex_AsSsize_t(index);
23775 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
23776 return __Pyx_GetItemInt_Fast(obj, key_value, 1, 1, 1);
23777 }
23778 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
23779 PyErr_Clear();
23780 __Pyx_RaiseErrorWithObjectType(
23781 PyExc_IndexError,
23782 "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer",
23783 index);
23784 }
23785 return NULL;
23786}
23787static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
23788 if (likely(PyType_Check(obj))) {
23789 if ((PyTypeObject*)obj == &PyType_Type) {
23790 return Py_GenericAlias(obj, key);
23791 }
23792 PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem);
23793 if (!meth) {
23794 if (PyErr_Occurred()) {
23795 return NULL;
23796 }
23797 } else {
23798 PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
23799 Py_DECREF(meth);
23800 return result;
23801 }
23802 }
23803 __Pyx_RaiseTypeErrorWithObjectType(
23804 "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj);
23805 return NULL;
23806}
23807static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
23808 PyTypeObject *tp = Py_TYPE(obj);
23809 PyMappingMethods *mm = tp->tp_as_mapping;
23810 PySequenceMethods *sm = tp->tp_as_sequence;
23811 if (likely(mm && mm->mp_subscript)) {
23812 return mm->mp_subscript(obj, key);
23813 }
23814 if (likely(sm && sm->sq_item)) {
23815 return __Pyx_PyObject_GetIndex(obj, key);
23816 }
23817 return __Pyx_PyObject_GetItem_Slow(obj, key);
23818}
23819#endif
23820
23821/* PyObjectFastCallMethod */
23822#if !CYTHON_VECTORCALL
23823static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) {
23824 PyObject *result;
23825 switch (__Pyx_PyVectorcall_NARGS(nargsf)) {
23826 case 1:
23827 return PyObject_CallMethodObjArgs(args[0], name, NULL);
23828 case 2:
23829 return PyObject_CallMethodObjArgs(args[0], name, args[1], NULL);
23830 case 3:
23831 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], NULL);
23832 case 4:
23833 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], NULL);
23834 case 5:
23835 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], args[4], NULL);
23836 }
23837 PyObject *attr = PyObject_GetAttr(args[0], name);
23838 if (unlikely(!attr))
23839 return NULL;
23840 result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1);
23841 Py_DECREF(attr);
23842 return result;
23843}
23844#endif
23845
23846/* HasAttr (used by ImportImpl) */
23847#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
23848static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
23849 PyObject *r;
23850 if (unlikely(!PyUnicode_Check(n))) {
23851 PyErr_SetString(PyExc_TypeError,
23852 "hasattr(): attribute name must be string");
23853 return -1;
23854 }
23855 r = __Pyx_PyObject_GetAttrStrNoError(o, n);
23856 if (!r) {
23857 return (unlikely(PyErr_Occurred())) ? -1 : 0;
23858 } else {
23859 Py_DECREF(r);
23860 return 1;
23861 }
23862}
23863#endif
23864
23865/* TupleOrListFromArrayImpl (used by ListFromArray) */
23866CYTHON_UNUSED static PyObject *
23867__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) {
23868 PyObject *res = PyList_New(n);
23869 if (unlikely(res == NULL)) return NULL;
23870 #if CYTHON_COMPILING_IN_CPYTHON
23871 __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
23872 #else
23873 Py_ssize_t i;
23874 for (i = 0; i < n; i++) {
23875 Py_INCREF(src[i]);
23876 if (unlikely(__Pyx_PyList_SET_ITEM(res, i, src[i]) < (0))) {
23877 Py_DECREF(res);
23878 return NULL;
23879 }
23880 }
23881 #endif
23882 return res;
23883}
23884
23885/* ImportImpl (used by Import) */
23886static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
23887 PyObject *imported_module = PyImport_GetModule(qualname);
23888 if (unlikely(!imported_module)) {
23889 *module = NULL;
23890 if (PyErr_Occurred()) {
23891 return -1;
23892 }
23893 return 0;
23894 }
23895 *module = imported_module;
23896 return 1;
23897}
23898static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject **module) {
23899 PyObject *imported_module;
23900 PyObject *top_level_package_name;
23901 Py_ssize_t i;
23902 int status, module_found;
23903 Py_ssize_t dot_index;
23904 module_found = __Pyx__Import_GetModule(qualname, &imported_module);
23905 if (unlikely(!module_found || module_found == -1)) {
23906 *module = NULL;
23907 return module_found;
23908 }
23909 if (imported_names) {
23910 for (i = 0; i < len_imported_names; i++) {
23911 PyObject *imported_name = imported_names[i];
23912#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
23913 int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name);
23914#else
23915 int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
23916 if (unlikely(has_imported_attribute == -1)) goto error;
23917#endif
23918 if (!has_imported_attribute) {
23919 goto not_found;
23920 }
23921 }
23922 *module = imported_module;
23923 return 1;
23924 }
23925 dot_index = PyUnicode_FindChar(qualname, '.', 0, PY_SSIZE_T_MAX, 1);
23926 if (dot_index == -1) {
23927 *module = imported_module;
23928 return 1;
23929 }
23930 if (unlikely(dot_index == -2)) goto error;
23931 top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index);
23932 if (unlikely(!top_level_package_name)) goto error;
23933 Py_DECREF(imported_module);
23934 status = __Pyx__Import_GetModule(top_level_package_name, module);
23935 Py_DECREF(top_level_package_name);
23936 return status;
23937error:
23938 Py_DECREF(imported_module);
23939 *module = NULL;
23940 return -1;
23941not_found:
23942 Py_DECREF(imported_module);
23943 *module = NULL;
23944 return 0;
23945}
23946static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level) {
23947 PyObject *module = 0;
23948 PyObject *empty_dict = 0;
23949 PyObject *from_list = 0;
23950 int module_found;
23951 if (!qualname) {
23952 qualname = name;
23953 }
23954 module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
23955 if (likely(module_found == 1)) {
23956 return module;
23957 } else if (unlikely(module_found == -1)) {
23958 return NULL;
23959 }
23960 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030f00a6
23961 empty_dict = PyFrozenDict_New(NULL);
23962 #else
23963 empty_dict = PyDict_New();
23964 #endif
23965 if (unlikely(!empty_dict))
23966 goto bad;
23967 if (imported_names) {
23968 from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
23969 if (unlikely(!from_list))
23970 goto bad;
23971 }
23972 if (level == -1) {
23973 const char* package_sep = strchr(__Pyx_MODULE_NAME, '.');
23974 if (package_sep != (0)) {
23975 module = PyImport_ImportModuleLevelObject(
23976 name, moddict, empty_dict, from_list, 1);
23977 if (unlikely(!module)) {
23978 if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
23979 goto bad;
23980 PyErr_Clear();
23981 }
23982 }
23983 level = 0;
23984 }
23985 if (!module) {
23986 module = PyImport_ImportModuleLevelObject(
23987 name, moddict, empty_dict, from_list, level);
23988 }
23989bad:
23990 Py_XDECREF(from_list);
23991 Py_XDECREF(empty_dict);
23992 return module;
23993}
23994
23995/* Import */
23996static PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level) {
23997 return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level);
23998}
23999
24000/* ImportFrom */
24001static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
24002 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
24003 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
24004 const char* module_name_str = 0;
24005 PyObject* module_name = 0;
24006 PyObject* module_dot = 0;
24007 PyObject* full_name = 0;
24008 PyErr_Clear();
24009 module_name_str = PyModule_GetName(module);
24010 if (unlikely(!module_name_str)) { goto modbad; }
24011 module_name = PyUnicode_FromString(module_name_str);
24012 if (unlikely(!module_name)) { goto modbad; }
24013 module_dot = PyUnicode_Concat(module_name, __pyx_mstate_global->__pyx_kp_u__2);
24014 if (unlikely(!module_dot)) { goto modbad; }
24015 full_name = PyUnicode_Concat(module_dot, name);
24016 if (unlikely(!full_name)) { goto modbad; }
24017 #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\
24018 CYTHON_COMPILING_IN_GRAAL
24019 {
24020 PyObject *modules = PyImport_GetModuleDict();
24021 if (unlikely(!modules))
24022 goto modbad;
24023 value = PyObject_GetItem(modules, full_name);
24024 }
24025 #else
24026 value = PyImport_GetModule(full_name);
24027 #endif
24028 modbad:
24029 Py_XDECREF(full_name);
24030 Py_XDECREF(module_dot);
24031 Py_XDECREF(module_name);
24032 }
24033 if (unlikely(!value)) {
24034 PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
24035 }
24036 return value;
24037}
24038
24039/* ListAppendAndDecrefInternal (used by ListCompAppendAndDecref) */
24040#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
24041static CYTHON_INLINE void __Pyx__ListComp_AppendAndDecref(PyObject* list, Py_ssize_t len, PyObject* x) {
24042 PyList_SET_ITEM(list, len, x);
24043 Py_SET_SIZE(list, len + 1);
24044}
24045#endif
24046
24047/* ListCompAppendAndDecref */
24048#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
24049static CYTHON_INLINE int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x) {
24050 PyListObject* L = (PyListObject*) list;
24051 Py_ssize_t len = Py_SIZE(list);
24052 if (likely(L->allocated > len)) {
24053 __Pyx__ListComp_AppendAndDecref(list, len, x);
24054 return 0;
24055 }
24056 int result = PyList_Append(list, x);
24057 Py_DECREF(x);
24058 return result;
24059}
24060#else
24061static CYTHON_INLINE int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x) {
24062 int result = PyList_Append(list, x);
24063 Py_DECREF(x);
24064 return result;
24065}
24066#endif
24067
24068/* DictGetItem */
24069#if !CYTHON_COMPILING_IN_PYPY
24070static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
24071 PyObject *value;
24072 if (unlikely(__Pyx_PyDict_GetItemRef(d, key, &value) == 0)) { // no value, no error
24073 if (unlikely(PyTuple_Check(key))) {
24074 PyObject* args = PyTuple_Pack(1, key);
24075 if (likely(args)) {
24076 PyErr_SetObject(PyExc_KeyError, args);
24077 Py_DECREF(args);
24078 }
24079 } else {
24080 PyErr_SetObject(PyExc_KeyError, key);
24081 }
24082 }
24083 return value;
24084}
24085#endif
24086
24087/* SliceObject */
24088static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
24089 Py_ssize_t cstart, Py_ssize_t cstop,
24090 PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
24091 int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
24092#if CYTHON_USE_TYPE_SLOTS
24093 PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping;
24094 if (likely(mp && mp->mp_subscript))
24095#else
24096 if ((1))
24097#endif
24098 {
24099 PyObject* result;
24100 PyObject *py_slice, *py_start, *py_stop;
24101 if (_py_slice) {
24102 py_slice = *_py_slice;
24103 } else {
24104 PyObject* owned_start = NULL;
24105 PyObject* owned_stop = NULL;
24106 if (_py_start) {
24107 py_start = *_py_start;
24108 } else {
24109 if (has_cstart) {
24110 owned_start = py_start = PyLong_FromSsize_t(cstart);
24111 if (unlikely(!py_start)) goto bad;
24112 } else
24113 py_start = Py_None;
24114 }
24115 if (_py_stop) {
24116 py_stop = *_py_stop;
24117 } else {
24118 if (has_cstop) {
24119 owned_stop = py_stop = PyLong_FromSsize_t(cstop);
24120 if (unlikely(!py_stop)) {
24121 Py_XDECREF(owned_start);
24122 goto bad;
24123 }
24124 } else
24125 py_stop = Py_None;
24126 }
24127 py_slice = PySlice_New(py_start, py_stop, Py_None);
24128 Py_XDECREF(owned_start);
24129 Py_XDECREF(owned_stop);
24130 if (unlikely(!py_slice)) goto bad;
24131 }
24132#if CYTHON_USE_TYPE_SLOTS
24133 result = mp->mp_subscript(obj, py_slice);
24134#else
24135 result = PyObject_GetItem(obj, py_slice);
24136#endif
24137 if (!_py_slice) {
24138 Py_DECREF(py_slice);
24139 }
24140 return result;
24141 } else {
24142 __Pyx_RaiseTypeErrorWithObjectType(
24143 "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj);
24144 }
24145bad:
24146 return NULL;
24147}
24148
24149/* PyObjectVectorcallKwds */
24150#if CYTHON_VECTORCALL
24151CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i) {
24152 PyObject *key = __Pyx_PyTuple_GET_ITEM(kwnames, i);
24153#if !CYTHON_ASSUME_SAFE_MACROS
24154 if (unlikely(!key)) return -1;
24155#endif
24156 if (unlikely(!PyUnicode_Check(key))) {
24157 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
24158 return -1;
24159 }
24160 return 0;
24161}
24162#else
24163CYTHON_UNUSED static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t n) {
24164 PyObject *out = PyDict_New();
24165 if (unlikely(!out)) return NULL;
24166 for (Py_ssize_t i=0; i<n; ++i) {
24167 if (unlikely(PyDict_SetItem(out, keys[i], values[i]) < 0)) {
24168 Py_DECREF(out);
24169 return NULL;
24170 }
24171 }
24172 return out;
24173}
24174CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i) {
24175 PyObject *key = kwnames[i];
24176 if (unlikely(!PyUnicode_Check(key))) {
24177 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
24178 return -1;
24179 }
24180 return 0;
24181}
24182#endif
24183
24184/* PyLongCompare */
24185static CYTHON_INLINE int __Pyx_PyLong_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
24186 CYTHON_MAYBE_UNUSED_VAR(intval);
24187 CYTHON_UNUSED_VAR(inplace);
24188 if (op1 == op2) {
24189 return 1;
24190 }
24191 #if CYTHON_USE_PYLONG_INTERNALS
24192 if (likely(PyLong_CheckExact(op1))) {
24193 int unequal;
24194 unsigned long uintval;
24195 Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
24196 const digit* digits = __Pyx_PyLong_Digits(op1);
24197 if (intval == 0) {
24198 return (__Pyx_PyLong_IsZero(op1) == 1);
24199 } else if (intval < 0) {
24200 if (__Pyx_PyLong_IsNonNeg(op1))
24201 return 0;
24202 intval = -intval;
24203 } else {
24204 if (__Pyx_PyLong_IsNeg(op1))
24205 return 0;
24206 }
24207 uintval = (unsigned long) intval;
24208#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
24209 if (uintval >> (PyLong_SHIFT * 4)) {
24210 unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
24211 | (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));
24212 } else
24213#endif
24214#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
24215 if (uintval >> (PyLong_SHIFT * 3)) {
24216 unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
24217 | (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));
24218 } else
24219#endif
24220#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
24221 if (uintval >> (PyLong_SHIFT * 2)) {
24222 unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
24223 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
24224 } else
24225#endif
24226#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
24227 if (uintval >> (PyLong_SHIFT * 1)) {
24228 unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
24229 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
24230 } else
24231#endif
24232 unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
24233 return (unequal == 0);
24234 }
24235 #endif
24236 if (PyFloat_CheckExact(op1)) {
24237 const long b = intval;
24238 double a = __Pyx_PyFloat_AS_DOUBLE(op1);
24239 return ((double)a == (double)b);
24240 }
24241 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
24242}
24243
24244/* PyFloatBinop */
24245#if !CYTHON_COMPILING_IN_PYPY
24246static int __Pyx_PyFloat_BoolNeObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) {
24247 const double b = floatval;
24248 double a;
24249 CYTHON_UNUSED_VAR(inplace);
24250 CYTHON_UNUSED_VAR(zerodivision_check);
24251 if (op1 == op2) {
24252 return 0;
24253 }
24254 if (likely(PyFloat_CheckExact(op1))) {
24255 a = __Pyx_PyFloat_AS_DOUBLE(op1);
24256
24257 } else
24258 if (likely(PyLong_CheckExact(op1))) {
24259 #if CYTHON_USE_PYLONG_INTERNALS
24260 if (__Pyx_PyLong_IsZero(op1)) {
24261 a = 0.0;
24262
24263 goto digits_done;
24264 } else if (__Pyx_PyLong_IsCompact(op1)) {
24265 a = (double) __Pyx_PyLong_CompactValue(op1);
24266 goto digits_done;
24267 } else {
24268 const digit* digits = __Pyx_PyLong_Digits(op1);
24269 const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
24270 if (size <= 2 && (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53)))) {
24271 a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24272 if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
24273 if (__Pyx_PyLong_IsNeg(op1)) a = -a;
24274 goto digits_done;
24275 }
24276 }
24277 if (size <= 3 && (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53)))) {
24278 a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24279 if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
24280 if (__Pyx_PyLong_IsNeg(op1)) a = -a;
24281 goto digits_done;
24282 }
24283 }
24284 if (size <= 4 && (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53)))) {
24285 a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
24286 if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
24287 if (__Pyx_PyLong_IsNeg(op1)) a = -a;
24288 goto digits_done;
24289 }
24290 }
24291 }
24292 #endif
24293 {
24294 PyObject *res =
24295 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
24296 __Pyx_PyType_GetSlot((&PyFloat_Type), tp_richcompare, richcmpfunc)
24297 #else
24298 PyObject_RichCompare
24299 #endif
24300 (op2, op1,
24301 Py_NE);
24302 return __Pyx_PyObject_IsTrueAndDecref(res);
24303 }
24304 } else {
24305 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_NE);
24306 }
24307#if CYTHON_USE_PYLONG_INTERNALS
24308digits_done:;
24309#endif
24310 if (a != b) {
24311 return 1;
24312 } else {
24313 return 0;
24314 }
24315}
24316#endif
24317
24318/* PyObjectCompare */
24319#ifndef __Pyx_DEFINED_PyObject_CompareIntFloatBoolGt
24320#define __Pyx_DEFINED_PyObject_CompareIntFloatBoolGt
24321static int __Pyx_PyObject_CompareIntFloatBoolGt(PyObject *op1, PyObject *op2) {
24322 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
24323 #if !CYTHON_ASSUME_SAFE_MACROS
24324 if (unlikely(float_op2 == -1. && PyErr_Occurred())) return -1;
24325 #endif
24326 #if CYTHON_USE_PYLONG_INTERNALS
24327 if (__Pyx_PyLong_IsCompact(op1)) {
24328 Py_ssize_t iop1 = __Pyx_PyLong_CompactValue(op1);
24329 if (((double)iop1) > float_op2) goto __pyx_return_true; else goto __pyx_return_false;
24330 }
24331 if (unlikely(!isfinite(float_op2))) {
24332 if (0.0 > float_op2) goto __pyx_return_true; else goto __pyx_return_false;
24333 } else {
24334 int sign1 = __Pyx_PyLong_Sign(op1);
24335 if (float_op2 >= 0.) {
24336 if (sign1 < 0) goto __pyx_return_false;
24337 if (float_op2 < (double) (1L << PyLong_SHIFT)) goto __pyx_return_true;
24338 } else {
24339 if (sign1 > 0) goto __pyx_return_true;
24340 if (float_op2 > -(double) (1L << PyLong_SHIFT)) goto __pyx_return_false;
24341 }
24342 }
24343 #else
24344 if (unlikely(!isfinite(float_op2))) {
24345 if (0.0 > float_op2) goto __pyx_return_true; else goto __pyx_return_false;
24346 } else {
24347 int overflow1;
24348 long iop1 = PyLong_AsLongAndOverflow(op1, &overflow1);
24349 if (likely(!overflow1)) {
24350 if ((long long) iop1 >= (1LL << 53)) {
24351 overflow1 = 1;
24352 } else if ((long long) iop1 <= - (1LL << 53)) {
24353 overflow1 = -1;
24354 } else {
24355 if (((double) iop1) > float_op2) goto __pyx_return_true; else goto __pyx_return_false;
24356 }
24357 }
24358 if (overflow1 < 0) {
24359 if (float_op2 > ((double) (1LL << 53))) goto __pyx_return_false;
24360 } else {
24361 if (float_op2 < - ((double) (1LL << 53))) goto __pyx_return_true;
24362 }
24363 }
24364 #endif
24365 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_GT);
24366__pyx_return_true:
24367 return 1;
24368__pyx_return_false:
24369 return 0;
24370}
24371#endif
24372static CYTHON_INLINE int __Pyx_PyObject_CompareBoolGt_object_float(PyObject *op1, PyObject *op2, int pyop) {
24373 CYTHON_UNUSED_VAR(pyop);
24374 if (unlikely(op2 == Py_None)) {
24375 goto __pyx_richcmp;
24376 }
24377 if (likely(PyFloat_CheckExact(op1))) {
24378 if (likely(op2 != Py_None)) {
24379 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
24380 #if !CYTHON_ASSUME_SAFE_MACROS
24381 if (unlikely(float_op1 == -1. && PyErr_Occurred())) return -1;
24382 #endif
24383 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
24384 #if !CYTHON_ASSUME_SAFE_MACROS
24385 if (unlikely(float_op2 == -1. && PyErr_Occurred())) return -1;
24386 #endif
24387 if (float_op1 > float_op2) goto __pyx_return_true; else goto __pyx_return_false;
24388 }
24389 goto __pyx_richcmp;
24390 }
24391 if (PyLong_CheckExact(op1)) {
24392 if (op1 == op2) goto __pyx_return_false;
24393 if (likely(op2 != Py_None)) {
24394 return __Pyx_PyObject_CompareIntFloatBoolGt(op1, op2);
24395 }
24396 goto __pyx_richcmp;
24397 }
24398 if ((0)) goto __pyx_richcmp;
24399 if ((0)) goto __pyx_return_true;
24400 if ((0)) goto __pyx_return_false;
24401__pyx_richcmp:
24402 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_GT);
24403__pyx_return_true:
24404 return 1;
24405__pyx_return_false:
24406 return 0;
24407}
24408
24409/* ListAppend */
24410#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
24411static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
24412 PyListObject* L = (PyListObject*) list;
24413 Py_ssize_t len = Py_SIZE(list);
24414 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
24415 Py_INCREF(x);
24416 __Pyx__ListComp_AppendAndDecref(list, len, x);
24417 return 0;
24418 }
24419 return PyList_Append(list, x);
24420}
24421#endif
24422
24423/* PyObjectCompare */
24424#ifndef __Pyx_DEFINED_PyObject_CompareIntFloatBoolLt
24425#define __Pyx_DEFINED_PyObject_CompareIntFloatBoolLt
24426static int __Pyx_PyObject_CompareIntFloatBoolLt(PyObject *op1, PyObject *op2) {
24427 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
24428 #if !CYTHON_ASSUME_SAFE_MACROS
24429 if (unlikely(float_op2 == -1. && PyErr_Occurred())) return -1;
24430 #endif
24431 #if CYTHON_USE_PYLONG_INTERNALS
24432 if (__Pyx_PyLong_IsCompact(op1)) {
24433 Py_ssize_t iop1 = __Pyx_PyLong_CompactValue(op1);
24434 if (((double)iop1) < float_op2) goto __pyx_return_true; else goto __pyx_return_false;
24435 }
24436 if (unlikely(!isfinite(float_op2))) {
24437 if (0.0 < float_op2) goto __pyx_return_true; else goto __pyx_return_false;
24438 } else {
24439 int sign1 = __Pyx_PyLong_Sign(op1);
24440 if (float_op2 >= 0.) {
24441 if (sign1 < 0) goto __pyx_return_true;
24442 if (float_op2 < (double) (1L << PyLong_SHIFT)) goto __pyx_return_false;
24443 } else {
24444 if (sign1 > 0) goto __pyx_return_false;
24445 if (float_op2 > -(double) (1L << PyLong_SHIFT)) goto __pyx_return_true;
24446 }
24447 }
24448 #else
24449 if (unlikely(!isfinite(float_op2))) {
24450 if (0.0 < float_op2) goto __pyx_return_true; else goto __pyx_return_false;
24451 } else {
24452 int overflow1;
24453 long iop1 = PyLong_AsLongAndOverflow(op1, &overflow1);
24454 if (likely(!overflow1)) {
24455 if ((long long) iop1 >= (1LL << 53)) {
24456 overflow1 = 1;
24457 } else if ((long long) iop1 <= - (1LL << 53)) {
24458 overflow1 = -1;
24459 } else {
24460 if (((double) iop1) < float_op2) goto __pyx_return_true; else goto __pyx_return_false;
24461 }
24462 }
24463 if (overflow1 < 0) {
24464 if (float_op2 > ((double) (1LL << 53))) goto __pyx_return_true;
24465 } else {
24466 if (float_op2 < - ((double) (1LL << 53))) goto __pyx_return_false;
24467 }
24468 }
24469 #endif
24470 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_LT);
24471__pyx_return_true:
24472 return 1;
24473__pyx_return_false:
24474 return 0;
24475}
24476#endif
24477static CYTHON_INLINE int __Pyx_PyObject_CompareBoolLt_object_float(PyObject *op1, PyObject *op2, int pyop) {
24478 CYTHON_UNUSED_VAR(pyop);
24479 if (unlikely(op2 == Py_None)) {
24480 goto __pyx_richcmp;
24481 }
24482 if (likely(PyFloat_CheckExact(op1))) {
24483 if (likely(op2 != Py_None)) {
24484 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
24485 #if !CYTHON_ASSUME_SAFE_MACROS
24486 if (unlikely(float_op1 == -1. && PyErr_Occurred())) return -1;
24487 #endif
24488 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
24489 #if !CYTHON_ASSUME_SAFE_MACROS
24490 if (unlikely(float_op2 == -1. && PyErr_Occurred())) return -1;
24491 #endif
24492 if (float_op1 < float_op2) goto __pyx_return_true; else goto __pyx_return_false;
24493 }
24494 goto __pyx_richcmp;
24495 }
24496 if (PyLong_CheckExact(op1)) {
24497 if (op1 == op2) goto __pyx_return_false;
24498 if (likely(op2 != Py_None)) {
24499 return __Pyx_PyObject_CompareIntFloatBoolLt(op1, op2);
24500 }
24501 goto __pyx_richcmp;
24502 }
24503 if ((0)) goto __pyx_richcmp;
24504 if ((0)) goto __pyx_return_true;
24505 if ((0)) goto __pyx_return_false;
24506__pyx_richcmp:
24507 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_LT);
24508__pyx_return_true:
24509 return 1;
24510__pyx_return_false:
24511 return 0;
24512}
24513
24514/* PyNumberBinop */
24515#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API)
24516#if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
24517#ifndef __Pyx_DEFINED_BinopTypeError
24518#define __Pyx_DEFINED_BinopTypeError
24519static void __Pyx_BinopTypeError(PyObject *op1, PyObject *op2, const char* op, int inplace) {
24520 char opname[4] = {op[0], op[1], 0, 0};
24521 if (inplace) {
24522 opname[op[1] ? 2 : 1] = '=';
24523 }
24524 __Pyx_RaiseErrorWithObjectTypes1(
24525 PyExc_TypeError,
24526 "unsupported operand type(s) for %.3s: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'",
24527 opname, op1, op2);
24528}
24529#endif
24530#endif
24531#ifndef __Pyx_DEFINED_PyNumber_Subtract_xfloat_object
24532#define __Pyx_DEFINED_PyNumber_Subtract_xfloat_object
24533static PyObject* __Pyx_PyNumber_Subtract_xfloat_object(PyObject *op1, PyObject *op2, int inplace) {
24534 if (PyLong_CheckExact(op2)) {
24535 double int_op2;
24536 #if CYTHON_USE_PYLONG_INTERNALS
24537 if (__Pyx_PyLong_IsCompact(op2)) {
24538 Py_ssize_t compact_op2 = __Pyx_PyLong_CompactValue(op2);
24539 if (compact_op2 == 0) return __Pyx_NewRef(op1);
24540 int_op2 = (double) compact_op2;
24541 } else
24542 #endif
24543 {
24544 int_op2 = PyLong_AsDouble(op2);
24545 if (unlikely((int_op2 == -1.) && PyErr_Occurred())) return NULL;
24546 #if !CYTHON_USE_PYLONG_INTERNALS
24547 if (int_op2 == 0.) return __Pyx_NewRef(op1);
24548 #endif
24549 }
24550 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
24551 #if !CYTHON_ASSUME_SAFE_MACROS
24552 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
24553 #endif
24554 return PyFloat_FromDouble(float_op1 - int_op2);
24555 }
24556 if (PyLong_Check(op2)) {
24557 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyFloat_Type, tp_as_number, nb_subtract, binaryfunc);
24558 if (likely(slot_func)) {
24559 return slot_func(op1, op2);
24560 }
24561 }
24562 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
24563 {
24564 PyTypeObject *type_op2 = Py_TYPE(op2);
24565 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_subtract, binaryfunc);
24566 if (likely(slot_func)) {
24567 PyObject *result = slot_func(op1, op2);
24568 if (likely(result != Py_NotImplemented)) {
24569 return result;
24570 }
24571 Py_DECREF(result);
24572 }
24573 __Pyx_BinopTypeError(op1, op2, "-", inplace);
24574 return NULL;
24575 }
24576 #else
24577 return (inplace) ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2);
24578 #endif
24579}
24580#endif
24581#ifndef __Pyx_DEFINED_PyNumber_Subtract_xint_object
24582#define __Pyx_DEFINED_PyNumber_Subtract_xint_object
24583static PyObject* __Pyx_PyNumber_Subtract_xint_object(PyObject *op1, PyObject *op2, int inplace) {
24584 if (PyFloat_CheckExact(op2)) {
24585 double int_op1;
24586 #if CYTHON_USE_PYLONG_INTERNALS
24587 if (__Pyx_PyLong_IsCompact(op1)) {
24588 Py_ssize_t compact_op1 = __Pyx_PyLong_CompactValue(op1);
24589 int_op1 = (double) compact_op1;
24590 } else
24591 #endif
24592 {
24593 int_op1 = PyLong_AsDouble(op1);
24594 if (unlikely((int_op1 == -1.) && PyErr_Occurred())) return NULL;
24595 }
24596 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
24597 #if !CYTHON_ASSUME_SAFE_MACROS
24598 if (unlikely((float_op2 == -1.) && PyErr_Occurred())) return NULL;
24599 #endif
24600 return PyFloat_FromDouble(int_op1 - float_op2);
24601 }
24602 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
24603 {
24604 PyTypeObject *type_op2 = Py_TYPE(op2);
24605 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_subtract, binaryfunc);
24606 if (likely(slot_func)) {
24607 PyObject *result = slot_func(op1, op2);
24608 if (likely(result != Py_NotImplemented)) {
24609 return result;
24610 }
24611 Py_DECREF(result);
24612 }
24613 __Pyx_BinopTypeError(op1, op2, "-", inplace);
24614 return NULL;
24615 }
24616 #else
24617 return (inplace) ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2);
24618 #endif
24619}
24620#endif
24621static CYTHON_INLINE PyObject* __Pyx__PyNumber_Subtract_object_object(PyObject *op1, PyObject *op2, int inplace) {
24622 if (PyFloat_CheckExact(op1)) {
24623 if (PyFloat_CheckExact(op2)) {
24624 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
24625 #if !CYTHON_ASSUME_SAFE_MACROS
24626 if (unlikely((float_op2 == -1.) && PyErr_Occurred())) return NULL;
24627 #endif
24628 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
24629 #if !CYTHON_ASSUME_SAFE_MACROS
24630 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
24631 #endif
24632 return PyFloat_FromDouble(float_op1 - float_op2);
24633 }
24634 return __Pyx_PyNumber_Subtract_xfloat_object(op1, op2, inplace);
24635 }
24636 if (PyLong_CheckExact(op1)) {
24637 if (PyLong_CheckExact(op2)) {
24638 #if CYTHON_USE_PYLONG_INTERNALS
24639 if (__Pyx_PyLong_IsCompact(op1)) {
24640 Py_ssize_t int_op1 = __Pyx_PyLong_CompactValue(op1);
24641 if (__Pyx_PyLong_IsCompact(op2)) {
24642 Py_ssize_t int_op2 = __Pyx_PyLong_CompactValue(op2);
24643 if (int_op2 == 0) return __Pyx_NewRef(op1);
24644 return PyLong_FromSsize_t(int_op1 - int_op2);
24645 }
24646 }
24647 else if (__Pyx_PyLong_IsZero(op2)) return __Pyx_NewRef(op1);
24648 #endif
24649 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyLong_Type, tp_as_number, nb_subtract, binaryfunc);
24650 if (likely(slot_func)) {
24651 return slot_func(op1, op2);
24652 }
24653 }
24654 return __Pyx_PyNumber_Subtract_xint_object(op1, op2, inplace);
24655 }
24656 return (inplace) ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2);
24657}
24658#endif
24659
24660/* PyNumberBinop */
24661#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API)
24662#if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
24663#ifndef __Pyx_DEFINED_BinopTypeError
24664#define __Pyx_DEFINED_BinopTypeError
24665static void __Pyx_BinopTypeError(PyObject *op1, PyObject *op2, const char* op, int inplace) {
24666 char opname[4] = {op[0], op[1], 0, 0};
24667 if (inplace) {
24668 opname[op[1] ? 2 : 1] = '=';
24669 }
24670 __Pyx_RaiseErrorWithObjectTypes1(
24671 PyExc_TypeError,
24672 "unsupported operand type(s) for %.3s: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'",
24673 opname, op1, op2);
24674}
24675#endif
24676#endif
24677#ifndef __Pyx_DEFINED_PyNumber_Multiply_xfloat_object
24678#define __Pyx_DEFINED_PyNumber_Multiply_xfloat_object
24679static PyObject* __Pyx_PyNumber_Multiply_xfloat_object(PyObject *op1, PyObject *op2, int inplace) {
24680 if (PyLong_CheckExact(op2)) {
24681 double int_op2;
24682 #if CYTHON_USE_PYLONG_INTERNALS
24683 if (__Pyx_PyLong_IsCompact(op2)) {
24684 Py_ssize_t compact_op2 = __Pyx_PyLong_CompactValue(op2);
24685 int_op2 = (double) compact_op2;
24686 } else
24687 #endif
24688 {
24689 int_op2 = PyLong_AsDouble(op2);
24690 if (unlikely((int_op2 == -1.) && PyErr_Occurred())) return NULL;
24691 }
24692 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
24693 #if !CYTHON_ASSUME_SAFE_MACROS
24694 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
24695 #endif
24696 if (float_op1 == 0.) return __Pyx_NewRef(op1);
24697 return PyFloat_FromDouble(float_op1 * int_op2);
24698 }
24699 if (PyLong_Check(op2)) {
24700 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyFloat_Type, tp_as_number, nb_multiply, binaryfunc);
24701 if (likely(slot_func)) {
24702 return slot_func(op1, op2);
24703 }
24704 }
24705 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
24706 {
24707 PyTypeObject *type_op2 = Py_TYPE(op2);
24708 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
24709 if (likely(slot_func)) {
24710 PyObject *result = slot_func(op1, op2);
24711 if (likely(result != Py_NotImplemented)) {
24712 return result;
24713 }
24714 Py_DECREF(result);
24715 }
24716 __Pyx_BinopTypeError(op1, op2, "*", inplace);
24717 return NULL;
24718 }
24719 #else
24720 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
24721 #endif
24722}
24723#endif
24724static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_float_object(PyObject *op1, PyObject *op2, int inplace) {
24725 if (likely(op1 != Py_None)) {
24726 if (likely(PyFloat_CheckExact(op2))) {
24727 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
24728 #if !CYTHON_ASSUME_SAFE_MACROS
24729 if (unlikely((float_op2 == -1.) && PyErr_Occurred())) return NULL;
24730 #endif
24731 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
24732 #if !CYTHON_ASSUME_SAFE_MACROS
24733 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
24734 #endif
24735 return PyFloat_FromDouble(float_op1 * float_op2);
24736 }
24737 return __Pyx_PyNumber_Multiply_xfloat_object(op1, op2, inplace);
24738 }
24739 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
24740}
24741#endif
24742
24743/* PyNumberBinop */
24744#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API)
24745#if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
24746#ifndef __Pyx_DEFINED_BinopTypeError
24747#define __Pyx_DEFINED_BinopTypeError
24748static void __Pyx_BinopTypeError(PyObject *op1, PyObject *op2, const char* op, int inplace) {
24749 char opname[4] = {op[0], op[1], 0, 0};
24750 if (inplace) {
24751 opname[op[1] ? 2 : 1] = '=';
24752 }
24753 __Pyx_RaiseErrorWithObjectTypes1(
24754 PyExc_TypeError,
24755 "unsupported operand type(s) for %.3s: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'",
24756 opname, op1, op2);
24757}
24758#endif
24759#endif
24760#ifndef __Pyx_DEFINED_PyNumber_Add_xfloat_object
24761#define __Pyx_DEFINED_PyNumber_Add_xfloat_object
24762static PyObject* __Pyx_PyNumber_Add_xfloat_object(PyObject *op1, PyObject *op2, int inplace) {
24763 if (PyLong_CheckExact(op2)) {
24764 double int_op2;
24765 #if CYTHON_USE_PYLONG_INTERNALS
24766 if (__Pyx_PyLong_IsCompact(op2)) {
24767 Py_ssize_t compact_op2 = __Pyx_PyLong_CompactValue(op2);
24768 if (compact_op2 == 0) return __Pyx_NewRef(op1);
24769 int_op2 = (double) compact_op2;
24770 } else
24771 #endif
24772 {
24773 int_op2 = PyLong_AsDouble(op2);
24774 if (unlikely((int_op2 == -1.) && PyErr_Occurred())) return NULL;
24775 #if !CYTHON_USE_PYLONG_INTERNALS
24776 if (int_op2 == 0.) return __Pyx_NewRef(op1);
24777 #endif
24778 }
24779 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
24780 #if !CYTHON_ASSUME_SAFE_MACROS
24781 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
24782 #endif
24783 return PyFloat_FromDouble(float_op1 + int_op2);
24784 }
24785 if (PyLong_Check(op2)) {
24786 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyFloat_Type, tp_as_number, nb_add, binaryfunc);
24787 if (likely(slot_func)) {
24788 return slot_func(op1, op2);
24789 }
24790 }
24791 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
24792 {
24793 PyTypeObject *type_op2 = Py_TYPE(op2);
24794 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_add, binaryfunc);
24795 if (likely(slot_func)) {
24796 PyObject *result = slot_func(op1, op2);
24797 if (likely(result != Py_NotImplemented)) {
24798 return result;
24799 }
24800 Py_DECREF(result);
24801 }
24802 __Pyx_BinopTypeError(op1, op2, "+", inplace);
24803 return NULL;
24804 }
24805 #else
24806 return (inplace) ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2);
24807 #endif
24808}
24809#endif
24810#ifndef __Pyx_DEFINED_PyNumber_Add_xint_object
24811#define __Pyx_DEFINED_PyNumber_Add_xint_object
24812static PyObject* __Pyx_PyNumber_Add_xint_object(PyObject *op1, PyObject *op2, int inplace) {
24813 if (PyFloat_CheckExact(op2)) {
24814 double int_op1;
24815 #if CYTHON_USE_PYLONG_INTERNALS
24816 if (__Pyx_PyLong_IsCompact(op1)) {
24817 Py_ssize_t compact_op1 = __Pyx_PyLong_CompactValue(op1);
24818 if (compact_op1 == 0) return __Pyx_NewRef(op2);
24819 int_op1 = (double) compact_op1;
24820 } else
24821 #endif
24822 {
24823 int_op1 = PyLong_AsDouble(op1);
24824 if (unlikely((int_op1 == -1.) && PyErr_Occurred())) return NULL;
24825 #if !CYTHON_USE_PYLONG_INTERNALS
24826 if (int_op1 == 0.) return __Pyx_NewRef(op2);
24827 #endif
24828 }
24829 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
24830 #if !CYTHON_ASSUME_SAFE_MACROS
24831 if (unlikely((float_op2 == -1.) && PyErr_Occurred())) return NULL;
24832 #endif
24833 return PyFloat_FromDouble(int_op1 + float_op2);
24834 }
24835 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
24836 {
24837 PyTypeObject *type_op2 = Py_TYPE(op2);
24838 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_add, binaryfunc);
24839 if (likely(slot_func)) {
24840 PyObject *result = slot_func(op1, op2);
24841 if (likely(result != Py_NotImplemented)) {
24842 return result;
24843 }
24844 Py_DECREF(result);
24845 }
24846 __Pyx_BinopTypeError(op1, op2, "+", inplace);
24847 return NULL;
24848 }
24849 #else
24850 return (inplace) ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2);
24851 #endif
24852}
24853#endif
24854static CYTHON_INLINE PyObject* __Pyx__PyNumber_Add_object_object(PyObject *op1, PyObject *op2, int inplace) {
24855 if (PyFloat_CheckExact(op1)) {
24856 if (PyFloat_CheckExact(op2)) {
24857 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
24858 #if !CYTHON_ASSUME_SAFE_MACROS
24859 if (unlikely((float_op2 == -1.) && PyErr_Occurred())) return NULL;
24860 #endif
24861 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
24862 #if !CYTHON_ASSUME_SAFE_MACROS
24863 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
24864 #endif
24865 return PyFloat_FromDouble(float_op1 + float_op2);
24866 }
24867 return __Pyx_PyNumber_Add_xfloat_object(op1, op2, inplace);
24868 }
24869 if (PyLong_CheckExact(op1)) {
24870 if (PyLong_CheckExact(op2)) {
24871 #if CYTHON_USE_PYLONG_INTERNALS
24872 if (__Pyx_PyLong_IsCompact(op1)) {
24873 Py_ssize_t int_op1 = __Pyx_PyLong_CompactValue(op1);
24874 if (int_op1 == 0) return __Pyx_NewRef(op2);
24875 if (__Pyx_PyLong_IsCompact(op2)) {
24876 Py_ssize_t int_op2 = __Pyx_PyLong_CompactValue(op2);
24877 if (int_op2 == 0) return __Pyx_NewRef(op1);
24878 return PyLong_FromSsize_t(int_op1 + int_op2);
24879 }
24880 }
24881 else if (__Pyx_PyLong_IsZero(op2)) return __Pyx_NewRef(op1);
24882 #endif
24883 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyLong_Type, tp_as_number, nb_add, binaryfunc);
24884 if (likely(slot_func)) {
24885 return slot_func(op1, op2);
24886 }
24887 }
24888 return __Pyx_PyNumber_Add_xint_object(op1, op2, inplace);
24889 }
24890 return (inplace) ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2);
24891}
24892#endif
24893
24894/* BufferFallbackError */
24895static void __Pyx_RaiseBufferFallbackError(void) {
24896 PyErr_SetString(PyExc_ValueError,
24897 "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
24898}
24899
24900/* SetItemInt */
24901static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
24902 int r;
24903 if (unlikely(!j)) return -1;
24904 r = PyObject_SetItem(o, j, v);
24905 Py_DECREF(j);
24906 return r;
24907}
24908#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
24909static CYTHON_INLINE int __Pyx_SetItemInt_Fast_mapping(PyObject *o, objobjargproc setitem, Py_ssize_t i, PyObject *value) {
24910 PyObject *key = PyLong_FromSsize_t(i);
24911 if (unlikely(!key)) return -1;
24912 int r = setitem(o, key, value);
24913 Py_DECREF(key);
24914 return r;
24915}
24916#endif
24917static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
24918 int wraparound, int boundscheck, int unsafe_shared) {
24919 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
24920#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS
24921 if (PyList_CheckExact(o)) {
24922 Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
24923 if ((CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared))) {
24924 Py_INCREF(v);
24925 return PyList_SetItem(o, n, v);
24926 } else if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
24927 PyObject* old;
24928 Py_INCREF(v);
24929 old = PyList_GET_ITEM(o, n);
24930 PyList_SET_ITEM(o, n, v);
24931 Py_DECREF(old);
24932 return 0;
24933 }
24934 } else
24935#endif
24936#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
24937 if (PyDict_CheckExact(o)) {
24938 return __Pyx_SetItemInt_Fast_mapping(o, PyDict_Type.tp_as_mapping->mp_ass_subscript, i, v);
24939 } else
24940 {
24941 PyTypeObject *obj_type = Py_TYPE(o);
24942 int seq_or_mapping = __Pyx_PyType_GetFlags(obj_type) & (Py_TPFLAGS_SEQUENCE|Py_TPFLAGS_MAPPING);
24943 if (seq_or_mapping != Py_TPFLAGS_SEQUENCE) {
24944 PyMappingMethods *mm = obj_type->tp_as_mapping;
24945 if (mm && mm->mp_ass_subscript)
24946 return __Pyx_SetItemInt_Fast_mapping(o, mm->mp_ass_subscript, i, v);
24947 }
24948 PySequenceMethods *sm = obj_type->tp_as_sequence;
24949 if (likely(sm && sm->sq_ass_item)) {
24950 if (wraparound && (i < 0) && unlikely(__Pyx_GetItemInt_wraparound(o, sm, &i) == -1))
24951 return -1;
24952 return sm->sq_ass_item(o, i, v);
24953 }
24954 if (seq_or_mapping == Py_TPFLAGS_SEQUENCE) {
24955 PyMappingMethods *mm = obj_type->tp_as_mapping;
24956 if (likely(mm && mm->mp_ass_subscript))
24957 return __Pyx_SetItemInt_Fast_mapping(o, mm->mp_ass_subscript, i, v);
24958 }
24959 }
24960#else
24961 if (!PyMapping_Check(o)) {
24962 return PySequence_SetItem(o, i, v);
24963 }
24964#endif
24965 (void)wraparound;
24966 (void)boundscheck;
24967 return __Pyx_SetItemInt_Generic(o, PyLong_FromSsize_t(i), v);
24968}
24969
24970/* PyObjectCompare */
24971#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
24972#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
24973static CYTHON_INLINE int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
24974 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
24975 int result = PyUnicode_Equal(s1, s2);
24976 #if !CYTHON_COMPILING_IN_CPYTHON
24977 if (unlikely(result == -1)) return -1;
24978 #endif
24979 if (result == 0) goto __pyx_return_false; else goto __pyx_return_true;
24980 #else
24981 int result = PyUnicode_Compare(s1, s2);
24982 if (unlikely((result == -1) && PyErr_Occurred())) return -1;
24983 if (result == 0) goto __pyx_return_true; else goto __pyx_return_false;
24984 #endif
24985__pyx_return_true:
24986 return 1;
24987__pyx_return_false:
24988 return 0;
24989}
24990#endif
24991static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_object_str(PyObject *op1, PyObject *op2, int pyop) {
24992 CYTHON_UNUSED_VAR(pyop);
24993 if (unlikely(op2 == Py_None)) {
24994 if (op1 == Py_None) goto __pyx_return_true; else goto __pyx_richcmp;
24995 }
24996 if (PyFloat_CheckExact(op1)) {
24997 goto __pyx_richcmp;
24998 }
24999 if (PyLong_CheckExact(op1)) {
25000 if (op1 == op2) goto __pyx_return_true;
25001 goto __pyx_richcmp;
25002 }
25003
25004 if (likely(PyUnicode_CheckExact(op1))) {
25005 if (op1 == op2) goto __pyx_return_true;
25006 if (likely(op2 != Py_None)) {
25007 return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
25008 }
25009 goto __pyx_richcmp;
25010 }
25011
25012 if ((0)) goto __pyx_richcmp;
25013 if ((0)) goto __pyx_return_true;
25014 if ((0)) goto __pyx_return_false;
25015__pyx_richcmp:
25016 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
25017__pyx_return_true:
25018 return 1;
25019__pyx_return_false:
25020 return 0;
25021}
25022
25023/* PyObjectVectorcallMethodKwds */
25024#if !CYTHON_VECTORCALL
25025static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
25026 PyObject *result;
25027 PyObject *obj = PyObject_GetAttr(args[0], name);
25028 if (unlikely(!obj))
25029 return NULL;
25030 result = __Pyx_Object_VectorcallKwds(obj, args+1, nargsf-1, kwnames);
25031 Py_DECREF(obj);
25032 return result;
25033}
25034#endif
25035
25036/* RaiseErrorWithObjectType1 (used by RaiseUnexpectedTypeError) */
25037static void __Pyx_RaiseErrorWithType1(PyObject* exc_type, const char* message, const char *arg, PyTypeObject *type_obj) {
25038 __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(type_obj);
25039 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
25040 if (unlikely(!type_name)) return;
25041 #endif
25042 PyErr_Format(exc_type, message, arg, type_name);
25043 __Pyx_DECREF_TypeName(type_name);
25044}
25045
25046/* RaiseUnexpectedTypeError */
25047static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) {
25048 __Pyx_RaiseTypeErrorWithObjectType1(
25049 "Expected %.42s, got " __Pyx_FMT_TYPENAME,
25050 expected, obj);
25051 return 0;
25052}
25053
25054/* PyNumberBinop */
25055#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API)
25056#if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
25057#ifndef __Pyx_DEFINED_BinopTypeError
25058#define __Pyx_DEFINED_BinopTypeError
25059static void __Pyx_BinopTypeError(PyObject *op1, PyObject *op2, const char* op, int inplace) {
25060 char opname[4] = {op[0], op[1], 0, 0};
25061 if (inplace) {
25062 opname[op[1] ? 2 : 1] = '=';
25063 }
25064 __Pyx_RaiseErrorWithObjectTypes1(
25065 PyExc_TypeError,
25066 "unsupported operand type(s) for %.3s: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'",
25067 opname, op1, op2);
25068}
25069#endif
25070#endif
25071#ifndef __Pyx_DEFINED_PyNumber_Multiply_xfloat_float
25072#define __Pyx_DEFINED_PyNumber_Multiply_xfloat_float
25073static PyObject* __Pyx_PyNumber_Multiply_xfloat_float(PyObject *op1, PyObject *op2, int inplace) {
25074 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
25075 {
25076 PyTypeObject *type_op2 = Py_TYPE(op2);
25077 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
25078 if (likely(slot_func)) {
25079 PyObject *result = slot_func(op1, op2);
25080 if (likely(result != Py_NotImplemented)) {
25081 return result;
25082 }
25083 Py_DECREF(result);
25084 }
25085 __Pyx_BinopTypeError(op1, op2, "*", inplace);
25086 return NULL;
25087 }
25088 #else
25089 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
25090 #endif
25091}
25092#endif
25093#ifndef __Pyx_DEFINED_PyNumber_Multiply_xint_float
25094#define __Pyx_DEFINED_PyNumber_Multiply_xint_float
25095static PyObject* __Pyx_PyNumber_Multiply_xint_float(PyObject *op1, PyObject *op2, int inplace) {
25096 if (likely(op2 != Py_None)) {
25097 double int_op1;
25098 #if CYTHON_USE_PYLONG_INTERNALS
25099 if (__Pyx_PyLong_IsCompact(op1)) {
25100 Py_ssize_t compact_op1 = __Pyx_PyLong_CompactValue(op1);
25101 int_op1 = (double) compact_op1;
25102 } else
25103 #endif
25104 {
25105 int_op1 = PyLong_AsDouble(op1);
25106 if (unlikely((int_op1 == -1.) && PyErr_Occurred())) return NULL;
25107 }
25108 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
25109 #if !CYTHON_ASSUME_SAFE_MACROS
25110 if (unlikely((float_op2 == -1.) && PyErr_Occurred())) return NULL;
25111 #endif
25112 return PyFloat_FromDouble(int_op1 * float_op2);
25113 }
25114 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
25115 {
25116 PyTypeObject *type_op2 = Py_TYPE(op2);
25117 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
25118 if (likely(slot_func)) {
25119 PyObject *result = slot_func(op1, op2);
25120 if (likely(result != Py_NotImplemented)) {
25121 return result;
25122 }
25123 Py_DECREF(result);
25124 }
25125 ssizeargfunc repeat_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_sequence, sq_repeat, ssizeargfunc);
25126 if (likely(repeat_func)) {
25127 Py_ssize_t count;
25128 #if CYTHON_USE_PYLONG_INTERNALS
25129 if (__Pyx_PyLong_IsCompact(op1)) {
25130 count = __Pyx_PyLong_CompactValue(op1);
25131 } else
25132 #endif
25133 {
25134 count = PyLong_AsSsize_t(op1);
25135 if (unlikely((count == -1) && PyErr_Occurred())) return NULL;
25136 }
25137 return repeat_func(op2, count);
25138 }
25139 __Pyx_BinopTypeError(op1, op2, "*", inplace);
25140 return NULL;
25141 }
25142 #else
25143 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
25144 #endif
25145}
25146#endif
25147static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_object_float(PyObject *op1, PyObject *op2, int inplace) {
25148 if (likely(PyFloat_CheckExact(op1))) {
25149 if (likely(op2 != Py_None)) {
25150 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
25151 #if !CYTHON_ASSUME_SAFE_MACROS
25152 if (unlikely((float_op2 == -1.) && PyErr_Occurred())) return NULL;
25153 #endif
25154 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
25155 #if !CYTHON_ASSUME_SAFE_MACROS
25156 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
25157 #endif
25158 return PyFloat_FromDouble(float_op1 * float_op2);
25159 }
25160 return __Pyx_PyNumber_Multiply_xfloat_float(op1, op2, inplace);
25161 }
25162 if (PyLong_CheckExact(op1)) {
25163 return __Pyx_PyNumber_Multiply_xint_float(op1, op2, inplace);
25164 }
25165 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
25166}
25167#endif
25168
25169/* PyObjectCompare */
25170#ifndef __Pyx_DEFINED_PyObject_CompareFloatIntBoolGt
25171#define __Pyx_DEFINED_PyObject_CompareFloatIntBoolGt
25172static int __Pyx_PyObject_CompareFloatIntBoolGt(PyObject *op1, PyObject *op2) {
25173 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
25174 #if !CYTHON_ASSUME_SAFE_MACROS
25175 if (unlikely(float_op1 == -1. && PyErr_Occurred())) return -1;
25176 #endif
25177 #if CYTHON_USE_PYLONG_INTERNALS
25178 if (__Pyx_PyLong_IsCompact(op2)) {
25179 Py_ssize_t iop2 = __Pyx_PyLong_CompactValue(op2);
25180 if (float_op1 > ((double)iop2)) goto __pyx_return_true; else goto __pyx_return_false;
25181 }
25182 if (unlikely(!isfinite(float_op1))) {
25183 if (float_op1 > 0.0) goto __pyx_return_true; else goto __pyx_return_false;
25184 } else {
25185 int sign2 = __Pyx_PyLong_Sign(op2);
25186 if (float_op1 >= 0.) {
25187 if (sign2 < 0) goto __pyx_return_true;
25188 if (float_op1 < (double) (1L << PyLong_SHIFT)) goto __pyx_return_false;
25189 } else {
25190 if (sign2 > 0) goto __pyx_return_false;
25191 if (float_op1 > -(double) (1L << PyLong_SHIFT)) goto __pyx_return_true;
25192 }
25193 }
25194 #else
25195 if (unlikely(!isfinite(float_op1))) {
25196 if (float_op1 > 0.0) goto __pyx_return_true; else goto __pyx_return_false;
25197 } else {
25198 int overflow2;
25199 long iop2 = PyLong_AsLongAndOverflow(op2, &overflow2);
25200 if (likely(!overflow2)) {
25201 if ((long long) iop2 >= (1LL << 53)) {
25202 overflow2 = 1;
25203 } else if ((long long) iop2 <= - (1LL << 53)) {
25204 overflow2 = -1;
25205 } else {
25206 if (float_op1 > ((double) iop2)) goto __pyx_return_true; else goto __pyx_return_false;
25207 }
25208 }
25209 if (overflow2 > 0) {
25210 if (float_op1 < ((double) (1LL << 53))) goto __pyx_return_false;
25211 } else {
25212 if (float_op1 > - ((double) (1LL << 53))) goto __pyx_return_true;
25213 }
25214 }
25215 #endif
25216 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_GT);
25217__pyx_return_true:
25218 return 1;
25219__pyx_return_false:
25220 return 0;
25221}
25222#endif
25223#ifndef __Pyx_DEFINED_PyObject_CompareIntIntBoolGt
25224#define __Pyx_DEFINED_PyObject_CompareIntIntBoolGt
25225static int __Pyx_PyObject_CompareIntIntBoolGt(PyObject *op1, PyObject *op2) {
25226#if CYTHON_USE_PYLONG_INTERNALS
25227 Py_ssize_t cmp = __Pyx_PyLong_CompareSignAndSize(op1, op2);
25228 if (cmp == 0) {
25229 Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
25230 if (size > 0) {
25231 const digit* digits1 = __Pyx_PyLong_Digits(op1);
25232 const digit* digits2 = __Pyx_PyLong_Digits(op2);
25233 if (size == 1) {
25234 cmp = (Py_ssize_t) digits1[0] - (Py_ssize_t) digits2[0];
25235 } else if ((size == 2) && (8 * sizeof(Py_ssize_t) >= 2 * PyLong_SHIFT)) {
25236 cmp = (Py_ssize_t) (((((size_t)digits1[1]) << PyLong_SHIFT) | (size_t)digits1[0])) - (Py_ssize_t) (((((size_t)digits2[1]) << PyLong_SHIFT) | (size_t)digits2[0]));
25237 } else {
25238 for (Py_ssize_t i=size-1; i >= 0 && !cmp; --i) {
25239 cmp = (Py_ssize_t) digits1[i] - (Py_ssize_t) digits2[i];
25240 }
25241 }
25242 }
25243 if (cmp == 0) goto __pyx_return_false;
25244 if (__Pyx_PyLong_IsNeg(op1)) cmp = -cmp;
25245 }
25246 if (cmp < 0) goto __pyx_return_false; else goto __pyx_return_true;
25247#else
25248 int overflow1, overflow2;
25249 long long iop1 = PyLong_AsLongLongAndOverflow(op1, &overflow1);
25250 long long iop2 = PyLong_AsLongLongAndOverflow(op2, &overflow2);
25251 if (likely(!(overflow1 | overflow2))) {
25252 if (iop1 > iop2) goto __pyx_return_true; else goto __pyx_return_false;
25253 } else if (overflow1 != overflow2) {
25254 if (overflow1 > overflow2) goto __pyx_return_true; else goto __pyx_return_false;
25255 } else {
25256 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_GT);
25257 }
25258#endif
25259__pyx_return_true:
25260 return 1;
25261__pyx_return_false:
25262 return 0;
25263}
25264#endif
25265static CYTHON_INLINE int __Pyx_PyObject_CompareBoolGt_object_int(PyObject *op1, PyObject *op2, int pyop) {
25266 CYTHON_UNUSED_VAR(pyop);
25267 if (unlikely(op2 == Py_None)) {
25268 goto __pyx_richcmp;
25269 }
25270 if (op1 == op2) goto __pyx_return_false;
25271 if (PyFloat_CheckExact(op1)) {
25272 if (likely(op2 != Py_None)) {
25273 return __Pyx_PyObject_CompareFloatIntBoolGt(op1, op2);
25274 }
25275 goto __pyx_richcmp;
25276 }
25277 if (likely(PyLong_CheckExact(op1))) {
25278 if (op1 == op2) goto __pyx_return_false;
25279 if (likely(op2 != Py_None)) {
25280 return __Pyx_PyObject_CompareIntIntBoolGt(op1, op2);
25281 }
25282 goto __pyx_richcmp;
25283 }
25284 if ((0)) goto __pyx_richcmp;
25285 if ((0)) goto __pyx_return_true;
25286 if ((0)) goto __pyx_return_false;
25287__pyx_richcmp:
25288 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_GT);
25289__pyx_return_true:
25290 return 1;
25291__pyx_return_false:
25292 return 0;
25293}
25294
25295/* PyObjectCompare */
25296#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolGt
25297#define __Pyx_DEFINED_PyObject_CompareStrStrBoolGt
25298static CYTHON_INLINE int __Pyx_PyObject_CompareStrStrBoolGt(PyObject* s1, PyObject* s2) {
25299 int result = PyUnicode_Compare(s1, s2);
25300 if (unlikely((result == -1) && PyErr_Occurred())) return -1;
25301 if (result > 0) goto __pyx_return_true; else goto __pyx_return_false;
25302__pyx_return_true:
25303 return 1;
25304__pyx_return_false:
25305 return 0;
25306}
25307#endif
25308#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
25309#ifndef __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesBoolGt
25310#define __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesBoolGt
25311static CYTHON_INLINE int __Pyx_PyObject_ComparePyBytesPyBytesBoolGt(PyObject* s1, PyObject* s2) {
25312 Py_ssize_t cmp;
25313 Py_ssize_t length1, length2, short_length;
25314 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
25315 const char *ps1, *ps2;
25316 length1 = __Pyx_PyBytes_GET_SIZE(s1);
25317 length2 = __Pyx_PyBytes_GET_SIZE(s2);
25318 short_length = (length1 < length2) ? length1 : length2;
25319 if (short_length == 0) {
25320 if (length1 == 0) goto __pyx_return_false; else goto __pyx_return_true;
25321 }
25322 ps1 = PyBytes_AS_STRING(s1);
25323 ps2 = PyBytes_AS_STRING(s2);
25324 #else
25325 char *ps1, *ps2;
25326 if (unlikely(PyBytes_AsStringAndSize(s1, &ps1, &length1) == -1)) return -1;
25327 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1)) return -1;
25328 short_length = (length1 < length2) ? length1 : length2;
25329 if (short_length == 0) {
25330 if (length1 == 0) goto __pyx_return_false; else goto __pyx_return_true;
25331 }
25332 #endif
25333 cmp = (Py_ssize_t) ((const unsigned char*) ps1)[0] - (Py_ssize_t) ((const unsigned char*) ps2)[0];
25334 if (cmp == 0 && short_length > 1) {
25335 cmp = memcmp(ps1, ps2, (size_t)short_length);
25336 }
25337 if (cmp == 0) cmp = (length1 - length2);
25338 if (cmp > 0) goto __pyx_return_true; else goto __pyx_return_false;
25339__pyx_return_true:
25340 return 1;
25341__pyx_return_false:
25342 return 0;
25343}
25344#endif
25345#endif
25346#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
25347#ifndef __Pyx_DEFINED_PyObject_ComparePyBytesPyByteArrayBoolGt
25348#define __Pyx_DEFINED_PyObject_ComparePyBytesPyByteArrayBoolGt
25349static CYTHON_INLINE int __Pyx_PyObject_ComparePyBytesPyByteArrayBoolGt(PyObject* s1, PyObject* s2) {
25350 Py_ssize_t cmp;
25351 Py_ssize_t length1, length2, short_length;
25352 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
25353 const char *ps1, *ps2;
25354 length1 = __Pyx_PyBytes_GET_SIZE(s1);
25355 length2 = __Pyx_PyByteArray_GET_SIZE(s2);
25356 short_length = (length1 < length2) ? length1 : length2;
25357 if (short_length == 0) {
25358 if (length1 == 0) goto __pyx_return_false; else goto __pyx_return_true;
25359 }
25360 ps1 = PyBytes_AS_STRING(s1);
25361 ps2 = PyByteArray_AS_STRING(s2);
25362 #else
25363 char *ps1, *ps2;
25364 if (unlikely(PyBytes_AsStringAndSize(s1, &ps1, &length1) == -1)) return -1;
25365 ps2 = __Pyx_PyByteArray_AsString(s2); if (unlikely(!ps2)) return -1;
25366 length2 = __Pyx_PyByteArray_GET_SIZE(s2); if (unlikely(length2 == -1)) return -1;
25367 short_length = (length1 < length2) ? length1 : length2;
25368 if (short_length == 0) {
25369 if (length1 == 0) goto __pyx_return_false; else goto __pyx_return_true;
25370 }
25371 #endif
25372 cmp = (Py_ssize_t) ((const unsigned char*) ps1)[0] - (Py_ssize_t) ((const unsigned char*) ps2)[0];
25373 if (cmp == 0 && short_length > 1) {
25374 cmp = memcmp(ps1, ps2, (size_t)short_length);
25375 }
25376 if (cmp == 0) cmp = (length1 - length2);
25377 if (cmp > 0) goto __pyx_return_true; else goto __pyx_return_false;
25378__pyx_return_true:
25379 return 1;
25380__pyx_return_false:
25381 return 0;
25382}
25383#endif
25384#endif
25385#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
25386#ifndef __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesBoolGt
25387#define __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesBoolGt
25388static CYTHON_INLINE int __Pyx_PyObject_ComparePyByteArrayPyBytesBoolGt(PyObject* s1, PyObject* s2) {
25389 Py_ssize_t cmp;
25390 Py_ssize_t length1, length2, short_length;
25391 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
25392 const char *ps1, *ps2;
25393 length1 = __Pyx_PyByteArray_GET_SIZE(s1);
25394 length2 = __Pyx_PyBytes_GET_SIZE(s2);
25395 short_length = (length1 < length2) ? length1 : length2;
25396 if (short_length == 0) {
25397 if (length1 == 0) goto __pyx_return_false; else goto __pyx_return_true;
25398 }
25399 ps1 = PyByteArray_AS_STRING(s1);
25400 ps2 = PyBytes_AS_STRING(s2);
25401 #else
25402 char *ps1, *ps2;
25403 ps1 = __Pyx_PyByteArray_AsString(s1); if (unlikely(!ps1)) return -1;
25404 length1 = __Pyx_PyByteArray_GET_SIZE(s1); if (unlikely(length1 == -1)) return -1;
25405 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1)) return -1;
25406 short_length = (length1 < length2) ? length1 : length2;
25407 if (short_length == 0) {
25408 if (length1 == 0) goto __pyx_return_false; else goto __pyx_return_true;
25409 }
25410 #endif
25411 cmp = (Py_ssize_t) ((const unsigned char*) ps1)[0] - (Py_ssize_t) ((const unsigned char*) ps2)[0];
25412 if (cmp == 0 && short_length > 1) {
25413 cmp = memcmp(ps1, ps2, (size_t)short_length);
25414 }
25415 if (cmp == 0) cmp = (length1 - length2);
25416 if (cmp > 0) goto __pyx_return_true; else goto __pyx_return_false;
25417__pyx_return_true:
25418 return 1;
25419__pyx_return_false:
25420 return 0;
25421}
25422#endif
25423#endif
25424#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
25425#ifndef __Pyx_DEFINED_PyObject_ComparePyByteArrayPyByteArrayBoolGt
25426#define __Pyx_DEFINED_PyObject_ComparePyByteArrayPyByteArrayBoolGt
25427static CYTHON_INLINE int __Pyx_PyObject_ComparePyByteArrayPyByteArrayBoolGt(PyObject* s1, PyObject* s2) {
25428 Py_ssize_t cmp;
25429 Py_ssize_t length1, length2, short_length;
25430 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
25431 const char *ps1, *ps2;
25432 length1 = __Pyx_PyByteArray_GET_SIZE(s1);
25433 length2 = __Pyx_PyByteArray_GET_SIZE(s2);
25434 short_length = (length1 < length2) ? length1 : length2;
25435 if (short_length == 0) {
25436 if (length1 == 0) goto __pyx_return_false; else goto __pyx_return_true;
25437 }
25438 ps1 = PyByteArray_AS_STRING(s1);
25439 ps2 = PyByteArray_AS_STRING(s2);
25440 #else
25441 char *ps1, *ps2;
25442 ps1 = __Pyx_PyByteArray_AsString(s1); if (unlikely(!ps1)) return -1;
25443 length1 = __Pyx_PyByteArray_GET_SIZE(s1); if (unlikely(length1 == -1)) return -1;
25444 ps2 = __Pyx_PyByteArray_AsString(s2); if (unlikely(!ps2)) return -1;
25445 length2 = __Pyx_PyByteArray_GET_SIZE(s2); if (unlikely(length2 == -1)) return -1;
25446 short_length = (length1 < length2) ? length1 : length2;
25447 if (short_length == 0) {
25448 if (length1 == 0) goto __pyx_return_false; else goto __pyx_return_true;
25449 }
25450 #endif
25451 cmp = (Py_ssize_t) ((const unsigned char*) ps1)[0] - (Py_ssize_t) ((const unsigned char*) ps2)[0];
25452 if (cmp == 0 && short_length > 1) {
25453 cmp = memcmp(ps1, ps2, (size_t)short_length);
25454 }
25455 if (cmp == 0) cmp = (length1 - length2);
25456 if (cmp > 0) goto __pyx_return_true; else goto __pyx_return_false;
25457__pyx_return_true:
25458 return 1;
25459__pyx_return_false:
25460 return 0;
25461}
25462#endif
25463#endif
25464#ifndef __Pyx_DEFINED_PyObject_CompareFloatIntBoolGt
25465#define __Pyx_DEFINED_PyObject_CompareFloatIntBoolGt
25466static int __Pyx_PyObject_CompareFloatIntBoolGt(PyObject *op1, PyObject *op2) {
25467 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
25468 #if !CYTHON_ASSUME_SAFE_MACROS
25469 if (unlikely(float_op1 == -1. && PyErr_Occurred())) return -1;
25470 #endif
25471 #if CYTHON_USE_PYLONG_INTERNALS
25472 if (__Pyx_PyLong_IsCompact(op2)) {
25473 Py_ssize_t iop2 = __Pyx_PyLong_CompactValue(op2);
25474 if (float_op1 > ((double)iop2)) goto __pyx_return_true; else goto __pyx_return_false;
25475 }
25476 if (unlikely(!isfinite(float_op1))) {
25477 if (float_op1 > 0.0) goto __pyx_return_true; else goto __pyx_return_false;
25478 } else {
25479 int sign2 = __Pyx_PyLong_Sign(op2);
25480 if (float_op1 >= 0.) {
25481 if (sign2 < 0) goto __pyx_return_true;
25482 if (float_op1 < (double) (1L << PyLong_SHIFT)) goto __pyx_return_false;
25483 } else {
25484 if (sign2 > 0) goto __pyx_return_false;
25485 if (float_op1 > -(double) (1L << PyLong_SHIFT)) goto __pyx_return_true;
25486 }
25487 }
25488 #else
25489 if (unlikely(!isfinite(float_op1))) {
25490 if (float_op1 > 0.0) goto __pyx_return_true; else goto __pyx_return_false;
25491 } else {
25492 int overflow2;
25493 long iop2 = PyLong_AsLongAndOverflow(op2, &overflow2);
25494 if (likely(!overflow2)) {
25495 if ((long long) iop2 >= (1LL << 53)) {
25496 overflow2 = 1;
25497 } else if ((long long) iop2 <= - (1LL << 53)) {
25498 overflow2 = -1;
25499 } else {
25500 if (float_op1 > ((double) iop2)) goto __pyx_return_true; else goto __pyx_return_false;
25501 }
25502 }
25503 if (overflow2 > 0) {
25504 if (float_op1 < ((double) (1LL << 53))) goto __pyx_return_false;
25505 } else {
25506 if (float_op1 > - ((double) (1LL << 53))) goto __pyx_return_true;
25507 }
25508 }
25509 #endif
25510 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_GT);
25511__pyx_return_true:
25512 return 1;
25513__pyx_return_false:
25514 return 0;
25515}
25516#endif
25517#ifndef __Pyx_DEFINED_PyObject_CompareIntFloatBoolGt
25518#define __Pyx_DEFINED_PyObject_CompareIntFloatBoolGt
25519static int __Pyx_PyObject_CompareIntFloatBoolGt(PyObject *op1, PyObject *op2) {
25520 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
25521 #if !CYTHON_ASSUME_SAFE_MACROS
25522 if (unlikely(float_op2 == -1. && PyErr_Occurred())) return -1;
25523 #endif
25524 #if CYTHON_USE_PYLONG_INTERNALS
25525 if (__Pyx_PyLong_IsCompact(op1)) {
25526 Py_ssize_t iop1 = __Pyx_PyLong_CompactValue(op1);
25527 if (((double)iop1) > float_op2) goto __pyx_return_true; else goto __pyx_return_false;
25528 }
25529 if (unlikely(!isfinite(float_op2))) {
25530 if (0.0 > float_op2) goto __pyx_return_true; else goto __pyx_return_false;
25531 } else {
25532 int sign1 = __Pyx_PyLong_Sign(op1);
25533 if (float_op2 >= 0.) {
25534 if (sign1 < 0) goto __pyx_return_false;
25535 if (float_op2 < (double) (1L << PyLong_SHIFT)) goto __pyx_return_true;
25536 } else {
25537 if (sign1 > 0) goto __pyx_return_true;
25538 if (float_op2 > -(double) (1L << PyLong_SHIFT)) goto __pyx_return_false;
25539 }
25540 }
25541 #else
25542 if (unlikely(!isfinite(float_op2))) {
25543 if (0.0 > float_op2) goto __pyx_return_true; else goto __pyx_return_false;
25544 } else {
25545 int overflow1;
25546 long iop1 = PyLong_AsLongAndOverflow(op1, &overflow1);
25547 if (likely(!overflow1)) {
25548 if ((long long) iop1 >= (1LL << 53)) {
25549 overflow1 = 1;
25550 } else if ((long long) iop1 <= - (1LL << 53)) {
25551 overflow1 = -1;
25552 } else {
25553 if (((double) iop1) > float_op2) goto __pyx_return_true; else goto __pyx_return_false;
25554 }
25555 }
25556 if (overflow1 < 0) {
25557 if (float_op2 > ((double) (1LL << 53))) goto __pyx_return_false;
25558 } else {
25559 if (float_op2 < - ((double) (1LL << 53))) goto __pyx_return_true;
25560 }
25561 }
25562 #endif
25563 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_GT);
25564__pyx_return_true:
25565 return 1;
25566__pyx_return_false:
25567 return 0;
25568}
25569#endif
25570#ifndef __Pyx_DEFINED_PyObject_CompareIntIntBoolGt
25571#define __Pyx_DEFINED_PyObject_CompareIntIntBoolGt
25572static int __Pyx_PyObject_CompareIntIntBoolGt(PyObject *op1, PyObject *op2) {
25573#if CYTHON_USE_PYLONG_INTERNALS
25574 Py_ssize_t cmp = __Pyx_PyLong_CompareSignAndSize(op1, op2);
25575 if (cmp == 0) {
25576 Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
25577 if (size > 0) {
25578 const digit* digits1 = __Pyx_PyLong_Digits(op1);
25579 const digit* digits2 = __Pyx_PyLong_Digits(op2);
25580 if (size == 1) {
25581 cmp = (Py_ssize_t) digits1[0] - (Py_ssize_t) digits2[0];
25582 } else if ((size == 2) && (8 * sizeof(Py_ssize_t) >= 2 * PyLong_SHIFT)) {
25583 cmp = (Py_ssize_t) (((((size_t)digits1[1]) << PyLong_SHIFT) | (size_t)digits1[0])) - (Py_ssize_t) (((((size_t)digits2[1]) << PyLong_SHIFT) | (size_t)digits2[0]));
25584 } else {
25585 for (Py_ssize_t i=size-1; i >= 0 && !cmp; --i) {
25586 cmp = (Py_ssize_t) digits1[i] - (Py_ssize_t) digits2[i];
25587 }
25588 }
25589 }
25590 if (cmp == 0) goto __pyx_return_false;
25591 if (__Pyx_PyLong_IsNeg(op1)) cmp = -cmp;
25592 }
25593 if (cmp < 0) goto __pyx_return_false; else goto __pyx_return_true;
25594#else
25595 int overflow1, overflow2;
25596 long long iop1 = PyLong_AsLongLongAndOverflow(op1, &overflow1);
25597 long long iop2 = PyLong_AsLongLongAndOverflow(op2, &overflow2);
25598 if (likely(!(overflow1 | overflow2))) {
25599 if (iop1 > iop2) goto __pyx_return_true; else goto __pyx_return_false;
25600 } else if (overflow1 != overflow2) {
25601 if (overflow1 > overflow2) goto __pyx_return_true; else goto __pyx_return_false;
25602 } else {
25603 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_GT);
25604 }
25605#endif
25606__pyx_return_true:
25607 return 1;
25608__pyx_return_false:
25609 return 0;
25610}
25611#endif
25612static CYTHON_INLINE int __Pyx_PyObject_CompareBoolGt_object_object(PyObject *op1, PyObject *op2, int pyop) {
25613 CYTHON_UNUSED_VAR(pyop);
25614 if (PyFloat_CheckExact(op1)) {
25615 if (PyFloat_CheckExact(op2)) {
25616 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
25617 #if !CYTHON_ASSUME_SAFE_MACROS
25618 if (unlikely(float_op1 == -1. && PyErr_Occurred())) return -1;
25619 #endif
25620 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
25621 #if !CYTHON_ASSUME_SAFE_MACROS
25622 if (unlikely(float_op2 == -1. && PyErr_Occurred())) return -1;
25623 #endif
25624 if (float_op1 > float_op2) goto __pyx_return_true; else goto __pyx_return_false;
25625 }
25626 if (PyLong_CheckExact(op2)) {
25627 return __Pyx_PyObject_CompareFloatIntBoolGt(op1, op2);
25628 }
25629 goto __pyx_richcmp;
25630 }
25631 if (PyLong_CheckExact(op1)) {
25632 if (op1 == op2) goto __pyx_return_false;
25633 if (PyLong_CheckExact(op2)) {
25634 return __Pyx_PyObject_CompareIntIntBoolGt(op1, op2);
25635 }
25636 if (PyFloat_CheckExact(op2)) {
25637 return __Pyx_PyObject_CompareIntFloatBoolGt(op1, op2);
25638 }
25639 goto __pyx_richcmp;
25640 }
25641
25642 if (PyUnicode_CheckExact(op1)) {
25643 if (op1 == op2) goto __pyx_return_false;
25644 if (PyUnicode_CheckExact(op2)) {
25645 return __Pyx_PyObject_CompareStrStrBoolGt(op1, op2);
25646 }
25647 goto __pyx_richcmp;
25648 }
25649
25650 #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
25651 if (PyBytes_CheckExact(op1)) {
25652 if (op1 == op2) goto __pyx_return_false;
25653 if (PyBytes_CheckExact(op2)) {
25654 return __Pyx_PyObject_ComparePyBytesPyBytesBoolGt(op1, op2);
25655 }
25656 if (PyByteArray_CheckExact(op2)) {
25657 return __Pyx_PyObject_ComparePyBytesPyByteArrayBoolGt(op1, op2);
25658 }
25659 goto __pyx_richcmp;
25660 }
25661 #endif
25662 #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
25663 if (PyByteArray_CheckExact(op1)) {
25664 if (op1 == op2) goto __pyx_return_false;
25665 if (PyByteArray_CheckExact(op2)) {
25666 return __Pyx_PyObject_ComparePyByteArrayPyByteArrayBoolGt(op1, op2);
25667 }
25668 if (PyBytes_CheckExact(op2)) {
25669 return __Pyx_PyObject_ComparePyByteArrayPyBytesBoolGt(op1, op2);
25670 }
25671 goto __pyx_richcmp;
25672 }
25673 #endif
25674 if ((0)) goto __pyx_richcmp;
25675 if ((0)) goto __pyx_return_true;
25676 if ((0)) goto __pyx_return_false;
25677__pyx_richcmp:
25678 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_GT);
25679__pyx_return_true:
25680 return 1;
25681__pyx_return_false:
25682 return 0;
25683}
25684
25685/* PyObjectCompare */
25686#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolLt
25687#define __Pyx_DEFINED_PyObject_CompareStrStrBoolLt
25688static CYTHON_INLINE int __Pyx_PyObject_CompareStrStrBoolLt(PyObject* s1, PyObject* s2) {
25689 int result = PyUnicode_Compare(s1, s2);
25690 if (unlikely((result == -1) && PyErr_Occurred())) return -1;
25691 if (result < 0) goto __pyx_return_true; else goto __pyx_return_false;
25692__pyx_return_true:
25693 return 1;
25694__pyx_return_false:
25695 return 0;
25696}
25697#endif
25698#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
25699#ifndef __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesBoolLt
25700#define __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesBoolLt
25701static CYTHON_INLINE int __Pyx_PyObject_ComparePyBytesPyBytesBoolLt(PyObject* s1, PyObject* s2) {
25702 Py_ssize_t cmp;
25703 Py_ssize_t length1, length2, short_length;
25704 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
25705 const char *ps1, *ps2;
25706 length1 = __Pyx_PyBytes_GET_SIZE(s1);
25707 length2 = __Pyx_PyBytes_GET_SIZE(s2);
25708 short_length = (length1 < length2) ? length1 : length2;
25709 if (short_length == 0) {
25710 if (length1 == 0) goto __pyx_return_true; else goto __pyx_return_false;
25711 }
25712 ps1 = PyBytes_AS_STRING(s1);
25713 ps2 = PyBytes_AS_STRING(s2);
25714 #else
25715 char *ps1, *ps2;
25716 if (unlikely(PyBytes_AsStringAndSize(s1, &ps1, &length1) == -1)) return -1;
25717 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1)) return -1;
25718 short_length = (length1 < length2) ? length1 : length2;
25719 if (short_length == 0) {
25720 if (length1 == 0) goto __pyx_return_true; else goto __pyx_return_false;
25721 }
25722 #endif
25723 cmp = (Py_ssize_t) ((const unsigned char*) ps1)[0] - (Py_ssize_t) ((const unsigned char*) ps2)[0];
25724 if (cmp == 0 && short_length > 1) {
25725 cmp = memcmp(ps1, ps2, (size_t)short_length);
25726 }
25727 if (cmp == 0) cmp = (length1 - length2);
25728 if (cmp < 0) goto __pyx_return_true; else goto __pyx_return_false;
25729__pyx_return_true:
25730 return 1;
25731__pyx_return_false:
25732 return 0;
25733}
25734#endif
25735#endif
25736#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
25737#ifndef __Pyx_DEFINED_PyObject_ComparePyBytesPyByteArrayBoolLt
25738#define __Pyx_DEFINED_PyObject_ComparePyBytesPyByteArrayBoolLt
25739static CYTHON_INLINE int __Pyx_PyObject_ComparePyBytesPyByteArrayBoolLt(PyObject* s1, PyObject* s2) {
25740 Py_ssize_t cmp;
25741 Py_ssize_t length1, length2, short_length;
25742 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
25743 const char *ps1, *ps2;
25744 length1 = __Pyx_PyBytes_GET_SIZE(s1);
25745 length2 = __Pyx_PyByteArray_GET_SIZE(s2);
25746 short_length = (length1 < length2) ? length1 : length2;
25747 if (short_length == 0) {
25748 if (length1 == 0) goto __pyx_return_true; else goto __pyx_return_false;
25749 }
25750 ps1 = PyBytes_AS_STRING(s1);
25751 ps2 = PyByteArray_AS_STRING(s2);
25752 #else
25753 char *ps1, *ps2;
25754 if (unlikely(PyBytes_AsStringAndSize(s1, &ps1, &length1) == -1)) return -1;
25755 ps2 = __Pyx_PyByteArray_AsString(s2); if (unlikely(!ps2)) return -1;
25756 length2 = __Pyx_PyByteArray_GET_SIZE(s2); if (unlikely(length2 == -1)) return -1;
25757 short_length = (length1 < length2) ? length1 : length2;
25758 if (short_length == 0) {
25759 if (length1 == 0) goto __pyx_return_true; else goto __pyx_return_false;
25760 }
25761 #endif
25762 cmp = (Py_ssize_t) ((const unsigned char*) ps1)[0] - (Py_ssize_t) ((const unsigned char*) ps2)[0];
25763 if (cmp == 0 && short_length > 1) {
25764 cmp = memcmp(ps1, ps2, (size_t)short_length);
25765 }
25766 if (cmp == 0) cmp = (length1 - length2);
25767 if (cmp < 0) goto __pyx_return_true; else goto __pyx_return_false;
25768__pyx_return_true:
25769 return 1;
25770__pyx_return_false:
25771 return 0;
25772}
25773#endif
25774#endif
25775#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
25776#ifndef __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesBoolLt
25777#define __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesBoolLt
25778static CYTHON_INLINE int __Pyx_PyObject_ComparePyByteArrayPyBytesBoolLt(PyObject* s1, PyObject* s2) {
25779 Py_ssize_t cmp;
25780 Py_ssize_t length1, length2, short_length;
25781 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
25782 const char *ps1, *ps2;
25783 length1 = __Pyx_PyByteArray_GET_SIZE(s1);
25784 length2 = __Pyx_PyBytes_GET_SIZE(s2);
25785 short_length = (length1 < length2) ? length1 : length2;
25786 if (short_length == 0) {
25787 if (length1 == 0) goto __pyx_return_true; else goto __pyx_return_false;
25788 }
25789 ps1 = PyByteArray_AS_STRING(s1);
25790 ps2 = PyBytes_AS_STRING(s2);
25791 #else
25792 char *ps1, *ps2;
25793 ps1 = __Pyx_PyByteArray_AsString(s1); if (unlikely(!ps1)) return -1;
25794 length1 = __Pyx_PyByteArray_GET_SIZE(s1); if (unlikely(length1 == -1)) return -1;
25795 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1)) return -1;
25796 short_length = (length1 < length2) ? length1 : length2;
25797 if (short_length == 0) {
25798 if (length1 == 0) goto __pyx_return_true; else goto __pyx_return_false;
25799 }
25800 #endif
25801 cmp = (Py_ssize_t) ((const unsigned char*) ps1)[0] - (Py_ssize_t) ((const unsigned char*) ps2)[0];
25802 if (cmp == 0 && short_length > 1) {
25803 cmp = memcmp(ps1, ps2, (size_t)short_length);
25804 }
25805 if (cmp == 0) cmp = (length1 - length2);
25806 if (cmp < 0) goto __pyx_return_true; else goto __pyx_return_false;
25807__pyx_return_true:
25808 return 1;
25809__pyx_return_false:
25810 return 0;
25811}
25812#endif
25813#endif
25814#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
25815#ifndef __Pyx_DEFINED_PyObject_ComparePyByteArrayPyByteArrayBoolLt
25816#define __Pyx_DEFINED_PyObject_ComparePyByteArrayPyByteArrayBoolLt
25817static CYTHON_INLINE int __Pyx_PyObject_ComparePyByteArrayPyByteArrayBoolLt(PyObject* s1, PyObject* s2) {
25818 Py_ssize_t cmp;
25819 Py_ssize_t length1, length2, short_length;
25820 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
25821 const char *ps1, *ps2;
25822 length1 = __Pyx_PyByteArray_GET_SIZE(s1);
25823 length2 = __Pyx_PyByteArray_GET_SIZE(s2);
25824 short_length = (length1 < length2) ? length1 : length2;
25825 if (short_length == 0) {
25826 if (length1 == 0) goto __pyx_return_true; else goto __pyx_return_false;
25827 }
25828 ps1 = PyByteArray_AS_STRING(s1);
25829 ps2 = PyByteArray_AS_STRING(s2);
25830 #else
25831 char *ps1, *ps2;
25832 ps1 = __Pyx_PyByteArray_AsString(s1); if (unlikely(!ps1)) return -1;
25833 length1 = __Pyx_PyByteArray_GET_SIZE(s1); if (unlikely(length1 == -1)) return -1;
25834 ps2 = __Pyx_PyByteArray_AsString(s2); if (unlikely(!ps2)) return -1;
25835 length2 = __Pyx_PyByteArray_GET_SIZE(s2); if (unlikely(length2 == -1)) return -1;
25836 short_length = (length1 < length2) ? length1 : length2;
25837 if (short_length == 0) {
25838 if (length1 == 0) goto __pyx_return_true; else goto __pyx_return_false;
25839 }
25840 #endif
25841 cmp = (Py_ssize_t) ((const unsigned char*) ps1)[0] - (Py_ssize_t) ((const unsigned char*) ps2)[0];
25842 if (cmp == 0 && short_length > 1) {
25843 cmp = memcmp(ps1, ps2, (size_t)short_length);
25844 }
25845 if (cmp == 0) cmp = (length1 - length2);
25846 if (cmp < 0) goto __pyx_return_true; else goto __pyx_return_false;
25847__pyx_return_true:
25848 return 1;
25849__pyx_return_false:
25850 return 0;
25851}
25852#endif
25853#endif
25854#ifndef __Pyx_DEFINED_PyObject_CompareFloatIntBoolLt
25855#define __Pyx_DEFINED_PyObject_CompareFloatIntBoolLt
25856static int __Pyx_PyObject_CompareFloatIntBoolLt(PyObject *op1, PyObject *op2) {
25857 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
25858 #if !CYTHON_ASSUME_SAFE_MACROS
25859 if (unlikely(float_op1 == -1. && PyErr_Occurred())) return -1;
25860 #endif
25861 #if CYTHON_USE_PYLONG_INTERNALS
25862 if (__Pyx_PyLong_IsCompact(op2)) {
25863 Py_ssize_t iop2 = __Pyx_PyLong_CompactValue(op2);
25864 if (float_op1 < ((double)iop2)) goto __pyx_return_true; else goto __pyx_return_false;
25865 }
25866 if (unlikely(!isfinite(float_op1))) {
25867 if (float_op1 < 0.0) goto __pyx_return_true; else goto __pyx_return_false;
25868 } else {
25869 int sign2 = __Pyx_PyLong_Sign(op2);
25870 if (float_op1 >= 0.) {
25871 if (sign2 < 0) goto __pyx_return_false;
25872 if (float_op1 < (double) (1L << PyLong_SHIFT)) goto __pyx_return_true;
25873 } else {
25874 if (sign2 > 0) goto __pyx_return_true;
25875 if (float_op1 > -(double) (1L << PyLong_SHIFT)) goto __pyx_return_false;
25876 }
25877 }
25878 #else
25879 if (unlikely(!isfinite(float_op1))) {
25880 if (float_op1 < 0.0) goto __pyx_return_true; else goto __pyx_return_false;
25881 } else {
25882 int overflow2;
25883 long iop2 = PyLong_AsLongAndOverflow(op2, &overflow2);
25884 if (likely(!overflow2)) {
25885 if ((long long) iop2 >= (1LL << 53)) {
25886 overflow2 = 1;
25887 } else if ((long long) iop2 <= - (1LL << 53)) {
25888 overflow2 = -1;
25889 } else {
25890 if (float_op1 < ((double) iop2)) goto __pyx_return_true; else goto __pyx_return_false;
25891 }
25892 }
25893 if (overflow2 > 0) {
25894 if (float_op1 < ((double) (1LL << 53))) goto __pyx_return_true;
25895 } else {
25896 if (float_op1 > - ((double) (1LL << 53))) goto __pyx_return_false;
25897 }
25898 }
25899 #endif
25900 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_LT);
25901__pyx_return_true:
25902 return 1;
25903__pyx_return_false:
25904 return 0;
25905}
25906#endif
25907#ifndef __Pyx_DEFINED_PyObject_CompareIntFloatBoolLt
25908#define __Pyx_DEFINED_PyObject_CompareIntFloatBoolLt
25909static int __Pyx_PyObject_CompareIntFloatBoolLt(PyObject *op1, PyObject *op2) {
25910 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
25911 #if !CYTHON_ASSUME_SAFE_MACROS
25912 if (unlikely(float_op2 == -1. && PyErr_Occurred())) return -1;
25913 #endif
25914 #if CYTHON_USE_PYLONG_INTERNALS
25915 if (__Pyx_PyLong_IsCompact(op1)) {
25916 Py_ssize_t iop1 = __Pyx_PyLong_CompactValue(op1);
25917 if (((double)iop1) < float_op2) goto __pyx_return_true; else goto __pyx_return_false;
25918 }
25919 if (unlikely(!isfinite(float_op2))) {
25920 if (0.0 < float_op2) goto __pyx_return_true; else goto __pyx_return_false;
25921 } else {
25922 int sign1 = __Pyx_PyLong_Sign(op1);
25923 if (float_op2 >= 0.) {
25924 if (sign1 < 0) goto __pyx_return_true;
25925 if (float_op2 < (double) (1L << PyLong_SHIFT)) goto __pyx_return_false;
25926 } else {
25927 if (sign1 > 0) goto __pyx_return_false;
25928 if (float_op2 > -(double) (1L << PyLong_SHIFT)) goto __pyx_return_true;
25929 }
25930 }
25931 #else
25932 if (unlikely(!isfinite(float_op2))) {
25933 if (0.0 < float_op2) goto __pyx_return_true; else goto __pyx_return_false;
25934 } else {
25935 int overflow1;
25936 long iop1 = PyLong_AsLongAndOverflow(op1, &overflow1);
25937 if (likely(!overflow1)) {
25938 if ((long long) iop1 >= (1LL << 53)) {
25939 overflow1 = 1;
25940 } else if ((long long) iop1 <= - (1LL << 53)) {
25941 overflow1 = -1;
25942 } else {
25943 if (((double) iop1) < float_op2) goto __pyx_return_true; else goto __pyx_return_false;
25944 }
25945 }
25946 if (overflow1 < 0) {
25947 if (float_op2 > ((double) (1LL << 53))) goto __pyx_return_true;
25948 } else {
25949 if (float_op2 < - ((double) (1LL << 53))) goto __pyx_return_false;
25950 }
25951 }
25952 #endif
25953 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_LT);
25954__pyx_return_true:
25955 return 1;
25956__pyx_return_false:
25957 return 0;
25958}
25959#endif
25960#ifndef __Pyx_DEFINED_PyObject_CompareIntIntBoolLt
25961#define __Pyx_DEFINED_PyObject_CompareIntIntBoolLt
25962static int __Pyx_PyObject_CompareIntIntBoolLt(PyObject *op1, PyObject *op2) {
25963#if CYTHON_USE_PYLONG_INTERNALS
25964 Py_ssize_t cmp = __Pyx_PyLong_CompareSignAndSize(op1, op2);
25965 if (cmp == 0) {
25966 Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
25967 if (size > 0) {
25968 const digit* digits1 = __Pyx_PyLong_Digits(op1);
25969 const digit* digits2 = __Pyx_PyLong_Digits(op2);
25970 if (size == 1) {
25971 cmp = (Py_ssize_t) digits1[0] - (Py_ssize_t) digits2[0];
25972 } else if ((size == 2) && (8 * sizeof(Py_ssize_t) >= 2 * PyLong_SHIFT)) {
25973 cmp = (Py_ssize_t) (((((size_t)digits1[1]) << PyLong_SHIFT) | (size_t)digits1[0])) - (Py_ssize_t) (((((size_t)digits2[1]) << PyLong_SHIFT) | (size_t)digits2[0]));
25974 } else {
25975 for (Py_ssize_t i=size-1; i >= 0 && !cmp; --i) {
25976 cmp = (Py_ssize_t) digits1[i] - (Py_ssize_t) digits2[i];
25977 }
25978 }
25979 }
25980 if (cmp == 0) goto __pyx_return_false;
25981 if (__Pyx_PyLong_IsNeg(op1)) cmp = -cmp;
25982 }
25983 if (cmp < 0) goto __pyx_return_true; else goto __pyx_return_false;
25984#else
25985 int overflow1, overflow2;
25986 long long iop1 = PyLong_AsLongLongAndOverflow(op1, &overflow1);
25987 long long iop2 = PyLong_AsLongLongAndOverflow(op2, &overflow2);
25988 if (likely(!(overflow1 | overflow2))) {
25989 if (iop1 < iop2) goto __pyx_return_true; else goto __pyx_return_false;
25990 } else if (overflow1 != overflow2) {
25991 if (overflow1 < overflow2) goto __pyx_return_true; else goto __pyx_return_false;
25992 } else {
25993 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_LT);
25994 }
25995#endif
25996__pyx_return_true:
25997 return 1;
25998__pyx_return_false:
25999 return 0;
26000}
26001#endif
26002static CYTHON_INLINE int __Pyx_PyObject_CompareBoolLt_object_object(PyObject *op1, PyObject *op2, int pyop) {
26003 CYTHON_UNUSED_VAR(pyop);
26004 if (PyFloat_CheckExact(op1)) {
26005 if (PyFloat_CheckExact(op2)) {
26006 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
26007 #if !CYTHON_ASSUME_SAFE_MACROS
26008 if (unlikely(float_op1 == -1. && PyErr_Occurred())) return -1;
26009 #endif
26010 double float_op2 = __Pyx_PyFloat_AS_DOUBLE(op2);
26011 #if !CYTHON_ASSUME_SAFE_MACROS
26012 if (unlikely(float_op2 == -1. && PyErr_Occurred())) return -1;
26013 #endif
26014 if (float_op1 < float_op2) goto __pyx_return_true; else goto __pyx_return_false;
26015 }
26016 if (PyLong_CheckExact(op2)) {
26017 return __Pyx_PyObject_CompareFloatIntBoolLt(op1, op2);
26018 }
26019 goto __pyx_richcmp;
26020 }
26021 if (PyLong_CheckExact(op1)) {
26022 if (op1 == op2) goto __pyx_return_false;
26023 if (PyLong_CheckExact(op2)) {
26024 return __Pyx_PyObject_CompareIntIntBoolLt(op1, op2);
26025 }
26026 if (PyFloat_CheckExact(op2)) {
26027 return __Pyx_PyObject_CompareIntFloatBoolLt(op1, op2);
26028 }
26029 goto __pyx_richcmp;
26030 }
26031
26032 if (PyUnicode_CheckExact(op1)) {
26033 if (op1 == op2) goto __pyx_return_false;
26034 if (PyUnicode_CheckExact(op2)) {
26035 return __Pyx_PyObject_CompareStrStrBoolLt(op1, op2);
26036 }
26037 goto __pyx_richcmp;
26038 }
26039
26040 #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
26041 if (PyBytes_CheckExact(op1)) {
26042 if (op1 == op2) goto __pyx_return_false;
26043 if (PyBytes_CheckExact(op2)) {
26044 return __Pyx_PyObject_ComparePyBytesPyBytesBoolLt(op1, op2);
26045 }
26046 if (PyByteArray_CheckExact(op2)) {
26047 return __Pyx_PyObject_ComparePyBytesPyByteArrayBoolLt(op1, op2);
26048 }
26049 goto __pyx_richcmp;
26050 }
26051 #endif
26052 #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
26053 if (PyByteArray_CheckExact(op1)) {
26054 if (op1 == op2) goto __pyx_return_false;
26055 if (PyByteArray_CheckExact(op2)) {
26056 return __Pyx_PyObject_ComparePyByteArrayPyByteArrayBoolLt(op1, op2);
26057 }
26058 if (PyBytes_CheckExact(op2)) {
26059 return __Pyx_PyObject_ComparePyByteArrayPyBytesBoolLt(op1, op2);
26060 }
26061 goto __pyx_richcmp;
26062 }
26063 #endif
26064 if ((0)) goto __pyx_richcmp;
26065 if ((0)) goto __pyx_return_true;
26066 if ((0)) goto __pyx_return_false;
26067__pyx_richcmp:
26068 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_LT);
26069__pyx_return_true:
26070 return 1;
26071__pyx_return_false:
26072 return 0;
26073}
26074
26075/* PyLongCompare */
26076static CYTHON_INLINE int __Pyx_PyLong_BoolNeObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
26077 CYTHON_MAYBE_UNUSED_VAR(intval);
26078 CYTHON_UNUSED_VAR(inplace);
26079 if (op1 == op2) {
26080 return 0;
26081 }
26082 #if CYTHON_USE_PYLONG_INTERNALS
26083 if (likely(PyLong_CheckExact(op1))) {
26084 int unequal;
26085 unsigned long uintval;
26086 Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
26087 const digit* digits = __Pyx_PyLong_Digits(op1);
26088 if (intval == 0) {
26089 return (__Pyx_PyLong_IsZero(op1) != 1);
26090 } else if (intval < 0) {
26091 if (__Pyx_PyLong_IsNonNeg(op1))
26092 return 1;
26093 intval = -intval;
26094 } else {
26095 if (__Pyx_PyLong_IsNeg(op1))
26096 return 1;
26097 }
26098 uintval = (unsigned long) intval;
26099#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
26100 if (uintval >> (PyLong_SHIFT * 4)) {
26101 unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
26102 | (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));
26103 } else
26104#endif
26105#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
26106 if (uintval >> (PyLong_SHIFT * 3)) {
26107 unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
26108 | (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));
26109 } else
26110#endif
26111#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
26112 if (uintval >> (PyLong_SHIFT * 2)) {
26113 unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
26114 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
26115 } else
26116#endif
26117#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
26118 if (uintval >> (PyLong_SHIFT * 1)) {
26119 unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
26120 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
26121 } else
26122#endif
26123 unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
26124 return (unequal != 0);
26125 }
26126 #endif
26127 if (PyFloat_CheckExact(op1)) {
26128 const long b = intval;
26129 double a = __Pyx_PyFloat_AS_DOUBLE(op1);
26130 return ((double)a != (double)b);
26131 }
26132 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_NE);
26133}
26134
26135/* PyLongBinop */
26136#if !CYTHON_COMPILING_IN_PYPY
26137static PyObject* __Pyx_Fallback___Pyx_PyLong_MultiplyCObj(PyObject *op1, PyObject *op2, int inplace) {
26138 return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2);
26139}
26140#if CYTHON_USE_PYLONG_INTERNALS
26141static PyObject* __Pyx_Unpacked___Pyx_PyLong_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
26142 CYTHON_MAYBE_UNUSED_VAR(inplace);
26143 CYTHON_UNUSED_VAR(zerodivision_check);
26144 const long a = intval;
26145 long b;
26146 const PY_LONG_LONG lla = intval;
26147 PY_LONG_LONG llb;
26148 if (unlikely(__Pyx_PyLong_IsZero(op2))) {
26149 return __Pyx_NewRef(op2);
26150 }
26151 const int is_positive = __Pyx_PyLong_IsPos(op2);
26152 const digit* digits = __Pyx_PyLong_Digits(op2);
26153 const Py_ssize_t size = __Pyx_PyLong_DigitCount(op2);
26154 if (likely(size == 1)) {
26155 b = (long) digits[0];
26156 if (!is_positive) b *= -1;
26157 } else {
26158 if (size == 2 && 8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) {
26159 b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26160 if (!is_positive) b *= -1;
26161 goto calculate_long;
26162 } else if (size == 2 && 8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) {
26163 llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
26164 if (!is_positive) llb *= -1;
26165 goto calculate_long_long;
26166 } else
26167 if (size == 3 && 8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) {
26168 b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26169 if (!is_positive) b *= -1;
26170 goto calculate_long;
26171 } else if (size == 3 && 8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) {
26172 llb = (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]));
26173 if (!is_positive) llb *= -1;
26174 goto calculate_long_long;
26175 } else
26176 if (size == 4 && 8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) {
26177 b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
26178 if (!is_positive) b *= -1;
26179 goto calculate_long;
26180 } else if (size == 4 && 8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) {
26181 llb = (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]));
26182 if (!is_positive) llb *= -1;
26183 goto calculate_long_long;
26184 } else
26185 {}
26186 return PyLong_Type.tp_as_number->nb_multiply(op1, op2);
26187 }
26188 calculate_long:
26189 CYTHON_UNUSED_VAR(a);
26190 CYTHON_UNUSED_VAR(b);
26191 llb = b;
26192 goto calculate_long_long;
26193 calculate_long_long:
26194 {
26195 PY_LONG_LONG llx;
26196 llx = lla * llb;
26197 return PyLong_FromLongLong(llx);
26198 }
26199
26200}
26201#endif
26202static PyObject* __Pyx_Float___Pyx_PyLong_MultiplyCObj(PyObject *float_val, long intval, int zerodivision_check) {
26203 CYTHON_UNUSED_VAR(zerodivision_check);
26204 const long a = intval;
26205 double b = __Pyx_PyFloat_AS_DOUBLE(float_val);
26206 double result;
26207
26208 result = ((double)a) * (double)b;
26209 return PyFloat_FromDouble(result);
26210}
26211static CYTHON_INLINE PyObject* __Pyx_PyLong_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
26212 CYTHON_MAYBE_UNUSED_VAR(intval);
26213 CYTHON_UNUSED_VAR(zerodivision_check);
26214 #if CYTHON_USE_PYLONG_INTERNALS
26215 if (likely(PyLong_CheckExact(op2))) {
26216 return __Pyx_Unpacked___Pyx_PyLong_MultiplyCObj(op1, op2, intval, inplace, zerodivision_check);
26217 }
26218 #endif
26219 if (PyFloat_CheckExact(op2)) {
26220 return __Pyx_Float___Pyx_PyLong_MultiplyCObj(op2, intval, zerodivision_check);
26221 }
26222 return __Pyx_Fallback___Pyx_PyLong_MultiplyCObj(op1, op2, inplace);
26223}
26224#endif
26225
26226/* AllocateExtensionType */
26227static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final) {
26228 if (is_final || likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
26229 allocfunc alloc_func = __Pyx_PyType_GetSlot(t, tp_alloc, allocfunc);
26230 return alloc_func(t, 0);
26231 } else {
26232 newfunc tp_new = __Pyx_PyType_TryGetSlot(&PyBaseObject_Type, tp_new, newfunc);
26233 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
26234 if (!tp_new) {
26235 PyObject *new_str = PyUnicode_FromString("__new__");
26236 if (likely(new_str)) {
26237 PyObject *o = PyObject_CallMethodObjArgs((PyObject *)&PyBaseObject_Type, new_str, t, NULL);
26238 Py_DECREF(new_str);
26239 return o;
26240 } else
26241 return NULL;
26242 } else
26243 #endif
26244 return tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
26245 }
26246}
26247
26248/* CallSlotAsVectorcallUnpackDict (used by CallSlotAsVectorcall) */
26249static CYTHON_INLINE int __Pyx_CallSlotAsVectorcallUnpackDict(Py_ssize_t args_size, PyObject *keys_dict, PyObject **args, PyObject *kwnames) {
26250 Py_ssize_t pos = 0, i = 0;
26251 PyObject *key, *value;
26252 while (PyDict_Next(keys_dict, &pos, &key, &value)) {
26253 Py_INCREF(value);
26254 args[args_size+i] = value;
26255 Py_INCREF(key);
26256 if (unlikely(__Pyx_PyTuple_SET_ITEM(kwnames, i, key) == -1)) {
26257 return -1;
26258 }
26259 ++i;
26260 }
26261 return 0;
26262}
26263
26264/* CallSlotAsVectorcall */
26265#if CYTHON_VECTORCALL_TPNEW
26266static PyObject * __Pyx_CallTpnewAsVectorcall(__Pyx_tpnewvectorcallfunc f, PyTypeObject* o, PyObject *a, PyObject *k) {
26267 Py_ssize_t k_size = k ? __Pyx_PyDict_GET_SIZE(k) : 0;
26268#if !CYTHON_ASSUME_SAFE_SIZE
26269 if (unlikely(k_size < 0)) return NULL;
26270#endif
26271 Py_ssize_t a_size = __Pyx_PyTuple_GET_SIZE(a);
26272#if !CYTHON_ASSUME_SAFE_SIZE
26273 if (unlikely(a_size < 0)) return NULL;
26274#endif
26275#if CYTHON_ASSUME_SAFE_MACROS
26276 if (k_size == 0) {
26277 return f(o, &PyTuple_GET_ITEM(a, 0), a_size, NULL);
26278 }
26279#else
26280 if (k_size == 0 && a_size == 0) {
26281 return f(o, NULL, 0, NULL);
26282 }
26283#endif
26284 PyObject *stack_args[5];
26285 PyObject **args = stack_args;
26286 Py_ssize_t maxnargs = PY_SSIZE_T_MAX / sizeof(PyObject*) - 1;
26287 if (a_size > maxnargs - k_size) {
26288 PyErr_NoMemory();
26289 return NULL;
26290 }
26291 Py_ssize_t total_size = a_size + k_size;
26292 if (total_size > 5) {
26293 args = (PyObject**)PyMem_Malloc(((size_t)total_size)*sizeof(PyObject*));
26294 if (unlikely(!args)) {
26295 PyErr_NoMemory();
26296 return NULL;
26297 }
26298 }
26299 PyObject * result = NULL;
26300 PyObject *kwnames = NULL;
26301 int unpack_dict_result;
26302 Py_ssize_t i = 0;
26303 for (; i < a_size; ++i) {
26304 args[i] = __Pyx_PyTuple_GET_ITEM(a, i);
26305#if !CYTHON_ASSUME_SAFE_MACROS
26306 if (unlikely(!args[i])) goto cleanup;
26307#endif
26308 }
26309#if !CYTHON_ASSUME_SAFE_MACROS
26310 if (k) // There's a specific shortcut earlier for ASSUME_SAFE_MACROS with no keywords
26311#endif
26312 {
26313 kwnames = PyTuple_New(k_size);
26314 if (unlikely(!kwnames)) goto cleanup;
26315 __Pyx_BEGIN_CRITICAL_SECTION(k);
26316 unpack_dict_result = __Pyx_CallSlotAsVectorcallUnpackDict(a_size, k, args, kwnames);
26317 __Pyx_END_CRITICAL_SECTION();
26318 if (unlikely(unpack_dict_result == -1)) goto cleanup;
26319 }
26320 result = f(o, args, a_size, kwnames);
26321 cleanup:
26322 Py_XDECREF(kwnames);
26323 for (i=a_size; i<total_size; ++i) {
26324 Py_XDECREF(args[i]);
26325 }
26326 if (args != stack_args) {
26327 PyMem_Free(args);
26328 }
26329 return result;
26330}
26331#endif
26332
26333/* CallNewInitFromVectorcall */
26334#if CYTHON_VECTORCALL_TPNEW
26335static PyObject *__Pyx_CallNewInitFromVectorcall(PyTypeObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
26336 newfunc tp_new = __Pyx_PyType_GetSlot(t, tp_new, newfunc);
26337 if (unlikely(!tp_new)) {
26338 __Pyx_RaiseErrorWithType(PyExc_TypeError, "cannot create " __Pyx_FMT_TYPENAME " instances", t);
26339 return NULL;
26340 }
26341 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
26342 PyObject *result = NULL, *args_tuple = NULL, *kwds_dict = NULL;
26343 Py_ssize_t kw_size = kwnames ? __Pyx_PyTuple_GET_SIZE(kwnames) : 0;
26344#if !CYTHON_ASSUME_SAFE_SIZE
26345 if (unlikely(kw_size == -1)) {
26346 return NULL;
26347 }
26348#endif
26349 if (kw_size) {
26350 kwds_dict = __Pyx_PyDict_NewPresized(kw_size);
26351 if (unlikely(!kwds_dict)) {
26352 return NULL;
26353 }
26354 for (Py_ssize_t i=0; i<kw_size; ++i) {
26355 PyObject *v = args[nargs + i];
26356 PyObject *k = __Pyx_PyTuple_GET_ITEM(kwnames, i);
26357#if !CYTHON_ASSUME_SAFE_MACROS
26358 if (unlikely(!k)) {
26359 goto end;
26360 }
26361#endif
26362 if (unlikely(PyDict_SetItem(kwds_dict, k, v) < 0)) {
26363 goto end;
26364 }
26365 }
26366 }
26367 if (nargs) {
26368 args_tuple = __Pyx_PyTuple_FromArray(args, nargs);
26369 if (unlikely(!args_tuple)) {
26370 goto end;
26371 }
26372 } else {
26373 args_tuple = __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
26374 }
26375 result = tp_new(t, args_tuple, kwds_dict);
26376 if (unlikely(!result)) {
26377 goto end;
26378 }
26379 if (PyObject_TypeCheck(result, t)) {
26380 initproc tp_init = __Pyx_PyObject_GetSlot(result, tp_init, initproc);
26381 if (tp_init && unlikely(tp_init(result, args_tuple, kwds_dict) < 0)) {
26382 Py_CLEAR(result);
26383 }
26384 }
26385 end:
26386 Py_XDECREF(args_tuple);
26387 Py_XDECREF(kwds_dict);
26388 return result;
26389}
26390#endif
26391
26392/* CallTypeTraverse */
26393#if !CYTHON_USE_TYPE_SPECS
26394#else
26395static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) {
26396 if (!always_call) {
26397 PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
26398 unsigned long flags = PyType_GetFlags(base);
26399 if (flags & Py_TPFLAGS_HEAPTYPE) {
26400 return 0;
26401 }
26402 }
26403 Py_VISIT((PyObject*)Py_TYPE(o));
26404 return 0;
26405}
26406#endif
26407
26408/* PyObjectCallMethod0 (used by PyType_Ready) */
26409static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
26410#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || !CYTHON_COMPILING_IN_LIMITED_API)
26411 return PyObject_VectorcallMethod(method_name, &obj, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
26412#elif CYTHON_COMPILING_IN_LIMITED_API
26413 return PyObject_CallMethodObjArgs(obj, method_name, NULL);
26414#else
26415 return PyObject_CallMethodNoArgs(obj, method_name);
26416#endif
26417}
26418
26419/* GetTypeDictOffset (used by ValidateBasesTuple) */
26420#if !CYTHON_USE_TYPE_SLOTS
26421CYTHON_UNUSED static Py_ssize_t __Pyx_GetTypeDictOffset(PyObject *tp, int require_cython_valid_result) {
26422 PyObject *tp_dictoffset_o;
26423 Py_ssize_t tp_dictoffset;
26424 tp_dictoffset_o = PyObject_GetAttrString(tp, "__dictoffset__");
26425 if (unlikely(!tp_dictoffset_o)) return -1;
26426 tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o);
26427 Py_DECREF(tp_dictoffset_o);
26428 if (unlikely(require_cython_valid_result && tp_dictoffset == 0)) {
26429 PyErr_SetString(
26430 PyExc_TypeError,
26431 "'type' doesn't have a dictoffset");
26432 return -1;
26433 } else if (unlikely(require_cython_valid_result && tp_dictoffset < 0)) {
26434 PyErr_SetString(
26435 PyExc_TypeError,
26436 "'type' has an unexpected negative dictoffset. "
26437 "Please report this as Cython bug");
26438 return -1;
26439 }
26440 return tp_dictoffset;
26441}
26442#endif
26443
26444/* ValidateBasesTuple (used by PyType_Ready) */
26445#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
26446static int __Pyx_validate_bases_tuple(const char *type_name, int has_dictoffset, PyObject *bases) {
26447 Py_ssize_t i, n;
26448#if CYTHON_ASSUME_SAFE_SIZE
26449 n = PyTuple_GET_SIZE(bases);
26450#else
26451 n = PyTuple_Size(bases);
26452 if (unlikely(n < 0)) return -1;
26453#endif
26454 if (!has_dictoffset) {
26455 PyObject *b;
26456#if CYTHON_AVOID_BORROWED_REFS
26457 b = PySequence_GetItem(bases, 0);
26458 if (!b) return -1;
26459#elif CYTHON_ASSUME_SAFE_MACROS
26460 b = PyTuple_GET_ITEM(bases, 0);
26461#else
26462 b = PyTuple_GetItem(bases, 0);
26463 if (!b) return -1;
26464#endif
26465#if CYTHON_USE_TYPE_SLOTS
26466 has_dictoffset = ((PyTypeObject*)b)->tp_dictoffset != 0;
26467#else
26468 Py_ssize_t dictoffset = __Pyx_GetTypeDictOffset(b, 0);
26469 has_dictoffset = dictoffset != 0;
26470#endif
26471#if CYTHON_AVOID_BORROWED_REFS
26472 Py_DECREF(b);
26473#endif
26474#if !CYTHON_USE_TYPE_SLOTS
26475 if (dictoffset == -1 && PyErr_Occurred()) return -1;
26476#endif
26477 }
26478 for (i = 1; i < n; i++)
26479 {
26480 PyTypeObject *b;
26481#if CYTHON_AVOID_BORROWED_REFS
26482 PyObject *b0 = PySequence_GetItem(bases, i);
26483 if (!b0) return -1;
26484#elif CYTHON_ASSUME_SAFE_MACROS
26485 PyObject *b0 = PyTuple_GET_ITEM(bases, i);
26486#else
26487 PyObject *b0 = PyTuple_GetItem(bases, i);
26488 if (!b0) return -1;
26489#endif
26490 b = (PyTypeObject*) b0;
26491 if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
26492 {
26493 __Pyx_RaiseErrorWithType(
26494 PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b);
26495#if CYTHON_AVOID_BORROWED_REFS
26496 Py_DECREF(b0);
26497#endif
26498 return -1;
26499 }
26500 if (!has_dictoffset)
26501 {
26502 Py_ssize_t b_dictoffset = 0;
26503#if CYTHON_USE_TYPE_SLOTS
26504 b_dictoffset = b->tp_dictoffset;
26505#else
26506 b_dictoffset = __Pyx_GetTypeDictOffset((PyObject*)b, 0);
26507 if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
26508#endif
26509 if (b_dictoffset) {
26510 __Pyx_RaiseErrorWithType1(
26511 PyExc_TypeError,
26512 "extension type '%.200s' has no __dict__ slot, "
26513 "but base type '" __Pyx_FMT_TYPENAME "' has: "
26514 "either add 'cdef dict __dict__' to the extension type "
26515 "or add '__slots__ = [...]' to the base type",
26516 type_name, b);
26517#if !CYTHON_USE_TYPE_SLOTS
26518 dictoffset_return:
26519#endif
26520#if CYTHON_AVOID_BORROWED_REFS
26521 Py_DECREF(b0);
26522#endif
26523 return -1;
26524 }
26525 }
26526#if CYTHON_AVOID_BORROWED_REFS
26527 Py_DECREF(b0);
26528#endif
26529 }
26530 return 0;
26531}
26532#endif
26533
26534/* PyType_Ready */
26535CYTHON_UNUSED static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) {
26536 while (t) {
26537 PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
26538 if (bases) {
26539 return 1;
26540 }
26541 t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*);
26542 }
26543 return 0;
26544}
26545static int __Pyx_PyType_Ready(PyTypeObject *t) {
26546#if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON
26547 (void)__Pyx_PyObject_CallMethod0;
26548#if CYTHON_USE_TYPE_SPECS
26549 (void)__Pyx_validate_bases_tuple;
26550#endif
26551 return PyType_Ready(t);
26552#else
26553 int r;
26554 if (!__Pyx_PyType_HasMultipleInheritance(t)) {
26555 return PyType_Ready(t);
26556 }
26557 PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
26558 if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset != 0, bases) == -1))
26559 return -1;
26560 {
26561 int gc_was_enabled;
26562 #if PY_VERSION_HEX >= 0x030A00b1
26563 gc_was_enabled = PyGC_Disable();
26564 (void)__Pyx_PyObject_CallMethod0;
26565 #else
26566 PyObject *ret, *py_status;
26567 PyObject *gc = NULL;
26568 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\
26569 !CYTHON_COMPILING_IN_GRAAL
26570 gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc);
26571 #endif
26572 if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc);
26573 if (unlikely(!gc)) return -1;
26574 py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled);
26575 if (unlikely(!py_status)) {
26576 Py_DECREF(gc);
26577 return -1;
26578 }
26579 gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
26580 Py_DECREF(py_status);
26581 if (gc_was_enabled > 0) {
26582 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable);
26583 if (unlikely(!ret)) {
26584 Py_DECREF(gc);
26585 return -1;
26586 }
26587 Py_DECREF(ret);
26588 } else if (unlikely(gc_was_enabled == -1)) {
26589 Py_DECREF(gc);
26590 return -1;
26591 }
26592 #endif
26593 t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
26594#if PY_VERSION_HEX >= 0x030A0000
26595 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
26596#endif
26597 r = PyType_Ready(t);
26598 t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
26599 #if PY_VERSION_HEX >= 0x030A00b1
26600 if (gc_was_enabled)
26601 PyGC_Enable();
26602 #else
26603 if (gc_was_enabled) {
26604 PyObject *tp, *v, *tb;
26605 PyErr_Fetch(&tp, &v, &tb);
26606 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable);
26607 if (likely(ret || r == -1)) {
26608 Py_XDECREF(ret);
26609 PyErr_Restore(tp, v, tb);
26610 } else {
26611 Py_XDECREF(tp);
26612 Py_XDECREF(v);
26613 Py_XDECREF(tb);
26614 r = -1;
26615 }
26616 }
26617 Py_DECREF(gc);
26618 #endif
26619 }
26620 return r;
26621#endif
26622}
26623
26624/* TypeImport */
26625#ifndef __PYX_HAVE_RT_ImportType_3_3_0
26626#define __PYX_HAVE_RT_ImportType_3_3_0
26627static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject *module, const char *module_name, const char *class_name,
26628 size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_3_0 check_size)
26629{
26630 PyObject *result = 0;
26631 Py_ssize_t basicsize;
26632 Py_ssize_t itemsize;
26633#if defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API)
26634 PyObject *py_basicsize;
26635 PyObject *py_itemsize;
26636#endif
26637 result = PyObject_GetAttrString(module, class_name);
26638 if (!result)
26639 goto bad;
26640 if (!PyType_Check(result)) {
26641 PyErr_Format(PyExc_TypeError,
26642 "%.200s.%.200s is not a type object",
26643 module_name, class_name);
26644 goto bad;
26645 }
26646#if !( defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API) )
26647 basicsize = ((PyTypeObject *)result)->tp_basicsize;
26648 itemsize = ((PyTypeObject *)result)->tp_itemsize;
26649#else
26650 if (size == 0) {
26651 return (PyTypeObject *)result;
26652 }
26653 py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
26654 if (!py_basicsize)
26655 goto bad;
26656 basicsize = PyLong_AsSsize_t(py_basicsize);
26657 Py_DECREF(py_basicsize);
26658 py_basicsize = 0;
26659 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
26660 goto bad;
26661 py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
26662 if (!py_itemsize)
26663 goto bad;
26664 itemsize = PyLong_AsSsize_t(py_itemsize);
26665 Py_DECREF(py_itemsize);
26666 py_itemsize = 0;
26667 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
26668 goto bad;
26669#endif
26670 if (itemsize) {
26671 if (size % alignment) {
26672 alignment = size % alignment;
26673 }
26674 if (itemsize < (Py_ssize_t)alignment)
26675 itemsize = (Py_ssize_t)alignment;
26676 }
26677 if ((size_t)(basicsize + itemsize) < size) {
26678 PyErr_Format(PyExc_ValueError,
26679 "%.200s.%.200s size changed, may indicate binary incompatibility. "
26680 "Expected %zd from C header, got %zd from PyObject",
26681 module_name, class_name, size, basicsize+itemsize);
26682 goto bad;
26683 }
26684 if (check_size == __Pyx_ImportType_CheckSize_Error_3_3_0 &&
26685 ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
26686 PyErr_Format(PyExc_ValueError,
26687 "%.200s.%.200s size changed, may indicate binary incompatibility. "
26688 "Expected %zd from C header, got %zd-%zd from PyObject",
26689 module_name, class_name, size, basicsize, basicsize+itemsize);
26690 goto bad;
26691 }
26692 else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_3_0 && (size_t)basicsize > size) {
26693 if (PyErr_WarnFormat(NULL, 0,
26694 "%.200s.%.200s size changed, may indicate binary incompatibility. "
26695 "Expected %zd from C header, got %zd from PyObject",
26696 module_name, class_name, size, basicsize) < 0) {
26697 goto bad;
26698 }
26699 }
26700 return (PyTypeObject *)result;
26701bad:
26702 Py_XDECREF(result);
26703 return NULL;
26704}
26705#endif
26706
26707/* Py3UpdateBases */
26708static PyObject*
26709__Pyx_PEP560_update_bases(PyObject *bases)
26710{
26711 Py_ssize_t i, j, size_bases;
26712 PyObject *base = NULL, *meth, *new_base, *result, *new_bases = NULL;
26713#if CYTHON_ASSUME_SAFE_SIZE
26714 size_bases = PyTuple_GET_SIZE(bases);
26715#else
26716 size_bases = PyTuple_Size(bases);
26717 if (size_bases < 0) return NULL;
26718#endif
26719 for (i = 0; i < size_bases; i++) {
26720#if CYTHON_AVOID_BORROWED_REFS
26721 Py_CLEAR(base);
26722#endif
26723#if CYTHON_ASSUME_SAFE_MACROS
26724 base = PyTuple_GET_ITEM(bases, i);
26725#else
26726 base = PyTuple_GetItem(bases, i);
26727 if (!base) goto error;
26728#endif
26729#if CYTHON_AVOID_BORROWED_REFS
26730 Py_INCREF(base);
26731#endif
26732 if (PyType_Check(base)) {
26733 if (new_bases) {
26734 if (PyList_Append(new_bases, base) < 0) {
26735 goto error;
26736 }
26737 }
26738 continue;
26739 }
26740 meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_mstate_global->__pyx_n_u_mro_entries);
26741 if (!meth && PyErr_Occurred()) {
26742 goto error;
26743 }
26744 if (!meth) {
26745 if (new_bases) {
26746 if (PyList_Append(new_bases, base) < 0) {
26747 goto error;
26748 }
26749 }
26750 continue;
26751 }
26752 new_base = __Pyx_PyObject_CallOneArg(meth, bases);
26753 Py_DECREF(meth);
26754 if (!new_base) {
26755 goto error;
26756 }
26757 if (!PyTuple_Check(new_base)) {
26758 PyErr_SetString(PyExc_TypeError,
26759 "__mro_entries__ must return a tuple");
26760 Py_DECREF(new_base);
26761 goto error;
26762 }
26763 if (!new_bases) {
26764 if (!(new_bases = PyList_New(i))) {
26765 goto error;
26766 }
26767 for (j = 0; j < i; j++) {
26768 PyObject *base_from_list;
26769#if CYTHON_ASSUME_SAFE_MACROS
26770 base_from_list = PyTuple_GET_ITEM(bases, j);
26771 PyList_SET_ITEM(new_bases, j, base_from_list);
26772 Py_INCREF(base_from_list);
26773#else
26774 base_from_list = PyTuple_GetItem(bases, j);
26775 if (!base_from_list) goto error;
26776 Py_INCREF(base_from_list);
26777 if (PyList_SetItem(new_bases, j, base_from_list) < 0) goto error;
26778#endif
26779 }
26780 }
26781#if CYTHON_ASSUME_SAFE_SIZE
26782 j = PyList_GET_SIZE(new_bases);
26783#else
26784 j = PyList_Size(new_bases);
26785 if (j < 0) goto error;
26786#endif
26787 if (PyList_SetSlice(new_bases, j, j, new_base) < 0) {
26788 goto error;
26789 }
26790 Py_DECREF(new_base);
26791 }
26792 if (!new_bases) {
26793 Py_INCREF(bases);
26794 return bases;
26795 }
26796 result = PyList_AsTuple(new_bases);
26797 Py_DECREF(new_bases);
26798#if CYTHON_AVOID_BORROWED_REFS
26799 Py_XDECREF(base);
26800#endif
26801 return result;
26802error:
26803 Py_XDECREF(new_bases);
26804#if CYTHON_AVOID_BORROWED_REFS
26805 Py_XDECREF(base);
26806#endif
26807 return NULL;
26808}
26809
26810/* CalculateMetaclass */
26811static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
26812 Py_ssize_t i, nbases;
26813#if CYTHON_ASSUME_SAFE_SIZE
26814 nbases = PyTuple_GET_SIZE(bases);
26815#else
26816 nbases = PyTuple_Size(bases);
26817 if (nbases < 0) return NULL;
26818#endif
26819 for (i=0; i < nbases; i++) {
26820 PyTypeObject *tmptype;
26821#if CYTHON_ASSUME_SAFE_MACROS
26822 PyObject *tmp = PyTuple_GET_ITEM(bases, i);
26823#else
26824 PyObject *tmp = PyTuple_GetItem(bases, i);
26825 if (!tmp) return NULL;
26826#endif
26827 tmptype = Py_TYPE(tmp);
26828 if (!metaclass) {
26829 metaclass = tmptype;
26830 continue;
26831 }
26832 if (PyType_IsSubtype(metaclass, tmptype))
26833 continue;
26834 if (PyType_IsSubtype(tmptype, metaclass)) {
26835 metaclass = tmptype;
26836 continue;
26837 }
26838 PyErr_SetString(PyExc_TypeError,
26839 "metaclass conflict: "
26840 "the metaclass of a derived class "
26841 "must be a (non-strict) subclass "
26842 "of the metaclasses of all its bases");
26843 return NULL;
26844 }
26845 if (!metaclass) {
26846 metaclass = &PyType_Type;
26847 }
26848 Py_INCREF((PyObject*) metaclass);
26849 return (PyObject*) metaclass;
26850}
26851
26852/* dict_setdefault (used by FetchCommonType) */
26853static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
26854 PyObject* value;
26855#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
26856 PyDict_SetDefaultRef(d, key, default_value, &value);
26857#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
26858 PyObject *args[] = {d, key, default_value};
26859 value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
26860#elif CYTHON_COMPILING_IN_LIMITED_API
26861 value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
26862#else
26863 value = PyDict_SetDefault(d, key, default_value);
26864 if (unlikely(!value)) return NULL;
26865 Py_INCREF(value);
26866#endif
26867 return value;
26868}
26869
26870/* AddModuleRef (used by FetchSharedCythonModule) */
26871#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3
26872 static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
26873 PyObject *module_dict = PyImport_GetModuleDict();
26874 PyObject *m;
26875 if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
26876 return NULL;
26877 }
26878 if (m != NULL && PyModule_Check(m)) {
26879 return m;
26880 }
26881 Py_XDECREF(m);
26882 m = PyModule_NewObject(name);
26883 if (m == NULL)
26884 return NULL;
26885 if (PyDict_CheckExact(module_dict)) {
26886 PyObject *new_m;
26887 (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
26888 Py_DECREF(m);
26889 return new_m;
26890 } else {
26891 if (PyObject_SetItem(module_dict, name, m) != 0) {
26892 Py_DECREF(m);
26893 return NULL;
26894 }
26895 return m;
26896 }
26897 }
26898 static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
26899 if ((PY_VERSION_HEX >= 0x030E0000) && Py_Version >= 0x030E0100) {
26900 return PyImport_AddModuleRef(name);
26901 }
26902 PyObject *py_name = PyUnicode_FromString(name);
26903 if (!py_name) return NULL;
26904 PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
26905 Py_DECREF(py_name);
26906 return module;
26907 }
26908#elif __PYX_LIMITED_VERSION_HEX < 0x030d0000
26909 static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
26910 PyObject *module = PyImport_AddModule(name);
26911 Py_XINCREF(module);
26912 return module;
26913 }
26914#endif
26915
26916/* FetchSharedCythonModule (used by FetchCommonType) */
26917static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
26918 return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
26919}
26920
26921/* VerifyCachedType (used by FetchCommonType) */
26922static int __Pyx_VerifyCachedType(PyObject *cached_type,
26923 const char *name,
26924 Py_ssize_t expected_basicsize) {
26925 Py_ssize_t basicsize;
26926 if (!PyType_Check(cached_type)) {
26927 PyErr_Format(PyExc_TypeError,
26928 "Shared Cython type %.200s is not a type object", name);
26929 return -1;
26930 }
26931 if (expected_basicsize == 0) {
26932 return 0; // size is inherited, nothing useful to check
26933 }
26934#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_OPAQUE_OBJECTS
26935 if (expected_basicsize < 0) {
26936 basicsize = PyType_GetTypeDataSize((PyTypeObject*)cached_type);
26937 } else
26938#endif
26939 {
26940 #if CYTHON_COMPILING_IN_LIMITED_API
26941 PyObject *py_basicsize;
26942 py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
26943 if (unlikely(!py_basicsize)) return -1;
26944 basicsize = PyLong_AsSsize_t(py_basicsize);
26945 Py_DECREF(py_basicsize);
26946 py_basicsize = NULL;
26947 if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1;
26948 #else
26949 basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
26950 #endif
26951 }
26952 if ((expected_basicsize >= 0) ?
26953 (basicsize != expected_basicsize) :
26954 (basicsize < -expected_basicsize)) {
26955 PyErr_Format(PyExc_TypeError,
26956 "Shared Cython type %.200s has the wrong size, try recompiling",
26957 name);
26958 return -1;
26959 }
26960 return 0;
26961}
26962
26963/* FetchCommonType (used by CommonTypesMetaclass) */
26964#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
26965static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
26966 PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
26967 if (result && metaclass) {
26968 PyObject *old_tp = (PyObject*)Py_TYPE(result);
26969 Py_INCREF((PyObject*)metaclass);
26970 Py_SET_TYPE(result, metaclass);
26971 Py_DECREF(old_tp);
26972 PyType_Modified((PyTypeObject*)result);
26973 }
26974 return result;
26975}
26976#else
26977#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
26978#endif
26979static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
26980 PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
26981 int get_item_ref_result;
26982 const char* object_name = strrchr(spec->name, '.');
26983 object_name = object_name ? object_name+1 : spec->name;
26984 py_object_name = PyUnicode_FromString(object_name);
26985 if (!py_object_name) return NULL;
26986 abi_module = __Pyx_FetchSharedCythonABIModule();
26987 if (!abi_module) goto done;
26988 abi_module_dict = PyModule_GetDict(abi_module);
26989 if (!abi_module_dict) goto done;
26990 get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
26991 if (get_item_ref_result == 1) {
26992 if (__Pyx_VerifyCachedType(
26993 cached_type,
26994 object_name,
26995 spec->basicsize) < 0) {
26996 goto bad;
26997 }
26998 goto done;
26999 } else if (unlikely(get_item_ref_result == -1)) {
27000 goto bad;
27001 }
27002 cached_type = __Pyx_PyType_FromMetaclass(
27003 metaclass,
27004 CYTHON_USE_MODULE_STATE ? module : abi_module,
27005 spec, bases);
27006 if (unlikely(!cached_type)) goto bad;
27007 new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type);
27008 if (unlikely(new_cached_type != cached_type)) {
27009 if (unlikely(!new_cached_type)) goto bad;
27010 Py_DECREF(cached_type);
27011 cached_type = new_cached_type;
27012 if (__Pyx_VerifyCachedType(
27013 cached_type,
27014 object_name,
27015 spec->basicsize) < 0) {
27016 goto bad;
27017 }
27018 goto done;
27019 } else {
27020 Py_DECREF(new_cached_type);
27021 }
27022done:
27023 Py_XDECREF(abi_module);
27024 Py_DECREF(py_object_name);
27025 assert(cached_type == NULL || PyType_Check(cached_type));
27026 return (PyTypeObject *) cached_type;
27027bad:
27028 Py_XDECREF(cached_type);
27029 cached_type = NULL;
27030 goto done;
27031}
27032
27033/* CommonTypesMetaclass (used by CythonFunctionShared) */
27034static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
27035 return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
27036}
27037#if __PYX_LIMITED_VERSION_HEX < 0x030A0000
27038static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) {
27039 PyErr_SetString(PyExc_TypeError, "Cannot instantiate Cython internal types");
27040 return NULL;
27041}
27042static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) {
27043 PyErr_SetString(PyExc_TypeError, "Cython internal types are immutable");
27044 return -1;
27045}
27046#endif
27047static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
27048 {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
27049 {0, 0, 0, 0, 0}
27050};
27051static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
27052 {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset},
27053 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
27054 {Py_tp_call, (void*)__pyx_CommonTypesMetaclass_call},
27055 {Py_tp_new, (void*)__pyx_CommonTypesMetaclass_call},
27056 {Py_tp_setattro, (void*)__pyx_CommonTypesMetaclass_setattr},
27057 #endif
27058 {0, 0}
27059};
27060static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
27061 __PYX_TYPE_MODULE_PREFIX "_common_types_metatype",
27062 0,
27063 0,
27064 Py_TPFLAGS_IMMUTABLETYPE |
27065 Py_TPFLAGS_DISALLOW_INSTANTIATION |
27066 Py_TPFLAGS_DEFAULT,
27067 __pyx_CommonTypesMetaclass_slots
27068};
27069static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
27070 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
27071 PyObject *bases = PyTuple_Pack(1, &PyType_Type);
27072 if (unlikely(!bases)) {
27073 return -1;
27074 }
27075 mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
27076 Py_DECREF(bases);
27077 if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
27078 return -1;
27079 }
27080 return 0;
27081}
27082
27083/* CythonFunctionPerModule (used by CythonFunctionShared) */
27084#if CYTHON_COMPILING_IN_LIMITED_API
27085static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) {
27086 if (__Pyx_CyFunction_Check(func)) {
27087 return __Pyx_as_CyFunctionObject(func)->func_methoddef->ml_meth == (PyCFunction) cfunc;
27088 } else if (PyCFunction_Check(func)) {
27089 return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
27090 }
27091 return 0;
27092}
27093static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
27094 if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
27095 int result;
27096 PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
27097 if (unlikely(!newFunc)) {
27098 PyErr_Clear(); // It's only an optimization, so don't throw an error
27099 return 0;
27100 }
27101 result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
27102 Py_DECREF(newFunc);
27103 return result;
27104 }
27105 return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
27106}
27107#else
27108static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
27109 if (PyMethod_Check(func)) {
27110 func = PyMethod_GET_FUNCTION(func);
27111 }
27112 return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
27113}
27114#endif
27115static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
27116#if CYTHON_COMPILING_IN_LIMITED_API
27117 __Pyx_Py_XDECREF_SET(
27118 __Pyx__CyFunction_GetClassObj(f),
27119 ((classobj) ? __Pyx_NewRef(classobj) : NULL));
27120#else
27121 __Pyx_Py_XDECREF_SET(
27122 ((PyCMethodObject *) (f))->mm_class,
27123 (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
27124#endif
27125}
27126static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
27127 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
27128 m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type);
27129 if (unlikely(!m->defaults))
27130 return NULL;
27131 return m->defaults;
27132}
27133static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
27134 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
27135 m->defaults_tuple = tuple;
27136 Py_INCREF(tuple);
27137}
27138static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
27139 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
27140 m->defaults_kwdict = dict;
27141 Py_INCREF(dict);
27142}
27143static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
27144 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
27145 m->func_annotations = dict;
27146 Py_INCREF(dict);
27147}
27148
27149/* PyMethodNew (used by CythonFunctionShared) */
27150#if CYTHON_COMPILING_IN_LIMITED_API
27151static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
27152 PyObject *result;
27153 CYTHON_UNUSED_VAR(typ);
27154 if (!self)
27155 return __Pyx_NewRef(func);
27156 #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
27157 {
27158 PyObject *args[] = {func, self};
27159 result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
27160 }
27161 #else
27162 result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
27163 #endif
27164 return result;
27165}
27166#else
27167static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
27168 CYTHON_UNUSED_VAR(typ);
27169 if (!self)
27170 return __Pyx_NewRef(func);
27171 return PyMethod_New(func, self);
27172}
27173#endif
27174
27175/* PyVectorcallFastCallDict (used by CythonFunctionShared) */
27176#if CYTHON_VECTORCALL
27177static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
27178{
27179 PyObject *res = NULL;
27180 PyObject *kwnames;
27181 PyObject **newargs;
27182 PyObject **kwvalues;
27183 Py_ssize_t i;
27184 #if CYTHON_AVOID_BORROWED_REFS
27185 PyObject *pos;
27186 #else
27187 Py_ssize_t pos;
27188 #endif
27189 size_t j;
27190 PyObject *key, *value;
27191 unsigned long keys_are_strings;
27192 #if !CYTHON_ASSUME_SAFE_SIZE
27193 Py_ssize_t nkw = PyDict_Size(kw);
27194 if (unlikely(nkw == -1)) return NULL;
27195 #else
27196 Py_ssize_t nkw = PyDict_GET_SIZE(kw);
27197 #endif
27198 newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
27199 if (unlikely(newargs == NULL)) {
27200 PyErr_NoMemory();
27201 return NULL;
27202 }
27203 for (j = 0; j < nargs; j++) newargs[j] = args[j];
27204 kwnames = PyTuple_New(nkw);
27205 if (unlikely(kwnames == NULL)) {
27206 PyMem_Free(newargs);
27207 return NULL;
27208 }
27209 kwvalues = newargs + nargs;
27210 pos = 0;
27211 i = 0;
27212 keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
27213 while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) {
27214 keys_are_strings &=
27215 #if CYTHON_COMPILING_IN_LIMITED_API
27216 PyType_GetFlags(Py_TYPE(key));
27217 #else
27218 Py_TYPE(key)->tp_flags;
27219 #endif
27220 #if !CYTHON_ASSUME_SAFE_MACROS
27221 if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup;
27222 #else
27223 PyTuple_SET_ITEM(kwnames, i, key);
27224 #endif
27225 kwvalues[i] = value;
27226 i++;
27227 }
27228 if (unlikely(!keys_are_strings)) {
27229 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
27230 goto cleanup;
27231 }
27232 res = vc(func, newargs, nargs, kwnames);
27233cleanup:
27234 #if CYTHON_AVOID_BORROWED_REFS
27235 Py_DECREF(pos);
27236 #endif
27237 Py_DECREF(kwnames);
27238 for (i = 0; i < nkw; i++)
27239 Py_DECREF(kwvalues[i]);
27240 PyMem_Free(newargs);
27241 return res;
27242}
27243static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
27244{
27245 Py_ssize_t kw_size =
27246 likely(kw == NULL) ?
27247 0 :
27248#if !CYTHON_ASSUME_SAFE_SIZE
27249 PyDict_Size(kw);
27250#else
27251 PyDict_GET_SIZE(kw);
27252#endif
27253 if (kw_size == 0) {
27254 return vc(func, args, nargs, NULL);
27255 }
27256#if !CYTHON_ASSUME_SAFE_SIZE
27257 else if (unlikely(kw_size == -1)) {
27258 return NULL;
27259 }
27260#endif
27261 return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
27262}
27263#endif
27264
27265/* CythonFunctionShared (used by CythonFunction) */
27266static PyObject *
27267__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
27268{
27269 if (unlikely(op->func_doc == NULL)) {
27270#if CYTHON_COMPILING_IN_LIMITED_API
27271 const char *doc = op->func_methoddef->ml_doc;
27272#else
27273 const char *doc = ((PyCFunctionObject*)op)->m_ml->ml_doc;
27274#endif
27275 if (doc) {
27276 op->func_doc = PyUnicode_FromString(doc);
27277 if (unlikely(op->func_doc == NULL))
27278 return NULL;
27279 } else {
27280 Py_INCREF(Py_None);
27281 return Py_None;
27282 }
27283 }
27284 Py_INCREF(op->func_doc);
27285 return op->func_doc;
27286}
27287static PyObject *
27288__Pyx_CyFunction_get_doc(PyObject *op_in, void *closure) {
27289 PyObject *result;
27290 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
27291 CYTHON_UNUSED_VAR(closure);
27292 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
27293 result = __Pyx_CyFunction_get_doc_locked(op);
27294 __Pyx_END_CRITICAL_SECTION();
27295 return result;
27296}
27297static int
27298__Pyx_CyFunction_set_doc(PyObject *op_in, PyObject *value, void *context)
27299{
27300 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
27301 CYTHON_UNUSED_VAR(context);
27302 if (value == NULL) {
27303 value = Py_None;
27304 }
27305 Py_INCREF(value);
27306 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
27307 __Pyx_Py_XDECREF_SET(op->func_doc, value);
27308 __Pyx_END_CRITICAL_SECTION();
27309 return 0;
27310}
27311static PyObject *
27312__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
27313{
27314 if (unlikely(op->func_name == NULL)) {
27315#if CYTHON_COMPILING_IN_LIMITED_API
27316 const char *name = op->func_methoddef->ml_name;
27317#else
27318 const char *name = ((PyCFunctionObject*)op)->m_ml->ml_name;
27319#endif
27320 op->func_name = PyUnicode_InternFromString(name);
27321 if (unlikely(op->func_name == NULL))
27322 return NULL;
27323 }
27324 Py_INCREF(op->func_name);
27325 return op->func_name;
27326}
27327static PyObject *
27328__Pyx_CyFunction_get_name(PyObject *op, void *context)
27329{
27330 PyObject *result = NULL;
27331 CYTHON_UNUSED_VAR(context);
27332 __Pyx_BEGIN_CRITICAL_SECTION(op);
27333 result = __Pyx_CyFunction_get_name_locked(__Pyx_as_CyFunctionObject(op));
27334 __Pyx_END_CRITICAL_SECTION();
27335 return result;
27336}
27337static int
27338__Pyx_CyFunction_set_name(PyObject *op_in, PyObject *value, void *context)
27339{
27340 CYTHON_UNUSED_VAR(context);
27341 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
27342 PyErr_SetString(PyExc_TypeError,
27343 "__name__ must be set to a string object");
27344 return -1;
27345 }
27346 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
27347 Py_INCREF(value);
27348 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
27349 __Pyx_Py_XDECREF_SET(op->func_name, value);
27350 __Pyx_END_CRITICAL_SECTION();
27351 return 0;
27352}
27353static PyObject *
27354__Pyx_CyFunction_get_qualname(PyObject *op_in, void *context)
27355{
27356 CYTHON_UNUSED_VAR(context);
27357 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
27358 PyObject *result;
27359 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
27360 Py_INCREF(op->func_qualname);
27361 result = op->func_qualname;
27362 __Pyx_END_CRITICAL_SECTION();
27363 return result;
27364}
27365static int
27366__Pyx_CyFunction_set_qualname(PyObject *op_in, PyObject *value, void *context)
27367{
27368 CYTHON_UNUSED_VAR(context);
27369 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
27370 PyErr_SetString(PyExc_TypeError,
27371 "__qualname__ must be set to a string object");
27372 return -1;
27373 }
27374 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
27375 Py_INCREF(value);
27376 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
27377 __Pyx_Py_XDECREF_SET(op->func_qualname, value);
27378 __Pyx_END_CRITICAL_SECTION();
27379 return 0;
27380}
27381#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
27382static PyObject *
27383__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
27384{
27385 CYTHON_UNUSED_VAR(context);
27386 if (unlikely(op->func_dict == NULL)) {
27387 op->func_dict = PyDict_New();
27388 if (unlikely(op->func_dict == NULL))
27389 return NULL;
27390 }
27391 Py_INCREF(op->func_dict);
27392 return op->func_dict;
27393}
27394#endif
27395static PyObject *
27396__Pyx_CyFunction_get_globals(PyObject *op_in, void *context)
27397{
27398 CYTHON_UNUSED_VAR(context);
27399 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
27400 Py_INCREF(op->func_globals);
27401 return op->func_globals;
27402}
27403static PyObject *
27404__Pyx_CyFunction_get_closure(PyObject *op, void *context)
27405{
27406 CYTHON_UNUSED_VAR(op);
27407 CYTHON_UNUSED_VAR(context);
27408 Py_INCREF(Py_None);
27409 return Py_None;
27410}
27411static PyObject *
27412__Pyx_CyFunction_get_code(PyObject *op_in, void *context)
27413{
27414 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
27415 PyObject* result = (op->func_code) ? op->func_code : Py_None;
27416 CYTHON_UNUSED_VAR(context);
27417 Py_INCREF(result);
27418 return result;
27419}
27420static int
27421__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op, PyObject *op_obj) {
27422 int result = 0;
27423 PyObject *res = op->defaults_getter(op_obj);
27424 if (unlikely(!res))
27425 return -1;
27426 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27427 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
27428 Py_INCREF(op->defaults_tuple);
27429 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
27430 Py_INCREF(op->defaults_kwdict);
27431 #else
27432 op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
27433 if (unlikely(!op->defaults_tuple)) result = -1;
27434 else {
27435 op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
27436 if (unlikely(!op->defaults_kwdict)) result = -1;
27437 }
27438 #endif
27439 Py_DECREF(res);
27440 return result;
27441}
27442static int
27443__Pyx_CyFunction_set_defaults(PyObject *op_in, PyObject* value, void *context) {
27444 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
27445 CYTHON_UNUSED_VAR(context);
27446 if (!value) {
27447 value = Py_None;
27448 } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
27449 PyErr_SetString(PyExc_TypeError,
27450 "__defaults__ must be set to a tuple object");
27451 return -1;
27452 }
27453 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
27454 "currently affect the values used in function calls", 1);
27455 Py_INCREF(value);
27456 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
27457 __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
27458 __Pyx_END_CRITICAL_SECTION();
27459 return 0;
27460}
27461static PyObject *
27462__Pyx_CyFunction_get_defaults_locked(PyObject *op_in) {
27463 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
27464 PyObject* result = op->defaults_tuple;
27465 if (unlikely(!result)) {
27466 if (op->defaults_getter) {
27467 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0)) return NULL;
27468 result = op->defaults_tuple;
27469 } else {
27470 result = Py_None;
27471 }
27472 }
27473 Py_INCREF(result);
27474 return result;
27475}
27476static PyObject *
27477__Pyx_CyFunction_get_defaults(PyObject *op, void *context) {
27478 PyObject* result = NULL;
27479 CYTHON_UNUSED_VAR(context);
27480 __Pyx_BEGIN_CRITICAL_SECTION(op);
27481 result = __Pyx_CyFunction_get_defaults_locked(op);
27482 __Pyx_END_CRITICAL_SECTION();
27483 return result;
27484}
27485static int
27486__Pyx_CyFunction_set_kwdefaults(PyObject *op_in, PyObject* value, void *context) {
27487 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
27488 CYTHON_UNUSED_VAR(context);
27489 if (!value) {
27490 value = Py_None;
27491 } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
27492 PyErr_SetString(PyExc_TypeError,
27493 "__kwdefaults__ must be set to a dict object");
27494 return -1;
27495 }
27496 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
27497 "currently affect the values used in function calls", 1);
27498 Py_INCREF(value);
27499 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
27500 __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
27501 __Pyx_END_CRITICAL_SECTION();
27502 return 0;
27503}
27504static PyObject *
27505__Pyx_CyFunction_get_kwdefaults_locked(PyObject *op_in) {
27506 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
27507 PyObject* result = op->defaults_kwdict;
27508 if (unlikely(!result)) {
27509 if (op->defaults_getter) {
27510 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0)) return NULL;
27511 result = op->defaults_kwdict;
27512 } else {
27513 result = Py_None;
27514 }
27515 }
27516 Py_INCREF(result);
27517 return result;
27518}
27519static PyObject *
27520__Pyx_CyFunction_get_kwdefaults(PyObject *op, void *context) {
27521 PyObject* result;
27522 CYTHON_UNUSED_VAR(context);
27523 __Pyx_BEGIN_CRITICAL_SECTION(op);
27524 result = __Pyx_CyFunction_get_kwdefaults_locked(op);
27525 __Pyx_END_CRITICAL_SECTION();
27526 return result;
27527}
27528static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value);
27529static int
27530__Pyx_CyFunction_set_annotations(PyObject *op_in, PyObject* value, void *context) {
27531 CYTHON_UNUSED_VAR(context);
27532 if (!value || value == Py_None) {
27533 value = NULL;
27534 } else if (unlikely(!PyDict_Check(value))) {
27535 PyErr_SetString(PyExc_TypeError,
27536 "__annotations__ must be set to a dict object");
27537 return -1;
27538 }
27539 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
27540 Py_XINCREF(value);
27541 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
27542 __Pyx_Py_XDECREF_SET(op->func_annotations, value);
27543 __Pyx_END_CRITICAL_SECTION();
27544 if (unlikely(__Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, Py_None) < 0)) return -1;
27545 return 0;
27546}
27547static int
27548__Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) {
27549 /* Return 1 if the function dict exists, 0 otherwise. This cannot fail:
27550 * _PyObject_GetDictPtr() may clear errors internally, but never reports them. */
27551#if CYTHON_COMPILING_IN_PYPY
27552 *dict = PyObject_GenericGetDict(op_in, NULL);
27553#elif CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030C0000
27554 *dict = __Pyx_as_CyFunctionObject(op_in)->func_dict;
27555#else
27556 PyObject **dictptr = _PyObject_GetDictPtr(op_in);
27557 *dict = likely(dictptr) ? *dictptr : NULL;
27558#endif
27559 return *dict ? 1 : 0;
27560}
27561static int
27562__Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) {
27563 PyObject *dict;
27564 int dict_found;
27565 *annotate = NULL;
27566 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
27567 if (!dict_found) return 0;
27568 return __Pyx_PyDict_GetItemRef(dict, __pyx_mstate_global->__pyx_n_u_annotate, annotate);
27569}
27570static int
27571__Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) {
27572 PyObject *dict;
27573 int dict_found;
27574 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
27575 if (!dict_found) return 0;
27576 if (value) {
27577 return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
27578 } else {
27579#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
27580 return PyDict_Pop(dict, __pyx_mstate_global->__pyx_n_u_annotate, NULL);
27581#else
27582 int result = PyDict_Contains(dict, __pyx_mstate_global->__pyx_n_u_annotate);
27583 if (result == 1) {
27584 result = PyDict_DelItem(dict, __pyx_mstate_global->__pyx_n_u_annotate);
27585 }
27586 return result;
27587#endif
27588 }
27589}
27590static int
27591__Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) {
27592 PyObject *dict;
27593 int result;
27594#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
27595 dict = __Pyx_CyFunction_get_dict(__Pyx_as_CyFunctionObject(op_in), NULL);
27596#else
27597 dict = PyObject_GenericGetDict(op_in, NULL);
27598#endif
27599 if (unlikely(!dict)) return -1;
27600 result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
27601 Py_DECREF(dict);
27602 return result;
27603}
27604static PyObject *
27605__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) {
27606 PyObject* result = op->func_annotations;
27607 if (unlikely(!result)) {
27608 result = PyDict_New();
27609 if (unlikely(!result)) return NULL;
27610 op->func_annotations = result;
27611 }
27612 Py_INCREF(result);
27613 return result;
27614}
27615static PyObject *
27616__Pyx_CyFunction_get_annotations(PyObject *op_in, void *context) {
27617 PyObject *annotate = NULL;
27618 PyObject *result = NULL;
27619 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
27620 CYTHON_UNUSED_VAR(context);
27621 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
27622 result = __Pyx_XNewRef(op->func_annotations);
27623 __Pyx_END_CRITICAL_SECTION();
27624 if (result) return result;
27625 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL;
27626 if (!annotate || annotate == Py_None) {
27627 Py_XDECREF(annotate);
27628 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
27629 result = __Pyx_CyFunction_get_annotations_locked(op);
27630 __Pyx_END_CRITICAL_SECTION();
27631 return result;
27632 }
27633 PyObject *format = PyLong_FromLong(1L); // annotationlib.Format.VALUE
27634 if (likely(format)) {
27635 if (!Py_EnterRecursiveCall(" cyfunction __annotations__.__get__")) {
27636 result = __Pyx_PyObject_CallOneArg(annotate, format);
27637 Py_LeaveRecursiveCall();
27638 Py_DECREF(format);
27639 }
27640 }
27641 Py_DECREF(annotate);
27642 if (unlikely(!result)) return NULL;
27643 if (unlikely(!PyDict_Check(result))) {
27644 PyErr_SetString(PyExc_TypeError, "__annotate__ must return a dict");
27645 Py_DECREF(result);
27646 return NULL;
27647 }
27648 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
27649 __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result));
27650 __Pyx_END_CRITICAL_SECTION();
27651 return result;
27652}
27653static PyObject *__Pyx_CyFunction_annotate_impl(PyObject *self, PyObject *arg) {
27654 CYTHON_UNUSED_VAR(arg);
27655 if (unlikely(!self)) {
27656 PyErr_SetString(PyExc_SystemError, "cython __annotate__ called without 'self' argument");
27657 return NULL;
27658 }
27659 PyObject *result;
27660 if (Py_EnterRecursiveCall(" in cyfunction annotate")) {
27661 return NULL;
27662 }
27663 result = __Pyx_CyFunction_get_annotations(self, NULL);
27664 Py_LeaveRecursiveCall();
27665 return result;
27666}
27667static PyObject *
27668__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context);
27669static int
27670__Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value, void *context) {
27671 CYTHON_UNUSED_VAR(context);
27672 if (value == NULL) {
27673 PyErr_SetString(PyExc_TypeError, "__annotate__ cannot be deleted");
27674 return -1;
27675 }
27676 if (unlikely(value != Py_None && !PyCallable_Check(value))) {
27677 PyErr_SetString(PyExc_TypeError, "__annotate__ must be callable or None");
27678 return -1;
27679 }
27680 if (unlikely(__Pyx_TypeCheck(value, &PyCFunction_Type))) {
27681#if !CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_PYPY
27682 PyCFunction cfunction = PyCFunction_GetFunction(value);
27683 if (unlikely(!cfunction)) return -1;
27684 PyObject *value_self = PyCFunction_GetSelf(value);
27685 if (unlikely(!value_self && PyErr_Occurred())) return -1;
27686#else
27687 PyCFunction cfunction = PyCFunction_GET_FUNCTION(value);
27688 PyObject *value_self = PyCFunction_GET_SELF(value);
27689#endif
27690 if (cfunction == __Pyx_CyFunction_annotate_impl && value_self == op_in) {
27691 return __Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, NULL);
27692 }
27693 }
27694 if (value != Py_None) {
27695 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
27696 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
27697 Py_CLEAR(op->func_annotations);
27698 __Pyx_END_CRITICAL_SECTION();
27699 }
27700 return __Pyx_CyFunction_set_annotate_in_dict(op_in, value);
27701}
27702#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
27703static PyObject *
27704__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
27705 int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
27706 if (is_coroutine) {
27707 PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine;
27708 fromlist = PyList_New(1);
27709 if (unlikely(!fromlist)) return NULL;
27710 Py_INCREF(marker);
27711#if CYTHON_ASSUME_SAFE_MACROS
27712 PyList_SET_ITEM(fromlist, 0, marker);
27713#else
27714 if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
27715 Py_DECREF(fromlist);
27716 return NULL;
27717 }
27718#endif
27719 module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
27720 Py_DECREF(fromlist);
27721 if (unlikely(!module)) {
27722 goto ignore_or_error;
27723 }
27724 is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
27725 Py_DECREF(module);
27726 if (likely(is_coroutine_value)) {
27727 return is_coroutine_value;
27728 }
27729ignore_or_error:
27730 if (!__Pyx_IgnoreException(PyExc_Exception)) {
27731 return NULL;
27732 }
27733 }
27734 return __Pyx_PyBool_FromLong(is_coroutine);
27735}
27736static PyObject *
27737__Pyx_CyFunction_get_is_coroutine(PyObject *op_in, void *context) {
27738 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
27739 PyObject *result;
27740 CYTHON_UNUSED_VAR(context);
27741 if (op->func_is_coroutine) {
27742 return __Pyx_NewRef(op->func_is_coroutine);
27743 }
27744 result = __Pyx_CyFunction_get_is_coroutine_value(op);
27745 if (unlikely(!result))
27746 return NULL;
27747 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
27748 if (op->func_is_coroutine) {
27749 Py_DECREF(result);
27750 result = __Pyx_NewRef(op->func_is_coroutine);
27751 } else {
27752 op->func_is_coroutine = __Pyx_NewRef(result);
27753 }
27754 __Pyx_END_CRITICAL_SECTION();
27755 return result;
27756}
27757#endif
27758static void __Pyx_CyFunction_raise_argument_count_error(PyObject *func, const char* message, Py_ssize_t size) {
27759#if CYTHON_COMPILING_IN_LIMITED_API
27760 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
27761 if (!py_name) return;
27762 PyErr_Format(PyExc_TypeError,
27763 "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
27764 py_name, message, size);
27765 Py_DECREF(py_name);
27766#else
27767 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
27768 PyErr_Format(PyExc_TypeError,
27769 "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
27770 name, message, size);
27771#endif
27772}
27773static void __Pyx_CyFunction_raise_type_error(PyObject *func, const char* message) {
27774#if CYTHON_COMPILING_IN_LIMITED_API
27775 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
27776 if (!py_name) return;
27777 PyErr_Format(PyExc_TypeError,
27778 "%.200S() %s",
27779 py_name, message);
27780 Py_DECREF(py_name);
27781#else
27782 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
27783 PyErr_Format(PyExc_TypeError,
27784 "%.200s() %s",
27785 name, message);
27786#endif
27787}
27788#if CYTHON_COMPILING_IN_LIMITED_API
27789static PyObject *
27790__Pyx_CyFunction_get_module(PyObject *op_in, void *context) {
27791 CYTHON_UNUSED_VAR(context);
27792 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
27793 Py_INCREF(op->func_module);
27794 return op->func_module;
27795}
27796static int
27797__Pyx_CyFunction_set_module(PyObject *op_in, PyObject* value, void *context) {
27798 CYTHON_UNUSED_VAR(context);
27799 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
27800 if (value == NULL) {
27801 value = Py_None;
27802 }
27803 Py_INCREF(value);
27804 PyObject *old = op->func_module;
27805 op->func_module = value;
27806 Py_DECREF(old);
27807 return 0;
27808}
27809#endif
27810static PyGetSetDef __pyx_CyFunction_getsets[] = {
27811 {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
27812 {"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
27813 {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
27814 {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
27815 {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
27816#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
27817 {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
27818 {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
27819#else
27820 {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
27821 {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
27822#endif
27823 {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
27824 {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
27825 {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
27826 {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
27827 {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
27828 {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
27829 {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
27830 {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
27831 {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
27832 {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
27833 {"__annotate__", (getter)__Pyx_CyFunction_get_annotate, (setter)__Pyx_CyFunction_set_annotate, 0, 0},
27834#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
27835 {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
27836#endif
27837#if CYTHON_COMPILING_IN_LIMITED_API
27838 {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
27839#endif
27840 {0, 0, 0, 0, 0}
27841};
27842static PyMemberDef __pyx_CyFunction_members[] = {
27843#if !CYTHON_COMPILING_IN_LIMITED_API
27844 {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
27845#endif
27846#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
27847 {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict),
27848 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
27849#endif
27850#if CYTHON_VECTORCALL
27851#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
27852 {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall),
27853 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
27854#else
27855 {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
27856#endif
27857#if CYTHON_COMPILING_IN_LIMITED_API
27858 {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist),
27859 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
27860#else
27861 {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
27862#endif
27863#endif
27864 {0, 0, 0, 0, 0}
27865};
27866static PyObject *
27867__Pyx_CyFunction_reduce(PyObject *m_in, PyObject *args)
27868{
27869 PyObject *result = NULL;
27870 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
27871 CYTHON_UNUSED_VAR(args);
27872 __Pyx_BEGIN_CRITICAL_SECTION(m_in);
27873 Py_INCREF(m->func_qualname);
27874 result = m->func_qualname;
27875 __Pyx_END_CRITICAL_SECTION();
27876 return result;
27877}
27878static PyMethodDef __pyx_CyFunction_methods[] = {
27879 {"__annotate_cython__", __Pyx_CyFunction_annotate_impl, METH_O,
27880 "Placeholder __annotate__ function to allow 'functools.wraps' to work "
27881 "on Cython functions."},
27882 {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_NOARGS, 0},
27883 {0, 0, 0, 0}
27884};
27885static PyObject *
27886__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context) {
27887 PyObject *annotate = NULL;
27888 CYTHON_UNUSED_VAR(context);
27889 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL;
27890 if (annotate) return annotate;
27891 PyObject *method = PyCFunction_New(
27892 &__pyx_CyFunction_methods[0],
27893 op_in);
27894 return method;
27895}
27896#if CYTHON_COMPILING_IN_LIMITED_API
27897#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
27898#else
27899#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
27900#endif
27901static PyObject *__Pyx_CyFunction_Init(PyObject *op_in,
27902 PyMethodDef *ml, int flags, PyObject* qualname,
27903 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
27904 __pyx_CyFunctionObject* op = __Pyx_as_CyFunctionObject(op_in);
27905#if !CYTHON_COMPILING_IN_LIMITED_API
27906 PyCFunctionObject *cf = (PyCFunctionObject*) op;
27907#endif
27908 if (unlikely(op == NULL))
27909 return NULL;
27910#if CYTHON_COMPILING_IN_LIMITED_API
27911 op->func_methoddef = ml;
27912 Py_INCREF(module);
27913 op->func_module = module;
27914#endif
27915 op->flags = flags;
27916 __Pyx_CyFunction_weakreflist(op) = NULL;
27917#if !CYTHON_COMPILING_IN_LIMITED_API
27918 cf->m_ml = ml;
27919 cf->m_self = (PyObject *) op;
27920#endif
27921 Py_XINCREF(closure);
27922 op->func_closure = closure;
27923#if !CYTHON_COMPILING_IN_LIMITED_API
27924 Py_XINCREF(module);
27925 cf->m_module = module;
27926#endif
27927#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
27928 op->func_dict = NULL;
27929#endif
27930 op->func_name = NULL;
27931 Py_INCREF(qualname);
27932 op->func_qualname = qualname;
27933 op->func_doc = NULL;
27934#if CYTHON_COMPILING_IN_LIMITED_API
27935 op->func_classobj = NULL;
27936#else
27937 ((PyCMethodObject*)op)->mm_class = NULL;
27938#endif
27939 op->func_globals = globals;
27940 Py_INCREF(op->func_globals);
27941 Py_XINCREF(code);
27942 op->func_code = code;
27943 op->defaults = NULL;
27944 op->defaults_tuple = NULL;
27945 op->defaults_kwdict = NULL;
27946 op->defaults_getter = NULL;
27947 op->func_annotations = NULL;
27948#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
27949 op->func_is_coroutine = NULL;
27950#endif
27951#if CYTHON_VECTORCALL
27952 switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
27953 case METH_NOARGS:
27954 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
27955 break;
27956 case METH_O:
27957 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
27958 break;
27959 case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
27960 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
27961 break;
27962 case METH_FASTCALL | METH_KEYWORDS:
27963 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
27964 break;
27965 case METH_VARARGS | METH_KEYWORDS:
27966 __Pyx_CyFunction_func_vectorcall(op) = NULL;
27967 break;
27968 default:
27969 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
27970 Py_DECREF(op_in);
27971 return NULL;
27972 }
27973#endif
27974 return op_in;
27975}
27976static int __Pyx__CyFunction_clear(__pyx_CyFunctionObject *m)
27977{
27978 Py_CLEAR(m->func_closure);
27979#if CYTHON_COMPILING_IN_LIMITED_API
27980 Py_CLEAR(m->func_module);
27981#else
27982 Py_CLEAR(((PyCFunctionObject*)m)->m_module);
27983#endif
27984#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
27985 Py_CLEAR(m->func_dict);
27986#elif PY_VERSION_HEX < 0x030d0000
27987 _PyObject_ClearManagedDict((PyObject*)m);
27988#else
27989 PyObject_ClearManagedDict((PyObject*)m);
27990#endif
27991 Py_CLEAR(m->func_name);
27992 Py_CLEAR(m->func_qualname);
27993 Py_CLEAR(m->func_doc);
27994 Py_CLEAR(m->func_globals);
27995 Py_CLEAR(m->func_code);
27996#if CYTHON_COMPILING_IN_LIMITED_API
27997 Py_CLEAR(m->func_classobj);
27998#else
27999 {
28000 PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
28001 ((PyCMethodObject *) (m))->mm_class = NULL;
28002 Py_XDECREF(cls);
28003 }
28004#endif
28005 Py_CLEAR(m->defaults_tuple);
28006 Py_CLEAR(m->defaults_kwdict);
28007 Py_CLEAR(m->func_annotations);
28008#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
28009 Py_CLEAR(m->func_is_coroutine);
28010#endif
28011 Py_CLEAR(m->defaults);
28012 return 0;
28013}
28014static int
28015__Pyx_CyFunction_clear(PyObject *m)
28016{
28017 return __Pyx__CyFunction_clear(__Pyx_as_CyFunctionObject(m));
28018}
28019static void __Pyx__CyFunction_dealloc(PyObject *m)
28020{
28021 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(m);
28022 if (__Pyx_CyFunction_weakreflist(cyfunc) != NULL)
28023 PyObject_ClearWeakRefs(m);
28024 __Pyx__CyFunction_clear(cyfunc);
28025 __Pyx_PyHeapTypeObject_GC_Del(m);
28026}
28027static void __Pyx_CyFunction_dealloc(PyObject *m)
28028{
28029 PyObject_GC_UnTrack(m);
28030 __Pyx__CyFunction_dealloc(m);
28031}
28032static int __Pyx_CyFunction_traverse(PyObject *m_in, visitproc visit, void *arg)
28033{
28034 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
28035 {
28036 int e = __Pyx_call_type_traverse(m_in, 1, visit, arg);
28037 if (e) return e;
28038 }
28039 Py_VISIT(m->func_closure);
28040#if CYTHON_COMPILING_IN_LIMITED_API
28041 Py_VISIT(m->func_module);
28042#else
28043 Py_VISIT(((PyCFunctionObject*)m)->m_module);
28044#endif
28045#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
28046 Py_VISIT(m->func_dict);
28047#else
28048 {
28049 int e =
28050#if PY_VERSION_HEX < 0x030d0000
28051 _PyObject_VisitManagedDict
28052#else
28053 PyObject_VisitManagedDict
28054#endif
28055 ((PyObject*)m, visit, arg);
28056 if (e != 0) return e;
28057 }
28058#endif
28059 __Pyx_VISIT_CONST(m->func_name);
28060 __Pyx_VISIT_CONST(m->func_qualname);
28061 Py_VISIT(m->func_doc);
28062 Py_VISIT(m->func_globals);
28063 __Pyx_VISIT_CONST(m->func_code);
28064 Py_VISIT(__Pyx__CyFunction_GetClassObj(m));
28065 Py_VISIT(m->defaults_tuple);
28066 Py_VISIT(m->defaults_kwdict);
28067 Py_VISIT(m->func_annotations);
28068#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
28069 Py_VISIT(m->func_is_coroutine);
28070#endif
28071 Py_VISIT(m->defaults);
28072 return 0;
28073}
28074static PyObject*
28075__Pyx_CyFunction_repr(PyObject *op_in)
28076{
28077 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
28078 PyObject *repr;
28079 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
28080 repr = PyUnicode_FromFormat("<cyfunction %U at %p>",
28081 op->func_qualname, (void *)op);
28082 __Pyx_END_CRITICAL_SECTION();
28083 return repr;
28084}
28085static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
28086#if CYTHON_COMPILING_IN_LIMITED_API
28087 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
28088 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
28089 int flags = cyfunc->func_methoddef->ml_flags;
28090#else
28091 PyCFunctionObject* f = (PyCFunctionObject*)func;
28092 PyCFunction meth = f->m_ml->ml_meth;
28093 int flags = f->m_ml->ml_flags;
28094#endif
28095 Py_ssize_t size;
28096 switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
28097 case METH_VARARGS:
28098 if (likely(kw == NULL || PyDict_Size(kw) == 0))
28099 return (*meth)(self, arg);
28100 break;
28101 case METH_VARARGS | METH_KEYWORDS:
28102 return (*(PyCFunctionWithKeywords)(void(*)(void))meth)(self, arg, kw);
28103 case METH_NOARGS:
28104 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
28105#if CYTHON_ASSUME_SAFE_SIZE
28106 size = PyTuple_GET_SIZE(arg);
28107#else
28108 size = PyTuple_Size(arg);
28109 if (unlikely(size < 0)) return NULL;
28110#endif
28111 if (likely(size == 0))
28112 return (*meth)(self, NULL);
28113 __Pyx_CyFunction_raise_argument_count_error(
28114 func,
28115 "takes no arguments", size);
28116 return NULL;
28117 }
28118 break;
28119 case METH_O:
28120 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
28121#if CYTHON_ASSUME_SAFE_SIZE
28122 size = PyTuple_GET_SIZE(arg);
28123#else
28124 size = PyTuple_Size(arg);
28125 if (unlikely(size < 0)) return NULL;
28126#endif
28127 if (likely(size == 1)) {
28128 PyObject *result, *arg0;
28129 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
28130 arg0 = PyTuple_GET_ITEM(arg, 0);
28131 #else
28132 arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
28133 #endif
28134 result = (*meth)(self, arg0);
28135 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
28136 Py_DECREF(arg0);
28137 #endif
28138 return result;
28139 }
28140 __Pyx_CyFunction_raise_argument_count_error(
28141 func,
28142 "takes exactly one argument", size);
28143 return NULL;
28144 }
28145 break;
28146 default:
28147 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
28148 return NULL;
28149 }
28150 __Pyx_CyFunction_raise_type_error(
28151 func, "takes no keyword arguments");
28152 return NULL;
28153}
28154static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
28155 PyObject *result;
28156 result = __Pyx_CyFunction_CallMethod(func, func, arg, kw);
28157 return result;
28158}
28159static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
28160 PyObject *result;
28161 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
28162#if CYTHON_VECTORCALL
28163 __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
28164 if (vc) {
28165#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
28166 return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
28167#else
28168 (void) &__Pyx_PyVectorcall_FastCallDict;
28169 return PyVectorcall_Call(func, args, kw);
28170#endif
28171 }
28172#endif
28173 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
28174 Py_ssize_t argc;
28175 PyObject *new_args;
28176 PyObject *self;
28177#if CYTHON_ASSUME_SAFE_SIZE
28178 argc = PyTuple_GET_SIZE(args);
28179#else
28180 argc = PyTuple_Size(args);
28181 if (unlikely(argc < 0)) return NULL;
28182#endif
28183 new_args = PyTuple_GetSlice(args, 1, argc);
28184 if (unlikely(!new_args))
28185 return NULL;
28186 self = PyTuple_GetItem(args, 0);
28187 if (unlikely(!self)) {
28188 Py_DECREF(new_args);
28189 PyErr_Format(PyExc_TypeError,
28190 "unbound method %.200S() needs an argument",
28191 cyfunc->func_qualname);
28192 return NULL;
28193 }
28194 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
28195 Py_DECREF(new_args);
28196 } else {
28197 result = __Pyx_CyFunction_Call(func, args, kw);
28198 }
28199 return result;
28200}
28201#if CYTHON_VECTORCALL
28202static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(PyObject *func, __pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
28203{
28204 int ret = 0;
28205 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
28206 if (unlikely(nargs < 1)) {
28207 __Pyx_CyFunction_raise_type_error(
28208 func, "needs an argument");
28209 return -1;
28210 }
28211 ret = 1;
28212 }
28213 if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
28214 __Pyx_CyFunction_raise_type_error(
28215 func, "takes no keyword arguments");
28216 return -1;
28217 }
28218 return ret;
28219}
28220static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
28221{
28222 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
28223 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
28224 PyObject *self;
28225#if CYTHON_COMPILING_IN_LIMITED_API
28226 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
28227 if (unlikely(!meth)) return NULL;
28228#else
28229 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
28230#endif
28231 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
28232 case 1:
28233 self = args[0];
28234 args += 1;
28235 nargs -= 1;
28236 break;
28237 case 0:
28238 self = func;
28239 break;
28240 default:
28241 return NULL;
28242 }
28243 if (unlikely(nargs != 0)) {
28244 __Pyx_CyFunction_raise_argument_count_error(
28245 func, "takes no arguments", nargs);
28246 return NULL;
28247 }
28248 return meth(self, NULL);
28249}
28250static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
28251{
28252 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
28253 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
28254 PyObject *self;
28255#if CYTHON_COMPILING_IN_LIMITED_API
28256 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
28257 if (unlikely(!meth)) return NULL;
28258#else
28259 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
28260#endif
28261 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
28262 case 1:
28263 self = args[0];
28264 args += 1;
28265 nargs -= 1;
28266 break;
28267 case 0:
28268 self = func;
28269 break;
28270 default:
28271 return NULL;
28272 }
28273 if (unlikely(nargs != 1)) {
28274 __Pyx_CyFunction_raise_argument_count_error(
28275 func, "takes exactly one argument", nargs);
28276 return NULL;
28277 }
28278 return meth(self, args[0]);
28279}
28280static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
28281{
28282 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
28283 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
28284 PyObject *self;
28285#if CYTHON_COMPILING_IN_LIMITED_API
28286 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
28287 if (unlikely(!meth)) return NULL;
28288#else
28289 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
28290#endif
28291 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
28292 case 1:
28293 self = args[0];
28294 args += 1;
28295 nargs -= 1;
28296 break;
28297 case 0:
28298 self = func;
28299 break;
28300 default:
28301 return NULL;
28302 }
28303 return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames);
28304}
28305static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
28306{
28307 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
28308 PyTypeObject *cls = (PyTypeObject *) __Pyx__CyFunction_GetClassObj(cyfunc);
28309 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
28310 PyObject *self;
28311#if CYTHON_COMPILING_IN_LIMITED_API
28312 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
28313 if (unlikely(!meth)) return NULL;
28314#else
28315 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
28316#endif
28317 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
28318 case 1:
28319 self = args[0];
28320 args += 1;
28321 nargs -= 1;
28322 break;
28323 case 0:
28324 self = func;
28325 break;
28326 default:
28327 return NULL;
28328 }
28329 #if PY_VERSION_HEX < 0x030e00A6
28330 size_t nargs_value = (size_t) nargs;
28331 #else
28332 Py_ssize_t nargs_value = nargs;
28333 #endif
28334 return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, kwnames);
28335}
28336#endif
28337static PyType_Slot __pyx_CyFunctionType_slots[] = {
28338 {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
28339 {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
28340 {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
28341 {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
28342 {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
28343 {Py_tp_methods, (void *)__pyx_CyFunction_methods},
28344 {Py_tp_members, (void *)__pyx_CyFunction_members},
28345 {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
28346 {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
28347 {0, 0},
28348};
28349static PyType_Spec __pyx_CyFunctionType_spec = {
28350 __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
28351 __PYX_SHARED_SIZEOF(__pyx_CyFunctionObject),
28352 0,
28353#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
28354 Py_TPFLAGS_METHOD_DESCRIPTOR |
28355#endif
28356#if CYTHON_VECTORCALL
28357#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
28358 Py_TPFLAGS_HAVE_VECTORCALL |
28359#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
28360 _Py_TPFLAGS_HAVE_VECTORCALL |
28361#endif
28362#endif // CYTHON_VECTORCALL
28363#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
28364 Py_TPFLAGS_MANAGED_DICT |
28365#endif
28366 Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
28367 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
28368 __pyx_CyFunctionType_slots
28369};
28370static int __pyx_CyFunction_init(PyObject *module) {
28371 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
28372 mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
28373 mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
28374 if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
28375 return -1;
28376 }
28377 return 0;
28378}
28379
28380/* CythonFunction */
28381static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
28382 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
28383 (void)&__Pyx_Get_CyFunction_Type;
28384 PyObject *op = __Pyx_CyFunction_Init(
28385 PyObject_GC_New(PyObject, __pyx_mstate_global->__pyx_CyFunctionType),
28386 ml, flags, qualname, closure, module, globals, code
28387 );
28388 if (likely(op)) {
28389 PyObject_GC_Track(op);
28390 }
28391 return op;
28392}
28393static PyTypeObject *__Pyx_Get_CyFunction_Type(void) {
28394 PyTypeObject *tp = __pyx_mstate_global->__pyx_CyFunctionType;
28395 Py_INCREF((PyObject*)tp);
28396 return tp;
28397}
28398
28399/* PyObjectCall2Args (used by Py3ClassCreate) */
28400static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
28401 PyObject *args[3] = {NULL, arg1, arg2};
28402 return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
28403}
28404
28405/* PyObjectLookupSpecial (used by Py3ClassCreate) */
28406#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
28407static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) {
28408 PyObject *res;
28409 PyTypeObject *tp = Py_TYPE(obj);
28410 res = _PyType_Lookup(tp, attr_name);
28411 if (likely(res)) {
28412 descrgetfunc f = Py_TYPE(res)->tp_descr_get;
28413 if (!f) {
28414 Py_INCREF(res);
28415 } else {
28416 res = f(res, obj, (PyObject *)tp);
28417 }
28418 } else if (with_error) {
28419 PyErr_SetObject(PyExc_AttributeError, attr_name);
28420 }
28421 return res;
28422}
28423#endif
28424
28425/* Py3ClassCreate */
28426static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
28427 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
28428 PyObject *ns;
28429 if (metaclass) {
28430 PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_mstate_global->__pyx_n_u_prepare);
28431 if (prep) {
28432 PyObject *pargs[3] = {NULL, name, bases};
28433 ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
28434 Py_DECREF(prep);
28435 } else {
28436 if (unlikely(PyErr_Occurred()))
28437 return NULL;
28438 ns = PyDict_New();
28439 }
28440 } else {
28441 ns = PyDict_New();
28442 }
28443 if (unlikely(!ns))
28444 return NULL;
28445 if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_module, modname) < 0)) goto bad;
28446 if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_qualname, qualname) < 0)) goto bad;
28447 if (unlikely(doc && PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_doc, doc) < 0)) goto bad;
28448 return ns;
28449bad:
28450 Py_DECREF(ns);
28451 return NULL;
28452}
28453static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
28454 PyObject *dict, PyObject *mkw,
28455 int calculate_metaclass, int allow_py2_metaclass) {
28456 PyObject *result;
28457 PyObject *owned_metaclass = NULL;
28458 PyObject *margs[4] = {NULL, name, bases, dict};
28459 if (allow_py2_metaclass) {
28460 owned_metaclass = PyObject_GetItem(dict, __pyx_mstate_global->__pyx_n_u_metaclass);
28461 if (owned_metaclass) {
28462 metaclass = owned_metaclass;
28463 } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
28464 PyErr_Clear();
28465 } else {
28466 return NULL;
28467 }
28468 }
28469 if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
28470 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
28471 Py_XDECREF(owned_metaclass);
28472 if (unlikely(!metaclass))
28473 return NULL;
28474 owned_metaclass = metaclass;
28475 }
28476 result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
28477 Py_XDECREF(owned_metaclass);
28478 return result;
28479}
28480
28481/* CLineInTraceback (used by AddTraceback) */
28482#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
28483#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
28484#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
28485#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
28486#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
28487#else
28488PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
28489 PyObject **dict_ptr = _PyObject_GetDictPtr(o);
28490 return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
28491}
28492#endif
28493static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
28494 PyObject *use_cline = NULL;
28495 PyObject *ptype, *pvalue, *ptraceback;
28496 PyObject *cython_runtime_dict;
28497 CYTHON_MAYBE_UNUSED_VAR(tstate);
28498 if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
28499 return c_line;
28500 }
28501 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
28502 cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
28503 if (likely(cython_runtime_dict)) {
28504 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
28505 use_cline, cython_runtime_dict,
28506 __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
28507 }
28508 if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
28509 c_line = 0;
28510 }
28511 Py_XDECREF(use_cline);
28512 Py_XDECREF(cython_runtime_dict);
28513 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
28514 return c_line;
28515}
28516#endif
28517
28518/* CodeObjectCache (used by AddTraceback) */
28519static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
28520 int start = 0, mid = 0, end = count - 1;
28521 if (end >= 0 && code_line > entries[end].code_line) {
28522 return count;
28523 }
28524 while (start < end) {
28525 mid = start + (end - start) / 2;
28526 if (code_line < entries[mid].code_line) {
28527 end = mid;
28528 } else if (code_line > entries[mid].code_line) {
28529 start = mid + 1;
28530 } else {
28531 return mid;
28532 }
28533 }
28534 if (code_line <= entries[mid].code_line) {
28535 return mid;
28536 } else {
28537 return mid + 1;
28538 }
28539}
28540static __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) {
28541 __Pyx_CachedCodeObjectType* code_object;
28542 int pos;
28543 if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
28544 return NULL;
28545 }
28546 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
28547 if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
28548 return NULL;
28549 }
28550 code_object = code_cache->entries[pos].code_object;
28551 Py_INCREF(code_object);
28552 return code_object;
28553}
28554static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) {
28555#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
28556 (void)__pyx__find_code_object;
28557 return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss.
28558#else
28559 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
28560#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
28561 __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
28562 if (old_count < 0) {
28563 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
28564 return NULL;
28565 }
28566#endif
28567 __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
28568#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
28569 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
28570#endif
28571 return result;
28572#endif
28573}
28574static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object)
28575{
28576 int pos, i;
28577 __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
28578 if (unlikely(!code_line)) {
28579 return;
28580 }
28581 if (unlikely(!entries)) {
28582 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
28583 if (likely(entries)) {
28584 code_cache->entries = entries;
28585 code_cache->max_count = 64;
28586 code_cache->count = 1;
28587 entries[0].code_line = code_line;
28588 entries[0].code_object = code_object;
28589 Py_INCREF(code_object);
28590 }
28591 return;
28592 }
28593 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
28594 if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
28595 __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
28596 entries[pos].code_object = code_object;
28597 Py_INCREF(code_object);
28598 Py_DECREF(tmp);
28599 return;
28600 }
28601 if (code_cache->count == code_cache->max_count) {
28602 int new_max = code_cache->max_count + 64;
28603 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
28604 code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
28605 if (unlikely(!entries)) {
28606 return;
28607 }
28608 code_cache->entries = entries;
28609 code_cache->max_count = new_max;
28610 }
28611 for (i=code_cache->count; i>pos; i--) {
28612 entries[i] = entries[i-1];
28613 }
28614 entries[pos].code_line = code_line;
28615 entries[pos].code_object = code_object;
28616 code_cache->count++;
28617 Py_INCREF(code_object);
28618}
28619static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) {
28620#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
28621 (void)__pyx__insert_code_object;
28622 return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail.
28623#else
28624 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
28625#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
28626 __pyx_nonatomic_int_type expected = 0;
28627 if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
28628 return;
28629 }
28630#endif
28631 __pyx__insert_code_object(code_cache, code_line, code_object);
28632#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
28633 __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
28634#endif
28635#endif
28636}
28637
28638/* AddTraceback */
28639#include "compile.h"
28640#include "frameobject.h"
28641#include "traceback.h"
28642#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
28643 #ifndef Py_BUILD_CORE
28644 #define Py_BUILD_CORE 1
28645 #endif
28646 #include "internal/pycore_frame.h"
28647#endif
28648#if CYTHON_COMPILING_IN_LIMITED_API
28649static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
28650 PyObject *firstlineno, PyObject *name) {
28651 PyObject *replace = NULL;
28652 if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
28653 if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
28654 replace = PyObject_GetAttrString(code, "replace");
28655 if (likely(replace)) {
28656 PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
28657 Py_DECREF(replace);
28658 return result;
28659 }
28660 return NULL;
28661}
28662static void __Pyx_AddTraceback(const char *funcname, int c_line,
28663 int py_line, const char *filename) {
28664 PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
28665 PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
28666 PyObject *exc_type, *exc_value, *exc_traceback;
28667 int success = 0;
28668 if (c_line) {
28669 c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
28670 }
28671 __Pyx_PyErr_FetchException(&exc_type, &exc_value, &exc_traceback);
28672 code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
28673 if (!code_object) {
28674 code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
28675 if (unlikely(!code_object)) goto bad;
28676 py_py_line = PyLong_FromLong(py_line);
28677 if (unlikely(!py_py_line)) goto bad;
28678 if (c_line) {
28679 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
28680 } else {
28681 py_funcname = PyUnicode_FromString(funcname);
28682 }
28683 if (unlikely(!py_funcname)) goto bad;
28684 dict = PyDict_New();
28685 if (unlikely(!dict)) goto bad;
28686 {
28687 PyObject *old_code_object = code_object;
28688 code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
28689 Py_DECREF(old_code_object);
28690 }
28691 if (unlikely(!code_object)) goto bad;
28692 __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
28693 } else {
28694 dict = PyDict_New();
28695 }
28696 getframe = PySys_GetObject("_getframe");
28697 if (unlikely(!getframe)) goto bad;
28698 if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
28699 frame = PyEval_EvalCode(code_object, dict, dict);
28700 if (unlikely(!frame) || frame == Py_None) goto bad;
28701 success = 1;
28702 bad:
28703 __Pyx_PyErr_RestoreException(exc_type, exc_value, exc_traceback);
28704 Py_XDECREF(code_object);
28705 Py_XDECREF(py_py_line);
28706 Py_XDECREF(py_funcname);
28707 Py_XDECREF(dict);
28708 Py_XDECREF(replace);
28709 if (success) {
28710 PyTraceBack_Here(
28711 (struct _frame*)frame);
28712 }
28713 Py_XDECREF(frame);
28714}
28715#else
28716static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
28717 const char *funcname, int c_line,
28718 int py_line, const char *filename) {
28719 PyCodeObject *py_code = NULL;
28720 PyObject *py_funcname = NULL;
28721 if (c_line) {
28722 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
28723 if (!py_funcname) goto bad;
28724 funcname = PyUnicode_AsUTF8(py_funcname);
28725 if (!funcname) goto bad;
28726 }
28727 py_code = PyCode_NewEmpty(filename, funcname, py_line);
28728 Py_XDECREF(py_funcname);
28729 return py_code;
28730bad:
28731 Py_XDECREF(py_funcname);
28732 return NULL;
28733}
28734static void __Pyx_AddTraceback(const char *funcname, int c_line,
28735 int py_line, const char *filename) {
28736 PyCodeObject *py_code = 0;
28737 PyFrameObject *py_frame = 0;
28738 PyThreadState *tstate = __Pyx_PyThreadState_Current;
28739 PyObject *ptype, *pvalue, *ptraceback;
28740 if (c_line) {
28741 c_line = __Pyx_CLineForTraceback(tstate, c_line);
28742 }
28743 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
28744 if (!py_code) {
28745 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
28746 py_code = __Pyx_CreateCodeObjectForTraceback(
28747 funcname, c_line, py_line, filename);
28748 if (!py_code) {
28749 /* If the code object creation fails, then we should clear the
28750 fetched exception references and propagate the new exception */
28751 Py_XDECREF(ptype);
28752 Py_XDECREF(pvalue);
28753 Py_XDECREF(ptraceback);
28754 goto bad;
28755 }
28756 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
28757 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
28758 }
28759 py_frame = PyFrame_New(
28760 tstate, /*PyThreadState *tstate,*/
28761 py_code, /*PyCodeObject *code,*/
28762 __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/
28763 0 /*PyObject *locals*/
28764 );
28765 if (!py_frame) goto bad;
28766 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
28767 PyTraceBack_Here(py_frame);
28768bad:
28769 Py_XDECREF(py_code);
28770 Py_XDECREF(py_frame);
28771}
28772#endif
28773
28774/* CIntFromPyVerify */
28775#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
28776 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
28777#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
28778 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
28779#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
28780 {\
28781 func_type value = func_value;\
28782 if (sizeof(target_type) < sizeof(func_type)) {\
28783 if (unlikely(value != (func_type) (target_type) value)) {\
28784 func_type zero = 0;\
28785 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
28786 return (target_type) -1;\
28787 if (is_unsigned && unlikely(value < zero))\
28788 goto raise_neg_overflow;\
28789 else\
28790 goto raise_overflow;\
28791 }\
28792 }\
28793 return (target_type) value;\
28794 }
28795
28796/* Declarations */
28797#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
28798 #ifdef __cplusplus
28799 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
28800 return ::std::complex< float >(x, y);
28801 }
28802 #else
28803 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
28804 return x + y*(__pyx_t_float_complex)_Complex_I;
28805 }
28806 #endif
28807#else
28808 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
28809 __pyx_t_float_complex z;
28810 z.real = x;
28811 z.imag = y;
28812 return z;
28813 }
28814#endif
28815
28816/* Arithmetic */
28817#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
28818#else
28819 static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28820 return (a.real == b.real) && (a.imag == b.imag);
28821 }
28822 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28823 __pyx_t_float_complex z;
28824 z.real = a.real + b.real;
28825 z.imag = a.imag + b.imag;
28826 return z;
28827 }
28828 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28829 __pyx_t_float_complex z;
28830 z.real = a.real - b.real;
28831 z.imag = a.imag - b.imag;
28832 return z;
28833 }
28834 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28835 __pyx_t_float_complex z;
28836 z.real = a.real * b.real - a.imag * b.imag;
28837 z.imag = a.real * b.imag + a.imag * b.real;
28838 return z;
28839 }
28840 #if 1
28841 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28842 if (b.imag == 0) {
28843 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
28844 } else if (fabsf(b.real) >= fabsf(b.imag)) {
28845 if (b.real == 0 && b.imag == 0) {
28846 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
28847 } else {
28848 float r = b.imag / b.real;
28849 float s = (float)(1.0) / (b.real + b.imag * r);
28850 return __pyx_t_float_complex_from_parts(
28851 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
28852 }
28853 } else {
28854 float r = b.real / b.imag;
28855 float s = (float)(1.0) / (b.imag + b.real * r);
28856 return __pyx_t_float_complex_from_parts(
28857 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
28858 }
28859 }
28860 #else
28861 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28862 if (b.imag == 0) {
28863 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
28864 } else {
28865 float denom = b.real * b.real + b.imag * b.imag;
28866 return __pyx_t_float_complex_from_parts(
28867 (a.real * b.real + a.imag * b.imag) / denom,
28868 (a.imag * b.real - a.real * b.imag) / denom);
28869 }
28870 }
28871 #endif
28872 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
28873 __pyx_t_float_complex z;
28874 z.real = -a.real;
28875 z.imag = -a.imag;
28876 return z;
28877 }
28878 static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
28879 return (a.real == 0) && (a.imag == 0);
28880 }
28881 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
28882 __pyx_t_float_complex z;
28883 z.real = a.real;
28884 z.imag = -a.imag;
28885 return z;
28886 }
28887 #if 1
28888 static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
28889 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
28890 return sqrtf(z.real*z.real + z.imag*z.imag);
28891 #else
28892 return hypotf(z.real, z.imag);
28893 #endif
28894 }
28895 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
28896 __pyx_t_float_complex z;
28897 float r, lnr, theta, z_r, z_theta;
28898 if (b.imag == 0 && b.real == (int)b.real) {
28899 if (b.real < 0) {
28900 float denom = a.real * a.real + a.imag * a.imag;
28901 a.real = a.real / denom;
28902 a.imag = -a.imag / denom;
28903 b.real = -b.real;
28904 }
28905 switch ((int)b.real) {
28906 case 0:
28907 z.real = 1;
28908 z.imag = 0;
28909 return z;
28910 case 1:
28911 return a;
28912 case 2:
28913 return __Pyx_c_prod_float(a, a);
28914 case 3:
28915 z = __Pyx_c_prod_float(a, a);
28916 return __Pyx_c_prod_float(z, a);
28917 case 4:
28918 z = __Pyx_c_prod_float(a, a);
28919 return __Pyx_c_prod_float(z, z);
28920 }
28921 }
28922 if (a.imag == 0) {
28923 if (a.real == 0) {
28924 return a;
28925 } else if ((b.imag == 0) && (a.real >= 0)) {
28926 z.real = powf(a.real, b.real);
28927 z.imag = 0;
28928 return z;
28929 } else if (a.real > 0) {
28930 r = a.real;
28931 theta = 0;
28932 } else {
28933 r = -a.real;
28934 theta = atan2f(0.0, -1.0);
28935 }
28936 } else {
28937 r = __Pyx_c_abs_float(a);
28938 theta = atan2f(a.imag, a.real);
28939 }
28940 lnr = logf(r);
28941 z_r = expf(lnr * b.real - theta * b.imag);
28942 z_theta = theta * b.real + lnr * b.imag;
28943 z.real = z_r * cosf(z_theta);
28944 z.imag = z_r * sinf(z_theta);
28945 return z;
28946 }
28947 #endif
28948#endif
28949
28950/* Declarations */
28951#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
28952 #ifdef __cplusplus
28953 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
28954 return ::std::complex< double >(x, y);
28955 }
28956 #else
28957 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
28958 return x + y*(__pyx_t_double_complex)_Complex_I;
28959 }
28960 #endif
28961#else
28962 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
28963 __pyx_t_double_complex z;
28964 z.real = x;
28965 z.imag = y;
28966 return z;
28967 }
28968#endif
28969
28970/* Arithmetic */
28971#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
28972#else
28973 static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28974 return (a.real == b.real) && (a.imag == b.imag);
28975 }
28976 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28977 __pyx_t_double_complex z;
28978 z.real = a.real + b.real;
28979 z.imag = a.imag + b.imag;
28980 return z;
28981 }
28982 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28983 __pyx_t_double_complex z;
28984 z.real = a.real - b.real;
28985 z.imag = a.imag - b.imag;
28986 return z;
28987 }
28988 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28989 __pyx_t_double_complex z;
28990 z.real = a.real * b.real - a.imag * b.imag;
28991 z.imag = a.real * b.imag + a.imag * b.real;
28992 return z;
28993 }
28994 #if 1
28995 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
28996 if (b.imag == 0) {
28997 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
28998 } else if (fabs(b.real) >= fabs(b.imag)) {
28999 if (b.real == 0 && b.imag == 0) {
29000 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
29001 } else {
29002 double r = b.imag / b.real;
29003 double s = (double)(1.0) / (b.real + b.imag * r);
29004 return __pyx_t_double_complex_from_parts(
29005 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
29006 }
29007 } else {
29008 double r = b.real / b.imag;
29009 double s = (double)(1.0) / (b.imag + b.real * r);
29010 return __pyx_t_double_complex_from_parts(
29011 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
29012 }
29013 }
29014 #else
29015 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
29016 if (b.imag == 0) {
29017 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
29018 } else {
29019 double denom = b.real * b.real + b.imag * b.imag;
29020 return __pyx_t_double_complex_from_parts(
29021 (a.real * b.real + a.imag * b.imag) / denom,
29022 (a.imag * b.real - a.real * b.imag) / denom);
29023 }
29024 }
29025 #endif
29026 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
29027 __pyx_t_double_complex z;
29028 z.real = -a.real;
29029 z.imag = -a.imag;
29030 return z;
29031 }
29032 static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
29033 return (a.real == 0) && (a.imag == 0);
29034 }
29035 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
29036 __pyx_t_double_complex z;
29037 z.real = a.real;
29038 z.imag = -a.imag;
29039 return z;
29040 }
29041 #if 1
29042 static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
29043 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
29044 return sqrt(z.real*z.real + z.imag*z.imag);
29045 #else
29046 return hypot(z.real, z.imag);
29047 #endif
29048 }
29049 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
29050 __pyx_t_double_complex z;
29051 double r, lnr, theta, z_r, z_theta;
29052 if (b.imag == 0 && b.real == (int)b.real) {
29053 if (b.real < 0) {
29054 double denom = a.real * a.real + a.imag * a.imag;
29055 a.real = a.real / denom;
29056 a.imag = -a.imag / denom;
29057 b.real = -b.real;
29058 }
29059 switch ((int)b.real) {
29060 case 0:
29061 z.real = 1;
29062 z.imag = 0;
29063 return z;
29064 case 1:
29065 return a;
29066 case 2:
29067 return __Pyx_c_prod_double(a, a);
29068 case 3:
29069 z = __Pyx_c_prod_double(a, a);
29070 return __Pyx_c_prod_double(z, a);
29071 case 4:
29072 z = __Pyx_c_prod_double(a, a);
29073 return __Pyx_c_prod_double(z, z);
29074 }
29075 }
29076 if (a.imag == 0) {
29077 if (a.real == 0) {
29078 return a;
29079 } else if ((b.imag == 0) && (a.real >= 0)) {
29080 z.real = pow(a.real, b.real);
29081 z.imag = 0;
29082 return z;
29083 } else if (a.real > 0) {
29084 r = a.real;
29085 theta = 0;
29086 } else {
29087 r = -a.real;
29088 theta = atan2(0.0, -1.0);
29089 }
29090 } else {
29091 r = __Pyx_c_abs_double(a);
29092 theta = atan2(a.imag, a.real);
29093 }
29094 lnr = log(r);
29095 z_r = exp(lnr * b.real - theta * b.imag);
29096 z_theta = theta * b.real + lnr * b.imag;
29097 z.real = z_r * cos(z_theta);
29098 z.imag = z_r * sin(z_theta);
29099 return z;
29100 }
29101 #endif
29102#endif
29103
29104/* Declarations */
29105#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
29106 #ifdef __cplusplus
29107 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
29108 return ::std::complex< long double >(x, y);
29109 }
29110 #else
29111 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
29112 return x + y*(__pyx_t_long_double_complex)_Complex_I;
29113 }
29114 #endif
29115#else
29116 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
29117 __pyx_t_long_double_complex z;
29118 z.real = x;
29119 z.imag = y;
29120 return z;
29121 }
29122#endif
29123
29124/* Arithmetic */
29125#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
29126#else
29127 static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
29128 return (a.real == b.real) && (a.imag == b.imag);
29129 }
29130 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
29131 __pyx_t_long_double_complex z;
29132 z.real = a.real + b.real;
29133 z.imag = a.imag + b.imag;
29134 return z;
29135 }
29136 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
29137 __pyx_t_long_double_complex z;
29138 z.real = a.real - b.real;
29139 z.imag = a.imag - b.imag;
29140 return z;
29141 }
29142 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
29143 __pyx_t_long_double_complex z;
29144 z.real = a.real * b.real - a.imag * b.imag;
29145 z.imag = a.real * b.imag + a.imag * b.real;
29146 return z;
29147 }
29148 #if 1
29149 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
29150 if (b.imag == 0) {
29151 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
29152 } else if (fabsl(b.real) >= fabsl(b.imag)) {
29153 if (b.real == 0 && b.imag == 0) {
29154 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
29155 } else {
29156 long double r = b.imag / b.real;
29157 long double s = (long double)(1.0) / (b.real + b.imag * r);
29158 return __pyx_t_long_double_complex_from_parts(
29159 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
29160 }
29161 } else {
29162 long double r = b.real / b.imag;
29163 long double s = (long double)(1.0) / (b.imag + b.real * r);
29164 return __pyx_t_long_double_complex_from_parts(
29165 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
29166 }
29167 }
29168 #else
29169 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
29170 if (b.imag == 0) {
29171 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
29172 } else {
29173 long double denom = b.real * b.real + b.imag * b.imag;
29174 return __pyx_t_long_double_complex_from_parts(
29175 (a.real * b.real + a.imag * b.imag) / denom,
29176 (a.imag * b.real - a.real * b.imag) / denom);
29177 }
29178 }
29179 #endif
29180 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) {
29181 __pyx_t_long_double_complex z;
29182 z.real = -a.real;
29183 z.imag = -a.imag;
29184 return z;
29185 }
29186 static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) {
29187 return (a.real == 0) && (a.imag == 0);
29188 }
29189 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) {
29190 __pyx_t_long_double_complex z;
29191 z.real = a.real;
29192 z.imag = -a.imag;
29193 return z;
29194 }
29195 #if 1
29196 static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex z) {
29197 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
29198 return sqrtl(z.real*z.real + z.imag*z.imag);
29199 #else
29200 return hypotl(z.real, z.imag);
29201 #endif
29202 }
29203 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
29204 __pyx_t_long_double_complex z;
29205 long double r, lnr, theta, z_r, z_theta;
29206 if (b.imag == 0 && b.real == (int)b.real) {
29207 if (b.real < 0) {
29208 long double denom = a.real * a.real + a.imag * a.imag;
29209 a.real = a.real / denom;
29210 a.imag = -a.imag / denom;
29211 b.real = -b.real;
29212 }
29213 switch ((int)b.real) {
29214 case 0:
29215 z.real = 1;
29216 z.imag = 0;
29217 return z;
29218 case 1:
29219 return a;
29220 case 2:
29221 return __Pyx_c_prod_long__double(a, a);
29222 case 3:
29223 z = __Pyx_c_prod_long__double(a, a);
29224 return __Pyx_c_prod_long__double(z, a);
29225 case 4:
29226 z = __Pyx_c_prod_long__double(a, a);
29227 return __Pyx_c_prod_long__double(z, z);
29228 }
29229 }
29230 if (a.imag == 0) {
29231 if (a.real == 0) {
29232 return a;
29233 } else if ((b.imag == 0) && (a.real >= 0)) {
29234 z.real = powl(a.real, b.real);
29235 z.imag = 0;
29236 return z;
29237 } else if (a.real > 0) {
29238 r = a.real;
29239 theta = 0;
29240 } else {
29241 r = -a.real;
29242 theta = atan2l(0.0, -1.0);
29243 }
29244 } else {
29245 r = __Pyx_c_abs_long__double(a);
29246 theta = atan2l(a.imag, a.real);
29247 }
29248 lnr = logl(r);
29249 z_r = expl(lnr * b.real - theta * b.imag);
29250 z_theta = theta * b.real + lnr * b.imag;
29251 z.real = z_r * cosl(z_theta);
29252 z.imag = z_r * sinl(z_theta);
29253 return z;
29254 }
29255 #endif
29256#endif
29257
29258/* CIntToPy */
29259static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) {
29260#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29261#pragma GCC diagnostic push
29262#pragma GCC diagnostic ignored "-Wconversion"
29263#endif
29264 const long neg_one = (long) -1, const_zero = (long) 0;
29265#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29266#pragma GCC diagnostic pop
29267#endif
29268 const int is_unsigned = neg_one > const_zero;
29269 if (is_unsigned) {
29270 if (sizeof(long) < sizeof(long)) {
29271 return PyLong_FromLong((long) value);
29272 } else if (sizeof(long) <= sizeof(unsigned long)) {
29273 return PyLong_FromUnsignedLong((unsigned long) value);
29274#if !CYTHON_COMPILING_IN_PYPY
29275 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
29276 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
29277#endif
29278 }
29279 } else {
29280 if (sizeof(long) <= sizeof(long)) {
29281 return PyLong_FromLong((long) value);
29282 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
29283 return PyLong_FromLongLong((PY_LONG_LONG) value);
29284 }
29285 }
29286 {
29287 unsigned char *bytes = (unsigned char *)&value;
29288#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
29289 if (is_unsigned) {
29290 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
29291 } else {
29292 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
29293 }
29294#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
29295 int one = 1; int little = (int)*(unsigned char *)&one;
29296 return _PyLong_FromByteArray(bytes, sizeof(long),
29297 little, !is_unsigned);
29298#else
29299 int one = 1; int little = (int)*(unsigned char *)&one;
29300 PyObject *result = NULL, *kwds = NULL;
29301 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
29302 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
29303 if (!py_bytes) goto limited_bad;
29304 from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
29305 if (!from_bytes_str) goto limited_bad;
29306 order_str = PyUnicode_FromString(little ? "little" : "big");
29307 if (!order_str) goto limited_bad;
29308 {
29309 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
29310 if (!is_unsigned) {
29311 PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
29312 if (!signed_str) goto limited_bad;
29313#if CYTHON_VECTORCALL
29314 kwds = PyTuple_Pack(1, signed_str);
29315#else
29316 {
29317 PyObject *keys[] = {signed_str};
29318 PyObject *values[] = {Py_True};
29319 kwds = __Pyx_MakeKwargDict(keys, values, 1);
29320 }
29321#endif
29322 Py_DECREF(signed_str);
29323 if (unlikely(!kwds)) goto limited_bad;
29324 }
29325 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
29326 }
29327 limited_bad:
29328 Py_XDECREF(kwds);
29329 Py_XDECREF(order_str);
29330 Py_XDECREF(py_bytes);
29331 Py_XDECREF(from_bytes_str);
29332 return result;
29333#endif
29334 }
29335}
29336
29337/* CIntFromPy */
29338static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x);
29339static int __Pyx_raise_neg_overflow___Pyx_PyLong_As_int(void) {
29340 const char* type_name = "int";
29341 PyErr_Format(PyExc_OverflowError,
29342 "can't convert negative value to %.200s", type_name);
29343 return (int) -1;
29344}
29345static int __Pyx_raise_overflow___Pyx_PyLong_As_int(void) {
29346 const char* type_name = "int";
29347 PyErr_Format(PyExc_OverflowError,
29348 "value too large to convert to %.200s", type_name);
29349 return (int) -1;
29350}
29351static CYTHON_INLINE int __Pyx_PyULong___Pyx_PyLong_As_int(PyObject *x) {
29352 const int is_unsigned = 1;
29353#if CYTHON_USE_PYLONG_INTERNALS
29354 {
29355 const digit* digits = __Pyx_PyLong_Digits(x);
29356 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
29357 if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
29358 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
29359 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29360 } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
29361 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
29362 }
29363 } else
29364 if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
29365 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
29366 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29367 } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
29368 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
29369 }
29370 } else
29371 if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
29372 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
29373 __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])))
29374 } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
29375 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
29376 }
29377 } else
29378 {}
29379 }
29380#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
29381 if (unlikely(Py_SIZE(x) < 0)) {
29382 goto raise_neg_overflow;
29383 }
29384#else
29385 {
29386 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
29387 if (unlikely(result < 0))
29388 return (int) -1;
29389 if (unlikely(result == 1))
29390 goto raise_neg_overflow;
29391 }
29392#endif
29393 if ((sizeof(int) <= sizeof(unsigned long))) {
29394 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
29395 } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
29396 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
29397 }
29398 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
29399raise_neg_overflow:
29400 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
29401raise_overflow:
29402 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
29403}
29404static CYTHON_INLINE int __Pyx_PySLong___Pyx_PyLong_As_int(PyObject *x) {
29405 const int is_unsigned = 0;
29406#if CYTHON_USE_PYLONG_INTERNALS
29407 if (__Pyx_PyLong_IsNeg(x)) {
29408 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
29409 const digit* digits = __Pyx_PyLong_Digits(x);
29410 if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
29411 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
29412 long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
29413 __PYX_VERIFY_RETURN_INT(int, long, ival)
29414 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
29415 return (int) (((int) -1) * (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
29416 }
29417 } else
29418 if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
29419 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
29420 long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
29421 __PYX_VERIFY_RETURN_INT(int, long, ival)
29422 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
29423 return (int) (((int) -1) * (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
29424 }
29425 } else
29426 if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
29427 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
29428 long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
29429 __PYX_VERIFY_RETURN_INT(int, long, ival)
29430 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
29431 return (int) (((int) -1) * (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
29432 }
29433 } else
29434 {}
29435 } else {
29436 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
29437 const digit* digits = __Pyx_PyLong_Digits(x);
29438 if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
29439 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
29440 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29441 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
29442 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
29443 }
29444 } else
29445 if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
29446 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
29447 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29448 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
29449 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
29450 }
29451 } else
29452 if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
29453 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
29454 __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])))
29455 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
29456 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
29457 }
29458 } else
29459 {}
29460 }
29461#endif
29462 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
29463 if ((sizeof(int) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
29464 __PYX_VERIFY_RETURN_INT_EXC(int, int, PyLong_AsInt(x))
29465 } else
29466 #endif
29467 if ((sizeof(int) <= sizeof(long))) {
29468 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
29469 } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
29470 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
29471 }
29472 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
29473raise_neg_overflow:
29474 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
29475raise_overflow:
29476 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
29477}
29478static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x) {
29479#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29480#pragma GCC diagnostic push
29481#pragma GCC diagnostic ignored "-Wconversion"
29482#endif
29483 const int neg_one = (int) -1, const_zero = (int) 0;
29484#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29485#pragma GCC diagnostic pop
29486#endif
29487 const int is_unsigned = neg_one > const_zero;
29488 int val;
29489 int ret = -1;
29490#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
29491 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
29492 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
29493 if (unlikely(bytes_copied == -1)) {
29494 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
29495 goto raise_overflow;
29496 } else {
29497 ret = 0;
29498 }
29499#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
29500 int one = 1; int is_little = (int)*(unsigned char *)&one;
29501 unsigned char *bytes = (unsigned char *)&val;
29502 ret = _PyLong_AsByteArray((PyLongObject *)x,
29503 bytes, sizeof(val),
29504 is_little, !is_unsigned);
29505 if ((0)) goto raise_overflow;
29506#else
29507 PyObject *v;
29508 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
29509 int bits, remaining_bits, is_negative = 0;
29510 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
29511 if (likely(PyLong_CheckExact(x))) {
29512 v = __Pyx_NewRef(x);
29513 } else {
29514 v = PyNumber_Long(x);
29515 if (unlikely(!v)) return (int) -1;
29516 assert(PyLong_CheckExact(v));
29517 }
29518 {
29519 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
29520 if (unlikely(result < 0)) {
29521 Py_DECREF(v);
29522 return (int) -1;
29523 }
29524 is_negative = result == 1;
29525 }
29526 if (is_unsigned && unlikely(is_negative)) {
29527 Py_DECREF(v);
29528 PyErr_SetString(PyExc_OverflowError,
29529 "can't convert negative value to int");
29530 return (int) -1;
29531 } else if (is_negative) {
29532 stepval = PyNumber_Invert(v);
29533 Py_DECREF(v);
29534 if (unlikely(!stepval))
29535 return (int) -1;
29536 } else {
29537 stepval = v;
29538 }
29539 v = NULL;
29540 val = (int) 0;
29541 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
29542 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
29543 for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
29544 PyObject *tmp, *digit;
29545 long idigit;
29546 digit = PyNumber_And(stepval, mask);
29547 if (unlikely(!digit)) goto done;
29548 idigit = PyLong_AsLong(digit);
29549 Py_DECREF(digit);
29550 if (unlikely(idigit < 0)) goto done;
29551 val |= ((int) idigit) << bits;
29552 tmp = PyNumber_Rshift(stepval, shift);
29553 if (unlikely(!tmp)) goto done;
29554 Py_DECREF(stepval); stepval = tmp;
29555 }
29556 Py_DECREF(shift); shift = NULL;
29557 Py_DECREF(mask); mask = NULL;
29558 {
29559 long idigit = PyLong_AsLong(stepval);
29560 if (unlikely(idigit < 0)) goto done;
29561 remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
29562 if (unlikely(idigit >= (1L << remaining_bits)))
29563 goto raise_overflow;
29564 val |= ((int) idigit) << bits;
29565 }
29566 if (!is_unsigned) {
29567 if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
29568 goto raise_overflow;
29569 if (is_negative)
29570 val = ~val;
29571 }
29572 ret = 0;
29573done:
29574 Py_XDECREF(shift);
29575 Py_XDECREF(mask);
29576 Py_XDECREF(stepval);
29577#endif
29578 if (unlikely(ret))
29579 return (int) -1;
29580 return val;
29581raise_overflow:
29582 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
29583}
29584static CYTHON_INLINE int __Pyx_PyLong___Pyx_PyLong_As_int(PyObject *x) {
29585#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29586#pragma GCC diagnostic push
29587#pragma GCC diagnostic ignored "-Wconversion"
29588#endif
29589 const int neg_one = (int) -1, const_zero = (int) 0;
29590#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29591#pragma GCC diagnostic pop
29592#endif
29593 const int is_unsigned = neg_one > const_zero;
29594 if (is_unsigned) {
29595 #if CYTHON_USE_PYLONG_INTERNALS
29596 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
29597 goto raise_neg_overflow;
29598 } else if (__Pyx_PyLong_IsCompact(x)) {
29599 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
29600 } else
29601 #endif
29602 {
29603 return __Pyx_PyULong___Pyx_PyLong_As_int(x);
29604 }
29605 } else {
29606 #if CYTHON_USE_PYLONG_INTERNALS
29607 if (__Pyx_PyLong_IsCompact(x)) {
29608 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
29609 } else
29610 #endif
29611 {
29612 return __Pyx_PySLong___Pyx_PyLong_As_int(x);
29613 }
29614 }
29615#if CYTHON_USE_PYLONG_INTERNALS
29616raise_neg_overflow:
29617 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
29618raise_overflow:
29619 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
29620#endif
29621}
29622static int __Pyx_NonPyLong___Pyx_PyLong_As_int(PyObject *x) {
29623 int val;
29624 PyObject *tmp = __Pyx_PyNumber_Long(x);
29625 if (!tmp) return (int) -1;
29626 val = __Pyx_PyLong_As_int(tmp);
29627 Py_DECREF(tmp);
29628 return val;
29629}
29630static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) {
29631 if (likely(PyLong_Check(x))) {
29632 return __Pyx_PyLong___Pyx_PyLong_As_int(x);
29633 } else {
29634 return __Pyx_NonPyLong___Pyx_PyLong_As_int(x);
29635 }
29636}
29637
29638/* CIntToPy */
29639static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value) {
29640#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29641#pragma GCC diagnostic push
29642#pragma GCC diagnostic ignored "-Wconversion"
29643#endif
29644 const int neg_one = (int) -1, const_zero = (int) 0;
29645#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29646#pragma GCC diagnostic pop
29647#endif
29648 const int is_unsigned = neg_one > const_zero;
29649 if (is_unsigned) {
29650 if (sizeof(int) < sizeof(long)) {
29651 return PyLong_FromLong((long) value);
29652 } else if (sizeof(int) <= sizeof(unsigned long)) {
29653 return PyLong_FromUnsignedLong((unsigned long) value);
29654#if !CYTHON_COMPILING_IN_PYPY
29655 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
29656 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
29657#endif
29658 }
29659 } else {
29660 if (sizeof(int) <= sizeof(long)) {
29661 return PyLong_FromLong((long) value);
29662 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
29663 return PyLong_FromLongLong((PY_LONG_LONG) value);
29664 }
29665 }
29666 {
29667 unsigned char *bytes = (unsigned char *)&value;
29668#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
29669 if (is_unsigned) {
29670 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
29671 } else {
29672 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
29673 }
29674#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
29675 int one = 1; int little = (int)*(unsigned char *)&one;
29676 return _PyLong_FromByteArray(bytes, sizeof(int),
29677 little, !is_unsigned);
29678#else
29679 int one = 1; int little = (int)*(unsigned char *)&one;
29680 PyObject *result = NULL, *kwds = NULL;
29681 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
29682 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
29683 if (!py_bytes) goto limited_bad;
29684 from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
29685 if (!from_bytes_str) goto limited_bad;
29686 order_str = PyUnicode_FromString(little ? "little" : "big");
29687 if (!order_str) goto limited_bad;
29688 {
29689 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
29690 if (!is_unsigned) {
29691 PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
29692 if (!signed_str) goto limited_bad;
29693#if CYTHON_VECTORCALL
29694 kwds = PyTuple_Pack(1, signed_str);
29695#else
29696 {
29697 PyObject *keys[] = {signed_str};
29698 PyObject *values[] = {Py_True};
29699 kwds = __Pyx_MakeKwargDict(keys, values, 1);
29700 }
29701#endif
29702 Py_DECREF(signed_str);
29703 if (unlikely(!kwds)) goto limited_bad;
29704 }
29705 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
29706 }
29707 limited_bad:
29708 Py_XDECREF(kwds);
29709 Py_XDECREF(order_str);
29710 Py_XDECREF(py_bytes);
29711 Py_XDECREF(from_bytes_str);
29712 return result;
29713#endif
29714 }
29715}
29716
29717/* CIntFromPy */
29718static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x);
29719static long __Pyx_raise_neg_overflow___Pyx_PyLong_As_long(void) {
29720 const char* type_name = "long";
29721 PyErr_Format(PyExc_OverflowError,
29722 "can't convert negative value to %.200s", type_name);
29723 return (long) -1;
29724}
29725static long __Pyx_raise_overflow___Pyx_PyLong_As_long(void) {
29726 const char* type_name = "long";
29727 PyErr_Format(PyExc_OverflowError,
29728 "value too large to convert to %.200s", type_name);
29729 return (long) -1;
29730}
29731static CYTHON_INLINE long __Pyx_PyULong___Pyx_PyLong_As_long(PyObject *x) {
29732 const int is_unsigned = 1;
29733#if CYTHON_USE_PYLONG_INTERNALS
29734 {
29735 const digit* digits = __Pyx_PyLong_Digits(x);
29736 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
29737 if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
29738 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
29739 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29740 } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
29741 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
29742 }
29743 } else
29744 if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
29745 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
29746 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29747 } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
29748 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
29749 }
29750 } else
29751 if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
29752 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
29753 __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])))
29754 } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
29755 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
29756 }
29757 } else
29758 {}
29759 }
29760#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
29761 if (unlikely(Py_SIZE(x) < 0)) {
29762 goto raise_neg_overflow;
29763 }
29764#else
29765 {
29766 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
29767 if (unlikely(result < 0))
29768 return (long) -1;
29769 if (unlikely(result == 1))
29770 goto raise_neg_overflow;
29771 }
29772#endif
29773 if ((sizeof(long) <= sizeof(unsigned long))) {
29774 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
29775 } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
29776 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
29777 }
29778 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
29779raise_neg_overflow:
29780 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
29781raise_overflow:
29782 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
29783}
29784static CYTHON_INLINE long __Pyx_PySLong___Pyx_PyLong_As_long(PyObject *x) {
29785 const int is_unsigned = 0;
29786#if CYTHON_USE_PYLONG_INTERNALS
29787 if (__Pyx_PyLong_IsNeg(x)) {
29788 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
29789 const digit* digits = __Pyx_PyLong_Digits(x);
29790 if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
29791 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
29792 long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
29793 __PYX_VERIFY_RETURN_INT(long, long, ival)
29794 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
29795 return (long) (((long) -1) * (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
29796 }
29797 } else
29798 if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
29799 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
29800 long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
29801 __PYX_VERIFY_RETURN_INT(long, long, ival)
29802 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
29803 return (long) (((long) -1) * (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
29804 }
29805 } else
29806 if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
29807 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
29808 long ival = - (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
29809 __PYX_VERIFY_RETURN_INT(long, long, ival)
29810 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
29811 return (long) (((long) -1) * (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
29812 }
29813 } else
29814 {}
29815 } else {
29816 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
29817 const digit* digits = __Pyx_PyLong_Digits(x);
29818 if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
29819 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
29820 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29821 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
29822 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
29823 }
29824 } else
29825 if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
29826 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
29827 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
29828 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
29829 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
29830 }
29831 } else
29832 if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
29833 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
29834 __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])))
29835 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
29836 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
29837 }
29838 } else
29839 {}
29840 }
29841#endif
29842 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
29843 if ((sizeof(long) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
29844 __PYX_VERIFY_RETURN_INT_EXC(long, int, PyLong_AsInt(x))
29845 } else
29846 #endif
29847 if ((sizeof(long) <= sizeof(long))) {
29848 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
29849 } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
29850 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
29851 }
29852 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
29853raise_neg_overflow:
29854 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
29855raise_overflow:
29856 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
29857}
29858static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x) {
29859#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29860#pragma GCC diagnostic push
29861#pragma GCC diagnostic ignored "-Wconversion"
29862#endif
29863 const long neg_one = (long) -1, const_zero = (long) 0;
29864#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29865#pragma GCC diagnostic pop
29866#endif
29867 const int is_unsigned = neg_one > const_zero;
29868 long val;
29869 int ret = -1;
29870#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
29871 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
29872 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
29873 if (unlikely(bytes_copied == -1)) {
29874 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
29875 goto raise_overflow;
29876 } else {
29877 ret = 0;
29878 }
29879#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
29880 int one = 1; int is_little = (int)*(unsigned char *)&one;
29881 unsigned char *bytes = (unsigned char *)&val;
29882 ret = _PyLong_AsByteArray((PyLongObject *)x,
29883 bytes, sizeof(val),
29884 is_little, !is_unsigned);
29885 if ((0)) goto raise_overflow;
29886#else
29887 PyObject *v;
29888 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
29889 int bits, remaining_bits, is_negative = 0;
29890 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
29891 if (likely(PyLong_CheckExact(x))) {
29892 v = __Pyx_NewRef(x);
29893 } else {
29894 v = PyNumber_Long(x);
29895 if (unlikely(!v)) return (long) -1;
29896 assert(PyLong_CheckExact(v));
29897 }
29898 {
29899 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
29900 if (unlikely(result < 0)) {
29901 Py_DECREF(v);
29902 return (long) -1;
29903 }
29904 is_negative = result == 1;
29905 }
29906 if (is_unsigned && unlikely(is_negative)) {
29907 Py_DECREF(v);
29908 PyErr_SetString(PyExc_OverflowError,
29909 "can't convert negative value to long");
29910 return (long) -1;
29911 } else if (is_negative) {
29912 stepval = PyNumber_Invert(v);
29913 Py_DECREF(v);
29914 if (unlikely(!stepval))
29915 return (long) -1;
29916 } else {
29917 stepval = v;
29918 }
29919 v = NULL;
29920 val = (long) 0;
29921 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
29922 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
29923 for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
29924 PyObject *tmp, *digit;
29925 long idigit;
29926 digit = PyNumber_And(stepval, mask);
29927 if (unlikely(!digit)) goto done;
29928 idigit = PyLong_AsLong(digit);
29929 Py_DECREF(digit);
29930 if (unlikely(idigit < 0)) goto done;
29931 val |= ((long) idigit) << bits;
29932 tmp = PyNumber_Rshift(stepval, shift);
29933 if (unlikely(!tmp)) goto done;
29934 Py_DECREF(stepval); stepval = tmp;
29935 }
29936 Py_DECREF(shift); shift = NULL;
29937 Py_DECREF(mask); mask = NULL;
29938 {
29939 long idigit = PyLong_AsLong(stepval);
29940 if (unlikely(idigit < 0)) goto done;
29941 remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
29942 if (unlikely(idigit >= (1L << remaining_bits)))
29943 goto raise_overflow;
29944 val |= ((long) idigit) << bits;
29945 }
29946 if (!is_unsigned) {
29947 if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
29948 goto raise_overflow;
29949 if (is_negative)
29950 val = ~val;
29951 }
29952 ret = 0;
29953done:
29954 Py_XDECREF(shift);
29955 Py_XDECREF(mask);
29956 Py_XDECREF(stepval);
29957#endif
29958 if (unlikely(ret))
29959 return (long) -1;
29960 return val;
29961raise_overflow:
29962 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
29963}
29964static CYTHON_INLINE long __Pyx_PyLong___Pyx_PyLong_As_long(PyObject *x) {
29965#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29966#pragma GCC diagnostic push
29967#pragma GCC diagnostic ignored "-Wconversion"
29968#endif
29969 const long neg_one = (long) -1, const_zero = (long) 0;
29970#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
29971#pragma GCC diagnostic pop
29972#endif
29973 const int is_unsigned = neg_one > const_zero;
29974 if (is_unsigned) {
29975 #if CYTHON_USE_PYLONG_INTERNALS
29976 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
29977 goto raise_neg_overflow;
29978 } else if (__Pyx_PyLong_IsCompact(x)) {
29979 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
29980 } else
29981 #endif
29982 {
29983 return __Pyx_PyULong___Pyx_PyLong_As_long(x);
29984 }
29985 } else {
29986 #if CYTHON_USE_PYLONG_INTERNALS
29987 if (__Pyx_PyLong_IsCompact(x)) {
29988 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
29989 } else
29990 #endif
29991 {
29992 return __Pyx_PySLong___Pyx_PyLong_As_long(x);
29993 }
29994 }
29995#if CYTHON_USE_PYLONG_INTERNALS
29996raise_neg_overflow:
29997 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
29998raise_overflow:
29999 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
30000#endif
30001}
30002static long __Pyx_NonPyLong___Pyx_PyLong_As_long(PyObject *x) {
30003 long val;
30004 PyObject *tmp = __Pyx_PyNumber_Long(x);
30005 if (!tmp) return (long) -1;
30006 val = __Pyx_PyLong_As_long(tmp);
30007 Py_DECREF(tmp);
30008 return val;
30009}
30010static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) {
30011 if (likely(PyLong_Check(x))) {
30012 return __Pyx_PyLong___Pyx_PyLong_As_long(x);
30013 } else {
30014 return __Pyx_NonPyLong___Pyx_PyLong_As_long(x);
30015 }
30016}
30017
30018/* GetRuntimeVersion */
30019#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
30020void __Pyx_init_runtime_version(void) {
30021 if (__Pyx_cached_runtime_version == 0) {
30022 const char* rt_version = Py_GetVersion();
30023 unsigned long version = 0;
30024 unsigned long factor = 0x01000000UL;
30025 unsigned int digit = 0;
30026 int i = 0;
30027 while (factor) {
30028 while ('0' <= rt_version[i] && rt_version[i] <= '9') {
30029 digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
30030 ++i;
30031 }
30032 version += factor * digit;
30033 if (rt_version[i] != '.')
30034 break;
30035 digit = 0;
30036 factor >>= 8;
30037 ++i;
30038 }
30039 __Pyx_cached_runtime_version = version;
30040 }
30041}
30042#endif
30043static unsigned long __Pyx_get_runtime_version(void) {
30044#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
30045 return Py_Version & ~0xFFUL;
30046#else
30047 return __Pyx_cached_runtime_version;
30048#endif
30049}
30050
30051/* SwapException (used by CoroutineBase) */
30052#if CYTHON_FAST_THREAD_STATE
30053static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
30054 PyObject *tmp_type, *tmp_value, *tmp_tb;
30055 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
30056 _PyErr_StackItem *exc_info = tstate->exc_info;
30057 tmp_value = exc_info->exc_value;
30058 exc_info->exc_value = *value;
30059 if (tmp_value == NULL || tmp_value == Py_None) {
30060 Py_XDECREF(tmp_value);
30061 tmp_value = NULL;
30062 tmp_type = NULL;
30063 tmp_tb = NULL;
30064 } else {
30065 tmp_type = (PyObject*) Py_TYPE(tmp_value);
30066 Py_INCREF(tmp_type);
30067 #if CYTHON_COMPILING_IN_CPYTHON
30068 tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
30069 Py_XINCREF(tmp_tb);
30070 #else
30071 tmp_tb = PyException_GetTraceback(tmp_value);
30072 #endif
30073 }
30074 #elif CYTHON_USE_EXC_INFO_STACK
30075 _PyErr_StackItem *exc_info = tstate->exc_info;
30076 tmp_type = exc_info->exc_type;
30077 tmp_value = exc_info->exc_value;
30078 tmp_tb = exc_info->exc_traceback;
30079 exc_info->exc_type = *type;
30080 exc_info->exc_value = *value;
30081 exc_info->exc_traceback = *tb;
30082 #else
30083 tmp_type = tstate->exc_type;
30084 tmp_value = tstate->exc_value;
30085 tmp_tb = tstate->exc_traceback;
30086 tstate->exc_type = *type;
30087 tstate->exc_value = *value;
30088 tstate->exc_traceback = *tb;
30089 #endif
30090 *type = tmp_type;
30091 *value = tmp_value;
30092 *tb = tmp_tb;
30093}
30094#else
30095static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
30096 PyObject *tmp_type, *tmp_value, *tmp_tb;
30097 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
30098 PyErr_SetExcInfo(*type, *value, *tb);
30099 *type = tmp_type;
30100 *value = tmp_value;
30101 *tb = tmp_tb;
30102}
30103#endif
30104
30105/* IterNextPlain (used by CoroutineBase) */
30106#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
30107static PyObject *__Pyx_GetBuiltinNext_LimitedAPI(void) {
30108 if (unlikely(!__pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache))
30109 __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache = __Pyx_GetBuiltinName(__pyx_mstate_global->__pyx_n_u_next);
30110 return __pyx_mstate_global->__Pyx_GetBuiltinNext_LimitedAPI_cache;
30111}
30112#endif
30113static CYTHON_INLINE PyObject *__Pyx_PyIter_Next_Plain(PyObject *iterator) {
30114#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
30115 PyObject *result;
30116 PyObject *next = __Pyx_GetBuiltinNext_LimitedAPI();
30117 if (unlikely(!next)) return NULL;
30118 result = PyObject_CallFunctionObjArgs(next, iterator, NULL);
30119 return result;
30120#else
30121 (void)__Pyx_GetBuiltinName; // only for early limited API
30122 iternextfunc iternext = __Pyx_PyObject_GetIterNextFunc(iterator);
30123 assert(iternext);
30124 return iternext(iterator);
30125#endif
30126}
30127
30128/* PyObjectCallMethod1 (used by CoroutineBase) */
30129static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
30130#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || !CYTHON_COMPILING_IN_LIMITED_API)
30131 PyObject *args[2] = {obj, arg};
30132 return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
30133#elif CYTHON_COMPILING_IN_LIMITED_API
30134 return PyObject_CallMethodObjArgs(obj, method_name, arg, NULL);
30135#else
30136 return PyObject_CallMethodOneArg(obj, method_name, arg);
30137#endif
30138}
30139
30140/* PyObjectCallNoArg (used by CoroutineBase) */
30141static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
30142 PyObject *arg[2] = {NULL, NULL};
30143 return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
30144}
30145
30146/* ReturnWithStopIteration (used by CoroutineBase) */
30147static void __Pyx__ReturnWithStopIteration(PyObject* value, int async);
30148static CYTHON_INLINE void __Pyx_ReturnWithStopIteration(PyObject* value, int async, int iternext) {
30149 if (value == Py_None) {
30150 if (async || !iternext)
30151 PyErr_SetNone(async ? PyExc_StopAsyncIteration : PyExc_StopIteration);
30152 return;
30153 }
30154 __Pyx__ReturnWithStopIteration(value, async);
30155}
30156static void __Pyx__ReturnWithStopIteration(PyObject* value, int async) {
30157#if CYTHON_COMPILING_IN_CPYTHON
30158 __Pyx_PyThreadState_declare
30159#endif
30160 PyObject *exc;
30161 PyObject *exc_type = async ? PyExc_StopAsyncIteration : PyExc_StopIteration;
30162#if CYTHON_COMPILING_IN_CPYTHON
30163 if ((PY_VERSION_HEX >= (0x030C00A6)) || unlikely(PyTuple_Check(value) || PyExceptionInstance_Check(value))) {
30164 if (PY_VERSION_HEX >= (0x030e00A1)) {
30165 exc = __Pyx_PyObject_CallOneArg(exc_type, value);
30166 } else {
30167 PyObject *args_tuple = PyTuple_New(1);
30168 if (unlikely(!args_tuple)) return;
30169 Py_INCREF(value);
30170 PyTuple_SET_ITEM(args_tuple, 0, value);
30171 exc = PyObject_Call(exc_type, args_tuple, NULL);
30172 Py_DECREF(args_tuple);
30173 }
30174 if (unlikely(!exc)) return;
30175 } else {
30176 Py_INCREF(value);
30177 exc = value;
30178 }
30179 #if CYTHON_FAST_THREAD_STATE
30180 __Pyx_PyThreadState_assign
30181 #if CYTHON_USE_EXC_INFO_STACK
30182 if (!__pyx_tstate->exc_info->exc_value)
30183 #else
30184 if (!__pyx_tstate->exc_type)
30185 #endif
30186 {
30187 Py_INCREF(exc_type);
30188 __Pyx_ErrRestore(exc_type, exc, NULL);
30189 return;
30190 }
30191 #endif
30192#else
30193 exc = __Pyx_PyObject_CallOneArg(exc_type, value);
30194 if (unlikely(!exc)) return;
30195#endif
30196 PyErr_SetObject(exc_type, exc);
30197 Py_DECREF(exc);
30198}
30199
30200/* CoroutineBase (used by Generator) */
30201#if !CYTHON_COMPILING_IN_LIMITED_API
30202#include <frameobject.h>
30203#if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION)
30204 #ifndef Py_BUILD_CORE
30205 #define Py_BUILD_CORE 1
30206 #endif
30207 #include "internal/pycore_frame.h"
30208#endif
30209#endif // CYTHON_COMPILING_IN_LIMITED_API
30210static CYTHON_INLINE void
30211__Pyx_Coroutine_Undelegate(__pyx_CoroutineObject *gen) {
30212#if CYTHON_USE_AM_SEND
30213 gen->yieldfrom_am_send = NULL;
30214#endif
30215 Py_CLEAR(gen->yieldfrom);
30216}
30217static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) {
30218 PyObject *et, *ev, *tb;
30219 PyObject *value = NULL;
30220 CYTHON_UNUSED_VAR(__pyx_tstate);
30221 __Pyx_ErrFetch(&et, &ev, &tb);
30222 if (!et) {
30223 Py_XDECREF(tb);
30224 Py_XDECREF(ev);
30225 Py_INCREF(Py_None);
30226 *pvalue = Py_None;
30227 return 0;
30228 }
30229 if (likely(et == PyExc_StopIteration)) {
30230 if (!ev) {
30231 Py_INCREF(Py_None);
30232 value = Py_None;
30233 }
30234 else if (likely(Py_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) {
30235 #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
30236 value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value);
30237 if (unlikely(!value)) goto limited_api_failure;
30238 #else
30239 value = ((PyStopIterationObject *)ev)->value;
30240 Py_INCREF(value);
30241 #endif
30242 Py_DECREF(ev);
30243 }
30244 else if (unlikely(PyTuple_Check(ev))) {
30245 Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(ev);
30246 #if !CYTHON_ASSUME_SAFE_SIZE
30247 if (unlikely(tuple_size < 0)) {
30248 Py_XDECREF(tb);
30249 Py_DECREF(ev);
30250 Py_DECREF(et);
30251 return -1;
30252 }
30253 #endif
30254 if (tuple_size >= 1) {
30255#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
30256 value = PyTuple_GET_ITEM(ev, 0);
30257 Py_INCREF(value);
30258#elif CYTHON_ASSUME_SAFE_MACROS
30259 value = PySequence_ITEM(ev, 0);
30260#else
30261 value = PySequence_GetItem(ev, 0);
30262 if (!value) goto limited_api_failure;
30263#endif
30264 } else {
30265 Py_INCREF(Py_None);
30266 value = Py_None;
30267 }
30268 Py_DECREF(ev);
30269 }
30270 else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
30271 value = ev;
30272 }
30273 if (likely(value)) {
30274 Py_XDECREF(tb);
30275 Py_DECREF(et);
30276 *pvalue = value;
30277 return 0;
30278 }
30279 } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
30280 __Pyx_ErrRestore(et, ev, tb);
30281 return -1;
30282 }
30283 PyErr_NormalizeException(&et, &ev, &tb);
30284 if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
30285 __Pyx_ErrRestore(et, ev, tb);
30286 return -1;
30287 }
30288 Py_XDECREF(tb);
30289 Py_DECREF(et);
30290#if CYTHON_COMPILING_IN_LIMITED_API
30291 value = PyObject_GetAttr(ev, __pyx_mstate_global->__pyx_n_u_value);
30292#else
30293 value = ((PyStopIterationObject *)ev)->value;
30294 Py_INCREF(value);
30295#endif
30296 Py_DECREF(ev);
30297#if CYTHON_COMPILING_IN_LIMITED_API
30298 if (unlikely(!value)) return -1;
30299#endif
30300 *pvalue = value;
30301 return 0;
30302#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL || !CYTHON_ASSUME_SAFE_MACROS
30303 limited_api_failure:
30304 Py_XDECREF(et);
30305 Py_XDECREF(tb);
30306 Py_XDECREF(ev);
30307 return -1;
30308#endif
30309}
30310static CYTHON_INLINE
30311__Pyx_PySendResult __Pyx_Coroutine_status_from_result(PyObject **retval) {
30312 if (*retval) {
30313 return PYGEN_NEXT;
30314 } else if (likely(__Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, retval) == 0)) {
30315 return PYGEN_RETURN;
30316 } else {
30317 return PYGEN_ERROR;
30318 }
30319}
30320static CYTHON_INLINE
30321void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
30322#if PY_VERSION_HEX >= 0x030B00a4
30323 Py_CLEAR(exc_state->exc_value);
30324#else
30325 PyObject *t, *v, *tb;
30326 t = exc_state->exc_type;
30327 v = exc_state->exc_value;
30328 tb = exc_state->exc_traceback;
30329 exc_state->exc_type = NULL;
30330 exc_state->exc_value = NULL;
30331 exc_state->exc_traceback = NULL;
30332 Py_XDECREF(t);
30333 Py_XDECREF(v);
30334 Py_XDECREF(tb);
30335#endif
30336}
30337#define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
30338static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) {
30339 const char *msg;
30340 CYTHON_MAYBE_UNUSED_VAR(gen);
30341 if ((0)) {
30342 #ifdef __Pyx_Coroutine_USED
30343 } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
30344 msg = "coroutine already executing";
30345 #endif
30346 #ifdef __Pyx_AsyncGen_USED
30347 } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
30348 msg = "async generator already executing";
30349 #endif
30350 } else {
30351 msg = "generator already executing";
30352 }
30353 PyErr_SetString(PyExc_ValueError, msg);
30354}
30355static void __Pyx_Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) {
30356 CYTHON_MAYBE_UNUSED_VAR(gen);
30357 CYTHON_MAYBE_UNUSED_VAR(closing);
30358 #ifdef __Pyx_Coroutine_USED
30359 if (!closing && __Pyx_Coroutine_Check(gen)) {
30360 PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
30361 } else
30362 #endif
30363 if (value) {
30364 #ifdef __Pyx_AsyncGen_USED
30365 if (__Pyx_AsyncGen_CheckExact(gen))
30366 PyErr_SetNone(PyExc_StopAsyncIteration);
30367 else
30368 #endif
30369 PyErr_SetNone(PyExc_StopIteration);
30370 }
30371}
30372static
30373__Pyx_PySendResult __Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, PyObject **result, int closing) {
30374 __Pyx_PyThreadState_declare
30375 PyThreadState *tstate;
30376 __Pyx_ExcInfoStruct *exc_state;
30377 PyObject *retval;
30378 assert(__Pyx_Coroutine_get_is_running(self)); // Callers should ensure is_running
30379 if (unlikely(self->resume_label == -1)) {
30380 __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
30381 return PYGEN_ERROR;
30382 }
30383#if CYTHON_FAST_THREAD_STATE
30384 __Pyx_PyThreadState_assign
30385 tstate = __pyx_tstate;
30386#else
30387 tstate = __Pyx_PyThreadState_Current;
30388#endif
30389 exc_state = &self->gi_exc_state;
30390 if (exc_state->exc_value) {
30391 #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
30392 #else
30393 PyObject *exc_tb;
30394 #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON
30395 exc_tb = PyException_GetTraceback(exc_state->exc_value);
30396 #elif PY_VERSION_HEX >= 0x030B00a4
30397 exc_tb = ((PyBaseExceptionObject*) exc_state->exc_value)->traceback;
30398 #else
30399 exc_tb = exc_state->exc_traceback;
30400 #endif
30401 if (exc_tb) {
30402 PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
30403 PyFrameObject *f = tb->tb_frame;
30404 assert(f->f_back == NULL);
30405 #if PY_VERSION_HEX >= 0x030B00A1
30406 f->f_back = PyThreadState_GetFrame(tstate);
30407 #else
30408 Py_XINCREF(tstate->frame);
30409 f->f_back = tstate->frame;
30410 #endif
30411 #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON
30412 Py_DECREF(exc_tb);
30413 #endif
30414 }
30415 #endif
30416 }
30417#if CYTHON_USE_EXC_INFO_STACK
30418 exc_state->previous_item = tstate->exc_info;
30419 tstate->exc_info = exc_state;
30420#else
30421 if (exc_state->exc_type) {
30422 __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
30423 } else {
30424 __Pyx_Coroutine_ExceptionClear(exc_state);
30425 __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
30426 }
30427#endif
30428 retval = self->body(self, tstate, value);
30429#if CYTHON_USE_EXC_INFO_STACK
30430 exc_state = &self->gi_exc_state;
30431 tstate->exc_info = exc_state->previous_item;
30432 exc_state->previous_item = NULL;
30433 __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
30434#endif
30435 *result = retval;
30436 if (self->resume_label == -1) {
30437 return likely(retval) ? PYGEN_RETURN : PYGEN_ERROR;
30438 }
30439 return PYGEN_NEXT;
30440}
30441static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
30442#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
30443 CYTHON_UNUSED_VAR(exc_state);
30444#else
30445 PyObject *exc_tb;
30446 #if PY_VERSION_HEX >= 0x030B00a4
30447 if (!exc_state->exc_value) return;
30448 exc_tb = PyException_GetTraceback(exc_state->exc_value);
30449 #else
30450 exc_tb = exc_state->exc_traceback;
30451 #endif
30452 if (likely(exc_tb)) {
30453 PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
30454 PyFrameObject *f = tb->tb_frame;
30455 Py_CLEAR(f->f_back);
30456 #if PY_VERSION_HEX >= 0x030B00a4
30457 Py_DECREF(exc_tb);
30458 #endif
30459 }
30460#endif
30461}
30462#define __Pyx_Coroutine_MethodReturnFromResult(gen, result, retval, iternext)\
30463 ((result) == PYGEN_NEXT ? (retval) : __Pyx__Coroutine_MethodReturnFromResult(gen, result, retval, iternext))
30464static PyObject *
30465__Pyx__Coroutine_MethodReturnFromResult(PyObject* gen, __Pyx_PySendResult result, PyObject *retval, int iternext) {
30466 CYTHON_MAYBE_UNUSED_VAR(gen);
30467 if (likely(result == PYGEN_RETURN)) {
30468 int is_async = 0;
30469 #ifdef __Pyx_AsyncGen_USED
30470 is_async = __Pyx_AsyncGen_CheckExact(gen);
30471 #endif
30472 __Pyx_ReturnWithStopIteration(retval, is_async, iternext);
30473 Py_XDECREF(retval);
30474 }
30475 return NULL;
30476}
30477#if CYTHON_COMPILING_IN_CPYTHON
30478static CYTHON_INLINE
30479PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) {
30480#if PY_VERSION_HEX <= 0x030A00A1
30481 return _PyGen_Send(gen, arg);
30482#else
30483 PyObject *result;
30484 if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) {
30485 if (PyAsyncGen_CheckExact(gen)) {
30486 assert(result == Py_None);
30487 PyErr_SetNone(PyExc_StopAsyncIteration);
30488 }
30489 else if (result == Py_None) {
30490 PyErr_SetNone(PyExc_StopIteration);
30491 }
30492 else {
30493#if PY_VERSION_HEX < 0x030d00A1
30494 _PyGen_SetStopIterationValue(result);
30495#else
30496 if (!PyTuple_Check(result) && !PyExceptionInstance_Check(result)) {
30497 PyErr_SetObject(PyExc_StopIteration, result);
30498 } else {
30499 PyObject *exc = __Pyx_PyObject_CallOneArg(PyExc_StopIteration, result);
30500 if (likely(exc != NULL)) {
30501 PyErr_SetObject(PyExc_StopIteration, exc);
30502 Py_DECREF(exc);
30503 }
30504 }
30505#endif
30506 }
30507 Py_DECREF(result);
30508 result = NULL;
30509 }
30510 return result;
30511#endif
30512}
30513#endif
30514static CYTHON_INLINE __Pyx_PySendResult
30515__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen, PyObject** retval) {
30516 __Pyx_PySendResult result;
30517 PyObject *val = NULL;
30518 assert(__Pyx_Coroutine_get_is_running(gen));
30519 __Pyx_Coroutine_Undelegate(gen);
30520 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
30521 result = __Pyx_Coroutine_SendEx(gen, val, retval, 0);
30522 Py_XDECREF(val);
30523 return result;
30524}
30525#if CYTHON_USE_AM_SEND
30526static __Pyx_PySendResult
30527__Pyx_Coroutine_SendToDelegate(__pyx_CoroutineObject *gen, __Pyx_pyiter_sendfunc gen_am_send, PyObject *value, PyObject **retval) {
30528 PyObject *ret = NULL;
30529 __Pyx_PySendResult delegate_result, result;
30530 assert(__Pyx_Coroutine_get_is_running(gen));
30531 delegate_result = gen_am_send(gen->yieldfrom, value, &ret);
30532 if (delegate_result == PYGEN_NEXT) {
30533 assert (ret != NULL);
30534 *retval = ret;
30535 return PYGEN_NEXT;
30536 }
30537 assert (delegate_result != PYGEN_ERROR || ret == NULL);
30538 __Pyx_Coroutine_Undelegate(gen);
30539 result = __Pyx_Coroutine_SendEx(gen, ret, retval, 0);
30540 Py_XDECREF(ret);
30541 return result;
30542}
30543#endif
30544static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
30545 PyObject *retval = NULL;
30546 __Pyx_PySendResult result = __Pyx_Coroutine_AmSend(self, value, &retval);
30547 return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0);
30548}
30549static __Pyx_PySendResult
30550__Pyx_Coroutine_AmSend(PyObject *self, PyObject *value, PyObject **retval) {
30551 __Pyx_PySendResult result;
30552 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
30553 if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
30554 *retval = __Pyx_Coroutine_AlreadyRunningError(gen);
30555 return PYGEN_ERROR;
30556 }
30557 #if CYTHON_USE_AM_SEND
30558 if (gen->yieldfrom_am_send) {
30559 result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, value, retval);
30560 } else
30561 #endif
30562 if (gen->yieldfrom) {
30563 PyObject *yf = gen->yieldfrom;
30564 PyObject *ret;
30565 #if !CYTHON_USE_AM_SEND
30566 #ifdef __Pyx_Generator_USED
30567 if (__Pyx_Generator_CheckExact(yf)) {
30568 ret = __Pyx_Coroutine_Send(yf, value);
30569 } else
30570 #endif
30571 #ifdef __Pyx_Coroutine_USED
30572 if (__Pyx_Coroutine_Check(yf)) {
30573 ret = __Pyx_Coroutine_Send(yf, value);
30574 } else
30575 #endif
30576 #ifdef __Pyx_AsyncGen_USED
30577 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
30578 ret = __Pyx_async_gen_asend_send(yf, value);
30579 } else
30580 #endif
30581 #if CYTHON_COMPILING_IN_CPYTHON
30582 if (PyGen_CheckExact(yf)) {
30583 ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
30584 } else
30585 if (PyCoro_CheckExact(yf)) {
30586 ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
30587 } else
30588 #endif
30589 #endif
30590 {
30591 if (value == Py_None && PyIter_Check(yf))
30592 ret = __Pyx_PyIter_Next_Plain(yf);
30593 else
30594 ret = __Pyx_PyObject_CallMethod1(yf, __pyx_mstate_global->__pyx_n_u_send, value);
30595 }
30596 if (likely(ret)) {
30597 __Pyx_Coroutine_unset_is_running(gen);
30598 *retval = ret;
30599 return PYGEN_NEXT;
30600 }
30601 result = __Pyx_Coroutine_FinishDelegation(gen, retval);
30602 } else {
30603 result = __Pyx_Coroutine_SendEx(gen, value, retval, 0);
30604 }
30605 __Pyx_Coroutine_unset_is_running(gen);
30606 return result;
30607}
30608static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
30609 __Pyx_PySendResult result;
30610 PyObject *retval = NULL;
30611 CYTHON_UNUSED_VAR(gen);
30612 assert(__Pyx_Coroutine_get_is_running(gen));
30613 #ifdef __Pyx_Generator_USED
30614 if (__Pyx_Generator_CheckExact(yf)) {
30615 result = __Pyx_Coroutine_Close(yf, &retval);
30616 } else
30617 #endif
30618 #ifdef __Pyx_Coroutine_USED
30619 if (__Pyx_Coroutine_Check(yf)) {
30620 result = __Pyx_Coroutine_Close(yf, &retval);
30621 } else
30622 if (__Pyx_CoroutineAwait_CheckExact(yf)) {
30623 result = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf);
30624 } else
30625 #endif
30626 #ifdef __Pyx_AsyncGen_USED
30627 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
30628 retval = __Pyx_async_gen_asend_close(yf, NULL);
30629 result = PYGEN_RETURN;
30630 } else
30631 if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
30632 retval = __Pyx_async_gen_athrow_close(yf, NULL);
30633 result = PYGEN_RETURN;
30634 } else
30635 #endif
30636 {
30637 PyObject *meth;
30638 result = PYGEN_RETURN;
30639 meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_close);
30640 if (unlikely(!meth)) {
30641 if (unlikely(PyErr_Occurred())) {
30642 PyErr_WriteUnraisable(yf);
30643 }
30644 } else {
30645 retval = __Pyx_PyObject_CallNoArg(meth);
30646 Py_DECREF(meth);
30647 if (unlikely(!retval)) {
30648 result = PYGEN_ERROR;
30649 }
30650 }
30651 }
30652 Py_XDECREF(retval);
30653 return result == PYGEN_ERROR ? -1 : 0;
30654}
30655static PyObject *__Pyx_Generator_Next(PyObject *self) {
30656 __Pyx_PySendResult result;
30657 PyObject *retval = NULL;
30658 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
30659 if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
30660 return __Pyx_Coroutine_AlreadyRunningError(gen);
30661 }
30662 #if CYTHON_USE_AM_SEND
30663 if (gen->yieldfrom_am_send) {
30664 result = __Pyx_Coroutine_SendToDelegate(gen, gen->yieldfrom_am_send, Py_None, &retval);
30665 } else
30666 #endif
30667 if (gen->yieldfrom) {
30668 PyObject *yf = gen->yieldfrom;
30669 PyObject *ret;
30670 #ifdef __Pyx_Generator_USED
30671 if (__Pyx_Generator_CheckExact(yf)) {
30672 ret = __Pyx_Generator_Next(yf);
30673 } else
30674 #endif
30675 #ifdef __Pyx_Coroutine_USED
30676 if (__Pyx_Coroutine_CheckExact(yf)) {
30677 ret = __Pyx_Coroutine_Send(yf, Py_None);
30678 } else
30679 #endif
30680 #if CYTHON_COMPILING_IN_CPYTHON && (PY_VERSION_HEX < 0x030A00A3 || !CYTHON_USE_AM_SEND)
30681 if (PyGen_CheckExact(yf)) {
30682 ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL);
30683 } else
30684 #endif
30685 ret = __Pyx_PyIter_Next_Plain(yf);
30686 if (likely(ret)) {
30687 __Pyx_Coroutine_unset_is_running(gen);
30688 return ret;
30689 }
30690 result = __Pyx_Coroutine_FinishDelegation(gen, &retval);
30691 } else {
30692 result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0);
30693 }
30694 __Pyx_Coroutine_unset_is_running(gen);
30695 return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 1);
30696}
30697static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) {
30698 PyObject *retval = NULL;
30699 __Pyx_PySendResult result;
30700 CYTHON_UNUSED_VAR(arg);
30701 result = __Pyx_Coroutine_Close(self, &retval);
30702 if (unlikely(result == PYGEN_ERROR))
30703 return NULL;
30704 Py_XDECREF(retval);
30705 Py_RETURN_NONE;
30706}
30707static __Pyx_PySendResult
30708__Pyx_Coroutine_Close(PyObject *self, PyObject **retval) {
30709 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
30710 __Pyx_PySendResult result;
30711 PyObject *yf;
30712 int err = 0;
30713 if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
30714 *retval = __Pyx_Coroutine_AlreadyRunningError(gen);
30715 return PYGEN_ERROR;
30716 }
30717 yf = gen->yieldfrom;
30718 if (yf) {
30719 Py_INCREF(yf);
30720 err = __Pyx_Coroutine_CloseIter(gen, yf);
30721 __Pyx_Coroutine_Undelegate(gen);
30722 Py_DECREF(yf);
30723 }
30724 if (err == 0)
30725 PyErr_SetNone(PyExc_GeneratorExit);
30726 result = __Pyx_Coroutine_SendEx(gen, NULL, retval, 1);
30727 if (result == PYGEN_ERROR) {
30728 __Pyx_PyThreadState_declare
30729 __Pyx_PyThreadState_assign
30730 __Pyx_Coroutine_unset_is_running(gen);
30731 if (!__Pyx_PyErr_Occurred()) {
30732 return PYGEN_RETURN;
30733 } else if (likely(__Pyx_PyErr_ExceptionMatches2(PyExc_GeneratorExit, PyExc_StopIteration))) {
30734 __Pyx_PyErr_Clear();
30735 return PYGEN_RETURN;
30736 }
30737 return PYGEN_ERROR;
30738 } else if (likely(result == PYGEN_RETURN && *retval == Py_None)) {
30739 __Pyx_Coroutine_unset_is_running(gen);
30740 return PYGEN_RETURN;
30741 } else {
30742 const char *msg;
30743 Py_DECREF(*retval);
30744 *retval = NULL;
30745 if ((0)) {
30746 #ifdef __Pyx_Coroutine_USED
30747 } else if (__Pyx_Coroutine_Check(self)) {
30748 msg = "coroutine ignored GeneratorExit";
30749 #endif
30750 #ifdef __Pyx_AsyncGen_USED
30751 } else if (__Pyx_AsyncGen_CheckExact(self)) {
30752 msg = "async generator ignored GeneratorExit";
30753 #endif
30754 } else {
30755 msg = "generator ignored GeneratorExit";
30756 }
30757 PyErr_SetString(PyExc_RuntimeError, msg);
30758 __Pyx_Coroutine_unset_is_running(gen);
30759 return PYGEN_ERROR;
30760 }
30761}
30762static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
30763 PyObject *args, int close_on_genexit) {
30764 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
30765 PyObject *yf;
30766 if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen)))
30767 return __Pyx_Coroutine_AlreadyRunningError(gen);
30768 yf = gen->yieldfrom;
30769 if (yf) {
30770 __Pyx_PySendResult result;
30771 PyObject *ret;
30772 Py_INCREF(yf);
30773 if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
30774 int err = __Pyx_Coroutine_CloseIter(gen, yf);
30775 Py_DECREF(yf);
30776 __Pyx_Coroutine_Undelegate(gen);
30777 if (err < 0)
30778 goto propagate_exception;
30779 goto throw_here;
30780 }
30781 if (0
30782 #ifdef __Pyx_Generator_USED
30783 || __Pyx_Generator_CheckExact(yf)
30784 #endif
30785 #ifdef __Pyx_Coroutine_USED
30786 || __Pyx_Coroutine_Check(yf)
30787 #endif
30788 ) {
30789 ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
30790 #ifdef __Pyx_Coroutine_USED
30791 } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
30792 ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
30793 #endif
30794 } else {
30795 PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_mstate_global->__pyx_n_u_throw);
30796 if (unlikely(!meth)) {
30797 Py_DECREF(yf);
30798 if (unlikely(PyErr_Occurred())) {
30799 __Pyx_Coroutine_unset_is_running(gen);
30800 return NULL;
30801 }
30802 __Pyx_Coroutine_Undelegate(gen);
30803 goto throw_here;
30804 }
30805 if (args) {
30806 ret = __Pyx_PyObject_Call(meth, args, NULL);
30807 } else {
30808 PyObject *cargs[4] = {NULL, typ, val, tb};
30809 size_t nargs = 1U + (val != NULL) + (tb != NULL);
30810 ret = __Pyx_PyObject_FastCall(meth, cargs+1, nargs | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
30811 }
30812 Py_DECREF(meth);
30813 }
30814 Py_DECREF(yf);
30815 if (ret) {
30816 __Pyx_Coroutine_unset_is_running(gen);
30817 return ret;
30818 }
30819 result = __Pyx_Coroutine_FinishDelegation(gen, &ret);
30820 __Pyx_Coroutine_unset_is_running(gen);
30821 return __Pyx_Coroutine_MethodReturnFromResult(self, result, ret, 0);
30822 }
30823throw_here:
30824 __Pyx_Raise(typ, val, tb, NULL);
30825propagate_exception:
30826 {
30827 PyObject *retval = NULL;
30828 __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, NULL, &retval, 0);
30829 __Pyx_Coroutine_unset_is_running(gen);
30830 return __Pyx_Coroutine_MethodReturnFromResult(self, result, retval, 0);
30831 }
30832}
30833static PyObject *__Pyx_Coroutine_Throw(PyObject *self,
30834#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
30835 PyObject *args
30836#else
30837 PyObject *const *args, Py_ssize_t nargs
30838#endif
30839) {
30840 PyObject *typ;
30841 PyObject *val = NULL;
30842 PyObject *tb = NULL;
30843#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
30844 if (unlikely(!PyArg_UnpackTuple(args, "throw", 1, 3, &typ, &val, &tb)))
30845 return NULL;
30846#else
30847 switch (nargs) {
30848 case 3:
30849 tb = args[2];
30850 CYTHON_FALLTHROUGH;
30851 case 2:
30852 val = args[1];
30853 CYTHON_FALLTHROUGH;
30854 case 1:
30855 typ = args[0];
30856 break;
30857 default:
30858 PyErr_SetString(PyExc_TypeError, "throw takes between 1 and 3 positional arguments");
30859 return NULL;
30860 }
30861#endif
30862 return __Pyx__Coroutine_Throw(self, typ, val, tb,
30863#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
30864 args,
30865#else
30866 NULL,
30867#endif
30868 1);
30869}
30870static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
30871#if PY_VERSION_HEX >= 0x030B00a4
30872 Py_VISIT(exc_state->exc_value);
30873#else
30874 Py_VISIT(exc_state->exc_type);
30875 Py_VISIT(exc_state->exc_value);
30876 Py_VISIT(exc_state->exc_traceback);
30877#endif
30878 return 0;
30879}
30880static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
30881 {
30882 int e = __Pyx_call_type_traverse((PyObject*)gen, 1, visit, arg);
30883 if (e) return e;
30884 }
30885 Py_VISIT(gen->closure);
30886 Py_VISIT(gen->classobj);
30887 Py_VISIT(gen->yieldfrom);
30888 return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
30889}
30890static int __Pyx_Coroutine_clear(PyObject *self) {
30891 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
30892 Py_CLEAR(gen->closure);
30893 Py_CLEAR(gen->classobj);
30894 __Pyx_Coroutine_Undelegate(gen);
30895 __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
30896#ifdef __Pyx_AsyncGen_USED
30897 if (__Pyx_AsyncGen_CheckExact(self)) {
30898 Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
30899 }
30900#endif
30901 Py_CLEAR(gen->gi_code);
30902 Py_CLEAR(gen->gi_frame);
30903 Py_CLEAR(gen->gi_name);
30904 Py_CLEAR(gen->gi_qualname);
30905 Py_CLEAR(gen->gi_modulename);
30906 return 0;
30907}
30908static void __Pyx_Coroutine_dealloc(PyObject *self) {
30909 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
30910 PyObject_GC_UnTrack(gen);
30911 #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
30912 if (gen->gi_weakreflist != NULL)
30913 #endif
30914 PyObject_ClearWeakRefs(self);
30915 if (gen->resume_label >= 0) {
30916#if CYTHON_USE_TP_FINALIZE
30917 PyObject_GC_Track(self);
30918 if (unlikely(PyObject_CallFinalizerFromDealloc(self)))
30919 {
30920 return;
30921 }
30922 PyObject_GC_UnTrack(self);
30923#endif
30924 }
30925#ifdef __Pyx_AsyncGen_USED
30926 if (__Pyx_AsyncGen_CheckExact(self)) {
30927 /* We have to handle this case for asynchronous generators
30928 right here, because this code has to be between UNTRACK
30929 and GC_Del. */
30930 Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
30931 }
30932#endif
30933 __Pyx_Coroutine_clear(self);
30934 __Pyx_PyHeapTypeObject_GC_Del(gen);
30935}
30936#if CYTHON_USE_TP_FINALIZE
30937static void __Pyx_Coroutine_del(PyObject *self) {
30938 PyObject *error_type, *error_value, *error_traceback;
30939 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
30940 __Pyx_PyThreadState_declare
30941 if (gen->resume_label < 0) {
30942 return;
30943 }
30944 __Pyx_PyThreadState_assign
30945 __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
30946#ifdef __Pyx_AsyncGen_USED
30947 if (__Pyx_AsyncGen_CheckExact(self)) {
30948 __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
30949 PyObject *finalizer = agen->ag_finalizer;
30950 if (finalizer && !agen->ag_closed) {
30951 PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
30952 if (unlikely(!res)) {
30953 PyErr_WriteUnraisable(self);
30954 } else {
30955 Py_DECREF(res);
30956 }
30957 __Pyx_ErrRestore(error_type, error_value, error_traceback);
30958 return;
30959 }
30960 }
30961#endif
30962 if (unlikely(gen->resume_label == 0 && !error_value)) {
30963#ifdef __Pyx_Coroutine_USED
30964#ifdef __Pyx_Generator_USED
30965 if (!__Pyx_Generator_CheckExact(self))
30966#endif
30967 {
30968 PyObject_GC_UnTrack(self);
30969 if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
30970 PyErr_WriteUnraisable(self);
30971 PyObject_GC_Track(self);
30972 }
30973#endif
30974 } else {
30975 PyObject *retval = NULL;
30976 __Pyx_PySendResult result = __Pyx_Coroutine_Close(self, &retval);
30977 if (result == PYGEN_ERROR) {
30978 PyErr_WriteUnraisable(self);
30979 } else {
30980 Py_XDECREF(retval);
30981 }
30982 }
30983 __Pyx_ErrRestore(error_type, error_value, error_traceback);
30984}
30985#endif
30986static PyObject *
30987__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context)
30988{
30989 PyObject *name = self->gi_name;
30990 CYTHON_UNUSED_VAR(context);
30991 if (unlikely(!name)) name = Py_None;
30992 Py_INCREF(name);
30993 return name;
30994}
30995static int
30996__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context)
30997{
30998 CYTHON_UNUSED_VAR(context);
30999 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
31000 PyErr_SetString(PyExc_TypeError,
31001 "__name__ must be set to a string object");
31002 return -1;
31003 }
31004 Py_INCREF(value);
31005 __Pyx_Py_XDECREF_SET(self->gi_name, value);
31006 return 0;
31007}
31008static PyObject *
31009__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, void *context)
31010{
31011 PyObject *name = self->gi_qualname;
31012 CYTHON_UNUSED_VAR(context);
31013 if (unlikely(!name)) name = Py_None;
31014 Py_INCREF(name);
31015 return name;
31016}
31017static int
31018__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context)
31019{
31020 CYTHON_UNUSED_VAR(context);
31021 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
31022 PyErr_SetString(PyExc_TypeError,
31023 "__qualname__ must be set to a string object");
31024 return -1;
31025 }
31026 Py_INCREF(value);
31027 __Pyx_Py_XDECREF_SET(self->gi_qualname, value);
31028 return 0;
31029}
31030#if !CYTHON_COMPILING_IN_LIMITED_API
31031static PyObject *
31032__Pyx__Coroutine_get_frame_locked(__pyx_CoroutineObject *self) {
31033 PyObject *frame;
31034 frame = self->gi_frame;
31035 if (!frame) {
31036 if (unlikely(!self->gi_code)) {
31037 Py_RETURN_NONE;
31038 }
31039 PyObject *globals = PyDict_New();
31040 if (unlikely(!globals)) return NULL;
31041 frame = (PyObject *) PyFrame_New(
31042 PyThreadState_Get(), /*PyThreadState *tstate,*/
31043 (PyCodeObject*) self->gi_code, /*PyCodeObject *code,*/
31044 globals, /*PyObject *globals,*/
31045 0 /*PyObject *locals*/
31046 );
31047 Py_DECREF(globals);
31048 if (unlikely(!frame))
31049 return NULL;
31050 if (unlikely(self->gi_frame)) {
31051 Py_DECREF(frame);
31052 frame = self->gi_frame;
31053 } else {
31054 self->gi_frame = frame;
31055 }
31056 }
31057 Py_INCREF(frame);
31058 return frame;
31059}
31060#endif
31061static PyObject *
31062__Pyx__Coroutine_get_frame(__pyx_CoroutineObject *self)
31063{
31064#if !CYTHON_COMPILING_IN_LIMITED_API
31065 PyObject *frame;
31066 __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)self);
31067 frame = __Pyx__Coroutine_get_frame_locked(self);
31068 __Pyx_END_CRITICAL_SECTION();
31069 return frame;
31070#else
31071 CYTHON_UNUSED_VAR(self);
31072 Py_RETURN_NONE;
31073#endif
31074}
31075static PyObject *
31076__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context) {
31077 CYTHON_UNUSED_VAR(context);
31078 PyObject *frame = self->gi_frame;
31079 if (frame)
31080 return __Pyx_NewRef(frame);
31081 return __Pyx__Coroutine_get_frame(self);
31082}
31083static __pyx_CoroutineObject *__Pyx__Coroutine_New(
31084 PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
31085 PyObject *name, PyObject *qualname, PyObject *module_name) {
31086 __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
31087 if (unlikely(!gen))
31088 return NULL;
31089 return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
31090}
31091static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
31092 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
31093 PyObject *name, PyObject *qualname, PyObject *module_name) {
31094 gen->body = body;
31095 gen->closure = closure;
31096 Py_XINCREF(closure);
31097 gen->is_running = 0;
31098 gen->resume_label = 0;
31099 gen->classobj = NULL;
31100 gen->yieldfrom = NULL;
31101 gen->yieldfrom_am_send = NULL;
31102 #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_LIMITED_API
31103 gen->gi_exc_state.exc_value = NULL;
31104 #else
31105 gen->gi_exc_state.exc_type = NULL;
31106 gen->gi_exc_state.exc_value = NULL;
31107 gen->gi_exc_state.exc_traceback = NULL;
31108 #endif
31109#if CYTHON_USE_EXC_INFO_STACK
31110 gen->gi_exc_state.previous_item = NULL;
31111#endif
31112#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
31113 gen->gi_weakreflist = NULL;
31114#endif
31115 Py_XINCREF(qualname);
31116 gen->gi_qualname = qualname;
31117 Py_XINCREF(name);
31118 gen->gi_name = name;
31119 Py_XINCREF(module_name);
31120 gen->gi_modulename = module_name;
31121 Py_XINCREF(code);
31122 gen->gi_code = code;
31123 gen->gi_frame = NULL;
31124#if CYTHON_USE_SYS_MONITORING && (CYTHON_PROFILE || CYTHON_TRACE)
31125 memset(gen->__pyx_pymonitoring_state, 0, sizeof(gen->__pyx_pymonitoring_state));
31126 gen->__pyx_pymonitoring_version = 0;
31127#endif
31128 PyObject_GC_Track(gen);
31129 return gen;
31130}
31131static char __Pyx_Coroutine_test_and_set_is_running(__pyx_CoroutineObject *gen) {
31132 char result;
31133 __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)gen);
31134 result = gen->is_running;
31135 gen->is_running = 1;
31136 __Pyx_END_CRITICAL_SECTION();
31137 return result;
31138}
31139static void __Pyx_Coroutine_unset_is_running(__pyx_CoroutineObject *gen) {
31140 __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)gen);
31141 assert(gen->is_running);
31142 gen->is_running = 0;
31143 __Pyx_END_CRITICAL_SECTION();
31144}
31145static char __Pyx_Coroutine_get_is_running(__pyx_CoroutineObject *gen) {
31146 char result;
31147 __Pyx_BEGIN_CRITICAL_SECTION((PyObject*)gen);
31148 result = gen->is_running;
31149 __Pyx_END_CRITICAL_SECTION();
31150 return result;
31151}
31152static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *closure) {
31153 CYTHON_UNUSED_VAR(closure);
31154 char result = __Pyx_Coroutine_get_is_running((__pyx_CoroutineObject*)gen);
31155 if (result) Py_RETURN_TRUE;
31156 else Py_RETURN_FALSE;
31157}
31158#if __PYX_HAS_PY_AM_SEND == 2
31159static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send) {
31160 Py_ssize_t ptr_offset = (char*)(type->tp_as_async) - (char*)type;
31161 if (ptr_offset < 0 || ptr_offset > type->tp_basicsize) {
31162 return;
31163 }
31164 memcpy((void*)static_amsend_methods, (void*)(type->tp_as_async), sizeof(*type->tp_as_async));
31165 static_amsend_methods->am_send = am_send;
31166 type->tp_as_async = __Pyx_SlotTpAsAsync(static_amsend_methods);
31167}
31168#endif
31169static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg) {
31170 CYTHON_UNUSED_VAR(arg);
31171 __Pyx_RaiseTypeErrorWithObjectType(
31172 "cannot pickle '" __Pyx_FMT_TYPENAME "' object", self);
31173 return NULL;
31174}
31175
31176/* Generator */
31177static PyMethodDef __pyx_Generator_methods[] = {
31178 {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
31179 PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
31180 {"throw", __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_Coroutine_Throw),
31181#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
31182 METH_VARARGS,
31183#else
31184 METH_FASTCALL,
31185#endif
31186 PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
31187 {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
31188 PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
31189 {"__reduce_ex__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_O, 0},
31190 {"__reduce__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_NOARGS, 0},
31191 {0, 0, 0, 0}
31192};
31193static PyMemberDef __pyx_Generator_memberlist[] = {
31194 {"gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
31195 PyDoc_STR("object being iterated by 'yield from', or None")},
31196 {"gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
31197 {"__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0},
31198#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
31199 {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0},
31200#endif
31201 {0, 0, 0, 0, 0}
31202};
31203static PyGetSetDef __pyx_Generator_getsets[] = {
31204 {"__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
31205 PyDoc_STR("name of the generator"), 0},
31206 {"__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
31207 PyDoc_STR("qualified name of the generator"), 0},
31208 {"gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
31209 PyDoc_STR("Frame of the generator"), 0},
31210 {"gi_running", __Pyx_Coroutine_get_is_running_getter, NULL, NULL, NULL},
31211 {0, 0, 0, 0, 0}
31212};
31213static PyType_Slot __pyx_GeneratorType_slots[] = {
31214 {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc},
31215 {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse},
31216 {Py_tp_iter, (void *)PyObject_SelfIter},
31217 {Py_tp_iternext, (void *)__Pyx_Generator_Next},
31218 {Py_tp_methods, (void *)__pyx_Generator_methods},
31219 {Py_tp_members, (void *)__pyx_Generator_memberlist},
31220 {Py_tp_getset, (void *)__pyx_Generator_getsets},
31221 {Py_tp_getattro, (void *) PyObject_GenericGetAttr},
31222#if CYTHON_USE_TP_FINALIZE
31223 {Py_tp_finalize, (void *)__Pyx_Coroutine_del},
31224#endif
31225#if __PYX_HAS_PY_AM_SEND == 1
31226 {Py_am_send, (void *)__Pyx_Coroutine_AmSend},
31227#endif
31228 {0, 0},
31229};
31230static PyType_Spec __pyx_GeneratorType_spec = {
31231 __PYX_TYPE_MODULE_PREFIX "generator",
31232 sizeof(__pyx_CoroutineObject),
31233 0,
31234#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
31235 Py_TPFLAGS_MANAGED_WEAKREF |
31236#endif
31237 Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
31238 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | __Pyx_TPFLAGS_HAVE_AM_SEND,
31239 __pyx_GeneratorType_slots
31240};
31241#if __PYX_HAS_PY_AM_SEND == 2
31242static __Pyx_PyAsyncMethodsStruct __pyx_Generator_as_async;
31243#endif
31244static int __pyx_Generator_init(PyObject *module) {
31245 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
31246 mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(
31247 mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_GeneratorType_spec, NULL);
31248 if (unlikely(!mstate->__pyx_GeneratorType)) {
31249 return -1;
31250 }
31251#if __PYX_HAS_PY_AM_SEND == 2
31252 __Pyx_SetBackportTypeAmSend(mstate->__pyx_GeneratorType, &__pyx_Generator_as_async, &__Pyx_Coroutine_AmSend);
31253#endif
31254 return 0;
31255}
31256static PyObject *__Pyx_Generator_GetInlinedResult(PyObject *self) {
31257 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
31258 PyObject *retval = NULL;
31259 if (unlikely(__Pyx_Coroutine_test_and_set_is_running(gen))) {
31260 return __Pyx_Coroutine_AlreadyRunningError(gen);
31261 }
31262 __Pyx_PySendResult result = __Pyx_Coroutine_SendEx(gen, Py_None, &retval, 0);
31263 __Pyx_Coroutine_unset_is_running(gen);
31264 (void) result;
31265 assert (result == PYGEN_RETURN || result == PYGEN_ERROR);
31266 assert ((result == PYGEN_RETURN && retval != NULL) || (result == PYGEN_ERROR && retval == NULL));
31267 return retval;
31268}
31269
31270/* CheckBinaryVersion */
31271static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
31272 const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
31273 if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
31274 return 0;
31275 if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
31276 return 1;
31277 {
31278 char message[200];
31279 PyOS_snprintf(message, sizeof(message),
31280 "compile time Python version %d.%d "
31281 "of module '%.100s' "
31282 "%s "
31283 "runtime version %d.%d",
31284 (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
31285 __Pyx_MODULE_NAME,
31286 (allow_newer) ? "was newer than" : "does not match",
31287 (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
31288 );
31289 return PyErr_WarnEx(NULL, message, 1);
31290 }
31291}
31292
31293/* NewCodeObj */
31294#if CYTHON_COMPILING_IN_LIMITED_API
31295 static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
31296 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
31297 PyObject *fv, PyObject *cell, PyObject* fn,
31298 PyObject *name, int fline, PyObject *lnos) {
31299 PyObject *exception_table = NULL;
31300 PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
31301 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
31302 PyObject *version_info;
31303 PyObject *py_minor_version = NULL;
31304 #endif
31305 long minor_version = 0;
31306 #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
31307 minor_version = 11;
31308 #else
31309 if (!(version_info = PySys_GetObject("version_info"))) goto end;
31310 if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
31311 minor_version = PyLong_AsLong(py_minor_version);
31312 Py_DECREF(py_minor_version);
31313 if (minor_version == -1 && PyErr_Occurred()) goto end;
31314 #endif
31315 if (!(types_module = PyImport_ImportModule("types"))) goto end;
31316 if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
31317 if (minor_version <= 10) {
31318 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOOO", a,p, k, l, s, f, code,
31319 c, n, v, fn, name, fline, lnos, fv, cell);
31320 } else {
31321 if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
31322 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOOOO", a,p, k, l, s, f, code,
31323 c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
31324 }
31325 end:
31326 Py_XDECREF(code_type);
31327 Py_XDECREF(exception_table);
31328 Py_XDECREF(types_module);
31329 if (!result) {
31330 PyObject *exc_type, *exc_value, *exc_tb;
31331 PyErr_Fetch(&exc_type, &exc_value, &exc_tb);
31332 if (PyErr_WarnFormat(
31333 PyExc_RuntimeWarning, 1,
31334 "Code object creation failed in Cython module: %S\nTry recompiling with a more recent version of Cython.",
31335 exc_value ? exc_value : exc_type) == 0) {
31336 result = Py_None;
31337 Py_INCREF(result);
31338 }
31339 Py_DECREF(exc_type);
31340 Py_XDECREF(exc_value);
31341 Py_XDECREF(exc_tb);
31342 }
31343 return result;
31344 }
31345#elif PY_VERSION_HEX >= 0x030B0000
31346 static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
31347 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
31348 PyObject *fv, PyObject *cell, PyObject* fn,
31349 PyObject *name, int fline, PyObject *lnos) {
31350 PyCodeObject *result;
31351 result =
31352 #if PY_VERSION_HEX >= 0x030C0000
31353 PyUnstable_Code_NewWithPosOnlyArgs
31354 #else
31355 PyCode_NewWithPosOnlyArgs
31356 #endif
31357 (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
31358 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
31359 if (likely(result))
31360 result->_co_firsttraceable = 0;
31361 #endif
31362 return result;
31363 }
31364#elif !CYTHON_COMPILING_IN_PYPY
31365 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
31366 PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
31367#else
31368 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
31369 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
31370#endif
31371static PyObject* __Pyx_PyCode_New(
31372 const __Pyx_PyCode_New_function_description descr,
31373 PyObject * const *varnames,
31374 PyObject *filename,
31375 PyObject *funcname,
31376 PyObject *line_table,
31377 PyObject *tuple_dedup_map
31378) {
31379 PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL;
31380 Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
31381 PyObject *varnames_tuple = PyTuple_New(var_count);
31382 if (unlikely(!varnames_tuple)) return NULL;
31383 for (Py_ssize_t i=0; i < var_count; i++) {
31384 Py_INCREF(varnames[i]);
31385 if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done;
31386 }
31387 #if CYTHON_COMPILING_IN_LIMITED_API
31388 varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
31389 if (!varnames_tuple_dedup) {
31390 if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done;
31391 varnames_tuple_dedup = varnames_tuple;
31392 }
31393 #else
31394 varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
31395 if (unlikely(!varnames_tuple_dedup)) goto done;
31396 #endif
31397 #if CYTHON_AVOID_BORROWED_REFS
31398 Py_INCREF(varnames_tuple_dedup);
31399 #endif
31400 if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) {
31401 Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table);
31402 #if !CYTHON_ASSUME_SAFE_SIZE
31403 if (unlikely(line_table_length == -1)) goto done;
31404 #endif
31405 Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL;
31406 code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
31407 if (unlikely(!code_bytes)) goto done;
31408 char* c_code_bytes = PyBytes_AsString(code_bytes);
31409 if (unlikely(!c_code_bytes)) goto done;
31410 memset(c_code_bytes, 0, (size_t) code_len);
31411 }
31412 code_obj = (PyObject*) __Pyx__PyCode_New(
31413 (int) descr.argcount,
31414 (int) descr.num_posonly_args,
31415 (int) descr.num_kwonly_args,
31416 (int) descr.nlocals,
31417 0,
31418 (int) descr.flags,
31419 code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
31420 __pyx_mstate_global->__pyx_empty_tuple,
31421 __pyx_mstate_global->__pyx_empty_tuple,
31422 varnames_tuple_dedup,
31423 __pyx_mstate_global->__pyx_empty_tuple,
31424 __pyx_mstate_global->__pyx_empty_tuple,
31425 filename,
31426 funcname,
31427 (int) descr.first_line,
31428 (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
31429 );
31430done:
31431 Py_XDECREF(code_bytes);
31432 #if CYTHON_AVOID_BORROWED_REFS
31433 Py_XDECREF(varnames_tuple_dedup);
31434 #endif
31435 Py_DECREF(varnames_tuple);
31436 return code_obj;
31437}
31438
31439/* DecompressString */
31440CYTHON_UNUSED
31441static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) {
31442#ifdef __Pyx_DecompressString_UNUSED
31443 CYTHON_UNUSED_VAR(s);
31444 CYTHON_UNUSED_VAR(length);
31445 CYTHON_UNUSED_VAR(algo);
31446 return NULL;
31447#else
31448 PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
31449 const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib";
31450 PyObject *methodname = PyUnicode_FromString("decompress");
31451 if (unlikely(!methodname)) return NULL;
31452 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
31453 if (algo == 3) {
31454 PyObject *fromlist = Py_BuildValue("[O]", methodname);
31455 if (unlikely(!fromlist)) goto bad;
31456 module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
31457 Py_DECREF(fromlist);
31458 } else
31459 #endif
31460 module = PyImport_ImportModule(module_name);
31461 if (unlikely(!module)) goto import_failed;
31462 decompress = PyObject_GetAttr(module, methodname);
31463 if (unlikely(!decompress)) goto import_failed;
31464 {
31465 #ifdef __cplusplus
31466 char *memview_bytes = const_cast<char*>(s);
31467 #else
31468 #if defined(__clang__)
31469 #pragma clang diagnostic push
31470 #pragma clang diagnostic ignored "-Wcast-qual"
31471 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
31472 #pragma GCC diagnostic push
31473 #pragma GCC diagnostic ignored "-Wcast-qual"
31474 #endif
31475 char *memview_bytes = (char*) s;
31476 #if defined(__clang__)
31477 #pragma clang diagnostic pop
31478 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
31479 #pragma GCC diagnostic pop
31480 #endif
31481 #endif
31482 #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
31483 int memview_flags = 0x100;
31484 #else
31485 int memview_flags = PyBUF_READ;
31486 #endif
31487 compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
31488 }
31489 if (unlikely(!compressed_bytes)) {
31490 Py_DECREF(decompress);
31491 goto bad;
31492 }
31493 decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
31494 Py_DECREF(compressed_bytes);
31495 Py_DECREF(decompress);
31496 Py_DECREF(module);
31497 Py_DECREF(methodname);
31498 return decompressed;
31499import_failed:
31500 PyErr_Format(PyExc_ImportError,
31501 "Failed to import '%.20s.decompress' - cannot initialise module strings. "
31502 "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
31503 module_name, algo);
31504bad:
31505 Py_XDECREF(module);
31506 Py_DECREF(methodname);
31507 return NULL;
31508#endif
31509}
31510
31511/* DecompressString_LZSS */
31512#ifndef __Pyx_DecompressString_LZSS_UNUSED
31513CYTHON_UNUSED
31514static CYTHON_SMALL_CODE size_t __pyx_lzss_decompress(const uint8_t* src, uint8_t* dst, size_t dst_len) {
31515 size_t pos = 0, out_pos = 0;
31516 while (1) {
31517 uint32_t flags = src[pos++] | 0xFF00;
31518 while (flags & 0x100) {
31519 if (flags & 1) {
31520 dst[out_pos++] = src[pos++];
31521 } else {
31522 uint32_t lo = src[pos++], hi = src[pos++];
31523 uint32_t end_offset_of_last_occurrence, match_length;
31524 if (!(lo & 0x80)) {
31525 end_offset_of_last_occurrence = lo;
31526 match_length = hi;
31527 } else if (!(hi & 0x80)) {
31528 end_offset_of_last_occurrence = 0x80 + (((hi << 2) & 0x180) | (lo & 0x7F));
31529 match_length = hi & 0x1F;
31530 } else {
31531 end_offset_of_last_occurrence = 0x80 + ((hi & 0x7F) << 7 | (lo & 0x7F));
31532 match_length = src[pos++];
31533 }
31534 match_length += 3;
31535 size_t ref_pos = out_pos - end_offset_of_last_occurrence - match_length;
31536 memcpy(dst + out_pos, dst + ref_pos, match_length);
31537 out_pos += match_length;
31538 }
31539 if (out_pos >= dst_len) return pos;
31540 flags >>= 1;
31541 }
31542 }
31543}
31544#endif
31545static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString_LZSS(const char *s, size_t compressed_length, size_t uncompressed_length) {
31546#ifdef __Pyx_DecompressString_LZSS_UNUSED
31547 CYTHON_UNUSED_VAR(s);
31548 CYTHON_UNUSED_VAR(compressed_length);
31549 CYTHON_UNUSED_VAR(uncompressed_length);
31550 return NULL;
31551#else
31552 PyObject *result;
31553 unsigned char *result_data;
31554 size_t src_length;
31555 result = PyBytes_FromStringAndSize(NULL, (Py_ssize_t) uncompressed_length);
31556 if (unlikely(!result)) return NULL;
31557 result_data = __Pyx_PyBytes_AsWritableUString(result);
31558 if (unlikely(!result_data)) goto bad;
31559 src_length = __pyx_lzss_decompress((const uint8_t*) s, result_data, uncompressed_length);
31560 if (unlikely(src_length != compressed_length)) goto decompression_failed;
31561 return result;
31562decompression_failed:
31563 PyErr_SetString(PyExc_RuntimeError, "LZSS string data decompression failed");
31564bad:
31565 Py_DECREF(result);
31566 return NULL;
31567#endif
31568}
31569
31570#include <string.h>
31571static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
31572 size_t len = strlen(s);
31573 if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
31574 PyErr_SetString(PyExc_OverflowError, "byte string is too long");
31575 return -1;
31576 }
31577 return (Py_ssize_t) len;
31578}
31579static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
31580 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
31581 if (unlikely(len < 0)) return NULL;
31582 return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
31583}
31584static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
31585 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
31586 if (unlikely(len < 0)) return NULL;
31587 return PyByteArray_FromStringAndSize(c_str, len);
31588}
31589static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
31590 Py_ssize_t ignore;
31591 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
31592}
31593#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
31594static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
31595 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
31596#if CYTHON_COMPILING_IN_LIMITED_API
31597 {
31598 const char* result;
31599 Py_ssize_t unicode_length;
31600 CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
31601 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
31602 if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL;
31603 #else
31604 result = PyUnicode_AsUTF8AndSize(o, length);
31605 #endif
31606 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
31607 unicode_length = PyUnicode_GetLength(o);
31608 if (unlikely(unicode_length < 0)) return NULL;
31609 if (unlikely(unicode_length != *length)) {
31610 PyUnicode_AsASCIIString(o);
31611 return NULL;
31612 }
31613 #endif
31614 return result;
31615 }
31616#else
31617#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
31618 if (likely(PyUnicode_IS_ASCII(o))) {
31619 *length = PyUnicode_GET_LENGTH(o);
31620 return PyUnicode_AsUTF8(o);
31621 } else {
31622 PyUnicode_AsASCIIString(o);
31623 return NULL;
31624 }
31625#else
31626 return PyUnicode_AsUTF8AndSize(o, length);
31627#endif
31628#endif
31629}
31630#endif
31631static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
31632#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
31633 if (PyUnicode_Check(o)) {
31634 return __Pyx_PyUnicode_AsStringAndSize(o, length);
31635 } else
31636#endif
31637 if (PyByteArray_Check(o)) {
31638#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
31639 *length = PyByteArray_GET_SIZE(o);
31640 return PyByteArray_AS_STRING(o);
31641#else
31642 *length = PyByteArray_Size(o);
31643 if (*length == -1) return NULL;
31644 return PyByteArray_AsString(o);
31645#endif
31646 } else
31647 {
31648 char* result;
31649 int r = PyBytes_AsStringAndSize(o, &result, length);
31650 if (unlikely(r < 0)) {
31651 return NULL;
31652 } else {
31653 return result;
31654 }
31655 }
31656}
31657static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
31658 int is_true = x == Py_True;
31659 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
31660 else return PyObject_IsTrue(x);
31661}
31662static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
31663 int retval;
31664 if (unlikely(!x)) return -1;
31665 retval = __Pyx_PyObject_IsTrue(x);
31666 Py_DECREF(x);
31667 return retval;
31668}
31669static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) {
31670 __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
31671 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
31672 if (unlikely(!result_type_name)) goto bad;
31673 #endif
31674 if (PyLong_Check(result)) {
31675 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
31676 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). "
31677 "The ability to return an instance of a strict subclass of int is deprecated, "
31678 "and may be removed in a future version of Python.",
31679 result_type_name)) {
31680 __Pyx_DECREF_TypeName(result_type_name);
31681 goto bad;
31682 }
31683 __Pyx_DECREF_TypeName(result_type_name);
31684 return result;
31685 }
31686 PyErr_Format(PyExc_TypeError,
31687 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")",
31688 result_type_name);
31689 __Pyx_DECREF_TypeName(result_type_name);
31690bad:
31691 Py_DECREF(result);
31692 return NULL;
31693}
31694static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
31695#if CYTHON_USE_TYPE_SLOTS
31696 PyNumberMethods *m;
31697#endif
31698 PyObject *res = NULL;
31699 if (likely(PyLong_Check(x)))
31700 return __Pyx_NewRef(x);
31701#if CYTHON_USE_TYPE_SLOTS
31702 m = Py_TYPE(x)->tp_as_number;
31703 if (likely(m && m->nb_int)) {
31704 res = m->nb_int(x);
31705 }
31706#else
31707 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
31708 res = PyNumber_Long(x);
31709 }
31710#endif
31711 if (likely(res)) {
31712 if (unlikely(!PyLong_CheckExact(res))) {
31713 return __Pyx_PyNumber_LongWrongResultType(res);
31714 }
31715 }
31716 else if (!PyErr_Occurred()) {
31717 PyErr_SetString(PyExc_TypeError,
31718 "an integer is required");
31719 }
31720 return res;
31721}
31722static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_AsSsize_t(PyObject* b) {
31723 #if CYTHON_USE_PYLONG_INTERNALS
31724 Py_ssize_t ival;
31725 const Py_ssize_t size = __Pyx_PyLong_DigitCount(b);
31726 const int is_neg = __Pyx_PyLong_IsNeg(b);
31727 const digit* digits = __Pyx_PyLong_Digits(b);
31728 if (size == 0) return 0;
31729 #if SIZEOF_SIZE_T * 8 > 1 * PyLong_SHIFT
31730 if (size == 1) {
31731 ival = (Py_ssize_t) (((size_t)digits[0]));
31732 } else
31733 #endif
31734 #if SIZEOF_SIZE_T * 8 > 2 * PyLong_SHIFT
31735 if (size == 2) {
31736 ival = (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
31737 } else
31738 #endif
31739 #if SIZEOF_SIZE_T * 8 > 3 * PyLong_SHIFT
31740 if (size == 3) {
31741 ival = (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
31742 } else
31743 #endif
31744 #if SIZEOF_SIZE_T * 8 > 4 * PyLong_SHIFT
31745 if (size == 4) {
31746 ival = (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]));
31747 } else
31748 #endif
31749 return PyLong_AsSsize_t(b);
31750 return is_neg ? -ival : ival;
31751 #else
31752 return PyLong_AsSsize_t(b);
31753 #endif
31754}
31755static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
31756 if (likely(PyLong_Check(b))) {
31757 return __Pyx_PyLong_AsSsize_t(b);
31758 } else {
31759 Py_ssize_t ival;
31760 PyObject *x = PyNumber_Index(b);
31761 if (unlikely(!x)) return -1;
31762 ival = __Pyx_PyLong_AsSsize_t(x);
31763 Py_DECREF(x);
31764 return ival;
31765 }
31766}
31767static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
31768 if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
31769 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
31770 } else {
31771 Py_ssize_t ival;
31772 PyObject *x;
31773 x = PyNumber_Index(o);
31774 if (!x) return -1;
31775 ival = PyLong_AsLong(x);
31776 Py_DECREF(x);
31777 return ival;
31778 }
31779}
31780static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) {
31781 CYTHON_UNUSED_VAR(b);
31782 return __Pyx_NewRef(Py_None);
31783}
31784static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
31785 return __Pyx_NewRef(b ? Py_True: Py_False);
31786}
31787static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) {
31788 return PyLong_FromSize_t(ival);
31789}
31790
31791
31792/* MultiPhaseInitModuleState */
31793#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
31794#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
31795#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
31796 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
31797#else
31798 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
31799#endif
31800#endif
31801#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
31802#error "Module state with PEP489 requires atomics. Currently that's one of\
31803 C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
31804#endif
31805#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
31806#define __Pyx_ModuleStateLookup_Lock()
31807#define __Pyx_ModuleStateLookup_Unlock()
31808#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
31809static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
31810#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
31811#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
31812#elif defined(__cplusplus) && __cplusplus >= 201103L
31813#include <mutex>
31814static std::mutex __Pyx_ModuleStateLookup_mutex;
31815#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
31816#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
31817#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
31818#include <threads.h>
31819static mtx_t __Pyx_ModuleStateLookup_mutex;
31820static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
31821static void __Pyx_ModuleStateLookup_initialize_mutex(void) {
31822 mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
31823}
31824#define __Pyx_ModuleStateLookup_Lock()\
31825 call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
31826 mtx_lock(&__Pyx_ModuleStateLookup_mutex)
31827#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
31828#elif defined(HAVE_PTHREAD_H)
31829#include <pthread.h>
31830static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
31831#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
31832#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
31833#elif defined(_WIN32)
31834#include <Windows.h> // synchapi.h on its own doesn't work
31835static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
31836#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
31837#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
31838#else
31839#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
31840 Requires C standard >= C11, or C++ standard >= C++11,\
31841 or pthreads, or the Windows 32 API, or Python >= 3.13."
31842#endif
31843typedef struct {
31844 int64_t id;
31845 PyObject *module;
31846} __Pyx_InterpreterIdAndModule;
31847typedef struct {
31848 char interpreter_id_as_index;
31849 Py_ssize_t count;
31850 Py_ssize_t allocated;
31851 __Pyx_InterpreterIdAndModule table[1];
31852} __Pyx_ModuleStateLookupData;
31853#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
31854#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
31855static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
31856#endif
31857#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
31858static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
31859#else
31860static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
31861#endif
31862static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
31863 __Pyx_InterpreterIdAndModule* table,
31864 Py_ssize_t count,
31865 int64_t interpreterId) {
31866 __Pyx_InterpreterIdAndModule* begin = table;
31867 __Pyx_InterpreterIdAndModule* end = begin + count;
31868 if (begin->id == interpreterId) {
31869 return begin;
31870 }
31871 while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
31872 __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
31873 if (halfway->id == interpreterId) {
31874 return halfway;
31875 }
31876 if (halfway->id < interpreterId) {
31877 begin = halfway;
31878 } else {
31879 end = halfway;
31880 }
31881 }
31882 for (; begin < end; ++begin) {
31883 if (begin->id >= interpreterId) return begin;
31884 }
31885 return begin;
31886}
31887static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) {
31888 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
31889 if (interpreter_id == -1) return NULL;
31890#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
31891 __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
31892 {
31893 __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
31894 if (likely(data)) {
31895 __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
31896 if (likely(data == new_data)) {
31897 goto read_finished;
31898 }
31899 }
31900 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
31901 __Pyx_ModuleStateLookup_Lock();
31902 __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
31903 data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
31904 __Pyx_ModuleStateLookup_Unlock();
31905 }
31906 read_finished:;
31907#else
31908 __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
31909#endif
31910 __Pyx_InterpreterIdAndModule* found = NULL;
31911 if (unlikely(!data)) goto end;
31912 if (data->interpreter_id_as_index) {
31913 if (interpreter_id < data->count) {
31914 found = data->table+interpreter_id;
31915 }
31916 } else {
31917 found = __Pyx_State_FindModuleStateLookupTableLowerBound(
31918 data->table, data->count, interpreter_id);
31919 }
31920 end:
31921 {
31922 PyObject *result=NULL;
31923 if (found && found->id == interpreter_id) {
31924 result = found->module;
31925 }
31926#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
31927 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
31928#endif
31929 return result;
31930 }
31931}
31932#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
31933static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) {
31934 while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
31935}
31936#else
31937#define __Pyx_ModuleStateLookup_wait_until_no_readers()
31938#endif
31939static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
31940 Py_ssize_t to_allocate = (*old_data)->allocated;
31941 while (to_allocate <= interpreter_id) {
31942 if (to_allocate == 0) to_allocate = 1;
31943 else to_allocate *= 2;
31944 }
31945 __Pyx_ModuleStateLookupData *new_data = *old_data;
31946 if (to_allocate != (*old_data)->allocated) {
31947 new_data = (__Pyx_ModuleStateLookupData *)realloc(
31948 *old_data,
31949 sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
31950 if (!new_data) {
31951 PyErr_NoMemory();
31952 return -1;
31953 }
31954 for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
31955 new_data->table[i].id = i;
31956 new_data->table[i].module = NULL;
31957 }
31958 new_data->allocated = to_allocate;
31959 }
31960 new_data->table[interpreter_id].module = module;
31961 if (new_data->count < interpreter_id+1) {
31962 new_data->count = interpreter_id+1;
31963 }
31964 *old_data = new_data;
31965 return 0;
31966}
31967static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
31968 __Pyx_InterpreterIdAndModule *read = data->table;
31969 __Pyx_InterpreterIdAndModule *write = data->table;
31970 __Pyx_InterpreterIdAndModule *end = read + data->count;
31971 for (; read<end; ++read) {
31972 if (read->module) {
31973 write->id = read->id;
31974 write->module = read->module;
31975 ++write;
31976 }
31977 }
31978 data->count = write - data->table;
31979 for (; write<end; ++write) {
31980 write->id = 0;
31981 write->module = NULL;
31982 }
31983 data->interpreter_id_as_index = 0;
31984}
31985static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) {
31986 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
31987 if (interpreter_id == -1) return -1;
31988 int result = 0;
31989 __Pyx_ModuleStateLookup_Lock();
31990#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
31991 __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
31992 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
31993#else
31994 __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
31995#endif
31996 __Pyx_ModuleStateLookupData *new_data = old_data;
31997 if (!new_data) {
31998 new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData));
31999 if (!new_data) {
32000 result = -1;
32001 PyErr_NoMemory();
32002 goto end;
32003 }
32004 new_data->allocated = 1;
32005 new_data->interpreter_id_as_index = 1;
32006 }
32007 __Pyx_ModuleStateLookup_wait_until_no_readers();
32008 if (new_data->interpreter_id_as_index) {
32009 if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
32010 result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
32011 goto end;
32012 }
32013 __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
32014 }
32015 {
32016 Py_ssize_t insert_at = 0;
32017 {
32018 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
32019 new_data->table, new_data->count, interpreter_id);
32020 assert(lower_bound);
32021 insert_at = lower_bound - new_data->table;
32022 if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
32023 lower_bound->module = module;
32024 goto end; // already in table, nothing more to do
32025 }
32026 }
32027 if (new_data->count+1 >= new_data->allocated) {
32028 Py_ssize_t to_allocate = (new_data->count+1)*2;
32029 new_data =
32030 (__Pyx_ModuleStateLookupData*)realloc(
32031 new_data,
32032 sizeof(__Pyx_ModuleStateLookupData) +
32033 (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
32034 if (!new_data) {
32035 result = -1;
32036 new_data = old_data;
32037 PyErr_NoMemory();
32038 goto end;
32039 }
32040 new_data->allocated = to_allocate;
32041 }
32042 ++new_data->count;
32043 int64_t last_id = interpreter_id;
32044 PyObject *last_module = module;
32045 for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
32046 int64_t current_id = new_data->table[i].id;
32047 new_data->table[i].id = last_id;
32048 last_id = current_id;
32049 PyObject *current_module = new_data->table[i].module;
32050 new_data->table[i].module = last_module;
32051 last_module = current_module;
32052 }
32053 }
32054 end:
32055#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
32056 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
32057#else
32058 __Pyx_ModuleStateLookup_data = new_data;
32059#endif
32060 __Pyx_ModuleStateLookup_Unlock();
32061 return result;
32062}
32063static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) {
32064 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
32065 if (interpreter_id == -1) return -1;
32066 __Pyx_ModuleStateLookup_Lock();
32067#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
32068 __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
32069 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
32070#else
32071 __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
32072#endif
32073 if (data->interpreter_id_as_index) {
32074 if (interpreter_id < data->count) {
32075 data->table[interpreter_id].module = NULL;
32076 }
32077 goto done;
32078 }
32079 {
32080 __Pyx_ModuleStateLookup_wait_until_no_readers();
32081 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
32082 data->table, data->count, interpreter_id);
32083 if (!lower_bound) goto done;
32084 if (lower_bound->id != interpreter_id) goto done;
32085 __Pyx_InterpreterIdAndModule *end = data->table+data->count;
32086 for (;lower_bound<end-1; ++lower_bound) {
32087 lower_bound->id = (lower_bound+1)->id;
32088 lower_bound->module = (lower_bound+1)->module;
32089 }
32090 }
32091 --data->count;
32092 if (data->count == 0) {
32093 free(data);
32094 data = NULL;
32095 }
32096 done:
32097#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
32098 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
32099#else
32100 __Pyx_ModuleStateLookup_data = data;
32101#endif
32102 __Pyx_ModuleStateLookup_Unlock();
32103 return 0;
32104}
32105#endif
32106
32107/* #### Code section: utility_code_pragmas_end ### */
32108#ifdef _MSC_VER
32109#pragma warning( pop )
32110#endif
32111
32112
32113
32114/* #### Code section: end ### */
32115#endif /* Py_PYTHON_H */
Int n
Definition Headers.h:28
Double T
Definition Headers.h:87
Double L
Definition Headers.h:72
Double r
Definition Headers.h:83
Int number
Definition Headers.h:33
Double f
Definition Headers.h:64
Double s
Definition Headers.h:84
Int ns
Definition Headers.h:30
Double * z
Definition Headers.h:49
Double v
Definition Headers.h:95
#define c(i)
Definition jf.h:21