proteus 1.9.0
C/C++/Fortran libraries
Loading...
Searching...
No Matches
cpartitioning.cpp
Go to the documentation of this file.
1/* Generated by Cython 3.3.0 */
2
3/* BEGIN: Cython Metadata
4{
5 "distutils": {
6 "define_macros": [
7 [
8 "PROTEUS_SUPERLU_H",
9 "\"slu_ddefs.h\""
10 ],
11 [
12 "CMRVEC_BOUNDS_CHECK",
13 1
14 ],
15 [
16 "MV_VECTOR_BOUNDS_CHECK",
17 1
18 ],
19 [
20 "PETSCVEC_BOUNDS_CHECK",
21 1
22 ],
23 [
24 "F77_POST_UNDERSCORE",
25 1
26 ],
27 [
28 "USE_BLAS",
29 1
30 ]
31 ],
32 "depends": [
33 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/arrayobject.h",
34 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/arrayscalars.h",
35 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/ndarrayobject.h",
36 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/ndarraytypes.h",
37 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include/numpy/ufuncobject.h",
38 "proteus/cmeshTools.pxd",
39 "proteus/cpartitioning.pyx",
40 "proteus/mesh.cpp",
41 "proteus/mesh.h",
42 "proteus/meshio.cpp",
43 "proteus/partitioning.cpp",
44 "proteus/partitioning.h"
45 ],
46 "extra_compile_args": [
47 "-std=c++20",
48 "-Wall",
49 "-DF77_POST_UNDERSCORE",
50 "-DUSE_BLAS",
51 "-DCMRVEC_BOUNDS_CHECK",
52 "-DMV_VECTOR_BOUNDS_CHECK",
53 "-DPETSC_INCLUDE_AS_C",
54 "-DPETSC_SKIP_COMPLEX"
55 ],
56 "extra_link_args": [
57 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
58 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
59 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
60 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
61 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
62 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
63 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
64 "-Wl,-rpath,/work/cekees/miniforge3/envs/proteus-jupyterhub/lib"
65 ],
66 "include_dirs": [
67 "proteus",
68 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/_core/include",
69 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/pybind11/include",
70 "/work/cekees/miniforge3/envs/proteus-jupyterhub/include",
71 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib",
72 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/mpi4py",
73 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages"
74 ],
75 "language": "c++",
76 "libraries": [
77 "hdf5",
78 "stdc++",
79 "m",
80 "petsc",
81 "mpi",
82 "hdf5"
83 ],
84 "library_dirs": [
85 "/work/cekees/miniforge3/envs/proteus-jupyterhub/lib"
86 ],
87 "name": "cpartitioning",
88 "sources": [
89 "proteus/cpartitioning.pyx",
90 "proteus/partitioning.cpp",
91 "proteus/mesh.cpp",
92 "proteus/meshio.cpp"
93 ]
94 },
95 "module_name": "cpartitioning"
96}
97END: Cython Metadata */
98
99#ifndef PY_SSIZE_T_CLEAN
100#define PY_SSIZE_T_CLEAN
101#endif /* PY_SSIZE_T_CLEAN */
102/* InitLimitedAPI */
103#if defined(Py_LIMITED_API)
104 #if !defined(CYTHON_LIMITED_API)
105 #define CYTHON_LIMITED_API 1
106 #endif
107#elif defined(CYTHON_LIMITED_API)
108 #ifdef _MSC_VER
109 #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.")
110 #else
111 #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.
112 #endif
113#endif
114
115#include "Python.h"
116#ifndef Py_PYTHON_H
117 #error Python headers needed to compile C extensions, please install development version of Python.
118#elif PY_VERSION_HEX < 0x03090000
119 #error Cython requires Python 3.9+.
120#elif defined(Py_LIMITED_API) && (Py_LIMITED_API & 0xFFFF0000) > (PY_VERSION_HEX & 0xFFFF0000)
121 #error 'Py_LIMITED_API' can only select past Python X.Y versions, not future ones.
122#else
123#define __PYX_ABI_VERSION "3_3_0"
124#define CYTHON_HEX_VERSION 0x030300F0
125#define CYTHON_FUTURE_DIVISION 1
126/* CModulePreamble */
127#include <stddef.h>
128#ifndef offsetof
129 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
130#endif
131#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
132 #ifndef __stdcall
133 #define __stdcall
134 #endif
135 #ifndef __cdecl
136 #define __cdecl
137 #endif
138 #ifndef __fastcall
139 #define __fastcall
140 #endif
141#endif
142#ifdef __has_builtin
143 #define __Pyx_has_cbuiltin(name) __has_builtin(name)
144#else
145 #define __Pyx_has_cbuiltin(name) (0)
146#endif
147#ifndef DL_IMPORT
148 #define DL_IMPORT(t) t
149#endif
150#ifndef DL_EXPORT
151 #define DL_EXPORT(t) t
152#endif
153#define __PYX_COMMA ,
154#ifndef PY_LONG_LONG
155 #define PY_LONG_LONG LONG_LONG
156#endif
157#ifndef Py_HUGE_VAL
158 #define Py_HUGE_VAL HUGE_VAL
159#endif
160#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
161#if defined(CYTHON_LIMITED_API)
162 #ifdef Py_LIMITED_API
163 #undef __PYX_LIMITED_VERSION_HEX
164 #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
165 #if Py_LIMITED_API < 0x03090000
166 #error "Cython 3.3 requires the Python Limited API version to be 3.9 or greater."
167 #endif
168 #endif
169 #if defined(GRAALVM_PYTHON) || defined(PYPY_VERSION)
170 #ifdef _MSC_VER
171 #pragma message ("Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
172 code for PyPy and GraalPy and is unlikely to work.")
173 #else
174 #warning "Py_LIMITED_API is defined on PyPy or GraalPy. This takes precedence over Cython's specialized\
175 code for PyPy and GraalPy and is unlikely to work."
176 #endif
177 #endif
178 #define CYTHON_COMPILING_IN_PYPY 0
179 #define CYTHON_COMPILING_IN_CPYTHON 0
180 #define CYTHON_COMPILING_IN_LIMITED_API 1
181 #define CYTHON_COMPILING_IN_GRAAL 0
182 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
183 #undef CYTHON_USE_TYPE_SLOTS
184 #define CYTHON_USE_TYPE_SLOTS 0
185 #undef CYTHON_USE_TYPE_SPECS
186 #define CYTHON_USE_TYPE_SPECS 1
187 #undef CYTHON_USE_PYTYPE_LOOKUP
188 #define CYTHON_USE_PYTYPE_LOOKUP 0
189 #undef CYTHON_USE_PYLIST_INTERNALS
190 #define CYTHON_USE_PYLIST_INTERNALS 0
191 #undef CYTHON_USE_UNICODE_INTERNALS
192 #define CYTHON_USE_UNICODE_INTERNALS 0
193 #ifndef CYTHON_USE_UNICODE_WRITER
194 #define CYTHON_USE_UNICODE_WRITER 0
195 #endif
196 #undef CYTHON_USE_PYLONG_INTERNALS
197 #define CYTHON_USE_PYLONG_INTERNALS 0
198 #ifndef CYTHON_AVOID_BORROWED_REFS
199 #define CYTHON_AVOID_BORROWED_REFS 0
200 #endif
201 #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
202 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
203 #endif
204 #undef CYTHON_ASSUME_SAFE_MACROS
205 #define CYTHON_ASSUME_SAFE_MACROS 0
206 #undef CYTHON_ASSUME_SAFE_SIZE
207 #define CYTHON_ASSUME_SAFE_SIZE 0
208 #undef CYTHON_UNPACK_METHODS
209 #define CYTHON_UNPACK_METHODS 0
210 #undef CYTHON_FAST_THREAD_STATE
211 #define CYTHON_FAST_THREAD_STATE 0
212 #undef CYTHON_FAST_GIL
213 #define CYTHON_FAST_GIL 0
214 #undef CYTHON_VECTORCALL
215 #define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
216 #ifndef CYTHON_VECTORCALL_TPNEW
217 #define CYTHON_VECTORCALL_TPNEW (CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
218 #endif
219 #ifndef CYTHON_PEP487_INIT_SUBCLASS
220 #define CYTHON_PEP487_INIT_SUBCLASS 1
221 #endif
222 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
223 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
224 #endif
225 #ifndef CYTHON_USE_MODULE_STATE
226 #define CYTHON_USE_MODULE_STATE 0
227 #endif
228 #undef CYTHON_USE_SYS_MONITORING
229 #define CYTHON_USE_SYS_MONITORING 0
230 #ifndef CYTHON_USE_TP_FINALIZE
231 #define CYTHON_USE_TP_FINALIZE (__PYX_LIMITED_VERSION_HEX >= 0x030F0000 && PY_VERSION_HEX > 0x030F00A8)
232 #endif
233 #ifndef CYTHON_USE_AM_SEND
234 #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
235 #endif
236 #undef CYTHON_USE_DICT_VERSIONS
237 #define CYTHON_USE_DICT_VERSIONS 0
238 #undef CYTHON_USE_EXC_INFO_STACK
239 #define CYTHON_USE_EXC_INFO_STACK 0
240 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
241 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
242 #endif
243 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
244 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
245 #endif
246 #ifndef CYTHON_USE_FREELISTS
247 #define CYTHON_USE_FREELISTS 1
248 #endif
249 #undef CYTHON_IMMORTAL_CONSTANTS
250 #define CYTHON_IMMORTAL_CONSTANTS 0
251 #if __PYX_LIMITED_VERSION_HEX < 0x030E0000
252 #undef CYTHON_OPAQUE_OBJECTS
253 #define CYTHON_OPAQUE_OBJECTS 0
254 #elif !defined(CYTHON_OPAQUE_OBJECTS)
255 #define CYTHON_OPAQUE_OBJECTS (__PYX_LIMITED_VERSION_HEX >= 0x030F0000)
256 #endif
257#elif defined(GRAALVM_PYTHON)
258 /* For very preliminary testing purposes. Most variables are set the same as PyPy.
259 The existence of this section does not imply that anything works or is even tested */
260 #define CYTHON_COMPILING_IN_PYPY 0
261 #define CYTHON_COMPILING_IN_CPYTHON 0
262 #define CYTHON_COMPILING_IN_LIMITED_API 0
263 #define CYTHON_COMPILING_IN_GRAAL 1
264 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
265 #ifndef CYTHON_USE_TYPE_SLOTS
266 #define CYTHON_USE_TYPE_SLOTS 0
267 #endif
268 #undef CYTHON_USE_TYPE_SPECS
269 #define CYTHON_USE_TYPE_SPECS 0
270 #undef CYTHON_USE_PYTYPE_LOOKUP
271 #define CYTHON_USE_PYTYPE_LOOKUP 0
272 #undef CYTHON_USE_PYLIST_INTERNALS
273 #define CYTHON_USE_PYLIST_INTERNALS 0
274 #undef CYTHON_USE_UNICODE_INTERNALS
275 #define CYTHON_USE_UNICODE_INTERNALS 0
276 #undef CYTHON_USE_UNICODE_WRITER
277 #define CYTHON_USE_UNICODE_WRITER 0
278 #undef CYTHON_USE_PYLONG_INTERNALS
279 #define CYTHON_USE_PYLONG_INTERNALS 0
280 #undef CYTHON_AVOID_BORROWED_REFS
281 #define CYTHON_AVOID_BORROWED_REFS 1
282 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
283 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
284 #undef CYTHON_ASSUME_SAFE_MACROS
285 #define CYTHON_ASSUME_SAFE_MACROS 0
286 #undef CYTHON_ASSUME_SAFE_SIZE
287 #define CYTHON_ASSUME_SAFE_SIZE 0
288 #undef CYTHON_UNPACK_METHODS
289 #define CYTHON_UNPACK_METHODS 0
290 #undef CYTHON_FAST_THREAD_STATE
291 #define CYTHON_FAST_THREAD_STATE 0
292 #undef CYTHON_FAST_GIL
293 #define CYTHON_FAST_GIL 0
294 #ifndef CYTHON_VECTORCALL
295 #define CYTHON_VECTORCALL 1
296 #endif
297 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
298 #undef CYTHON_VECTORCALL_TPNEW
299 #define CYTHON_VECTORCALL_TPNEW 0
300 #elif !defined(CYTHON_VECTORCALL_TPNEW)
301 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
302 #endif
303 #ifndef CYTHON_PEP487_INIT_SUBCLASS
304 #define CYTHON_PEP487_INIT_SUBCLASS 1
305 #endif
306 #undef CYTHON_PEP489_MULTI_PHASE_INIT
307 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
308 #undef CYTHON_USE_MODULE_STATE
309 #define CYTHON_USE_MODULE_STATE 0
310 #undef CYTHON_USE_SYS_MONITORING
311 #define CYTHON_USE_SYS_MONITORING 0
312 #undef CYTHON_USE_TP_FINALIZE
313 #define CYTHON_USE_TP_FINALIZE 0
314 #undef CYTHON_USE_AM_SEND
315 #define CYTHON_USE_AM_SEND 0
316 #undef CYTHON_USE_DICT_VERSIONS
317 #define CYTHON_USE_DICT_VERSIONS 0
318 #undef CYTHON_USE_EXC_INFO_STACK
319 #define CYTHON_USE_EXC_INFO_STACK 1
320 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
321 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
322 #endif
323 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
324 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
325 #endif
326 #undef CYTHON_USE_FREELISTS
327 #define CYTHON_USE_FREELISTS 0
328 #undef CYTHON_IMMORTAL_CONSTANTS
329 #define CYTHON_IMMORTAL_CONSTANTS 0
330 #undef CYTHON_OPAQUE_OBJECTS
331 #define CYTHON_OPAQUE_OBJECTS 0
332#elif defined(PYPY_VERSION)
333 #define CYTHON_COMPILING_IN_PYPY 1
334 #define CYTHON_COMPILING_IN_CPYTHON 0
335 #define CYTHON_COMPILING_IN_LIMITED_API 0
336 #define CYTHON_COMPILING_IN_GRAAL 0
337 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
338 #undef CYTHON_USE_TYPE_SLOTS
339 #define CYTHON_USE_TYPE_SLOTS 1
340 #ifndef CYTHON_USE_TYPE_SPECS
341 #define CYTHON_USE_TYPE_SPECS 0
342 #endif
343 #undef CYTHON_USE_PYTYPE_LOOKUP
344 #define CYTHON_USE_PYTYPE_LOOKUP 0
345 #undef CYTHON_USE_PYLIST_INTERNALS
346 #define CYTHON_USE_PYLIST_INTERNALS 0
347 #undef CYTHON_USE_UNICODE_INTERNALS
348 #define CYTHON_USE_UNICODE_INTERNALS 0
349 #undef CYTHON_USE_UNICODE_WRITER
350 #define CYTHON_USE_UNICODE_WRITER 0
351 #undef CYTHON_USE_PYLONG_INTERNALS
352 #define CYTHON_USE_PYLONG_INTERNALS 0
353 #undef CYTHON_AVOID_BORROWED_REFS
354 #define CYTHON_AVOID_BORROWED_REFS 1
355 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
356 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
357 #undef CYTHON_ASSUME_SAFE_MACROS
358 #define CYTHON_ASSUME_SAFE_MACROS 0
359 #ifndef CYTHON_ASSUME_SAFE_SIZE
360 #define CYTHON_ASSUME_SAFE_SIZE 1
361 #endif
362 #undef CYTHON_UNPACK_METHODS
363 #define CYTHON_UNPACK_METHODS 0
364 #undef CYTHON_FAST_THREAD_STATE
365 #define CYTHON_FAST_THREAD_STATE 0
366 #undef CYTHON_FAST_GIL
367 #define CYTHON_FAST_GIL 0
368 #ifndef CYTHON_VECTORCALL
369 #define CYTHON_VECTORCALL 1
370 #endif
371 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
372 #undef CYTHON_VECTORCALL_TPNEW
373 #define CYTHON_VECTORCALL_TPNEW 0
374 #elif !defined(CYTHON_VECTORCALL_TPNEW)
375 #define CYTHON_VECTORCALL_TPNEW (PYPY_VERSION_NUM >= 0x07030800 && CYTHON_VECTORCALL)
376 #endif
377 #ifndef CYTHON_PEP487_INIT_SUBCLASS
378 #define CYTHON_PEP487_INIT_SUBCLASS 1
379 #endif
380 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
381 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
382 #endif
383 #undef CYTHON_USE_MODULE_STATE
384 #define CYTHON_USE_MODULE_STATE 0
385 #undef CYTHON_USE_SYS_MONITORING
386 #define CYTHON_USE_SYS_MONITORING 0
387 #ifndef CYTHON_USE_TP_FINALIZE
388 #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
389 #endif
390 #undef CYTHON_USE_AM_SEND
391 #define CYTHON_USE_AM_SEND 0
392 #undef CYTHON_USE_DICT_VERSIONS
393 #define CYTHON_USE_DICT_VERSIONS 0
394 #undef CYTHON_USE_EXC_INFO_STACK
395 #define CYTHON_USE_EXC_INFO_STACK 0
396 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
397 #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
398 #endif
399 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
400 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
401 #endif
402 #undef CYTHON_USE_FREELISTS
403 #define CYTHON_USE_FREELISTS 0
404 #undef CYTHON_IMMORTAL_CONSTANTS
405 #define CYTHON_IMMORTAL_CONSTANTS 0
406 #undef CYTHON_OPAQUE_OBJECTS
407 #define CYTHON_OPAQUE_OBJECTS 0
408#else
409 #define CYTHON_COMPILING_IN_PYPY 0
410 #define CYTHON_COMPILING_IN_CPYTHON 1
411 #define CYTHON_COMPILING_IN_LIMITED_API 0
412 #define CYTHON_COMPILING_IN_GRAAL 0
413 #ifdef Py_GIL_DISABLED
414 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
415 #else
416 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
417 #endif
418 #if PY_VERSION_HEX < 0x030A0000
419 #undef CYTHON_USE_TYPE_SLOTS
420 #define CYTHON_USE_TYPE_SLOTS 1
421 #elif !defined(CYTHON_USE_TYPE_SLOTS)
422 #define CYTHON_USE_TYPE_SLOTS 1
423 #endif
424 #ifndef CYTHON_USE_TYPE_SPECS
425 #define CYTHON_USE_TYPE_SPECS 0
426 #endif
427 #ifndef CYTHON_USE_PYTYPE_LOOKUP
428 #define CYTHON_USE_PYTYPE_LOOKUP 1
429 #endif
430 #ifndef CYTHON_USE_PYLONG_INTERNALS
431 #define CYTHON_USE_PYLONG_INTERNALS 1
432 #endif
433 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
434 #undef CYTHON_USE_PYLIST_INTERNALS
435 #define CYTHON_USE_PYLIST_INTERNALS 0
436 #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
437 #define CYTHON_USE_PYLIST_INTERNALS 1
438 #endif
439 #ifndef CYTHON_USE_UNICODE_INTERNALS
440 #define CYTHON_USE_UNICODE_INTERNALS 1
441 #endif
442 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
443 #undef CYTHON_USE_UNICODE_WRITER
444 #define CYTHON_USE_UNICODE_WRITER 0
445 #elif !defined(CYTHON_USE_UNICODE_WRITER)
446 #define CYTHON_USE_UNICODE_WRITER 1
447 #endif
448 #ifndef CYTHON_AVOID_BORROWED_REFS
449 #define CYTHON_AVOID_BORROWED_REFS 0
450 #endif
451 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
452 #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
453 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
454 #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
455 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
456 #endif
457 #ifndef CYTHON_ASSUME_SAFE_MACROS
458 #define CYTHON_ASSUME_SAFE_MACROS 1
459 #endif
460 #ifndef CYTHON_ASSUME_SAFE_SIZE
461 #define CYTHON_ASSUME_SAFE_SIZE 1
462 #endif
463 #ifndef CYTHON_UNPACK_METHODS
464 #define CYTHON_UNPACK_METHODS 1
465 #endif
466 #ifndef CYTHON_FAST_THREAD_STATE
467 #define CYTHON_FAST_THREAD_STATE 1
468 #endif
469 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
470 #undef CYTHON_FAST_GIL
471 #define CYTHON_FAST_GIL 0
472 #elif !defined(CYTHON_FAST_GIL)
473 #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
474 #endif
475 #ifndef CYTHON_VECTORCALL
476 #define CYTHON_VECTORCALL 1
477 #endif
478 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX < 0x030E0000
479 #undef CYTHON_VECTORCALL_TPNEW
480 #define CYTHON_VECTORCALL_TPNEW 0
481 #elif !defined(CYTHON_VECTORCALL_TPNEW)
482 #define CYTHON_VECTORCALL_TPNEW CYTHON_VECTORCALL
483 #endif
484 #ifndef CYTHON_PEP487_INIT_SUBCLASS
485 #define CYTHON_PEP487_INIT_SUBCLASS 1
486 #endif
487 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
488 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
489 #endif
490 #ifndef CYTHON_USE_MODULE_STATE
491 #define CYTHON_USE_MODULE_STATE 0
492 #endif
493 #ifndef CYTHON_USE_SYS_MONITORING
494 #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
495 #endif
496 #ifndef CYTHON_USE_TP_FINALIZE
497 #define CYTHON_USE_TP_FINALIZE 1
498 #endif
499 #ifndef CYTHON_USE_AM_SEND
500 #define CYTHON_USE_AM_SEND 1
501 #endif
502 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
503 #undef CYTHON_USE_DICT_VERSIONS
504 #define CYTHON_USE_DICT_VERSIONS 0
505 #elif !defined(CYTHON_USE_DICT_VERSIONS)
506 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
507 #endif
508 #ifndef CYTHON_USE_EXC_INFO_STACK
509 #define CYTHON_USE_EXC_INFO_STACK 1
510 #endif
511 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
512 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
513 #endif
514 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
515 #define CYTHON_USE_OWN_PREP_RERAISE_STAR (PY_VERSION_HEX < 0x030C00B2)
516 #endif
517 #ifndef CYTHON_USE_FREELISTS
518 #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
519 #endif
520 #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
521 #undef CYTHON_IMMORTAL_CONSTANTS
522 #define CYTHON_IMMORTAL_CONSTANTS 0 // definitely won't work
523 #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
524 #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
525 #endif
526 #ifndef CYTHON_OPAQUE_OBJECTS
527 #define CYTHON_OPAQUE_OBJECTS 0
528 #endif
529#endif
530#if CYTHON_USE_PYLONG_INTERNALS
531 #undef SHIFT
532 #undef BASE
533 #undef MASK
534 #ifdef SIZEOF_VOID_P
535 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
536 #endif
537#endif
538#ifndef __has_attribute
539 #define __has_attribute(x) 0
540#endif
541#ifndef __has_cpp_attribute
542 #define __has_cpp_attribute(x) 0
543#endif
544#ifndef CYTHON_RESTRICT
545 #if defined(__GNUC__)
546 #define CYTHON_RESTRICT __restrict__
547 #elif defined(_MSC_VER) && _MSC_VER >= 1400
548 #define CYTHON_RESTRICT __restrict
549 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
550 #define CYTHON_RESTRICT restrict
551 #else
552 #define CYTHON_RESTRICT
553 #endif
554#endif
555#ifndef CYTHON_UNUSED
556 #if defined(__cplusplus)
557 /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
558 * but leads to warnings with -pedantic, since it is a C++17 feature */
559 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
560 #if __has_cpp_attribute(maybe_unused)
561 #define CYTHON_UNUSED [[maybe_unused]]
562 #endif
563 #endif
564 #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
565 #define CYTHON_UNUSED [[maybe_unused]]
566 #endif
567#endif
568#ifndef CYTHON_UNUSED
569# if defined(__GNUC__)
570# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
571# define CYTHON_UNUSED __attribute__ ((__unused__))
572# else
573# define CYTHON_UNUSED
574# endif
575# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
576# define CYTHON_UNUSED __attribute__ ((__unused__))
577# else
578# define CYTHON_UNUSED
579# endif
580#endif
581#ifndef CYTHON_UNUSED_VAR
582# if defined(__cplusplus)
583 template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
584# else
585# define CYTHON_UNUSED_VAR(x) (void)(x)
586# endif
587#endif
588#ifndef CYTHON_MAYBE_UNUSED_VAR
589 #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
590#endif
591#ifndef CYTHON_NCP_UNUSED
592# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
593# define CYTHON_NCP_UNUSED
594# else
595# define CYTHON_NCP_UNUSED CYTHON_UNUSED
596# endif
597#endif
598#ifndef CYTHON_USE_CPP_STD_MOVE
599 #if defined(__cplusplus) && (\
600 __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
601 #define CYTHON_USE_CPP_STD_MOVE 1
602 #else
603 #define CYTHON_USE_CPP_STD_MOVE 0
604 #endif
605#endif
606#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
607#include <stdint.h>
608typedef uintptr_t __pyx_uintptr_t;
609#ifndef CYTHON_FALLTHROUGH
610 #if defined(__cplusplus)
611 /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
612 * but leads to warnings with -pedantic, since it is a C++17 feature */
613 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
614 #if __has_cpp_attribute(fallthrough)
615 #define CYTHON_FALLTHROUGH [[fallthrough]]
616 #endif
617 #endif
618 #ifndef CYTHON_FALLTHROUGH
619 #if __has_cpp_attribute(clang::fallthrough)
620 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
621 #elif __has_cpp_attribute(gnu::fallthrough)
622 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
623 #endif
624 #endif
625 #endif
626 #ifndef CYTHON_FALLTHROUGH
627 #if __has_attribute(fallthrough)
628 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
629 #else
630 #define CYTHON_FALLTHROUGH
631 #endif
632 #endif
633 #if defined(__clang__) && defined(__apple_build_version__)
634 #if __apple_build_version__ < 7000000
635 #undef CYTHON_FALLTHROUGH
636 #define CYTHON_FALLTHROUGH
637 #endif
638 #endif
639#endif
640#ifdef Py_UNREACHABLE
641 #define __Pyx_UNREACHABLE() Py_UNREACHABLE()
642#elif __Pyx_has_cbuiltin(__builtin_unreachable)
643 #define __Pyx_UNREACHABLE() __builtin_unreachable()
644#elif defined(__clang__) || defined(__INTEL_COMPILER) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)))
645 #define __Pyx_UNREACHABLE() __builtin_unreachable()
646#elif defined(_MSC_VER)
647 #define __Pyx_UNREACHABLE() __assume(0)
648#else
649 #define __Pyx_UNREACHABLE() Py_FatalError("Unreachable C code path reached")
650#endif
651#ifndef Py_UNREACHABLE
652 #define Py_UNREACHABLE() __Pyx_UNREACHABLE()
653#endif
654#ifdef __cplusplus
655 template <typename T>
656 struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
657 #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
658#else
659 #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
660#endif
661#if CYTHON_COMPILING_IN_PYPY == 1
662 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x030A0000)
663#else
664 #define __PYX_NEED_TP_PRINT_SLOT 0
665#endif
666#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
667#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
668#define __Pyx_PyErr_FetchException(petype, peval, petb) PyErr_Fetch(petype, peval, petb)
669#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_Restore(etype, eval, etb)
670#else
671#define __Pyx_PyErr_FetchException(petype, peval, petb) *(petype)=NULL; *(peval)=PyErr_GetRaisedException(); *(petb)=NULL
672#define __Pyx_PyErr_RestoreException(etype, eval, etb) PyErr_SetRaisedException(eval)
673#endif
674
675/* CppInitCode */
676#ifndef __cplusplus
677 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
678#endif
679#ifndef CYTHON_INLINE
680 #if defined(__clang__)
681 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
682 #else
683 #define CYTHON_INLINE inline
684 #endif
685#endif
686template<typename T>
687void __Pyx_call_destructor(T& x) {
688 x.~T();
689}
690template<typename T>
691class __Pyx_FakeReference {
692 public:
693 __Pyx_FakeReference() : ptr(NULL) { }
694 __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
695 T *operator->() { return ptr; }
696 T *operator&() { return ptr; }
697 operator T&() { return *ptr; }
698 template<typename U> bool operator ==(const U& other) const { return *ptr == other; }
699 template<typename U> bool operator !=(const U& other) const { return *ptr != other; }
700 template<typename U> bool operator==(const __Pyx_FakeReference<U>& other) const { return *ptr == *other.ptr; }
701 template<typename U> bool operator!=(const __Pyx_FakeReference<U>& other) const { return *ptr != *other.ptr; }
702 private:
703 T *ptr;
704};
705
706/* PythonCompatibility */
707#define __PYX_BUILD_PY_SSIZE_T "n"
708#define CYTHON_FORMAT_SSIZE_T "z"
709#define __Pyx_BUILTIN_MODULE_NAME "builtins"
710#define __Pyx_DefaultClassType PyType_Type
711#if CYTHON_COMPILING_IN_LIMITED_API
712 #ifndef CO_OPTIMIZED
713 static int CO_OPTIMIZED;
714 #endif
715 #ifndef CO_NEWLOCALS
716 static int CO_NEWLOCALS;
717 #endif
718 #ifndef CO_VARARGS
719 static int CO_VARARGS;
720 #endif
721 #ifndef CO_VARKEYWORDS
722 static int CO_VARKEYWORDS;
723 #endif
724 #ifndef CO_ASYNC_GENERATOR
725 static int CO_ASYNC_GENERATOR;
726 #endif
727 #ifndef CO_GENERATOR
728 static int CO_GENERATOR;
729 #endif
730 #ifndef CO_COROUTINE
731 static int CO_COROUTINE;
732 #endif
733#else
734 #ifndef CO_COROUTINE
735 #define CO_COROUTINE 0x80
736 #endif
737 #ifndef CO_ASYNC_GENERATOR
738 #define CO_ASYNC_GENERATOR 0x200
739 #endif
740#endif
741static int __Pyx_init_co_variables(void);
742#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
743 #define __Pyx_Py_Is(x, y) Py_Is(x, y)
744#else
745 #define __Pyx_Py_Is(x, y) ((x) == (y))
746#endif
747#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
748 #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
749#else
750 #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
751#endif
752#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
753 #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
754#else
755 #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
756#endif
757#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
758 #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
759#else
760 #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
761#endif
762#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
763#if CYTHON_COMPILING_IN_PYPY
764 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
765#else
766 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
767#endif
768#if CYTHON_COMPILING_IN_LIMITED_API
769static unsigned long __Pyx_Runtime_TPFLAGS_SEQUENCE;
770static unsigned long __Pyx_Runtime_TPFLAGS_MAPPING;
771#else
772#define __Pyx_Runtime_TPFLAGS_SEQUENCE Py_TPFLAGS_SEQUENCE
773#define __Pyx_Runtime_TPFLAGS_MAPPING Py_TPFLAGS_MAPPING
774#endif
775static int __Pyx_init_tpflags_variables(void);
776#ifndef Py_TPFLAGS_HAVE_FINALIZE
777 #define Py_TPFLAGS_HAVE_FINALIZE 0
778#endif
779#ifndef Py_TPFLAGS_SEQUENCE
780 #define Py_TPFLAGS_SEQUENCE (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 5)
781#endif
782#ifndef Py_TPFLAGS_MAPPING
783 #define Py_TPFLAGS_MAPPING (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 6)
784#endif
785#ifndef Py_TPFLAGS_IMMUTABLETYPE
786 #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
787#endif
788#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
789 #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
790#endif
791#ifndef METH_STACKLESS
792 #define METH_STACKLESS 0
793#endif
794#if !defined(METH_FASTCALL) || CYTHON_COMPILING_IN_PYPY
795 #ifndef METH_FASTCALL
796 #define METH_FASTCALL 0x80
797 #endif
798 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
799 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
800 Py_ssize_t nargs, PyObject *kwnames);
801#else
802 #if PY_VERSION_HEX >= 0x030d00A4
803 # define __Pyx_PyCFunctionFast PyCFunctionFast
804 # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
805 #else
806 # define __Pyx_PyCFunctionFast _PyCFunctionFast
807 # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
808 #endif
809#endif
810#if CYTHON_VECTORCALL
811 #define __Pyx_METH_FASTCALL METH_FASTCALL
812 #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
813 #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
814#else
815 #define __Pyx_METH_FASTCALL METH_VARARGS
816 #define __Pyx_PyCFunction_FastCall PyCFunction
817 #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
818#endif
819#if CYTHON_VECTORCALL
820 #define __pyx_vectorcallfunc vectorcallfunc
821 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
822 #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
823#else
824 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
825 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
826#endif
827#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
828#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
829#if CYTHON_COMPILING_IN_CPYTHON
830#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
831#elif !CYTHON_COMPILING_IN_LIMITED_API
832#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
833#endif
834#if CYTHON_COMPILING_IN_CPYTHON
835#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
836static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
837 return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
838}
839#endif
840static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) {
841#if CYTHON_COMPILING_IN_LIMITED_API
842 return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
843#else
844 return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
845#endif
846}
847#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
848#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
849 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
850#else
851 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
852#endif
853#if CYTHON_COMPILING_IN_PYPY
854 typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
855#else
856 #define __Pyx_PyCMethod PyCMethod
857#endif
858#ifndef METH_METHOD
859 #define METH_METHOD 0x200
860#endif
861#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
862 #define PyObject_Malloc(s) PyMem_Malloc(s)
863 #define PyObject_Free(p) PyMem_Free(p)
864 #define PyObject_Realloc(p) PyMem_Realloc(p)
865#endif
866#if CYTHON_COMPILING_IN_LIMITED_API
867 #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
868#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
869 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
870 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno))
871#elif CYTHON_COMPILING_IN_GRAAL
872 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
873 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
874#else
875 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
876 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
877#endif
878#if CYTHON_COMPILING_IN_LIMITED_API
879 #define __Pyx_PyThreadState_Current PyThreadState_Get()
880#elif !CYTHON_FAST_THREAD_STATE
881 #define __Pyx_PyThreadState_Current PyThreadState_GET()
882#elif PY_VERSION_HEX >= 0x030d00A1
883 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
884#else
885 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
886#endif
887#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
888 #define __PYX_SHARED_SIZEOF(T) -((int)sizeof(T))
889 #define __PYX_SHARED_RELATIVE_OFFSET Py_RELATIVE_OFFSET
890 #define CYTHON_OPAQUE_SHARED_TYPES 1
891#else
892 #define __PYX_SHARED_SIZEOF(T) sizeof(T)
893 #define __PYX_SHARED_RELATIVE_OFFSET 0
894 #define CYTHON_OPAQUE_SHARED_TYPES 0
895#endif
896#if CYTHON_USE_MODULE_STATE
897static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op)
898{
899 void *result;
900 result = PyModule_GetState(op);
901 if (!result)
902 Py_FatalError("Couldn't find the module state");
903 return result;
904}
905#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
906#else
907#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
908#endif
909#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
910#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
911#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
912#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
913#if CYTHON_USE_TYPE_SLOTS
914 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
915 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
916 #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
917 #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
918#else
919 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
920 #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
921 ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
922 (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
923 __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
924 #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
925 #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
926#endif
927#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
928#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
929#else
930#define __Pyx_PyDict_NewPresized(n) PyDict_New()
931#endif
932#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
933#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
934#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
935#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
936static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
937 PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
938 if (res == NULL && PyErr_Occurred()) {
939 PyErr_WriteUnraisable(NULL);
940 }
941 return res;
942}
943#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
944#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
945#define __Pyx_PyDict_GetItemStr PyDict_GetItem
946#else
947static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
948#if CYTHON_COMPILING_IN_PYPY
949 return PyDict_GetItem(dict, name);
950#else
951 PyDictEntry *ep;
952 PyDictObject *mp = (PyDictObject*) dict;
953 long hash = ((PyStringObject *) name)->ob_shash;
954 assert(hash != -1);
955 ep = (mp->ma_lookup)(mp, name, hash);
956 if (ep == NULL) {
957 return NULL;
958 }
959 return ep->me_value;
960#endif
961}
962#define __Pyx_PyDict_GetItemStr PyDict_GetItem
963#endif
964#if CYTHON_USE_TYPE_SLOTS
965 #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
966 #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
967#else
968 #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
969 #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
970#endif
971#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
972#if CYTHON_USE_TYPE_SPECS
973#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
974 PyTypeObject *type = Py_TYPE((PyObject*)obj);\
975 assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
976 PyObject_GC_Del(obj);\
977 Py_DECREF(type);\
978}
979#else
980#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
981#endif
982#if CYTHON_COMPILING_IN_LIMITED_API
983 #define __Pyx_PyUnicode_READY(op) (0)
984 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
985 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
986 #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
987 #define __Pyx_PyUnicode_KIND_04(u) __Pyx_PyUnicode_KIND(u)
988 #define __Pyx_PyUnicode_DATA(u) ((void*)u)
989 #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
990 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
991#else
992 #if PY_VERSION_HEX >= 0x030C0000
993 #define __Pyx_PyUnicode_READY(op) (0)
994 #else
995 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
996 0 : _PyUnicode_Ready((PyObject *)(op)))
997 #endif
998 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
999 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
1000 #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
1001 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
1002 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
1003 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
1004 #if PY_VERSION_HEX >= 0x030C0000
1005 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
1006 #else
1007 #if CYTHON_COMPILING_IN_CPYTHON
1008 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
1009 #else
1010 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
1011 #endif
1012 #endif
1013 static CYTHON_INLINE int __Pyx_PyUnicode_KIND_04(PyObject *o) {
1014 return __Pyx_PyUnicode_KIND(o) - (int) !!PyUnicode_IS_ASCII(o);
1015 }
1016#endif
1017#if CYTHON_COMPILING_IN_PYPY
1018 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
1019 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
1020#else
1021 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
1022 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
1023 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
1024#endif
1025#if CYTHON_COMPILING_IN_PYPY
1026 #if !defined(PyUnicode_DecodeUnicodeEscape)
1027 #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
1028 #endif
1029 #if !defined(PyUnicode_Contains)
1030 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
1031 #endif
1032 #if !defined(PyByteArray_Check)
1033 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
1034 #endif
1035 #if !defined(PyObject_Format)
1036 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
1037 #endif
1038#endif
1039#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
1040#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
1041 #define __Pyx_PySequence_ListKeepNew(obj)\
1042 (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
1043#elif CYTHON_COMPILING_IN_CPYTHON
1044 #define __Pyx_PySequence_ListKeepNew(obj)\
1045 (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
1046#else
1047 #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
1048#endif
1049#ifndef PySet_CheckExact
1050 #define PySet_CheckExact(obj) Py_IS_TYPE(obj, &PySet_Type)
1051#endif
1052enum __Pyx_ReferenceSharing {
1053 __Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check
1054 __Pyx_ReferenceSharing_OwnStrongReference,
1055 __Pyx_ReferenceSharing_FunctionArgument,
1056 __Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar
1057};
1058#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
1059#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
1060 (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
1061 (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
1062 (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
1063#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
1064#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
1065#else
1066#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
1067#endif
1068#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1069 #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
1070#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1071 #if CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
1072 #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1073 #else
1074 #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
1075 #endif
1076#elif CYTHON_COMPILING_IN_LIMITED_API || !(CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE)
1077 #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
1078#else
1079 #define __Pyx_PyList_GetItemRef(o, i) (likely(__Pyx_is_valid_index(i, PyList_GET_SIZE(o))) ?\
1080 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1081#endif
1082#if CYTHON_AVOID_BORROWED_REFS || CYTHON_COMPILING_IN_LIMITED_API
1083 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1084 __Pyx_PyList_GetItemRef(o, i))
1085#elif CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1086 #if CYTHON_ASSUME_SAFE_MACROS
1087 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1088 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1089 __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1090 #else
1091 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) (\
1092 __Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
1093 __Pyx_XNewRef(PyList_GetItem(o, i)) : __Pyx_PyList_GetItemRef(o, i))
1094 #endif
1095#elif CYTHON_ASSUME_SAFE_MACROS
1096 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1097 __Pyx_NewRef(PyList_GET_ITEM(o, i)))
1098#else
1099 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1100 __Pyx_XNewRef(PyList_GetItem(o, i)))
1101#endif
1102#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
1103#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
1104#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
1105static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1106 *result = PyObject_GetItem(dict, key);
1107 if (*result == NULL) {
1108 if (PyErr_ExceptionMatches(PyExc_KeyError)) {
1109 PyErr_Clear();
1110 return 0;
1111 }
1112 return -1;
1113 }
1114 return 1;
1115}
1116#else
1117static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
1118 *result = PyDict_GetItemWithError(dict, key);
1119 if (*result == NULL) {
1120 return PyErr_Occurred() ? -1 : 0;
1121 }
1122 Py_INCREF(*result);
1123 return 1;
1124}
1125#endif
1126#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
1127 #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj)
1128#else
1129 #define __Pyx_VISIT_CONST(obj)
1130#endif
1131#if CYTHON_ASSUME_SAFE_MACROS
1132 #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
1133 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
1134 #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
1135 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
1136 #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
1137 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
1138#else
1139 #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
1140 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
1141 #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
1142 #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
1143 #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
1144 #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
1145#endif
1146#if CYTHON_ASSUME_SAFE_SIZE
1147 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
1148 #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
1149 #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
1150 #define __Pyx_PyDict_GET_SIZE(o) PyDict_GET_SIZE(o)
1151 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
1152 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
1153 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
1154#else
1155 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
1156 #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
1157 #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
1158 #define __Pyx_PyDict_GET_SIZE(o) PyDict_Size(o)
1159 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1160 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1161 #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
1162#endif
1163#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
1164 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1165#endif
1166#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
1167#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t
1168#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1169 #define __Pyx_PySendResult PySendResult
1170#else
1171 typedef enum {
1172 PYGEN_RETURN = 0,
1173 PYGEN_ERROR = -1,
1174 PYGEN_NEXT = 1,
1175 } __Pyx_PySendResult;
1176#endif
1177#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
1178 typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
1179#else
1180 #define __Pyx_pyiter_sendfunc sendfunc
1181#endif
1182#if !CYTHON_USE_AM_SEND
1183#define __PYX_HAS_PY_AM_SEND 0
1184#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
1185#define __PYX_HAS_PY_AM_SEND 1
1186#else
1187#define __PYX_HAS_PY_AM_SEND 2 // our own backported implementation
1188#endif
1189#if __PYX_HAS_PY_AM_SEND < 2
1190 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1191#else
1192 typedef struct {
1193 unaryfunc am_await;
1194 unaryfunc am_aiter;
1195 unaryfunc am_anext;
1196 __Pyx_pyiter_sendfunc am_send;
1197 } __Pyx_PyAsyncMethodsStruct;
1198 #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
1199#endif
1200#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
1201 #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
1202#else
1203 #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
1204#endif
1205#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
1206#ifdef __cplusplus
1207extern "C"
1208#endif
1209PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
1210#endif
1211#if CYTHON_COMPILING_IN_LIMITED_API
1212static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) {
1213 int value;
1214 PyObject *py_value = PyObject_GetAttrString(inspect, name);
1215 if (!py_value) return 0;
1216 value = (int) PyLong_AsLong(py_value);
1217 Py_DECREF(py_value);
1218 *write_to = value;
1219 return value != -1 || !PyErr_Occurred();
1220}
1221static int __Pyx_init_co_variables(void) {
1222 PyObject *inspect;
1223 int result;
1224 inspect = PyImport_ImportModule("inspect");
1225 result =
1226#if !defined(CO_OPTIMIZED)
1227 __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) &&
1228#endif
1229#if !defined(CO_NEWLOCALS)
1230 __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) &&
1231#endif
1232#if !defined(CO_VARARGS)
1233 __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) &&
1234#endif
1235#if !defined(CO_VARKEYWORDS)
1236 __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
1237#endif
1238#if !defined(CO_ASYNC_GENERATOR)
1239 __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
1240#endif
1241#if !defined(CO_GENERATOR)
1242 __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) &&
1243#endif
1244#if !defined(CO_COROUTINE)
1245 __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) &&
1246#endif
1247 1;
1248 Py_DECREF(inspect);
1249 return result ? 0 : -1;
1250}
1251static int __Pyx_init_tpflags_bitcount(unsigned long flag) {
1252 int count = 0;
1253 while (flag) {
1254 count += (int) (flag & 1);
1255 flag >>= 1;
1256 }
1257 return count;
1258}
1259static int __Pyx_init_tpflags_variables(void) {
1260 if (__Pyx_Runtime_TPFLAGS_SEQUENCE != 0 && __Pyx_Runtime_TPFLAGS_MAPPING != 0) {
1261 return 0;
1262 }
1263 PyObject *collections_abc = PyImport_ImportModule("collections.abc");
1264 if (!collections_abc) return -1;
1265 int result = 0;
1266 PyObject *sequence = NULL, *mapping = NULL;
1267#if __PYX_LIMITED_VERSION_HEX >= 0x030D0000
1268 if (PyObject_GetOptionalAttrString(collections_abc, "Sequence", &sequence) != 1) goto fail;
1269 if (PyObject_GetOptionalAttrString(collections_abc, "Mapping", &mapping) != 1) goto fail;
1270#else
1271 sequence = PyObject_GetAttrString(collections_abc, "Sequence");
1272 if (!sequence) goto fail_attr_lookup;
1273 mapping = PyObject_GetAttrString(collections_abc, "Mapping");
1274 if (!mapping) goto fail_attr_lookup;
1275#endif
1276 if (!PyType_Check(sequence) || !PyType_Check(mapping)) goto fail;
1277 {
1278 unsigned long sequence_flags = PyType_GetFlags((PyTypeObject*)sequence);
1279 unsigned long mapping_flags = PyType_GetFlags((PyTypeObject*)mapping);
1280 unsigned long mutual_flags = sequence_flags & mapping_flags;
1281 sequence_flags = sequence_flags ^ mutual_flags;
1282 mapping_flags = mapping_flags ^ mutual_flags;
1283 if (__Pyx_Runtime_TPFLAGS_SEQUENCE == 0 && __Pyx_init_tpflags_bitcount(sequence_flags) == 1) {
1284 __Pyx_Runtime_TPFLAGS_SEQUENCE = sequence_flags;
1285 }
1286 if (__Pyx_Runtime_TPFLAGS_MAPPING == 0 && __Pyx_init_tpflags_bitcount(mapping_flags) == 1) {
1287 __Pyx_Runtime_TPFLAGS_MAPPING = mapping_flags;
1288 }
1289 }
1290 cleanup:
1291 Py_XDECREF(mapping);
1292 Py_XDECREF(sequence);
1293 Py_DECREF(collections_abc);
1294 return result;
1295#if __PYX_LIMITED_VERSION_HEX < 0x030D0000
1296 fail_attr_lookup:
1297 if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
1298 PyErr_Clear();
1299 }
1300#endif
1301 fail:
1302 result = PyErr_Occurred() ? -1 : 0;
1303 goto cleanup;
1304}
1305#else
1306static int __Pyx_init_co_variables(void) {
1307 return 0; // It's a limited API-only feature
1308}
1309static int __Pyx_init_tpflags_variables(void) {
1310 return 0; // It's a limited API-only feature
1311}
1312#endif
1313
1314/* MathInitCode */
1315#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1316 #ifndef _USE_MATH_DEFINES
1317 #define _USE_MATH_DEFINES
1318 #endif
1319#endif
1320#include <math.h>
1321#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1322#define __Pyx_truncl trunc
1323#else
1324#define __Pyx_truncl truncl
1325#endif
1326
1327#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1328#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 1
1329#endif
1330#ifndef CYTHON_CLINE_IN_TRACEBACK
1331#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1332#endif
1333#if CYTHON_CLINE_IN_TRACEBACK
1334#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; }
1335#else
1336#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; }
1337#endif
1338#define __PYX_ERR(f_index, lineno, Ln_error) \
1339 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1340
1341#ifdef CYTHON_EXTERN_C
1342 #undef __PYX_EXTERN_C
1343 #define __PYX_EXTERN_C CYTHON_EXTERN_C
1344#elif defined(__PYX_EXTERN_C)
1345 #ifdef _MSC_VER
1346 #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1347 #else
1348 #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1349 #endif
1350#else
1351 #define __PYX_EXTERN_C extern "C++"
1352#endif
1353
1354#define __PYX_HAVE__cpartitioning
1355#define __PYX_HAVE_API__cpartitioning
1356/* Early includes */
1357#include <string.h>
1358#include <stdio.h>
1359
1360 /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */
1361
1362#include "numpy/arrayobject.h"
1363#include "numpy/ndarrayobject.h"
1364#include "numpy/ndarraytypes.h"
1365#include "numpy/arrayscalars.h"
1366#include "numpy/ufuncobject.h"
1367
1368 #include <mpi.h>
1369
1370 #if (MPI_VERSION < 3) && !defined(PyMPI_HAVE_MPI_Message)
1371 typedef void *PyMPI_MPI_Message;
1372 #define MPI_Message PyMPI_MPI_Message
1373 #endif
1374
1375 #if (MPI_VERSION < 4) && !defined(PyMPI_HAVE_MPI_Session)
1376 typedef void *PyMPI_MPI_Session;
1377 #define MPI_Session PyMPI_MPI_Session
1378 #endif"
1379
1380#include <mpi.h>
1381
1382 #if (MPI_VERSION < 3) && !defined(PyMPI_HAVE_MPI_Message)
1383 #if !defined(MPI_Message) && !defined(MPI_MESSAGE_NULL)
1384 typedef void *PyMPI_MPI_Message;
1385 #define MPI_Message PyMPI_MPI_Message
1386 #endif
1387 #endif
1388
1389 #if (MPI_VERSION < 4) && !defined(PyMPI_HAVE_MPI_Session)
1390 #if !defined(MPI_Session) && !defined(MPI_SESSION_NULL)
1391 typedef void *PyMPI_MPI_Session;
1392 #define MPI_Session PyMPI_MPI_Session
1393 #endif
1394 #endif
1395
1396#include "mesh.h"
1397#include "partitioning.h"
1398#include "pythread.h"
1399
1400 typedef int (*__pyx_memoryview_to_dtype_func_type)(char*, PyObject*);
1401
1402#include <stdlib.h>
1403#ifdef _OPENMP
1404#include <omp.h>
1405#endif /* _OPENMP */
1406
1407#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1408#define CYTHON_WITHOUT_ASSERTIONS
1409#endif
1410
1411#ifdef CYTHON_FREETHREADING_COMPATIBLE
1412#if CYTHON_FREETHREADING_COMPATIBLE
1413#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
1414#else
1415#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1416#endif
1417#else
1418#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1419#endif
1420#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1421#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1422#define __PYX_DEFAULT_STRING_ENCODING ""
1423#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1424#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1425#define __Pyx_uchar_cast(c) ((unsigned char)c)
1426#define __Pyx_long_cast(x) ((long)x)
1427#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1428 (sizeof(type) < sizeof(Py_ssize_t)) ||\
1429 (sizeof(type) > sizeof(Py_ssize_t) &&\
1430 likely(v < (type)PY_SSIZE_T_MAX ||\
1431 v == (type)PY_SSIZE_T_MAX) &&\
1432 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1433 v == (type)PY_SSIZE_T_MIN))) ||\
1434 (sizeof(type) == sizeof(Py_ssize_t) &&\
1435 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1436 v == (type)PY_SSIZE_T_MAX))) )
1437static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1438 return (size_t) i < (size_t) limit;
1439}
1440#if defined (__cplusplus) && __cplusplus >= 201103L
1441 #include <cstdlib>
1442 #define __Pyx_sst_abs(value) std::abs(value)
1443#elif SIZEOF_INT >= SIZEOF_SIZE_T
1444 #define __Pyx_sst_abs(value) abs(value)
1445#elif SIZEOF_LONG >= SIZEOF_SIZE_T
1446 #define __Pyx_sst_abs(value) labs(value)
1447#elif defined (_MSC_VER)
1448 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1449#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1450 #define __Pyx_sst_abs(value) llabs(value)
1451#elif defined (__GNUC__)
1452 #define __Pyx_sst_abs(value) __builtin_llabs(value)
1453#else
1454 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1455#endif
1456static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
1457static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
1458static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1459static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
1460#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1461#define __Pyx_PyBytes_FromString PyBytes_FromString
1462#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1463static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
1464#if CYTHON_ASSUME_SAFE_MACROS
1465 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1466 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1467 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1468 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1469 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1470 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1471 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
1472#else
1473 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s))
1474 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s))
1475 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s))
1476 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s))
1477 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s))
1478 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s))
1479 #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
1480#endif
1481#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1482#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1483#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1484#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1485#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1486#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1487#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1488#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1489#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1490#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1491#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1492static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
1493#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
1494 return Py_NewRef(obj);
1495#else
1496 Py_INCREF(obj);
1497 return obj;
1498#endif
1499}
1500static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
1501#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
1502 return Py_XNewRef(obj);
1503#else
1504 Py_XINCREF(obj);
1505 return obj;
1506#endif
1507}
1508static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b);
1509static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
1510static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
1511static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1512static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x);
1513#define __Pyx_PyObject_RichCompareBool(a,b,cmp) __Pyx_PyObject_IsTrueAndDecref(PyObject_RichCompare((a),(b),(cmp)))
1514#define __Pyx_PySequence_Tuple(obj)\
1515 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1516static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1517static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t);
1518static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1519#if CYTHON_ASSUME_SAFE_MACROS
1520#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1521#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
1522#define __Pyx_PyFloat_IsNonZero(x) (PyFloat_AS_DOUBLE(x) != 0.0)
1523#else
1524#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1525#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
1526#define __Pyx_PyFloat_IsNonZero(x) PyObject_IsTrue(x)
1527#endif
1528#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
1529#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1530#if CYTHON_USE_PYLONG_INTERNALS
1531 #if PY_VERSION_HEX >= 0x030C00A7
1532 #ifndef _PyLong_SIGN_MASK
1533 #define _PyLong_SIGN_MASK 3
1534 #endif
1535 #ifndef _PyLong_NON_SIZE_BITS
1536 #define _PyLong_NON_SIZE_BITS 3
1537 #endif
1538 #define __Pyx_PyLong_SignBits(x) ((int) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK))
1539 #define __Pyx_PyLong_Sign(x) (1 - __Pyx_PyLong_SignBits(x))
1540 #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_SignBits(x) & 2) != 0)
1541 #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1542 #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_SignBits(x) & 1)
1543 #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_SignBits(x) == 0)
1544 #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1545 #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1546 #define __Pyx_PyLong_SignedDigitCount(x)\
1547 (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1548 #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1549 #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1550 #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1551 #else
1552 #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1553 #define __Pyx_PyLong_CompactValue(x) (((Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1554 #endif
1555 static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_CompareSignAndSize(PyObject *a, PyObject *b) {
1556 uintptr_t tag_a = ((PyLongObject*)a)->long_value.lv_tag;
1557 uintptr_t tag_b = ((PyLongObject*)b)->long_value.lv_tag;
1558 if (tag_a == tag_b) return 0;
1559 int sign_a = (int) (tag_a & _PyLong_SIGN_MASK);
1560 int sign_b = (int) (tag_b & _PyLong_SIGN_MASK);
1561 if (sign_a > sign_b) return -1;
1562 if (sign_a < sign_b) return 1;
1563 Py_ssize_t size_a = (Py_ssize_t) (tag_a >> _PyLong_NON_SIZE_BITS);
1564 Py_ssize_t size_b = (Py_ssize_t) (tag_b >> _PyLong_NON_SIZE_BITS);
1565 return (1 - sign_a) * (size_a - size_b);
1566 }
1567 typedef Py_ssize_t __Pyx_compact_pylong;
1568 typedef size_t __Pyx_compact_upylong;
1569 #else
1570 #define __Pyx_PyLong_Sign(x) ((int) ((Py_SIZE(x) == 0) ? 0 : (Py_SIZE(x) < 0) ? -1 : 1))
1571 #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1572 #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1573 #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1574 #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1575 #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1576 #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1577 #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1578 #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1579 #define __Pyx_PyLong_CompactValue(x)\
1580 ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1581 #define __Pyx_PyLong_CompareSignAndSize(a, b) (Py_SIZE(a) - Py_SIZE(b))
1582 typedef sdigit __Pyx_compact_pylong;
1583 typedef digit __Pyx_compact_upylong;
1584 #endif
1585 #if PY_VERSION_HEX >= 0x030C00A5
1586 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1587 #else
1588 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1589 #endif
1590 #define __Pyx_PyLong_IsNonZero(x) (!__Pyx_PyLong_IsZero(x))
1591#else
1592 #define __Pyx_PyLong_IsNonZero(x) PyObject_IsTrue(x)
1593#endif
1594#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
1595 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1596#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1597 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
1598#else
1599 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1600#endif
1601
1602
1603/* Test for GCC > 2.95 */
1604#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1605 #define likely(x) __builtin_expect(!!(x), 1)
1606 #define unlikely(x) __builtin_expect(!!(x), 0)
1607#else /* !__GNUC__ or GCC < 2.95 */
1608 #define likely(x) (x)
1609 #define unlikely(x) (x)
1610#endif /* __GNUC__ */
1611/* PretendToInitialize */
1612#ifdef __cplusplus
1613#if __cplusplus > 201103L
1614#include <type_traits>
1615#endif
1616template <typename T>
1617static void __Pyx_pretend_to_initialize(T* ptr) {
1618#if __cplusplus > 201103L
1619 if ((std::is_trivially_default_constructible<T>::value))
1620#endif
1621 *ptr = T();
1622 (void)ptr;
1623}
1624#else
1625static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1626#endif
1627
1628
1629#if !CYTHON_USE_MODULE_STATE
1630static PyObject *__pyx_m = NULL;
1631#endif
1632static const char * const __pyx_cfilenm = __FILE__;
1633
1634/* Header.proto */
1635#if !defined(CYTHON_CCOMPLEX)
1636 #if defined(__cplusplus)
1637 #define CYTHON_CCOMPLEX 1
1638 #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
1639 #define CYTHON_CCOMPLEX 1
1640 #else
1641 #define CYTHON_CCOMPLEX 0
1642 #endif
1643#endif
1644#if CYTHON_CCOMPLEX
1645 #ifdef __cplusplus
1646 #include <complex>
1647 #else
1648 #include <complex.h>
1649 #endif
1650#endif
1651#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1652 #undef _Complex_I
1653 #define _Complex_I 1.0fj
1654#endif
1655
1656/* #### Code section: filename_table ### */
1657
1658static const char* const __pyx_f[] = {
1659 "proteus/cpartitioning.pyx",
1660 "View.MemoryView",
1661 "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd",
1662 "cpython/type.pxd",
1663 "mpi4py/MPI.pxd",
1664 "proteus/cmeshTools.pxd",
1665};
1666/* #### Code section: utility_code_proto_before_types ### */
1667/* Atomics.proto (used by UnpackUnboundCMethod) */
1668#include <pythread.h>
1669#ifndef CYTHON_ATOMICS
1670 #define CYTHON_ATOMICS 1
1671#endif
1672#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1673#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1674#define __pyx_atomic_int_type int
1675#define __pyx_nonatomic_int_type int
1676#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1677 (__STDC_VERSION__ >= 201112L) &&\
1678 !defined(__STDC_NO_ATOMICS__))
1679 #include <stdatomic.h>
1680#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1681 (__cplusplus >= 201103L) ||\
1682 (defined(_MSC_VER) && _MSC_VER >= 1700)))
1683 #include <atomic>
1684#endif
1685#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1686 (__STDC_VERSION__ >= 201112L) &&\
1687 !defined(__STDC_NO_ATOMICS__) &&\
1688 ATOMIC_INT_LOCK_FREE == 2)
1689 #undef __pyx_atomic_int_type
1690 #define __pyx_atomic_int_type atomic_int
1691 #define __pyx_atomic_ptr_type atomic_uintptr_t
1692 #define __pyx_nonatomic_ptr_type uintptr_t
1693 #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
1694 #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
1695 #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
1696 #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
1697 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1698 #define __pyx_atomic_load(value) atomic_load(value)
1699 #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
1700 #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
1701 #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
1702 #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1703 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
1704 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1705 #pragma message ("Using standard C atomics")
1706 #elif defined(__PYX_DEBUG_ATOMICS)
1707 #warning "Using standard C atomics"
1708 #endif
1709#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1710 (__cplusplus >= 201103L) ||\
1711\
1712 (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
1713 ATOMIC_INT_LOCK_FREE == 2)
1714 #undef __pyx_atomic_int_type
1715 #define __pyx_atomic_int_type std::atomic_int
1716 #define __pyx_atomic_ptr_type std::atomic_uintptr_t
1717 #define __pyx_nonatomic_ptr_type uintptr_t
1718 #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
1719 #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
1720 #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
1721 #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
1722 #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1723 #define __pyx_atomic_load(value) std::atomic_load(value)
1724 #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
1725 #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
1726 #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
1727 #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
1728 #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
1729 #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1730 #pragma message ("Using standard C++ atomics")
1731 #elif defined(__PYX_DEBUG_ATOMICS)
1732 #warning "Using standard C++ atomics"
1733 #endif
1734#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1735 (__GNUC_MINOR__ > 1 ||\
1736 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1737 #define __pyx_atomic_ptr_type void*
1738 #define __pyx_nonatomic_ptr_type void*
1739 #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
1740 #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
1741 #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
1742 #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
1743 static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1744 __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
1745 int result = old == *expected;
1746 *expected = old;
1747 return result;
1748 }
1749 #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
1750 #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
1751 #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
1752 #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
1753 #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
1754 static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1755 __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
1756 int result = old == *expected;
1757 *expected = old;
1758 return result;
1759 }
1760 #ifdef __PYX_DEBUG_ATOMICS
1761 #warning "Using GNU atomics"
1762 #endif
1763#elif CYTHON_ATOMICS && defined(_MSC_VER)
1764 #include <intrin.h>
1765 #undef __pyx_atomic_int_type
1766 #define __pyx_atomic_int_type long
1767 #define __pyx_atomic_ptr_type void*
1768 #undef __pyx_nonatomic_int_type
1769 #define __pyx_nonatomic_int_type long
1770 #define __pyx_nonatomic_ptr_type void*
1771 #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
1772 #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
1773 #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
1774 #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
1775 #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
1776 static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
1777 __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
1778 int result = old == *expected;
1779 *expected = old;
1780 return result;
1781 }
1782 #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
1783 #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
1784 #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
1785 #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
1786 #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
1787 static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
1788 __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
1789 int result = old == *expected;
1790 *expected = old;
1791 return result;
1792 }
1793 #ifdef __PYX_DEBUG_ATOMICS
1794 #pragma message ("Using MSVC atomics")
1795 #endif
1796#else
1797 #undef CYTHON_ATOMICS
1798 #define CYTHON_ATOMICS 0
1799 #ifdef __PYX_DEBUG_ATOMICS
1800 #warning "Not using atomics"
1801 #endif
1802#endif
1803
1804/* CriticalSectionsDefinition.proto (used by CriticalSections) */
1805#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1806#define __Pyx_PyCriticalSection void*
1807#define __Pyx_PyCriticalSection2 void*
1808#define __Pyx_PyCriticalSection_End(cs)
1809#define __Pyx_PyCriticalSection2_End(cs)
1810#else
1811#define __Pyx_PyCriticalSection PyCriticalSection
1812#define __Pyx_PyCriticalSection2 PyCriticalSection2
1813#define __Pyx_PyCriticalSection_End PyCriticalSection_End
1814#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
1815#endif
1816
1817/* CriticalSections.proto (used by ParseKeywordsImpl) */
1818#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
1819#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs)
1820#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs)
1821#else
1822#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
1823#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
1824#endif
1825#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
1826#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
1827#define __Pyx_END_CRITICAL_SECTION() }
1828#else
1829#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
1830#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
1831#endif
1832
1833/* ForceInitThreads.proto */
1834#ifndef __PYX_FORCE_INIT_THREADS
1835 #define __PYX_FORCE_INIT_THREADS 0
1836#endif
1837
1838/* NoFastGil.proto */
1839#define __Pyx_PyGILState_Ensure PyGILState_Ensure
1840#define __Pyx_PyGILState_Release PyGILState_Release
1841#define __Pyx_FastGIL_Remember()
1842#define __Pyx_FastGIL_Forget()
1843#define __Pyx_FastGilFuncInit()
1844
1845/* IncludeStructmemberH.proto (used by CythonFunctionShared) */
1846#include <structmember.h>
1847
1848/* BufferFormatStructs.proto */
1849struct __Pyx_StructField_;
1850#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1851typedef struct {
1852 const char* name;
1853 const struct __Pyx_StructField_* fields;
1854 size_t size;
1855 size_t arraysize[8];
1856 int ndim;
1857 char typegroup;
1858 char is_unsigned;
1859 int flags;
1860} __Pyx_TypeInfo;
1861typedef struct __Pyx_StructField_ {
1862 const __Pyx_TypeInfo* type;
1863 const char* name;
1864 size_t offset;
1865} __Pyx_StructField;
1866typedef struct {
1867 const __Pyx_StructField* field;
1868 size_t parent_offset;
1869} __Pyx_BufFmt_StackElem;
1870typedef struct {
1871 __Pyx_StructField root;
1872 __Pyx_BufFmt_StackElem* head;
1873 size_t fmt_offset;
1874 size_t new_count, enc_count;
1875 size_t struct_alignment;
1876 int is_complex;
1877 char enc_type;
1878 char new_packmode;
1879 char enc_packmode;
1880 char is_valid_array;
1881} __Pyx_BufFmt_Context;
1882
1883/* MemviewSliceStruct.proto */
1884struct __pyx_memoryview_obj;
1885typedef struct {
1886 struct __pyx_memoryview_obj *memview;
1887 char *data;
1888 Py_ssize_t shape[8];
1889 Py_ssize_t strides[8];
1890 Py_ssize_t suboffsets[8];
1891} __Pyx_memviewslice;
1892#define __Pyx_MemoryView_Len(m) (m.shape[0])
1893#define __Pyx_MEMVIEW_DIRECT 1
1894#define __Pyx_MEMVIEW_PTR 2
1895#define __Pyx_MEMVIEW_FULL 4
1896#define __Pyx_MEMVIEW_CONTIG 8
1897#define __Pyx_MEMVIEW_STRIDED 16
1898#define __Pyx_MEMVIEW_FOLLOW 32
1899#define __Pyx_IS_C_CONTIG 1
1900#define __Pyx_IS_F_CONTIG 2
1901#define __Pyx_MEMSLICE_INIT { 0, 0, { 0 }, { 0 }, { 0 } }
1902#if CYTHON_ATOMICS
1903 #define __pyx_add_acquisition_count(memview)\
1904 __pyx_atomic_incr_relaxed(__pyx_get_slice_count_pointer(memview))
1905 #define __pyx_sub_acquisition_count(memview)\
1906 __pyx_atomic_decr_acq_rel(__pyx_get_slice_count_pointer(memview))
1907#else
1908 #define __pyx_add_acquisition_count(memview)\
1909 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1910 #define __pyx_sub_acquisition_count(memview)\
1911 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1912#endif
1913
1914/* #### Code section: numeric_typedefs ### */
1915
1916/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":761
1917 * # in Cython to enable them only on the right systems.
1918 *
1919 * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1920 * ctypedef npy_int16 int16_t
1921 * ctypedef npy_int32 int32_t
1922*/
1923typedef npy_int8 __pyx_t_5numpy_int8_t;
1924
1925/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":762
1926 *
1927 * ctypedef npy_int8 int8_t
1928 * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1929 * ctypedef npy_int32 int32_t
1930 * ctypedef npy_int64 int64_t
1931*/
1932typedef npy_int16 __pyx_t_5numpy_int16_t;
1933
1934/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":763
1935 * ctypedef npy_int8 int8_t
1936 * ctypedef npy_int16 int16_t
1937 * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1938 * ctypedef npy_int64 int64_t
1939 *
1940*/
1941typedef npy_int32 __pyx_t_5numpy_int32_t;
1942
1943/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":764
1944 * ctypedef npy_int16 int16_t
1945 * ctypedef npy_int32 int32_t
1946 * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1947 *
1948 * ctypedef npy_uint8 uint8_t
1949*/
1950typedef npy_int64 __pyx_t_5numpy_int64_t;
1951
1952/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":766
1953 * ctypedef npy_int64 int64_t
1954 *
1955 * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1956 * ctypedef npy_uint16 uint16_t
1957 * ctypedef npy_uint32 uint32_t
1958*/
1959typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1960
1961/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":767
1962 *
1963 * ctypedef npy_uint8 uint8_t
1964 * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1965 * ctypedef npy_uint32 uint32_t
1966 * ctypedef npy_uint64 uint64_t
1967*/
1968typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1969
1970/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":768
1971 * ctypedef npy_uint8 uint8_t
1972 * ctypedef npy_uint16 uint16_t
1973 * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1974 * ctypedef npy_uint64 uint64_t
1975 *
1976*/
1977typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1978
1979/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":769
1980 * ctypedef npy_uint16 uint16_t
1981 * ctypedef npy_uint32 uint32_t
1982 * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1983 *
1984 * ctypedef npy_float32 float32_t
1985*/
1986typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1987
1988/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":771
1989 * ctypedef npy_uint64 uint64_t
1990 *
1991 * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1992 * ctypedef npy_float64 float64_t
1993 * #ctypedef npy_float80 float80_t
1994*/
1995typedef npy_float32 __pyx_t_5numpy_float32_t;
1996
1997/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":772
1998 *
1999 * ctypedef npy_float32 float32_t
2000 * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
2001 * #ctypedef npy_float80 float80_t
2002 * #ctypedef npy_float128 float128_t
2003*/
2004typedef npy_float64 __pyx_t_5numpy_float64_t;
2005
2006/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":779
2007 * ctypedef double complex complex128_t
2008 *
2009 * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
2010 * ctypedef npy_ulonglong ulonglong_t
2011 *
2012*/
2013typedef npy_longlong __pyx_t_5numpy_longlong_t;
2014
2015/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":780
2016 *
2017 * ctypedef npy_longlong longlong_t
2018 * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
2019 *
2020 * ctypedef npy_intp intp_t
2021*/
2022typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
2023
2024/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":782
2025 * ctypedef npy_ulonglong ulonglong_t
2026 *
2027 * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
2028 * ctypedef npy_uintp uintp_t
2029 *
2030*/
2031typedef npy_intp __pyx_t_5numpy_intp_t;
2032
2033/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":783
2034 *
2035 * ctypedef npy_intp intp_t
2036 * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
2037 *
2038 * ctypedef npy_double float_t
2039*/
2040typedef npy_uintp __pyx_t_5numpy_uintp_t;
2041
2042/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":785
2043 * ctypedef npy_uintp uintp_t
2044 *
2045 * ctypedef npy_double float_t # <<<<<<<<<<<<<<
2046 * ctypedef npy_double double_t
2047 * ctypedef npy_longdouble longdouble_t
2048*/
2049typedef npy_double __pyx_t_5numpy_float_t;
2050
2051/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":786
2052 *
2053 * ctypedef npy_double float_t
2054 * ctypedef npy_double double_t # <<<<<<<<<<<<<<
2055 * ctypedef npy_longdouble longdouble_t
2056 *
2057*/
2058typedef npy_double __pyx_t_5numpy_double_t;
2059
2060/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":787
2061 * ctypedef npy_double float_t
2062 * ctypedef npy_double double_t
2063 * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
2064 *
2065 * ctypedef float complex cfloat_t
2066*/
2067typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
2068/* #### Code section: complex_type_declarations ### */
2069/* Declarations.proto */
2070#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2071 #ifdef __cplusplus
2072 typedef ::std::complex< float > __pyx_t_float_complex;
2073 #else
2074 typedef float _Complex __pyx_t_float_complex;
2075 #endif
2076#else
2077 typedef struct { float real, imag; } __pyx_t_float_complex;
2078#endif
2079static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
2080
2081/* Declarations.proto */
2082#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2083 #ifdef __cplusplus
2084 typedef ::std::complex< double > __pyx_t_double_complex;
2085 #else
2086 typedef double _Complex __pyx_t_double_complex;
2087 #endif
2088#else
2089 typedef struct { double real, imag; } __pyx_t_double_complex;
2090#endif
2091static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
2092
2093/* Declarations.proto */
2094#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2095 #ifdef __cplusplus
2096 typedef ::std::complex< long double > __pyx_t_long_double_complex;
2097 #else
2098 typedef long double _Complex __pyx_t_long_double_complex;
2099 #endif
2100#else
2101 typedef struct { long double real, imag; } __pyx_t_long_double_complex;
2102#endif
2103static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double);
2104
2105/* #### Code section: type_declarations ### */
2106
2107/*--- Type declarations ---*/
2108struct PyMPIDatatypeObject;
2109struct PyMPIStatusObject;
2110struct PyMPIRequestObject;
2111struct PyMPIPrequestObject;
2112struct PyMPIGrequestObject;
2113struct PyMPIMessageObject;
2114struct PyMPIOpObject;
2115struct PyMPIGroupObject;
2116struct PyMPIInfoObject;
2117struct PyMPIErrhandlerObject;
2118struct PyMPISessionObject;
2119struct PyMPICommObject;
2120struct PyMPIIntracommObject;
2121struct PyMPITopocommObject;
2122struct PyMPICartcommObject;
2123struct PyMPIGraphcommObject;
2124struct PyMPIDistgraphcommObject;
2125struct PyMPIIntercommObject;
2126struct PyMPIWinObject;
2127struct PyMPIFileObject;
2128struct __pyx_obj_7proteus_10cmeshTools_CMesh;
2129struct __pyx_array_obj;
2130struct __pyx_MemviewEnum_obj;
2131struct __pyx_memoryview_obj;
2132struct __pyx_memoryviewslice_obj;
2133
2134/* "mpi4py/MPI.pxd":44
2135 * ctypedef MPI_Count Count "MPI_Count"
2136 *
2137 * ctypedef api class Datatype [ # <<<<<<<<<<<<<<
2138 * type PyMPIDatatype_Type,
2139 * object PyMPIDatatypeObject,
2140*/
2141struct PyMPIDatatypeObject {
2142 PyObject_HEAD
2143 MPI_Datatype ob_mpi;
2144 unsigned int flags;
2145 PyObject *__weakref__;
2146};
2147typedef struct PyMPIDatatypeObject PyMPIDatatypeObject;
2148
2149
2150/* "mpi4py/MPI.pxd":52
2151 * cdef object __weakref__
2152 *
2153 * ctypedef api class Status [ # <<<<<<<<<<<<<<
2154 * type PyMPIStatus_Type,
2155 * object PyMPIStatusObject,
2156*/
2157struct PyMPIStatusObject {
2158 PyObject_HEAD
2159 MPI_Status ob_mpi;
2160 unsigned int flags;
2161 PyObject *__weakref__;
2162};
2163typedef struct PyMPIStatusObject PyMPIStatusObject;
2164
2165
2166/* "mpi4py/MPI.pxd":60
2167 * cdef object __weakref__
2168 *
2169 * ctypedef api class Request [ # <<<<<<<<<<<<<<
2170 * type PyMPIRequest_Type,
2171 * object PyMPIRequestObject,
2172*/
2173struct PyMPIRequestObject {
2174 PyObject_HEAD
2175 MPI_Request ob_mpi;
2176 unsigned int flags;
2177 PyObject *__weakref__;
2178 PyObject *ob_buf;
2179};
2180typedef struct PyMPIRequestObject PyMPIRequestObject;
2181
2182
2183/* "mpi4py/MPI.pxd":69
2184 * cdef object ob_buf
2185 *
2186 * ctypedef api class Prequest(Request) [ # <<<<<<<<<<<<<<
2187 * type PyMPIPrequest_Type,
2188 * object PyMPIPrequestObject,
2189*/
2190struct PyMPIPrequestObject {
2191 struct PyMPIRequestObject __pyx_base;
2192};
2193typedef struct PyMPIPrequestObject PyMPIPrequestObject;
2194
2195
2196/* "mpi4py/MPI.pxd":75
2197 * pass
2198 *
2199 * ctypedef api class Grequest(Request) [ # <<<<<<<<<<<<<<
2200 * type PyMPIGrequest_Type,
2201 * object PyMPIGrequestObject,
2202*/
2203struct PyMPIGrequestObject {
2204 struct PyMPIRequestObject __pyx_base;
2205 MPI_Request ob_grequest;
2206};
2207typedef struct PyMPIGrequestObject PyMPIGrequestObject;
2208
2209
2210/* "mpi4py/MPI.pxd":81
2211 * cdef MPI_Request ob_grequest
2212 *
2213 * ctypedef api class Message [ # <<<<<<<<<<<<<<
2214 * type PyMPIMessage_Type,
2215 * object PyMPIMessageObject,
2216*/
2217struct PyMPIMessageObject {
2218 PyObject_HEAD
2219 MPI_Message ob_mpi;
2220 unsigned int flags;
2221 PyObject *__weakref__;
2222 PyObject *ob_buf;
2223};
2224typedef struct PyMPIMessageObject PyMPIMessageObject;
2225
2226
2227/* "mpi4py/MPI.pxd":90
2228 * cdef object ob_buf
2229 *
2230 * ctypedef api class Op [ # <<<<<<<<<<<<<<
2231 * type PyMPIOp_Type,
2232 * object PyMPIOpObject,
2233*/
2234struct PyMPIOpObject {
2235 PyObject_HEAD
2236 MPI_Op ob_mpi;
2237 unsigned int flags;
2238 PyObject *__weakref__;
2239};
2240typedef struct PyMPIOpObject PyMPIOpObject;
2241
2242
2243/* "mpi4py/MPI.pxd":98
2244 * cdef object __weakref__
2245 *
2246 * ctypedef api class Group [ # <<<<<<<<<<<<<<
2247 * type PyMPIGroup_Type,
2248 * object PyMPIGroupObject,
2249*/
2250struct PyMPIGroupObject {
2251 PyObject_HEAD
2252 MPI_Group ob_mpi;
2253 unsigned int flags;
2254 PyObject *__weakref__;
2255};
2256typedef struct PyMPIGroupObject PyMPIGroupObject;
2257
2258
2259/* "mpi4py/MPI.pxd":106
2260 * cdef object __weakref__
2261 *
2262 * ctypedef api class Info [ # <<<<<<<<<<<<<<
2263 * type PyMPIInfo_Type,
2264 * object PyMPIInfoObject,
2265*/
2266struct PyMPIInfoObject {
2267 PyObject_HEAD
2268 MPI_Info ob_mpi;
2269 unsigned int flags;
2270 PyObject *__weakref__;
2271};
2272typedef struct PyMPIInfoObject PyMPIInfoObject;
2273
2274
2275/* "mpi4py/MPI.pxd":114
2276 * cdef object __weakref__
2277 *
2278 * ctypedef api class Errhandler [ # <<<<<<<<<<<<<<
2279 * type PyMPIErrhandler_Type,
2280 * object PyMPIErrhandlerObject,
2281*/
2282struct PyMPIErrhandlerObject {
2283 PyObject_HEAD
2284 MPI_Errhandler ob_mpi;
2285 unsigned int flags;
2286 PyObject *__weakref__;
2287};
2288typedef struct PyMPIErrhandlerObject PyMPIErrhandlerObject;
2289
2290
2291/* "mpi4py/MPI.pxd":122
2292 * cdef object __weakref__
2293 *
2294 * ctypedef api class Session [ # <<<<<<<<<<<<<<
2295 * type PyMPISession_Type,
2296 * object PyMPISessionObject,
2297*/
2298struct PyMPISessionObject {
2299 PyObject_HEAD
2300 MPI_Session ob_mpi;
2301 unsigned int flags;
2302 PyObject *__weakref__;
2303};
2304typedef struct PyMPISessionObject PyMPISessionObject;
2305
2306
2307/* "mpi4py/MPI.pxd":130
2308 * cdef object __weakref__
2309 *
2310 * ctypedef api class Comm [ # <<<<<<<<<<<<<<
2311 * type PyMPIComm_Type,
2312 * object PyMPICommObject,
2313*/
2314struct PyMPICommObject {
2315 PyObject_HEAD
2316 MPI_Comm ob_mpi;
2317 unsigned int flags;
2318 PyObject *__weakref__;
2319};
2320typedef struct PyMPICommObject PyMPICommObject;
2321
2322
2323/* "mpi4py/MPI.pxd":138
2324 * cdef object __weakref__
2325 *
2326 * ctypedef api class Intracomm(Comm) [ # <<<<<<<<<<<<<<
2327 * type PyMPIIntracomm_Type,
2328 * object PyMPIIntracommObject,
2329*/
2330struct PyMPIIntracommObject {
2331 struct PyMPICommObject __pyx_base;
2332};
2333typedef struct PyMPIIntracommObject PyMPIIntracommObject;
2334
2335
2336/* "mpi4py/MPI.pxd":144
2337 * pass
2338 *
2339 * ctypedef api class Topocomm(Intracomm) [ # <<<<<<<<<<<<<<
2340 * type PyMPITopocomm_Type,
2341 * object PyMPITopocommObject,
2342*/
2343struct PyMPITopocommObject {
2344 struct PyMPIIntracommObject __pyx_base;
2345};
2346typedef struct PyMPITopocommObject PyMPITopocommObject;
2347
2348
2349/* "mpi4py/MPI.pxd":150
2350 * pass
2351 *
2352 * ctypedef api class Cartcomm(Topocomm) [ # <<<<<<<<<<<<<<
2353 * type PyMPICartcomm_Type,
2354 * object PyMPICartcommObject,
2355*/
2356struct PyMPICartcommObject {
2357 struct PyMPITopocommObject __pyx_base;
2358};
2359typedef struct PyMPICartcommObject PyMPICartcommObject;
2360
2361
2362/* "mpi4py/MPI.pxd":156
2363 * pass
2364 *
2365 * ctypedef api class Graphcomm(Topocomm) [ # <<<<<<<<<<<<<<
2366 * type PyMPIGraphcomm_Type,
2367 * object PyMPIGraphcommObject,
2368*/
2369struct PyMPIGraphcommObject {
2370 struct PyMPITopocommObject __pyx_base;
2371};
2372typedef struct PyMPIGraphcommObject PyMPIGraphcommObject;
2373
2374
2375/* "mpi4py/MPI.pxd":162
2376 * pass
2377 *
2378 * ctypedef api class Distgraphcomm(Topocomm) [ # <<<<<<<<<<<<<<
2379 * type PyMPIDistgraphcomm_Type,
2380 * object PyMPIDistgraphcommObject,
2381*/
2382struct PyMPIDistgraphcommObject {
2383 struct PyMPITopocommObject __pyx_base;
2384};
2385typedef struct PyMPIDistgraphcommObject PyMPIDistgraphcommObject;
2386
2387
2388/* "mpi4py/MPI.pxd":168
2389 * pass
2390 *
2391 * ctypedef api class Intercomm(Comm) [ # <<<<<<<<<<<<<<
2392 * type PyMPIIntercomm_Type,
2393 * object PyMPIIntercommObject,
2394*/
2395struct PyMPIIntercommObject {
2396 struct PyMPICommObject __pyx_base;
2397};
2398typedef struct PyMPIIntercommObject PyMPIIntercommObject;
2399
2400
2401/* "mpi4py/MPI.pxd":174
2402 * pass
2403 *
2404 * ctypedef api class Win [ # <<<<<<<<<<<<<<
2405 * type PyMPIWin_Type,
2406 * object PyMPIWinObject,
2407*/
2408struct PyMPIWinObject {
2409 PyObject_HEAD
2410 MPI_Win ob_mpi;
2411 unsigned int flags;
2412 PyObject *__weakref__;
2413 PyObject *ob_mem;
2414};
2415typedef struct PyMPIWinObject PyMPIWinObject;
2416
2417
2418/* "mpi4py/MPI.pxd":183
2419 * cdef object ob_mem
2420 *
2421 * ctypedef api class File [ # <<<<<<<<<<<<<<
2422 * type PyMPIFile_Type,
2423 * object PyMPIFileObject,
2424*/
2425struct PyMPIFileObject {
2426 PyObject_HEAD
2427 MPI_File ob_mpi;
2428 unsigned int flags;
2429 PyObject *__weakref__;
2430};
2431typedef struct PyMPIFileObject PyMPIFileObject;
2432
2433
2434/* "cmeshTools.pxd":6
2435 * cimport mesh as cppm
2436 *
2437 * cdef class CMesh: # <<<<<<<<<<<<<<
2438 * cdef cppm.Mesh mesh
2439 * cdef public:
2440*/
2441struct __pyx_obj_7proteus_10cmeshTools_CMesh {
2442 PyObject_HEAD
2443 struct Mesh mesh;
2444 int nElements_global;
2445 int nNodes_global;
2446 int nNodes_element;
2447 int nNodes_elementBoundary;
2448 int nElementBoundaries_element;
2449 int nElementBoundaries_global;
2450 int nInteriorElementBoundaries_global;
2451 int nExteriorElementBoundaries_global;
2452 int max_nElements_node;
2453 int nEdges_global;
2454 int max_nNodeNeighbors_node;
2455 PyArrayObject *elementNodesArray;
2456 PyArrayObject *nodeElementsArray;
2457 PyArrayObject *nodeElementOffsets;
2458 PyArrayObject *elementNeighborsArray;
2459 PyArrayObject *elementBoundariesArray;
2460 PyArrayObject *elementBoundaryNodesArray;
2461 PyArrayObject *elementBoundaryElementsArray;
2462 PyArrayObject *elementBoundaryLocalElementBoundariesArray;
2463 PyArrayObject *interiorElementBoundariesArray;
2464 PyArrayObject *exteriorElementBoundariesArray;
2465 PyArrayObject *edgeNodesArray;
2466 PyArrayObject *nodeStarArray;
2467 PyArrayObject *nodeStarOffsets;
2468 PyArrayObject *elementMaterialTypes;
2469 PyArrayObject *elementBoundaryMaterialTypes;
2470 PyArrayObject *nodeMaterialTypes;
2471 PyArrayObject *nodeArray;
2472 int nx;
2473 int ny;
2474 int nz;
2475 int px;
2476 int py;
2477 int pz;
2478 PyArrayObject *elementIJK;
2479 PyArrayObject *weights;
2480 PyArrayObject *U_KNOT;
2481 PyArrayObject *V_KNOT;
2482 PyArrayObject *W_KNOT;
2483 PyArrayObject *elementDiametersArray;
2484 PyArrayObject *elementInnerDiametersArray;
2485 PyArrayObject *elementBoundaryDiametersArray;
2486 PyArrayObject *elementBarycentersArray;
2487 PyArrayObject *elementBoundaryBarycentersArray;
2488 PyArrayObject *nodeDiametersArray;
2489 PyArrayObject *nodeSupportArray;
2490 double h;
2491 double hMin;
2492 double sigmaMax;
2493 double volume;
2494};
2495
2496
2497/* "View.MemoryView":128
2498 *
2499 *
2500 * @cython.collection_type("sequence") # <<<<<<<<<<<<<<
2501 * @cname("__pyx_array")
2502 * cdef class array:
2503*/
2504struct __pyx_array_obj {
2505 PyObject_HEAD
2506 struct __pyx_vtabstruct_array *__pyx_vtab;
2507 char *data;
2508 Py_ssize_t len;
2509 char *format;
2510 int ndim;
2511 Py_ssize_t *_shape;
2512 Py_ssize_t *_strides;
2513 Py_ssize_t itemsize;
2514 PyObject *mode;
2515 PyObject *_format;
2516 void (*callback_free_data)(void *);
2517 int free_data;
2518 int dtype_is_object;
2519};
2520
2521
2522/* "View.MemoryView":318
2523 *
2524 *
2525 * @cname('__pyx_MemviewEnum') # <<<<<<<<<<<<<<
2526 * cdef class Enum(object):
2527 * cdef object name
2528*/
2529struct __pyx_MemviewEnum_obj {
2530 PyObject_HEAD
2531 PyObject *name;
2532};
2533
2534
2535/* "View.MemoryView":353
2536 *
2537 *
2538 * @cname('__pyx_memoryview') # <<<<<<<<<<<<<<
2539 * cdef class memoryview:
2540 *
2541*/
2542struct __pyx_memoryview_obj {
2543 PyObject_HEAD
2544 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
2545 PyObject *obj;
2546 PyObject *_size;
2547 void *_unused;
2548 PyThread_type_lock lock;
2549 __pyx_atomic_int_type acquisition_count;
2550 Py_buffer view;
2551 int flags;
2552 int dtype_is_object;
2553 __Pyx_TypeInfo const *typeinfo;
2554};
2555
2556
2557/* "View.MemoryView":947
2558 *
2559 *
2560 * @cython.collection_type("sequence") # <<<<<<<<<<<<<<
2561 * @cname('__pyx_memoryviewslice')
2562 * cdef class _memoryviewslice(memoryview):
2563*/
2564struct __pyx_memoryviewslice_obj {
2565 struct __pyx_memoryview_obj __pyx_base;
2566 __Pyx_memviewslice from_slice;
2567 PyObject *from_object;
2568 PyObject *(*to_object_func)(char *);
2569 __pyx_memoryview_to_dtype_func_type to_dtype_func;
2570};
2571
2572
2573
2574/* "View.MemoryView":128
2575 *
2576 *
2577 * @cython.collection_type("sequence") # <<<<<<<<<<<<<<
2578 * @cname("__pyx_array")
2579 * cdef class array:
2580*/
2581
2582struct __pyx_vtabstruct_array {
2583 PyObject *(*get_memview)(struct __pyx_array_obj *);
2584};
2585static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
2586
2587
2588/* "View.MemoryView":353
2589 *
2590 *
2591 * @cname('__pyx_memoryview') # <<<<<<<<<<<<<<
2592 * cdef class memoryview:
2593 *
2594*/
2595
2596struct __pyx_vtabstruct_memoryview {
2597 char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
2598 PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
2599 PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2600 PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
2601 PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2602 PyObject *(*setitem_indexed1)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
2603 PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
2604 PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
2605 PyObject *(*_get_base)(struct __pyx_memoryview_obj *);
2606};
2607static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
2608
2609
2610/* "View.MemoryView":947
2611 *
2612 *
2613 * @cython.collection_type("sequence") # <<<<<<<<<<<<<<
2614 * @cname('__pyx_memoryviewslice')
2615 * cdef class _memoryviewslice(memoryview):
2616*/
2617
2618struct __pyx_vtabstruct__memoryviewslice {
2619 struct __pyx_vtabstruct_memoryview __pyx_base;
2620};
2621static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
2622/* #### Code section: utility_code_proto ### */
2623
2624/* --- Runtime support code (head) --- */
2625/* Refnanny.proto */
2626#ifndef CYTHON_REFNANNY
2627 #define CYTHON_REFNANNY 0
2628#endif
2629#if CYTHON_REFNANNY
2630 typedef struct {
2631 void (*INCREF)(void*, PyObject*, Py_ssize_t);
2632 void (*DECREF)(void*, PyObject*, Py_ssize_t);
2633 void (*GOTREF)(void*, PyObject*, Py_ssize_t);
2634 void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
2635 void* (*SetupContext)(const char*, Py_ssize_t, const char*);
2636 void (*FinishContext)(void**);
2637 } __Pyx_RefNannyAPIStruct;
2638 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
2639 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
2640 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
2641 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2642 if (acquire_gil) {\
2643 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2644 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2645 PyGILState_Release(__pyx_gilstate_save);\
2646 } else {\
2647 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2648 }
2649 #define __Pyx_RefNannyFinishContextNogil() {\
2650 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2651 __Pyx_RefNannyFinishContext();\
2652 PyGILState_Release(__pyx_gilstate_save);\
2653 }
2654 #define __Pyx_RefNannyFinishContextNogil() {\
2655 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2656 __Pyx_RefNannyFinishContext();\
2657 PyGILState_Release(__pyx_gilstate_save);\
2658 }
2659 #define __Pyx_RefNannyFinishContext()\
2660 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
2661 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2662 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2663 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2664 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2665 #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
2666 #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
2667 #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
2668 #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
2669#else
2670 #define __Pyx_RefNannyDeclarations
2671 #define __Pyx_RefNannySetupContext(name, acquire_gil)
2672 #define __Pyx_RefNannyFinishContextNogil()
2673 #define __Pyx_RefNannyFinishContext()
2674 #define __Pyx_INCREF(r) Py_INCREF(r)
2675 #define __Pyx_DECREF(r) Py_DECREF(r)
2676 #define __Pyx_GOTREF(r)
2677 #define __Pyx_GIVEREF(r)
2678 #define __Pyx_XINCREF(r) Py_XINCREF(r)
2679 #define __Pyx_XDECREF(r) Py_XDECREF(r)
2680 #define __Pyx_XGOTREF(r)
2681 #define __Pyx_XGIVEREF(r)
2682#endif
2683#define __Pyx_Py_XDECREF_SET(r, v) do {\
2684 PyObject *tmp = (PyObject *) r;\
2685 r = v; Py_XDECREF(tmp);\
2686 } while (0)
2687#define __Pyx_XDECREF_SET(r, v) do {\
2688 PyObject *tmp = (PyObject *) r;\
2689 r = v; __Pyx_XDECREF(tmp);\
2690 } while (0)
2691#define __Pyx_DECREF_SET(r, v) do {\
2692 PyObject *tmp = (PyObject *) r;\
2693 r = v; __Pyx_DECREF(tmp);\
2694 } while (0)
2695#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
2696#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
2697
2698/* CopyObjectArray.proto (used by TupleOrListFromArrayImpl) */
2699#if CYTHON_COMPILING_IN_CPYTHON
2700static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length);
2701#endif
2702
2703/* TupleOrListFromArrayImpl.proto (used by TupleFromArray) */
2704#if PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API
2705#define __Pyx_PyTuple_FromArray(src, n) PyTuple_FromArray(src, ((n)<0) ? 0 : (n))
2706#else
2707CYTHON_UNUSED static PyObject *
2708__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
2709#endif
2710
2711/* TupleFromArray.proto (used by fastcall) */
2712
2713
2714/* IncludeStringH.proto (used by PyObjectCompare) */
2715#include <string.h>
2716
2717/* PyObjectCompare.proto (used by UnicodeEquals) */
2718static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2, int pyop);
2719
2720/* UnicodeEquals.proto (used by fastcall) */
2721#define __Pyx_PyUnicode_Equals(s1, s2) __Pyx_PyObject_CompareBoolEq_str_str(s1, s2, Py_EQ)
2722
2723/* fastcall.proto */
2724#if CYTHON_AVOID_BORROWED_REFS
2725 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
2726#elif CYTHON_ASSUME_SAFE_MACROS
2727 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
2728#else
2729 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
2730#endif
2731#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
2732#define __Pyx_KwValues_VARARGS(args, nargs) NULL
2733#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
2734#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
2735#if CYTHON_VECTORCALL
2736 #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
2737 #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
2738 #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
2739 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
2740 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
2741 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
2742 #else
2743 #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
2744 #endif
2745#else
2746 #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
2747 #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
2748 #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
2749 #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
2750 #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
2751#endif
2752#if CYTHON_VECTORCALL_TPNEW
2753 #if !CYTHON_VECTORCALL
2754 #error Enabling CYTHON_VECTORCALL_TPNEW without CYTHON_VECTORCALL is not supported
2755 #endif
2756 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_FASTCALL
2757 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_FASTCALL
2758 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_FASTCALL
2759 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_FASTCALL
2760 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_FASTCALL
2761#else
2762 #define __Pyx_ArgRef_FASTCALL_TPNEW __Pyx_ArgRef_VARARGS
2763 #define __Pyx_NumKwargs_FASTCALL_TPNEW __Pyx_NumKwargs_VARARGS
2764 #define __Pyx_KwValues_FASTCALL_TPNEW __Pyx_KwValues_VARARGS
2765 #define __Pyx_GetKwValue_FASTCALL_TPNEW __Pyx_GetKwValue_VARARGS
2766 #define __Pyx_KwargsAsDict_FASTCALL_TPNEW __Pyx_KwargsAsDict_VARARGS
2767#endif
2768#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
2769#if CYTHON_VECTORCALL
2770#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
2771#else
2772#define __Pyx_ArgsSlice_FASTCALL __Pyx_ArgsSlice_VARARGS
2773#endif
2774
2775/* py_dict_items.proto (used by OwnedDictNext) */
2776#define __Pyx_PyDict_items_TypePtr (&PyDictKeys_Type)
2777#define __Pyx_PyDict_items_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictItems_TypePtr)
2778#define __Pyx_PyDict_items_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictItems_TypePtr)
2779static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);
2780
2781/* CallCFunction.proto (used by CallUnboundCMethod0) */
2782#define __Pyx_CallCFunction(cfunc, self, args)\
2783 ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
2784#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
2785 ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
2786#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
2787 ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
2788#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
2789 ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)
2790
2791/* PyObjectCall.proto (used by PyObjectFastCall) */
2792#if CYTHON_COMPILING_IN_CPYTHON
2793static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2794#else
2795#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2796#endif
2797
2798/* PyObjectCallMethO.proto (used by PyObjectFastCall) */
2799#if CYTHON_COMPILING_IN_CPYTHON
2800static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2801#endif
2802
2803/* PyObjectFastCall.proto (used by PyObjectCallOneArg) */
2804#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
2805static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargsf, PyObject *kwargs);
2806
2807/* PyObjectCallOneArg.proto (used by CallUnboundCMethod0) */
2808static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2809
2810/* UnpackUnboundCMethod_decl.proto (used by UnpackUnboundCMethod) */
2811typedef struct {
2812 PyObject *type;
2813 PyObject **method_name;
2814 PyCFunction func;
2815 PyObject *method;
2816 int flag;
2817#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
2818 __pyx_atomic_int_type initialized;
2819#endif
2820} __Pyx_CachedCFunction;
2821
2822/* IgnoreException.proto (used by UnpackUnboundCMethod_impl) */
2823static CYTHON_INLINE int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception);
2824#define __Pyx_IgnoreException(ignorable_exception) __Pyx_IgnoreGivenException(NULL, ignorable_exception)
2825
2826/* FastTypeChecks.proto (used by UnpackUnboundCMethod_impl) */
2827#if CYTHON_COMPILING_IN_CPYTHON
2828#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2829#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
2830static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2831static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
2832#define __Pyx_PyAnySet_Check(obj) __Pyx_TypeCheck2(obj, &PySet_Type, &PyFrozenSet_Type)
2833#else
2834#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2835#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
2836#define __Pyx_PyAnySet_Check(obj) PyAnySet_Check(obj)
2837#endif
2838
2839/* PyObjectGetAttrStr.proto (used by UnpackUnboundCMethod_impl) */
2840#if CYTHON_USE_TYPE_SLOTS
2841static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2842#else
2843#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2844#endif
2845
2846/* UnpackUnboundCMethod_impl.export */
2847static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target);
2848
2849/* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */
2850#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
2851static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
2852#if !CYTHON_ATOMICS
2853 return 1;
2854#else
2855 __pyx_nonatomic_int_type expected = 0;
2856 if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
2857 return 0;
2858 }
2859 return expected;
2860#endif
2861}
2862static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
2863#if CYTHON_ATOMICS
2864 __pyx_atomic_store(&cfunc->initialized, 2);
2865#endif
2866}
2867#else
2868#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
2869#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
2870#endif
2871
2872/* CallUnboundCMethod0.proto */
2873CYTHON_UNUSED
2874static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2875#if CYTHON_COMPILING_IN_CPYTHON
2876static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2877#else
2878#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
2879#endif
2880
2881/* py_dict_values.proto (used by OwnedDictNext) */
2882#define __Pyx_PyDict_values_TypePtr (&PyDictKeys_Type)
2883#define __Pyx_PyDict_values_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyDictValues_TypePtr)
2884#define __Pyx_PyDict_values_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyDictValues_TypePtr)
2885static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);
2886
2887/* OwnedDictNext.proto (used by ParseKeywordsImpl) */
2888#if CYTHON_AVOID_BORROWED_REFS
2889static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue);
2890#else
2891CYTHON_INLINE
2892static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
2893#endif
2894
2895/* RaiseDoubleKeywords.proto (used by ParseKeywordsImpl) */
2896static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
2897
2898/* ParseKeywordsImpl.export */
2899static int __Pyx_ParseKeywordsTuple(
2900 PyObject *kwds,
2901 PyObject * const *kwvalues,
2902 PyObject ** const argnames[],
2903 PyObject *kwds2,
2904 PyObject *values[],
2905 Py_ssize_t num_pos_args,
2906 Py_ssize_t num_kwargs,
2907 const char* function_name,
2908 int ignore_unknown_kwargs
2909);
2910static int __Pyx_ParseKeywordDictToDict(
2911 PyObject *kwds,
2912 PyObject ** const argnames[],
2913 PyObject *kwds2,
2914 PyObject *values[],
2915 Py_ssize_t num_pos_args,
2916 const char* function_name
2917);
2918static int __Pyx_ParseKeywordDict(
2919 PyObject *kwds,
2920 PyObject ** const argnames[],
2921 PyObject *values[],
2922 Py_ssize_t num_pos_args,
2923 Py_ssize_t num_kwargs,
2924 const char* function_name,
2925 int ignore_unknown_kwargs
2926);
2927
2928/* CallUnboundCMethod2.proto */
2929CYTHON_UNUSED
2930static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
2931#if CYTHON_COMPILING_IN_CPYTHON
2932static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
2933#else
2934#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
2935#endif
2936
2937/* ParseKeywords.proto */
2938static CYTHON_INLINE int __Pyx_ParseKeywords(
2939 PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[],
2940 PyObject *kwds2, PyObject *values[],
2941 Py_ssize_t num_pos_args, Py_ssize_t num_kwargs,
2942 const char* function_name,
2943 int ignore_unknown_kwargs
2944);
2945
2946/* RaiseArgTupleInvalid.export */
2947static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
2948 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2949
2950/* ArgTypeTestError.export */
2951static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2952
2953/* ArgTypeTest.proto */
2954static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact);
2955
2956/* PyThreadStateGet.proto (used by PyErrFetchRestore) */
2957#if CYTHON_FAST_THREAD_STATE
2958#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2959#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2960#if PY_VERSION_HEX >= 0x030C00A6
2961#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
2962#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
2963#else
2964#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
2965#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
2966#endif
2967#else
2968#define __Pyx_PyThreadState_declare
2969#define __Pyx_PyThreadState_assign
2970#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
2971#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
2972#endif
2973
2974/* PyErrFetchRestore.proto (used by GivenExceptionMatches) */
2975#if CYTHON_FAST_THREAD_STATE
2976#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2977#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2978#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2979#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2980#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2981static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2982static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2983#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
2984#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2985#else
2986#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2987#endif
2988#else
2989#define __Pyx_PyErr_Clear() PyErr_Clear()
2990#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2991#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2992#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2993#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2994#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2995#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2996#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2997#endif
2998
2999/* GivenExceptionMatches.proto (used by PyErrExceptionMatches) */
3000#if CYTHON_COMPILING_IN_CPYTHON
3001static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
3002static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
3003#else
3004#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
3005static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
3006 return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
3007}
3008#endif
3009#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
3010
3011/* PyErrExceptionMatches.proto (used by PyObjectGetAttrStrNoError) */
3012#if CYTHON_FAST_THREAD_STATE
3013#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
3014static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
3015#else
3016#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
3017#endif
3018
3019/* PyObjectGetAttrStrNoError.proto (used by GetBuiltinName) */
3020static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
3021
3022/* GetBuiltinName.proto */
3023static PyObject *__Pyx_GetBuiltinName(PyObject *name);
3024
3025/* PyObjectFastCallMethod.proto */
3026#if CYTHON_VECTORCALL
3027#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL)
3028#else
3029static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf);
3030#endif
3031
3032/* FormatTypeName.proto (used by RaiseErrorWithObjectType1) */
3033#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030d0000
3034typedef PyObject *__Pyx_TypeName;
3035#define __Pyx_FMT_TYPENAME "%N"
3036#define __Pyx_PyType_GetFullyQualifiedName(tp) Py_NewRef((PyObject*)tp)
3037#define __Pyx_DECREF_TypeName(obj) Py_DECREF(obj)
3038#elif CYTHON_COMPILING_IN_LIMITED_API
3039typedef PyObject *__Pyx_TypeName;
3040#define __Pyx_FMT_TYPENAME "%U"
3041#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
3042static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
3043#else // !LIMITED_API
3044typedef const char *__Pyx_TypeName;
3045#define __Pyx_FMT_TYPENAME "%.200s"
3046#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
3047#define __Pyx_DECREF_TypeName(obj)
3048#endif
3049
3050/* RaiseErrorWithObjectType1.proto (used by RaiseUnexpectedTypeError) */
3051#define __Pyx_RaiseTypeErrorWithObjectType1(message, arg, obj) __Pyx_RaiseErrorWithObjectType1(PyExc_TypeError, message, arg, obj)
3052#define __Pyx_RaiseErrorWithObjectType1(exc_type, message, arg, obj) __Pyx_RaiseErrorWithType1(exc_type, message, arg, Py_TYPE(obj))
3053CYTHON_UNUSED
3054static void __Pyx_RaiseErrorWithType1(PyObject* exc_type, const char* message, const char *arg, PyTypeObject *type_obj);
3055
3056/* RaiseUnexpectedTypeError.proto */
3057CYTHON_UNUSED
3058static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);
3059
3060/* PyMemoryError_Check.proto */
3061#define __Pyx_PyExc_MemoryError_Check(obj) __Pyx_TypeCheck(obj, PyExc_MemoryError)
3062
3063/* RaiseException.export */
3064static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
3065
3066/* PyValueError_Check.proto */
3067#define __Pyx_PyExc_ValueError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ValueError)
3068
3069/* BuildPyUnicode.proto (used by COrdinalToPyUnicode) */
3070static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, const char* chars, int clength,
3071 int prepend_sign, char padding_char);
3072
3073/* COrdinalToPyUnicode.proto (used by CIntToPyUnicode) */
3074static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value);
3075static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t width, char padding_char);
3076
3077/* GCCDiagnostics.proto (used by CIntToPyUnicode) */
3078#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
3079#define __Pyx_HAS_GCC_DIAGNOSTIC
3080#endif
3081
3082/* IncludeStdlibH.proto (used by CIntToPyUnicode) */
3083#include <stdlib.h>
3084
3085/* CIntToPyUnicode.proto */
3086#define __Pyx_PyUnicode_From_int(value, width, padding_char, format_char) (\
3087 ((format_char) == ('c')) ?\
3088 __Pyx_uchar___Pyx_PyUnicode_From_int(value, width, padding_char) :\
3089 __Pyx____Pyx_PyUnicode_From_int(value, width, padding_char, format_char)\
3090 )
3091static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char);
3092static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char);
3093
3094/* CIntToPyUnicode.proto */
3095#define __Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char, format_char) (\
3096 ((format_char) == ('c')) ?\
3097 __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char) :\
3098 __Pyx____Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char, format_char)\
3099 )
3100static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char);
3101static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);
3102
3103/* JoinPyUnicode.proto */
3104#define __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH\
3105 (!CYTHON_COMPILING_IN_GRAAL && !CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API)
3106
3107/* JoinPyUnicode.export */
3108static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, int kind);
3109
3110/* UnicodeEqualsUCS4.proto (used by UnicodeEquals_uchar) */
3111#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
3112#define __Pyx_PyObject_Equals_uchar(s1, s2, ch2, equals, s1_is_str) (\
3113 ((s1) == (s2)) ? ((equals) == Py_EQ) :\
3114 ((s1) == Py_None) ? ((equals) == Py_NE) :\
3115 __Pyx_PyObject_RichCompareBool(s1, s2, equals)\
3116 )
3117#else
3118#define __Pyx_PyObject_Equals_uchar(s1, s2, ch2, equals, s1_is_str) (\
3119 ((s1) == (s2)) ? ((equals) == Py_EQ) :\
3120 ((s1) == Py_None) ? ((equals) == Py_NE) :\
3121 (likely((s1_is_str) || PyUnicode_CheckExact(s1)) ?\
3122 __Pyx__PyUnicode_EqualsUCS4(s1, ch2, equals) :\
3123 __Pyx_PyObject_RichCompareBool(s1, s2, equals)\
3124 ))
3125static CYTHON_INLINE int __Pyx__PyUnicode_EqualsUCS4(PyObject* s1, Py_UCS4 ch2, int equals);
3126#endif
3127
3128/* UnicodeEquals_uchar.proto */
3129#define __Pyx_PyObject_Equals_obj_ch99(s1, s2, equals) __Pyx_PyObject_Equals_uchar(s1, s2, 99, equals, 0)
3130
3131/* PyObjectCompare.proto */
3132static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_object_str(PyObject *op1, PyObject *op2, int pyop);
3133
3134/* PyObjectFormatSimple.proto */
3135#if CYTHON_COMPILING_IN_PYPY
3136 #define __Pyx_PyObject_FormatSimple(s, f) (\
3137 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
3138 PyObject_Format(s, f))
3139#elif CYTHON_USE_TYPE_SLOTS
3140 #define __Pyx_PyObject_FormatSimple(s, f) (\
3141 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
3142 likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
3143 likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
3144 PyObject_Format(s, f))
3145#else
3146 #define __Pyx_PyObject_FormatSimple(s, f) (\
3147 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
3148 PyObject_Format(s, f))
3149#endif
3150
3151/* PyObjectCompare.proto */
3152static CYTHON_INLINE PyObject* __Pyx_PyObject_CompareEq_object_bytes(PyObject *op1, PyObject *op2, int pyop);
3153
3154CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
3155/* UnicodeEquals_uchar.proto */
3156#define __Pyx_PyObject_Equals_str_ch99(s1, s2, equals) __Pyx_PyObject_Equals_uchar(s1, s2, 99, equals, 1)
3157
3158static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
3159/* GetAttr.proto */
3160static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
3161
3162/* PyFrozenDict.proto (used by GetItemInt) */
3163#if CYTHON_COMPILING_IN_LIMITED_API
3164#define __Pyx_PyFrozenDict_TypePtr ((PyTypeObject*) __pyx_mstate_global->__Pyx_PyFrozenDictType)
3165#define __Pyx_PyFrozenDict_New(it) __Pyx__PyFrozenDict_New(__pyx_mstate_global->__Pyx_PyFrozenDictType, it)
3166static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it);
3167#define __Pyx_PyFrozenDict_NewEmpty() __Pyx_PyFrozenDict_New(NULL)
3168#define __Pyx_PyFrozenDict_Check(obj) PyObject_TypeCheck((obj), __Pyx_PyFrozenDict_TypePtr)
3169#define __Pyx_PyFrozenDict_CheckExact(obj) Py_IS_TYPE((obj), __Pyx_PyFrozenDict_TypePtr)
3170#define __Pyx_PyAnyDict_Check(obj) __Pyx__PyAnyDict_Check(obj, __Pyx_PyFrozenDict_TypePtr)
3171static CYTHON_INLINE int __Pyx__PyAnyDict_Check(PyObject *obj, PyTypeObject* frozendict_type) {
3172 return PyObject_TypeCheck(obj, &PyDict_Type) || PyObject_TypeCheck(obj, frozendict_type);
3173}
3174#define __Pyx_PyAnyDict_CheckExact(obj) __Pyx__PyAnyDict_CheckExact(obj, __Pyx_PyFrozenDict_TypePtr)
3175static CYTHON_INLINE int __Pyx__PyAnyDict_CheckExact(PyObject *obj, PyTypeObject* frozendict_type) {
3176 return Py_IS_TYPE(obj, &PyDict_Type) || Py_IS_TYPE(obj, frozendict_type);
3177}
3178#elif PY_VERSION_HEX >= 0x030f00a6 ||\
3179 (defined(PyFrozenDict_Check) && defined(PyAnyDict_Check) && defined(PyFrozenDict_New))
3180#define __Pyx_PyFrozenDict_TypePtr (&PyFrozenDict_Type)
3181#define __Pyx_PyFrozenDict_New(it) PyFrozenDict_New(it)
3182#define __Pyx_PyFrozenDict_NewEmpty() PyFrozenDict_New(NULL)
3183#define __Pyx_PyFrozenDict_Check(obj) PyFrozenDict_Check(obj)
3184#define __Pyx_PyFrozenDict_CheckExact(obj) PyFrozenDict_CheckExact(obj)
3185#define __Pyx_PyAnyDict_Check(obj) PyAnyDict_Check(obj)
3186#define __Pyx_PyAnyDict_CheckExact(obj) PyAnyDict_CheckExact(obj)
3187#else
3188#define __Pyx_PyFrozenDict_TypePtr (&PyDict_Type)
3189static CYTHON_INLINE PyObject* __Pyx_PyFrozenDict_New(PyObject* it) {
3190 if (!it) {
3191 return PyDict_New();
3192 } else if (PyDict_Check(it)) {
3193 return PyDict_Copy(it);
3194 } else {
3195 PyObject *dict = PyDict_New();
3196 if (!dict) return NULL;
3197 PyObject *result = PyNumber_InPlaceOr(dict, it);
3198 Py_DECREF(dict);
3199 return result;
3200 }
3201}
3202#define __Pyx_PyFrozenDict_NewEmpty() PyDict_New()
3203#define __Pyx_PyFrozenDict_Check(obj) PyDict_Check(obj)
3204#define __Pyx_PyFrozenDict_CheckExact(obj) PyDict_CheckExact(obj)
3205#define __Pyx_PyAnyDict_Check(obj) PyDict_Check(obj)
3206#define __Pyx_PyAnyDict_CheckExact(obj) PyDict_CheckExact(obj)
3207#endif
3208
3209/* GetItemInt.proto */
3210#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
3211 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
3212 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
3213 __Pyx_GetItemInt_Generic(o, to_py_func(i)))
3214#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
3215 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
3216 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
3217 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
3218static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
3219 int wraparound, int boundscheck, int unsafe_shared);
3220#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
3221 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
3222 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
3223 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
3224static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
3225 int wraparound, int boundscheck, int unsafe_shared);
3226static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
3227static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
3228 int wraparound, int boundscheck, int unsafe_shared);
3229
3230/* RaiseErrorWithObjectType.proto (used by ObjectGetItem) */
3231#define __Pyx_RaiseTypeErrorWithObjectType(message, obj) __Pyx_RaiseErrorWithObjectType(PyExc_TypeError, message, obj)
3232#define __Pyx_RaiseErrorWithObjectType(exc_type, message, obj) __Pyx_RaiseErrorWithType(exc_type, message, Py_TYPE(obj))
3233CYTHON_UNUSED
3234static void __Pyx_RaiseErrorWithType(PyObject* exc_type, const char* message, PyTypeObject *type_obj);
3235
3236/* ObjectGetItem.proto */
3237#if CYTHON_USE_TYPE_SLOTS
3238static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
3239#else
3240#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
3241#endif
3242
3243/* RejectKeywords.export */
3244static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds);
3245
3246/* PyTypeError_Check.proto */
3247#define __Pyx_PyExc_TypeError_Check(obj) __Pyx_TypeCheck(obj, PyExc_TypeError)
3248
3249/* DivInt[Py_ssize_t].proto */
3250static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t, int b_is_constant);
3251
3252/* UnaryNegOverflows.proto */
3253#define __Pyx_UNARY_NEG_WOULD_OVERFLOW(x)\
3254 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
3255
3256/* GetAttr3.proto */
3257static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
3258
3259/* PyDictVersioning.proto (used by GetModuleGlobalName) */
3260#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
3261#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
3262#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
3263#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
3264 (version_var) = __PYX_GET_DICT_VERSION(dict);\
3265 (cache_var) = (value);
3266#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
3267 static PY_UINT64_T __pyx_dict_version = 0;\
3268 static PyObject *__pyx_dict_cached_value = NULL;\
3269 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
3270 (VAR) = __Pyx_XNewRef(__pyx_dict_cached_value);\
3271 } else {\
3272 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
3273 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
3274 }\
3275}
3276static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
3277static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
3278static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
3279#else
3280#define __PYX_GET_DICT_VERSION(dict) (0)
3281#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
3282#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
3283#endif
3284
3285/* GetModuleGlobalName.proto */
3286#if CYTHON_USE_DICT_VERSIONS
3287#define __Pyx_GetModuleGlobalName(var, name) do {\
3288 static PY_UINT64_T __pyx_dict_version = 0;\
3289 static PyObject *__pyx_dict_cached_value = NULL;\
3290 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\
3291 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
3292 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
3293} while(0)
3294#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
3295 PY_UINT64_T __pyx_dict_version;\
3296 PyObject *__pyx_dict_cached_value;\
3297 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
3298} while(0)
3299static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
3300#else
3301#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
3302#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
3303static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
3304#endif
3305
3306/* AssertionsEnabled.proto */
3307#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000
3308 static int __pyx_assertions_enabled_flag;
3309 #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
3310 #if __clang__ || __GNUC__
3311 __attribute__((no_sanitize("thread")))
3312 #endif
3313 static int __Pyx_init_assertions_enabled(void) {
3314 PyObject *builtins, *debug, *debug_str;
3315 int flag;
3316 builtins = PyEval_GetBuiltins();
3317 if (!builtins) goto bad;
3318 debug_str = PyUnicode_FromStringAndSize("__debug__", 9);
3319 if (!debug_str) goto bad;
3320 debug = PyObject_GetItem(builtins, debug_str);
3321 Py_DECREF(debug_str);
3322 if (!debug) goto bad;
3323 flag = PyObject_IsTrue(debug);
3324 Py_DECREF(debug);
3325 if (flag == -1) goto bad;
3326 __pyx_assertions_enabled_flag = flag;
3327 return 0;
3328 bad:
3329 __pyx_assertions_enabled_flag = 1;
3330 return -1;
3331 }
3332#else
3333 #define __Pyx_init_assertions_enabled() (0)
3334 #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
3335#endif
3336
3337/* PyAssertionError_Check.proto */
3338#define __Pyx_PyExc_AssertionError_Check(obj) __Pyx_TypeCheck(obj, PyExc_AssertionError)
3339
3340/* RaiseTooManyValuesToUnpack.proto */
3341static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
3342
3343/* RaiseNeedMoreValuesToUnpack.proto */
3344static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
3345
3346/* RaiseNoneIterError.proto */
3347static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
3348
3349/* GetTopmostException.proto (used by SaveResetException) */
3350#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
3351static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
3352#endif
3353
3354/* SaveResetException.proto */
3355#if CYTHON_FAST_THREAD_STATE
3356#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
3357static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3358#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
3359static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
3360#else
3361#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
3362#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
3363#endif
3364
3365/* RaiseErrorWithObjectTypes.proto (used by ExtTypeTest) */
3366#define __Pyx_RaiseErrorWithObjectTypes1(exc_type, message, arg, obj1, obj2) __Pyx_RaiseErrorWithTypes1(exc_type, message, arg, Py_TYPE(obj1), Py_TYPE(obj2))
3367#define __Pyx_RaiseTypeErrorWithObjectTypes(message, obj1, obj2) __Pyx_RaiseTypeErrorWithTypes(message, Py_TYPE(obj1), Py_TYPE(obj2))
3368#define __Pyx_RaiseTypeErrorWithTypes(message, type_obj1, type_obj2) __Pyx_RaiseErrorWithTypes1(PyExc_TypeError, "%.1s" message, "", type_obj1, type_obj2)
3369CYTHON_UNUSED
3370static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type, const char *message, const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2);
3371
3372/* ExtTypeTest.proto */
3373static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
3374
3375/* GetException.proto */
3376#if CYTHON_FAST_THREAD_STATE
3377#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
3378static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3379#else
3380static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
3381#endif
3382
3383/* SwapException.proto */
3384#if CYTHON_FAST_THREAD_STATE
3385#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
3386static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
3387#else
3388static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
3389#endif
3390
3391/* HasAttr.proto (used by ImportImpl) */
3392#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
3393#define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n)
3394#else
3395static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
3396#endif
3397
3398/* TupleOrListFromArrayImpl.proto (used by ListFromArray) */
3399CYTHON_UNUSED static PyObject *
3400__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
3401
3402/* ListFromArray.proto (used by ImportImpl) */
3403
3404
3405/* ImportImpl.export */
3406static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level);
3407
3408/* Import.proto */
3409static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level);
3410
3411CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
3412/* ListCompAppendAndDecref.proto */
3413static CYTHON_INLINE int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x);
3414
3415/* PySequenceMultiply.proto */
3416#define __Pyx_PySequence_Multiply_Left(mul, seq) __Pyx_PySequence_Multiply(seq, mul)
3417#if !CYTHON_USE_TYPE_SLOTS
3418#define __Pyx_PySequence_Multiply PySequence_Repeat
3419#else
3420static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul);
3421#endif
3422
3423/* PyNumberBinop.proto */
3424#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API
3425#define __Pyx_PyNumber_Multiply_object_int(op1, op2) PyNumber_Multiply(op1, op2)
3426#define __Pyx_PyNumber_InPlaceMultiply_object_int(op1, op2) PyNumber_InPlaceMultiply(op1, op2)
3427#else
3428#define __Pyx_PyNumber_Multiply_object_int(op1, op2) __Pyx__PyNumber_Multiply_object_int(op1, op2, 0)
3429#define __Pyx_PyNumber_InPlaceMultiply_object_int(op1, op2) __Pyx__PyNumber_Multiply_object_int(op1, op2, 1)
3430static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_object_int(PyObject *op1, PyObject *op2, int inplace);
3431#endif
3432
3433/* PyObjectFormatAndDecref.proto */
3434static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
3435static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);
3436
3437/* PyObjectFormat.proto */
3438#if CYTHON_USE_UNICODE_WRITER
3439static PyObject* __Pyx_PyObject_Format(PyObject* s, PyObject* f);
3440#else
3441#define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f)
3442#endif
3443
3444/* PyObject_Unicode.proto */
3445#define __Pyx_PyObject_Unicode(obj)\
3446 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
3447
3448/* SetItemInt.proto */
3449#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, wraparound, boundscheck, has_gil, unsafe_shared)\
3450 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
3451 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, wraparound, boundscheck, unsafe_shared) :\
3452 __Pyx_SetItemInt_Generic(o, to_py_func(i), v))
3453static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
3454static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
3455 int wraparound, int boundscheck, int unsafe_shared);
3456
3457/* RaiseUnboundLocalError.proto */
3458static void __Pyx_RaiseUnboundLocalError(const char *varname);
3459
3460/* DivInt[long].proto */
3461static CYTHON_INLINE long __Pyx_div_long(long, long, int b_is_constant);
3462
3463/* ListAppend.proto */
3464#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
3465static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x);
3466#else
3467#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
3468#endif
3469
3470/* PyObjectCallMethod1.proto (used by StringJoin) */
3471static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
3472
3473/* StringJoin.proto */
3474static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
3475
3476/* CIntToPyUnicode.proto */
3477#define __Pyx_PyUnicode_From_size_t(value, width, padding_char, format_char) (\
3478 ((format_char) == ('c')) ?\
3479 __Pyx_uchar___Pyx_PyUnicode_From_size_t(value, width, padding_char) :\
3480 __Pyx____Pyx_PyUnicode_From_size_t(value, width, padding_char, format_char)\
3481 )
3482static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char);
3483static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char, char format_char);
3484
3485/* PyException_Check.proto */
3486#define __Pyx_PyExc_Exception_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
3487
3488/* PyImportError_Check.proto */
3489#define __Pyx_PyExc_ImportError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ImportError)
3490
3491/* PyLongBinop.proto */
3492#if !CYTHON_COMPILING_IN_PYPY
3493static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
3494#else
3495#define __Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
3496 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
3497#endif
3498
3499/* AllocateExtensionType.proto */
3500static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final);
3501
3502/* CallSlotAsVectorcall.proto */
3503#if CYTHON_VECTORCALL_TPNEW
3504typedef PyObject * (*__Pyx_tpnewvectorcallfunc)(PyTypeObject* o, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames);
3505static PyObject * __Pyx_CallTpnewAsVectorcall(__Pyx_tpnewvectorcallfunc f, PyTypeObject* o, PyObject *a, PyObject *k);
3506#endif
3507
3508/* CallNewInitFromVectorcall.proto */
3509#if CYTHON_VECTORCALL_TPNEW
3510static PyObject *__Pyx_CallNewInitFromVectorcall(PyTypeObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3511#endif
3512
3513/* DeallocKeepAlive.proto */
3514#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
3515#define __Pyx_DeallocKeepAliveBegin(o) do {\
3516 _Py_atomic_store_uintptr_relaxed(&(o)->ob_tid, _Py_ThreadId());\
3517 _Py_atomic_store_uint32_relaxed(&(o)->ob_ref_local, 1);\
3518 _Py_atomic_store_ssize_relaxed(&(o)->ob_ref_shared, 0);\
3519 } while (0)
3520#define __Pyx_DeallocKeepAliveEnd(o)\
3521 _Py_atomic_store_uint32_relaxed(&(o)->ob_ref_local, 0)
3522#else
3523#define __Pyx_DeallocKeepAliveBegin(o) Py_SET_REFCNT(o, Py_REFCNT(o) + 1)
3524#define __Pyx_DeallocKeepAliveEnd(o) Py_SET_REFCNT(o, Py_REFCNT(o) - 1)
3525#endif
3526
3527/* CallSlotAsVectorcall.proto */
3528#if CYTHON_VECTORCALL_TPNEW
3529typedef int (*__Pyx_tpinitvectorcallfunc)(PyObject* o, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames);
3530static int __Pyx_CallTpinitAsVectorcall(__Pyx_tpinitvectorcallfunc f, PyObject* o, PyObject *a, PyObject *k);
3531#endif
3532
3533/* CallTypeTraverse.proto */
3534#if !CYTHON_USE_TYPE_SPECS
3535#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
3536#else
3537static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg);
3538#endif
3539
3540/* DefaultPlacementNew.proto */
3541#include <new>
3542template<typename T>
3543void __Pyx_default_placement_construct(T* x) {
3544 new (static_cast<void*>(x)) T();
3545}
3546
3547/* ApplySequenceOrMappingFlag.proto */
3548#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
3549int __Pyx_ApplySequenceOrMappingFlag(PyTypeObject *tp, int is_sequence);
3550#else
3551#define __Pyx_ApplySequenceOrMappingFlag(tp, is_sequence) (0)
3552#endif
3553
3554/* PyObjectCallMethod0.proto (used by PyType_Ready) */
3555static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
3556
3557/* GetTypeDictOffset.proto (used by ValidateBasesTuple) */
3558#if !CYTHON_USE_TYPE_SLOTS
3559CYTHON_UNUSED static Py_ssize_t __Pyx_GetTypeDictOffset(PyObject *tp, int require_cython_valid_result);
3560#endif
3561
3562/* ValidateBasesTuple.proto (used by PyType_Ready) */
3563#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
3564static int __Pyx_validate_bases_tuple(const char *type_name, int has_dictoffset, PyObject *bases);
3565#endif
3566
3567/* PyType_Ready.export */
3568CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);
3569
3570/* GetVTable.proto (used by MergeVTables) */
3571static int __Pyx_GetVtable(PyTypeObject *type, void** table);
3572
3573/* MergeVTables.proto (used by SetVTable) */
3574static int __Pyx_MergeVtables(PyTypeObject *type);
3575
3576/* SetVTable.export */
3577static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);
3578
3579/* LimitedApiGetTypeTypeDict.proto (used by DelItemOnTypeDict) */
3580#if CYTHON_COMPILING_IN_LIMITED_API
3581static PyObject *__Pyx_GetTypeTypeDict(PyTypeObject *tp);
3582#endif
3583
3584/* DelItemOnTypeDict.proto (used by SetupReduce) */
3585#define __Pyx_DelItemOnTypeDict(tp, k) __Pyx__DelItemOnTypeDict((PyTypeObject*)tp, k)
3586
3587/* DelItemOnTypeDict.export */
3588static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k);
3589
3590/* SetItemOnTypeDict.proto (used by SetupReduce) */
3591#define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)
3592
3593/* SetItemOnTypeDict.export */
3594static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v);
3595
3596/* SetupReduce.export */
3597static int __Pyx_setup_reduce(PyObject* type_obj);
3598
3599/* TypeImport.proto */
3600#ifndef __PYX_HAVE_RT_ImportType_proto_3_3_0
3601#define __PYX_HAVE_RT_ImportType_proto_3_3_0
3602#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
3603#include <stdalign.h>
3604#endif
3605#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
3606#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) alignof(s)
3607#else
3608#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) sizeof(void*)
3609#endif
3610enum __Pyx_ImportType_CheckSize_3_3_0 {
3611 __Pyx_ImportType_CheckSize_Error_3_3_0 = 0,
3612 __Pyx_ImportType_CheckSize_Warn_3_3_0 = 1,
3613 __Pyx_ImportType_CheckSize_Ignore_3_3_0 = 2
3614};
3615static 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);
3616#endif
3617
3618/* ImportFrom.export */
3619static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
3620
3621/* dict_setdefault.proto (used by FetchCommonType) */
3622static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);
3623
3624/* AddModuleRef.proto (used by FetchSharedCythonModule) */
3625#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3) ||\
3626 __PYX_LIMITED_VERSION_HEX < 0x030d0000)
3627 static PyObject *__Pyx_PyImport_AddModuleRef(const char *name);
3628#else
3629 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
3630#endif
3631
3632/* FetchSharedCythonModule.proto (used by FetchCommonType) */
3633static PyObject *__Pyx_FetchSharedCythonABIModule(void);
3634
3635/* VerifyCachedType.proto (used by FetchCommonType) */
3636static int __Pyx_VerifyCachedType(PyObject *cached_type,
3637 const char *name,
3638 Py_ssize_t expected_basicsize);
3639
3640/* FetchCommonType.proto (used by CommonTypesMetaclass) */
3641static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);
3642
3643/* CommonTypesMetaclass.proto (used by CythonFunctionShared) */
3644static int __pyx_CommonTypesMetaclass_init(PyObject *module);
3645#define __Pyx_CommonTypesMetaclass_USED
3646
3647/* CythonFunctionPerModule.proto (used by CythonFunctionShared) */
3648#define __Pyx_CyFunction_USED
3649#if CYTHON_OPAQUE_SHARED_TYPES
3650#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)PyObject_GetTypeData((o), __pyx_mstate_global->__pyx_CyFunctionType))
3651#else
3652#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)o)
3653#endif
3654#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
3655#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
3656#define __Pyx_CYFUNCTION_CCLASS 0x04
3657#define __Pyx_CYFUNCTION_COROUTINE 0x08
3658#define __Pyx_CyFunction_GetClosure(f)\
3659 ((__Pyx_as_CyFunctionObject(f))->func_closure)
3660#if CYTHON_COMPILING_IN_LIMITED_API
3661 #define __Pyx__CyFunction_GetClassObj(f)\
3662 ((f)->func_classobj)
3663#else
3664 #define __Pyx__CyFunction_GetClassObj(f)\
3665 ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
3666#endif
3667#define __Pyx_CyFunction_GetClassObj(f)\
3668 __Pyx__CyFunction_GetClassObj(__Pyx_as_CyFunctionObject(f))
3669#define __Pyx_CyFunction_SetClassObj(f, classobj)\
3670 __Pyx__CyFunction_SetClassObj(__Pyx_as_CyFunctionObject(f), (classobj))
3671#define __Pyx_CyFunction_Defaults(type, f)\
3672 ((type *)((__Pyx_as_CyFunctionObject(f))->defaults))
3673#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
3674 (__Pyx_as_CyFunctionObject(f))->defaults_getter = (g)
3675typedef struct {
3676#if CYTHON_COMPILING_IN_LIMITED_API
3677#if !CYTHON_OPAQUE_OBJECTS
3678 PyObject_HEAD
3679#endif
3680 PyMethodDef *func_methoddef;
3681 PyObject *func_module;
3682#else
3683 PyCMethodObject func;
3684#endif
3685#if (CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY) && CYTHON_VECTORCALL
3686 __pyx_vectorcallfunc func_vectorcall;
3687#endif
3688#if CYTHON_COMPILING_IN_LIMITED_API
3689 PyObject *func_weakreflist;
3690#endif
3691#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
3692 PyObject *func_dict;
3693#endif
3694 PyObject *func_name;
3695 PyObject *func_qualname;
3696 PyObject *func_doc;
3697 PyObject *func_globals;
3698 PyObject *func_code;
3699 PyObject *func_closure;
3700#if CYTHON_COMPILING_IN_LIMITED_API
3701 PyObject *func_classobj;
3702#endif
3703 PyObject *defaults;
3704 int flags;
3705 PyObject *defaults_tuple;
3706 PyObject *defaults_kwdict;
3707 PyObject *(*defaults_getter)(PyObject *);
3708 PyObject *func_annotations;
3709#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
3710 PyObject *func_is_coroutine;
3711#endif
3712} __pyx_CyFunctionObject;
3713#undef __Pyx_CyOrPyCFunction_Check
3714#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType)
3715#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
3716#define __Pyx_CyFunction_CheckExact(obj) Py_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
3717static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void));
3718#undef __Pyx_IsSameCFunction
3719#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
3720static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
3721static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
3722 PyTypeObject *defaults_type);
3723static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
3724 PyObject *tuple);
3725static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
3726 PyObject *dict);
3727static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
3728 PyObject *dict);
3729static int __pyx_CyFunction_init(PyObject *module);
3730#if CYTHON_VECTORCALL
3731#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
3732#define __Pyx_CyFunction_func_vectorcall(f) ((f)->func_vectorcall)
3733#else
3734#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
3735#endif
3736#endif
3737
3738/* PyMethodNew.proto (used by CythonFunctionShared) */
3739static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);
3740
3741/* PyVectorcallFastCallDict.proto (used by CythonFunctionShared) */
3742#if CYTHON_VECTORCALL
3743static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
3744#endif
3745
3746/* CythonFunctionShared.proto (used by CythonFunction) */
3747static PyObject *__Pyx_CyFunction_Init(PyObject *op_in, PyMethodDef *ml,
3748 int flags, PyObject* qualname,
3749 PyObject *closure,
3750 PyObject *module, PyObject *globals,
3751 PyObject* code);
3752#if CYTHON_VECTORCALL
3753static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3754static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3755static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3756static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
3757#endif
3758
3759/* CythonFunction.export */
3760static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
3761 int flags, PyObject* qualname,
3762 PyObject *closure,
3763 PyObject *module, PyObject *globals,
3764 PyObject* code);
3765static PyTypeObject *__Pyx_Get_CyFunction_Type(void);
3766
3767/* CLineInTraceback.proto (used by AddTraceback) */
3768#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
3769static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
3770#else
3771#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
3772#endif
3773
3774/* CodeObjectCache.proto (used by AddTraceback) */
3775#if CYTHON_COMPILING_IN_LIMITED_API
3776typedef PyObject __Pyx_CachedCodeObjectType;
3777#else
3778typedef PyCodeObject __Pyx_CachedCodeObjectType;
3779#endif
3780typedef struct {
3781 __Pyx_CachedCodeObjectType* code_object;
3782 int code_line;
3783} __Pyx_CodeObjectCacheEntry;
3784struct __Pyx_CodeObjectCache {
3785 int count;
3786 int max_count;
3787 __Pyx_CodeObjectCacheEntry* entries;
3788 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
3789 __pyx_atomic_int_type accessor_count;
3790 #endif
3791};
3792static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
3793static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line);
3794static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object);
3795
3796/* AddTraceback.proto */
3797static void __Pyx_AddTraceback(const char *funcname, int c_line,
3798 int py_line, const char *filename);
3799
3800/* MemviewDtypeToObject.proto */
3801static CYTHON_INLINE PyObject *__pyx_memview_get_int(const char *itemp);
3802static CYTHON_INLINE int __pyx_memview_set_int(char *itemp, PyObject *obj);
3803
3804/* RealImag.proto */
3805#if CYTHON_CCOMPLEX
3806 #ifdef __cplusplus
3807 #define __Pyx_CREAL(z) ((z).real())
3808 #define __Pyx_CIMAG(z) ((z).imag())
3809 #else
3810 #define __Pyx_CREAL(z) (__real__(z))
3811 #define __Pyx_CIMAG(z) (__imag__(z))
3812 #endif
3813#else
3814 #define __Pyx_CREAL(z) ((z).real)
3815 #define __Pyx_CIMAG(z) ((z).imag)
3816#endif
3817#if defined(__cplusplus) && CYTHON_CCOMPLEX\
3818 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
3819 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
3820 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
3821#else
3822 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
3823 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
3824#endif
3825
3826/* Arithmetic.proto */
3827#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3828 #define __Pyx_c_eq_float(a, b) ((a)==(b))
3829 #define __Pyx_c_sum_float(a, b) ((a)+(b))
3830 #define __Pyx_c_diff_float(a, b) ((a)-(b))
3831 #define __Pyx_c_prod_float(a, b) ((a)*(b))
3832 #define __Pyx_c_quot_float(a, b) ((a)/(b))
3833 #define __Pyx_c_neg_float(a) (-(a))
3834 #ifdef __cplusplus
3835 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
3836 #define __Pyx_c_conj_float(z) (::std::conj(z))
3837 #if 1
3838 #define __Pyx_c_abs_float(z) (::std::abs(z))
3839 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
3840 #endif
3841 #else
3842 #define __Pyx_c_is_zero_float(z) ((z)==0)
3843 #define __Pyx_c_conj_float(z) (conjf(z))
3844 #if 1
3845 #define __Pyx_c_abs_float(z) (cabsf(z))
3846 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
3847 #endif
3848 #endif
3849#else
3850 static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
3851 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
3852 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
3853 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
3854 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
3855 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
3856 static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
3857 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
3858 #if 1
3859 static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
3860 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
3861 #endif
3862#endif
3863
3864/* Arithmetic.proto */
3865#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3866 #define __Pyx_c_eq_double(a, b) ((a)==(b))
3867 #define __Pyx_c_sum_double(a, b) ((a)+(b))
3868 #define __Pyx_c_diff_double(a, b) ((a)-(b))
3869 #define __Pyx_c_prod_double(a, b) ((a)*(b))
3870 #define __Pyx_c_quot_double(a, b) ((a)/(b))
3871 #define __Pyx_c_neg_double(a) (-(a))
3872 #ifdef __cplusplus
3873 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
3874 #define __Pyx_c_conj_double(z) (::std::conj(z))
3875 #if 1
3876 #define __Pyx_c_abs_double(z) (::std::abs(z))
3877 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
3878 #endif
3879 #else
3880 #define __Pyx_c_is_zero_double(z) ((z)==0)
3881 #define __Pyx_c_conj_double(z) (conj(z))
3882 #if 1
3883 #define __Pyx_c_abs_double(z) (cabs(z))
3884 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
3885 #endif
3886 #endif
3887#else
3888 static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
3889 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
3890 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
3891 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
3892 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
3893 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
3894 static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
3895 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
3896 #if 1
3897 static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
3898 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
3899 #endif
3900#endif
3901
3902/* Arithmetic.proto */
3903#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3904 #define __Pyx_c_eq_long__double(a, b) ((a)==(b))
3905 #define __Pyx_c_sum_long__double(a, b) ((a)+(b))
3906 #define __Pyx_c_diff_long__double(a, b) ((a)-(b))
3907 #define __Pyx_c_prod_long__double(a, b) ((a)*(b))
3908 #define __Pyx_c_quot_long__double(a, b) ((a)/(b))
3909 #define __Pyx_c_neg_long__double(a) (-(a))
3910 #ifdef __cplusplus
3911 #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
3912 #define __Pyx_c_conj_long__double(z) (::std::conj(z))
3913 #if 1
3914 #define __Pyx_c_abs_long__double(z) (::std::abs(z))
3915 #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b))
3916 #endif
3917 #else
3918 #define __Pyx_c_is_zero_long__double(z) ((z)==0)
3919 #define __Pyx_c_conj_long__double(z) (conjl(z))
3920 #if 1
3921 #define __Pyx_c_abs_long__double(z) (cabsl(z))
3922 #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b))
3923 #endif
3924 #endif
3925#else
3926 static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3927 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3928 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3929 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3930 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3931 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
3932 static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
3933 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
3934 #if 1
3935 static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
3936 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3937 #endif
3938#endif
3939
3940/* BufferStructDeclare.proto */
3941typedef struct {
3942 Py_ssize_t shape, strides, suboffsets;
3943} __Pyx_Buf_DimInfo;
3944typedef struct {
3945 size_t refcount;
3946 Py_buffer pybuffer;
3947} __Pyx_Buffer;
3948typedef struct {
3949 __Pyx_Buffer *rcbuffer;
3950 char *data;
3951 __Pyx_Buf_DimInfo diminfo[8];
3952} __Pyx_LocalBuf_ND;
3953
3954/* MemviewRefcount.proto */
3955static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
3956 __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3957static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
3958 __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3959#define __pyx_get_slice_count_pointer(memview) (&memview->acquisition_count)
3960#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
3961#define __PYX_XCLEAR_MEMVIEW(slice, have_gil) __Pyx_XCLEAR_MEMVIEW(slice, have_gil, __LINE__)
3962static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
3963static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *, int, int);
3964
3965/* MemviewSliceIsContig.proto */
3966static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
3967
3968/* OverlappingSlices.proto */
3969static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
3970 __Pyx_memviewslice *slice2,
3971 int ndim, size_t itemsize);
3972
3973/* MemviewSliceInit.proto */
3974static int __Pyx_init_memviewslice(
3975 struct __pyx_memoryview_obj *memview,
3976 int ndim,
3977 __Pyx_memviewslice *memviewslice,
3978 int memview_is_new_reference);
3979
3980/* SliceMemoryviewSlice.proto */
3981static CYTHON_INLINE int __pyx_memoryview_slice_memviewslice(
3982 __Pyx_memviewslice *dst,
3983 Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
3984 int dim, int new_ndim, int *suboffset_dim,
3985 Py_ssize_t start, Py_ssize_t stop, Py_ssize_t step,
3986 int have_start, int have_stop, int have_step,
3987 int is_slice);
3988
3989/* CIntFromPy.proto */
3990static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *);
3991
3992/* PyObjectVectorcallKwds.proto (used by PyObjectVectorcallMethodKwds) */
3993#if CYTHON_VECTORCALL
3994#define __Pyx_Object_VectorcallKwds PyObject_Vectorcall
3995CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i);
3996#else
3997#define __Pyx_Object_VectorcallKwds __Pyx_PyObject_FastCallDict
3998CYTHON_UNUSED static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t n);
3999CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i);
4000#endif
4001
4002/* PyObjectVectorcallMethodKwds.proto (used by CIntToPy) */
4003#if CYTHON_VECTORCALL
4004#define __Pyx_Object_VectorcallMethodKwds PyObject_VectorcallMethod
4005#else
4006static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames);
4007#endif
4008
4009/* CIntToPy.proto */
4010static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value);
4011
4012/* TypeInfoToFormat.proto */
4013struct __pyx_typeinfo_string {
4014 char string[3];
4015};
4016static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(const __Pyx_TypeInfo *type);
4017
4018/* MemviewSliceCopy.proto */
4019static __Pyx_memviewslice
4020__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
4021 const char *mode, int ndim,
4022 Py_ssize_t sizeof_dtype, int contig_flag,
4023 int dtype_is_object);
4024
4025/* UpdateUnpickledDict.export */
4026static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index);
4027
4028/* CheckUnpickleChecksumError.export */
4029static void __Pyx_RaiseUnpickleChecksumError(long checksum, long checksum1, long checksum2, long checksum3, const char *members);
4030
4031/* CheckUnpickleChecksum.proto */
4032static CYTHON_INLINE int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members);
4033
4034/* CIntFromPy.proto */
4035static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *);
4036
4037/* CIntToPy.proto */
4038static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value);
4039
4040/* CIntFromPy.proto */
4041static CYTHON_INLINE char __Pyx_PyLong_As_char(PyObject *);
4042
4043/* GetRuntimeVersion.proto */
4044#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
4045static unsigned long __Pyx_cached_runtime_version = 0;
4046static void __Pyx_init_runtime_version(void);
4047#else
4048#define __Pyx_init_runtime_version()
4049#endif
4050static unsigned long __Pyx_get_runtime_version(void);
4051
4052/* CheckBinaryVersion.proto */
4053static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
4054
4055/* DecompressString.proto */
4056static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo);
4057
4058/* DecompressString_LZSS.proto */
4059static PyObject *__Pyx_DecompressString_LZSS(const char *s, size_t compressed_length, size_t uncompressed_length);
4060
4061/* MultiPhaseInitModuleState.proto */
4062#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
4063#include <stdlib.h>
4064static PyObject *__Pyx_State_FindModule(void*);
4065static int __Pyx_State_AddModule(PyObject* module, void*);
4066static int __Pyx_State_RemoveModule(void*);
4067#elif CYTHON_USE_MODULE_STATE
4068#define __Pyx_State_FindModule PyState_FindModule
4069#define __Pyx_State_AddModule PyState_AddModule
4070#define __Pyx_State_RemoveModule PyState_RemoveModule
4071#endif
4072
4073/* #### Code section: module_declarations ### */
4074/* CythonABIVersion.proto */
4075#if CYTHON_COMPILING_IN_LIMITED_API
4076 #if CYTHON_VECTORCALL
4077 #define __PYX_VECTORCALL_ABI_SUFFIX "_vectorcall"
4078 #else
4079 #define __PYX_VECTORCALL_ABI_SUFFIX
4080 #endif
4081 #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_VECTORCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
4082#else
4083 #define __PYX_LIMITED_ABI_SUFFIX
4084#endif
4085#if __PYX_HAS_PY_AM_SEND == 1
4086 #define __PYX_AM_SEND_ABI_SUFFIX
4087#elif __PYX_HAS_PY_AM_SEND == 2
4088 #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
4089#else
4090 #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
4091#endif
4092#ifndef __PYX_MONITORING_ABI_SUFFIX
4093 #define __PYX_MONITORING_ABI_SUFFIX
4094#endif
4095#if CYTHON_USE_TP_FINALIZE
4096 #define __PYX_TP_FINALIZE_ABI_SUFFIX
4097#else
4098 #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
4099#endif
4100#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
4101 #define __PYX_FREELISTS_ABI_SUFFIX
4102#else
4103 #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
4104#endif
4105#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
4106 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX "opaque"
4107#else
4108 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
4109#endif
4110#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
4111#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
4112#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
4113
4114static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
4115static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
4116static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
4117static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
4118static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
4119static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_value); /* proto*/
4120static PyObject *__pyx_memoryview_setitem_indexed1(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
4121static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
4122static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
4123static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self); /* proto*/
4124static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
4125static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
4126static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto*/
4127static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self); /* proto*/
4128static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self); /* proto*/
4129static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self); /* proto*/
4130static CYTHON_INLINE char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self); /* proto*/
4131static CYTHON_INLINE int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self); /* proto*/
4132static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self); /* proto*/
4133static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self); /* proto*/
4134static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self); /* proto*/
4135static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self); /* proto*/
4136static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self); /* proto*/
4137static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self); /* proto*/
4138static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
4139static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
4140static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
4141static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
4142static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
4143static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
4144static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self); /* proto*/
4145static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self); /* proto*/
4146static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self); /* proto*/
4147static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self); /* proto*/
4148static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self); /* proto*/
4149static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self); /* proto*/
4150static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self); /* proto*/
4151static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self); /* proto*/
4152static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self); /* proto*/
4153static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self); /* proto*/
4154static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self); /* proto*/
4155static CYTHON_INLINE void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self); /* proto*/
4156static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self); /* proto*/
4157static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self); /* proto*/
4158static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self); /* proto*/
4159static CYTHON_INLINE void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self); /* proto*/
4160static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self); /* proto*/
4161static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self); /* proto*/
4162
4163/* Module declarations from "libc.string" */
4164
4165/* Module declarations from "libc.stdio" */
4166
4167/* Module declarations from "__builtin__" */
4168
4169/* Module declarations from "cpython.type" */
4170
4171/* Module declarations from "cpython" */
4172
4173/* Module declarations from "cpython.object" */
4174
4175/* Module declarations from "cpython.ref" */
4176
4177/* Module declarations from "numpy" */
4178
4179/* Module declarations from "numpy" */
4180
4181/* Module declarations from "mpi4py.libmpi" */
4182
4183/* Module declarations from "mpi4py.MPI" */
4184
4185/* Module declarations from "libcpp" */
4186
4187/* Module declarations from "mesh" */
4188
4189/* Module declarations from "proteus" */
4190
4191/* Module declarations from "proteus.cmeshTools" */
4192
4193/* Module declarations from "proteus.partitioning" */
4194
4195/* Module declarations from "cpartitioning" */
4196static PyObject *__pyx_collections_abc_Sequence = 0;
4197static PyObject *generic = 0;
4198static PyObject *strided = 0;
4199static PyObject *indirect = 0;
4200static PyObject *contiguous = 0;
4201static PyObject *indirect_contiguous = 0;
4202static int __pyx_memoryview_thread_locks_used;
4203static PyThread_type_lock __pyx_memoryview_thread_locks[8];
4204static int __pyx_array_allocate_buffer(struct __pyx_array_obj *); /*proto*/
4205static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char const *, char *); /*proto*/
4206static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo const *); /*proto*/
4207static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
4208static int __pyx_memoryview_err_invalid_index(PyObject *); /*proto*/
4209static PyObject *_unellipsify_index_tuple(PyObject *, int); /*proto*/
4210static PyObject *_unellipsify(PyObject *, int); /*proto*/
4211static int assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
4212static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
4213static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
4214static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
4215static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), __pyx_memoryview_to_dtype_func_type, int); /*proto*/
4216static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
4217static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
4218static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
4219static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
4220static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
4221static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
4222static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
4223static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
4224static size_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
4225static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
4226static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
4227static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
4228static int __pyx_memoryview_err_dim(PyObject *, char const *, int); /*proto*/
4229static int __pyx_memoryview_err(PyObject *, char const *); /*proto*/
4230static int __pyx_memoryview_err_no_memory(void); /*proto*/
4231static int __pyx_memoryview_err_ValueError(char const *); /*proto*/
4232static int __pyx_memoryview_err_IndexError(char const *, Py_ssize_t); /*proto*/
4233static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
4234static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
4235static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
4236static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
4237static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
4238static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
4239static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
4240static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
4241static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo const *); /*proto*/
4242/* #### Code section: typeinfo ### */
4243static const __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, __PYX_IS_UNSIGNED(int) ? 'U' : 'I', __PYX_IS_UNSIGNED(int), 0 };
4244/* #### Code section: before_global_var ### */
4245#define __Pyx_MODULE_NAME "cpartitioning"
4246extern int __pyx_module_is_main_cpartitioning;
4247int __pyx_module_is_main_cpartitioning = 0;
4248
4249/* Implementation of "cpartitioning" */
4250/* #### Code section: global_var ### */
4251static PyObject *__pyx_builtin___import__;
4252static PyObject *__pyx_builtin_enumerate;
4253static PyObject *__pyx_builtin_Ellipsis;
4254static PyObject *__pyx_builtin_id;
4255/* #### Code section: string_decls ### */
4256static const char __pyx_k_c[] = "c";
4257static const char __pyx_k_name[] = "name";
4258static const char __pyx_k_fortran[] = "fortran";
4259static const char __pyx_k_Dimension_d_is_not_direct[] = "Dimension %d is not direct";
4260static const char __pyx_k_Cannot_index_with_type_200U[] = "Cannot index with type \047%.200U\047";
4261static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
4262static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
4263static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
4264static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
4265static const char __pyx_k_Cannot_transpose_memoryview_with[] = "Cannot transpose memoryview with indirect dimensions";
4266static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
4267static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
4268static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %zd)";
4269static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
4270static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %zd and %zd)";
4271/* #### Code section: decls ### */
4272static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
4273static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
4274static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
4275static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
4276static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
4277static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
4278static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
4279static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
4280static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
4281static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4282static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
4283static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
4284static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
4285static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
4286static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
4287static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4288static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
4289static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
4290static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
4291static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4292static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4293static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4294static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4295static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4296static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4297static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4298static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4299static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4300static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4301static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4302static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4303static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4304static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4305static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4306static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4307static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
4308static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4309static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
4310static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
4311static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4312static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
4313static PyObject *__pyx_pf_13cpartitioning_partitionElements(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh); /* proto */
4314static PyObject *__pyx_pf_13cpartitioning_2partitionNodes(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh); /* proto */
4315static PyObject *__pyx_pf_13cpartitioning_4convertPUMIPartitionToPython(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED struct PyMPICommObject *__pyx_v_comm, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh); /* proto */
4316static PyObject *__pyx_pf_13cpartitioning_6partitionNodesFromTetgenFiles(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, PyObject *__pyx_v_filebase, int __pyx_v_indexBase, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, double __pyx_v_memHardLimit); /* proto */
4317static PyObject *__pyx_pf_13cpartitioning_8partitionNodesFromTriangleFiles(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, PyObject *__pyx_v_filebase, int __pyx_v_indexBase, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh); /* proto */
4318static PyObject *__pyx_pf_13cpartitioning_10buildQuadraticLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nSpace, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes); /* proto */
4319static PyObject *__pyx_pf_13cpartitioning_12buildQuadraticCubeLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nSpace, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, CYTHON_UNUSED PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes); /* proto */
4320static PyObject *__pyx_pf_13cpartitioning_14buildDiscontinuousGalerkinLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nDOF_element, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_dg_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_dg_subdomain_l2g, PyArrayObject *__pyx_v_dgNumbering_subdomain2global); /* proto */
4321static PyObject *__pyx_tp_new__initialisation_array(PyObject *o,
4322#if CYTHON_VECTORCALL_TPNEW
4323 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4324#else
4325 PyObject *a, PyObject *k
4326#endif
4327); /*proto*/
4328static PyObject *__pyx_tp_new_vectorcall_array(PyTypeObject *t,
4329#if CYTHON_VECTORCALL_TPNEW
4330 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4331#else
4332 PyObject *a, PyObject *k
4333#endif
4334); /*proto*/
4335#if CYTHON_VECTORCALL_TPNEW
4336static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4337#endif
4338#if !CYTHON_VECTORCALL_TPNEW
4339#define __pyx_tp_new_array __pyx_tp_new_vectorcall_array
4340#endif
4341#if CYTHON_VECTORCALL_TPNEW
4342static PyObject *__pyx_tp_vectorcall_array(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
4343#endif
4344static PyObject *__pyx_tp_new__initialisation_Enum(PyObject *o,
4345#if CYTHON_VECTORCALL_TPNEW
4346 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4347#else
4348 PyObject *a, PyObject *k
4349#endif
4350); /*proto*/
4351static PyObject *__pyx_tp_new_vectorcall_Enum(PyTypeObject *t,
4352#if CYTHON_VECTORCALL_TPNEW
4353 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4354#else
4355 PyObject *a, PyObject *k
4356#endif
4357); /*proto*/
4358#if CYTHON_VECTORCALL_TPNEW
4359static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4360#endif
4361#if !CYTHON_VECTORCALL_TPNEW
4362#define __pyx_tp_new_Enum __pyx_tp_new_vectorcall_Enum
4363#endif
4364#if CYTHON_VECTORCALL_TPNEW
4365static PyObject *__pyx_tp_vectorcall_Enum(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
4366#endif
4367#if CYTHON_VECTORCALL_TPNEW
4368static int __pyx_tp_init_Enum(PyObject *o, PyObject *args, PyObject *kwds); /*proto*/
4369#endif
4370#if !CYTHON_VECTORCALL_TPNEW
4371#define __pyx_tp_init_Enum __pyx_MemviewEnum___init__
4372#endif
4373static PyObject *__pyx_tp_new__initialisation_memoryview(PyObject *o,
4374#if CYTHON_VECTORCALL_TPNEW
4375 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4376#else
4377 PyObject *a, PyObject *k
4378#endif
4379); /*proto*/
4380static PyObject *__pyx_tp_new_vectorcall_memoryview(PyTypeObject *t,
4381#if CYTHON_VECTORCALL_TPNEW
4382 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4383#else
4384 PyObject *a, PyObject *k
4385#endif
4386); /*proto*/
4387#if CYTHON_VECTORCALL_TPNEW
4388static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4389#endif
4390#if !CYTHON_VECTORCALL_TPNEW
4391#define __pyx_tp_new_memoryview __pyx_tp_new_vectorcall_memoryview
4392#endif
4393#if CYTHON_VECTORCALL_TPNEW
4394static PyObject *__pyx_tp_vectorcall_memoryview(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
4395#endif
4396static PyObject *__pyx_tp_new__initialisation__memoryviewslice(PyObject *o,
4397#if CYTHON_VECTORCALL_TPNEW
4398 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4399#else
4400 PyObject *a, PyObject *k
4401#endif
4402); /*proto*/
4403static PyObject *__pyx_tp_new_vectorcall__memoryviewslice(PyTypeObject *t,
4404#if CYTHON_VECTORCALL_TPNEW
4405 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4406#else
4407 PyObject *a, PyObject *k
4408#endif
4409); /*proto*/
4410#if CYTHON_VECTORCALL_TPNEW
4411static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4412#endif
4413#if !CYTHON_VECTORCALL_TPNEW
4414#define __pyx_tp_new__memoryviewslice __pyx_tp_new_vectorcall__memoryviewslice
4415#endif
4416#if CYTHON_VECTORCALL_TPNEW
4417static PyObject *__pyx_tp_vectorcall__memoryviewslice(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
4418#endif
4419/* #### Code section: late_includes ### */
4420/* #### Code section: module_state ### */
4421/* SmallCodeConfig */
4422#ifndef CYTHON_SMALL_CODE
4423#if defined(__clang__)
4424 #define CYTHON_SMALL_CODE
4425#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
4426 #define CYTHON_SMALL_CODE __attribute__((cold))
4427#else
4428 #define CYTHON_SMALL_CODE
4429#endif
4430#endif
4431
4432#ifdef __cplusplus
4433namespace {
4434 #endif
4435 typedef struct {
4436 PyObject *__pyx_d;
4437 PyObject *__pyx_b;
4438 PyObject *__pyx_cython_runtime;
4439 PyObject *__pyx_empty_tuple;
4440 PyObject *__pyx_empty_bytes;
4441 PyObject *__pyx_empty_unicode;
4442 PyTypeObject *__pyx_ptype_7cpython_4type_type;
4443 PyTypeObject *__pyx_ptype_5numpy_dtype;
4444 PyTypeObject *__pyx_ptype_5numpy_flatiter;
4445 PyTypeObject *__pyx_ptype_5numpy_broadcast;
4446 PyTypeObject *__pyx_ptype_5numpy_ndarray;
4447 PyTypeObject *__pyx_ptype_5numpy_generic;
4448 PyTypeObject *__pyx_ptype_5numpy_number;
4449 PyTypeObject *__pyx_ptype_5numpy_integer;
4450 PyTypeObject *__pyx_ptype_5numpy_signedinteger;
4451 PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
4452 PyTypeObject *__pyx_ptype_5numpy_inexact;
4453 PyTypeObject *__pyx_ptype_5numpy_floating;
4454 PyTypeObject *__pyx_ptype_5numpy_complexfloating;
4455 PyTypeObject *__pyx_ptype_5numpy_flexible;
4456 PyTypeObject *__pyx_ptype_5numpy_character;
4457 PyTypeObject *__pyx_ptype_5numpy_ufunc;
4458 PyObject *PyMPIDatatype_Type;
4459 PyObject *PyMPIStatus_Type;
4460 PyObject *PyMPIRequest_Type;
4461 PyObject *PyMPIPrequest_Type;
4462 PyObject *PyMPIGrequest_Type;
4463 PyObject *PyMPIMessage_Type;
4464 PyObject *PyMPIOp_Type;
4465 PyObject *PyMPIGroup_Type;
4466 PyObject *PyMPIInfo_Type;
4467 PyObject *PyMPIErrhandler_Type;
4468 PyObject *PyMPISession_Type;
4469 PyObject *PyMPIComm_Type;
4470 PyObject *PyMPIIntracomm_Type;
4471 PyObject *PyMPITopocomm_Type;
4472 PyObject *PyMPICartcomm_Type;
4473 PyObject *PyMPIGraphcomm_Type;
4474 PyObject *PyMPIDistgraphcomm_Type;
4475 PyObject *PyMPIIntercomm_Type;
4476 PyObject *PyMPIWin_Type;
4477 PyObject *PyMPIFile_Type;
4478 PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Datatype;
4479 PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Status;
4480 PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Request;
4481 PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Prequest;
4482 PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Grequest;
4483 PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Message;
4484 PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Op;
4485 PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Group;
4486 PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Info;
4487 PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Errhandler;
4488 PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Session;
4489 PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Comm;
4490 PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Intracomm;
4491 PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Topocomm;
4492 PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Cartcomm;
4493 PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Graphcomm;
4494 PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Distgraphcomm;
4495 PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Intercomm;
4496 PyTypeObject *__pyx_ptype_6mpi4py_3MPI_Win;
4497 PyTypeObject *__pyx_ptype_6mpi4py_3MPI_File;
4498 PyTypeObject *__pyx_ptype_7proteus_10cmeshTools_CMesh;
4499 PyObject *__pyx_type___pyx_array;
4500 PyObject *__pyx_type___pyx_MemviewEnum;
4501 PyObject *__pyx_type___pyx_memoryview;
4502 PyObject *__pyx_type___pyx_memoryviewslice;
4503 PyTypeObject *__pyx_array_type;
4504 PyTypeObject *__pyx_MemviewEnum_type;
4505 PyTypeObject *__pyx_memoryview_type;
4506 PyTypeObject *__pyx_memoryviewslice_type;
4507 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
4508 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
4509 __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
4510 PyObject *__pyx_slice[1];
4511 PyObject *__pyx_tuple[2];
4512 PyObject *__pyx_codeobj_tab[8];
4513 PyObject *__pyx_string_tab[157];
4514 PyObject *__pyx_number_tab[4];
4515/* #### Code section: module_state_contents ### */
4516/* PyFrozenDict.module_state_decls */
4517#if CYTHON_COMPILING_IN_LIMITED_API
4518PyObject *__Pyx_PyFrozenDictType;
4519#endif
4520
4521/* CommonTypesMetaclass.module_state_decls */
4522PyTypeObject *__pyx_CommonTypesMetaclassType;
4523
4524/* CachedMethodType.module_state_decls */
4525#if CYTHON_COMPILING_IN_LIMITED_API
4526PyObject *__Pyx_CachedMethodType;
4527#endif
4528
4529/* CythonFunctionPerModule.module_state_decls */
4530PyTypeObject *__pyx_CyFunctionType;
4531
4532/* CodeObjectCache.module_state_decls */
4533struct __Pyx_CodeObjectCache __pyx_code_cache;
4534
4535/* #### Code section: module_state_end ### */
4536} __pyx_mstatetype;
4537#ifdef __cplusplus
4538} /* anonymous namespace */
4539#endif
4540
4541#if CYTHON_USE_MODULE_STATE
4542#ifdef __cplusplus
4543namespace {
4544extern struct PyModuleDef __pyx_moduledef;
4545} /* anonymous namespace */
4546#else
4547static struct PyModuleDef __pyx_moduledef;
4548#endif
4549
4550#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))
4551
4552#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
4553#else
4554static __pyx_mstatetype __pyx_mstate_global_static =
4555#ifdef __cplusplus
4556 {};
4557#else
4558 {0};
4559#endif
4560static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static;
4561#endif
4562/* #### Code section: constant_name_defines ### */
4563#define __pyx_kp_u_at_0x __pyx_string_tab[0]
4564#define __pyx_kp_u_object __pyx_string_tab[1]
4565#define __pyx_kp_u__9 __pyx_string_tab[2]
4566#define __pyx_kp_u__11 __pyx_string_tab[3]
4567#define __pyx_kp_u__10 __pyx_string_tab[4]
4568#define __pyx_kp_u__3 __pyx_string_tab[5]
4569#define __pyx_kp_u__2 __pyx_string_tab[6]
4570#define __pyx_kp_u_MemoryView_of __pyx_string_tab[7]
4571#define __pyx_kp_u_contiguous_and_direct __pyx_string_tab[8]
4572#define __pyx_kp_u_contiguous_and_indirect __pyx_string_tab[9]
4573#define __pyx_kp_u_strided_and_direct_or_indirect __pyx_string_tab[10]
4574#define __pyx_kp_u_strided_and_direct __pyx_string_tab[11]
4575#define __pyx_kp_u_strided_and_indirect __pyx_string_tab[12]
4576#define __pyx_kp_u__4 __pyx_string_tab[13]
4577#define __pyx_kp_u_ __pyx_string_tab[14]
4578#define __pyx_kp_u_Cannot_assign_to_read_only_memor __pyx_string_tab[15]
4579#define __pyx_kp_u_Invalid_mode_expected_c_or_fortr __pyx_string_tab[16]
4580#define __pyx_kp_u_Invalid_shape_in_axis __pyx_string_tab[17]
4581#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[18]
4582#define __pyx_kp_u_add_note __pyx_string_tab[19]
4583#define __pyx_kp_u_buildQuadraticCubeSubdomain2Glob __pyx_string_tab[20]
4584#define __pyx_kp_u_buildQuadraticCubeSubdomain2Glob_2 __pyx_string_tab[21]
4585#define __pyx_kp_u_collections_abc __pyx_string_tab[22]
4586#define __pyx_kp_u_disable __pyx_string_tab[23]
4587#define __pyx_kp_u_enable __pyx_string_tab[24]
4588#define __pyx_kp_u_gc __pyx_string_tab[25]
4589#define __pyx_kp_u_isenabled __pyx_string_tab[26]
4590#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[27]
4591#define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_string_tab[28]
4592#define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_string_tab[29]
4593#define __pyx_kp_u_proteus_cpartitioning_pyx __pyx_string_tab[30]
4594#define __pyx_kp_u_unable_to_allocate_array_data __pyx_string_tab[31]
4595#define __pyx_kp_u_unable_to_allocate_shape_and_str __pyx_string_tab[32]
4596#define __pyx_n_u_ASCII __pyx_string_tab[33]
4597#define __pyx_n_u_Comm __pyx_string_tab[34]
4598#define __pyx_n_u_Ellipsis __pyx_string_tab[35]
4599#define __pyx_n_u_Sequence __pyx_string_tab[36]
4600#define __pyx_n_u_View_MemoryView __pyx_string_tab[37]
4601#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[38]
4602#define __pyx_n_u_annotate __pyx_string_tab[39]
4603#define __pyx_n_u_class __pyx_string_tab[40]
4604#define __pyx_n_u_class_getitem __pyx_string_tab[41]
4605#define __pyx_n_u_dict __pyx_string_tab[42]
4606#define __pyx_n_u_func __pyx_string_tab[43]
4607#define __pyx_n_u_getstate __pyx_string_tab[44]
4608#define __pyx_n_u_import __pyx_string_tab[45]
4609#define __pyx_n_u_main __pyx_string_tab[46]
4610#define __pyx_n_u_module __pyx_string_tab[47]
4611#define __pyx_n_u_name_2 __pyx_string_tab[48]
4612#define __pyx_n_u_new __pyx_string_tab[49]
4613#define __pyx_n_u_pyx_checksum __pyx_string_tab[50]
4614#define __pyx_n_u_pyx_state __pyx_string_tab[51]
4615#define __pyx_n_u_pyx_type __pyx_string_tab[52]
4616#define __pyx_n_u_pyx_unpickle_Enum __pyx_string_tab[53]
4617#define __pyx_n_u_pyx_vtable __pyx_string_tab[54]
4618#define __pyx_n_u_qualname __pyx_string_tab[55]
4619#define __pyx_n_u_reduce __pyx_string_tab[56]
4620#define __pyx_n_u_reduce_cython __pyx_string_tab[57]
4621#define __pyx_n_u_reduce_ex __pyx_string_tab[58]
4622#define __pyx_n_u_set_name __pyx_string_tab[59]
4623#define __pyx_n_u_setstate __pyx_string_tab[60]
4624#define __pyx_n_u_setstate_cython __pyx_string_tab[61]
4625#define __pyx_n_u_test __pyx_string_tab[62]
4626#define __pyx_n_u_is_coroutine __pyx_string_tab[63]
4627#define __pyx_n_u_abc __pyx_string_tab[64]
4628#define __pyx_n_u_allocate_buffer __pyx_string_tab[65]
4629#define __pyx_n_u_asarray __pyx_string_tab[66]
4630#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[67]
4631#define __pyx_n_u_base __pyx_string_tab[68]
4632#define __pyx_n_u_buildDiscontinuousGalerkinLocal2 __pyx_string_tab[69]
4633#define __pyx_n_u_buildQuadraticCubeLocal2GlobalMa __pyx_string_tab[70]
4634#define __pyx_n_u_buildQuadraticLocal2GlobalMappin __pyx_string_tab[71]
4635#define __pyx_n_u_c __pyx_string_tab[72]
4636#define __pyx_n_u_cline_in_traceback __pyx_string_tab[73]
4637#define __pyx_n_u_cmesh __pyx_string_tab[74]
4638#define __pyx_n_u_comm __pyx_string_tab[75]
4639#define __pyx_n_u_convertPUMIPartitionToPython __pyx_string_tab[76]
4640#define __pyx_n_u_count __pyx_string_tab[77]
4641#define __pyx_n_u_cpartitioning __pyx_string_tab[78]
4642#define __pyx_n_u_dgNumbering_subdomain2global __pyx_string_tab[79]
4643#define __pyx_n_u_dg_dof_offsets_subdomain_owned __pyx_string_tab[80]
4644#define __pyx_n_u_dg_subdomain_l2g __pyx_string_tab[81]
4645#define __pyx_n_u_dtype_is_object __pyx_string_tab[82]
4646#define __pyx_n_u_edgeNumbering_subdomain2global __pyx_string_tab[83]
4647#define __pyx_n_u_edgeOffsets_subdomain_owned __pyx_string_tab[84]
4648#define __pyx_n_u_elementBoundaryNumbering_subdoma __pyx_string_tab[85]
4649#define __pyx_n_u_elementBoundaryOffsets_subdomain __pyx_string_tab[86]
4650#define __pyx_n_u_elementNumbering_subdomain2globa __pyx_string_tab[87]
4651#define __pyx_n_u_elementOffsets_subdomain_owned __pyx_string_tab[88]
4652#define __pyx_n_u_encode __pyx_string_tab[89]
4653#define __pyx_n_u_enumerate __pyx_string_tab[90]
4654#define __pyx_n_u_error __pyx_string_tab[91]
4655#define __pyx_n_u_filebase __pyx_string_tab[92]
4656#define __pyx_n_u_flags __pyx_string_tab[93]
4657#define __pyx_n_u_format __pyx_string_tab[94]
4658#define __pyx_n_u_fortran __pyx_string_tab[95]
4659#define __pyx_n_u_id __pyx_string_tab[96]
4660#define __pyx_n_u_index __pyx_string_tab[97]
4661#define __pyx_n_u_indexBase __pyx_string_tab[98]
4662#define __pyx_n_u_items __pyx_string_tab[99]
4663#define __pyx_n_u_itemsize __pyx_string_tab[100]
4664#define __pyx_n_u_join __pyx_string_tab[101]
4665#define __pyx_n_u_max_dof_neighbors __pyx_string_tab[102]
4666#define __pyx_n_u_memHardLimit __pyx_string_tab[103]
4667#define __pyx_n_u_memview __pyx_string_tab[104]
4668#define __pyx_n_u_mode __pyx_string_tab[105]
4669#define __pyx_n_u_nDOF_all_processes __pyx_string_tab[106]
4670#define __pyx_n_u_nDOF_element __pyx_string_tab[107]
4671#define __pyx_n_u_nDOF_subdomain __pyx_string_tab[108]
4672#define __pyx_n_u_nLayersOfOverlap __pyx_string_tab[109]
4673#define __pyx_n_u_nSpace __pyx_string_tab[110]
4674#define __pyx_n_u_name __pyx_string_tab[111]
4675#define __pyx_n_u_ndim __pyx_string_tab[112]
4676#define __pyx_n_u_nodeNumbering_subdomain2global __pyx_string_tab[113]
4677#define __pyx_n_u_nodeOffsets_subdomain_owned __pyx_string_tab[114]
4678#define __pyx_n_u_np __pyx_string_tab[115]
4679#define __pyx_n_u_numpy __pyx_string_tab[116]
4680#define __pyx_n_u_obj __pyx_string_tab[117]
4681#define __pyx_n_u_pack __pyx_string_tab[118]
4682#define __pyx_n_u_partitionElements __pyx_string_tab[119]
4683#define __pyx_n_u_partitionNodes __pyx_string_tab[120]
4684#define __pyx_n_u_partitionNodesFromTetgenFiles __pyx_string_tab[121]
4685#define __pyx_n_u_partitionNodesFromTriangleFiles __pyx_string_tab[122]
4686#define __pyx_n_u_pop __pyx_string_tab[123]
4687#define __pyx_n_u_proteus __pyx_string_tab[124]
4688#define __pyx_n_u_proteus_Comm __pyx_string_tab[125]
4689#define __pyx_n_u_quadraticNumbering_subdomain2glo __pyx_string_tab[126]
4690#define __pyx_n_u_quadratic_dof_offsets_subdomain __pyx_string_tab[127]
4691#define __pyx_n_u_quadratic_lagrangeNodes __pyx_string_tab[128]
4692#define __pyx_n_u_quadratic_subdomain_l2g __pyx_string_tab[129]
4693#define __pyx_n_u_register __pyx_string_tab[130]
4694#define __pyx_n_u_setdefault __pyx_string_tab[131]
4695#define __pyx_n_u_shape __pyx_string_tab[132]
4696#define __pyx_n_u_size __pyx_string_tab[133]
4697#define __pyx_n_u_start __pyx_string_tab[134]
4698#define __pyx_n_u_step __pyx_string_tab[135]
4699#define __pyx_n_u_stop __pyx_string_tab[136]
4700#define __pyx_n_u_struct __pyx_string_tab[137]
4701#define __pyx_n_u_subdomain_cmesh __pyx_string_tab[138]
4702#define __pyx_n_u_unpack __pyx_string_tab[139]
4703#define __pyx_n_u_update __pyx_string_tab[140]
4704#define __pyx_n_u_values __pyx_string_tab[141]
4705#define __pyx_n_u_x __pyx_string_tab[142]
4706#define __pyx_kp_b__6 __pyx_string_tab[143]
4707#define __pyx_kp_b__7 __pyx_string_tab[144]
4708#define __pyx_n_b_O __pyx_string_tab[145]
4709#define __pyx_kp_b_T __pyx_string_tab[146]
4710#define __pyx_kp_b__5 __pyx_string_tab[147]
4711#define __pyx_kp_b__8 __pyx_string_tab[148]
4712#define __pyx_kp_b_iso88591_nA_A_t_Qj_87_1D_2_6_U_4uE_6_e_B __pyx_string_tab[149]
4713#define __pyx_kp_b_iso88591_nA_A_t_Qj_87_Qd_2_6_U_4uE_6_e_B __pyx_string_tab[150]
4714#define __pyx_kp_b_iso88591_nA_A_AT_6_U_4uE_6_e_B_uA_6_U_4u __pyx_string_tab[151]
4715#define __pyx_kp_b_iso88591_nA_A_q_A_Q_7_e1E_e1_6_e_B_uA_7 __pyx_string_tab[152]
4716#define __pyx_kp_b_iso88591_nA_A_6_U_4uE_6_e_B_uA_6_U_4uE_6 __pyx_string_tab[153]
4717#define __pyx_kp_b_iso88591_A_q_6at17_A7_7____787878787_7_N __pyx_string_tab[154]
4718#define __pyx_kp_b_iso88591_A_q_wc_wa_1_wa_5Qd_6_16_XXY6_XX __pyx_string_tab[155]
4719#define __pyx_kp_b_iso88591_A_q_wc_1_a27q299WWX299TTU299ZZ __pyx_string_tab[156]
4720#define __pyx_int_0 __pyx_number_tab[0]
4721#define __pyx_int_neg_1 __pyx_number_tab[1]
4722#define __pyx_int_1 __pyx_number_tab[2]
4723#define __pyx_int_136983863 __pyx_number_tab[3]
4724/* #### Code section: module_state_clear ### */
4725#if CYTHON_USE_MODULE_STATE
4726static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
4727 __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
4728 if (!clear_module_state) return 0;
4729 Py_CLEAR(clear_module_state->__pyx_d);
4730 Py_CLEAR(clear_module_state->__pyx_b);
4731 Py_CLEAR(clear_module_state->__pyx_cython_runtime);
4732 Py_CLEAR(clear_module_state->__pyx_empty_tuple);
4733 Py_CLEAR(clear_module_state->__pyx_empty_bytes);
4734 Py_CLEAR(clear_module_state->__pyx_empty_unicode);
4735 #if CYTHON_PEP489_MULTI_PHASE_INIT
4736 __Pyx_State_RemoveModule(NULL);
4737 #endif
4738 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
4739 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
4740 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
4741 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
4742 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
4743 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
4744 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
4745 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
4746 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
4747 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
4748 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
4749 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
4750 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
4751 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
4752 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
4753 Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
4754 Py_CLEAR(clear_module_state->__pyx_ptype_6mpi4py_3MPI_Datatype);
4755 Py_CLEAR(clear_module_state->PyMPIDatatype_Type);
4756 Py_CLEAR(clear_module_state->__pyx_ptype_6mpi4py_3MPI_Status);
4757 Py_CLEAR(clear_module_state->PyMPIStatus_Type);
4758 Py_CLEAR(clear_module_state->__pyx_ptype_6mpi4py_3MPI_Request);
4759 Py_CLEAR(clear_module_state->PyMPIRequest_Type);
4760 Py_CLEAR(clear_module_state->__pyx_ptype_6mpi4py_3MPI_Prequest);
4761 Py_CLEAR(clear_module_state->PyMPIPrequest_Type);
4762 Py_CLEAR(clear_module_state->__pyx_ptype_6mpi4py_3MPI_Grequest);
4763 Py_CLEAR(clear_module_state->PyMPIGrequest_Type);
4764 Py_CLEAR(clear_module_state->__pyx_ptype_6mpi4py_3MPI_Message);
4765 Py_CLEAR(clear_module_state->PyMPIMessage_Type);
4766 Py_CLEAR(clear_module_state->__pyx_ptype_6mpi4py_3MPI_Op);
4767 Py_CLEAR(clear_module_state->PyMPIOp_Type);
4768 Py_CLEAR(clear_module_state->__pyx_ptype_6mpi4py_3MPI_Group);
4769 Py_CLEAR(clear_module_state->PyMPIGroup_Type);
4770 Py_CLEAR(clear_module_state->__pyx_ptype_6mpi4py_3MPI_Info);
4771 Py_CLEAR(clear_module_state->PyMPIInfo_Type);
4772 Py_CLEAR(clear_module_state->__pyx_ptype_6mpi4py_3MPI_Errhandler);
4773 Py_CLEAR(clear_module_state->PyMPIErrhandler_Type);
4774 Py_CLEAR(clear_module_state->__pyx_ptype_6mpi4py_3MPI_Session);
4775 Py_CLEAR(clear_module_state->PyMPISession_Type);
4776 Py_CLEAR(clear_module_state->__pyx_ptype_6mpi4py_3MPI_Comm);
4777 Py_CLEAR(clear_module_state->PyMPIComm_Type);
4778 Py_CLEAR(clear_module_state->__pyx_ptype_6mpi4py_3MPI_Intracomm);
4779 Py_CLEAR(clear_module_state->PyMPIIntracomm_Type);
4780 Py_CLEAR(clear_module_state->__pyx_ptype_6mpi4py_3MPI_Topocomm);
4781 Py_CLEAR(clear_module_state->PyMPITopocomm_Type);
4782 Py_CLEAR(clear_module_state->__pyx_ptype_6mpi4py_3MPI_Cartcomm);
4783 Py_CLEAR(clear_module_state->PyMPICartcomm_Type);
4784 Py_CLEAR(clear_module_state->__pyx_ptype_6mpi4py_3MPI_Graphcomm);
4785 Py_CLEAR(clear_module_state->PyMPIGraphcomm_Type);
4786 Py_CLEAR(clear_module_state->__pyx_ptype_6mpi4py_3MPI_Distgraphcomm);
4787 Py_CLEAR(clear_module_state->PyMPIDistgraphcomm_Type);
4788 Py_CLEAR(clear_module_state->__pyx_ptype_6mpi4py_3MPI_Intercomm);
4789 Py_CLEAR(clear_module_state->PyMPIIntercomm_Type);
4790 Py_CLEAR(clear_module_state->__pyx_ptype_6mpi4py_3MPI_Win);
4791 Py_CLEAR(clear_module_state->PyMPIWin_Type);
4792 Py_CLEAR(clear_module_state->__pyx_ptype_6mpi4py_3MPI_File);
4793 Py_CLEAR(clear_module_state->PyMPIFile_Type);
4794 Py_CLEAR(clear_module_state->__pyx_ptype_7proteus_10cmeshTools_CMesh);
4795 Py_CLEAR(clear_module_state->__pyx_array_type);
4796 Py_CLEAR(clear_module_state->__pyx_type___pyx_array);
4797 Py_CLEAR(clear_module_state->__pyx_MemviewEnum_type);
4798 Py_CLEAR(clear_module_state->__pyx_type___pyx_MemviewEnum);
4799 Py_CLEAR(clear_module_state->__pyx_memoryview_type);
4800 Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryview);
4801 Py_CLEAR(clear_module_state->__pyx_memoryviewslice_type);
4802 Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryviewslice);
4803 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_items.method);
4804 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_pop.method);
4805 Py_CLEAR(clear_module_state->__pyx_umethod_PyDict_Type_values.method);
4806 for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); }
4807 for (int i=0; i<2; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
4808 for (int i=0; i<8; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
4809 for (int i=0; i<157; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
4810 for (int i=0; i<4; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); }
4811/* #### Code section: module_state_clear_contents ### */
4812/* CommonTypesMetaclass.module_state_clear */
4813Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);
4814
4815/* CythonFunctionPerModule.module_state_clear */
4816Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
4817
4818/* #### Code section: module_state_clear_end ### */
4819return 0;
4820}
4821#endif
4822/* #### Code section: module_state_traverse ### */
4823#if CYTHON_USE_MODULE_STATE
4824static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
4825 __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
4826 if (!traverse_module_state) return 0;
4827 Py_VISIT(traverse_module_state->__pyx_d);
4828 Py_VISIT(traverse_module_state->__pyx_b);
4829 Py_VISIT(traverse_module_state->__pyx_cython_runtime);
4830 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
4831 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
4832 __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
4833 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
4834 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
4835 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
4836 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
4837 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
4838 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
4839 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
4840 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
4841 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
4842 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
4843 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
4844 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
4845 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
4846 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
4847 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
4848 Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
4849 Py_VISIT(traverse_module_state->__pyx_ptype_6mpi4py_3MPI_Datatype);
4850 Py_VISIT(traverse_module_state->PyMPIDatatype_Type);
4851 Py_VISIT(traverse_module_state->__pyx_ptype_6mpi4py_3MPI_Status);
4852 Py_VISIT(traverse_module_state->PyMPIStatus_Type);
4853 Py_VISIT(traverse_module_state->__pyx_ptype_6mpi4py_3MPI_Request);
4854 Py_VISIT(traverse_module_state->PyMPIRequest_Type);
4855 Py_VISIT(traverse_module_state->__pyx_ptype_6mpi4py_3MPI_Prequest);
4856 Py_VISIT(traverse_module_state->PyMPIPrequest_Type);
4857 Py_VISIT(traverse_module_state->__pyx_ptype_6mpi4py_3MPI_Grequest);
4858 Py_VISIT(traverse_module_state->PyMPIGrequest_Type);
4859 Py_VISIT(traverse_module_state->__pyx_ptype_6mpi4py_3MPI_Message);
4860 Py_VISIT(traverse_module_state->PyMPIMessage_Type);
4861 Py_VISIT(traverse_module_state->__pyx_ptype_6mpi4py_3MPI_Op);
4862 Py_VISIT(traverse_module_state->PyMPIOp_Type);
4863 Py_VISIT(traverse_module_state->__pyx_ptype_6mpi4py_3MPI_Group);
4864 Py_VISIT(traverse_module_state->PyMPIGroup_Type);
4865 Py_VISIT(traverse_module_state->__pyx_ptype_6mpi4py_3MPI_Info);
4866 Py_VISIT(traverse_module_state->PyMPIInfo_Type);
4867 Py_VISIT(traverse_module_state->__pyx_ptype_6mpi4py_3MPI_Errhandler);
4868 Py_VISIT(traverse_module_state->PyMPIErrhandler_Type);
4869 Py_VISIT(traverse_module_state->__pyx_ptype_6mpi4py_3MPI_Session);
4870 Py_VISIT(traverse_module_state->PyMPISession_Type);
4871 Py_VISIT(traverse_module_state->__pyx_ptype_6mpi4py_3MPI_Comm);
4872 Py_VISIT(traverse_module_state->PyMPIComm_Type);
4873 Py_VISIT(traverse_module_state->__pyx_ptype_6mpi4py_3MPI_Intracomm);
4874 Py_VISIT(traverse_module_state->PyMPIIntracomm_Type);
4875 Py_VISIT(traverse_module_state->__pyx_ptype_6mpi4py_3MPI_Topocomm);
4876 Py_VISIT(traverse_module_state->PyMPITopocomm_Type);
4877 Py_VISIT(traverse_module_state->__pyx_ptype_6mpi4py_3MPI_Cartcomm);
4878 Py_VISIT(traverse_module_state->PyMPICartcomm_Type);
4879 Py_VISIT(traverse_module_state->__pyx_ptype_6mpi4py_3MPI_Graphcomm);
4880 Py_VISIT(traverse_module_state->PyMPIGraphcomm_Type);
4881 Py_VISIT(traverse_module_state->__pyx_ptype_6mpi4py_3MPI_Distgraphcomm);
4882 Py_VISIT(traverse_module_state->PyMPIDistgraphcomm_Type);
4883 Py_VISIT(traverse_module_state->__pyx_ptype_6mpi4py_3MPI_Intercomm);
4884 Py_VISIT(traverse_module_state->PyMPIIntercomm_Type);
4885 Py_VISIT(traverse_module_state->__pyx_ptype_6mpi4py_3MPI_Win);
4886 Py_VISIT(traverse_module_state->PyMPIWin_Type);
4887 Py_VISIT(traverse_module_state->__pyx_ptype_6mpi4py_3MPI_File);
4888 Py_VISIT(traverse_module_state->PyMPIFile_Type);
4889 Py_VISIT(traverse_module_state->__pyx_ptype_7proteus_10cmeshTools_CMesh);
4890 Py_VISIT(traverse_module_state->__pyx_array_type);
4891 Py_VISIT(traverse_module_state->__pyx_type___pyx_array);
4892 Py_VISIT(traverse_module_state->__pyx_MemviewEnum_type);
4893 Py_VISIT(traverse_module_state->__pyx_type___pyx_MemviewEnum);
4894 Py_VISIT(traverse_module_state->__pyx_memoryview_type);
4895 Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryview);
4896 Py_VISIT(traverse_module_state->__pyx_memoryviewslice_type);
4897 Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryviewslice);
4898 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_items.method);
4899 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_pop.method);
4900 Py_VISIT(traverse_module_state->__pyx_umethod_PyDict_Type_values.method);
4901 for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); }
4902 for (int i=0; i<2; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
4903 for (int i=0; i<8; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
4904 for (int i=0; i<157; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
4905 for (int i=0; i<4; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); }
4906/* #### Code section: module_state_traverse_contents ### */
4907/* CommonTypesMetaclass.module_state_traverse */
4908Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);
4909
4910/* CythonFunctionPerModule.module_state_traverse */
4911Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
4912
4913/* #### Code section: module_state_traverse_end ### */
4914return 0;
4915}
4916#endif
4917/* #### Code section: module_code ### */
4918
4919/* "View.MemoryView":147
4920 * cdef bint dtype_is_object
4921 *
4922 * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
4923 * mode="c", bint allocate_buffer=True):
4924 *
4925*/
4926
4927/* Python wrapper */
4928static int __pyx_array___cinit__(PyObject *__pyx_v_self,
4929#if CYTHON_VECTORCALL_TPNEW
4930PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
4931#else
4932PyObject *__pyx_args, PyObject *__pyx_kwds
4933#endif
4934); /*proto*/
4935static int __pyx_array___cinit__(PyObject *__pyx_v_self,
4936#if CYTHON_VECTORCALL_TPNEW
4937PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
4938#else
4939PyObject *__pyx_args, PyObject *__pyx_kwds
4940#endif
4941) {
4942 PyObject *__pyx_v_shape = 0;
4943 Py_ssize_t __pyx_v_itemsize;
4944 PyObject *__pyx_v_format = 0;
4945 PyObject *__pyx_v_mode = 0;
4946 int __pyx_v_allocate_buffer;
4947 #if !CYTHON_VECTORCALL_TPNEW
4948 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
4949 #endif
4950 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
4951 PyObject* values[5] = {0,0,0,0,0};
4952 int __pyx_lineno = 0;
4953 const char *__pyx_filename = NULL;
4954 int __pyx_clineno = 0;
4955 int __pyx_r;
4956 __Pyx_RefNannyDeclarations
4957 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
4958 #if !CYTHON_VECTORCALL_TPNEW
4959 #if CYTHON_ASSUME_SAFE_SIZE
4960 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
4961 #else
4962 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
4963 #endif
4964 #endif
4965 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
4966 {
4967 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_shape,&__pyx_mstate_global->__pyx_n_u_itemsize,&__pyx_mstate_global->__pyx_n_u_format,&__pyx_mstate_global->__pyx_n_u_mode,&__pyx_mstate_global->__pyx_n_u_allocate_buffer,0};
4968 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
4969 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 147, __pyx_L3_error)
4970 if (__pyx_kwds_len > 0) {
4971 switch (__pyx_nargs) {
4972 case 5:
4973 values[4] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 4);
4974 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 147, __pyx_L3_error)
4975 CYTHON_FALLTHROUGH;
4976 case 4:
4977 values[3] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 3);
4978 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 147, __pyx_L3_error)
4979 CYTHON_FALLTHROUGH;
4980 case 3:
4981 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
4982 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 147, __pyx_L3_error)
4983 CYTHON_FALLTHROUGH;
4984 case 2:
4985 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
4986 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 147, __pyx_L3_error)
4987 CYTHON_FALLTHROUGH;
4988 case 1:
4989 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
4990 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 147, __pyx_L3_error)
4991 CYTHON_FALLTHROUGH;
4992 case 0: break;
4993 default: goto __pyx_L5_argtuple_error;
4994 }
4995 const Py_ssize_t kwd_pos_args = __pyx_nargs;
4996 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(1, 147, __pyx_L3_error)
4997 if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_c));
4998 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
4999 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, i); __PYX_ERR(1, 147, __pyx_L3_error) }
5000 }
5001 } else {
5002 switch (__pyx_nargs) {
5003 case 5:
5004 values[4] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 4);
5005 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(1, 147, __pyx_L3_error)
5006 CYTHON_FALLTHROUGH;
5007 case 4:
5008 values[3] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 3);
5009 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(1, 147, __pyx_L3_error)
5010 CYTHON_FALLTHROUGH;
5011 case 3:
5012 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
5013 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 147, __pyx_L3_error)
5014 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
5015 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 147, __pyx_L3_error)
5016 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
5017 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 147, __pyx_L3_error)
5018 break;
5019 default: goto __pyx_L5_argtuple_error;
5020 }
5021 if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_c));
5022 }
5023 __pyx_v_shape = ((PyObject*)values[0]);
5024 __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 147, __pyx_L3_error)
5025 __pyx_v_format = values[2];
5026 __pyx_v_mode = values[3];
5027 if (values[4]) {
5028 __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 148, __pyx_L3_error)
5029 } else {
5030
5031 /* "View.MemoryView":148
5032 *
5033 * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
5034 * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
5035 *
5036 * cdef int idx
5037*/
5038 __pyx_v_allocate_buffer = ((int)1);
5039 }
5040 }
5041 goto __pyx_L6_skip;
5042 __pyx_L5_argtuple_error:;
5043 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, __pyx_nargs); __PYX_ERR(1, 147, __pyx_L3_error)
5044 __pyx_L6_skip:;
5045 goto __pyx_L4_argument_unpacking_done;
5046 __pyx_L3_error:;
5047 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
5048 Py_XDECREF(values[__pyx_temp]);
5049 }
5050 __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5051 __Pyx_RefNannyFinishContext();
5052 return -1;
5053 __pyx_L4_argument_unpacking_done:;
5054 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 147, __pyx_L1_error)
5055 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
5056 PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 147, __pyx_L1_error)
5057 }
5058 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
5059
5060 /* "View.MemoryView":147
5061 * cdef bint dtype_is_object
5062 *
5063 * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
5064 * mode="c", bint allocate_buffer=True):
5065 *
5066*/
5067
5068 /* function exit code */
5069 goto __pyx_L0;
5070 __pyx_L1_error:;
5071 __pyx_r = -1;
5072 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
5073 Py_XDECREF(values[__pyx_temp]);
5074 }
5075 goto __pyx_L7_cleaned_up;
5076 __pyx_L0:;
5077 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
5078 Py_XDECREF(values[__pyx_temp]);
5079 }
5080 __pyx_L7_cleaned_up:;
5081
5082
5083 __Pyx_RefNannyFinishContext();
5084 return __pyx_r;
5085}
5086
5087static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
5088 int __pyx_v_idx;
5089 Py_ssize_t __pyx_v_dim;
5090 char __pyx_v_order;
5091 int __pyx_r;
5092 __Pyx_RefNannyDeclarations
5093 Py_ssize_t __pyx_t_1;
5094 int __pyx_t_2;
5095 int __pyx_t_3;
5096 int __pyx_t_4;
5097 PyObject *__pyx_t_5 = NULL;
5098 PyObject *__pyx_t_6 = NULL;
5099 size_t __pyx_t_7;
5100 char *__pyx_t_8;
5101 Py_ssize_t __pyx_t_9;
5102 PyObject *__pyx_t_10 = NULL;
5103 PyObject *__pyx_t_11[5];
5104 int __pyx_t_12;
5105 PyObject *__pyx_t_13 = NULL;
5106 int __pyx_lineno = 0;
5107 const char *__pyx_filename = NULL;
5108 int __pyx_clineno = 0;
5109 __Pyx_RefNannySetupContext("__cinit__", 0);
5110 __Pyx_INCREF(__pyx_v_format);
5111
5112 /* "View.MemoryView":153
5113 * cdef Py_ssize_t dim
5114 *
5115 * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
5116 * self.itemsize = itemsize
5117 *
5118*/
5119 if (unlikely(__pyx_v_shape == Py_None)) {
5120 PyErr_SetString(PyExc_TypeError, "object of type \047NoneType\047 has no len()");
5121 __PYX_ERR(1, 153, __pyx_L1_error)
5122 }
5123 __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 153, __pyx_L1_error)
5124 __pyx_v_self->ndim = ((int)__pyx_t_1);
5125
5126
5127 /* "View.MemoryView":154
5128 *
5129 * self.ndim = <int> len(shape)
5130 * self.itemsize = itemsize # <<<<<<<<<<<<<<
5131 *
5132 * if cython.unlikely(not self.ndim):
5133*/
5134 __pyx_v_self->itemsize = __pyx_v_itemsize;
5135
5136 /* "View.MemoryView":156
5137 * self.itemsize = itemsize
5138 *
5139 * if cython.unlikely(not self.ndim): # <<<<<<<<<<<<<<
5140 * _err_ValueError("Empty shape tuple for cython.array")
5141 *
5142*/
5143 __pyx_t_2 = (!(__pyx_v_self->ndim != 0));
5144
5145 if (unlikely(__pyx_t_2)) {
5146
5147
5148 /* "View.MemoryView":157
5149 *
5150 * if cython.unlikely(not self.ndim):
5151 * _err_ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
5152 *
5153 * if cython.unlikely(itemsize <= 0):
5154*/
5155 __pyx_t_3 = __pyx_memoryview_err_ValueError(__pyx_k_Empty_shape_tuple_for_cython_arr); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 157, __pyx_L1_error)
5156
5157
5158 /* "View.MemoryView":156
5159 * self.itemsize = itemsize
5160 *
5161 * if cython.unlikely(not self.ndim): # <<<<<<<<<<<<<<
5162 * _err_ValueError("Empty shape tuple for cython.array")
5163 *
5164*/
5165 }
5166
5167 /* "View.MemoryView":159
5168 * _err_ValueError("Empty shape tuple for cython.array")
5169 *
5170 * if cython.unlikely(itemsize <= 0): # <<<<<<<<<<<<<<
5171 * _err_ValueError("itemsize <= 0 for cython.array")
5172 *
5173*/
5174 __pyx_t_2 = (__pyx_v_itemsize <= 0);
5175
5176 if (unlikely(__pyx_t_2)) {
5177
5178
5179 /* "View.MemoryView":160
5180 *
5181 * if cython.unlikely(itemsize <= 0):
5182 * _err_ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
5183 *
5184 * if not isinstance(format, bytes):
5185*/
5186 __pyx_t_3 = __pyx_memoryview_err_ValueError(__pyx_k_itemsize_0_for_cython_array); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 160, __pyx_L1_error)
5187
5188
5189 /* "View.MemoryView":159
5190 * _err_ValueError("Empty shape tuple for cython.array")
5191 *
5192 * if cython.unlikely(itemsize <= 0): # <<<<<<<<<<<<<<
5193 * _err_ValueError("itemsize <= 0 for cython.array")
5194 *
5195*/
5196 }
5197
5198 /* "View.MemoryView":162
5199 * _err_ValueError("itemsize <= 0 for cython.array")
5200 *
5201 * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
5202 * format = format.encode('ASCII')
5203 * self._format = format # keep a reference to the byte string
5204*/
5205 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
5206 __pyx_t_4 = (!__pyx_t_2);
5207
5208
5209 if (__pyx_t_4) {
5210
5211
5212 /* "View.MemoryView":163
5213 *
5214 * if not isinstance(format, bytes):
5215 * format = format.encode('ASCII') # <<<<<<<<<<<<<<
5216 * self._format = format # keep a reference to the byte string
5217 * self.format = self._format
5218*/
5219 __pyx_t_6 = __pyx_v_format;
5220 __Pyx_INCREF(__pyx_t_6);
5221 __pyx_t_7 = 0;
5222 {
5223 PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ASCII};
5224 __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
5225 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5226 if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 163, __pyx_L1_error)
5227 __Pyx_GOTREF(__pyx_t_5);
5228 }
5229 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
5230 __pyx_t_5 = 0;
5231
5232 /* "View.MemoryView":162
5233 * _err_ValueError("itemsize <= 0 for cython.array")
5234 *
5235 * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
5236 * format = format.encode('ASCII')
5237 * self._format = format # keep a reference to the byte string
5238*/
5239 }
5240
5241 /* "View.MemoryView":164
5242 * if not isinstance(format, bytes):
5243 * format = format.encode('ASCII')
5244 * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
5245 * self.format = self._format
5246 *
5247*/
5248 __pyx_t_5 = __pyx_v_format;
5249 __Pyx_INCREF(__pyx_t_5);
5250 if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_5))) __PYX_ERR(1, 164, __pyx_L1_error)
5251 __Pyx_GIVEREF(__pyx_t_5);
5252 __Pyx_GOTREF(__pyx_v_self->_format);
5253 __Pyx_DECREF(__pyx_v_self->_format);
5254 __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
5255 __pyx_t_5 = 0;
5256
5257 /* "View.MemoryView":165
5258 * format = format.encode('ASCII')
5259 * self._format = format # keep a reference to the byte string
5260 * self.format = self._format # <<<<<<<<<<<<<<
5261 *
5262 *
5263*/
5264 if (unlikely(__pyx_v_self->_format == Py_None)) {
5265 PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
5266 __PYX_ERR(1, 165, __pyx_L1_error)
5267 }
5268 __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(1, 165, __pyx_L1_error)
5269 __pyx_v_self->format = __pyx_t_8;
5270
5271 /* "View.MemoryView":168
5272 *
5273 *
5274 * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t> self.ndim) # <<<<<<<<<<<<<<
5275 * self._strides = self._shape + self.ndim
5276 *
5277*/
5278 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_self->ndim))));
5279
5280 /* "View.MemoryView":169
5281 *
5282 * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t> self.ndim)
5283 * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
5284 *
5285 * if not self._shape:
5286*/
5287 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
5288
5289 /* "View.MemoryView":171
5290 * self._strides = self._shape + self.ndim
5291 *
5292 * if not self._shape: # <<<<<<<<<<<<<<
5293 * raise MemoryError, "unable to allocate shape and strides."
5294 *
5295*/
5296 __pyx_t_4 = (!(__pyx_v_self->_shape != 0));
5297
5298 if (unlikely(__pyx_t_4)) {
5299
5300
5301 /* "View.MemoryView":172
5302 *
5303 * if not self._shape:
5304 * raise MemoryError, "unable to allocate shape and strides." # <<<<<<<<<<<<<<
5305 *
5306 *
5307*/
5308 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_MemoryError))), __pyx_mstate_global->__pyx_kp_u_unable_to_allocate_shape_and_str, 0, 0);
5309 __PYX_ERR(1, 172, __pyx_L1_error)
5310
5311 /* "View.MemoryView":171
5312 * self._strides = self._shape + self.ndim
5313 *
5314 * if not self._shape: # <<<<<<<<<<<<<<
5315 * raise MemoryError, "unable to allocate shape and strides."
5316 *
5317*/
5318 }
5319
5320 /* "View.MemoryView":175
5321 *
5322 *
5323 * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
5324 * if dim <= 0:
5325 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5326*/
5327
5328 __pyx_t_3 = 0;
5329 __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5);
5330 __pyx_t_1 = 0;
5331 for (;;) {
5332 {
5333 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5);
5334 #if !CYTHON_ASSUME_SAFE_SIZE
5335 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 175, __pyx_L1_error)
5336 #endif
5337 if (__pyx_t_1 >= __pyx_temp) break;
5338 }
5339 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5340 __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1));
5341 #else
5342 __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_1);
5343 #endif
5344 ++__pyx_t_1;
5345 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 175, __pyx_L1_error)
5346 __Pyx_GOTREF(__pyx_t_6);
5347 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 175, __pyx_L1_error)
5348 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5349 __pyx_v_dim = __pyx_t_9;
5350 __pyx_v_idx = __pyx_t_3;
5351 __pyx_t_3 = (__pyx_t_3 + 1);
5352
5353 /* "View.MemoryView":176
5354 *
5355 * for idx, dim in enumerate(shape):
5356 * if dim <= 0: # <<<<<<<<<<<<<<
5357 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5358 * self._shape[idx] = dim
5359*/
5360 __pyx_t_4 = (__pyx_v_dim <= 0);
5361
5362 if (unlikely(__pyx_t_4)) {
5363
5364
5365 /* "View.MemoryView":177
5366 * for idx, dim in enumerate(shape):
5367 * if dim <= 0:
5368 * raise ValueError, f"Invalid shape in axis {idx}: {dim}." # <<<<<<<<<<<<<<
5369 * self._shape[idx] = dim
5370 *
5371*/
5372 __pyx_t_6 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 177, __pyx_L1_error)
5373 __Pyx_GOTREF(__pyx_t_6);
5374 __pyx_t_10 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 177, __pyx_L1_error)
5375 __Pyx_GOTREF(__pyx_t_10);
5376 __pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_Invalid_shape_in_axis;
5377 __pyx_t_11[1] = __pyx_t_6;
5378 __pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u__2;
5379 __pyx_t_11[3] = __pyx_t_10;
5380 __pyx_t_11[4] = __pyx_mstate_global->__pyx_kp_u__3;
5381 __pyx_t_9 = 25;
5382 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
5383 __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11[3]);
5384 #endif
5385 __pyx_t_12 = 0;
5386 __pyx_t_13 = __Pyx_PyUnicode_Join(__pyx_t_11, 5, __pyx_t_9, __pyx_t_12);
5387 if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 177, __pyx_L1_error)
5388 __Pyx_GOTREF(__pyx_t_13);
5389 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5390 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5391 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_t_13, 0, 0);
5392 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5393 __PYX_ERR(1, 177, __pyx_L1_error)
5394
5395 /* "View.MemoryView":176
5396 *
5397 * for idx, dim in enumerate(shape):
5398 * if dim <= 0: # <<<<<<<<<<<<<<
5399 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5400 * self._shape[idx] = dim
5401*/
5402 }
5403
5404 /* "View.MemoryView":178
5405 * if dim <= 0:
5406 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5407 * self._shape[idx] = dim # <<<<<<<<<<<<<<
5408 *
5409 * cdef char order
5410*/
5411 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
5412
5413 /* "View.MemoryView":175
5414 *
5415 *
5416 * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
5417 * if dim <= 0:
5418 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5419*/
5420 }
5421 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5422
5423 /* "View.MemoryView":181
5424 *
5425 * cdef char order
5426 * if mode == 'c': # <<<<<<<<<<<<<<
5427 * order = b'C'
5428 * self.mode = u'c'
5429*/
5430 __pyx_t_4 = (__Pyx_PyObject_Equals_obj_ch99(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_c, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 181, __pyx_L1_error)
5431 if (__pyx_t_4) {
5432
5433
5434 /* "View.MemoryView":182
5435 * cdef char order
5436 * if mode == 'c':
5437 * order = b'C' # <<<<<<<<<<<<<<
5438 * self.mode = u'c'
5439 * elif mode == 'fortran':
5440*/
5441 __pyx_v_order = 'C';
5442
5443 /* "View.MemoryView":183
5444 * if mode == 'c':
5445 * order = b'C'
5446 * self.mode = u'c' # <<<<<<<<<<<<<<
5447 * elif mode == 'fortran':
5448 * order = b'F'
5449*/
5450 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_c);
5451 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_c);
5452 __Pyx_GOTREF(__pyx_v_self->mode);
5453 __Pyx_DECREF(__pyx_v_self->mode);
5454 __pyx_v_self->mode = __pyx_mstate_global->__pyx_n_u_c;
5455
5456 /* "View.MemoryView":181
5457 *
5458 * cdef char order
5459 * if mode == 'c': # <<<<<<<<<<<<<<
5460 * order = b'C'
5461 * self.mode = u'c'
5462*/
5463 goto __pyx_L11;
5464 }
5465
5466 /* "View.MemoryView":184
5467 * order = b'C'
5468 * self.mode = u'c'
5469 * elif mode == 'fortran': # <<<<<<<<<<<<<<
5470 * order = b'F'
5471 * self.mode = u'fortran'
5472*/
5473 __pyx_t_4 = __Pyx_PyObject_CompareBoolEq_object_str(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_fortran, Py_EQ); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 184, __pyx_L1_error)
5474 if (likely(__pyx_t_4)) {
5475
5476
5477 /* "View.MemoryView":185
5478 * self.mode = u'c'
5479 * elif mode == 'fortran':
5480 * order = b'F' # <<<<<<<<<<<<<<
5481 * self.mode = u'fortran'
5482 * else:
5483*/
5484 __pyx_v_order = 'F';
5485
5486 /* "View.MemoryView":186
5487 * elif mode == 'fortran':
5488 * order = b'F'
5489 * self.mode = u'fortran' # <<<<<<<<<<<<<<
5490 * else:
5491 * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
5492*/
5493 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_fortran);
5494 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_fortran);
5495 __Pyx_GOTREF(__pyx_v_self->mode);
5496 __Pyx_DECREF(__pyx_v_self->mode);
5497 __pyx_v_self->mode = __pyx_mstate_global->__pyx_n_u_fortran;
5498
5499 /* "View.MemoryView":184
5500 * order = b'C'
5501 * self.mode = u'c'
5502 * elif mode == 'fortran': # <<<<<<<<<<<<<<
5503 * order = b'F'
5504 * self.mode = u'fortran'
5505*/
5506 goto __pyx_L11;
5507 }
5508
5509 /* "View.MemoryView":188
5510 * self.mode = u'fortran'
5511 * else:
5512 * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}" # <<<<<<<<<<<<<<
5513 *
5514 * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
5515*/
5516 /*else*/ {
5517 __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_mode, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 188, __pyx_L1_error)
5518 __Pyx_GOTREF(__pyx_t_5);
5519 __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 188, __pyx_L1_error)
5520 __Pyx_GOTREF(__pyx_t_13);
5521 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5522 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_t_13, 0, 0);
5523 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5524 __PYX_ERR(1, 188, __pyx_L1_error)
5525 }
5526 __pyx_L11:;
5527
5528 /* "View.MemoryView":190
5529 * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
5530 *
5531 * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order) # <<<<<<<<<<<<<<
5532 *
5533 * self.free_data = allocate_buffer
5534*/
5535 __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
5536
5537 /* "View.MemoryView":192
5538 * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
5539 *
5540 * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
5541 * self.dtype_is_object = format == b'O'
5542 *
5543*/
5544 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
5545
5546 /* "View.MemoryView":193
5547 *
5548 * self.free_data = allocate_buffer
5549 * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
5550 *
5551 * if allocate_buffer:
5552*/
5553 __pyx_t_13 = __Pyx_PyObject_CompareEq_object_bytes(__pyx_v_format, __pyx_mstate_global->__pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(1, 193, __pyx_L1_error)
5554 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 193, __pyx_L1_error)
5555 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5556 __pyx_v_self->dtype_is_object = __pyx_t_4;
5557
5558 /* "View.MemoryView":195
5559 * self.dtype_is_object = format == b'O'
5560 *
5561 * if allocate_buffer: # <<<<<<<<<<<<<<
5562 * _allocate_buffer(self)
5563 *
5564*/
5565 if (__pyx_v_allocate_buffer) {
5566
5567 /* "View.MemoryView":196
5568 *
5569 * if allocate_buffer:
5570 * _allocate_buffer(self) # <<<<<<<<<<<<<<
5571 *
5572 * @cname('getbuffer')
5573*/
5574 __pyx_t_3 = __pyx_array_allocate_buffer(__pyx_v_self); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 196, __pyx_L1_error)
5575
5576
5577 /* "View.MemoryView":195
5578 * self.dtype_is_object = format == b'O'
5579 *
5580 * if allocate_buffer: # <<<<<<<<<<<<<<
5581 * _allocate_buffer(self)
5582 *
5583*/
5584 }
5585
5586 /* "View.MemoryView":147
5587 * cdef bint dtype_is_object
5588 *
5589 * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
5590 * mode="c", bint allocate_buffer=True):
5591 *
5592*/
5593
5594 /* function exit code */
5595 __pyx_r = 0;
5596 goto __pyx_L0;
5597 __pyx_L1_error:;
5598 __Pyx_XDECREF(__pyx_t_5);
5599 __Pyx_XDECREF(__pyx_t_6);
5600 __Pyx_XDECREF(__pyx_t_10);
5601 __Pyx_XDECREF(__pyx_t_13);
5602 __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5603 __pyx_r = -1;
5604 __pyx_L0:;
5605
5606
5607
5608 __Pyx_XDECREF(__pyx_v_format);
5609
5610 __Pyx_RefNannyFinishContext();
5611 return __pyx_r;
5612}
5613
5614/* "View.MemoryView":198
5615 * _allocate_buffer(self)
5616 *
5617 * @cname('getbuffer') # <<<<<<<<<<<<<<
5618 * def __getbuffer__(self, Py_buffer *info, int flags):
5619 * cdef int bufmode = -1
5620*/
5621
5622/* Python wrapper */
5623CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
5624CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
5625 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5626 int __pyx_r;
5627 __Pyx_RefNannyDeclarations
5628 __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
5629 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5630 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
5631
5632 /* function exit code */
5633
5634
5635 __Pyx_RefNannyFinishContext();
5636 return __pyx_r;
5637}
5638
5639static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
5640 int __pyx_v_bufmode;
5641 int __pyx_r;
5642 __Pyx_RefNannyDeclarations
5643 int __pyx_t_1;
5644 int __pyx_t_2;
5645 char *__pyx_t_3;
5646 Py_ssize_t __pyx_t_4;
5647 Py_ssize_t *__pyx_t_5;
5648 int __pyx_lineno = 0;
5649 const char *__pyx_filename = NULL;
5650 int __pyx_clineno = 0;
5651 if (unlikely(__pyx_v_info == NULL)) {
5652 PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
5653 return -1;
5654 }
5655 __Pyx_RefNannySetupContext("__getbuffer__", 0);
5656 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
5657 __Pyx_GIVEREF(__pyx_v_info->obj);
5658
5659 /* "View.MemoryView":200
5660 * @cname('getbuffer')
5661 * def __getbuffer__(self, Py_buffer *info, int flags):
5662 * cdef int bufmode = -1 # <<<<<<<<<<<<<<
5663 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5664 * if self.mode == u"c":
5665*/
5666 __pyx_v_bufmode = -1;
5667
5668 /* "View.MemoryView":201
5669 * def __getbuffer__(self, Py_buffer *info, int flags):
5670 * cdef int bufmode = -1
5671 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
5672 * if self.mode == u"c":
5673 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5674*/
5675 __pyx_t_1 = ((__pyx_v_flags & ((PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS) | PyBUF_ANY_CONTIGUOUS)) != 0);
5676
5677 if (__pyx_t_1) {
5678
5679
5680 /* "View.MemoryView":202
5681 * cdef int bufmode = -1
5682 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5683 * if self.mode == u"c": # <<<<<<<<<<<<<<
5684 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5685 * elif self.mode == u"fortran":
5686*/
5687 __pyx_t_1 = (__Pyx_PyObject_Equals_str_ch99(__pyx_v_self->mode, __pyx_mstate_global->__pyx_n_u_c, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 202, __pyx_L1_error)
5688 if (__pyx_t_1) {
5689
5690
5691 /* "View.MemoryView":203
5692 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5693 * if self.mode == u"c":
5694 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
5695 * elif self.mode == u"fortran":
5696 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5697*/
5698 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
5699
5700 /* "View.MemoryView":202
5701 * cdef int bufmode = -1
5702 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5703 * if self.mode == u"c": # <<<<<<<<<<<<<<
5704 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5705 * elif self.mode == u"fortran":
5706*/
5707 goto __pyx_L4;
5708 }
5709
5710 /* "View.MemoryView":204
5711 * if self.mode == u"c":
5712 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5713 * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
5714 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5715 * if cython.unlikely(not (flags & bufmode)):
5716*/
5717 __pyx_t_1 = __Pyx_PyObject_CompareBoolEq_str_str(__pyx_v_self->mode, __pyx_mstate_global->__pyx_n_u_fortran, Py_EQ); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 204, __pyx_L1_error)
5718 if (__pyx_t_1) {
5719
5720
5721 /* "View.MemoryView":205
5722 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5723 * elif self.mode == u"fortran":
5724 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
5725 * if cython.unlikely(not (flags & bufmode)):
5726 * _err_ValueError("Can only create a buffer that is contiguous in memory.")
5727*/
5728 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
5729
5730 /* "View.MemoryView":204
5731 * if self.mode == u"c":
5732 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5733 * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
5734 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5735 * if cython.unlikely(not (flags & bufmode)):
5736*/
5737 }
5738 __pyx_L4:;
5739
5740 /* "View.MemoryView":206
5741 * elif self.mode == u"fortran":
5742 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5743 * if cython.unlikely(not (flags & bufmode)): # <<<<<<<<<<<<<<
5744 * _err_ValueError("Can only create a buffer that is contiguous in memory.")
5745 * info.buf = self.data
5746*/
5747 __pyx_t_1 = (!((__pyx_v_flags & __pyx_v_bufmode) != 0));
5748
5749 if (unlikely(__pyx_t_1)) {
5750
5751
5752 /* "View.MemoryView":207
5753 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5754 * if cython.unlikely(not (flags & bufmode)):
5755 * _err_ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
5756 * info.buf = self.data
5757 * info.len = self.len
5758*/
5759 __pyx_t_2 = __pyx_memoryview_err_ValueError(__pyx_k_Can_only_create_a_buffer_that_is); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 207, __pyx_L1_error)
5760
5761
5762 /* "View.MemoryView":206
5763 * elif self.mode == u"fortran":
5764 * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5765 * if cython.unlikely(not (flags & bufmode)): # <<<<<<<<<<<<<<
5766 * _err_ValueError("Can only create a buffer that is contiguous in memory.")
5767 * info.buf = self.data
5768*/
5769 }
5770
5771 /* "View.MemoryView":201
5772 * def __getbuffer__(self, Py_buffer *info, int flags):
5773 * cdef int bufmode = -1
5774 * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
5775 * if self.mode == u"c":
5776 * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5777*/
5778 }
5779
5780 /* "View.MemoryView":208
5781 * if cython.unlikely(not (flags & bufmode)):
5782 * _err_ValueError("Can only create a buffer that is contiguous in memory.")
5783 * info.buf = self.data # <<<<<<<<<<<<<<
5784 * info.len = self.len
5785 *
5786*/
5787 __pyx_t_3 = __pyx_v_self->data;
5788
5789 __pyx_v_info->buf = __pyx_t_3;
5790
5791 /* "View.MemoryView":209
5792 * _err_ValueError("Can only create a buffer that is contiguous in memory.")
5793 * info.buf = self.data
5794 * info.len = self.len # <<<<<<<<<<<<<<
5795 *
5796 * if flags & PyBUF_STRIDES:
5797*/
5798 __pyx_t_4 = __pyx_v_self->len;
5799
5800 __pyx_v_info->len = __pyx_t_4;
5801
5802 /* "View.MemoryView":211
5803 * info.len = self.len
5804 *
5805 * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
5806 * info.ndim = self.ndim
5807 * info.shape = self._shape
5808*/
5809 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
5810
5811 if (__pyx_t_1) {
5812
5813
5814 /* "View.MemoryView":212
5815 *
5816 * if flags & PyBUF_STRIDES:
5817 * info.ndim = self.ndim # <<<<<<<<<<<<<<
5818 * info.shape = self._shape
5819 * info.strides = self._strides
5820*/
5821 __pyx_t_2 = __pyx_v_self->ndim;
5822
5823 __pyx_v_info->ndim = __pyx_t_2;
5824
5825 /* "View.MemoryView":213
5826 * if flags & PyBUF_STRIDES:
5827 * info.ndim = self.ndim
5828 * info.shape = self._shape # <<<<<<<<<<<<<<
5829 * info.strides = self._strides
5830 * else:
5831*/
5832 __pyx_t_5 = __pyx_v_self->_shape;
5833
5834 __pyx_v_info->shape = __pyx_t_5;
5835
5836 /* "View.MemoryView":214
5837 * info.ndim = self.ndim
5838 * info.shape = self._shape
5839 * info.strides = self._strides # <<<<<<<<<<<<<<
5840 * else:
5841 * info.ndim = 1
5842*/
5843 __pyx_t_5 = __pyx_v_self->_strides;
5844
5845 __pyx_v_info->strides = __pyx_t_5;
5846
5847 /* "View.MemoryView":211
5848 * info.len = self.len
5849 *
5850 * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
5851 * info.ndim = self.ndim
5852 * info.shape = self._shape
5853*/
5854 goto __pyx_L6;
5855 }
5856
5857 /* "View.MemoryView":216
5858 * info.strides = self._strides
5859 * else:
5860 * info.ndim = 1 # <<<<<<<<<<<<<<
5861 * info.shape = &self.len if flags & PyBUF_ND else NULL
5862 * info.strides = NULL
5863*/
5864 /*else*/ {
5865 __pyx_v_info->ndim = 1;
5866
5867 /* "View.MemoryView":217
5868 * else:
5869 * info.ndim = 1
5870 * info.shape = &self.len if flags & PyBUF_ND else NULL # <<<<<<<<<<<<<<
5871 * info.strides = NULL
5872 *
5873*/
5874 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
5875
5876 if (__pyx_t_1) {
5877
5878 __pyx_t_5 = (&__pyx_v_self->len);
5879 } else {
5880
5881 __pyx_t_5 = NULL;
5882 }
5883
5884 __pyx_v_info->shape = __pyx_t_5;
5885
5886 /* "View.MemoryView":218
5887 * info.ndim = 1
5888 * info.shape = &self.len if flags & PyBUF_ND else NULL
5889 * info.strides = NULL # <<<<<<<<<<<<<<
5890 *
5891 * info.suboffsets = NULL
5892*/
5893 __pyx_v_info->strides = NULL;
5894 }
5895 __pyx_L6:;
5896
5897 /* "View.MemoryView":220
5898 * info.strides = NULL
5899 *
5900 * info.suboffsets = NULL # <<<<<<<<<<<<<<
5901 * info.itemsize = self.itemsize
5902 * info.readonly = 0
5903*/
5904 __pyx_v_info->suboffsets = NULL;
5905
5906 /* "View.MemoryView":221
5907 *
5908 * info.suboffsets = NULL
5909 * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
5910 * info.readonly = 0
5911 * info.format = self.format if flags & PyBUF_FORMAT else NULL
5912*/
5913 __pyx_t_4 = __pyx_v_self->itemsize;
5914
5915 __pyx_v_info->itemsize = __pyx_t_4;
5916
5917 /* "View.MemoryView":222
5918 * info.suboffsets = NULL
5919 * info.itemsize = self.itemsize
5920 * info.readonly = 0 # <<<<<<<<<<<<<<
5921 * info.format = self.format if flags & PyBUF_FORMAT else NULL
5922 * info.obj = self
5923*/
5924 __pyx_v_info->readonly = 0;
5925
5926 /* "View.MemoryView":223
5927 * info.itemsize = self.itemsize
5928 * info.readonly = 0
5929 * info.format = self.format if flags & PyBUF_FORMAT else NULL # <<<<<<<<<<<<<<
5930 * info.obj = self
5931 *
5932*/
5933 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
5934
5935 if (__pyx_t_1) {
5936
5937 __pyx_t_3 = __pyx_v_self->format;
5938 } else {
5939
5940 __pyx_t_3 = NULL;
5941 }
5942
5943 __pyx_v_info->format = __pyx_t_3;
5944
5945 /* "View.MemoryView":224
5946 * info.readonly = 0
5947 * info.format = self.format if flags & PyBUF_FORMAT else NULL
5948 * info.obj = self # <<<<<<<<<<<<<<
5949 *
5950 * def __dealloc__(array self):
5951*/
5952 __Pyx_INCREF((PyObject *)__pyx_v_self);
5953 __Pyx_GIVEREF((PyObject *)__pyx_v_self);
5954 __Pyx_GOTREF(__pyx_v_info->obj);
5955 __Pyx_DECREF(__pyx_v_info->obj);
5956 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
5957
5958 /* "View.MemoryView":198
5959 * _allocate_buffer(self)
5960 *
5961 * @cname('getbuffer') # <<<<<<<<<<<<<<
5962 * def __getbuffer__(self, Py_buffer *info, int flags):
5963 * cdef int bufmode = -1
5964*/
5965
5966 /* function exit code */
5967 __pyx_r = 0;
5968 goto __pyx_L0;
5969 __pyx_L1_error:;
5970 __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5971 __pyx_r = -1;
5972 if (__pyx_v_info->obj != NULL) {
5973 __Pyx_GOTREF(__pyx_v_info->obj);
5974 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5975 }
5976 goto __pyx_L2;
5977 __pyx_L0:;
5978 if (__pyx_v_info->obj == Py_None) {
5979 __Pyx_GOTREF(__pyx_v_info->obj);
5980 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5981 }
5982 __pyx_L2:;
5983
5984
5985 __Pyx_RefNannyFinishContext();
5986 return __pyx_r;
5987}
5988
5989/* "View.MemoryView":226
5990 * info.obj = self
5991 *
5992 * def __dealloc__(array self): # <<<<<<<<<<<<<<
5993 * if self.callback_free_data != NULL:
5994 * self.callback_free_data(self.data)
5995*/
5996
5997/* Python wrapper */
5998static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
5999static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
6000 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6001 __Pyx_RefNannyDeclarations
6002 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
6003 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6004 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
6005
6006 /* function exit code */
6007 __Pyx_RefNannyFinishContext();
6008}
6009
6010static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
6011 int __pyx_t_1;
6012 int __pyx_t_2;
6013
6014 /* "View.MemoryView":227
6015 *
6016 * def __dealloc__(array self):
6017 * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
6018 * self.callback_free_data(self.data)
6019 * elif self.free_data and self.data is not NULL:
6020*/
6021 __pyx_t_1 = (__pyx_v_self->callback_free_data != NULL);
6022
6023 if (__pyx_t_1) {
6024
6025
6026 /* "View.MemoryView":228
6027 * def __dealloc__(array self):
6028 * if self.callback_free_data != NULL:
6029 * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
6030 * elif self.free_data and self.data is not NULL:
6031 * if self.dtype_is_object:
6032*/
6033 __pyx_v_self->callback_free_data(__pyx_v_self->data);
6034
6035 /* "View.MemoryView":227
6036 *
6037 * def __dealloc__(array self):
6038 * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
6039 * self.callback_free_data(self.data)
6040 * elif self.free_data and self.data is not NULL:
6041*/
6042 goto __pyx_L3;
6043 }
6044
6045 /* "View.MemoryView":229
6046 * if self.callback_free_data != NULL:
6047 * self.callback_free_data(self.data)
6048 * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
6049 * if self.dtype_is_object:
6050 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6051*/
6052 if (__pyx_v_self->free_data) {
6053 } else {
6054
6055 __pyx_t_1 = __pyx_v_self->free_data;
6056 goto __pyx_L4_bool_binop_done;
6057 }
6058 __pyx_t_2 = (__pyx_v_self->data != NULL);
6059
6060
6061 __pyx_t_1 = __pyx_t_2;
6062
6063 __pyx_L4_bool_binop_done:;
6064 if (__pyx_t_1) {
6065
6066
6067 /* "View.MemoryView":230
6068 * self.callback_free_data(self.data)
6069 * elif self.free_data and self.data is not NULL:
6070 * if self.dtype_is_object: # <<<<<<<<<<<<<<
6071 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6072 * free(self.data)
6073*/
6074 if (__pyx_v_self->dtype_is_object) {
6075
6076 /* "View.MemoryView":231
6077 * elif self.free_data and self.data is not NULL:
6078 * if self.dtype_is_object:
6079 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False) # <<<<<<<<<<<<<<
6080 * free(self.data)
6081 * PyObject_Free(self._shape)
6082*/
6083 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
6084
6085 /* "View.MemoryView":230
6086 * self.callback_free_data(self.data)
6087 * elif self.free_data and self.data is not NULL:
6088 * if self.dtype_is_object: # <<<<<<<<<<<<<<
6089 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6090 * free(self.data)
6091*/
6092 }
6093
6094 /* "View.MemoryView":232
6095 * if self.dtype_is_object:
6096 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6097 * free(self.data) # <<<<<<<<<<<<<<
6098 * PyObject_Free(self._shape)
6099 *
6100*/
6101 free(__pyx_v_self->data);
6102
6103 /* "View.MemoryView":229
6104 * if self.callback_free_data != NULL:
6105 * self.callback_free_data(self.data)
6106 * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
6107 * if self.dtype_is_object:
6108 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6109*/
6110 }
6111 __pyx_L3:;
6112
6113 /* "View.MemoryView":233
6114 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6115 * free(self.data)
6116 * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
6117 *
6118 * @property
6119*/
6120 PyObject_Free(__pyx_v_self->_shape);
6121
6122 /* "View.MemoryView":226
6123 * info.obj = self
6124 *
6125 * def __dealloc__(array self): # <<<<<<<<<<<<<<
6126 * if self.callback_free_data != NULL:
6127 * self.callback_free_data(self.data)
6128*/
6129
6130 /* function exit code */
6131
6132}
6133
6134/* "View.MemoryView":235
6135 * PyObject_Free(self._shape)
6136 *
6137 * @property # <<<<<<<<<<<<<<
6138 * def memview(self):
6139 * return array.get_memview(self)
6140*/
6141
6142/* Python wrapper */
6143static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
6144static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
6145 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6146 PyObject *__pyx_r = 0;
6147 __Pyx_RefNannyDeclarations
6148 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
6149 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6150 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
6151
6152 /* function exit code */
6153 __Pyx_RefNannyFinishContext();
6154 return __pyx_r;
6155}
6156
6157static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
6158 PyObject *__pyx_r = NULL;
6159 __Pyx_RefNannyDeclarations
6160 PyObject *__pyx_t_1 = NULL;
6161 int __pyx_lineno = 0;
6162 const char *__pyx_filename = NULL;
6163 int __pyx_clineno = 0;
6164 __Pyx_RefNannySetupContext("__get__", 0);
6165
6166 /* "View.MemoryView":237
6167 * @property
6168 * def memview(self):
6169 * return array.get_memview(self) # <<<<<<<<<<<<<<
6170 *
6171 *
6172*/
6173 __pyx_t_1 = __pyx_array_get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
6174 __Pyx_GOTREF(__pyx_t_1);
6175 {
6176 PyObject *__pyx_temp;
6177 {
6178 __pyx_temp = __pyx_r;
6179 __pyx_r = __pyx_t_1;
6180 }
6181 __Pyx_XDECREF(__pyx_temp);
6182 }
6183 __pyx_t_1 = 0;
6184 goto __pyx_L0;
6185
6186 /* "View.MemoryView":235
6187 * PyObject_Free(self._shape)
6188 *
6189 * @property # <<<<<<<<<<<<<<
6190 * def memview(self):
6191 * return array.get_memview(self)
6192*/
6193
6194 /* function exit code */
6195 __pyx_L1_error:;
6196 __Pyx_XDECREF(__pyx_t_1);
6197 __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6198 __pyx_r = NULL;
6199 __pyx_L0:;
6200 __Pyx_XGIVEREF(__pyx_r);
6201 __Pyx_RefNannyFinishContext();
6202 return __pyx_r;
6203}
6204
6205/* "View.MemoryView":240
6206 *
6207 *
6208 * @cname('get_memview') # <<<<<<<<<<<<<<
6209 * cdef get_memview(self):
6210 * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
6211*/
6212
6213static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
6214 int __pyx_v_flags;
6215 PyObject *__pyx_r = NULL;
6216 __Pyx_RefNannyDeclarations
6217 PyObject *__pyx_t_1 = NULL;
6218 PyObject *__pyx_t_2 = NULL;
6219 PyObject *__pyx_t_3 = NULL;
6220 PyObject *__pyx_t_4 = NULL;
6221 size_t __pyx_t_5;
6222 int __pyx_lineno = 0;
6223 const char *__pyx_filename = NULL;
6224 int __pyx_clineno = 0;
6225 __Pyx_RefNannySetupContext("get_memview", 0);
6226
6227 /* "View.MemoryView":242
6228 * @cname('get_memview')
6229 * cdef get_memview(self):
6230 * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
6231 * return memoryview(self, flags, self.dtype_is_object)
6232 *
6233*/
6234 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
6235
6236 /* "View.MemoryView":243
6237 * cdef get_memview(self):
6238 * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
6239 * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
6240 *
6241 * def __len__(self):
6242*/
6243 __pyx_t_2 = NULL;
6244 __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 243, __pyx_L1_error)
6245 __Pyx_GOTREF(__pyx_t_3);
6246 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 243, __pyx_L1_error)
6247 __Pyx_GOTREF(__pyx_t_4);
6248 __pyx_t_5 = 1;
6249 {
6250 PyObject *__pyx_callargs[4] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_t_3, __pyx_t_4};
6251 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_memoryview_type, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
6252 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6253 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6254 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6255 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 243, __pyx_L1_error)
6256 __Pyx_GOTREF((PyObject *)__pyx_t_1);
6257 }
6258 {
6259 PyObject *__pyx_temp;
6260 {
6261 __pyx_temp = __pyx_r;
6262 __pyx_r = ((PyObject *)__pyx_t_1);
6263 }
6264 __Pyx_XDECREF(__pyx_temp);
6265 }
6266 __pyx_t_1 = 0;
6267 goto __pyx_L0;
6268
6269 /* "View.MemoryView":240
6270 *
6271 *
6272 * @cname('get_memview') # <<<<<<<<<<<<<<
6273 * cdef get_memview(self):
6274 * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
6275*/
6276
6277 /* function exit code */
6278 __pyx_L1_error:;
6279 __Pyx_XDECREF(__pyx_t_1);
6280 __Pyx_XDECREF(__pyx_t_2);
6281 __Pyx_XDECREF(__pyx_t_3);
6282 __Pyx_XDECREF(__pyx_t_4);
6283 __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
6284 __pyx_r = 0;
6285 __pyx_L0:;
6286
6287 __Pyx_XGIVEREF(__pyx_r);
6288 __Pyx_RefNannyFinishContext();
6289 return __pyx_r;
6290}
6291
6292/* "View.MemoryView":245
6293 * return memoryview(self, flags, self.dtype_is_object)
6294 *
6295 * def __len__(self): # <<<<<<<<<<<<<<
6296 * return self._shape[0]
6297 *
6298*/
6299
6300/* Python wrapper */
6301static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
6302static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
6303 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6304 Py_ssize_t __pyx_r;
6305 __Pyx_RefNannyDeclarations
6306 __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
6307 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6308 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
6309
6310 /* function exit code */
6311 __Pyx_RefNannyFinishContext();
6312 return __pyx_r;
6313}
6314
6315static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
6316 Py_ssize_t __pyx_r;
6317
6318 /* "View.MemoryView":246
6319 *
6320 * def __len__(self):
6321 * return self._shape[0] # <<<<<<<<<<<<<<
6322 *
6323 * def __getattr__(self, attr):
6324*/
6325 {
6326
6327 __pyx_r = (__pyx_v_self->_shape[0]);
6328 }
6329 goto __pyx_L0;
6330
6331 /* "View.MemoryView":245
6332 * return memoryview(self, flags, self.dtype_is_object)
6333 *
6334 * def __len__(self): # <<<<<<<<<<<<<<
6335 * return self._shape[0]
6336 *
6337*/
6338
6339 /* function exit code */
6340 __pyx_L0:;
6341
6342 return __pyx_r;
6343}
6344
6345/* "View.MemoryView":248
6346 * return self._shape[0]
6347 *
6348 * def __getattr__(self, attr): # <<<<<<<<<<<<<<
6349 * return getattr(self.memview, attr)
6350 *
6351*/
6352
6353/* Python wrapper */
6354static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
6355static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
6356 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6357 PyObject *__pyx_r = 0;
6358 __Pyx_RefNannyDeclarations
6359 __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
6360 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6361 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
6362
6363 /* function exit code */
6364 __Pyx_RefNannyFinishContext();
6365 return __pyx_r;
6366}
6367
6368static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
6369 PyObject *__pyx_r = NULL;
6370 __Pyx_RefNannyDeclarations
6371 PyObject *__pyx_t_1 = NULL;
6372 PyObject *__pyx_t_2 = NULL;
6373 int __pyx_lineno = 0;
6374 const char *__pyx_filename = NULL;
6375 int __pyx_clineno = 0;
6376 __Pyx_RefNannySetupContext("__getattr__", 0);
6377
6378 /* "View.MemoryView":249
6379 *
6380 * def __getattr__(self, attr):
6381 * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
6382 *
6383 * def __getitem__(self, item):
6384*/
6385 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 249, __pyx_L1_error)
6386 __Pyx_GOTREF(__pyx_t_1);
6387 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
6388 __Pyx_GOTREF(__pyx_t_2);
6389 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6390 {
6391 PyObject *__pyx_temp;
6392 {
6393 __pyx_temp = __pyx_r;
6394 __pyx_r = __pyx_t_2;
6395 }
6396 __Pyx_XDECREF(__pyx_temp);
6397 }
6398 __pyx_t_2 = 0;
6399 goto __pyx_L0;
6400
6401 /* "View.MemoryView":248
6402 * return self._shape[0]
6403 *
6404 * def __getattr__(self, attr): # <<<<<<<<<<<<<<
6405 * return getattr(self.memview, attr)
6406 *
6407*/
6408
6409 /* function exit code */
6410 __pyx_L1_error:;
6411 __Pyx_XDECREF(__pyx_t_1);
6412 __Pyx_XDECREF(__pyx_t_2);
6413 __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6414 __pyx_r = NULL;
6415 __pyx_L0:;
6416 __Pyx_XGIVEREF(__pyx_r);
6417 __Pyx_RefNannyFinishContext();
6418 return __pyx_r;
6419}
6420
6421/* "View.MemoryView":251
6422 * return getattr(self.memview, attr)
6423 *
6424 * def __getitem__(self, item): # <<<<<<<<<<<<<<
6425 * return self.memview[item]
6426 *
6427*/
6428
6429/* Python wrapper */
6430static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
6431static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
6432 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6433 PyObject *__pyx_r = 0;
6434 __Pyx_RefNannyDeclarations
6435 __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
6436 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6437 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
6438
6439 /* function exit code */
6440 __Pyx_RefNannyFinishContext();
6441 return __pyx_r;
6442}
6443
6444static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
6445 PyObject *__pyx_r = NULL;
6446 __Pyx_RefNannyDeclarations
6447 PyObject *__pyx_t_1 = NULL;
6448 PyObject *__pyx_t_2 = NULL;
6449 int __pyx_lineno = 0;
6450 const char *__pyx_filename = NULL;
6451 int __pyx_clineno = 0;
6452 __Pyx_RefNannySetupContext("__getitem__", 0);
6453
6454 /* "View.MemoryView":252
6455 *
6456 * def __getitem__(self, item):
6457 * return self.memview[item] # <<<<<<<<<<<<<<
6458 *
6459 * def __setitem__(self, item, value):
6460*/
6461 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 252, __pyx_L1_error)
6462 __Pyx_GOTREF(__pyx_t_1);
6463 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 252, __pyx_L1_error)
6464 __Pyx_GOTREF(__pyx_t_2);
6465 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6466 {
6467 PyObject *__pyx_temp;
6468 {
6469 __pyx_temp = __pyx_r;
6470 __pyx_r = __pyx_t_2;
6471 }
6472 __Pyx_XDECREF(__pyx_temp);
6473 }
6474 __pyx_t_2 = 0;
6475 goto __pyx_L0;
6476
6477 /* "View.MemoryView":251
6478 * return getattr(self.memview, attr)
6479 *
6480 * def __getitem__(self, item): # <<<<<<<<<<<<<<
6481 * return self.memview[item]
6482 *
6483*/
6484
6485 /* function exit code */
6486 __pyx_L1_error:;
6487 __Pyx_XDECREF(__pyx_t_1);
6488 __Pyx_XDECREF(__pyx_t_2);
6489 __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6490 __pyx_r = NULL;
6491 __pyx_L0:;
6492 __Pyx_XGIVEREF(__pyx_r);
6493 __Pyx_RefNannyFinishContext();
6494 return __pyx_r;
6495}
6496
6497/* "View.MemoryView":254
6498 * return self.memview[item]
6499 *
6500 * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
6501 * self.memview[item] = value
6502 *
6503*/
6504
6505/* Python wrapper */
6506static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
6507static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
6508 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6509 int __pyx_r;
6510 __Pyx_RefNannyDeclarations
6511 __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
6512 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6513 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
6514
6515 /* function exit code */
6516 __Pyx_RefNannyFinishContext();
6517 return __pyx_r;
6518}
6519
6520static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
6521 int __pyx_r;
6522 __Pyx_RefNannyDeclarations
6523 PyObject *__pyx_t_1 = NULL;
6524 int __pyx_lineno = 0;
6525 const char *__pyx_filename = NULL;
6526 int __pyx_clineno = 0;
6527 __Pyx_RefNannySetupContext("__setitem__", 0);
6528
6529 /* "View.MemoryView":255
6530 *
6531 * def __setitem__(self, item, value):
6532 * self.memview[item] = value # <<<<<<<<<<<<<<
6533 *
6534 *
6535*/
6536 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 255, __pyx_L1_error)
6537 __Pyx_GOTREF(__pyx_t_1);
6538 if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0))) __PYX_ERR(1, 255, __pyx_L1_error)
6539 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6540
6541 /* "View.MemoryView":254
6542 * return self.memview[item]
6543 *
6544 * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
6545 * self.memview[item] = value
6546 *
6547*/
6548
6549 /* function exit code */
6550 __pyx_r = 0;
6551 goto __pyx_L0;
6552 __pyx_L1_error:;
6553 __Pyx_XDECREF(__pyx_t_1);
6554 __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6555 __pyx_r = -1;
6556 __pyx_L0:;
6557
6558 __Pyx_RefNannyFinishContext();
6559 return __pyx_r;
6560}
6561
6562/* "(tree fragment)":1
6563 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6564 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6565 * def __setstate_cython__(self, __pyx_state):
6566*/
6567
6568/* Python wrapper */
6569static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
6570#if CYTHON_VECTORCALL
6571PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6572#else
6573PyObject *__pyx_args, PyObject *__pyx_kwds
6574#endif
6575); /*proto*/
6576static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
6577#if CYTHON_VECTORCALL
6578PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6579#else
6580PyObject *__pyx_args, PyObject *__pyx_kwds
6581#endif
6582) {
6583 #if !CYTHON_VECTORCALL
6584 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6585 #endif
6586 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6587 PyObject *__pyx_r = 0;
6588 __Pyx_RefNannyDeclarations
6589 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6590 #if !CYTHON_VECTORCALL
6591 #if CYTHON_ASSUME_SAFE_SIZE
6592 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6593 #else
6594 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6595 #endif
6596 #endif
6597 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6598 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
6599 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6600 if (unlikely(__pyx_kwds_len < 0)) return NULL;
6601 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
6602 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
6603
6604 /* function exit code */
6605 __Pyx_RefNannyFinishContext();
6606 return __pyx_r;
6607}
6608
6609static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
6610 PyObject *__pyx_r = NULL;
6611 __Pyx_RefNannyDeclarations
6612 int __pyx_lineno = 0;
6613 const char *__pyx_filename = NULL;
6614 int __pyx_clineno = 0;
6615 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
6616
6617 /* "(tree fragment)":2
6618 * def __reduce_cython__(self):
6619 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
6620 * def __setstate_cython__(self, __pyx_state):
6621 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6622*/
6623 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
6624 __PYX_ERR(1, 2, __pyx_L1_error)
6625
6626 /* "(tree fragment)":1
6627 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6628 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6629 * def __setstate_cython__(self, __pyx_state):
6630*/
6631
6632 /* function exit code */
6633 __pyx_L1_error:;
6634 __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6635 __pyx_r = NULL;
6636 __Pyx_XGIVEREF(__pyx_r);
6637 __Pyx_RefNannyFinishContext();
6638 return __pyx_r;
6639}
6640
6641/* "(tree fragment)":3
6642 * def __reduce_cython__(self):
6643 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6644 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6645 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6646*/
6647
6648/* Python wrapper */
6649static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
6650#if CYTHON_VECTORCALL
6651PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6652#else
6653PyObject *__pyx_args, PyObject *__pyx_kwds
6654#endif
6655); /*proto*/
6656static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
6657#if CYTHON_VECTORCALL
6658PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6659#else
6660PyObject *__pyx_args, PyObject *__pyx_kwds
6661#endif
6662) {
6663 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
6664 #if !CYTHON_VECTORCALL
6665 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6666 #endif
6667 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6668 PyObject* values[1] = {0};
6669 int __pyx_lineno = 0;
6670 const char *__pyx_filename = NULL;
6671 int __pyx_clineno = 0;
6672 PyObject *__pyx_r = 0;
6673 __Pyx_RefNannyDeclarations
6674 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
6675 #if !CYTHON_VECTORCALL
6676 #if CYTHON_ASSUME_SAFE_SIZE
6677 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6678 #else
6679 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6680 #endif
6681 #endif
6682 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6683 {
6684 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
6685 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
6686 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
6687 if (__pyx_kwds_len > 0) {
6688 switch (__pyx_nargs) {
6689 case 1:
6690 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6691 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
6692 CYTHON_FALLTHROUGH;
6693 case 0: break;
6694 default: goto __pyx_L5_argtuple_error;
6695 }
6696 const Py_ssize_t kwd_pos_args = __pyx_nargs;
6697 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
6698 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
6699 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
6700 }
6701 } else if (unlikely(__pyx_nargs != 1)) {
6702 goto __pyx_L5_argtuple_error;
6703 } else {
6704 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
6705 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
6706 }
6707 __pyx_v___pyx_state = values[0];
6708 }
6709 goto __pyx_L6_skip;
6710 __pyx_L5_argtuple_error:;
6711 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
6712 __pyx_L6_skip:;
6713 goto __pyx_L4_argument_unpacking_done;
6714 __pyx_L3_error:;
6715 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6716 Py_XDECREF(values[__pyx_temp]);
6717 }
6718 __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6719 __Pyx_RefNannyFinishContext();
6720 return NULL;
6721 __pyx_L4_argument_unpacking_done:;
6722 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v___pyx_state);
6723
6724 /* function exit code */
6725 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6726 Py_XDECREF(values[__pyx_temp]);
6727 }
6728 __Pyx_RefNannyFinishContext();
6729 return __pyx_r;
6730}
6731
6732static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6733 PyObject *__pyx_r = NULL;
6734 __Pyx_RefNannyDeclarations
6735 int __pyx_lineno = 0;
6736 const char *__pyx_filename = NULL;
6737 int __pyx_clineno = 0;
6738 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
6739
6740 /* "(tree fragment)":4
6741 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6742 * def __setstate_cython__(self, __pyx_state):
6743 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
6744*/
6745 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
6746 __PYX_ERR(1, 4, __pyx_L1_error)
6747
6748 /* "(tree fragment)":3
6749 * def __reduce_cython__(self):
6750 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6751 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6752 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6753*/
6754
6755 /* function exit code */
6756 __pyx_L1_error:;
6757 __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6758 __pyx_r = NULL;
6759 __Pyx_XGIVEREF(__pyx_r);
6760 __Pyx_RefNannyFinishContext();
6761 return __pyx_r;
6762}
6763
6764/* "View.MemoryView":264
6765 * pass
6766 *
6767 * @cname("__pyx_array_allocate_buffer") # <<<<<<<<<<<<<<
6768 * cdef int _allocate_buffer(array self) except -1:
6769 *
6770*/
6771
6772static int __pyx_array_allocate_buffer(struct __pyx_array_obj *__pyx_v_self) {
6773 Py_ssize_t __pyx_v_i;
6774 PyObject **__pyx_v_p;
6775 int __pyx_r;
6776 int __pyx_t_1;
6777 Py_ssize_t __pyx_t_2;
6778 Py_ssize_t __pyx_t_3;
6779 Py_ssize_t __pyx_t_4;
6780 int __pyx_lineno = 0;
6781 const char *__pyx_filename = NULL;
6782 int __pyx_clineno = 0;
6783
6784 /* "View.MemoryView":271
6785 * cdef PyObject **p
6786 *
6787 * self.free_data = True # <<<<<<<<<<<<<<
6788 * self.data = <char *>malloc(<size_t> self.len)
6789 * if not self.data:
6790*/
6791 __pyx_v_self->free_data = 1;
6792
6793 /* "View.MemoryView":272
6794 *
6795 * self.free_data = True
6796 * self.data = <char *>malloc(<size_t> self.len) # <<<<<<<<<<<<<<
6797 * if not self.data:
6798 * raise MemoryError, "unable to allocate array data."
6799*/
6800 __pyx_v_self->data = ((char *)malloc(((size_t)__pyx_v_self->len)));
6801
6802 /* "View.MemoryView":273
6803 * self.free_data = True
6804 * self.data = <char *>malloc(<size_t> self.len)
6805 * if not self.data: # <<<<<<<<<<<<<<
6806 * raise MemoryError, "unable to allocate array data."
6807 *
6808*/
6809 __pyx_t_1 = (!(__pyx_v_self->data != 0));
6810
6811 if (unlikely(__pyx_t_1)) {
6812
6813
6814 /* "View.MemoryView":274
6815 * self.data = <char *>malloc(<size_t> self.len)
6816 * if not self.data:
6817 * raise MemoryError, "unable to allocate array data." # <<<<<<<<<<<<<<
6818 *
6819 * if self.dtype_is_object:
6820*/
6821 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_MemoryError))), __pyx_mstate_global->__pyx_kp_u_unable_to_allocate_array_data, 0, 0);
6822 __PYX_ERR(1, 274, __pyx_L1_error)
6823
6824 /* "View.MemoryView":273
6825 * self.free_data = True
6826 * self.data = <char *>malloc(<size_t> self.len)
6827 * if not self.data: # <<<<<<<<<<<<<<
6828 * raise MemoryError, "unable to allocate array data."
6829 *
6830*/
6831 }
6832
6833 /* "View.MemoryView":276
6834 * raise MemoryError, "unable to allocate array data."
6835 *
6836 * if self.dtype_is_object: # <<<<<<<<<<<<<<
6837 * p = <PyObject **> self.data
6838 * for i in range(self.len // self.itemsize):
6839*/
6840 if (__pyx_v_self->dtype_is_object) {
6841
6842 /* "View.MemoryView":277
6843 *
6844 * if self.dtype_is_object:
6845 * p = <PyObject **> self.data # <<<<<<<<<<<<<<
6846 * for i in range(self.len // self.itemsize):
6847 * p[i] = Py_None
6848*/
6849 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
6850
6851 /* "View.MemoryView":278
6852 * if self.dtype_is_object:
6853 * p = <PyObject **> self.data
6854 * for i in range(self.len // self.itemsize): # <<<<<<<<<<<<<<
6855 * p[i] = Py_None
6856 * Py_INCREF(Py_None)
6857*/
6858 if (unlikely(__pyx_v_self->itemsize == 0)) {
6859 PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
6860 __PYX_ERR(1, 278, __pyx_L1_error)
6861 }
6862 else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_self->itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
6863 PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
6864 __PYX_ERR(1, 278, __pyx_L1_error)
6865 }
6866
6867 __pyx_t_2 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_self->itemsize, 0);
6868 __pyx_t_3 = __pyx_t_2;
6869
6870 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
6871 __pyx_v_i = __pyx_t_4;
6872
6873 /* "View.MemoryView":279
6874 * p = <PyObject **> self.data
6875 * for i in range(self.len // self.itemsize):
6876 * p[i] = Py_None # <<<<<<<<<<<<<<
6877 * Py_INCREF(Py_None)
6878 * return 0
6879*/
6880 (__pyx_v_p[__pyx_v_i]) = Py_None;
6881
6882 /* "View.MemoryView":280
6883 * for i in range(self.len // self.itemsize):
6884 * p[i] = Py_None
6885 * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
6886 * return 0
6887 *
6888*/
6889 Py_INCREF(Py_None);
6890 }
6891
6892
6893 /* "View.MemoryView":276
6894 * raise MemoryError, "unable to allocate array data."
6895 *
6896 * if self.dtype_is_object: # <<<<<<<<<<<<<<
6897 * p = <PyObject **> self.data
6898 * for i in range(self.len // self.itemsize):
6899*/
6900 }
6901
6902 /* "View.MemoryView":281
6903 * p[i] = Py_None
6904 * Py_INCREF(Py_None)
6905 * return 0 # <<<<<<<<<<<<<<
6906 *
6907 *
6908*/
6909 {
6910
6911 __pyx_r = 0;
6912 }
6913 goto __pyx_L0;
6914
6915 /* "View.MemoryView":264
6916 * pass
6917 *
6918 * @cname("__pyx_array_allocate_buffer") # <<<<<<<<<<<<<<
6919 * cdef int _allocate_buffer(array self) except -1:
6920 *
6921*/
6922
6923 /* function exit code */
6924 __pyx_L1_error:;
6925 __Pyx_AddTraceback("View.MemoryView._allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
6926 __pyx_r = -1;
6927 __pyx_L0:;
6928
6929
6930
6931 return __pyx_r;
6932}
6933
6934/* "View.MemoryView":284
6935 *
6936 *
6937 * @cname("__pyx_array_new") # <<<<<<<<<<<<<<
6938 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
6939 * cdef array result
6940*/
6941
6942static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char const *__pyx_v_c_mode, char *__pyx_v_buf) {
6943 struct __pyx_array_obj *__pyx_v_result = 0;
6944 PyObject *__pyx_v_mode = 0;
6945 struct __pyx_array_obj *__pyx_r = NULL;
6946 __Pyx_RefNannyDeclarations
6947 PyObject *__pyx_t_1 = NULL;
6948 int __pyx_t_2;
6949 PyObject *__pyx_t_3 = NULL;
6950 PyObject *__pyx_t_4 = NULL;
6951 int __pyx_lineno = 0;
6952 const char *__pyx_filename = NULL;
6953 int __pyx_clineno = 0;
6954 __Pyx_RefNannySetupContext("array_cwrapper", 0);
6955
6956 /* "View.MemoryView":287
6957 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
6958 * cdef array result
6959 * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string. # <<<<<<<<<<<<<<
6960 *
6961 * if buf is NULL:
6962*/
6963 __pyx_t_2 = ((__pyx_v_c_mode[0]) == 'f');
6964
6965 if (__pyx_t_2) {
6966 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_fortran);
6967 __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_fortran;
6968 } else {
6969 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_c);
6970 __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_c;
6971 }
6972
6973 __pyx_v_mode = ((PyObject*)__pyx_t_1);
6974 __pyx_t_1 = 0;
6975
6976 /* "View.MemoryView":289
6977 * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
6978 *
6979 * if buf is NULL: # <<<<<<<<<<<<<<
6980 * result = array.__new__(array, shape, itemsize, format, mode)
6981 * else:
6982*/
6983 __pyx_t_2 = (__pyx_v_buf == NULL);
6984
6985 if (__pyx_t_2) {
6986
6987
6988 /* "View.MemoryView":290
6989 *
6990 * if buf is NULL:
6991 * result = array.__new__(array, shape, itemsize, format, mode) # <<<<<<<<<<<<<<
6992 * else:
6993 * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
6994*/
6995 __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 290, __pyx_L1_error)
6996 __Pyx_GOTREF(__pyx_t_1);
6997 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 290, __pyx_L1_error)
6998 __Pyx_GOTREF(__pyx_t_3);
6999 __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 290, __pyx_L1_error)
7000 __Pyx_GOTREF(__pyx_t_4);
7001 __Pyx_INCREF(__pyx_v_shape);
7002 __Pyx_GIVEREF(__pyx_v_shape);
7003 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
7004 __Pyx_GIVEREF(__pyx_t_1);
7005 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
7006 __Pyx_GIVEREF(__pyx_t_3);
7007 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
7008 __Pyx_INCREF(__pyx_v_mode);
7009 __Pyx_GIVEREF(__pyx_v_mode);
7010 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_mode) != (0)) __PYX_ERR(1, 290, __pyx_L1_error);
7011 __pyx_t_1 = 0;
7012 __pyx_t_3 = 0;
7013 __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_mstate_global->__pyx_array_type), __pyx_t_4, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 290, __pyx_L1_error)
7014 __Pyx_GOTREF(__pyx_t_3);
7015 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7016 __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
7017 __pyx_t_3 = 0;
7018
7019 /* "View.MemoryView":289
7020 * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
7021 *
7022 * if buf is NULL: # <<<<<<<<<<<<<<
7023 * result = array.__new__(array, shape, itemsize, format, mode)
7024 * else:
7025*/
7026 goto __pyx_L3;
7027 }
7028
7029 /* "View.MemoryView":292
7030 * result = array.__new__(array, shape, itemsize, format, mode)
7031 * else:
7032 * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False) # <<<<<<<<<<<<<<
7033 * result.data = buf
7034 *
7035*/
7036 /*else*/ {
7037 __pyx_t_3 = PyLong_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 292, __pyx_L1_error)
7038 __Pyx_GOTREF(__pyx_t_3);
7039 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 292, __pyx_L1_error)
7040 __Pyx_GOTREF(__pyx_t_4);
7041 __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
7042 __Pyx_GOTREF(__pyx_t_1);
7043 __Pyx_INCREF(__pyx_v_shape);
7044 __Pyx_GIVEREF(__pyx_v_shape);
7045 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_shape) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
7046 __Pyx_GIVEREF(__pyx_t_3);
7047 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
7048 __Pyx_GIVEREF(__pyx_t_4);
7049 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
7050 __Pyx_INCREF(__pyx_v_mode);
7051 __Pyx_GIVEREF(__pyx_v_mode);
7052 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_mode) != (0)) __PYX_ERR(1, 292, __pyx_L1_error);
7053 __pyx_t_3 = 0;
7054 __pyx_t_4 = 0;
7055 __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 292, __pyx_L1_error)
7056 __Pyx_GOTREF(__pyx_t_4);
7057 if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_allocate_buffer, Py_False) < (0)) __PYX_ERR(1, 292, __pyx_L1_error)
7058 __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_mstate_global->__pyx_array_type), __pyx_t_1, __pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 292, __pyx_L1_error)
7059 __Pyx_GOTREF(__pyx_t_3);
7060 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7061 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7062 __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
7063 __pyx_t_3 = 0;
7064
7065 /* "View.MemoryView":293
7066 * else:
7067 * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
7068 * result.data = buf # <<<<<<<<<<<<<<
7069 *
7070 * return result
7071*/
7072 __pyx_v_result->data = __pyx_v_buf;
7073 }
7074 __pyx_L3:;
7075
7076 /* "View.MemoryView":295
7077 * result.data = buf
7078 *
7079 * return result # <<<<<<<<<<<<<<
7080 *
7081 *
7082*/
7083 {
7084 struct __pyx_array_obj *__pyx_temp;
7085 {
7086 __pyx_temp = __pyx_r;
7087 __Pyx_INCREF((PyObject *)__pyx_v_result);
7088 __pyx_r = __pyx_v_result;
7089 }
7090 __Pyx_XDECREF((PyObject *)__pyx_temp);
7091 }
7092 goto __pyx_L0;
7093
7094 /* "View.MemoryView":284
7095 *
7096 *
7097 * @cname("__pyx_array_new") # <<<<<<<<<<<<<<
7098 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
7099 * cdef array result
7100*/
7101
7102 /* function exit code */
7103 __pyx_L1_error:;
7104 __Pyx_XDECREF(__pyx_t_1);
7105 __Pyx_XDECREF(__pyx_t_3);
7106 __Pyx_XDECREF(__pyx_t_4);
7107 __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
7108 __pyx_r = 0;
7109 __pyx_L0:;
7110 __Pyx_XDECREF((PyObject *)__pyx_v_result);
7111 __Pyx_XDECREF(__pyx_v_mode);
7112 __Pyx_XGIVEREF((PyObject *)__pyx_r);
7113 __Pyx_RefNannyFinishContext();
7114 return __pyx_r;
7115}
7116
7117/* "View.MemoryView":321
7118 * cdef class Enum(object):
7119 * cdef object name
7120 * def __init__(self, name): # <<<<<<<<<<<<<<
7121 * self.name = name
7122 * def __repr__(self):
7123*/
7124
7125/* Python wrapper */
7126static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self,
7127#if CYTHON_VECTORCALL_TPNEW
7128PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7129#else
7130PyObject *__pyx_args, PyObject *__pyx_kwds
7131#endif
7132); /*proto*/
7133static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self,
7134#if CYTHON_VECTORCALL_TPNEW
7135PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7136#else
7137PyObject *__pyx_args, PyObject *__pyx_kwds
7138#endif
7139) {
7140 PyObject *__pyx_v_name = 0;
7141 #if !CYTHON_VECTORCALL_TPNEW
7142 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7143 #endif
7144 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7145 PyObject* values[1] = {0};
7146 int __pyx_lineno = 0;
7147 const char *__pyx_filename = NULL;
7148 int __pyx_clineno = 0;
7149 int __pyx_r;
7150 __Pyx_RefNannyDeclarations
7151 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
7152 #if !CYTHON_VECTORCALL_TPNEW
7153 #if CYTHON_ASSUME_SAFE_SIZE
7154 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7155 #else
7156 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
7157 #endif
7158 #endif
7159 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
7160 {
7161 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
7162 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
7163 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 321, __pyx_L3_error)
7164 if (__pyx_kwds_len > 0) {
7165 switch (__pyx_nargs) {
7166 case 1:
7167 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
7168 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 321, __pyx_L3_error)
7169 CYTHON_FALLTHROUGH;
7170 case 0: break;
7171 default: goto __pyx_L5_argtuple_error;
7172 }
7173 const Py_ssize_t kwd_pos_args = __pyx_nargs;
7174 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(1, 321, __pyx_L3_error)
7175 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
7176 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, i); __PYX_ERR(1, 321, __pyx_L3_error) }
7177 }
7178 } else if (unlikely(__pyx_nargs != 1)) {
7179 goto __pyx_L5_argtuple_error;
7180 } else {
7181 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
7182 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 321, __pyx_L3_error)
7183 }
7184 __pyx_v_name = values[0];
7185 }
7186 goto __pyx_L6_skip;
7187 __pyx_L5_argtuple_error:;
7188 __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 321, __pyx_L3_error)
7189 __pyx_L6_skip:;
7190 goto __pyx_L4_argument_unpacking_done;
7191 __pyx_L3_error:;
7192 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7193 Py_XDECREF(values[__pyx_temp]);
7194 }
7195 __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7196 __Pyx_RefNannyFinishContext();
7197 return -1;
7198 __pyx_L4_argument_unpacking_done:;
7199 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
7200
7201 /* function exit code */
7202 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7203 Py_XDECREF(values[__pyx_temp]);
7204 }
7205 __Pyx_RefNannyFinishContext();
7206 return __pyx_r;
7207}
7208
7209static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
7210 int __pyx_r;
7211 __Pyx_RefNannyDeclarations
7212 __Pyx_RefNannySetupContext("__init__", 0);
7213
7214 /* "View.MemoryView":322
7215 * cdef object name
7216 * def __init__(self, name):
7217 * self.name = name # <<<<<<<<<<<<<<
7218 * def __repr__(self):
7219 * return self.name
7220*/
7221 __Pyx_INCREF(__pyx_v_name);
7222 __Pyx_GIVEREF(__pyx_v_name);
7223 __Pyx_GOTREF(__pyx_v_self->name);
7224 __Pyx_DECREF(__pyx_v_self->name);
7225 __pyx_v_self->name = __pyx_v_name;
7226
7227 /* "View.MemoryView":321
7228 * cdef class Enum(object):
7229 * cdef object name
7230 * def __init__(self, name): # <<<<<<<<<<<<<<
7231 * self.name = name
7232 * def __repr__(self):
7233*/
7234
7235 /* function exit code */
7236 __pyx_r = 0;
7237
7238 __Pyx_RefNannyFinishContext();
7239 return __pyx_r;
7240}
7241
7242/* "View.MemoryView":323
7243 * def __init__(self, name):
7244 * self.name = name
7245 * def __repr__(self): # <<<<<<<<<<<<<<
7246 * return self.name
7247 *
7248*/
7249
7250/* Python wrapper */
7251static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
7252static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
7253 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7254 PyObject *__pyx_r = 0;
7255 __Pyx_RefNannyDeclarations
7256 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
7257 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7258 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
7259
7260 /* function exit code */
7261 __Pyx_RefNannyFinishContext();
7262 return __pyx_r;
7263}
7264
7265static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
7266 PyObject *__pyx_r = NULL;
7267 __Pyx_RefNannyDeclarations
7268 __Pyx_RefNannySetupContext("__repr__", 0);
7269
7270 /* "View.MemoryView":324
7271 * self.name = name
7272 * def __repr__(self):
7273 * return self.name # <<<<<<<<<<<<<<
7274 *
7275 * cdef generic = Enum("<strided and direct or indirect>")
7276*/
7277 {
7278 PyObject *__pyx_temp;
7279 {
7280 __pyx_temp = __pyx_r;
7281 __Pyx_INCREF(__pyx_v_self->name);
7282 __pyx_r = __pyx_v_self->name;
7283 }
7284 __Pyx_XDECREF(__pyx_temp);
7285 }
7286 goto __pyx_L0;
7287
7288 /* "View.MemoryView":323
7289 * def __init__(self, name):
7290 * self.name = name
7291 * def __repr__(self): # <<<<<<<<<<<<<<
7292 * return self.name
7293 *
7294*/
7295
7296 /* function exit code */
7297 __pyx_L0:;
7298 __Pyx_XGIVEREF(__pyx_r);
7299 __Pyx_RefNannyFinishContext();
7300 return __pyx_r;
7301}
7302
7303/* "(tree fragment)":1
7304 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7305 * cdef tuple state
7306 * cdef object _dict
7307*/
7308
7309/* Python wrapper */
7310static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
7311#if CYTHON_VECTORCALL
7312PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7313#else
7314PyObject *__pyx_args, PyObject *__pyx_kwds
7315#endif
7316); /*proto*/
7317static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
7318#if CYTHON_VECTORCALL
7319PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7320#else
7321PyObject *__pyx_args, PyObject *__pyx_kwds
7322#endif
7323) {
7324 #if !CYTHON_VECTORCALL
7325 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7326 #endif
7327 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7328 PyObject *__pyx_r = 0;
7329 __Pyx_RefNannyDeclarations
7330 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
7331 #if !CYTHON_VECTORCALL
7332 #if CYTHON_ASSUME_SAFE_SIZE
7333 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7334 #else
7335 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7336 #endif
7337 #endif
7338 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7339 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
7340 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
7341 if (unlikely(__pyx_kwds_len < 0)) return NULL;
7342 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
7343 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
7344
7345 /* function exit code */
7346 __Pyx_RefNannyFinishContext();
7347 return __pyx_r;
7348}
7349
7350static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
7351 PyObject *__pyx_v_state = 0;
7352 PyObject *__pyx_v__dict = 0;
7353 int __pyx_v_use_setstate;
7354 PyObject *__pyx_r = NULL;
7355 __Pyx_RefNannyDeclarations
7356 PyObject *__pyx_t_1 = NULL;
7357 PyObject *__pyx_t_2 = NULL;
7358 int __pyx_t_3;
7359 int __pyx_t_4;
7360 PyObject *__pyx_t_5 = NULL;
7361 int __pyx_lineno = 0;
7362 const char *__pyx_filename = NULL;
7363 int __pyx_clineno = 0;
7364 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
7365
7366 /* "(tree fragment)":5
7367 * cdef object _dict
7368 * cdef bint use_setstate
7369 * with CRITICAL_SECTION(self): # <<<<<<<<<<<<<<
7370 * state = (self.name,)
7371 * _dict = getattr(self, '__dict__', None)
7372*/
7373 {
7374 __Pyx_PyCriticalSection __pyx_cs;
7375 __pyx_t_1 = ((PyObject *)__pyx_v_self);
7376 __Pyx_INCREF(__pyx_t_1);
7377 __Pyx_PyCriticalSection_Begin(&__pyx_cs, (PyObject*)__pyx_t_1);
7378 /*try:*/ {
7379
7380 /* "(tree fragment)":6
7381 * cdef bint use_setstate
7382 * with CRITICAL_SECTION(self):
7383 * state = (self.name,) # <<<<<<<<<<<<<<
7384 * _dict = getattr(self, '__dict__', None)
7385 * if _dict is not None and _dict:
7386*/
7387 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L4_error)
7388 __Pyx_GOTREF(__pyx_t_2);
7389 __Pyx_INCREF(__pyx_v_self->name);
7390 __Pyx_GIVEREF(__pyx_v_self->name);
7391 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->name) != (0)) __PYX_ERR(1, 6, __pyx_L4_error);
7392 __pyx_v_state = ((PyObject*)__pyx_t_2);
7393 __pyx_t_2 = 0;
7394
7395 /* "(tree fragment)":7
7396 * with CRITICAL_SECTION(self):
7397 * state = (self.name,)
7398 * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
7399 * if _dict is not None and _dict:
7400 * state += (_dict,)
7401*/
7402 __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L4_error)
7403 __Pyx_GOTREF(__pyx_t_2);
7404 __pyx_v__dict = __pyx_t_2;
7405 __pyx_t_2 = 0;
7406 }
7407
7408 /* "(tree fragment)":5
7409 * cdef object _dict
7410 * cdef bint use_setstate
7411 * with CRITICAL_SECTION(self): # <<<<<<<<<<<<<<
7412 * state = (self.name,)
7413 * _dict = getattr(self, '__dict__', None)
7414*/
7415 /*finally:*/ {
7416 /*normal exit:*/{
7417 __Pyx_PyCriticalSection_End(&__pyx_cs);
7418 goto __pyx_L5;
7419 }
7420 __pyx_L4_error: {
7421 __Pyx_PyCriticalSection_End(&__pyx_cs);
7422 goto __pyx_L1_error;
7423 }
7424 __pyx_L5:;
7425 }
7426 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7427 }
7428
7429 /* "(tree fragment)":8
7430 * state = (self.name,)
7431 * _dict = getattr(self, '__dict__', None)
7432 * if _dict is not None and _dict: # <<<<<<<<<<<<<<
7433 * state += (_dict,)
7434 * use_setstate = True
7435*/
7436 __pyx_t_4 = (__pyx_v__dict != Py_None);
7437 if (__pyx_t_4) {
7438
7439 } else {
7440
7441 __pyx_t_3 = __pyx_t_4;
7442
7443 goto __pyx_L7_bool_binop_done;
7444 }
7445 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 8, __pyx_L1_error)
7446
7447 __pyx_t_3 = __pyx_t_4;
7448
7449 __pyx_L7_bool_binop_done:;
7450 if (__pyx_t_3) {
7451
7452
7453 /* "(tree fragment)":9
7454 * _dict = getattr(self, '__dict__', None)
7455 * if _dict is not None and _dict:
7456 * state += (_dict,) # <<<<<<<<<<<<<<
7457 * use_setstate = True
7458 * else:
7459*/
7460 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
7461 __Pyx_GOTREF(__pyx_t_1);
7462 __Pyx_INCREF(__pyx_v__dict);
7463 __Pyx_GIVEREF(__pyx_v__dict);
7464 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict) != (0)) __PYX_ERR(1, 9, __pyx_L1_error);
7465 __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
7466 __Pyx_GOTREF(__pyx_t_2);
7467 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7468 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
7469 __pyx_t_2 = 0;
7470
7471 /* "(tree fragment)":10
7472 * if _dict is not None and _dict:
7473 * state += (_dict,)
7474 * use_setstate = True # <<<<<<<<<<<<<<
7475 * else:
7476 * use_setstate = self.name is not None
7477*/
7478 __pyx_v_use_setstate = 1;
7479
7480 /* "(tree fragment)":8
7481 * state = (self.name,)
7482 * _dict = getattr(self, '__dict__', None)
7483 * if _dict is not None and _dict: # <<<<<<<<<<<<<<
7484 * state += (_dict,)
7485 * use_setstate = True
7486*/
7487 goto __pyx_L6;
7488 }
7489
7490 /* "(tree fragment)":12
7491 * use_setstate = True
7492 * else:
7493 * use_setstate = self.name is not None # <<<<<<<<<<<<<<
7494 * if use_setstate:
7495 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7496*/
7497 /*else*/ {
7498 __pyx_t_3 = (__pyx_v_self->name != Py_None);
7499 __pyx_v_use_setstate = __pyx_t_3;
7500 }
7501 __pyx_L6:;
7502
7503 /* "(tree fragment)":13
7504 * else:
7505 * use_setstate = self.name is not None
7506 * if use_setstate: # <<<<<<<<<<<<<<
7507 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7508 * else:
7509*/
7510 if (__pyx_v_use_setstate) {
7511
7512 /* "(tree fragment)":14
7513 * use_setstate = self.name is not None
7514 * if use_setstate:
7515 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state # <<<<<<<<<<<<<<
7516 * else:
7517 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7518*/
7519 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 14, __pyx_L1_error)
7520 __Pyx_GOTREF(__pyx_t_2);
7521 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
7522 __Pyx_GOTREF(__pyx_t_1);
7523 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7524 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7525 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7526 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_136983863);
7527 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_136983863);
7528 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_136983863) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7529 __Pyx_INCREF(Py_None);
7530 __Pyx_GIVEREF(Py_None);
7531 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7532 __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error)
7533 __Pyx_GOTREF(__pyx_t_5);
7534 __Pyx_GIVEREF(__pyx_t_2);
7535 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7536 __Pyx_GIVEREF(__pyx_t_1);
7537 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7538 __Pyx_INCREF(__pyx_v_state);
7539 __Pyx_GIVEREF(__pyx_v_state);
7540 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 14, __pyx_L1_error);
7541 __pyx_t_2 = 0;
7542 __pyx_t_1 = 0;
7543 {
7544 PyObject *__pyx_temp;
7545 {
7546 __pyx_temp = __pyx_r;
7547 __pyx_r = __pyx_t_5;
7548 }
7549 __Pyx_XDECREF(__pyx_temp);
7550 }
7551 __pyx_t_5 = 0;
7552 goto __pyx_L0;
7553
7554 /* "(tree fragment)":13
7555 * else:
7556 * use_setstate = self.name is not None
7557 * if use_setstate: # <<<<<<<<<<<<<<
7558 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7559 * else:
7560*/
7561 }
7562
7563 /* "(tree fragment)":16
7564 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7565 * else:
7566 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state) # <<<<<<<<<<<<<<
7567 * def __setstate_cython__(self, __pyx_state):
7568 * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7569*/
7570 /*else*/ {
7571 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 16, __pyx_L1_error)
7572 __Pyx_GOTREF(__pyx_t_5);
7573 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
7574 __Pyx_GOTREF(__pyx_t_1);
7575 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7576 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7577 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7578 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_136983863);
7579 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_136983863);
7580 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_136983863) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7581 __Pyx_INCREF(__pyx_v_state);
7582 __Pyx_GIVEREF(__pyx_v_state);
7583 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7584 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error)
7585 __Pyx_GOTREF(__pyx_t_2);
7586 __Pyx_GIVEREF(__pyx_t_5);
7587 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7588 __Pyx_GIVEREF(__pyx_t_1);
7589 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1) != (0)) __PYX_ERR(1, 16, __pyx_L1_error);
7590 __pyx_t_5 = 0;
7591 __pyx_t_1 = 0;
7592 {
7593 PyObject *__pyx_temp;
7594 {
7595 __pyx_temp = __pyx_r;
7596 __pyx_r = __pyx_t_2;
7597 }
7598 __Pyx_XDECREF(__pyx_temp);
7599 }
7600 __pyx_t_2 = 0;
7601 goto __pyx_L0;
7602 }
7603
7604 /* "(tree fragment)":1
7605 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7606 * cdef tuple state
7607 * cdef object _dict
7608*/
7609
7610 /* function exit code */
7611 __pyx_L1_error:;
7612 __Pyx_XDECREF(__pyx_t_1);
7613 __Pyx_XDECREF(__pyx_t_2);
7614 __Pyx_XDECREF(__pyx_t_5);
7615 __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7616 __pyx_r = NULL;
7617 __pyx_L0:;
7618 __Pyx_XDECREF(__pyx_v_state);
7619 __Pyx_XDECREF(__pyx_v__dict);
7620
7621 __Pyx_XGIVEREF(__pyx_r);
7622 __Pyx_RefNannyFinishContext();
7623 return __pyx_r;
7624}
7625
7626/* "(tree fragment)":17
7627 * else:
7628 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7629 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7630 * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7631*/
7632
7633/* Python wrapper */
7634static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
7635#if CYTHON_VECTORCALL
7636PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7637#else
7638PyObject *__pyx_args, PyObject *__pyx_kwds
7639#endif
7640); /*proto*/
7641static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
7642#if CYTHON_VECTORCALL
7643PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7644#else
7645PyObject *__pyx_args, PyObject *__pyx_kwds
7646#endif
7647) {
7648 PyObject *__pyx_v___pyx_state = 0;
7649 #if !CYTHON_VECTORCALL
7650 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7651 #endif
7652 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7653 PyObject* values[1] = {0};
7654 int __pyx_lineno = 0;
7655 const char *__pyx_filename = NULL;
7656 int __pyx_clineno = 0;
7657 PyObject *__pyx_r = 0;
7658 __Pyx_RefNannyDeclarations
7659 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
7660 #if !CYTHON_VECTORCALL
7661 #if CYTHON_ASSUME_SAFE_SIZE
7662 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7663 #else
7664 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7665 #endif
7666 #endif
7667 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7668 {
7669 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
7670 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
7671 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 17, __pyx_L3_error)
7672 if (__pyx_kwds_len > 0) {
7673 switch (__pyx_nargs) {
7674 case 1:
7675 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
7676 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 17, __pyx_L3_error)
7677 CYTHON_FALLTHROUGH;
7678 case 0: break;
7679 default: goto __pyx_L5_argtuple_error;
7680 }
7681 const Py_ssize_t kwd_pos_args = __pyx_nargs;
7682 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 17, __pyx_L3_error)
7683 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
7684 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 17, __pyx_L3_error) }
7685 }
7686 } else if (unlikely(__pyx_nargs != 1)) {
7687 goto __pyx_L5_argtuple_error;
7688 } else {
7689 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
7690 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 17, __pyx_L3_error)
7691 }
7692 __pyx_v___pyx_state = values[0];
7693 }
7694 goto __pyx_L6_skip;
7695 __pyx_L5_argtuple_error:;
7696 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 17, __pyx_L3_error)
7697 __pyx_L6_skip:;
7698 goto __pyx_L4_argument_unpacking_done;
7699 __pyx_L3_error:;
7700 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7701 Py_XDECREF(values[__pyx_temp]);
7702 }
7703 __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7704 __Pyx_RefNannyFinishContext();
7705 return NULL;
7706 __pyx_L4_argument_unpacking_done:;
7707 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v___pyx_state);
7708
7709 /* function exit code */
7710 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7711 Py_XDECREF(values[__pyx_temp]);
7712 }
7713 __Pyx_RefNannyFinishContext();
7714 return __pyx_r;
7715}
7716
7717static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7718 PyObject *__pyx_r = NULL;
7719 __Pyx_RefNannyDeclarations
7720 PyObject *__pyx_t_1 = NULL;
7721 PyObject *__pyx_t_2 = NULL;
7722 int __pyx_lineno = 0;
7723 const char *__pyx_filename = NULL;
7724 int __pyx_clineno = 0;
7725 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
7726
7727 /* "(tree fragment)":18
7728 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7729 * def __setstate_cython__(self, __pyx_state):
7730 * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
7731*/
7732 __pyx_t_1 = __pyx_v___pyx_state;
7733 __Pyx_INCREF(__pyx_t_1);
7734 if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(1, 18, __pyx_L1_error)
7735 if (unlikely(__pyx_t_1 == Py_None)) {
7736 PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
7737 __PYX_ERR(1, 18, __pyx_L1_error)
7738 }
7739 __pyx_t_2 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 18, __pyx_L1_error)
7740 __Pyx_GOTREF(__pyx_t_2);
7741 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7742 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7743
7744 /* "(tree fragment)":17
7745 * else:
7746 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7747 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7748 * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7749*/
7750
7751 /* function exit code */
7752 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7753 goto __pyx_L0;
7754 __pyx_L1_error:;
7755 __Pyx_XDECREF(__pyx_t_1);
7756 __Pyx_XDECREF(__pyx_t_2);
7757 __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7758 __pyx_r = NULL;
7759 __pyx_L0:;
7760 __Pyx_XGIVEREF(__pyx_r);
7761 __Pyx_RefNannyFinishContext();
7762 return __pyx_r;
7763}
7764
7765/* "View.MemoryView":367
7766 * cdef const __Pyx_TypeInfo *typeinfo
7767 *
7768 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
7769 * self.obj = obj
7770 * self.flags = flags
7771*/
7772
7773/* Python wrapper */
7774static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self,
7775#if CYTHON_VECTORCALL_TPNEW
7776PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7777#else
7778PyObject *__pyx_args, PyObject *__pyx_kwds
7779#endif
7780); /*proto*/
7781static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self,
7782#if CYTHON_VECTORCALL_TPNEW
7783PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7784#else
7785PyObject *__pyx_args, PyObject *__pyx_kwds
7786#endif
7787) {
7788 PyObject *__pyx_v_obj = 0;
7789 int __pyx_v_flags;
7790 int __pyx_v_dtype_is_object;
7791 #if !CYTHON_VECTORCALL_TPNEW
7792 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7793 #endif
7794 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7795 PyObject* values[3] = {0,0,0};
7796 int __pyx_lineno = 0;
7797 const char *__pyx_filename = NULL;
7798 int __pyx_clineno = 0;
7799 int __pyx_r;
7800 __Pyx_RefNannyDeclarations
7801 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
7802 #if !CYTHON_VECTORCALL_TPNEW
7803 #if CYTHON_ASSUME_SAFE_SIZE
7804 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7805 #else
7806 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
7807 #endif
7808 #endif
7809 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
7810 {
7811 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_obj,&__pyx_mstate_global->__pyx_n_u_flags,&__pyx_mstate_global->__pyx_n_u_dtype_is_object,0};
7812 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL_TPNEW(__pyx_kwds) : 0;
7813 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 367, __pyx_L3_error)
7814 if (__pyx_kwds_len > 0) {
7815 switch (__pyx_nargs) {
7816 case 3:
7817 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
7818 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 367, __pyx_L3_error)
7819 CYTHON_FALLTHROUGH;
7820 case 2:
7821 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
7822 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 367, __pyx_L3_error)
7823 CYTHON_FALLTHROUGH;
7824 case 1:
7825 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
7826 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 367, __pyx_L3_error)
7827 CYTHON_FALLTHROUGH;
7828 case 0: break;
7829 default: goto __pyx_L5_argtuple_error;
7830 }
7831 const Py_ssize_t kwd_pos_args = __pyx_nargs;
7832 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(1, 367, __pyx_L3_error)
7833 for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
7834 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, i); __PYX_ERR(1, 367, __pyx_L3_error) }
7835 }
7836 } else {
7837 switch (__pyx_nargs) {
7838 case 3:
7839 values[2] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 2);
7840 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 367, __pyx_L3_error)
7841 CYTHON_FALLTHROUGH;
7842 case 2:
7843 values[1] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 1);
7844 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 367, __pyx_L3_error)
7845 values[0] = __Pyx_ArgRef_FASTCALL_TPNEW(__pyx_args, 0);
7846 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 367, __pyx_L3_error)
7847 break;
7848 default: goto __pyx_L5_argtuple_error;
7849 }
7850 }
7851 __pyx_v_obj = values[0];
7852 __pyx_v_flags = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 367, __pyx_L3_error)
7853 if (values[2]) {
7854 __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 367, __pyx_L3_error)
7855 } else {
7856 __pyx_v_dtype_is_object = ((int)0);
7857 }
7858 }
7859 goto __pyx_L6_skip;
7860 __pyx_L5_argtuple_error:;
7861 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, __pyx_nargs); __PYX_ERR(1, 367, __pyx_L3_error)
7862 __pyx_L6_skip:;
7863 goto __pyx_L4_argument_unpacking_done;
7864 __pyx_L3_error:;
7865 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7866 Py_XDECREF(values[__pyx_temp]);
7867 }
7868 __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7869 __Pyx_RefNannyFinishContext();
7870 return -1;
7871 __pyx_L4_argument_unpacking_done:;
7872 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
7873
7874 /* function exit code */
7875 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7876 Py_XDECREF(values[__pyx_temp]);
7877 }
7878
7879
7880 __Pyx_RefNannyFinishContext();
7881 return __pyx_r;
7882}
7883
7884static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
7885 int __pyx_r;
7886 __Pyx_RefNannyDeclarations
7887 int __pyx_t_1;
7888 int __pyx_t_2;
7889 int __pyx_t_3;
7890 int __pyx_lineno = 0;
7891 const char *__pyx_filename = NULL;
7892 int __pyx_clineno = 0;
7893 __Pyx_RefNannySetupContext("__cinit__", 0);
7894
7895 /* "View.MemoryView":368
7896 *
7897 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
7898 * self.obj = obj # <<<<<<<<<<<<<<
7899 * self.flags = flags
7900 * if type(self) is memoryview or obj is not None:
7901*/
7902 __Pyx_INCREF(__pyx_v_obj);
7903 __Pyx_GIVEREF(__pyx_v_obj);
7904 __Pyx_GOTREF(__pyx_v_self->obj);
7905 __Pyx_DECREF(__pyx_v_self->obj);
7906 __pyx_v_self->obj = __pyx_v_obj;
7907
7908 /* "View.MemoryView":369
7909 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
7910 * self.obj = obj
7911 * self.flags = flags # <<<<<<<<<<<<<<
7912 * if type(self) is memoryview or obj is not None:
7913 * PyObject_GetBuffer(obj, &self.view, flags)
7914*/
7915 __pyx_v_self->flags = __pyx_v_flags;
7916
7917 /* "View.MemoryView":370
7918 * self.obj = obj
7919 * self.flags = flags
7920 * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
7921 * PyObject_GetBuffer(obj, &self.view, flags)
7922 * if <PyObject *> self.view.obj == NULL:
7923*/
7924 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_mstate_global->__pyx_memoryview_type));
7925 if (!__pyx_t_2) {
7926
7927 } else {
7928
7929 __pyx_t_1 = __pyx_t_2;
7930
7931 goto __pyx_L4_bool_binop_done;
7932 }
7933 __pyx_t_2 = (__pyx_v_obj != Py_None);
7934
7935 __pyx_t_1 = __pyx_t_2;
7936
7937 __pyx_L4_bool_binop_done:;
7938 if (__pyx_t_1) {
7939
7940
7941 /* "View.MemoryView":371
7942 * self.flags = flags
7943 * if type(self) is memoryview or obj is not None:
7944 * PyObject_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
7945 * if <PyObject *> self.view.obj == NULL:
7946 * (<__pyx_buffer *> &self.view).obj = Py_None
7947*/
7948 __pyx_t_3 = PyObject_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 371, __pyx_L1_error)
7949
7950
7951 /* "View.MemoryView":372
7952 * if type(self) is memoryview or obj is not None:
7953 * PyObject_GetBuffer(obj, &self.view, flags)
7954 * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
7955 * (<__pyx_buffer *> &self.view).obj = Py_None
7956 * Py_INCREF(Py_None)
7957*/
7958 __pyx_t_1 = (((PyObject *)__pyx_v_self->view.obj) == NULL);
7959
7960 if (__pyx_t_1) {
7961
7962
7963 /* "View.MemoryView":373
7964 * PyObject_GetBuffer(obj, &self.view, flags)
7965 * if <PyObject *> self.view.obj == NULL:
7966 * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
7967 * Py_INCREF(Py_None)
7968 *
7969*/
7970 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
7971
7972 /* "View.MemoryView":374
7973 * if <PyObject *> self.view.obj == NULL:
7974 * (<__pyx_buffer *> &self.view).obj = Py_None
7975 * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
7976 *
7977 * if not __PYX_CYTHON_ATOMICS_ENABLED():
7978*/
7979 Py_INCREF(Py_None);
7980
7981 /* "View.MemoryView":372
7982 * if type(self) is memoryview or obj is not None:
7983 * PyObject_GetBuffer(obj, &self.view, flags)
7984 * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
7985 * (<__pyx_buffer *> &self.view).obj = Py_None
7986 * Py_INCREF(Py_None)
7987*/
7988 }
7989
7990 /* "View.MemoryView":370
7991 * self.obj = obj
7992 * self.flags = flags
7993 * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
7994 * PyObject_GetBuffer(obj, &self.view, flags)
7995 * if <PyObject *> self.view.obj == NULL:
7996*/
7997 }
7998
7999 /* "View.MemoryView":376
8000 * Py_INCREF(Py_None)
8001 *
8002 * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
8003 * global __pyx_memoryview_thread_locks_used
8004 * if (__pyx_memoryview_thread_locks_used < 8 and
8005*/
8006 __pyx_t_1 = (!__PYX_CYTHON_ATOMICS_ENABLED());
8007
8008 if (__pyx_t_1) {
8009
8010
8011 /* "View.MemoryView":378
8012 * if not __PYX_CYTHON_ATOMICS_ENABLED():
8013 * global __pyx_memoryview_thread_locks_used
8014 * if (__pyx_memoryview_thread_locks_used < 8 and # <<<<<<<<<<<<<<
8015 *
8016 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
8017*/
8018 __pyx_t_2 = (__pyx_memoryview_thread_locks_used < 8);
8019
8020 if (__pyx_t_2) {
8021
8022 } else {
8023
8024 __pyx_t_1 = __pyx_t_2;
8025
8026 goto __pyx_L9_bool_binop_done;
8027 }
8028
8029 /* "View.MemoryView":380
8030 * if (__pyx_memoryview_thread_locks_used < 8 and
8031 *
8032 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()): # <<<<<<<<<<<<<<
8033 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8034 * __pyx_memoryview_thread_locks_used += 1
8035*/
8036 __pyx_t_2 = (!__PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING());
8037
8038
8039 __pyx_t_1 = __pyx_t_2;
8040
8041 __pyx_L9_bool_binop_done:;
8042
8043 /* "View.MemoryView":378
8044 * if not __PYX_CYTHON_ATOMICS_ENABLED():
8045 * global __pyx_memoryview_thread_locks_used
8046 * if (__pyx_memoryview_thread_locks_used < 8 and # <<<<<<<<<<<<<<
8047 *
8048 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
8049*/
8050 if (__pyx_t_1) {
8051
8052
8053 /* "View.MemoryView":381
8054 *
8055 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
8056 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
8057 * __pyx_memoryview_thread_locks_used += 1
8058 * if self.lock is NULL:
8059*/
8060 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
8061
8062 /* "View.MemoryView":382
8063 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
8064 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8065 * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
8066 * if self.lock is NULL:
8067 * self.lock = PyThread_allocate_lock()
8068*/
8069 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
8070
8071 /* "View.MemoryView":378
8072 * if not __PYX_CYTHON_ATOMICS_ENABLED():
8073 * global __pyx_memoryview_thread_locks_used
8074 * if (__pyx_memoryview_thread_locks_used < 8 and # <<<<<<<<<<<<<<
8075 *
8076 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
8077*/
8078 }
8079
8080 /* "View.MemoryView":383
8081 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8082 * __pyx_memoryview_thread_locks_used += 1
8083 * if self.lock is NULL: # <<<<<<<<<<<<<<
8084 * self.lock = PyThread_allocate_lock()
8085 * if self.lock is NULL:
8086*/
8087 __pyx_t_1 = (__pyx_v_self->lock == NULL);
8088
8089 if (__pyx_t_1) {
8090
8091
8092 /* "View.MemoryView":384
8093 * __pyx_memoryview_thread_locks_used += 1
8094 * if self.lock is NULL:
8095 * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
8096 * if self.lock is NULL:
8097 * raise MemoryError
8098*/
8099 __pyx_v_self->lock = PyThread_allocate_lock();
8100
8101 /* "View.MemoryView":385
8102 * if self.lock is NULL:
8103 * self.lock = PyThread_allocate_lock()
8104 * if self.lock is NULL: # <<<<<<<<<<<<<<
8105 * raise MemoryError
8106 *
8107*/
8108 __pyx_t_1 = (__pyx_v_self->lock == NULL);
8109
8110 if (unlikely(__pyx_t_1)) {
8111
8112
8113 /* "View.MemoryView":386
8114 * self.lock = PyThread_allocate_lock()
8115 * if self.lock is NULL:
8116 * raise MemoryError # <<<<<<<<<<<<<<
8117 *
8118 * if flags & PyBUF_FORMAT:
8119*/
8120 PyErr_NoMemory(); __PYX_ERR(1, 386, __pyx_L1_error)
8121
8122 /* "View.MemoryView":385
8123 * if self.lock is NULL:
8124 * self.lock = PyThread_allocate_lock()
8125 * if self.lock is NULL: # <<<<<<<<<<<<<<
8126 * raise MemoryError
8127 *
8128*/
8129 }
8130
8131 /* "View.MemoryView":383
8132 * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8133 * __pyx_memoryview_thread_locks_used += 1
8134 * if self.lock is NULL: # <<<<<<<<<<<<<<
8135 * self.lock = PyThread_allocate_lock()
8136 * if self.lock is NULL:
8137*/
8138 }
8139
8140 /* "View.MemoryView":376
8141 * Py_INCREF(Py_None)
8142 *
8143 * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
8144 * global __pyx_memoryview_thread_locks_used
8145 * if (__pyx_memoryview_thread_locks_used < 8 and
8146*/
8147 }
8148
8149 /* "View.MemoryView":388
8150 * raise MemoryError
8151 *
8152 * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8153 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8154 * else:
8155*/
8156 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
8157
8158 if (__pyx_t_1) {
8159
8160
8161 /* "View.MemoryView":389
8162 *
8163 * if flags & PyBUF_FORMAT:
8164 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
8165 * else:
8166 * self.dtype_is_object = dtype_is_object
8167*/
8168 __pyx_t_2 = ((__pyx_v_self->view.format[0]) == 'O');
8169
8170 if (__pyx_t_2) {
8171
8172 } else {
8173
8174 __pyx_t_1 = __pyx_t_2;
8175
8176 goto __pyx_L14_bool_binop_done;
8177 }
8178 __pyx_t_2 = ((__pyx_v_self->view.format[1]) == '\x00');
8179
8180
8181 __pyx_t_1 = __pyx_t_2;
8182
8183 __pyx_L14_bool_binop_done:;
8184 __pyx_v_self->dtype_is_object = __pyx_t_1;
8185
8186 /* "View.MemoryView":388
8187 * raise MemoryError
8188 *
8189 * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8190 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8191 * else:
8192*/
8193 goto __pyx_L13;
8194 }
8195
8196 /* "View.MemoryView":391
8197 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8198 * else:
8199 * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
8200 *
8201 * with cython.cdivision(True):
8202*/
8203 /*else*/ {
8204 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
8205 }
8206 __pyx_L13:;
8207
8208 /* "View.MemoryView":394
8209 *
8210 * with cython.cdivision(True):
8211 * assert <uintptr_t>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0 # <<<<<<<<<<<<<<
8212 * self.typeinfo = NULL
8213 *
8214*/
8215 #ifndef CYTHON_WITHOUT_ASSERTIONS
8216 if (unlikely(__pyx_assertions_enabled())) {
8217 __pyx_t_1 = ((((__pyx_uintptr_t)(&__pyx_v_self->acquisition_count)) % (sizeof(__pyx_atomic_int_type))) == 0);
8218
8219 if (unlikely(!__pyx_t_1)) {
8220 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
8221 __PYX_ERR(1, 394, __pyx_L1_error)
8222 }
8223
8224 }
8225 #else
8226 if ((1)); else __PYX_ERR(1, 394, __pyx_L1_error)
8227 #endif
8228
8229 /* "View.MemoryView":395
8230 * with cython.cdivision(True):
8231 * assert <uintptr_t>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
8232 * self.typeinfo = NULL # <<<<<<<<<<<<<<
8233 *
8234 * def __dealloc__(memoryview self):
8235*/
8236 __pyx_v_self->typeinfo = NULL;
8237
8238 /* "View.MemoryView":367
8239 * cdef const __Pyx_TypeInfo *typeinfo
8240 *
8241 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
8242 * self.obj = obj
8243 * self.flags = flags
8244*/
8245
8246 /* function exit code */
8247 __pyx_r = 0;
8248 goto __pyx_L0;
8249 __pyx_L1_error:;
8250 __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8251 __pyx_r = -1;
8252 __pyx_L0:;
8253
8254 __Pyx_RefNannyFinishContext();
8255 return __pyx_r;
8256}
8257
8258/* "View.MemoryView":397
8259 * self.typeinfo = NULL
8260 *
8261 * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
8262 * if self.obj is not None:
8263 * PyBuffer_Release(&self.view)
8264*/
8265
8266/* Python wrapper */
8267static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
8268static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
8269 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8270 __Pyx_RefNannyDeclarations
8271 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
8272 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8273 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
8274
8275 /* function exit code */
8276 __Pyx_RefNannyFinishContext();
8277}
8278
8279static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
8280 int __pyx_v_i;
8281 int __pyx_t_1;
8282 Py_ssize_t __pyx_t_2;
8283 Py_ssize_t __pyx_t_3;
8284 int __pyx_t_4;
8285 PyThread_type_lock __pyx_t_5;
8286 PyThread_type_lock __pyx_t_6;
8287
8288 /* "View.MemoryView":398
8289 *
8290 * def __dealloc__(memoryview self):
8291 * if self.obj is not None: # <<<<<<<<<<<<<<
8292 * PyBuffer_Release(&self.view)
8293 * elif (<__pyx_buffer *> &self.view).obj == Py_None:
8294*/
8295 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
8296 if (__pyx_t_1) {
8297
8298
8299 /* "View.MemoryView":399
8300 * def __dealloc__(memoryview self):
8301 * if self.obj is not None:
8302 * PyBuffer_Release(&self.view) # <<<<<<<<<<<<<<
8303 * elif (<__pyx_buffer *> &self.view).obj == Py_None:
8304 *
8305*/
8306 PyBuffer_Release((&__pyx_v_self->view));
8307
8308 /* "View.MemoryView":398
8309 *
8310 * def __dealloc__(memoryview self):
8311 * if self.obj is not None: # <<<<<<<<<<<<<<
8312 * PyBuffer_Release(&self.view)
8313 * elif (<__pyx_buffer *> &self.view).obj == Py_None:
8314*/
8315 goto __pyx_L3;
8316 }
8317
8318 /* "View.MemoryView":400
8319 * if self.obj is not None:
8320 * PyBuffer_Release(&self.view)
8321 * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
8322 *
8323 * (<__pyx_buffer *> &self.view).obj = NULL
8324*/
8325 __pyx_t_1 = (((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None);
8326
8327 if (__pyx_t_1) {
8328
8329
8330 /* "View.MemoryView":402
8331 * elif (<__pyx_buffer *> &self.view).obj == Py_None:
8332 *
8333 * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
8334 * Py_DECREF(Py_None)
8335 *
8336*/
8337 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
8338
8339 /* "View.MemoryView":403
8340 *
8341 * (<__pyx_buffer *> &self.view).obj = NULL
8342 * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
8343 *
8344 * cdef int i
8345*/
8346 Py_DECREF(Py_None);
8347
8348 /* "View.MemoryView":400
8349 * if self.obj is not None:
8350 * PyBuffer_Release(&self.view)
8351 * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
8352 *
8353 * (<__pyx_buffer *> &self.view).obj = NULL
8354*/
8355 }
8356 __pyx_L3:;
8357
8358 /* "View.MemoryView":407
8359 * cdef int i
8360 * global __pyx_memoryview_thread_locks_used
8361 * if self.lock != NULL: # <<<<<<<<<<<<<<
8362 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
8363 * if __pyx_memoryview_thread_locks[i] is self.lock:
8364*/
8365 __pyx_t_1 = (__pyx_v_self->lock != NULL);
8366
8367 if (__pyx_t_1) {
8368
8369
8370 /* "View.MemoryView":408
8371 * global __pyx_memoryview_thread_locks_used
8372 * if self.lock != NULL:
8373 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
8374 * if __pyx_memoryview_thread_locks[i] is self.lock:
8375 * __pyx_memoryview_thread_locks_used -= 1
8376*/
8377 __pyx_t_1 = __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING();
8378
8379 if (__pyx_t_1) {
8380
8381 __pyx_t_2 = 0;
8382 } else {
8383
8384 __pyx_t_2 = __pyx_memoryview_thread_locks_used;
8385 }
8386
8387 __pyx_t_3 = __pyx_t_2;
8388
8389 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
8390 __pyx_v_i = __pyx_t_4;
8391
8392 /* "View.MemoryView":409
8393 * if self.lock != NULL:
8394 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
8395 * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
8396 * __pyx_memoryview_thread_locks_used -= 1
8397 * if i != __pyx_memoryview_thread_locks_used:
8398*/
8399 __pyx_t_1 = ((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock);
8400
8401 if (__pyx_t_1) {
8402
8403
8404 /* "View.MemoryView":410
8405 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
8406 * if __pyx_memoryview_thread_locks[i] is self.lock:
8407 * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
8408 * if i != __pyx_memoryview_thread_locks_used:
8409 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8410*/
8411 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
8412
8413 /* "View.MemoryView":411
8414 * if __pyx_memoryview_thread_locks[i] is self.lock:
8415 * __pyx_memoryview_thread_locks_used -= 1
8416 * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
8417 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8418 * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8419*/
8420 __pyx_t_1 = (__pyx_v_i != __pyx_memoryview_thread_locks_used);
8421
8422 if (__pyx_t_1) {
8423
8424
8425 /* "View.MemoryView":413
8426 * if i != __pyx_memoryview_thread_locks_used:
8427 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8428 * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
8429 * break
8430 * else:
8431*/
8432 __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
8433
8434 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
8435
8436
8437 /* "View.MemoryView":412
8438 * __pyx_memoryview_thread_locks_used -= 1
8439 * if i != __pyx_memoryview_thread_locks_used:
8440 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
8441 * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8442 * break
8443*/
8444 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
8445
8446 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
8447
8448
8449 /* "View.MemoryView":411
8450 * if __pyx_memoryview_thread_locks[i] is self.lock:
8451 * __pyx_memoryview_thread_locks_used -= 1
8452 * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
8453 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8454 * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8455*/
8456 }
8457
8458 /* "View.MemoryView":414
8459 * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8460 * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8461 * break # <<<<<<<<<<<<<<
8462 * else:
8463 * PyThread_free_lock(self.lock)
8464*/
8465 goto __pyx_L6_break;
8466
8467 /* "View.MemoryView":409
8468 * if self.lock != NULL:
8469 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
8470 * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
8471 * __pyx_memoryview_thread_locks_used -= 1
8472 * if i != __pyx_memoryview_thread_locks_used:
8473*/
8474 }
8475 }
8476 /*else*/ {
8477
8478 /* "View.MemoryView":416
8479 * break
8480 * else:
8481 * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
8482 *
8483 *
8484*/
8485 PyThread_free_lock(__pyx_v_self->lock);
8486 }
8487 __pyx_L6_break:;
8488
8489
8490
8491 /* "View.MemoryView":407
8492 * cdef int i
8493 * global __pyx_memoryview_thread_locks_used
8494 * if self.lock != NULL: # <<<<<<<<<<<<<<
8495 * for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
8496 * if __pyx_memoryview_thread_locks[i] is self.lock:
8497*/
8498 }
8499
8500 /* "View.MemoryView":397
8501 * self.typeinfo = NULL
8502 *
8503 * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
8504 * if self.obj is not None:
8505 * PyBuffer_Release(&self.view)
8506*/
8507
8508 /* function exit code */
8509
8510
8511}
8512
8513/* "View.MemoryView":419
8514 *
8515 *
8516 * cdef char *get_item_pointer(memoryview self, index: tuple) except NULL: # <<<<<<<<<<<<<<
8517 * cdef Py_ssize_t dim
8518 * cdef char *itemp = <char *> self.view.buf
8519*/
8520
8521static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
8522 Py_ssize_t __pyx_v_dim;
8523 char *__pyx_v_itemp;
8524 PyObject *__pyx_v_idx = NULL;
8525 char *__pyx_r;
8526 __Pyx_RefNannyDeclarations
8527 Py_ssize_t __pyx_t_1;
8528 PyObject *__pyx_t_2 = NULL;
8529 Py_ssize_t __pyx_t_3;
8530 PyObject *__pyx_t_4 = NULL;
8531 Py_ssize_t __pyx_t_5;
8532 char *__pyx_t_6;
8533 int __pyx_lineno = 0;
8534 const char *__pyx_filename = NULL;
8535 int __pyx_clineno = 0;
8536 __Pyx_RefNannySetupContext("get_item_pointer", 0);
8537
8538 /* "View.MemoryView":421
8539 * cdef char *get_item_pointer(memoryview self, index: tuple) except NULL:
8540 * cdef Py_ssize_t dim
8541 * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
8542 *
8543 * for dim, idx in enumerate(index):
8544*/
8545 __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
8546
8547 /* "View.MemoryView":423
8548 * cdef char *itemp = <char *> self.view.buf
8549 *
8550 * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
8551 * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8552 *
8553*/
8554
8555 __pyx_t_1 = 0;
8556 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2);
8557 __pyx_t_3 = 0;
8558 for (;;) {
8559 {
8560 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
8561 #if !CYTHON_ASSUME_SAFE_SIZE
8562 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 423, __pyx_L1_error)
8563 #endif
8564 if (__pyx_t_3 >= __pyx_temp) break;
8565 }
8566 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8567 __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
8568 #else
8569 __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
8570 #endif
8571 ++__pyx_t_3;
8572 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 423, __pyx_L1_error)
8573 __Pyx_GOTREF(__pyx_t_4);
8574 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_4);
8575 __pyx_t_4 = 0;
8576 __pyx_v_dim = __pyx_t_1;
8577 __pyx_t_1 = (__pyx_t_1 + 1);
8578
8579 /* "View.MemoryView":424
8580 *
8581 * for dim, idx in enumerate(index):
8582 * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
8583 *
8584 * return itemp
8585*/
8586 __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 424, __pyx_L1_error)
8587 __pyx_t_6 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_5, __pyx_v_dim); if (unlikely(__pyx_t_6 == ((void *)NULL))) __PYX_ERR(1, 424, __pyx_L1_error)
8588 __pyx_v_itemp = __pyx_t_6;
8589
8590
8591 /* "View.MemoryView":423
8592 * cdef char *itemp = <char *> self.view.buf
8593 *
8594 * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
8595 * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8596 *
8597*/
8598 }
8599 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8600
8601 /* "View.MemoryView":426
8602 * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8603 *
8604 * return itemp # <<<<<<<<<<<<<<
8605 *
8606 *
8607*/
8608 {
8609
8610 __pyx_r = __pyx_v_itemp;
8611 }
8612 goto __pyx_L0;
8613
8614 /* "View.MemoryView":419
8615 *
8616 *
8617 * cdef char *get_item_pointer(memoryview self, index: tuple) except NULL: # <<<<<<<<<<<<<<
8618 * cdef Py_ssize_t dim
8619 * cdef char *itemp = <char *> self.view.buf
8620*/
8621
8622 /* function exit code */
8623 __pyx_L1_error:;
8624 __Pyx_XDECREF(__pyx_t_2);
8625 __Pyx_XDECREF(__pyx_t_4);
8626 __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
8627 __pyx_r = NULL;
8628 __pyx_L0:;
8629
8630
8631 __Pyx_XDECREF(__pyx_v_idx);
8632
8633 __Pyx_RefNannyFinishContext();
8634 return __pyx_r;
8635}
8636
8637/* "View.MemoryView":429
8638 *
8639 *
8640 * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
8641 * cdef char *buffer
8642 * if self.view.ndim == 1 and isinstance(index, int):
8643*/
8644
8645/* Python wrapper */
8646static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
8647static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
8648 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8649 PyObject *__pyx_r = 0;
8650 __Pyx_RefNannyDeclarations
8651 __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
8652 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8653 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
8654
8655 /* function exit code */
8656 __Pyx_RefNannyFinishContext();
8657 return __pyx_r;
8658}
8659
8660static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
8661 char *__pyx_v_buffer;
8662 int __pyx_v_have_slices;
8663 PyObject *__pyx_v_indices = NULL;
8664 char *__pyx_v_itemp;
8665 PyObject *__pyx_r = NULL;
8666 __Pyx_RefNannyDeclarations
8667 int __pyx_t_1;
8668 int __pyx_t_2;
8669 Py_ssize_t __pyx_t_3;
8670 char *__pyx_t_4;
8671 PyObject *__pyx_t_5 = NULL;
8672 PyObject *__pyx_t_6 = NULL;
8673 PyObject *__pyx_t_7 = NULL;
8674 int __pyx_lineno = 0;
8675 const char *__pyx_filename = NULL;
8676 int __pyx_clineno = 0;
8677 __Pyx_RefNannySetupContext("__getitem__", 0);
8678
8679 /* "View.MemoryView":431
8680 * def __getitem__(memoryview self, object index):
8681 * cdef char *buffer
8682 * if self.view.ndim == 1 and isinstance(index, int): # <<<<<<<<<<<<<<
8683 * buffer = <char *> self.view.buf
8684 * return self.convert_item_to_object(
8685*/
8686 __pyx_t_2 = (__pyx_v_self->view.ndim == 1);
8687
8688 if (__pyx_t_2) {
8689
8690 } else {
8691
8692 __pyx_t_1 = __pyx_t_2;
8693
8694 goto __pyx_L4_bool_binop_done;
8695 }
8696 __pyx_t_2 = PyLong_Check(__pyx_v_index);
8697
8698 __pyx_t_1 = __pyx_t_2;
8699
8700 __pyx_L4_bool_binop_done:;
8701 if (__pyx_t_1) {
8702
8703
8704 /* "View.MemoryView":432
8705 * cdef char *buffer
8706 * if self.view.ndim == 1 and isinstance(index, int):
8707 * buffer = <char *> self.view.buf # <<<<<<<<<<<<<<
8708 * return self.convert_item_to_object(
8709 * pybuffer_index(&self.view, buffer, index, 0))
8710*/
8711 __pyx_v_buffer = ((char *)__pyx_v_self->view.buf);
8712
8713 /* "View.MemoryView":434
8714 * buffer = <char *> self.view.buf
8715 * return self.convert_item_to_object(
8716 * pybuffer_index(&self.view, buffer, index, 0)) # <<<<<<<<<<<<<<
8717 *
8718 * if index is Ellipsis:
8719*/
8720 __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 434, __pyx_L1_error)
8721 __pyx_t_4 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_buffer, __pyx_t_3, 0); if (unlikely(__pyx_t_4 == ((void *)NULL))) __PYX_ERR(1, 434, __pyx_L1_error)
8722
8723 /* "View.MemoryView":433
8724 * if self.view.ndim == 1 and isinstance(index, int):
8725 * buffer = <char *> self.view.buf
8726 * return self.convert_item_to_object( # <<<<<<<<<<<<<<
8727 * pybuffer_index(&self.view, buffer, index, 0))
8728 *
8729*/
8730 __pyx_t_5 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 433, __pyx_L1_error)
8731 __Pyx_GOTREF(__pyx_t_5);
8732
8733
8734 {
8735 PyObject *__pyx_temp;
8736 {
8737 __pyx_temp = __pyx_r;
8738 __pyx_r = __pyx_t_5;
8739 }
8740 __Pyx_XDECREF(__pyx_temp);
8741 }
8742 __pyx_t_5 = 0;
8743 goto __pyx_L0;
8744
8745 /* "View.MemoryView":431
8746 * def __getitem__(memoryview self, object index):
8747 * cdef char *buffer
8748 * if self.view.ndim == 1 and isinstance(index, int): # <<<<<<<<<<<<<<
8749 * buffer = <char *> self.view.buf
8750 * return self.convert_item_to_object(
8751*/
8752 }
8753
8754 /* "View.MemoryView":436
8755 * pybuffer_index(&self.view, buffer, index, 0))
8756 *
8757 * if index is Ellipsis: # <<<<<<<<<<<<<<
8758 * return self
8759 *
8760*/
8761 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
8762 if (__pyx_t_1) {
8763
8764
8765 /* "View.MemoryView":437
8766 *
8767 * if index is Ellipsis:
8768 * return self # <<<<<<<<<<<<<<
8769 *
8770 * have_slices, indices = _unellipsify(index, self.view.ndim)
8771*/
8772 {
8773 PyObject *__pyx_temp;
8774 {
8775 __pyx_temp = __pyx_r;
8776 __Pyx_INCREF((PyObject *)__pyx_v_self);
8777 __pyx_r = ((PyObject *)__pyx_v_self);
8778 }
8779 __Pyx_XDECREF(__pyx_temp);
8780 }
8781 goto __pyx_L0;
8782
8783 /* "View.MemoryView":436
8784 * pybuffer_index(&self.view, buffer, index, 0))
8785 *
8786 * if index is Ellipsis: # <<<<<<<<<<<<<<
8787 * return self
8788 *
8789*/
8790 }
8791
8792 /* "View.MemoryView":439
8793 * return self
8794 *
8795 * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
8796 *
8797 * cdef char *itemp
8798*/
8799 __pyx_t_5 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 439, __pyx_L1_error)
8800 __Pyx_GOTREF(__pyx_t_5);
8801 if (likely(__pyx_t_5 != Py_None)) {
8802 PyObject* sequence = __pyx_t_5;
8803 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
8804 if (unlikely(size != 2)) {
8805 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8806 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8807 __PYX_ERR(1, 439, __pyx_L1_error)
8808 }
8809 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8810 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
8811 __Pyx_INCREF(__pyx_t_6);
8812 __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
8813 __Pyx_INCREF(__pyx_t_7);
8814 #else
8815 __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 439, __pyx_L1_error)
8816 __Pyx_GOTREF(__pyx_t_6);
8817 __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 439, __pyx_L1_error)
8818 __Pyx_GOTREF(__pyx_t_7);
8819 #endif
8820 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8821 } else {
8822 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 439, __pyx_L1_error)
8823 }
8824 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 439, __pyx_L1_error)
8825 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8826 if (!(likely(PyTuple_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_7))) __PYX_ERR(1, 439, __pyx_L1_error)
8827 __pyx_v_have_slices = __pyx_t_1;
8828 __pyx_v_indices = ((PyObject*)__pyx_t_7);
8829 __pyx_t_7 = 0;
8830
8831 /* "View.MemoryView":442
8832 *
8833 * cdef char *itemp
8834 * if have_slices: # <<<<<<<<<<<<<<
8835 * return memview_slice(self, indices)
8836 * else:
8837*/
8838 if (__pyx_v_have_slices) {
8839
8840 /* "View.MemoryView":443
8841 * cdef char *itemp
8842 * if have_slices:
8843 * return memview_slice(self, indices) # <<<<<<<<<<<<<<
8844 * else:
8845 * itemp = memoryview.get_item_pointer(self, <tuple> indices)
8846*/
8847 __pyx_t_5 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 443, __pyx_L1_error)
8848 __Pyx_GOTREF(__pyx_t_5);
8849 {
8850 PyObject *__pyx_temp;
8851 {
8852 __pyx_temp = __pyx_r;
8853 __pyx_r = __pyx_t_5;
8854 }
8855 __Pyx_XDECREF(__pyx_temp);
8856 }
8857 __pyx_t_5 = 0;
8858 goto __pyx_L0;
8859
8860 /* "View.MemoryView":442
8861 *
8862 * cdef char *itemp
8863 * if have_slices: # <<<<<<<<<<<<<<
8864 * return memview_slice(self, indices)
8865 * else:
8866*/
8867 }
8868
8869 /* "View.MemoryView":445
8870 * return memview_slice(self, indices)
8871 * else:
8872 * itemp = memoryview.get_item_pointer(self, <tuple> indices) # <<<<<<<<<<<<<<
8873 * return self.convert_item_to_object(itemp)
8874 *
8875*/
8876 /*else*/ {
8877 if (unlikely(__pyx_v_indices == Py_None)) {
8878 PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
8879 __PYX_ERR(1, 445, __pyx_L1_error)
8880 }
8881 __pyx_t_4 = __pyx_memoryview_get_item_pointer(__pyx_v_self, ((PyObject*)__pyx_v_indices)); if (unlikely(__pyx_t_4 == ((void *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
8882 __pyx_v_itemp = __pyx_t_4;
8883
8884 /* "View.MemoryView":446
8885 * else:
8886 * itemp = memoryview.get_item_pointer(self, <tuple> indices)
8887 * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
8888 *
8889 * def __setitem__(memoryview self, object index, object value):
8890*/
8891 __pyx_t_5 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 446, __pyx_L1_error)
8892 __Pyx_GOTREF(__pyx_t_5);
8893 {
8894 PyObject *__pyx_temp;
8895 {
8896 __pyx_temp = __pyx_r;
8897 __pyx_r = __pyx_t_5;
8898 }
8899 __Pyx_XDECREF(__pyx_temp);
8900 }
8901 __pyx_t_5 = 0;
8902 goto __pyx_L0;
8903 }
8904
8905 /* "View.MemoryView":429
8906 *
8907 *
8908 * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
8909 * cdef char *buffer
8910 * if self.view.ndim == 1 and isinstance(index, int):
8911*/
8912
8913 /* function exit code */
8914 __pyx_L1_error:;
8915 __Pyx_XDECREF(__pyx_t_5);
8916 __Pyx_XDECREF(__pyx_t_6);
8917 __Pyx_XDECREF(__pyx_t_7);
8918 __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8919 __pyx_r = NULL;
8920 __pyx_L0:;
8921
8922
8923 __Pyx_XDECREF(__pyx_v_indices);
8924
8925 __Pyx_XGIVEREF(__pyx_r);
8926 __Pyx_RefNannyFinishContext();
8927 return __pyx_r;
8928}
8929
8930/* "View.MemoryView":448
8931 * return self.convert_item_to_object(itemp)
8932 *
8933 * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
8934 * if self.view.readonly:
8935 * raise TypeError, "Cannot assign to read-only memoryview"
8936*/
8937
8938/* Python wrapper */
8939static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
8940static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
8941 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8942 int __pyx_r;
8943 __Pyx_RefNannyDeclarations
8944 __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
8945 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8946 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
8947
8948 /* function exit code */
8949 __Pyx_RefNannyFinishContext();
8950 return __pyx_r;
8951}
8952
8953static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
8954 int __pyx_v_have_slices;
8955 PyObject *__pyx_v_indices = NULL;
8956 PyObject *__pyx_v_obj = NULL;
8957 struct __pyx_memoryview_obj *__pyx_v_target_slice = NULL;
8958 int __pyx_r;
8959 __Pyx_RefNannyDeclarations
8960 int __pyx_t_1;
8961 int __pyx_t_2;
8962 PyObject *__pyx_t_3 = NULL;
8963 PyObject *__pyx_t_4 = NULL;
8964 PyObject *__pyx_t_5 = NULL;
8965 int __pyx_lineno = 0;
8966 const char *__pyx_filename = NULL;
8967 int __pyx_clineno = 0;
8968 __Pyx_RefNannySetupContext("__setitem__", 0);
8969
8970 /* "View.MemoryView":449
8971 *
8972 * def __setitem__(memoryview self, object index, object value):
8973 * if self.view.readonly: # <<<<<<<<<<<<<<
8974 * raise TypeError, "Cannot assign to read-only memoryview"
8975 *
8976*/
8977 if (unlikely(__pyx_v_self->view.readonly)) {
8978
8979 /* "View.MemoryView":450
8980 * def __setitem__(memoryview self, object index, object value):
8981 * if self.view.readonly:
8982 * raise TypeError, "Cannot assign to read-only memoryview" # <<<<<<<<<<<<<<
8983 *
8984 * if self.view.ndim == 1 and isinstance(index, int):
8985*/
8986 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_Cannot_assign_to_read_only_memor, 0, 0);
8987 __PYX_ERR(1, 450, __pyx_L1_error)
8988
8989 /* "View.MemoryView":449
8990 *
8991 * def __setitem__(memoryview self, object index, object value):
8992 * if self.view.readonly: # <<<<<<<<<<<<<<
8993 * raise TypeError, "Cannot assign to read-only memoryview"
8994 *
8995*/
8996 }
8997
8998 /* "View.MemoryView":452
8999 * raise TypeError, "Cannot assign to read-only memoryview"
9000 *
9001 * if self.view.ndim == 1 and isinstance(index, int): # <<<<<<<<<<<<<<
9002 * memoryview.setitem_indexed1(self, index, value)
9003 * return
9004*/
9005 __pyx_t_2 = (__pyx_v_self->view.ndim == 1);
9006
9007 if (__pyx_t_2) {
9008
9009 } else {
9010
9011 __pyx_t_1 = __pyx_t_2;
9012
9013 goto __pyx_L5_bool_binop_done;
9014 }
9015 __pyx_t_2 = PyLong_Check(__pyx_v_index);
9016
9017 __pyx_t_1 = __pyx_t_2;
9018
9019 __pyx_L5_bool_binop_done:;
9020 if (__pyx_t_1) {
9021
9022
9023 /* "View.MemoryView":453
9024 *
9025 * if self.view.ndim == 1 and isinstance(index, int):
9026 * memoryview.setitem_indexed1(self, index, value) # <<<<<<<<<<<<<<
9027 * return
9028 *
9029*/
9030 __pyx_t_3 = __pyx_memoryview_setitem_indexed1(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 453, __pyx_L1_error)
9031 __Pyx_GOTREF(__pyx_t_3);
9032 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9033
9034 /* "View.MemoryView":454
9035 * if self.view.ndim == 1 and isinstance(index, int):
9036 * memoryview.setitem_indexed1(self, index, value)
9037 * return # <<<<<<<<<<<<<<
9038 *
9039 * have_slices, indices = _unellipsify(index, self.view.ndim)
9040*/
9041 {
9042 __pyx_r = 0;
9043 }
9044 goto __pyx_L0;
9045
9046 /* "View.MemoryView":452
9047 * raise TypeError, "Cannot assign to read-only memoryview"
9048 *
9049 * if self.view.ndim == 1 and isinstance(index, int): # <<<<<<<<<<<<<<
9050 * memoryview.setitem_indexed1(self, index, value)
9051 * return
9052*/
9053 }
9054
9055 /* "View.MemoryView":456
9056 * return
9057 *
9058 * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
9059 *
9060 * if have_slices:
9061*/
9062 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 456, __pyx_L1_error)
9063 __Pyx_GOTREF(__pyx_t_3);
9064 if (likely(__pyx_t_3 != Py_None)) {
9065 PyObject* sequence = __pyx_t_3;
9066 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
9067 if (unlikely(size != 2)) {
9068 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
9069 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9070 __PYX_ERR(1, 456, __pyx_L1_error)
9071 }
9072 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9073 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
9074 __Pyx_INCREF(__pyx_t_4);
9075 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
9076 __Pyx_INCREF(__pyx_t_5);
9077 #else
9078 __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 456, __pyx_L1_error)
9079 __Pyx_GOTREF(__pyx_t_4);
9080 __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 456, __pyx_L1_error)
9081 __Pyx_GOTREF(__pyx_t_5);
9082 #endif
9083 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9084 } else {
9085 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 456, __pyx_L1_error)
9086 }
9087 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 456, __pyx_L1_error)
9088 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9089 if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_5))) __PYX_ERR(1, 456, __pyx_L1_error)
9090 __pyx_v_have_slices = __pyx_t_1;
9091 __pyx_v_indices = ((PyObject*)__pyx_t_5);
9092 __pyx_t_5 = 0;
9093
9094 /* "View.MemoryView":458
9095 * have_slices, indices = _unellipsify(index, self.view.ndim)
9096 *
9097 * if have_slices: # <<<<<<<<<<<<<<
9098 * obj = memoryview.is_slice(self, value)
9099 * target_slice = memview_slice(self, indices)
9100*/
9101 if (__pyx_v_have_slices) {
9102
9103 /* "View.MemoryView":459
9104 *
9105 * if have_slices:
9106 * obj = memoryview.is_slice(self, value) # <<<<<<<<<<<<<<
9107 * target_slice = memview_slice(self, indices)
9108 * if obj is not None:
9109*/
9110 __pyx_t_3 = __pyx_memoryview_is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 459, __pyx_L1_error)
9111 __Pyx_GOTREF(__pyx_t_3);
9112 __pyx_v_obj = __pyx_t_3;
9113 __pyx_t_3 = 0;
9114
9115 /* "View.MemoryView":460
9116 * if have_slices:
9117 * obj = memoryview.is_slice(self, value)
9118 * target_slice = memview_slice(self, indices) # <<<<<<<<<<<<<<
9119 * if obj is not None:
9120 * memoryview.setitem_slice_assignment(self, target_slice, obj)
9121*/
9122 __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 460, __pyx_L1_error)
9123 __Pyx_GOTREF(__pyx_t_3);
9124 __pyx_v_target_slice = ((struct __pyx_memoryview_obj *)__pyx_t_3);
9125 __pyx_t_3 = 0;
9126
9127 /* "View.MemoryView":461
9128 * obj = memoryview.is_slice(self, value)
9129 * target_slice = memview_slice(self, indices)
9130 * if obj is not None: # <<<<<<<<<<<<<<
9131 * memoryview.setitem_slice_assignment(self, target_slice, obj)
9132 * else:
9133*/
9134 __pyx_t_1 = (__pyx_v_obj != Py_None);
9135 if (__pyx_t_1) {
9136
9137
9138 /* "View.MemoryView":462
9139 * target_slice = memview_slice(self, indices)
9140 * if obj is not None:
9141 * memoryview.setitem_slice_assignment(self, target_slice, obj) # <<<<<<<<<<<<<<
9142 * else:
9143 * memoryview.setitem_slice_assign_scalar(self, target_slice, value)
9144*/
9145 __pyx_t_3 = __pyx_memoryview_setitem_slice_assignment(__pyx_v_self, ((PyObject *)__pyx_v_target_slice), __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 462, __pyx_L1_error)
9146 __Pyx_GOTREF(__pyx_t_3);
9147 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9148
9149 /* "View.MemoryView":461
9150 * obj = memoryview.is_slice(self, value)
9151 * target_slice = memview_slice(self, indices)
9152 * if obj is not None: # <<<<<<<<<<<<<<
9153 * memoryview.setitem_slice_assignment(self, target_slice, obj)
9154 * else:
9155*/
9156 goto __pyx_L8;
9157 }
9158
9159 /* "View.MemoryView":464
9160 * memoryview.setitem_slice_assignment(self, target_slice, obj)
9161 * else:
9162 * memoryview.setitem_slice_assign_scalar(self, target_slice, value) # <<<<<<<<<<<<<<
9163 * else:
9164 * memoryview.setitem_indexed(self, <tuple> indices, value)
9165*/
9166 /*else*/ {
9167 __pyx_t_3 = __pyx_memoryview_setitem_slice_assign_scalar(__pyx_v_self, __pyx_v_target_slice, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 464, __pyx_L1_error)
9168 __Pyx_GOTREF(__pyx_t_3);
9169 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9170 }
9171 __pyx_L8:;
9172
9173 /* "View.MemoryView":458
9174 * have_slices, indices = _unellipsify(index, self.view.ndim)
9175 *
9176 * if have_slices: # <<<<<<<<<<<<<<
9177 * obj = memoryview.is_slice(self, value)
9178 * target_slice = memview_slice(self, indices)
9179*/
9180 goto __pyx_L7;
9181 }
9182
9183 /* "View.MemoryView":466
9184 * memoryview.setitem_slice_assign_scalar(self, target_slice, value)
9185 * else:
9186 * memoryview.setitem_indexed(self, <tuple> indices, value) # <<<<<<<<<<<<<<
9187 *
9188 *
9189*/
9190 /*else*/ {
9191 if (unlikely(__pyx_v_indices == Py_None)) {
9192 PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
9193 __PYX_ERR(1, 466, __pyx_L1_error)
9194 }
9195 __pyx_t_3 = __pyx_memoryview_setitem_indexed(__pyx_v_self, ((PyObject*)__pyx_v_indices), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 466, __pyx_L1_error)
9196 __Pyx_GOTREF(__pyx_t_3);
9197 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9198 }
9199 __pyx_L7:;
9200
9201 /* "View.MemoryView":448
9202 * return self.convert_item_to_object(itemp)
9203 *
9204 * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
9205 * if self.view.readonly:
9206 * raise TypeError, "Cannot assign to read-only memoryview"
9207*/
9208
9209 /* function exit code */
9210 __pyx_r = 0;
9211 goto __pyx_L0;
9212 __pyx_L1_error:;
9213 __Pyx_XDECREF(__pyx_t_3);
9214 __Pyx_XDECREF(__pyx_t_4);
9215 __Pyx_XDECREF(__pyx_t_5);
9216 __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9217 __pyx_r = -1;
9218 __pyx_L0:;
9219
9220 __Pyx_XDECREF(__pyx_v_indices);
9221 __Pyx_XDECREF(__pyx_v_obj);
9222 __Pyx_XDECREF((PyObject *)__pyx_v_target_slice);
9223
9224 __Pyx_RefNannyFinishContext();
9225 return __pyx_r;
9226}
9227
9228/* "View.MemoryView":469
9229 *
9230 *
9231 * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
9232 * if not isinstance(obj, memoryview):
9233 * try:
9234*/
9235
9236static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
9237 PyObject *__pyx_r = NULL;
9238 __Pyx_RefNannyDeclarations
9239 int __pyx_t_1;
9240 int __pyx_t_2;
9241 PyObject *__pyx_t_3 = NULL;
9242 PyObject *__pyx_t_4 = NULL;
9243 PyObject *__pyx_t_5 = NULL;
9244 PyObject *__pyx_t_6 = NULL;
9245 PyObject *__pyx_t_7 = NULL;
9246 PyObject *__pyx_t_8 = NULL;
9247 PyObject *__pyx_t_9 = NULL;
9248 size_t __pyx_t_10;
9249 int __pyx_t_11;
9250 int __pyx_lineno = 0;
9251 const char *__pyx_filename = NULL;
9252 int __pyx_clineno = 0;
9253 __Pyx_RefNannySetupContext("is_slice", 0);
9254 __Pyx_INCREF(__pyx_v_obj);
9255
9256 /* "View.MemoryView":470
9257 *
9258 * cdef is_slice(self, obj):
9259 * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
9260 * try:
9261 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9262*/
9263 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_mstate_global->__pyx_memoryview_type);
9264 __pyx_t_2 = (!__pyx_t_1);
9265
9266
9267 if (__pyx_t_2) {
9268
9269
9270 /* "View.MemoryView":471
9271 * cdef is_slice(self, obj):
9272 * if not isinstance(obj, memoryview):
9273 * try: # <<<<<<<<<<<<<<
9274 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9275 * self.dtype_is_object)
9276*/
9277 {
9278 __Pyx_PyThreadState_declare
9279 __Pyx_PyThreadState_assign
9280 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
9281 __Pyx_XGOTREF(__pyx_t_3);
9282 __Pyx_XGOTREF(__pyx_t_4);
9283 __Pyx_XGOTREF(__pyx_t_5);
9284 /*try:*/ {
9285
9286 /* "View.MemoryView":472
9287 * if not isinstance(obj, memoryview):
9288 * try:
9289 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
9290 * self.dtype_is_object)
9291 * except TypeError:
9292*/
9293 __pyx_t_7 = NULL;
9294 __pyx_t_8 = __Pyx_PyLong_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 472, __pyx_L4_error)
9295 __Pyx_GOTREF(__pyx_t_8);
9296
9297 /* "View.MemoryView":473
9298 * try:
9299 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9300 * self.dtype_is_object) # <<<<<<<<<<<<<<
9301 * except TypeError:
9302 * return None
9303*/
9304 __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 473, __pyx_L4_error)
9305 __Pyx_GOTREF(__pyx_t_9);
9306 __pyx_t_10 = 1;
9307 {
9308 PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_v_obj, __pyx_t_8, __pyx_t_9};
9309 __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_memoryview_type, __pyx_callargs+__pyx_t_10, (4-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
9310 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9311 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9312 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9313 if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 472, __pyx_L4_error)
9314 __Pyx_GOTREF((PyObject *)__pyx_t_6);
9315 }
9316 __Pyx_DECREF_SET(__pyx_v_obj, ((PyObject *)__pyx_t_6));
9317 __pyx_t_6 = 0;
9318
9319 /* "View.MemoryView":471
9320 * cdef is_slice(self, obj):
9321 * if not isinstance(obj, memoryview):
9322 * try: # <<<<<<<<<<<<<<
9323 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9324 * self.dtype_is_object)
9325*/
9326 }
9327 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9328 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9329 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9330 goto __pyx_L9_try_end;
9331 __pyx_L4_error:;
9332 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9333 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9334 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
9335 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
9336
9337 /* "View.MemoryView":474
9338 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9339 * self.dtype_is_object)
9340 * except TypeError: # <<<<<<<<<<<<<<
9341 * return None
9342 *
9343*/
9344 __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_TypeError))));
9345 if (__pyx_t_11) {
9346 __Pyx_ErrRestore(0,0,0);
9347
9348 /* "View.MemoryView":475
9349 * self.dtype_is_object)
9350 * except TypeError:
9351 * return None # <<<<<<<<<<<<<<
9352 *
9353 * return obj
9354*/
9355 {
9356 PyObject *__pyx_temp;
9357 {
9358 __pyx_temp = __pyx_r;
9359 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9360 }
9361 __Pyx_XDECREF(__pyx_temp);
9362 }
9363 goto __pyx_L7_except_return;
9364 }
9365 goto __pyx_L6_except_error;
9366
9367 /* "View.MemoryView":471
9368 * cdef is_slice(self, obj):
9369 * if not isinstance(obj, memoryview):
9370 * try: # <<<<<<<<<<<<<<
9371 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9372 * self.dtype_is_object)
9373*/
9374 __pyx_L6_except_error:;
9375 __Pyx_XGIVEREF(__pyx_t_3);
9376 __Pyx_XGIVEREF(__pyx_t_4);
9377 __Pyx_XGIVEREF(__pyx_t_5);
9378 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9379 goto __pyx_L1_error;
9380 __pyx_L7_except_return:;
9381 __Pyx_XGIVEREF(__pyx_t_3);
9382 __Pyx_XGIVEREF(__pyx_t_4);
9383 __Pyx_XGIVEREF(__pyx_t_5);
9384 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9385 goto __pyx_L0;
9386 __pyx_L9_try_end:;
9387 }
9388
9389 /* "View.MemoryView":470
9390 *
9391 * cdef is_slice(self, obj):
9392 * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
9393 * try:
9394 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9395*/
9396 }
9397
9398 /* "View.MemoryView":477
9399 * return None
9400 *
9401 * return obj # <<<<<<<<<<<<<<
9402 *
9403 *
9404*/
9405 {
9406 PyObject *__pyx_temp;
9407 {
9408 __pyx_temp = __pyx_r;
9409 __Pyx_INCREF(__pyx_v_obj);
9410 __pyx_r = __pyx_v_obj;
9411 }
9412 __Pyx_XDECREF(__pyx_temp);
9413 }
9414 goto __pyx_L0;
9415
9416 /* "View.MemoryView":469
9417 *
9418 *
9419 * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
9420 * if not isinstance(obj, memoryview):
9421 * try:
9422*/
9423
9424 /* function exit code */
9425 __pyx_L1_error:;
9426 __Pyx_XDECREF(__pyx_t_6);
9427 __Pyx_XDECREF(__pyx_t_7);
9428 __Pyx_XDECREF(__pyx_t_8);
9429 __Pyx_XDECREF(__pyx_t_9);
9430 __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
9431 __pyx_r = 0;
9432 __pyx_L0:;
9433 __Pyx_XDECREF(__pyx_v_obj);
9434 __Pyx_XGIVEREF(__pyx_r);
9435 __Pyx_RefNannyFinishContext();
9436 return __pyx_r;
9437}
9438
9439/* "View.MemoryView":480
9440 *
9441 *
9442 * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
9443 * cdef __Pyx_memviewslice dst_slice
9444 * cdef __Pyx_memviewslice src_slice
9445*/
9446
9447static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
9448 __Pyx_memviewslice __pyx_v_dst_slice;
9449 __Pyx_memviewslice __pyx_v_src_slice;
9450 __Pyx_memviewslice __pyx_v_msrc;
9451 __Pyx_memviewslice __pyx_v_mdst;
9452 PyObject *__pyx_r = NULL;
9453 __Pyx_RefNannyDeclarations
9454 __Pyx_memviewslice *__pyx_t_1;
9455 PyObject *__pyx_t_2 = NULL;
9456 int __pyx_t_3;
9457 int __pyx_t_4;
9458 int __pyx_t_5;
9459 int __pyx_lineno = 0;
9460 const char *__pyx_filename = NULL;
9461 int __pyx_clineno = 0;
9462 __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
9463
9464 /* "View.MemoryView":483
9465 * cdef __Pyx_memviewslice dst_slice
9466 * cdef __Pyx_memviewslice src_slice
9467 * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0] # <<<<<<<<<<<<<<
9468 * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
9469 *
9470*/
9471 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 483, __pyx_L1_error)
9472 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 483, __pyx_L1_error)
9473 __pyx_v_msrc = (__pyx_t_1[0]);
9474
9475
9476 /* "View.MemoryView":484
9477 * cdef __Pyx_memviewslice src_slice
9478 * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0]
9479 * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0] # <<<<<<<<<<<<<<
9480 *
9481 * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
9482*/
9483 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 484, __pyx_L1_error)
9484 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 484, __pyx_L1_error)
9485 __pyx_v_mdst = (__pyx_t_1[0]);
9486
9487
9488 /* "View.MemoryView":486
9489 * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
9490 *
9491 * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
9492 *
9493 *
9494*/
9495 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_mstate_global->__pyx_n_u_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 486, __pyx_L1_error)
9496 __Pyx_GOTREF(__pyx_t_2);
9497 __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 486, __pyx_L1_error)
9498 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9499 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_mstate_global->__pyx_n_u_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 486, __pyx_L1_error)
9500 __Pyx_GOTREF(__pyx_t_2);
9501 __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 486, __pyx_L1_error)
9502 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9503 __pyx_t_5 = __pyx_memoryview_copy_contents(__pyx_v_msrc, __pyx_v_mdst, __pyx_t_3, __pyx_t_4, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 486, __pyx_L1_error)
9504
9505
9506
9507
9508 /* "View.MemoryView":480
9509 *
9510 *
9511 * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
9512 * cdef __Pyx_memviewslice dst_slice
9513 * cdef __Pyx_memviewslice src_slice
9514*/
9515
9516 /* function exit code */
9517 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9518 goto __pyx_L0;
9519 __pyx_L1_error:;
9520 __Pyx_XDECREF(__pyx_t_2);
9521 __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
9522 __pyx_r = 0;
9523 __pyx_L0:;
9524
9525
9526
9527
9528 __Pyx_XGIVEREF(__pyx_r);
9529 __Pyx_RefNannyFinishContext();
9530 return __pyx_r;
9531}
9532
9533/* "View.MemoryView":489
9534 *
9535 *
9536 * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
9537 * cdef int array[128]
9538 * cdef void *tmp = NULL
9539*/
9540
9541static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
9542 int __pyx_v_array[128];
9543 void *__pyx_v_tmp;
9544 void *__pyx_v_item;
9545 __Pyx_memviewslice *__pyx_v_dst_slice;
9546 __Pyx_memviewslice __pyx_v_tmp_slice;
9547 PyObject *__pyx_r = NULL;
9548 __Pyx_RefNannyDeclarations
9549 __Pyx_memviewslice *__pyx_t_1;
9550 int __pyx_t_2;
9551 PyObject *__pyx_t_3 = NULL;
9552 int __pyx_t_4;
9553 int __pyx_t_5;
9554 char const *__pyx_t_6;
9555 PyObject *__pyx_t_7 = NULL;
9556 PyObject *__pyx_t_8 = NULL;
9557 PyObject *__pyx_t_9 = NULL;
9558 PyObject *__pyx_t_10 = NULL;
9559 PyObject *__pyx_t_11 = NULL;
9560 PyObject *__pyx_t_12 = NULL;
9561 int __pyx_lineno = 0;
9562 const char *__pyx_filename = NULL;
9563 int __pyx_clineno = 0;
9564 __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
9565
9566 /* "View.MemoryView":491
9567 * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
9568 * cdef int array[128]
9569 * cdef void *tmp = NULL # <<<<<<<<<<<<<<
9570 * cdef void *item
9571 *
9572*/
9573 __pyx_v_tmp = NULL;
9574
9575 /* "View.MemoryView":496
9576 * cdef __Pyx_memviewslice *dst_slice
9577 * cdef __Pyx_memviewslice tmp_slice
9578 * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
9579 *
9580 * if <size_t>self.view.itemsize > sizeof(array):
9581*/
9582 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 496, __pyx_L1_error)
9583 __pyx_v_dst_slice = __pyx_t_1;
9584
9585 /* "View.MemoryView":498
9586 * dst_slice = get_slice_from_memview(dst, &tmp_slice)
9587 *
9588 * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
9589 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9590 * if tmp == NULL:
9591*/
9592 __pyx_t_2 = (((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array)));
9593
9594 if (__pyx_t_2) {
9595
9596
9597 /* "View.MemoryView":499
9598 *
9599 * if <size_t>self.view.itemsize > sizeof(array):
9600 * tmp = PyMem_Malloc(<size_t> self.view.itemsize) # <<<<<<<<<<<<<<
9601 * if tmp == NULL:
9602 * raise MemoryError
9603*/
9604 __pyx_v_tmp = PyMem_Malloc(((size_t)__pyx_v_self->view.itemsize));
9605
9606 /* "View.MemoryView":500
9607 * if <size_t>self.view.itemsize > sizeof(array):
9608 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9609 * if tmp == NULL: # <<<<<<<<<<<<<<
9610 * raise MemoryError
9611 * item = tmp
9612*/
9613 __pyx_t_2 = (__pyx_v_tmp == NULL);
9614
9615 if (unlikely(__pyx_t_2)) {
9616
9617
9618 /* "View.MemoryView":501
9619 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9620 * if tmp == NULL:
9621 * raise MemoryError # <<<<<<<<<<<<<<
9622 * item = tmp
9623 * else:
9624*/
9625 PyErr_NoMemory(); __PYX_ERR(1, 501, __pyx_L1_error)
9626
9627 /* "View.MemoryView":500
9628 * if <size_t>self.view.itemsize > sizeof(array):
9629 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9630 * if tmp == NULL: # <<<<<<<<<<<<<<
9631 * raise MemoryError
9632 * item = tmp
9633*/
9634 }
9635
9636 /* "View.MemoryView":502
9637 * if tmp == NULL:
9638 * raise MemoryError
9639 * item = tmp # <<<<<<<<<<<<<<
9640 * else:
9641 * item = <void *> array
9642*/
9643 __pyx_v_item = __pyx_v_tmp;
9644
9645 /* "View.MemoryView":498
9646 * dst_slice = get_slice_from_memview(dst, &tmp_slice)
9647 *
9648 * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
9649 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9650 * if tmp == NULL:
9651*/
9652 goto __pyx_L3;
9653 }
9654
9655 /* "View.MemoryView":504
9656 * item = tmp
9657 * else:
9658 * item = <void *> array # <<<<<<<<<<<<<<
9659 *
9660 * try:
9661*/
9662 /*else*/ {
9663 __pyx_v_item = ((void *)__pyx_v_array);
9664 }
9665 __pyx_L3:;
9666
9667 /* "View.MemoryView":506
9668 * item = <void *> array
9669 *
9670 * try: # <<<<<<<<<<<<<<
9671 * if self.dtype_is_object:
9672 * (<PyObject **> item)[0] = <PyObject *> value
9673*/
9674 /*try:*/ {
9675
9676 /* "View.MemoryView":507
9677 *
9678 * try:
9679 * if self.dtype_is_object: # <<<<<<<<<<<<<<
9680 * (<PyObject **> item)[0] = <PyObject *> value
9681 * else:
9682*/
9683 if (__pyx_v_self->dtype_is_object) {
9684
9685 /* "View.MemoryView":508
9686 * try:
9687 * if self.dtype_is_object:
9688 * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
9689 * else:
9690 * self.assign_item_from_object(<char *> item, value)
9691*/
9692 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
9693
9694 /* "View.MemoryView":507
9695 *
9696 * try:
9697 * if self.dtype_is_object: # <<<<<<<<<<<<<<
9698 * (<PyObject **> item)[0] = <PyObject *> value
9699 * else:
9700*/
9701 goto __pyx_L8;
9702 }
9703
9704 /* "View.MemoryView":510
9705 * (<PyObject **> item)[0] = <PyObject *> value
9706 * else:
9707 * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
9708 *
9709 *
9710*/
9711 /*else*/ {
9712 __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 510, __pyx_L6_error)
9713 __Pyx_GOTREF(__pyx_t_3);
9714 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9715 }
9716 __pyx_L8:;
9717
9718 /* "View.MemoryView":514
9719 *
9720 *
9721 * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
9722 * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9723 * slice_assign_scalar(dst_slice, dst.view.ndim, <size_t> self.view.itemsize,
9724*/
9725 __pyx_t_2 = (__pyx_v_self->view.suboffsets != NULL);
9726
9727 if (__pyx_t_2) {
9728
9729
9730 /* "View.MemoryView":515
9731 *
9732 * if self.view.suboffsets != NULL:
9733 * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
9734 * slice_assign_scalar(dst_slice, dst.view.ndim, <size_t> self.view.itemsize,
9735 * item, self.dtype_is_object)
9736*/
9737 __pyx_t_4 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 515, __pyx_L6_error)
9738
9739
9740 /* "View.MemoryView":514
9741 *
9742 *
9743 * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
9744 * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9745 * slice_assign_scalar(dst_slice, dst.view.ndim, <size_t> self.view.itemsize,
9746*/
9747 }
9748
9749 /* "View.MemoryView":516
9750 * if self.view.suboffsets != NULL:
9751 * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9752 * slice_assign_scalar(dst_slice, dst.view.ndim, <size_t> self.view.itemsize, # <<<<<<<<<<<<<<
9753 * item, self.dtype_is_object)
9754 * finally:
9755*/
9756 __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, ((size_t)__pyx_v_self->view.itemsize), __pyx_v_item, __pyx_v_self->dtype_is_object);
9757 }
9758
9759 /* "View.MemoryView":519
9760 * item, self.dtype_is_object)
9761 * finally:
9762 * PyMem_Free(tmp) # <<<<<<<<<<<<<<
9763 *
9764 *
9765*/
9766 /*finally:*/ {
9767 /*normal exit:*/{
9768 PyMem_Free(__pyx_v_tmp);
9769 goto __pyx_L7;
9770 }
9771 __pyx_L6_error:;
9772 /*exception exit:*/{
9773 __Pyx_PyThreadState_declare
9774 __Pyx_PyThreadState_assign
9775 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9776 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9777 __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
9778 if ( unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
9779 __Pyx_XGOTREF(__pyx_t_7);
9780 __Pyx_XGOTREF(__pyx_t_8);
9781 __Pyx_XGOTREF(__pyx_t_9);
9782 __Pyx_XGOTREF(__pyx_t_10);
9783 __Pyx_XGOTREF(__pyx_t_11);
9784 __Pyx_XGOTREF(__pyx_t_12);
9785 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
9786 {
9787 PyMem_Free(__pyx_v_tmp);
9788 }
9789 __Pyx_XGIVEREF(__pyx_t_10);
9790 __Pyx_XGIVEREF(__pyx_t_11);
9791 __Pyx_XGIVEREF(__pyx_t_12);
9792 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
9793 __Pyx_XGIVEREF(__pyx_t_7);
9794 __Pyx_XGIVEREF(__pyx_t_8);
9795 __Pyx_XGIVEREF(__pyx_t_9);
9796 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
9797 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9798 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
9799 goto __pyx_L1_error;
9800 }
9801 __pyx_L7:;
9802 }
9803
9804 /* "View.MemoryView":489
9805 *
9806 *
9807 * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
9808 * cdef int array[128]
9809 * cdef void *tmp = NULL
9810*/
9811
9812 /* function exit code */
9813 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9814 goto __pyx_L0;
9815 __pyx_L1_error:;
9816 __Pyx_XDECREF(__pyx_t_3);
9817 __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
9818 __pyx_r = 0;
9819 __pyx_L0:;
9820
9821
9822
9823
9824
9825 __Pyx_XGIVEREF(__pyx_r);
9826 __Pyx_RefNannyFinishContext();
9827 return __pyx_r;
9828}
9829
9830/* "View.MemoryView":522
9831 *
9832 *
9833 * cdef setitem_indexed(self, indices: tuple, value): # <<<<<<<<<<<<<<
9834 * cdef char *itemp = memoryview.get_item_pointer(self, indices)
9835 * self.assign_item_from_object(itemp, value)
9836*/
9837
9838static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_value) {
9839 char *__pyx_v_itemp;
9840 PyObject *__pyx_r = NULL;
9841 __Pyx_RefNannyDeclarations
9842 char *__pyx_t_1;
9843 PyObject *__pyx_t_2 = NULL;
9844 int __pyx_lineno = 0;
9845 const char *__pyx_filename = NULL;
9846 int __pyx_clineno = 0;
9847 __Pyx_RefNannySetupContext("setitem_indexed", 0);
9848
9849 /* "View.MemoryView":523
9850 *
9851 * cdef setitem_indexed(self, indices: tuple, value):
9852 * cdef char *itemp = memoryview.get_item_pointer(self, indices) # <<<<<<<<<<<<<<
9853 * self.assign_item_from_object(itemp, value)
9854 *
9855*/
9856 __pyx_t_1 = __pyx_memoryview_get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 523, __pyx_L1_error)
9857 __pyx_v_itemp = __pyx_t_1;
9858
9859 /* "View.MemoryView":524
9860 * cdef setitem_indexed(self, indices: tuple, value):
9861 * cdef char *itemp = memoryview.get_item_pointer(self, indices)
9862 * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
9863 *
9864 *
9865*/
9866 __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 524, __pyx_L1_error)
9867 __Pyx_GOTREF(__pyx_t_2);
9868 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9869
9870 /* "View.MemoryView":522
9871 *
9872 *
9873 * cdef setitem_indexed(self, indices: tuple, value): # <<<<<<<<<<<<<<
9874 * cdef char *itemp = memoryview.get_item_pointer(self, indices)
9875 * self.assign_item_from_object(itemp, value)
9876*/
9877
9878 /* function exit code */
9879 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9880 goto __pyx_L0;
9881 __pyx_L1_error:;
9882 __Pyx_XDECREF(__pyx_t_2);
9883 __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
9884 __pyx_r = 0;
9885 __pyx_L0:;
9886
9887 __Pyx_XGIVEREF(__pyx_r);
9888 __Pyx_RefNannyFinishContext();
9889 return __pyx_r;
9890}
9891
9892/* "View.MemoryView":527
9893 *
9894 *
9895 * cdef setitem_indexed1(self, index, value): # <<<<<<<<<<<<<<
9896 * cdef char *buffer = <char *> self.view.buf
9897 * cdef char *itemp = pybuffer_index(&self.view, buffer, index, 0)
9898*/
9899
9900static PyObject *__pyx_memoryview_setitem_indexed1(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9901 char *__pyx_v_buffer;
9902 char *__pyx_v_itemp;
9903 PyObject *__pyx_r = NULL;
9904 __Pyx_RefNannyDeclarations
9905 Py_ssize_t __pyx_t_1;
9906 char *__pyx_t_2;
9907 PyObject *__pyx_t_3 = NULL;
9908 int __pyx_lineno = 0;
9909 const char *__pyx_filename = NULL;
9910 int __pyx_clineno = 0;
9911 __Pyx_RefNannySetupContext("setitem_indexed1", 0);
9912
9913 /* "View.MemoryView":528
9914 *
9915 * cdef setitem_indexed1(self, index, value):
9916 * cdef char *buffer = <char *> self.view.buf # <<<<<<<<<<<<<<
9917 * cdef char *itemp = pybuffer_index(&self.view, buffer, index, 0)
9918 * self.assign_item_from_object(itemp, value)
9919*/
9920 __pyx_v_buffer = ((char *)__pyx_v_self->view.buf);
9921
9922 /* "View.MemoryView":529
9923 * cdef setitem_indexed1(self, index, value):
9924 * cdef char *buffer = <char *> self.view.buf
9925 * cdef char *itemp = pybuffer_index(&self.view, buffer, index, 0) # <<<<<<<<<<<<<<
9926 * self.assign_item_from_object(itemp, value)
9927 *
9928*/
9929 __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 529, __pyx_L1_error)
9930 __pyx_t_2 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_buffer, __pyx_t_1, 0); if (unlikely(__pyx_t_2 == ((void *)NULL))) __PYX_ERR(1, 529, __pyx_L1_error)
9931 __pyx_v_itemp = __pyx_t_2;
9932
9933
9934 /* "View.MemoryView":530
9935 * cdef char *buffer = <char *> self.view.buf
9936 * cdef char *itemp = pybuffer_index(&self.view, buffer, index, 0)
9937 * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
9938 *
9939 * cdef convert_item_to_object(self, char *itemp):
9940*/
9941 __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 530, __pyx_L1_error)
9942 __Pyx_GOTREF(__pyx_t_3);
9943 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9944
9945 /* "View.MemoryView":527
9946 *
9947 *
9948 * cdef setitem_indexed1(self, index, value): # <<<<<<<<<<<<<<
9949 * cdef char *buffer = <char *> self.view.buf
9950 * cdef char *itemp = pybuffer_index(&self.view, buffer, index, 0)
9951*/
9952
9953 /* function exit code */
9954 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9955 goto __pyx_L0;
9956 __pyx_L1_error:;
9957 __Pyx_XDECREF(__pyx_t_3);
9958 __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed1", __pyx_clineno, __pyx_lineno, __pyx_filename);
9959 __pyx_r = 0;
9960 __pyx_L0:;
9961
9962
9963 __Pyx_XGIVEREF(__pyx_r);
9964 __Pyx_RefNannyFinishContext();
9965 return __pyx_r;
9966}
9967
9968/* "View.MemoryView":532
9969 * self.assign_item_from_object(itemp, value)
9970 *
9971 * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
9972 * """Only used if instantiated manually by the user, or if Cython doesn't
9973 * know how to convert the type"""
9974*/
9975
9976static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
9977 PyObject *__pyx_v_struct = NULL;
9978 PyObject *__pyx_v_bytesitem = 0;
9979 PyObject *__pyx_v_result = NULL;
9980 PyObject *__pyx_r = NULL;
9981 __Pyx_RefNannyDeclarations
9982 PyObject *__pyx_t_1 = NULL;
9983 PyObject *__pyx_t_2 = NULL;
9984 PyObject *__pyx_t_3 = NULL;
9985 PyObject *__pyx_t_4 = NULL;
9986 PyObject *__pyx_t_5 = NULL;
9987 PyObject *__pyx_t_6 = NULL;
9988 size_t __pyx_t_7;
9989 Py_ssize_t __pyx_t_8;
9990 int __pyx_t_9;
9991 PyObject *__pyx_t_10 = NULL;
9992 int __pyx_t_11;
9993 int __pyx_lineno = 0;
9994 const char *__pyx_filename = NULL;
9995 int __pyx_clineno = 0;
9996 __Pyx_RefNannySetupContext("convert_item_to_object", 0);
9997
9998 /* "View.MemoryView":535
9999 * """Only used if instantiated manually by the user, or if Cython doesn't
10000 * know how to convert the type"""
10001 * import struct # <<<<<<<<<<<<<<
10002 * cdef bytes bytesitem
10003 *
10004*/
10005 __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_struct, 0, 0, NULL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 535, __pyx_L1_error)
10006 __pyx_t_1 = __pyx_t_2;
10007 __Pyx_GOTREF(__pyx_t_1);
10008 __pyx_v_struct = __pyx_t_1;
10009 __pyx_t_1 = 0;
10010
10011 /* "View.MemoryView":538
10012 * cdef bytes bytesitem
10013 *
10014 * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
10015 * try:
10016 * result = struct.unpack(self.view.format, bytesitem)
10017*/
10018 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 538, __pyx_L1_error)
10019 __Pyx_GOTREF(__pyx_t_1);
10020 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
10021 __pyx_t_1 = 0;
10022
10023 /* "View.MemoryView":539
10024 *
10025 * bytesitem = itemp[:self.view.itemsize]
10026 * try: # <<<<<<<<<<<<<<
10027 * result = struct.unpack(self.view.format, bytesitem)
10028 * except struct.error:
10029*/
10030 {
10031 __Pyx_PyThreadState_declare
10032 __Pyx_PyThreadState_assign
10033 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
10034 __Pyx_XGOTREF(__pyx_t_2);
10035 __Pyx_XGOTREF(__pyx_t_3);
10036 __Pyx_XGOTREF(__pyx_t_4);
10037 /*try:*/ {
10038
10039 /* "View.MemoryView":540
10040 * bytesitem = itemp[:self.view.itemsize]
10041 * try:
10042 * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
10043 * except struct.error:
10044 * _err_ValueError("Unable to convert item to object")
10045*/
10046 __pyx_t_5 = __pyx_v_struct;
10047 __Pyx_INCREF(__pyx_t_5);
10048 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 540, __pyx_L3_error)
10049 __Pyx_GOTREF(__pyx_t_6);
10050 __pyx_t_7 = 0;
10051 {
10052 PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_6, __pyx_v_bytesitem};
10053 __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_unpack, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
10054 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10055 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10056 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __pyx_L3_error)
10057 __Pyx_GOTREF(__pyx_t_1);
10058 }
10059 __pyx_v_result = __pyx_t_1;
10060 __pyx_t_1 = 0;
10061
10062 /* "View.MemoryView":539
10063 *
10064 * bytesitem = itemp[:self.view.itemsize]
10065 * try: # <<<<<<<<<<<<<<
10066 * result = struct.unpack(self.view.format, bytesitem)
10067 * except struct.error:
10068*/
10069 }
10070
10071 /* "View.MemoryView":544
10072 * _err_ValueError("Unable to convert item to object")
10073 * else:
10074 * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
10075 * return result[0]
10076 * return result
10077*/
10078 /*else:*/ {
10079 __pyx_t_8 = __Pyx_ssize_strlen(__pyx_v_self->view.format); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 544, __pyx_L5_except_error)
10080 __pyx_t_9 = (__pyx_t_8 == 1);
10081
10082
10083 if (__pyx_t_9) {
10084
10085
10086 /* "View.MemoryView":545
10087 * else:
10088 * if len(self.view.format) == 1:
10089 * return result[0] # <<<<<<<<<<<<<<
10090 * return result
10091 *
10092*/
10093 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 545, __pyx_L5_except_error)
10094 __Pyx_GOTREF(__pyx_t_1);
10095 {
10096 PyObject *__pyx_temp;
10097 {
10098 __pyx_temp = __pyx_r;
10099 __pyx_r = __pyx_t_1;
10100 }
10101 __Pyx_XDECREF(__pyx_temp);
10102 }
10103 __pyx_t_1 = 0;
10104 goto __pyx_L6_except_return;
10105
10106 /* "View.MemoryView":544
10107 * _err_ValueError("Unable to convert item to object")
10108 * else:
10109 * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
10110 * return result[0]
10111 * return result
10112*/
10113 }
10114
10115 /* "View.MemoryView":546
10116 * if len(self.view.format) == 1:
10117 * return result[0]
10118 * return result # <<<<<<<<<<<<<<
10119 *
10120 * cdef assign_item_from_object(self, char *itemp, object value):
10121*/
10122 {
10123 PyObject *__pyx_temp;
10124 {
10125 __pyx_temp = __pyx_r;
10126 __Pyx_INCREF(__pyx_v_result);
10127 __pyx_r = __pyx_v_result;
10128 }
10129 __Pyx_XDECREF(__pyx_temp);
10130 }
10131 goto __pyx_L6_except_return;
10132 }
10133 __pyx_L3_error:;
10134 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
10135 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10136 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10137
10138 /* "View.MemoryView":541
10139 * try:
10140 * result = struct.unpack(self.view.format, bytesitem)
10141 * except struct.error: # <<<<<<<<<<<<<<
10142 * _err_ValueError("Unable to convert item to object")
10143 * else:
10144*/
10145 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_6, &__pyx_t_5);
10146 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_mstate_global->__pyx_n_u_error); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 541, __pyx_L5_except_error)
10147 __Pyx_GOTREF(__pyx_t_10);
10148 __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_10);
10149 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
10150 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_6, __pyx_t_5);
10151 __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_5 = 0;
10152 if (__pyx_t_11) {
10153 __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10154 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_1) < 0) __PYX_ERR(1, 541, __pyx_L5_except_error)
10155 __Pyx_XGOTREF(__pyx_t_5);
10156 __Pyx_XGOTREF(__pyx_t_6);
10157 __Pyx_XGOTREF(__pyx_t_1);
10158
10159 /* "View.MemoryView":542
10160 * result = struct.unpack(self.view.format, bytesitem)
10161 * except struct.error:
10162 * _err_ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
10163 * else:
10164 * if len(self.view.format) == 1:
10165*/
10166 __pyx_t_11 = __pyx_memoryview_err_ValueError(__pyx_k_Unable_to_convert_item_to_object); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 542, __pyx_L5_except_error)
10167
10168 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10169 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10170 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
10171 goto __pyx_L4_exception_handled;
10172 }
10173 goto __pyx_L5_except_error;
10174
10175 /* "View.MemoryView":539
10176 *
10177 * bytesitem = itemp[:self.view.itemsize]
10178 * try: # <<<<<<<<<<<<<<
10179 * result = struct.unpack(self.view.format, bytesitem)
10180 * except struct.error:
10181*/
10182 __pyx_L5_except_error:;
10183 __Pyx_XGIVEREF(__pyx_t_2);
10184 __Pyx_XGIVEREF(__pyx_t_3);
10185 __Pyx_XGIVEREF(__pyx_t_4);
10186 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
10187 goto __pyx_L1_error;
10188 __pyx_L6_except_return:;
10189 __Pyx_XGIVEREF(__pyx_t_2);
10190 __Pyx_XGIVEREF(__pyx_t_3);
10191 __Pyx_XGIVEREF(__pyx_t_4);
10192 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
10193 goto __pyx_L0;
10194 __pyx_L4_exception_handled:;
10195 __Pyx_XGIVEREF(__pyx_t_2);
10196 __Pyx_XGIVEREF(__pyx_t_3);
10197 __Pyx_XGIVEREF(__pyx_t_4);
10198 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
10199 }
10200
10201 /* "View.MemoryView":532
10202 * self.assign_item_from_object(itemp, value)
10203 *
10204 * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
10205 * """Only used if instantiated manually by the user, or if Cython doesn't
10206 * know how to convert the type"""
10207*/
10208
10209 /* function exit code */
10210 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10211 goto __pyx_L0;
10212 __pyx_L1_error:;
10213 __Pyx_XDECREF(__pyx_t_1);
10214 __Pyx_XDECREF(__pyx_t_5);
10215 __Pyx_XDECREF(__pyx_t_6);
10216 __Pyx_XDECREF(__pyx_t_10);
10217 __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10218 __pyx_r = 0;
10219 __pyx_L0:;
10220 __Pyx_XDECREF(__pyx_v_struct);
10221 __Pyx_XDECREF(__pyx_v_bytesitem);
10222 __Pyx_XDECREF(__pyx_v_result);
10223 __Pyx_XGIVEREF(__pyx_r);
10224 __Pyx_RefNannyFinishContext();
10225 return __pyx_r;
10226}
10227
10228/* "View.MemoryView":548
10229 * return result
10230 *
10231 * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
10232 * """Only used if instantiated manually by the user, or if Cython doesn't
10233 * know how to convert the type"""
10234*/
10235
10236static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
10237 PyObject *__pyx_v_struct = NULL;
10238 char __pyx_v_c;
10239 PyObject *__pyx_v_bytesvalue = 0;
10240 Py_ssize_t __pyx_v_i;
10241 PyObject *__pyx_r = NULL;
10242 __Pyx_RefNannyDeclarations
10243 PyObject *__pyx_t_1 = NULL;
10244 PyObject *__pyx_t_2 = NULL;
10245 int __pyx_t_3;
10246 PyObject *__pyx_t_4 = NULL;
10247 PyObject *__pyx_t_5 = NULL;
10248 PyObject *__pyx_t_6 = NULL;
10249 size_t __pyx_t_7;
10250 Py_ssize_t __pyx_t_8;
10251 PyObject *__pyx_t_9 = NULL;
10252 char *__pyx_t_10;
10253 char *__pyx_t_11;
10254 Py_ssize_t __pyx_t_12;
10255 char *__pyx_t_13;
10256 char *__pyx_t_14;
10257 int __pyx_lineno = 0;
10258 const char *__pyx_filename = NULL;
10259 int __pyx_clineno = 0;
10260 __Pyx_RefNannySetupContext("assign_item_from_object", 0);
10261
10262 /* "View.MemoryView":551
10263 * """Only used if instantiated manually by the user, or if Cython doesn't
10264 * know how to convert the type"""
10265 * import struct # <<<<<<<<<<<<<<
10266 * cdef char c
10267 * cdef bytes bytesvalue
10268*/
10269 __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_struct, 0, 0, NULL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 551, __pyx_L1_error)
10270 __pyx_t_1 = __pyx_t_2;
10271 __Pyx_GOTREF(__pyx_t_1);
10272 __pyx_v_struct = __pyx_t_1;
10273 __pyx_t_1 = 0;
10274
10275 /* "View.MemoryView":556
10276 * cdef Py_ssize_t i
10277 *
10278 * if isinstance(value, tuple): # <<<<<<<<<<<<<<
10279 * bytesvalue = struct.pack(self.view.format, *value)
10280 * else:
10281*/
10282 __pyx_t_3 = PyTuple_Check(__pyx_v_value);
10283 if (__pyx_t_3) {
10284
10285
10286 /* "View.MemoryView":557
10287 *
10288 * if isinstance(value, tuple):
10289 * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
10290 * else:
10291 * bytesvalue = struct.pack(self.view.format, value)
10292*/
10293 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_mstate_global->__pyx_n_u_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 557, __pyx_L1_error)
10294 __Pyx_GOTREF(__pyx_t_1);
10295 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 557, __pyx_L1_error)
10296 __Pyx_GOTREF(__pyx_t_4);
10297 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 557, __pyx_L1_error)
10298 __Pyx_GOTREF(__pyx_t_5);
10299 __Pyx_GIVEREF(__pyx_t_4);
10300 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4) != (0)) __PYX_ERR(1, 557, __pyx_L1_error);
10301 __pyx_t_4 = 0;
10302 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 557, __pyx_L1_error)
10303 __Pyx_GOTREF(__pyx_t_4);
10304 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 557, __pyx_L1_error)
10305 __Pyx_GOTREF(__pyx_t_6);
10306 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10307 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10308 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 557, __pyx_L1_error)
10309 __Pyx_GOTREF(__pyx_t_4);
10310 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10311 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10312 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(1, 557, __pyx_L1_error)
10313 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
10314 __pyx_t_4 = 0;
10315
10316 /* "View.MemoryView":556
10317 * cdef Py_ssize_t i
10318 *
10319 * if isinstance(value, tuple): # <<<<<<<<<<<<<<
10320 * bytesvalue = struct.pack(self.view.format, *value)
10321 * else:
10322*/
10323 goto __pyx_L3;
10324 }
10325
10326 /* "View.MemoryView":559
10327 * bytesvalue = struct.pack(self.view.format, *value)
10328 * else:
10329 * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
10330 *
10331 * for i, c in enumerate(bytesvalue):
10332*/
10333 /*else*/ {
10334 __pyx_t_6 = __pyx_v_struct;
10335 __Pyx_INCREF(__pyx_t_6);
10336 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 559, __pyx_L1_error)
10337 __Pyx_GOTREF(__pyx_t_1);
10338 __pyx_t_7 = 0;
10339 {
10340 PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_1, __pyx_v_value};
10341 __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_pack, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
10342 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10343 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10344 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 559, __pyx_L1_error)
10345 __Pyx_GOTREF(__pyx_t_4);
10346 }
10347 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(1, 559, __pyx_L1_error)
10348 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
10349 __pyx_t_4 = 0;
10350 }
10351 __pyx_L3:;
10352
10353 /* "View.MemoryView":561
10354 * bytesvalue = struct.pack(self.view.format, value)
10355 *
10356 * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
10357 * itemp[i] = c
10358 *
10359*/
10360
10361 __pyx_t_8 = 0;
10362 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
10363 PyErr_SetString(PyExc_TypeError, "\047NoneType\047 is not iterable");
10364 __PYX_ERR(1, 561, __pyx_L1_error)
10365 }
10366 __Pyx_INCREF(__pyx_v_bytesvalue);
10367 __pyx_t_9 = __pyx_v_bytesvalue;
10368 __pyx_t_11 = __Pyx_PyBytes_AsWritableString(__pyx_t_9); if (unlikely(__pyx_t_11 == ((char *)NULL))) __PYX_ERR(1, 561, __pyx_L1_error)
10369 __pyx_t_12 = __Pyx_PyBytes_GET_SIZE(__pyx_t_9); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(1, 561, __pyx_L1_error)
10370 __pyx_t_13 = (__pyx_t_11 + __pyx_t_12);
10371
10372 for (__pyx_t_14 = __pyx_t_11; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
10373 __pyx_t_10 = __pyx_t_14;
10374 __pyx_v_c = (__pyx_t_10[0]);
10375
10376 /* "View.MemoryView":562
10377 *
10378 * for i, c in enumerate(bytesvalue):
10379 * itemp[i] = c # <<<<<<<<<<<<<<
10380 *
10381 * @cname('getbuffer')
10382*/
10383 __pyx_v_i = __pyx_t_8;
10384
10385 /* "View.MemoryView":561
10386 * bytesvalue = struct.pack(self.view.format, value)
10387 *
10388 * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
10389 * itemp[i] = c
10390 *
10391*/
10392 __pyx_t_8 = (__pyx_t_8 + 1);
10393
10394 /* "View.MemoryView":562
10395 *
10396 * for i, c in enumerate(bytesvalue):
10397 * itemp[i] = c # <<<<<<<<<<<<<<
10398 *
10399 * @cname('getbuffer')
10400*/
10401 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
10402 }
10403
10404
10405
10406 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10407
10408 /* "View.MemoryView":548
10409 * return result
10410 *
10411 * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
10412 * """Only used if instantiated manually by the user, or if Cython doesn't
10413 * know how to convert the type"""
10414*/
10415
10416 /* function exit code */
10417 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10418 goto __pyx_L0;
10419 __pyx_L1_error:;
10420 __Pyx_XDECREF(__pyx_t_1);
10421 __Pyx_XDECREF(__pyx_t_4);
10422 __Pyx_XDECREF(__pyx_t_5);
10423 __Pyx_XDECREF(__pyx_t_6);
10424 __Pyx_XDECREF(__pyx_t_9);
10425 __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10426 __pyx_r = 0;
10427 __pyx_L0:;
10428 __Pyx_XDECREF(__pyx_v_struct);
10429
10430 __Pyx_XDECREF(__pyx_v_bytesvalue);
10431
10432 __Pyx_XGIVEREF(__pyx_r);
10433 __Pyx_RefNannyFinishContext();
10434 return __pyx_r;
10435}
10436
10437/* "View.MemoryView":564
10438 * itemp[i] = c
10439 *
10440 * @cname('getbuffer') # <<<<<<<<<<<<<<
10441 * def __getbuffer__(self, Py_buffer *info, int flags):
10442 * if cython.unlikely(flags & PyBUF_WRITABLE and self.view.readonly):
10443*/
10444
10445/* Python wrapper */
10446CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
10447CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
10448 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10449 int __pyx_r;
10450 __Pyx_RefNannyDeclarations
10451 __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
10452 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10453 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
10454
10455 /* function exit code */
10456
10457
10458 __Pyx_RefNannyFinishContext();
10459 return __pyx_r;
10460}
10461
10462static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
10463 int __pyx_r;
10464 __Pyx_RefNannyDeclarations
10465 int __pyx_t_1;
10466 int __pyx_t_2;
10467 int __pyx_t_3;
10468 Py_ssize_t *__pyx_t_4;
10469 char *__pyx_t_5;
10470 void *__pyx_t_6;
10471 Py_ssize_t __pyx_t_7;
10472 int __pyx_lineno = 0;
10473 const char *__pyx_filename = NULL;
10474 int __pyx_clineno = 0;
10475 if (unlikely(__pyx_v_info == NULL)) {
10476 PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
10477 return -1;
10478 }
10479 __Pyx_RefNannySetupContext("__getbuffer__", 0);
10480 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
10481 __Pyx_GIVEREF(__pyx_v_info->obj);
10482
10483 /* "View.MemoryView":566
10484 * @cname('getbuffer')
10485 * def __getbuffer__(self, Py_buffer *info, int flags):
10486 * if cython.unlikely(flags & PyBUF_WRITABLE and self.view.readonly): # <<<<<<<<<<<<<<
10487 * _err_ValueError("Cannot create writable memory view from read-only memoryview")
10488 *
10489*/
10490 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
10491
10492 if (__pyx_t_2) {
10493
10494 } else {
10495
10496 __pyx_t_1 = __pyx_t_2;
10497
10498 goto __pyx_L4_bool_binop_done;
10499 }
10500
10501 __pyx_t_1 = __pyx_v_self->view.readonly;
10502 __pyx_L4_bool_binop_done:;
10503 if (unlikely(__pyx_t_1)) {
10504
10505
10506 /* "View.MemoryView":567
10507 * def __getbuffer__(self, Py_buffer *info, int flags):
10508 * if cython.unlikely(flags & PyBUF_WRITABLE and self.view.readonly):
10509 * _err_ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
10510 *
10511 * if flags & PyBUF_ND:
10512*/
10513 __pyx_t_3 = __pyx_memoryview_err_ValueError(__pyx_k_Cannot_create_writable_memory_vi); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 567, __pyx_L1_error)
10514
10515
10516 /* "View.MemoryView":566
10517 * @cname('getbuffer')
10518 * def __getbuffer__(self, Py_buffer *info, int flags):
10519 * if cython.unlikely(flags & PyBUF_WRITABLE and self.view.readonly): # <<<<<<<<<<<<<<
10520 * _err_ValueError("Cannot create writable memory view from read-only memoryview")
10521 *
10522*/
10523 }
10524
10525 /* "View.MemoryView":569
10526 * _err_ValueError("Cannot create writable memory view from read-only memoryview")
10527 *
10528 * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
10529 * info.shape = self.view.shape
10530 * else:
10531*/
10532 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
10533
10534 if (__pyx_t_1) {
10535
10536
10537 /* "View.MemoryView":570
10538 *
10539 * if flags & PyBUF_ND:
10540 * info.shape = self.view.shape # <<<<<<<<<<<<<<
10541 * else:
10542 * info.shape = NULL
10543*/
10544 __pyx_t_4 = __pyx_v_self->view.shape;
10545
10546 __pyx_v_info->shape = __pyx_t_4;
10547
10548 /* "View.MemoryView":569
10549 * _err_ValueError("Cannot create writable memory view from read-only memoryview")
10550 *
10551 * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
10552 * info.shape = self.view.shape
10553 * else:
10554*/
10555 goto __pyx_L6;
10556 }
10557
10558 /* "View.MemoryView":572
10559 * info.shape = self.view.shape
10560 * else:
10561 * info.shape = NULL # <<<<<<<<<<<<<<
10562 *
10563 * if flags & PyBUF_STRIDES:
10564*/
10565 /*else*/ {
10566 __pyx_v_info->shape = NULL;
10567 }
10568 __pyx_L6:;
10569
10570 /* "View.MemoryView":574
10571 * info.shape = NULL
10572 *
10573 * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
10574 * info.strides = self.view.strides
10575 * else:
10576*/
10577 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
10578
10579 if (__pyx_t_1) {
10580
10581
10582 /* "View.MemoryView":575
10583 *
10584 * if flags & PyBUF_STRIDES:
10585 * info.strides = self.view.strides # <<<<<<<<<<<<<<
10586 * else:
10587 * info.strides = NULL
10588*/
10589 __pyx_t_4 = __pyx_v_self->view.strides;
10590
10591 __pyx_v_info->strides = __pyx_t_4;
10592
10593 /* "View.MemoryView":574
10594 * info.shape = NULL
10595 *
10596 * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
10597 * info.strides = self.view.strides
10598 * else:
10599*/
10600 goto __pyx_L7;
10601 }
10602
10603 /* "View.MemoryView":577
10604 * info.strides = self.view.strides
10605 * else:
10606 * info.strides = NULL # <<<<<<<<<<<<<<
10607 *
10608 * if flags & PyBUF_INDIRECT:
10609*/
10610 /*else*/ {
10611 __pyx_v_info->strides = NULL;
10612 }
10613 __pyx_L7:;
10614
10615 /* "View.MemoryView":579
10616 * info.strides = NULL
10617 *
10618 * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
10619 * info.suboffsets = self.view.suboffsets
10620 * else:
10621*/
10622 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
10623
10624 if (__pyx_t_1) {
10625
10626
10627 /* "View.MemoryView":580
10628 *
10629 * if flags & PyBUF_INDIRECT:
10630 * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
10631 * else:
10632 * info.suboffsets = NULL
10633*/
10634 __pyx_t_4 = __pyx_v_self->view.suboffsets;
10635
10636 __pyx_v_info->suboffsets = __pyx_t_4;
10637
10638 /* "View.MemoryView":579
10639 * info.strides = NULL
10640 *
10641 * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
10642 * info.suboffsets = self.view.suboffsets
10643 * else:
10644*/
10645 goto __pyx_L8;
10646 }
10647
10648 /* "View.MemoryView":582
10649 * info.suboffsets = self.view.suboffsets
10650 * else:
10651 * info.suboffsets = NULL # <<<<<<<<<<<<<<
10652 *
10653 * if flags & PyBUF_FORMAT:
10654*/
10655 /*else*/ {
10656 __pyx_v_info->suboffsets = NULL;
10657 }
10658 __pyx_L8:;
10659
10660 /* "View.MemoryView":584
10661 * info.suboffsets = NULL
10662 *
10663 * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10664 * info.format = self.view.format
10665 * else:
10666*/
10667 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10668
10669 if (__pyx_t_1) {
10670
10671
10672 /* "View.MemoryView":585
10673 *
10674 * if flags & PyBUF_FORMAT:
10675 * info.format = self.view.format # <<<<<<<<<<<<<<
10676 * else:
10677 * info.format = NULL
10678*/
10679 __pyx_t_5 = __pyx_v_self->view.format;
10680
10681 __pyx_v_info->format = __pyx_t_5;
10682
10683 /* "View.MemoryView":584
10684 * info.suboffsets = NULL
10685 *
10686 * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10687 * info.format = self.view.format
10688 * else:
10689*/
10690 goto __pyx_L9;
10691 }
10692
10693 /* "View.MemoryView":587
10694 * info.format = self.view.format
10695 * else:
10696 * info.format = NULL # <<<<<<<<<<<<<<
10697 *
10698 * info.buf = self.view.buf
10699*/
10700 /*else*/ {
10701 __pyx_v_info->format = NULL;
10702 }
10703 __pyx_L9:;
10704
10705 /* "View.MemoryView":589
10706 * info.format = NULL
10707 *
10708 * info.buf = self.view.buf # <<<<<<<<<<<<<<
10709 * info.ndim = self.view.ndim
10710 * info.itemsize = self.view.itemsize
10711*/
10712 __pyx_t_6 = __pyx_v_self->view.buf;
10713
10714 __pyx_v_info->buf = __pyx_t_6;
10715
10716 /* "View.MemoryView":590
10717 *
10718 * info.buf = self.view.buf
10719 * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
10720 * info.itemsize = self.view.itemsize
10721 * info.len = self.view.len
10722*/
10723 __pyx_t_3 = __pyx_v_self->view.ndim;
10724
10725 __pyx_v_info->ndim = __pyx_t_3;
10726
10727 /* "View.MemoryView":591
10728 * info.buf = self.view.buf
10729 * info.ndim = self.view.ndim
10730 * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
10731 * info.len = self.view.len
10732 * info.readonly = self.view.readonly
10733*/
10734 __pyx_t_7 = __pyx_v_self->view.itemsize;
10735
10736 __pyx_v_info->itemsize = __pyx_t_7;
10737
10738 /* "View.MemoryView":592
10739 * info.ndim = self.view.ndim
10740 * info.itemsize = self.view.itemsize
10741 * info.len = self.view.len # <<<<<<<<<<<<<<
10742 * info.readonly = self.view.readonly
10743 * info.obj = self
10744*/
10745 __pyx_t_7 = __pyx_v_self->view.len;
10746
10747 __pyx_v_info->len = __pyx_t_7;
10748
10749 /* "View.MemoryView":593
10750 * info.itemsize = self.view.itemsize
10751 * info.len = self.view.len
10752 * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
10753 * info.obj = self
10754 *
10755*/
10756 __pyx_t_1 = __pyx_v_self->view.readonly;
10757
10758 __pyx_v_info->readonly = __pyx_t_1;
10759
10760 /* "View.MemoryView":594
10761 * info.len = self.view.len
10762 * info.readonly = self.view.readonly
10763 * info.obj = self # <<<<<<<<<<<<<<
10764 *
10765 *
10766*/
10767 __Pyx_INCREF((PyObject *)__pyx_v_self);
10768 __Pyx_GIVEREF((PyObject *)__pyx_v_self);
10769 __Pyx_GOTREF(__pyx_v_info->obj);
10770 __Pyx_DECREF(__pyx_v_info->obj);
10771 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
10772
10773 /* "View.MemoryView":564
10774 * itemp[i] = c
10775 *
10776 * @cname('getbuffer') # <<<<<<<<<<<<<<
10777 * def __getbuffer__(self, Py_buffer *info, int flags):
10778 * if cython.unlikely(flags & PyBUF_WRITABLE and self.view.readonly):
10779*/
10780
10781 /* function exit code */
10782 __pyx_r = 0;
10783 goto __pyx_L0;
10784 __pyx_L1_error:;
10785 __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10786 __pyx_r = -1;
10787 if (__pyx_v_info->obj != NULL) {
10788 __Pyx_GOTREF(__pyx_v_info->obj);
10789 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10790 }
10791 goto __pyx_L2;
10792 __pyx_L0:;
10793 if (__pyx_v_info->obj == Py_None) {
10794 __Pyx_GOTREF(__pyx_v_info->obj);
10795 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10796 }
10797 __pyx_L2:;
10798
10799 __Pyx_RefNannyFinishContext();
10800 return __pyx_r;
10801}
10802
10803/* "View.MemoryView":597
10804 *
10805 *
10806 * @property # <<<<<<<<<<<<<<
10807 * def T(self):
10808 * cdef _memoryviewslice result = memoryview_copy(self)
10809*/
10810
10811/* Python wrapper */
10812static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
10813static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
10814 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10815 PyObject *__pyx_r = 0;
10816 __Pyx_RefNannyDeclarations
10817 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10818 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10819 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10820
10821 /* function exit code */
10822 __Pyx_RefNannyFinishContext();
10823 return __pyx_r;
10824}
10825
10826static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10827 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
10828 PyObject *__pyx_r = NULL;
10829 __Pyx_RefNannyDeclarations
10830 PyObject *__pyx_t_1 = NULL;
10831 int __pyx_t_2;
10832 int __pyx_lineno = 0;
10833 const char *__pyx_filename = NULL;
10834 int __pyx_clineno = 0;
10835 __Pyx_RefNannySetupContext("__get__", 0);
10836
10837 /* "View.MemoryView":599
10838 * @property
10839 * def T(self):
10840 * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
10841 * transpose_memslice(&result.from_slice)
10842 * return result
10843*/
10844 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 599, __pyx_L1_error)
10845 __Pyx_GOTREF(__pyx_t_1);
10846 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_memoryviewslice_type))))) __PYX_ERR(1, 599, __pyx_L1_error)
10847 __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
10848 __pyx_t_1 = 0;
10849
10850 /* "View.MemoryView":600
10851 * def T(self):
10852 * cdef _memoryviewslice result = memoryview_copy(self)
10853 * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
10854 * return result
10855 *
10856*/
10857 __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 600, __pyx_L1_error)
10858
10859
10860 /* "View.MemoryView":601
10861 * cdef _memoryviewslice result = memoryview_copy(self)
10862 * transpose_memslice(&result.from_slice)
10863 * return result # <<<<<<<<<<<<<<
10864 *
10865 * @property
10866*/
10867 {
10868 PyObject *__pyx_temp;
10869 {
10870 __pyx_temp = __pyx_r;
10871 __Pyx_INCREF((PyObject *)__pyx_v_result);
10872 __pyx_r = ((PyObject *)__pyx_v_result);
10873 }
10874 __Pyx_XDECREF(__pyx_temp);
10875 }
10876 goto __pyx_L0;
10877
10878 /* "View.MemoryView":597
10879 *
10880 *
10881 * @property # <<<<<<<<<<<<<<
10882 * def T(self):
10883 * cdef _memoryviewslice result = memoryview_copy(self)
10884*/
10885
10886 /* function exit code */
10887 __pyx_L1_error:;
10888 __Pyx_XDECREF(__pyx_t_1);
10889 __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10890 __pyx_r = NULL;
10891 __pyx_L0:;
10892 __Pyx_XDECREF((PyObject *)__pyx_v_result);
10893 __Pyx_XGIVEREF(__pyx_r);
10894 __Pyx_RefNannyFinishContext();
10895 return __pyx_r;
10896}
10897
10898/* "View.MemoryView":603
10899 * return result
10900 *
10901 * @property # <<<<<<<<<<<<<<
10902 * def base(self):
10903 * return self._get_base()
10904*/
10905
10906/* Python wrapper */
10907static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
10908static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
10909 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10910 PyObject *__pyx_r = 0;
10911 __Pyx_RefNannyDeclarations
10912 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10913 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10914 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10915
10916 /* function exit code */
10917 __Pyx_RefNannyFinishContext();
10918 return __pyx_r;
10919}
10920
10921static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10922 PyObject *__pyx_r = NULL;
10923 __Pyx_RefNannyDeclarations
10924 PyObject *__pyx_t_1 = NULL;
10925 int __pyx_lineno = 0;
10926 const char *__pyx_filename = NULL;
10927 int __pyx_clineno = 0;
10928 __Pyx_RefNannySetupContext("__get__", 0);
10929
10930 /* "View.MemoryView":605
10931 * @property
10932 * def base(self):
10933 * return self._get_base() # <<<<<<<<<<<<<<
10934 *
10935 * cdef _get_base(self):
10936*/
10937 __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->_get_base(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 605, __pyx_L1_error)
10938 __Pyx_GOTREF(__pyx_t_1);
10939 {
10940 PyObject *__pyx_temp;
10941 {
10942 __pyx_temp = __pyx_r;
10943 __pyx_r = __pyx_t_1;
10944 }
10945 __Pyx_XDECREF(__pyx_temp);
10946 }
10947 __pyx_t_1 = 0;
10948 goto __pyx_L0;
10949
10950 /* "View.MemoryView":603
10951 * return result
10952 *
10953 * @property # <<<<<<<<<<<<<<
10954 * def base(self):
10955 * return self._get_base()
10956*/
10957
10958 /* function exit code */
10959 __pyx_L1_error:;
10960 __Pyx_XDECREF(__pyx_t_1);
10961 __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10962 __pyx_r = NULL;
10963 __pyx_L0:;
10964 __Pyx_XGIVEREF(__pyx_r);
10965 __Pyx_RefNannyFinishContext();
10966 return __pyx_r;
10967}
10968
10969/* "View.MemoryView":607
10970 * return self._get_base()
10971 *
10972 * cdef _get_base(self): # <<<<<<<<<<<<<<
10973 * return self.obj
10974 *
10975*/
10976
10977static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self) {
10978 PyObject *__pyx_r = NULL;
10979 __Pyx_RefNannyDeclarations
10980 __Pyx_RefNannySetupContext("_get_base", 0);
10981
10982 /* "View.MemoryView":608
10983 *
10984 * cdef _get_base(self):
10985 * return self.obj # <<<<<<<<<<<<<<
10986 *
10987 * @property
10988*/
10989 {
10990 PyObject *__pyx_temp;
10991 {
10992 __pyx_temp = __pyx_r;
10993 __Pyx_INCREF(__pyx_v_self->obj);
10994 __pyx_r = __pyx_v_self->obj;
10995 }
10996 __Pyx_XDECREF(__pyx_temp);
10997 }
10998 goto __pyx_L0;
10999
11000 /* "View.MemoryView":607
11001 * return self._get_base()
11002 *
11003 * cdef _get_base(self): # <<<<<<<<<<<<<<
11004 * return self.obj
11005 *
11006*/
11007
11008 /* function exit code */
11009 __pyx_L0:;
11010 __Pyx_XGIVEREF(__pyx_r);
11011 __Pyx_RefNannyFinishContext();
11012 return __pyx_r;
11013}
11014
11015/* "View.MemoryView":610
11016 * return self.obj
11017 *
11018 * @property # <<<<<<<<<<<<<<
11019 * def shape(self):
11020 * return tuple([length for length in self.view.shape[:self.view.ndim]])
11021*/
11022
11023/* Python wrapper */
11024static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
11025static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
11026 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11027 PyObject *__pyx_r = 0;
11028 __Pyx_RefNannyDeclarations
11029 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11030 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11031 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11032
11033 /* function exit code */
11034 __Pyx_RefNannyFinishContext();
11035 return __pyx_r;
11036}
11037
11038static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11039 Py_ssize_t __pyx_7genexpr__pyx_v_length;
11040 PyObject *__pyx_r = NULL;
11041 __Pyx_RefNannyDeclarations
11042 PyObject *__pyx_t_1 = NULL;
11043 Py_ssize_t *__pyx_t_2;
11044 Py_ssize_t *__pyx_t_3;
11045 Py_ssize_t *__pyx_t_4;
11046 PyObject *__pyx_t_5 = NULL;
11047 int __pyx_lineno = 0;
11048 const char *__pyx_filename = NULL;
11049 int __pyx_clineno = 0;
11050 __Pyx_RefNannySetupContext("__get__", 0);
11051
11052 /* "View.MemoryView":612
11053 * @property
11054 * def shape(self):
11055 * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
11056 *
11057 * @property
11058*/
11059 { /* enter inner scope */
11060 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
11061 __Pyx_GOTREF(__pyx_t_1);
11062 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
11063
11064 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
11065 __pyx_t_2 = __pyx_t_4;
11066 __pyx_7genexpr__pyx_v_length = (__pyx_t_2[0]);
11067 __pyx_t_5 = PyLong_FromSsize_t(__pyx_7genexpr__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 612, __pyx_L1_error)
11068 __Pyx_GOTREF(__pyx_t_5);
11069 __Pyx_GIVEREF(__pyx_t_5);
11070 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_1, __pyx_t_5))) __PYX_ERR(1, 612, __pyx_L1_error)
11071 __pyx_t_5 = 0;
11072 }
11073
11074 } /* exit inner scope */
11075 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 612, __pyx_L1_error)
11076 __Pyx_GOTREF(__pyx_t_5);
11077 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11078 {
11079 PyObject *__pyx_temp;
11080 {
11081 __pyx_temp = __pyx_r;
11082 __pyx_r = __pyx_t_5;
11083 }
11084 __Pyx_XDECREF(__pyx_temp);
11085 }
11086 __pyx_t_5 = 0;
11087 goto __pyx_L0;
11088
11089 /* "View.MemoryView":610
11090 * return self.obj
11091 *
11092 * @property # <<<<<<<<<<<<<<
11093 * def shape(self):
11094 * return tuple([length for length in self.view.shape[:self.view.ndim]])
11095*/
11096
11097 /* function exit code */
11098 __pyx_L1_error:;
11099 __Pyx_XDECREF(__pyx_t_1);
11100 __Pyx_XDECREF(__pyx_t_5);
11101 __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11102 __pyx_r = NULL;
11103 __pyx_L0:;
11104
11105 __Pyx_XGIVEREF(__pyx_r);
11106 __Pyx_RefNannyFinishContext();
11107 return __pyx_r;
11108}
11109
11110/* "View.MemoryView":614
11111 * return tuple([length for length in self.view.shape[:self.view.ndim]])
11112 *
11113 * @property # <<<<<<<<<<<<<<
11114 * def strides(self):
11115 * if cython.unlikely(self.view.strides == NULL):
11116*/
11117
11118/* Python wrapper */
11119static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
11120static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
11121 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11122 PyObject *__pyx_r = 0;
11123 __Pyx_RefNannyDeclarations
11124 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11125 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11126 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11127
11128 /* function exit code */
11129 __Pyx_RefNannyFinishContext();
11130 return __pyx_r;
11131}
11132
11133static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11134 Py_ssize_t __pyx_8genexpr1__pyx_v_stride;
11135 PyObject *__pyx_r = NULL;
11136 __Pyx_RefNannyDeclarations
11137 int __pyx_t_1;
11138 int __pyx_t_2;
11139 PyObject *__pyx_t_3 = NULL;
11140 Py_ssize_t *__pyx_t_4;
11141 Py_ssize_t *__pyx_t_5;
11142 Py_ssize_t *__pyx_t_6;
11143 PyObject *__pyx_t_7 = NULL;
11144 int __pyx_lineno = 0;
11145 const char *__pyx_filename = NULL;
11146 int __pyx_clineno = 0;
11147 __Pyx_RefNannySetupContext("__get__", 0);
11148
11149 /* "View.MemoryView":616
11150 * @property
11151 * def strides(self):
11152 * if cython.unlikely(self.view.strides == NULL): # <<<<<<<<<<<<<<
11153 *
11154 * _err_ValueError("Buffer view does not expose strides")
11155*/
11156 __pyx_t_1 = (__pyx_v_self->view.strides == NULL);
11157
11158 if (unlikely(__pyx_t_1)) {
11159
11160
11161 /* "View.MemoryView":618
11162 * if cython.unlikely(self.view.strides == NULL):
11163 *
11164 * _err_ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
11165 *
11166 * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
11167*/
11168 __pyx_t_2 = __pyx_memoryview_err_ValueError(__pyx_k_Buffer_view_does_not_expose_stri); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 618, __pyx_L1_error)
11169
11170
11171 /* "View.MemoryView":616
11172 * @property
11173 * def strides(self):
11174 * if cython.unlikely(self.view.strides == NULL): # <<<<<<<<<<<<<<
11175 *
11176 * _err_ValueError("Buffer view does not expose strides")
11177*/
11178 }
11179
11180 /* "View.MemoryView":620
11181 * _err_ValueError("Buffer view does not expose strides")
11182 *
11183 * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
11184 *
11185 * @property
11186*/
11187 { /* enter inner scope */
11188 __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 620, __pyx_L1_error)
11189 __Pyx_GOTREF(__pyx_t_3);
11190 __pyx_t_5 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
11191
11192 for (__pyx_t_6 = __pyx_v_self->view.strides; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
11193 __pyx_t_4 = __pyx_t_6;
11194 __pyx_8genexpr1__pyx_v_stride = (__pyx_t_4[0]);
11195 __pyx_t_7 = PyLong_FromSsize_t(__pyx_8genexpr1__pyx_v_stride); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 620, __pyx_L1_error)
11196 __Pyx_GOTREF(__pyx_t_7);
11197 __Pyx_GIVEREF(__pyx_t_7);
11198 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_3, __pyx_t_7))) __PYX_ERR(1, 620, __pyx_L1_error)
11199 __pyx_t_7 = 0;
11200 }
11201
11202 } /* exit inner scope */
11203 __pyx_t_7 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 620, __pyx_L1_error)
11204 __Pyx_GOTREF(__pyx_t_7);
11205 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11206 {
11207 PyObject *__pyx_temp;
11208 {
11209 __pyx_temp = __pyx_r;
11210 __pyx_r = __pyx_t_7;
11211 }
11212 __Pyx_XDECREF(__pyx_temp);
11213 }
11214 __pyx_t_7 = 0;
11215 goto __pyx_L0;
11216
11217 /* "View.MemoryView":614
11218 * return tuple([length for length in self.view.shape[:self.view.ndim]])
11219 *
11220 * @property # <<<<<<<<<<<<<<
11221 * def strides(self):
11222 * if cython.unlikely(self.view.strides == NULL):
11223*/
11224
11225 /* function exit code */
11226 __pyx_L1_error:;
11227 __Pyx_XDECREF(__pyx_t_3);
11228 __Pyx_XDECREF(__pyx_t_7);
11229 __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11230 __pyx_r = NULL;
11231 __pyx_L0:;
11232
11233 __Pyx_XGIVEREF(__pyx_r);
11234 __Pyx_RefNannyFinishContext();
11235 return __pyx_r;
11236}
11237
11238/* "View.MemoryView":622
11239 * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
11240 *
11241 * @property # <<<<<<<<<<<<<<
11242 * def suboffsets(self):
11243 * if self.view.suboffsets == NULL:
11244*/
11245
11246/* Python wrapper */
11247static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
11248static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
11249 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11250 PyObject *__pyx_r = 0;
11251 __Pyx_RefNannyDeclarations
11252 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11253 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11254 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11255
11256 /* function exit code */
11257 __Pyx_RefNannyFinishContext();
11258 return __pyx_r;
11259}
11260
11261static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11262 Py_ssize_t __pyx_8genexpr2__pyx_v_suboffset;
11263 PyObject *__pyx_r = NULL;
11264 __Pyx_RefNannyDeclarations
11265 int __pyx_t_1;
11266 PyObject *__pyx_t_2 = NULL;
11267 Py_ssize_t *__pyx_t_3;
11268 Py_ssize_t *__pyx_t_4;
11269 Py_ssize_t *__pyx_t_5;
11270 PyObject *__pyx_t_6 = NULL;
11271 int __pyx_lineno = 0;
11272 const char *__pyx_filename = NULL;
11273 int __pyx_clineno = 0;
11274 __Pyx_RefNannySetupContext("__get__", 0);
11275
11276 /* "View.MemoryView":624
11277 * @property
11278 * def suboffsets(self):
11279 * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
11280 * return (-1,) * self.view.ndim
11281 *
11282*/
11283 __pyx_t_1 = (__pyx_v_self->view.suboffsets == NULL);
11284
11285 if (__pyx_t_1) {
11286
11287
11288 /* "View.MemoryView":625
11289 * def suboffsets(self):
11290 * if self.view.suboffsets == NULL:
11291 * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
11292 *
11293 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
11294*/
11295 __pyx_t_2 = __Pyx_PySequence_Multiply(__pyx_mstate_global->__pyx_tuple[0], __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 625, __pyx_L1_error)
11296 __Pyx_GOTREF(__pyx_t_2);
11297 {
11298 PyObject *__pyx_temp;
11299 {
11300 __pyx_temp = __pyx_r;
11301 __pyx_r = __pyx_t_2;
11302 }
11303 __Pyx_XDECREF(__pyx_temp);
11304 }
11305 __pyx_t_2 = 0;
11306 goto __pyx_L0;
11307
11308 /* "View.MemoryView":624
11309 * @property
11310 * def suboffsets(self):
11311 * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
11312 * return (-1,) * self.view.ndim
11313 *
11314*/
11315 }
11316
11317 /* "View.MemoryView":627
11318 * return (-1,) * self.view.ndim
11319 *
11320 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
11321 *
11322 * @property
11323*/
11324 { /* enter inner scope */
11325 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 627, __pyx_L1_error)
11326 __Pyx_GOTREF(__pyx_t_2);
11327 __pyx_t_4 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
11328
11329 for (__pyx_t_5 = __pyx_v_self->view.suboffsets; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
11330 __pyx_t_3 = __pyx_t_5;
11331 __pyx_8genexpr2__pyx_v_suboffset = (__pyx_t_3[0]);
11332 __pyx_t_6 = PyLong_FromSsize_t(__pyx_8genexpr2__pyx_v_suboffset); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 627, __pyx_L1_error)
11333 __Pyx_GOTREF(__pyx_t_6);
11334 __Pyx_GIVEREF(__pyx_t_6);
11335 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_2, __pyx_t_6))) __PYX_ERR(1, 627, __pyx_L1_error)
11336 __pyx_t_6 = 0;
11337 }
11338
11339 } /* exit inner scope */
11340 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 627, __pyx_L1_error)
11341 __Pyx_GOTREF(__pyx_t_6);
11342 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11343 {
11344 PyObject *__pyx_temp;
11345 {
11346 __pyx_temp = __pyx_r;
11347 __pyx_r = __pyx_t_6;
11348 }
11349 __Pyx_XDECREF(__pyx_temp);
11350 }
11351 __pyx_t_6 = 0;
11352 goto __pyx_L0;
11353
11354 /* "View.MemoryView":622
11355 * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
11356 *
11357 * @property # <<<<<<<<<<<<<<
11358 * def suboffsets(self):
11359 * if self.view.suboffsets == NULL:
11360*/
11361
11362 /* function exit code */
11363 __pyx_L1_error:;
11364 __Pyx_XDECREF(__pyx_t_2);
11365 __Pyx_XDECREF(__pyx_t_6);
11366 __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11367 __pyx_r = NULL;
11368 __pyx_L0:;
11369
11370 __Pyx_XGIVEREF(__pyx_r);
11371 __Pyx_RefNannyFinishContext();
11372 return __pyx_r;
11373}
11374
11375/* "View.MemoryView":629
11376 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
11377 *
11378 * @property # <<<<<<<<<<<<<<
11379 * def ndim(self):
11380 * return self.view.ndim
11381*/
11382
11383/* Python wrapper */
11384static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
11385static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
11386 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11387 PyObject *__pyx_r = 0;
11388 __Pyx_RefNannyDeclarations
11389 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11390 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11391 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11392
11393 /* function exit code */
11394 __Pyx_RefNannyFinishContext();
11395 return __pyx_r;
11396}
11397
11398static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11399 PyObject *__pyx_r = NULL;
11400 __Pyx_RefNannyDeclarations
11401 PyObject *__pyx_t_1 = NULL;
11402 int __pyx_lineno = 0;
11403 const char *__pyx_filename = NULL;
11404 int __pyx_clineno = 0;
11405 __Pyx_RefNannySetupContext("__get__", 0);
11406
11407 /* "View.MemoryView":631
11408 * @property
11409 * def ndim(self):
11410 * return self.view.ndim # <<<<<<<<<<<<<<
11411 *
11412 * @property
11413*/
11414 __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 631, __pyx_L1_error)
11415 __Pyx_GOTREF(__pyx_t_1);
11416 {
11417 PyObject *__pyx_temp;
11418 {
11419 __pyx_temp = __pyx_r;
11420 __pyx_r = __pyx_t_1;
11421 }
11422 __Pyx_XDECREF(__pyx_temp);
11423 }
11424 __pyx_t_1 = 0;
11425 goto __pyx_L0;
11426
11427 /* "View.MemoryView":629
11428 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
11429 *
11430 * @property # <<<<<<<<<<<<<<
11431 * def ndim(self):
11432 * return self.view.ndim
11433*/
11434
11435 /* function exit code */
11436 __pyx_L1_error:;
11437 __Pyx_XDECREF(__pyx_t_1);
11438 __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11439 __pyx_r = NULL;
11440 __pyx_L0:;
11441 __Pyx_XGIVEREF(__pyx_r);
11442 __Pyx_RefNannyFinishContext();
11443 return __pyx_r;
11444}
11445
11446/* "View.MemoryView":633
11447 * return self.view.ndim
11448 *
11449 * @property # <<<<<<<<<<<<<<
11450 * def itemsize(self):
11451 * return self.view.itemsize
11452*/
11453
11454/* Python wrapper */
11455static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
11456static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
11457 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11458 PyObject *__pyx_r = 0;
11459 __Pyx_RefNannyDeclarations
11460 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11461 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11462 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11463
11464 /* function exit code */
11465 __Pyx_RefNannyFinishContext();
11466 return __pyx_r;
11467}
11468
11469static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11470 PyObject *__pyx_r = NULL;
11471 __Pyx_RefNannyDeclarations
11472 PyObject *__pyx_t_1 = NULL;
11473 int __pyx_lineno = 0;
11474 const char *__pyx_filename = NULL;
11475 int __pyx_clineno = 0;
11476 __Pyx_RefNannySetupContext("__get__", 0);
11477
11478 /* "View.MemoryView":635
11479 * @property
11480 * def itemsize(self):
11481 * return self.view.itemsize # <<<<<<<<<<<<<<
11482 *
11483 * @property
11484*/
11485 __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 635, __pyx_L1_error)
11486 __Pyx_GOTREF(__pyx_t_1);
11487 {
11488 PyObject *__pyx_temp;
11489 {
11490 __pyx_temp = __pyx_r;
11491 __pyx_r = __pyx_t_1;
11492 }
11493 __Pyx_XDECREF(__pyx_temp);
11494 }
11495 __pyx_t_1 = 0;
11496 goto __pyx_L0;
11497
11498 /* "View.MemoryView":633
11499 * return self.view.ndim
11500 *
11501 * @property # <<<<<<<<<<<<<<
11502 * def itemsize(self):
11503 * return self.view.itemsize
11504*/
11505
11506 /* function exit code */
11507 __pyx_L1_error:;
11508 __Pyx_XDECREF(__pyx_t_1);
11509 __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11510 __pyx_r = NULL;
11511 __pyx_L0:;
11512 __Pyx_XGIVEREF(__pyx_r);
11513 __Pyx_RefNannyFinishContext();
11514 return __pyx_r;
11515}
11516
11517/* "View.MemoryView":637
11518 * return self.view.itemsize
11519 *
11520 * @property # <<<<<<<<<<<<<<
11521 * def nbytes(self):
11522 * return self.size * self.view.itemsize
11523*/
11524
11525/* Python wrapper */
11526static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
11527static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
11528 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11529 PyObject *__pyx_r = 0;
11530 __Pyx_RefNannyDeclarations
11531 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11532 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11533 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11534
11535 /* function exit code */
11536 __Pyx_RefNannyFinishContext();
11537 return __pyx_r;
11538}
11539
11540static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11541 PyObject *__pyx_r = NULL;
11542 __Pyx_RefNannyDeclarations
11543 PyObject *__pyx_t_1 = NULL;
11544 PyObject *__pyx_t_2 = NULL;
11545 PyObject *__pyx_t_3 = NULL;
11546 int __pyx_lineno = 0;
11547 const char *__pyx_filename = NULL;
11548 int __pyx_clineno = 0;
11549 __Pyx_RefNannySetupContext("__get__", 0);
11550
11551 /* "View.MemoryView":639
11552 * @property
11553 * def nbytes(self):
11554 * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
11555 *
11556 * @property
11557*/
11558 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 639, __pyx_L1_error)
11559 __Pyx_GOTREF(__pyx_t_1);
11560 __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 639, __pyx_L1_error)
11561 __Pyx_GOTREF(__pyx_t_2);
11562 __pyx_t_3 = __Pyx_PyNumber_Multiply_object_int(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 639, __pyx_L1_error)
11563 __Pyx_GOTREF(__pyx_t_3);
11564 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11565 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11566 {
11567 PyObject *__pyx_temp;
11568 {
11569 __pyx_temp = __pyx_r;
11570 __pyx_r = __pyx_t_3;
11571 }
11572 __Pyx_XDECREF(__pyx_temp);
11573 }
11574 __pyx_t_3 = 0;
11575 goto __pyx_L0;
11576
11577 /* "View.MemoryView":637
11578 * return self.view.itemsize
11579 *
11580 * @property # <<<<<<<<<<<<<<
11581 * def nbytes(self):
11582 * return self.size * self.view.itemsize
11583*/
11584
11585 /* function exit code */
11586 __pyx_L1_error:;
11587 __Pyx_XDECREF(__pyx_t_1);
11588 __Pyx_XDECREF(__pyx_t_2);
11589 __Pyx_XDECREF(__pyx_t_3);
11590 __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11591 __pyx_r = NULL;
11592 __pyx_L0:;
11593 __Pyx_XGIVEREF(__pyx_r);
11594 __Pyx_RefNannyFinishContext();
11595 return __pyx_r;
11596}
11597
11598/* "View.MemoryView":641
11599 * return self.size * self.view.itemsize
11600 *
11601 * @property # <<<<<<<<<<<<<<
11602 * def size(self):
11603 * cdef size_t result
11604*/
11605
11606/* Python wrapper */
11607static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
11608static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
11609 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11610 PyObject *__pyx_r = 0;
11611 __Pyx_RefNannyDeclarations
11612 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11613 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11614 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11615
11616 /* function exit code */
11617 __Pyx_RefNannyFinishContext();
11618 return __pyx_r;
11619}
11620
11621static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11622 size_t __pyx_v_result;
11623 Py_ssize_t __pyx_v_length;
11624 PyObject *__pyx_r = NULL;
11625 __Pyx_RefNannyDeclarations
11626 int __pyx_t_1;
11627 Py_ssize_t *__pyx_t_2;
11628 Py_ssize_t *__pyx_t_3;
11629 Py_ssize_t *__pyx_t_4;
11630 PyObject *__pyx_t_5 = NULL;
11631 int __pyx_lineno = 0;
11632 const char *__pyx_filename = NULL;
11633 int __pyx_clineno = 0;
11634 __Pyx_RefNannySetupContext("__get__", 0);
11635
11636 /* "View.MemoryView":644
11637 * def size(self):
11638 * cdef size_t result
11639 * if self._size is None: # <<<<<<<<<<<<<<
11640 * result = 1
11641 *
11642*/
11643 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
11644 if (__pyx_t_1) {
11645
11646
11647 /* "View.MemoryView":645
11648 * cdef size_t result
11649 * if self._size is None:
11650 * result = 1 # <<<<<<<<<<<<<<
11651 *
11652 * for length in self.view.shape[:self.view.ndim]:
11653*/
11654 __pyx_v_result = 1;
11655
11656 /* "View.MemoryView":647
11657 * result = 1
11658 *
11659 * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
11660 * result *= <size_t> length
11661 *
11662*/
11663 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
11664
11665 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
11666 __pyx_t_2 = __pyx_t_4;
11667 __pyx_v_length = (__pyx_t_2[0]);
11668
11669 /* "View.MemoryView":648
11670 *
11671 * for length in self.view.shape[:self.view.ndim]:
11672 * result *= <size_t> length # <<<<<<<<<<<<<<
11673 *
11674 * self._size = result
11675*/
11676 __pyx_v_result = (__pyx_v_result * ((size_t)__pyx_v_length));
11677 }
11678
11679
11680 /* "View.MemoryView":650
11681 * result *= <size_t> length
11682 *
11683 * self._size = result # <<<<<<<<<<<<<<
11684 *
11685 * return self._size
11686*/
11687 __pyx_t_5 = __Pyx_PyLong_FromSize_t(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 650, __pyx_L1_error)
11688 __Pyx_GOTREF(__pyx_t_5);
11689 __Pyx_GIVEREF(__pyx_t_5);
11690 __Pyx_GOTREF(__pyx_v_self->_size);
11691 __Pyx_DECREF(__pyx_v_self->_size);
11692 __pyx_v_self->_size = __pyx_t_5;
11693 __pyx_t_5 = 0;
11694
11695 /* "View.MemoryView":644
11696 * def size(self):
11697 * cdef size_t result
11698 * if self._size is None: # <<<<<<<<<<<<<<
11699 * result = 1
11700 *
11701*/
11702 }
11703
11704 /* "View.MemoryView":652
11705 * self._size = result
11706 *
11707 * return self._size # <<<<<<<<<<<<<<
11708 *
11709 * def __len__(self):
11710*/
11711 {
11712 PyObject *__pyx_temp;
11713 {
11714 __pyx_temp = __pyx_r;
11715 __Pyx_INCREF(__pyx_v_self->_size);
11716 __pyx_r = __pyx_v_self->_size;
11717 }
11718 __Pyx_XDECREF(__pyx_temp);
11719 }
11720 goto __pyx_L0;
11721
11722 /* "View.MemoryView":641
11723 * return self.size * self.view.itemsize
11724 *
11725 * @property # <<<<<<<<<<<<<<
11726 * def size(self):
11727 * cdef size_t result
11728*/
11729
11730 /* function exit code */
11731 __pyx_L1_error:;
11732 __Pyx_XDECREF(__pyx_t_5);
11733 __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11734 __pyx_r = NULL;
11735 __pyx_L0:;
11736
11737
11738 __Pyx_XGIVEREF(__pyx_r);
11739 __Pyx_RefNannyFinishContext();
11740 return __pyx_r;
11741}
11742
11743/* "View.MemoryView":654
11744 * return self._size
11745 *
11746 * def __len__(self): # <<<<<<<<<<<<<<
11747 * if self.view.ndim >= 1:
11748 * return self.view.shape[0]
11749*/
11750
11751/* Python wrapper */
11752static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
11753static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
11754 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11755 Py_ssize_t __pyx_r;
11756 __Pyx_RefNannyDeclarations
11757 __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
11758 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11759 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11760
11761 /* function exit code */
11762 __Pyx_RefNannyFinishContext();
11763 return __pyx_r;
11764}
11765
11766static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
11767 Py_ssize_t __pyx_r;
11768 int __pyx_t_1;
11769
11770 /* "View.MemoryView":655
11771 *
11772 * def __len__(self):
11773 * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
11774 * return self.view.shape[0]
11775 *
11776*/
11777 __pyx_t_1 = (__pyx_v_self->view.ndim >= 1);
11778
11779 if (__pyx_t_1) {
11780
11781
11782 /* "View.MemoryView":656
11783 * def __len__(self):
11784 * if self.view.ndim >= 1:
11785 * return self.view.shape[0] # <<<<<<<<<<<<<<
11786 *
11787 * return 0
11788*/
11789 {
11790
11791 __pyx_r = (__pyx_v_self->view.shape[0]);
11792 }
11793 goto __pyx_L0;
11794
11795 /* "View.MemoryView":655
11796 *
11797 * def __len__(self):
11798 * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
11799 * return self.view.shape[0]
11800 *
11801*/
11802 }
11803
11804 /* "View.MemoryView":658
11805 * return self.view.shape[0]
11806 *
11807 * return 0 # <<<<<<<<<<<<<<
11808 *
11809 * def __repr__(self):
11810*/
11811 {
11812
11813 __pyx_r = 0;
11814 }
11815 goto __pyx_L0;
11816
11817 /* "View.MemoryView":654
11818 * return self._size
11819 *
11820 * def __len__(self): # <<<<<<<<<<<<<<
11821 * if self.view.ndim >= 1:
11822 * return self.view.shape[0]
11823*/
11824
11825 /* function exit code */
11826 __pyx_L0:;
11827
11828 return __pyx_r;
11829}
11830
11831/* "View.MemoryView":660
11832 * return 0
11833 *
11834 * def __repr__(self): # <<<<<<<<<<<<<<
11835 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11836 * id(self))
11837*/
11838
11839/* Python wrapper */
11840static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
11841static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
11842 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11843 PyObject *__pyx_r = 0;
11844 __Pyx_RefNannyDeclarations
11845 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
11846 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11847 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11848
11849 /* function exit code */
11850 __Pyx_RefNannyFinishContext();
11851 return __pyx_r;
11852}
11853
11854static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
11855 PyObject *__pyx_r = NULL;
11856 __Pyx_RefNannyDeclarations
11857 PyObject *__pyx_t_1 = NULL;
11858 PyObject *__pyx_t_2 = NULL;
11859 PyObject *__pyx_t_3 = NULL;
11860 PyObject *__pyx_t_4[5];
11861 Py_ssize_t __pyx_t_5;
11862 int __pyx_t_6;
11863 int __pyx_lineno = 0;
11864 const char *__pyx_filename = NULL;
11865 int __pyx_clineno = 0;
11866 __Pyx_RefNannySetupContext("__repr__", 0);
11867
11868 /* "View.MemoryView":661
11869 *
11870 * def __repr__(self):
11871 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
11872 * id(self))
11873 *
11874*/
11875 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 661, __pyx_L1_error)
11876 __Pyx_GOTREF(__pyx_t_1);
11877 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 661, __pyx_L1_error)
11878 __Pyx_GOTREF(__pyx_t_2);
11879 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11880 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 661, __pyx_L1_error)
11881 __Pyx_GOTREF(__pyx_t_1);
11882 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11883 __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 661, __pyx_L1_error)
11884 __Pyx_GOTREF(__pyx_t_2);
11885 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11886
11887 /* "View.MemoryView":662
11888 * def __repr__(self):
11889 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11890 * id(self)) # <<<<<<<<<<<<<<
11891 *
11892 * def __str__(self):
11893*/
11894 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 662, __pyx_L1_error)
11895 __Pyx_GOTREF(__pyx_t_1);
11896 __pyx_t_3 = __Pyx_PyObject_Format(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 662, __pyx_L1_error)
11897 __Pyx_GOTREF(__pyx_t_3);
11898 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11899 __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_MemoryView_of;
11900 __pyx_t_4[1] = __pyx_t_2;
11901 __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u_at_0x;
11902 __pyx_t_4[3] = __pyx_t_3;
11903 __pyx_t_4[4] = __pyx_mstate_global->__pyx_kp_u__4;
11904
11905 /* "View.MemoryView":661
11906 *
11907 * def __repr__(self):
11908 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
11909 * id(self))
11910 *
11911*/
11912 __pyx_t_5 = 22;
11913 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11914 __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4[1]) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4[3]);
11915 #endif
11916 __pyx_t_6 = 0;
11917 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
11918 __pyx_t_6 |= __Pyx_PyUnicode_KIND_04(__pyx_t_4[1]) | __Pyx_PyUnicode_KIND_04(__pyx_t_4[3]);
11919 #endif
11920 __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, __pyx_t_5, __pyx_t_6);
11921 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 661, __pyx_L1_error)
11922 __Pyx_GOTREF(__pyx_t_1);
11923 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11924 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11925 {
11926 PyObject *__pyx_temp;
11927 {
11928 __pyx_temp = __pyx_r;
11929 __pyx_r = __pyx_t_1;
11930 }
11931 __Pyx_XDECREF(__pyx_temp);
11932 }
11933 __pyx_t_1 = 0;
11934 goto __pyx_L0;
11935
11936 /* "View.MemoryView":660
11937 * return 0
11938 *
11939 * def __repr__(self): # <<<<<<<<<<<<<<
11940 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11941 * id(self))
11942*/
11943
11944 /* function exit code */
11945 __pyx_L1_error:;
11946 __Pyx_XDECREF(__pyx_t_1);
11947 __Pyx_XDECREF(__pyx_t_2);
11948 __Pyx_XDECREF(__pyx_t_3);
11949 __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11950 __pyx_r = NULL;
11951 __pyx_L0:;
11952 __Pyx_XGIVEREF(__pyx_r);
11953 __Pyx_RefNannyFinishContext();
11954 return __pyx_r;
11955}
11956
11957/* "View.MemoryView":664
11958 * id(self))
11959 *
11960 * def __str__(self): # <<<<<<<<<<<<<<
11961 * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
11962 *
11963*/
11964
11965/* Python wrapper */
11966static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
11967static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
11968 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11969 PyObject *__pyx_r = 0;
11970 __Pyx_RefNannyDeclarations
11971 __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
11972 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11973 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11974
11975 /* function exit code */
11976 __Pyx_RefNannyFinishContext();
11977 return __pyx_r;
11978}
11979
11980static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
11981 PyObject *__pyx_r = NULL;
11982 __Pyx_RefNannyDeclarations
11983 PyObject *__pyx_t_1 = NULL;
11984 PyObject *__pyx_t_2 = NULL;
11985 PyObject *__pyx_t_3[3];
11986 Py_ssize_t __pyx_t_4;
11987 int __pyx_t_5;
11988 int __pyx_lineno = 0;
11989 const char *__pyx_filename = NULL;
11990 int __pyx_clineno = 0;
11991 __Pyx_RefNannySetupContext("__str__", 0);
11992
11993 /* "View.MemoryView":665
11994 *
11995 * def __str__(self):
11996 * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
11997 *
11998 *
11999*/
12000 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 665, __pyx_L1_error)
12001 __Pyx_GOTREF(__pyx_t_1);
12002 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 665, __pyx_L1_error)
12003 __Pyx_GOTREF(__pyx_t_2);
12004 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12005 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 665, __pyx_L1_error)
12006 __Pyx_GOTREF(__pyx_t_1);
12007 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12008 __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 665, __pyx_L1_error)
12009 __Pyx_GOTREF(__pyx_t_2);
12010 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12011 __pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u_MemoryView_of;
12012 __pyx_t_3[1] = __pyx_t_2;
12013 __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u_object;
12014 __pyx_t_4 = 23;
12015 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
12016 __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3[1]);
12017 #endif
12018 __pyx_t_5 = 0;
12019 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
12020 __pyx_t_5 |= __Pyx_PyUnicode_KIND_04(__pyx_t_3[1]);
12021 #endif
12022 __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_4, __pyx_t_5);
12023 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 665, __pyx_L1_error)
12024 __Pyx_GOTREF(__pyx_t_1);
12025 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12026 {
12027 PyObject *__pyx_temp;
12028 {
12029 __pyx_temp = __pyx_r;
12030 __pyx_r = __pyx_t_1;
12031 }
12032 __Pyx_XDECREF(__pyx_temp);
12033 }
12034 __pyx_t_1 = 0;
12035 goto __pyx_L0;
12036
12037 /* "View.MemoryView":664
12038 * id(self))
12039 *
12040 * def __str__(self): # <<<<<<<<<<<<<<
12041 * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
12042 *
12043*/
12044
12045 /* function exit code */
12046 __pyx_L1_error:;
12047 __Pyx_XDECREF(__pyx_t_1);
12048 __Pyx_XDECREF(__pyx_t_2);
12049 __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12050 __pyx_r = NULL;
12051 __pyx_L0:;
12052 __Pyx_XGIVEREF(__pyx_r);
12053 __Pyx_RefNannyFinishContext();
12054 return __pyx_r;
12055}
12056
12057/* "View.MemoryView":668
12058 *
12059 *
12060 * def is_c_contig(self): # <<<<<<<<<<<<<<
12061 * cdef __Pyx_memviewslice *mslice
12062 * cdef __Pyx_memviewslice tmp
12063*/
12064
12065/* Python wrapper */
12066static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
12067#if CYTHON_VECTORCALL
12068PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12069#else
12070PyObject *__pyx_args, PyObject *__pyx_kwds
12071#endif
12072); /*proto*/
12073static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
12074#if CYTHON_VECTORCALL
12075PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12076#else
12077PyObject *__pyx_args, PyObject *__pyx_kwds
12078#endif
12079) {
12080 #if !CYTHON_VECTORCALL
12081 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12082 #endif
12083 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12084 PyObject *__pyx_r = 0;
12085 __Pyx_RefNannyDeclarations
12086 __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
12087 #if !CYTHON_VECTORCALL
12088 #if CYTHON_ASSUME_SAFE_SIZE
12089 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12090 #else
12091 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12092 #endif
12093 #endif
12094 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12095 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_c_contig", 1, 0, 0, __pyx_nargs); return NULL; }
12096 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
12097 if (unlikely(__pyx_kwds_len < 0)) return NULL;
12098 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_c_contig", __pyx_kwds); return NULL;}
12099 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
12100
12101 /* function exit code */
12102 __Pyx_RefNannyFinishContext();
12103 return __pyx_r;
12104}
12105
12106static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
12107 __Pyx_memviewslice *__pyx_v_mslice;
12108 __Pyx_memviewslice __pyx_v_tmp;
12109 PyObject *__pyx_r = NULL;
12110 __Pyx_RefNannyDeclarations
12111 __Pyx_memviewslice *__pyx_t_1;
12112 PyObject *__pyx_t_2 = NULL;
12113 int __pyx_lineno = 0;
12114 const char *__pyx_filename = NULL;
12115 int __pyx_clineno = 0;
12116 __Pyx_RefNannySetupContext("is_c_contig", 0);
12117
12118 /* "View.MemoryView":671
12119 * cdef __Pyx_memviewslice *mslice
12120 * cdef __Pyx_memviewslice tmp
12121 * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
12122 * return slice_is_contig(mslice[0], 'C', self.view.ndim)
12123 *
12124*/
12125 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 671, __pyx_L1_error)
12126 __pyx_v_mslice = __pyx_t_1;
12127
12128 /* "View.MemoryView":672
12129 * cdef __Pyx_memviewslice tmp
12130 * mslice = get_slice_from_memview(self, &tmp)
12131 * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
12132 *
12133 * def is_f_contig(self):
12134*/
12135 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 672, __pyx_L1_error)
12136 __Pyx_GOTREF(__pyx_t_2);
12137 {
12138 PyObject *__pyx_temp;
12139 {
12140 __pyx_temp = __pyx_r;
12141 __pyx_r = __pyx_t_2;
12142 }
12143 __Pyx_XDECREF(__pyx_temp);
12144 }
12145 __pyx_t_2 = 0;
12146 goto __pyx_L0;
12147
12148 /* "View.MemoryView":668
12149 *
12150 *
12151 * def is_c_contig(self): # <<<<<<<<<<<<<<
12152 * cdef __Pyx_memviewslice *mslice
12153 * cdef __Pyx_memviewslice tmp
12154*/
12155
12156 /* function exit code */
12157 __pyx_L1_error:;
12158 __Pyx_XDECREF(__pyx_t_2);
12159 __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
12160 __pyx_r = NULL;
12161 __pyx_L0:;
12162
12163
12164 __Pyx_XGIVEREF(__pyx_r);
12165 __Pyx_RefNannyFinishContext();
12166 return __pyx_r;
12167}
12168
12169/* "View.MemoryView":674
12170 * return slice_is_contig(mslice[0], 'C', self.view.ndim)
12171 *
12172 * def is_f_contig(self): # <<<<<<<<<<<<<<
12173 * cdef __Pyx_memviewslice *mslice
12174 * cdef __Pyx_memviewslice tmp
12175*/
12176
12177/* Python wrapper */
12178static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
12179#if CYTHON_VECTORCALL
12180PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12181#else
12182PyObject *__pyx_args, PyObject *__pyx_kwds
12183#endif
12184); /*proto*/
12185static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
12186#if CYTHON_VECTORCALL
12187PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12188#else
12189PyObject *__pyx_args, PyObject *__pyx_kwds
12190#endif
12191) {
12192 #if !CYTHON_VECTORCALL
12193 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12194 #endif
12195 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12196 PyObject *__pyx_r = 0;
12197 __Pyx_RefNannyDeclarations
12198 __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
12199 #if !CYTHON_VECTORCALL
12200 #if CYTHON_ASSUME_SAFE_SIZE
12201 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12202 #else
12203 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12204 #endif
12205 #endif
12206 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12207 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("is_f_contig", 1, 0, 0, __pyx_nargs); return NULL; }
12208 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
12209 if (unlikely(__pyx_kwds_len < 0)) return NULL;
12210 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_f_contig", __pyx_kwds); return NULL;}
12211 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
12212
12213 /* function exit code */
12214 __Pyx_RefNannyFinishContext();
12215 return __pyx_r;
12216}
12217
12218static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
12219 __Pyx_memviewslice *__pyx_v_mslice;
12220 __Pyx_memviewslice __pyx_v_tmp;
12221 PyObject *__pyx_r = NULL;
12222 __Pyx_RefNannyDeclarations
12223 __Pyx_memviewslice *__pyx_t_1;
12224 PyObject *__pyx_t_2 = NULL;
12225 int __pyx_lineno = 0;
12226 const char *__pyx_filename = NULL;
12227 int __pyx_clineno = 0;
12228 __Pyx_RefNannySetupContext("is_f_contig", 0);
12229
12230 /* "View.MemoryView":677
12231 * cdef __Pyx_memviewslice *mslice
12232 * cdef __Pyx_memviewslice tmp
12233 * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
12234 * return slice_is_contig(mslice[0], 'F', self.view.ndim)
12235 *
12236*/
12237 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((void *)NULL))) __PYX_ERR(1, 677, __pyx_L1_error)
12238 __pyx_v_mslice = __pyx_t_1;
12239
12240 /* "View.MemoryView":678
12241 * cdef __Pyx_memviewslice tmp
12242 * mslice = get_slice_from_memview(self, &tmp)
12243 * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
12244 *
12245 * def copy(self):
12246*/
12247 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 678, __pyx_L1_error)
12248 __Pyx_GOTREF(__pyx_t_2);
12249 {
12250 PyObject *__pyx_temp;
12251 {
12252 __pyx_temp = __pyx_r;
12253 __pyx_r = __pyx_t_2;
12254 }
12255 __Pyx_XDECREF(__pyx_temp);
12256 }
12257 __pyx_t_2 = 0;
12258 goto __pyx_L0;
12259
12260 /* "View.MemoryView":674
12261 * return slice_is_contig(mslice[0], 'C', self.view.ndim)
12262 *
12263 * def is_f_contig(self): # <<<<<<<<<<<<<<
12264 * cdef __Pyx_memviewslice *mslice
12265 * cdef __Pyx_memviewslice tmp
12266*/
12267
12268 /* function exit code */
12269 __pyx_L1_error:;
12270 __Pyx_XDECREF(__pyx_t_2);
12271 __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
12272 __pyx_r = NULL;
12273 __pyx_L0:;
12274
12275
12276 __Pyx_XGIVEREF(__pyx_r);
12277 __Pyx_RefNannyFinishContext();
12278 return __pyx_r;
12279}
12280
12281/* "View.MemoryView":680
12282 * return slice_is_contig(mslice[0], 'F', self.view.ndim)
12283 *
12284 * def copy(self): # <<<<<<<<<<<<<<
12285 * cdef __Pyx_memviewslice mslice
12286 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12287*/
12288
12289/* Python wrapper */
12290static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
12291#if CYTHON_VECTORCALL
12292PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12293#else
12294PyObject *__pyx_args, PyObject *__pyx_kwds
12295#endif
12296); /*proto*/
12297static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
12298#if CYTHON_VECTORCALL
12299PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12300#else
12301PyObject *__pyx_args, PyObject *__pyx_kwds
12302#endif
12303) {
12304 #if !CYTHON_VECTORCALL
12305 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12306 #endif
12307 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12308 PyObject *__pyx_r = 0;
12309 __Pyx_RefNannyDeclarations
12310 __Pyx_RefNannySetupContext("copy (wrapper)", 0);
12311 #if !CYTHON_VECTORCALL
12312 #if CYTHON_ASSUME_SAFE_SIZE
12313 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12314 #else
12315 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12316 #endif
12317 #endif
12318 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12319 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL; }
12320 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
12321 if (unlikely(__pyx_kwds_len < 0)) return NULL;
12322 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("copy", __pyx_kwds); return NULL;}
12323 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
12324
12325 /* function exit code */
12326 __Pyx_RefNannyFinishContext();
12327 return __pyx_r;
12328}
12329
12330static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
12331 __Pyx_memviewslice __pyx_v_mslice;
12332 int __pyx_v_flags;
12333 PyObject *__pyx_r = NULL;
12334 __Pyx_RefNannyDeclarations
12335 __Pyx_memviewslice __pyx_t_1;
12336 PyObject *__pyx_t_2 = NULL;
12337 int __pyx_lineno = 0;
12338 const char *__pyx_filename = NULL;
12339 int __pyx_clineno = 0;
12340 __Pyx_RefNannySetupContext("copy", 0);
12341
12342 /* "View.MemoryView":682
12343 * def copy(self):
12344 * cdef __Pyx_memviewslice mslice
12345 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
12346 *
12347 * slice_copy(self, &mslice)
12348*/
12349 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
12350
12351 /* "View.MemoryView":684
12352 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12353 *
12354 * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
12355 * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
12356 * self.view.itemsize,
12357*/
12358 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
12359
12360 /* "View.MemoryView":685
12361 *
12362 * slice_copy(self, &mslice)
12363 * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
12364 * self.view.itemsize,
12365 * flags|PyBUF_C_CONTIGUOUS,
12366*/
12367 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), __pyx_k_c, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 685, __pyx_L1_error)
12368 __pyx_v_mslice = __pyx_t_1;
12369
12370 /* "View.MemoryView":690
12371 * self.dtype_is_object)
12372 *
12373 * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
12374 *
12375 * def copy_fortran(self):
12376*/
12377 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 690, __pyx_L1_error)
12378 __Pyx_GOTREF(__pyx_t_2);
12379 {
12380 PyObject *__pyx_temp;
12381 {
12382 __pyx_temp = __pyx_r;
12383 __pyx_r = __pyx_t_2;
12384 }
12385 __Pyx_XDECREF(__pyx_temp);
12386 }
12387 __pyx_t_2 = 0;
12388 goto __pyx_L0;
12389
12390 /* "View.MemoryView":680
12391 * return slice_is_contig(mslice[0], 'F', self.view.ndim)
12392 *
12393 * def copy(self): # <<<<<<<<<<<<<<
12394 * cdef __Pyx_memviewslice mslice
12395 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12396*/
12397
12398 /* function exit code */
12399 __pyx_L1_error:;
12400 __Pyx_XDECREF(__pyx_t_2);
12401 __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
12402 __pyx_r = NULL;
12403 __pyx_L0:;
12404
12405
12406 __Pyx_XGIVEREF(__pyx_r);
12407 __Pyx_RefNannyFinishContext();
12408 return __pyx_r;
12409}
12410
12411/* "View.MemoryView":692
12412 * return memoryview_copy_from_slice(self, &mslice)
12413 *
12414 * def copy_fortran(self): # <<<<<<<<<<<<<<
12415 * cdef __Pyx_memviewslice src, dst
12416 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12417*/
12418
12419/* Python wrapper */
12420static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
12421#if CYTHON_VECTORCALL
12422PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12423#else
12424PyObject *__pyx_args, PyObject *__pyx_kwds
12425#endif
12426); /*proto*/
12427static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
12428#if CYTHON_VECTORCALL
12429PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12430#else
12431PyObject *__pyx_args, PyObject *__pyx_kwds
12432#endif
12433) {
12434 #if !CYTHON_VECTORCALL
12435 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12436 #endif
12437 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12438 PyObject *__pyx_r = 0;
12439 __Pyx_RefNannyDeclarations
12440 __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
12441 #if !CYTHON_VECTORCALL
12442 #if CYTHON_ASSUME_SAFE_SIZE
12443 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12444 #else
12445 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12446 #endif
12447 #endif
12448 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12449 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy_fortran", 1, 0, 0, __pyx_nargs); return NULL; }
12450 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
12451 if (unlikely(__pyx_kwds_len < 0)) return NULL;
12452 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("copy_fortran", __pyx_kwds); return NULL;}
12453 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
12454
12455 /* function exit code */
12456 __Pyx_RefNannyFinishContext();
12457 return __pyx_r;
12458}
12459
12460static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
12461 __Pyx_memviewslice __pyx_v_src;
12462 __Pyx_memviewslice __pyx_v_dst;
12463 int __pyx_v_flags;
12464 PyObject *__pyx_r = NULL;
12465 __Pyx_RefNannyDeclarations
12466 __Pyx_memviewslice __pyx_t_1;
12467 PyObject *__pyx_t_2 = NULL;
12468 int __pyx_lineno = 0;
12469 const char *__pyx_filename = NULL;
12470 int __pyx_clineno = 0;
12471 __Pyx_RefNannySetupContext("copy_fortran", 0);
12472
12473 /* "View.MemoryView":694
12474 * def copy_fortran(self):
12475 * cdef __Pyx_memviewslice src, dst
12476 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
12477 *
12478 * slice_copy(self, &src)
12479*/
12480 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
12481
12482 /* "View.MemoryView":696
12483 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12484 *
12485 * slice_copy(self, &src) # <<<<<<<<<<<<<<
12486 * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
12487 * self.view.itemsize,
12488*/
12489 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
12490
12491 /* "View.MemoryView":697
12492 *
12493 * slice_copy(self, &src)
12494 * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
12495 * self.view.itemsize,
12496 * flags|PyBUF_F_CONTIGUOUS,
12497*/
12498 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), __pyx_k_fortran, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 697, __pyx_L1_error)
12499 __pyx_v_dst = __pyx_t_1;
12500
12501 /* "View.MemoryView":702
12502 * self.dtype_is_object)
12503 *
12504 * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
12505 *
12506 *
12507*/
12508 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 702, __pyx_L1_error)
12509 __Pyx_GOTREF(__pyx_t_2);
12510 {
12511 PyObject *__pyx_temp;
12512 {
12513 __pyx_temp = __pyx_r;
12514 __pyx_r = __pyx_t_2;
12515 }
12516 __Pyx_XDECREF(__pyx_temp);
12517 }
12518 __pyx_t_2 = 0;
12519 goto __pyx_L0;
12520
12521 /* "View.MemoryView":692
12522 * return memoryview_copy_from_slice(self, &mslice)
12523 *
12524 * def copy_fortran(self): # <<<<<<<<<<<<<<
12525 * cdef __Pyx_memviewslice src, dst
12526 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12527*/
12528
12529 /* function exit code */
12530 __pyx_L1_error:;
12531 __Pyx_XDECREF(__pyx_t_2);
12532 __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
12533 __pyx_r = NULL;
12534 __pyx_L0:;
12535
12536
12537
12538 __Pyx_XGIVEREF(__pyx_r);
12539 __Pyx_RefNannyFinishContext();
12540 return __pyx_r;
12541}
12542
12543/* "(tree fragment)":1
12544 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
12545 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12546 * def __setstate_cython__(self, __pyx_state):
12547*/
12548
12549/* Python wrapper */
12550static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
12551#if CYTHON_VECTORCALL
12552PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12553#else
12554PyObject *__pyx_args, PyObject *__pyx_kwds
12555#endif
12556); /*proto*/
12557static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
12558#if CYTHON_VECTORCALL
12559PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12560#else
12561PyObject *__pyx_args, PyObject *__pyx_kwds
12562#endif
12563) {
12564 #if !CYTHON_VECTORCALL
12565 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12566 #endif
12567 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12568 PyObject *__pyx_r = 0;
12569 __Pyx_RefNannyDeclarations
12570 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
12571 #if !CYTHON_VECTORCALL
12572 #if CYTHON_ASSUME_SAFE_SIZE
12573 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12574 #else
12575 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12576 #endif
12577 #endif
12578 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12579 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
12580 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
12581 if (unlikely(__pyx_kwds_len < 0)) return NULL;
12582 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
12583 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12584
12585 /* function exit code */
12586 __Pyx_RefNannyFinishContext();
12587 return __pyx_r;
12588}
12589
12590static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
12591 PyObject *__pyx_r = NULL;
12592 __Pyx_RefNannyDeclarations
12593 int __pyx_lineno = 0;
12594 const char *__pyx_filename = NULL;
12595 int __pyx_clineno = 0;
12596 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
12597
12598 /* "(tree fragment)":2
12599 * def __reduce_cython__(self):
12600 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
12601 * def __setstate_cython__(self, __pyx_state):
12602 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12603*/
12604 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
12605 __PYX_ERR(1, 2, __pyx_L1_error)
12606
12607 /* "(tree fragment)":1
12608 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
12609 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12610 * def __setstate_cython__(self, __pyx_state):
12611*/
12612
12613 /* function exit code */
12614 __pyx_L1_error:;
12615 __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12616 __pyx_r = NULL;
12617 __Pyx_XGIVEREF(__pyx_r);
12618 __Pyx_RefNannyFinishContext();
12619 return __pyx_r;
12620}
12621
12622/* "(tree fragment)":3
12623 * def __reduce_cython__(self):
12624 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12625 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
12626 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12627*/
12628
12629/* Python wrapper */
12630static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
12631#if CYTHON_VECTORCALL
12632PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12633#else
12634PyObject *__pyx_args, PyObject *__pyx_kwds
12635#endif
12636); /*proto*/
12637static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
12638#if CYTHON_VECTORCALL
12639PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12640#else
12641PyObject *__pyx_args, PyObject *__pyx_kwds
12642#endif
12643) {
12644 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
12645 #if !CYTHON_VECTORCALL
12646 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12647 #endif
12648 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12649 PyObject* values[1] = {0};
12650 int __pyx_lineno = 0;
12651 const char *__pyx_filename = NULL;
12652 int __pyx_clineno = 0;
12653 PyObject *__pyx_r = 0;
12654 __Pyx_RefNannyDeclarations
12655 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
12656 #if !CYTHON_VECTORCALL
12657 #if CYTHON_ASSUME_SAFE_SIZE
12658 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12659 #else
12660 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12661 #endif
12662 #endif
12663 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12664 {
12665 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
12666 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
12667 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
12668 if (__pyx_kwds_len > 0) {
12669 switch (__pyx_nargs) {
12670 case 1:
12671 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
12672 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
12673 CYTHON_FALLTHROUGH;
12674 case 0: break;
12675 default: goto __pyx_L5_argtuple_error;
12676 }
12677 const Py_ssize_t kwd_pos_args = __pyx_nargs;
12678 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
12679 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
12680 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
12681 }
12682 } else if (unlikely(__pyx_nargs != 1)) {
12683 goto __pyx_L5_argtuple_error;
12684 } else {
12685 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
12686 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
12687 }
12688 __pyx_v___pyx_state = values[0];
12689 }
12690 goto __pyx_L6_skip;
12691 __pyx_L5_argtuple_error:;
12692 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
12693 __pyx_L6_skip:;
12694 goto __pyx_L4_argument_unpacking_done;
12695 __pyx_L3_error:;
12696 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
12697 Py_XDECREF(values[__pyx_temp]);
12698 }
12699 __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12700 __Pyx_RefNannyFinishContext();
12701 return NULL;
12702 __pyx_L4_argument_unpacking_done:;
12703 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v___pyx_state);
12704
12705 /* function exit code */
12706 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
12707 Py_XDECREF(values[__pyx_temp]);
12708 }
12709 __Pyx_RefNannyFinishContext();
12710 return __pyx_r;
12711}
12712
12713static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
12714 PyObject *__pyx_r = NULL;
12715 __Pyx_RefNannyDeclarations
12716 int __pyx_lineno = 0;
12717 const char *__pyx_filename = NULL;
12718 int __pyx_clineno = 0;
12719 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
12720
12721 /* "(tree fragment)":4
12722 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12723 * def __setstate_cython__(self, __pyx_state):
12724 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
12725*/
12726 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
12727 __PYX_ERR(1, 4, __pyx_L1_error)
12728
12729 /* "(tree fragment)":3
12730 * def __reduce_cython__(self):
12731 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12732 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
12733 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12734*/
12735
12736 /* function exit code */
12737 __pyx_L1_error:;
12738 __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12739 __pyx_r = NULL;
12740 __Pyx_XGIVEREF(__pyx_r);
12741 __Pyx_RefNannyFinishContext();
12742 return __pyx_r;
12743}
12744
12745/* "View.MemoryView":705
12746 *
12747 *
12748 * @cname('__pyx_memoryview_new') # <<<<<<<<<<<<<<
12749 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
12750 * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12751*/
12752
12753static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo const *__pyx_v_typeinfo) {
12754 struct __pyx_memoryview_obj *__pyx_v_result = 0;
12755 PyObject *__pyx_r = NULL;
12756 __Pyx_RefNannyDeclarations
12757 PyObject *__pyx_t_1 = NULL;
12758 PyObject *__pyx_t_2 = NULL;
12759 PyObject *__pyx_t_3 = NULL;
12760 PyObject *__pyx_t_4 = NULL;
12761 size_t __pyx_t_5;
12762 int __pyx_lineno = 0;
12763 const char *__pyx_filename = NULL;
12764 int __pyx_clineno = 0;
12765 __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
12766
12767 /* "View.MemoryView":707
12768 * @cname('__pyx_memoryview_new')
12769 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
12770 * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
12771 * result.typeinfo = typeinfo
12772 * return result
12773*/
12774 __pyx_t_2 = NULL;
12775 __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 707, __pyx_L1_error)
12776 __Pyx_GOTREF(__pyx_t_3);
12777 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 707, __pyx_L1_error)
12778 __Pyx_GOTREF(__pyx_t_4);
12779 __pyx_t_5 = 1;
12780 {
12781 PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_o, __pyx_t_3, __pyx_t_4};
12782 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_memoryview_type, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
12783 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12784 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12785 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12786 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 707, __pyx_L1_error)
12787 __Pyx_GOTREF((PyObject *)__pyx_t_1);
12788 }
12789 __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_1);
12790 __pyx_t_1 = 0;
12791
12792 /* "View.MemoryView":708
12793 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
12794 * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12795 * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
12796 * return result
12797 *
12798*/
12799 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
12800
12801 /* "View.MemoryView":709
12802 * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12803 * result.typeinfo = typeinfo
12804 * return result # <<<<<<<<<<<<<<
12805 *
12806 * @cname('__pyx_memoryview_check')
12807*/
12808 {
12809 PyObject *__pyx_temp;
12810 {
12811 __pyx_temp = __pyx_r;
12812 __Pyx_INCREF((PyObject *)__pyx_v_result);
12813 __pyx_r = ((PyObject *)__pyx_v_result);
12814 }
12815 __Pyx_XDECREF(__pyx_temp);
12816 }
12817 goto __pyx_L0;
12818
12819 /* "View.MemoryView":705
12820 *
12821 *
12822 * @cname('__pyx_memoryview_new') # <<<<<<<<<<<<<<
12823 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
12824 * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12825*/
12826
12827 /* function exit code */
12828 __pyx_L1_error:;
12829 __Pyx_XDECREF(__pyx_t_1);
12830 __Pyx_XDECREF(__pyx_t_2);
12831 __Pyx_XDECREF(__pyx_t_3);
12832 __Pyx_XDECREF(__pyx_t_4);
12833 __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
12834 __pyx_r = 0;
12835 __pyx_L0:;
12836 __Pyx_XDECREF((PyObject *)__pyx_v_result);
12837 __Pyx_XGIVEREF(__pyx_r);
12838 __Pyx_RefNannyFinishContext();
12839 return __pyx_r;
12840}
12841
12842/* "View.MemoryView":711
12843 * return result
12844 *
12845 * @cname('__pyx_memoryview_check') # <<<<<<<<<<<<<<
12846 * cdef inline bint memoryview_check(object o) noexcept:
12847 * return isinstance(o, memoryview)
12848*/
12849
12850static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
12851 int __pyx_r;
12852 int __pyx_t_1;
12853
12854 /* "View.MemoryView":713
12855 * @cname('__pyx_memoryview_check')
12856 * cdef inline bint memoryview_check(object o) noexcept:
12857 * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
12858 *
12859 *
12860*/
12861 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_mstate_global->__pyx_memoryview_type);
12862 {
12863 __pyx_r = __pyx_t_1;
12864 }
12865 goto __pyx_L0;
12866
12867 /* "View.MemoryView":711
12868 * return result
12869 *
12870 * @cname('__pyx_memoryview_check') # <<<<<<<<<<<<<<
12871 * cdef inline bint memoryview_check(object o) noexcept:
12872 * return isinstance(o, memoryview)
12873*/
12874
12875 /* function exit code */
12876 __pyx_L0:;
12877
12878 return __pyx_r;
12879}
12880
12881/* "View.MemoryView":716
12882 *
12883 *
12884 * @cname('__pyx_memoryview_err_invalid_index') # <<<<<<<<<<<<<<
12885 * cdef int _err_invalid_index(item) except -1:
12886 * type_name = str(type(item))
12887*/
12888
12889static int __pyx_memoryview_err_invalid_index(PyObject *__pyx_v_item) {
12890 PyObject *__pyx_v_type_name = NULL;
12891 int __pyx_r;
12892 __Pyx_RefNannyDeclarations
12893 PyObject *__pyx_t_1 = NULL;
12894 int __pyx_lineno = 0;
12895 const char *__pyx_filename = NULL;
12896 int __pyx_clineno = 0;
12897 __Pyx_RefNannySetupContext("_err_invalid_index", 0);
12898
12899 /* "View.MemoryView":718
12900 * @cname('__pyx_memoryview_err_invalid_index')
12901 * cdef int _err_invalid_index(item) except -1:
12902 * type_name = str(type(item)) # <<<<<<<<<<<<<<
12903 * PyErr_Format(PyExc_TypeError, "Cannot index with type '%.200U'", <PyObject*> type_name)
12904 * return -1
12905*/
12906 __pyx_t_1 = __Pyx_PyObject_Unicode(((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 718, __pyx_L1_error)
12907 __Pyx_GOTREF(__pyx_t_1);
12908 __pyx_v_type_name = ((PyObject*)__pyx_t_1);
12909 __pyx_t_1 = 0;
12910
12911 /* "View.MemoryView":719
12912 * cdef int _err_invalid_index(item) except -1:
12913 * type_name = str(type(item))
12914 * PyErr_Format(PyExc_TypeError, "Cannot index with type '%.200U'", <PyObject*> type_name) # <<<<<<<<<<<<<<
12915 * return -1
12916 *
12917*/
12918 (void)(PyErr_Format(PyExc_TypeError, __pyx_k_Cannot_index_with_type_200U, ((PyObject *)__pyx_v_type_name)));
12919
12920 /* "View.MemoryView":720
12921 * type_name = str(type(item))
12922 * PyErr_Format(PyExc_TypeError, "Cannot index with type '%.200U'", <PyObject*> type_name)
12923 * return -1 # <<<<<<<<<<<<<<
12924 *
12925 *
12926*/
12927 {
12928
12929 __pyx_r = -1;
12930 }
12931 goto __pyx_L0;
12932
12933 /* "View.MemoryView":716
12934 *
12935 *
12936 * @cname('__pyx_memoryview_err_invalid_index') # <<<<<<<<<<<<<<
12937 * cdef int _err_invalid_index(item) except -1:
12938 * type_name = str(type(item))
12939*/
12940
12941 /* function exit code */
12942 __pyx_L1_error:;
12943 __Pyx_XDECREF(__pyx_t_1);
12944 __Pyx_AddTraceback("View.MemoryView._err_invalid_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
12945 __pyx_r = -1;
12946 __pyx_L0:;
12947 __Pyx_XDECREF(__pyx_v_type_name);
12948
12949 __Pyx_RefNannyFinishContext();
12950 return __pyx_r;
12951}
12952
12953/* "View.MemoryView":723
12954 *
12955 *
12956 * cdef tuple[bint, tuple] _unellipsify_index_tuple(index_tuple: tuple, int ndim): # <<<<<<<<<<<<<<
12957 * """
12958 * Replace all ellipses with full slices and fill incomplete indices with full slices.
12959*/
12960
12961static PyObject *_unellipsify_index_tuple(PyObject *__pyx_v_index_tuple, int __pyx_v_ndim) {
12962 Py_ssize_t __pyx_v_first_ellipsis_index;
12963 Py_ssize_t __pyx_v_idx;
12964 Py_ssize_t __pyx_v_ellipsis_end;
12965 Py_ssize_t __pyx_v_indices_from_ellipsis;
12966 int __pyx_v_have_slices;
12967 PyObject *__pyx_v_item = NULL;
12968 PyObject *__pyx_v_result = NULL;
12969 PyObject *__pyx_r = NULL;
12970 __Pyx_RefNannyDeclarations
12971 PyObject *__pyx_t_1 = NULL;
12972 Py_ssize_t __pyx_t_2;
12973 PyObject *__pyx_t_3 = NULL;
12974 int __pyx_t_4;
12975 int __pyx_t_5;
12976 Py_ssize_t __pyx_t_6;
12977 Py_ssize_t __pyx_t_7;
12978 Py_ssize_t __pyx_t_8;
12979 int __pyx_lineno = 0;
12980 const char *__pyx_filename = NULL;
12981 int __pyx_clineno = 0;
12982 __Pyx_RefNannySetupContext("_unellipsify_index_tuple", 0);
12983 __Pyx_INCREF(__pyx_v_index_tuple);
12984
12985 /* "View.MemoryView":727
12986 * Replace all ellipses with full slices and fill incomplete indices with full slices.
12987 * """
12988 * cdef Py_ssize_t first_ellipsis_index = -1 # <<<<<<<<<<<<<<
12989 * cdef Py_ssize_t idx, ellipsis_end, indices_from_ellipsis
12990 *
12991*/
12992 __pyx_v_first_ellipsis_index = -1L;
12993
12994 /* "View.MemoryView":730
12995 * cdef Py_ssize_t idx, ellipsis_end, indices_from_ellipsis
12996 *
12997 * have_slices = False # <<<<<<<<<<<<<<
12998 *
12999 * idx = 0
13000*/
13001 __pyx_v_have_slices = 0;
13002
13003 /* "View.MemoryView":732
13004 * have_slices = False
13005 *
13006 * idx = 0 # <<<<<<<<<<<<<<
13007 * for item in index_tuple:
13008 * if item is Ellipsis:
13009*/
13010 __pyx_v_idx = 0;
13011
13012 /* "View.MemoryView":733
13013 *
13014 * idx = 0
13015 * for item in index_tuple: # <<<<<<<<<<<<<<
13016 * if item is Ellipsis:
13017 * have_slices = True
13018*/
13019 __pyx_t_1 = __pyx_v_index_tuple; __Pyx_INCREF(__pyx_t_1);
13020 __pyx_t_2 = 0;
13021 for (;;) {
13022 {
13023 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
13024 #if !CYTHON_ASSUME_SAFE_SIZE
13025 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 733, __pyx_L1_error)
13026 #endif
13027 if (__pyx_t_2 >= __pyx_temp) break;
13028 }
13029 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13030 __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
13031 #else
13032 __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
13033 #endif
13034 ++__pyx_t_2;
13035 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 733, __pyx_L1_error)
13036 __Pyx_GOTREF(__pyx_t_3);
13037 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
13038 __pyx_t_3 = 0;
13039
13040 /* "View.MemoryView":734
13041 * idx = 0
13042 * for item in index_tuple:
13043 * if item is Ellipsis: # <<<<<<<<<<<<<<
13044 * have_slices = True
13045 * if first_ellipsis_index == -1:
13046*/
13047 __pyx_t_4 = (__pyx_v_item == __pyx_builtin_Ellipsis);
13048 if (__pyx_t_4) {
13049
13050
13051 /* "View.MemoryView":735
13052 * for item in index_tuple:
13053 * if item is Ellipsis:
13054 * have_slices = True # <<<<<<<<<<<<<<
13055 * if first_ellipsis_index == -1:
13056 * first_ellipsis_index = idx
13057*/
13058 __pyx_v_have_slices = 1;
13059
13060 /* "View.MemoryView":736
13061 * if item is Ellipsis:
13062 * have_slices = True
13063 * if first_ellipsis_index == -1: # <<<<<<<<<<<<<<
13064 * first_ellipsis_index = idx
13065 * elif isinstance(item, slice):
13066*/
13067 __pyx_t_4 = (__pyx_v_first_ellipsis_index == -1L);
13068
13069 if (__pyx_t_4) {
13070
13071
13072 /* "View.MemoryView":737
13073 * have_slices = True
13074 * if first_ellipsis_index == -1:
13075 * first_ellipsis_index = idx # <<<<<<<<<<<<<<
13076 * elif isinstance(item, slice):
13077 * have_slices = True
13078*/
13079 __pyx_v_first_ellipsis_index = __pyx_v_idx;
13080
13081 /* "View.MemoryView":736
13082 * if item is Ellipsis:
13083 * have_slices = True
13084 * if first_ellipsis_index == -1: # <<<<<<<<<<<<<<
13085 * first_ellipsis_index = idx
13086 * elif isinstance(item, slice):
13087*/
13088 }
13089
13090 /* "View.MemoryView":734
13091 * idx = 0
13092 * for item in index_tuple:
13093 * if item is Ellipsis: # <<<<<<<<<<<<<<
13094 * have_slices = True
13095 * if first_ellipsis_index == -1:
13096*/
13097 goto __pyx_L5;
13098 }
13099
13100 /* "View.MemoryView":738
13101 * if first_ellipsis_index == -1:
13102 * first_ellipsis_index = idx
13103 * elif isinstance(item, slice): # <<<<<<<<<<<<<<
13104 * have_slices = True
13105 * elif cython.unlikely(not PyIndex_Check(item)):
13106*/
13107 __pyx_t_4 = PySlice_Check(__pyx_v_item);
13108 if (__pyx_t_4) {
13109
13110
13111 /* "View.MemoryView":739
13112 * first_ellipsis_index = idx
13113 * elif isinstance(item, slice):
13114 * have_slices = True # <<<<<<<<<<<<<<
13115 * elif cython.unlikely(not PyIndex_Check(item)):
13116 * _err_invalid_index(item)
13117*/
13118 __pyx_v_have_slices = 1;
13119
13120 /* "View.MemoryView":738
13121 * if first_ellipsis_index == -1:
13122 * first_ellipsis_index = idx
13123 * elif isinstance(item, slice): # <<<<<<<<<<<<<<
13124 * have_slices = True
13125 * elif cython.unlikely(not PyIndex_Check(item)):
13126*/
13127 goto __pyx_L5;
13128 }
13129
13130 /* "View.MemoryView":740
13131 * elif isinstance(item, slice):
13132 * have_slices = True
13133 * elif cython.unlikely(not PyIndex_Check(item)): # <<<<<<<<<<<<<<
13134 * _err_invalid_index(item)
13135 * idx += 1
13136*/
13137 __pyx_t_4 = (!(PyIndex_Check(__pyx_v_item) != 0));
13138
13139 if (unlikely(__pyx_t_4)) {
13140
13141
13142 /* "View.MemoryView":741
13143 * have_slices = True
13144 * elif cython.unlikely(not PyIndex_Check(item)):
13145 * _err_invalid_index(item) # <<<<<<<<<<<<<<
13146 * idx += 1
13147 *
13148*/
13149 __pyx_t_5 = __pyx_memoryview_err_invalid_index(__pyx_v_item); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 741, __pyx_L1_error)
13150
13151
13152 /* "View.MemoryView":740
13153 * elif isinstance(item, slice):
13154 * have_slices = True
13155 * elif cython.unlikely(not PyIndex_Check(item)): # <<<<<<<<<<<<<<
13156 * _err_invalid_index(item)
13157 * idx += 1
13158*/
13159 }
13160 __pyx_L5:;
13161
13162 /* "View.MemoryView":742
13163 * elif cython.unlikely(not PyIndex_Check(item)):
13164 * _err_invalid_index(item)
13165 * idx += 1 # <<<<<<<<<<<<<<
13166 *
13167 * if first_ellipsis_index >= 0:
13168*/
13169 __pyx_v_idx = (__pyx_v_idx + 1);
13170
13171 /* "View.MemoryView":733
13172 *
13173 * idx = 0
13174 * for item in index_tuple: # <<<<<<<<<<<<<<
13175 * if item is Ellipsis:
13176 * have_slices = True
13177*/
13178 }
13179 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13180
13181 /* "View.MemoryView":744
13182 * idx += 1
13183 *
13184 * if first_ellipsis_index >= 0: # <<<<<<<<<<<<<<
13185 * result = [slice(None)] * ndim
13186 *
13187*/
13188 __pyx_t_4 = (__pyx_v_first_ellipsis_index >= 0);
13189
13190 if (__pyx_t_4) {
13191
13192
13193 /* "View.MemoryView":745
13194 *
13195 * if first_ellipsis_index >= 0:
13196 * result = [slice(None)] * ndim # <<<<<<<<<<<<<<
13197 *
13198 * for idx in range(first_ellipsis_index):
13199*/
13200 __pyx_t_1 = PyList_New(1 * ((__pyx_v_ndim<0) ? 0:__pyx_v_ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 745, __pyx_L1_error)
13201 __Pyx_GOTREF(__pyx_t_1);
13202 { Py_ssize_t __pyx_temp;
13203 for (__pyx_temp=0; __pyx_temp < __pyx_v_ndim; __pyx_temp++) {
13204 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
13205 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
13206 if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 745, __pyx_L1_error);
13207 }
13208 }
13209 __pyx_v_result = ((PyObject*)__pyx_t_1);
13210 __pyx_t_1 = 0;
13211
13212 /* "View.MemoryView":747
13213 * result = [slice(None)] * ndim
13214 *
13215 * for idx in range(first_ellipsis_index): # <<<<<<<<<<<<<<
13216 * result[idx] = index_tuple[idx]
13217 *
13218*/
13219
13220 __pyx_t_2 = __pyx_v_first_ellipsis_index;
13221 __pyx_t_6 = __pyx_t_2;
13222
13223 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
13224 __pyx_v_idx = __pyx_t_7;
13225
13226 /* "View.MemoryView":748
13227 *
13228 * for idx in range(first_ellipsis_index):
13229 * result[idx] = index_tuple[idx] # <<<<<<<<<<<<<<
13230 *
13231 * indices_from_ellipsis = len(index_tuple) - first_ellipsis_index
13232*/
13233 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_index_tuple, __pyx_v_idx, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 748, __pyx_L1_error)
13234 __Pyx_GOTREF(__pyx_t_1);
13235 if (unlikely((__Pyx_SetItemInt(__pyx_v_result, __pyx_v_idx, __pyx_t_1, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(1, 748, __pyx_L1_error)
13236 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13237 }
13238
13239
13240 /* "View.MemoryView":750
13241 * result[idx] = index_tuple[idx]
13242 *
13243 * indices_from_ellipsis = len(index_tuple) - first_ellipsis_index # <<<<<<<<<<<<<<
13244 * ellipsis_end = ndim - indices_from_ellipsis
13245 *
13246*/
13247 __pyx_t_2 = __Pyx_PyTuple_GET_SIZE(__pyx_v_index_tuple); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 750, __pyx_L1_error)
13248 __pyx_v_indices_from_ellipsis = (__pyx_t_2 - __pyx_v_first_ellipsis_index);
13249
13250
13251 /* "View.MemoryView":751
13252 *
13253 * indices_from_ellipsis = len(index_tuple) - first_ellipsis_index
13254 * ellipsis_end = ndim - indices_from_ellipsis # <<<<<<<<<<<<<<
13255 *
13256 * for idx in range(1, indices_from_ellipsis):
13257*/
13258 __pyx_v_ellipsis_end = (__pyx_v_ndim - __pyx_v_indices_from_ellipsis);
13259
13260 /* "View.MemoryView":753
13261 * ellipsis_end = ndim - indices_from_ellipsis
13262 *
13263 * for idx in range(1, indices_from_ellipsis): # <<<<<<<<<<<<<<
13264 * item = index_tuple[first_ellipsis_index + idx]
13265 * if item is not Ellipsis:
13266*/
13267
13268 __pyx_t_2 = __pyx_v_indices_from_ellipsis;
13269 __pyx_t_6 = __pyx_t_2;
13270
13271 for (__pyx_t_7 = 1; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
13272 __pyx_v_idx = __pyx_t_7;
13273
13274 /* "View.MemoryView":754
13275 *
13276 * for idx in range(1, indices_from_ellipsis):
13277 * item = index_tuple[first_ellipsis_index + idx] # <<<<<<<<<<<<<<
13278 * if item is not Ellipsis:
13279 * result[ellipsis_end + idx] = item
13280*/
13281 __pyx_t_8 = (__pyx_v_first_ellipsis_index + __pyx_v_idx);
13282
13283 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_index_tuple, __pyx_t_8, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 754, __pyx_L1_error)
13284 __Pyx_GOTREF(__pyx_t_1);
13285
13286 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1);
13287 __pyx_t_1 = 0;
13288
13289 /* "View.MemoryView":755
13290 * for idx in range(1, indices_from_ellipsis):
13291 * item = index_tuple[first_ellipsis_index + idx]
13292 * if item is not Ellipsis: # <<<<<<<<<<<<<<
13293 * result[ellipsis_end + idx] = item
13294 *
13295*/
13296 __pyx_t_4 = (__pyx_v_item != __pyx_builtin_Ellipsis);
13297 if (__pyx_t_4) {
13298
13299
13300 /* "View.MemoryView":756
13301 * item = index_tuple[first_ellipsis_index + idx]
13302 * if item is not Ellipsis:
13303 * result[ellipsis_end + idx] = item # <<<<<<<<<<<<<<
13304 *
13305 * index_tuple = tuple(result)
13306*/
13307 __pyx_t_8 = (__pyx_v_ellipsis_end + __pyx_v_idx);
13308
13309 if (unlikely((__Pyx_SetItemInt(__pyx_v_result, __pyx_t_8, __pyx_v_item, Py_ssize_t, 1, PyLong_FromSsize_t, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(1, 756, __pyx_L1_error)
13310
13311
13312 /* "View.MemoryView":755
13313 * for idx in range(1, indices_from_ellipsis):
13314 * item = index_tuple[first_ellipsis_index + idx]
13315 * if item is not Ellipsis: # <<<<<<<<<<<<<<
13316 * result[ellipsis_end + idx] = item
13317 *
13318*/
13319 }
13320 }
13321
13322
13323 /* "View.MemoryView":758
13324 * result[ellipsis_end + idx] = item
13325 *
13326 * index_tuple = tuple(result) # <<<<<<<<<<<<<<
13327 *
13328 * elif ndim > idx:
13329*/
13330 __pyx_t_1 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 758, __pyx_L1_error)
13331 __Pyx_GOTREF(__pyx_t_1);
13332 __Pyx_DECREF_SET(__pyx_v_index_tuple, ((PyObject*)__pyx_t_1));
13333 __pyx_t_1 = 0;
13334
13335 /* "View.MemoryView":744
13336 * idx += 1
13337 *
13338 * if first_ellipsis_index >= 0: # <<<<<<<<<<<<<<
13339 * result = [slice(None)] * ndim
13340 *
13341*/
13342 goto __pyx_L8;
13343 }
13344
13345 /* "View.MemoryView":760
13346 * index_tuple = tuple(result)
13347 *
13348 * elif ndim > idx: # <<<<<<<<<<<<<<
13349 *
13350 * have_slices = True
13351*/
13352 __pyx_t_4 = (__pyx_v_ndim > __pyx_v_idx);
13353
13354 if (__pyx_t_4) {
13355
13356
13357 /* "View.MemoryView":762
13358 * elif ndim > idx:
13359 *
13360 * have_slices = True # <<<<<<<<<<<<<<
13361 * index_tuple += (slice(None),) * (ndim - idx)
13362 *
13363*/
13364 __pyx_v_have_slices = 1;
13365
13366 /* "View.MemoryView":763
13367 *
13368 * have_slices = True
13369 * index_tuple += (slice(None),) * (ndim - idx) # <<<<<<<<<<<<<<
13370 *
13371 * return have_slices, index_tuple
13372*/
13373 __pyx_t_2 = (__pyx_v_ndim - __pyx_v_idx);
13374
13375 __pyx_t_1 = __Pyx_PySequence_Multiply(__pyx_mstate_global->__pyx_tuple[1], __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 763, __pyx_L1_error)
13376 __Pyx_GOTREF(__pyx_t_1);
13377
13378 __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_index_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 763, __pyx_L1_error)
13379 __Pyx_GOTREF(__pyx_t_3);
13380 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13381 __Pyx_DECREF_SET(__pyx_v_index_tuple, ((PyObject*)__pyx_t_3));
13382 __pyx_t_3 = 0;
13383
13384 /* "View.MemoryView":760
13385 * index_tuple = tuple(result)
13386 *
13387 * elif ndim > idx: # <<<<<<<<<<<<<<
13388 *
13389 * have_slices = True
13390*/
13391 }
13392 __pyx_L8:;
13393
13394 /* "View.MemoryView":765
13395 * index_tuple += (slice(None),) * (ndim - idx)
13396 *
13397 * return have_slices, index_tuple # <<<<<<<<<<<<<<
13398 *
13399 *
13400*/
13401 __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 765, __pyx_L1_error)
13402 __Pyx_GOTREF(__pyx_t_3);
13403 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 765, __pyx_L1_error)
13404 __Pyx_GOTREF(__pyx_t_1);
13405 __Pyx_GIVEREF(__pyx_t_3);
13406 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3) != (0)) __PYX_ERR(1, 765, __pyx_L1_error);
13407 __Pyx_INCREF(__pyx_v_index_tuple);
13408 __Pyx_GIVEREF(__pyx_v_index_tuple);
13409 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_index_tuple) != (0)) __PYX_ERR(1, 765, __pyx_L1_error);
13410 __pyx_t_3 = 0;
13411 {
13412 PyObject *__pyx_temp;
13413 {
13414 __pyx_temp = __pyx_r;
13415 __pyx_r = ((PyObject*)__pyx_t_1);
13416 }
13417 __Pyx_XDECREF(__pyx_temp);
13418 }
13419 __pyx_t_1 = 0;
13420 goto __pyx_L0;
13421
13422 /* "View.MemoryView":723
13423 *
13424 *
13425 * cdef tuple[bint, tuple] _unellipsify_index_tuple(index_tuple: tuple, int ndim): # <<<<<<<<<<<<<<
13426 * """
13427 * Replace all ellipses with full slices and fill incomplete indices with full slices.
13428*/
13429
13430 /* function exit code */
13431 __pyx_L1_error:;
13432 __Pyx_XDECREF(__pyx_t_1);
13433 __Pyx_XDECREF(__pyx_t_3);
13434 __Pyx_AddTraceback("View.MemoryView._unellipsify_index_tuple", __pyx_clineno, __pyx_lineno, __pyx_filename);
13435 __pyx_r = 0;
13436 __pyx_L0:;
13437
13438
13439
13440
13441
13442 __Pyx_XDECREF(__pyx_v_item);
13443 __Pyx_XDECREF(__pyx_v_result);
13444 __Pyx_XDECREF(__pyx_v_index_tuple);
13445 __Pyx_XGIVEREF(__pyx_r);
13446 __Pyx_RefNannyFinishContext();
13447 return __pyx_r;
13448}
13449
13450/* "View.MemoryView":768
13451 *
13452 *
13453 * cdef tuple[bint, tuple] _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
13454 * """
13455 * Replace all ellipses with full slices and fill incomplete indices with full slices.
13456*/
13457
13458static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
13459 PyObject *__pyx_v_result = 0;
13460 int __pyx_v_have_slices;
13461 PyObject *__pyx_r = NULL;
13462 __Pyx_RefNannyDeclarations
13463 int __pyx_t_1;
13464 PyObject *__pyx_t_2 = NULL;
13465 int __pyx_t_3;
13466 long __pyx_t_4;
13467 PyObject *__pyx_t_5 = NULL;
13468 PyObject *__pyx_t_6 = NULL;
13469 int __pyx_lineno = 0;
13470 const char *__pyx_filename = NULL;
13471 int __pyx_clineno = 0;
13472 __Pyx_RefNannySetupContext("_unellipsify", 0);
13473
13474 /* "View.MemoryView":773
13475 * """
13476 * result: tuple
13477 * have_slices = False # <<<<<<<<<<<<<<
13478 *
13479 * if index is Ellipsis:
13480*/
13481 __pyx_v_have_slices = 0;
13482
13483 /* "View.MemoryView":775
13484 * have_slices = False
13485 *
13486 * if index is Ellipsis: # <<<<<<<<<<<<<<
13487 * have_slices = True
13488 * result = (slice(None),) * ndim
13489*/
13490 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
13491 if (__pyx_t_1) {
13492
13493
13494 /* "View.MemoryView":776
13495 *
13496 * if index is Ellipsis:
13497 * have_slices = True # <<<<<<<<<<<<<<
13498 * result = (slice(None),) * ndim
13499 *
13500*/
13501 __pyx_v_have_slices = 1;
13502
13503 /* "View.MemoryView":777
13504 * if index is Ellipsis:
13505 * have_slices = True
13506 * result = (slice(None),) * ndim # <<<<<<<<<<<<<<
13507 *
13508 * elif isinstance(index, tuple):
13509*/
13510 __pyx_t_2 = __Pyx_PySequence_Multiply(__pyx_mstate_global->__pyx_tuple[1], __pyx_v_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 777, __pyx_L1_error)
13511 __Pyx_GOTREF(__pyx_t_2);
13512 __pyx_v_result = ((PyObject*)__pyx_t_2);
13513 __pyx_t_2 = 0;
13514
13515 /* "View.MemoryView":775
13516 * have_slices = False
13517 *
13518 * if index is Ellipsis: # <<<<<<<<<<<<<<
13519 * have_slices = True
13520 * result = (slice(None),) * ndim
13521*/
13522 goto __pyx_L3;
13523 }
13524
13525 /* "View.MemoryView":779
13526 * result = (slice(None),) * ndim
13527 *
13528 * elif isinstance(index, tuple): # <<<<<<<<<<<<<<
13529 * return _unellipsify_index_tuple(<tuple> index, ndim)
13530 *
13531*/
13532 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
13533 if (__pyx_t_1) {
13534
13535
13536 /* "View.MemoryView":780
13537 *
13538 * elif isinstance(index, tuple):
13539 * return _unellipsify_index_tuple(<tuple> index, ndim) # <<<<<<<<<<<<<<
13540 *
13541 * else:
13542*/
13543 if (unlikely(__pyx_v_index == Py_None)) {
13544 PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
13545 __PYX_ERR(1, 780, __pyx_L1_error)
13546 }
13547 __pyx_t_2 = _unellipsify_index_tuple(((PyObject*)__pyx_v_index), __pyx_v_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 780, __pyx_L1_error)
13548 __Pyx_GOTREF(__pyx_t_2);
13549 {
13550 PyObject *__pyx_temp;
13551 {
13552 __pyx_temp = __pyx_r;
13553 __pyx_r = ((PyObject*)__pyx_t_2);
13554 }
13555 __Pyx_XDECREF(__pyx_temp);
13556 }
13557 __pyx_t_2 = 0;
13558 goto __pyx_L0;
13559
13560 /* "View.MemoryView":779
13561 * result = (slice(None),) * ndim
13562 *
13563 * elif isinstance(index, tuple): # <<<<<<<<<<<<<<
13564 * return _unellipsify_index_tuple(<tuple> index, ndim)
13565 *
13566*/
13567 }
13568
13569 /* "View.MemoryView":783
13570 *
13571 * else:
13572 * if isinstance(index, slice): # <<<<<<<<<<<<<<
13573 * have_slices = True
13574 * elif cython.unlikely(not PyIndex_Check(index)):
13575*/
13576 /*else*/ {
13577 __pyx_t_1 = PySlice_Check(__pyx_v_index);
13578 if (__pyx_t_1) {
13579
13580
13581 /* "View.MemoryView":784
13582 * else:
13583 * if isinstance(index, slice):
13584 * have_slices = True # <<<<<<<<<<<<<<
13585 * elif cython.unlikely(not PyIndex_Check(index)):
13586 * _err_invalid_index(index)
13587*/
13588 __pyx_v_have_slices = 1;
13589
13590 /* "View.MemoryView":783
13591 *
13592 * else:
13593 * if isinstance(index, slice): # <<<<<<<<<<<<<<
13594 * have_slices = True
13595 * elif cython.unlikely(not PyIndex_Check(index)):
13596*/
13597 goto __pyx_L4;
13598 }
13599
13600 /* "View.MemoryView":785
13601 * if isinstance(index, slice):
13602 * have_slices = True
13603 * elif cython.unlikely(not PyIndex_Check(index)): # <<<<<<<<<<<<<<
13604 * _err_invalid_index(index)
13605 *
13606*/
13607 __pyx_t_1 = (!(PyIndex_Check(__pyx_v_index) != 0));
13608
13609 if (unlikely(__pyx_t_1)) {
13610
13611
13612 /* "View.MemoryView":786
13613 * have_slices = True
13614 * elif cython.unlikely(not PyIndex_Check(index)):
13615 * _err_invalid_index(index) # <<<<<<<<<<<<<<
13616 *
13617 *
13618*/
13619 __pyx_t_3 = __pyx_memoryview_err_invalid_index(__pyx_v_index); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 786, __pyx_L1_error)
13620
13621
13622 /* "View.MemoryView":785
13623 * if isinstance(index, slice):
13624 * have_slices = True
13625 * elif cython.unlikely(not PyIndex_Check(index)): # <<<<<<<<<<<<<<
13626 * _err_invalid_index(index)
13627 *
13628*/
13629 }
13630 __pyx_L4:;
13631
13632 /* "View.MemoryView":789
13633 *
13634 *
13635 * if ndim == 1: # <<<<<<<<<<<<<<
13636 * result = (index,)
13637 * elif ndim == 2:
13638*/
13639 switch (__pyx_v_ndim) {
13640 case 1:
13641
13642 /* "View.MemoryView":790
13643 *
13644 * if ndim == 1:
13645 * result = (index,) # <<<<<<<<<<<<<<
13646 * elif ndim == 2:
13647 * have_slices = True
13648*/
13649 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 790, __pyx_L1_error)
13650 __Pyx_GOTREF(__pyx_t_2);
13651 __Pyx_INCREF(__pyx_v_index);
13652 __Pyx_GIVEREF(__pyx_v_index);
13653 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_index) != (0)) __PYX_ERR(1, 790, __pyx_L1_error);
13654 __pyx_v_result = ((PyObject*)__pyx_t_2);
13655 __pyx_t_2 = 0;
13656
13657 /* "View.MemoryView":789
13658 *
13659 *
13660 * if ndim == 1: # <<<<<<<<<<<<<<
13661 * result = (index,)
13662 * elif ndim == 2:
13663*/
13664 break;
13665 case 2:
13666
13667 /* "View.MemoryView":792
13668 * result = (index,)
13669 * elif ndim == 2:
13670 * have_slices = True # <<<<<<<<<<<<<<
13671 * result = (index, slice(None))
13672 * else:
13673*/
13674 __pyx_v_have_slices = 1;
13675
13676 /* "View.MemoryView":793
13677 * elif ndim == 2:
13678 * have_slices = True
13679 * result = (index, slice(None)) # <<<<<<<<<<<<<<
13680 * else:
13681 * have_slices = True
13682*/
13683 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 793, __pyx_L1_error)
13684 __Pyx_GOTREF(__pyx_t_2);
13685 __Pyx_INCREF(__pyx_v_index);
13686 __Pyx_GIVEREF(__pyx_v_index);
13687 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_index) != (0)) __PYX_ERR(1, 793, __pyx_L1_error);
13688 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
13689 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
13690 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 793, __pyx_L1_error);
13691 __pyx_v_result = ((PyObject*)__pyx_t_2);
13692 __pyx_t_2 = 0;
13693
13694 /* "View.MemoryView":791
13695 * if ndim == 1:
13696 * result = (index,)
13697 * elif ndim == 2: # <<<<<<<<<<<<<<
13698 * have_slices = True
13699 * result = (index, slice(None))
13700*/
13701 break;
13702 default:
13703
13704 /* "View.MemoryView":795
13705 * result = (index, slice(None))
13706 * else:
13707 * have_slices = True # <<<<<<<<<<<<<<
13708 * result = (index,) + (slice(None),) * (ndim - 1)
13709 *
13710*/
13711 __pyx_v_have_slices = 1;
13712
13713 /* "View.MemoryView":796
13714 * else:
13715 * have_slices = True
13716 * result = (index,) + (slice(None),) * (ndim - 1) # <<<<<<<<<<<<<<
13717 *
13718 * return have_slices, result
13719*/
13720 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 796, __pyx_L1_error)
13721 __Pyx_GOTREF(__pyx_t_2);
13722 __Pyx_INCREF(__pyx_v_index);
13723 __Pyx_GIVEREF(__pyx_v_index);
13724 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_index) != (0)) __PYX_ERR(1, 796, __pyx_L1_error);
13725 __pyx_t_4 = (__pyx_v_ndim - 1);
13726
13727 __pyx_t_5 = __Pyx_PySequence_Multiply(__pyx_mstate_global->__pyx_tuple[1], __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 796, __pyx_L1_error)
13728 __Pyx_GOTREF(__pyx_t_5);
13729
13730 __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 796, __pyx_L1_error)
13731 __Pyx_GOTREF(__pyx_t_6);
13732 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13733 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13734 __pyx_v_result = ((PyObject*)__pyx_t_6);
13735 __pyx_t_6 = 0;
13736 break;
13737 }
13738 }
13739 __pyx_L3:;
13740
13741 /* "View.MemoryView":798
13742 * result = (index,) + (slice(None),) * (ndim - 1)
13743 *
13744 * return have_slices, result # <<<<<<<<<<<<<<
13745 *
13746 *
13747*/
13748 __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 798, __pyx_L1_error)
13749 __Pyx_GOTREF(__pyx_t_6);
13750 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 798, __pyx_L1_error)
13751 __Pyx_GOTREF(__pyx_t_5);
13752 __Pyx_GIVEREF(__pyx_t_6);
13753 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6) != (0)) __PYX_ERR(1, 798, __pyx_L1_error);
13754 __Pyx_INCREF(__pyx_v_result);
13755 __Pyx_GIVEREF(__pyx_v_result);
13756 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_result) != (0)) __PYX_ERR(1, 798, __pyx_L1_error);
13757 __pyx_t_6 = 0;
13758 {
13759 PyObject *__pyx_temp;
13760 {
13761 __pyx_temp = __pyx_r;
13762 __pyx_r = ((PyObject*)__pyx_t_5);
13763 }
13764 __Pyx_XDECREF(__pyx_temp);
13765 }
13766 __pyx_t_5 = 0;
13767 goto __pyx_L0;
13768
13769 /* "View.MemoryView":768
13770 *
13771 *
13772 * cdef tuple[bint, tuple] _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
13773 * """
13774 * Replace all ellipses with full slices and fill incomplete indices with full slices.
13775*/
13776
13777 /* function exit code */
13778 __pyx_L1_error:;
13779 __Pyx_XDECREF(__pyx_t_2);
13780 __Pyx_XDECREF(__pyx_t_5);
13781 __Pyx_XDECREF(__pyx_t_6);
13782 __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
13783 __pyx_r = 0;
13784 __pyx_L0:;
13785 __Pyx_XDECREF(__pyx_v_result);
13786
13787 __Pyx_XGIVEREF(__pyx_r);
13788 __Pyx_RefNannyFinishContext();
13789 return __pyx_r;
13790}
13791
13792/* "View.MemoryView":801
13793 *
13794 *
13795 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
13796 * for suboffset in suboffsets[:ndim]:
13797 * if cython.unlikely(suboffset >= 0):
13798*/
13799
13800static int assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
13801 Py_ssize_t __pyx_v_suboffset;
13802 int __pyx_r;
13803 Py_ssize_t *__pyx_t_1;
13804 Py_ssize_t *__pyx_t_2;
13805 Py_ssize_t *__pyx_t_3;
13806 int __pyx_t_4;
13807 int __pyx_t_5;
13808 int __pyx_lineno = 0;
13809 const char *__pyx_filename = NULL;
13810 int __pyx_clineno = 0;
13811
13812 /* "View.MemoryView":802
13813 *
13814 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
13815 * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
13816 * if cython.unlikely(suboffset >= 0):
13817 * _err_ValueError("Indirect dimensions not supported")
13818*/
13819 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
13820
13821 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
13822 __pyx_t_1 = __pyx_t_3;
13823 __pyx_v_suboffset = (__pyx_t_1[0]);
13824
13825 /* "View.MemoryView":803
13826 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
13827 * for suboffset in suboffsets[:ndim]:
13828 * if cython.unlikely(suboffset >= 0): # <<<<<<<<<<<<<<
13829 * _err_ValueError("Indirect dimensions not supported")
13830 * return 0 # return type just used as an error flag
13831*/
13832 __pyx_t_4 = (__pyx_v_suboffset >= 0);
13833
13834 if (unlikely(__pyx_t_4)) {
13835
13836
13837 /* "View.MemoryView":804
13838 * for suboffset in suboffsets[:ndim]:
13839 * if cython.unlikely(suboffset >= 0):
13840 * _err_ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
13841 * return 0 # return type just used as an error flag
13842 *
13843*/
13844 __pyx_t_5 = __pyx_memoryview_err_ValueError(__pyx_k_Indirect_dimensions_not_supporte); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 804, __pyx_L1_error)
13845
13846
13847 /* "View.MemoryView":803
13848 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
13849 * for suboffset in suboffsets[:ndim]:
13850 * if cython.unlikely(suboffset >= 0): # <<<<<<<<<<<<<<
13851 * _err_ValueError("Indirect dimensions not supported")
13852 * return 0 # return type just used as an error flag
13853*/
13854 }
13855 }
13856
13857
13858 /* "View.MemoryView":805
13859 * if cython.unlikely(suboffset >= 0):
13860 * _err_ValueError("Indirect dimensions not supported")
13861 * return 0 # return type just used as an error flag # <<<<<<<<<<<<<<
13862 *
13863 *
13864*/
13865 {
13866
13867 __pyx_r = 0;
13868 }
13869 goto __pyx_L0;
13870
13871 /* "View.MemoryView":801
13872 *
13873 *
13874 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
13875 * for suboffset in suboffsets[:ndim]:
13876 * if cython.unlikely(suboffset >= 0):
13877*/
13878
13879 /* function exit code */
13880 __pyx_L1_error:;
13881 __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
13882 __pyx_r = -1;
13883 __pyx_L0:;
13884
13885
13886 return __pyx_r;
13887}
13888
13889/* "View.MemoryView":811
13890 *
13891 *
13892 * @cname('__pyx_memview_slice') # <<<<<<<<<<<<<<
13893 * cdef memoryview memview_slice(memoryview memview, tuple indices):
13894 * cdef int new_ndim = 0, suboffset_dim = -1, dim
13895*/
13896
13897static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
13898 int __pyx_v_new_ndim;
13899 int __pyx_v_suboffset_dim;
13900 int __pyx_v_dim;
13901 __Pyx_memviewslice __pyx_v_src;
13902 __Pyx_memviewslice __pyx_v_dst;
13903 __Pyx_memviewslice *__pyx_v_p_src;
13904 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
13905 __Pyx_memviewslice *__pyx_v_p_dst;
13906 int *__pyx_v_p_suboffset_dim;
13907 Py_ssize_t __pyx_v_start;
13908 Py_ssize_t __pyx_v_stop;
13909 Py_ssize_t __pyx_v_step;
13910 Py_ssize_t __pyx_v_cindex;
13911 int __pyx_v_have_start;
13912 int __pyx_v_have_stop;
13913 int __pyx_v_have_step;
13914 PyObject *__pyx_v_index = NULL;
13915 struct __pyx_memoryview_obj *__pyx_r = NULL;
13916 __Pyx_RefNannyDeclarations
13917 int __pyx_t_1;
13918 PyObject *__pyx_t_2 = NULL;
13919 struct __pyx_memoryview_obj *__pyx_t_3;
13920 char *__pyx_t_4;
13921 int __pyx_t_5;
13922 Py_ssize_t __pyx_t_6;
13923 PyObject *__pyx_t_7 = NULL;
13924 Py_ssize_t __pyx_t_8;
13925 int __pyx_t_9;
13926 Py_ssize_t __pyx_t_10;
13927 int __pyx_lineno = 0;
13928 const char *__pyx_filename = NULL;
13929 int __pyx_clineno = 0;
13930 __Pyx_RefNannySetupContext("memview_slice", 0);
13931
13932 /* "View.MemoryView":813
13933 * @cname('__pyx_memview_slice')
13934 * cdef memoryview memview_slice(memoryview memview, tuple indices):
13935 * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
13936 * cdef bint negative_step
13937 * cdef __Pyx_memviewslice src, dst
13938*/
13939 __pyx_v_new_ndim = 0;
13940 __pyx_v_suboffset_dim = -1;
13941
13942 /* "View.MemoryView":820
13943 *
13944 *
13945 * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
13946 *
13947 * cdef _memoryviewslice memviewsliceobj
13948*/
13949 (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
13950
13951 /* "View.MemoryView":824
13952 * cdef _memoryviewslice memviewsliceobj
13953 *
13954 * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
13955 *
13956 * if isinstance(memview, _memoryviewslice):
13957*/
13958 #ifndef CYTHON_WITHOUT_ASSERTIONS
13959 if (unlikely(__pyx_assertions_enabled())) {
13960 __pyx_t_1 = (__pyx_v_memview->view.ndim > 0);
13961
13962 if (unlikely(!__pyx_t_1)) {
13963 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
13964 __PYX_ERR(1, 824, __pyx_L1_error)
13965 }
13966
13967 }
13968 #else
13969 if ((1)); else __PYX_ERR(1, 824, __pyx_L1_error)
13970 #endif
13971
13972 /* "View.MemoryView":826
13973 * assert memview.view.ndim > 0
13974 *
13975 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13976 * memviewsliceobj = memview
13977 * p_src = &memviewsliceobj.from_slice
13978*/
13979 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
13980 if (__pyx_t_1) {
13981
13982
13983 /* "View.MemoryView":827
13984 *
13985 * if isinstance(memview, _memoryviewslice):
13986 * memviewsliceobj = memview # <<<<<<<<<<<<<<
13987 * p_src = &memviewsliceobj.from_slice
13988 * else:
13989*/
13990 __pyx_t_2 = ((PyObject *)__pyx_v_memview);
13991 __Pyx_INCREF(__pyx_t_2);
13992 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryviewslice_type))))) __PYX_ERR(1, 827, __pyx_L1_error)
13993 __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
13994 __pyx_t_2 = 0;
13995
13996 /* "View.MemoryView":828
13997 * if isinstance(memview, _memoryviewslice):
13998 * memviewsliceobj = memview
13999 * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
14000 * else:
14001 * slice_copy(memview, &src)
14002*/
14003 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
14004
14005 /* "View.MemoryView":826
14006 * assert memview.view.ndim > 0
14007 *
14008 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14009 * memviewsliceobj = memview
14010 * p_src = &memviewsliceobj.from_slice
14011*/
14012 goto __pyx_L3;
14013 }
14014
14015 /* "View.MemoryView":830
14016 * p_src = &memviewsliceobj.from_slice
14017 * else:
14018 * slice_copy(memview, &src) # <<<<<<<<<<<<<<
14019 * p_src = &src
14020 *
14021*/
14022 /*else*/ {
14023 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
14024
14025 /* "View.MemoryView":831
14026 * else:
14027 * slice_copy(memview, &src)
14028 * p_src = &src # <<<<<<<<<<<<<<
14029 *
14030 *
14031*/
14032 __pyx_v_p_src = (&__pyx_v_src);
14033 }
14034 __pyx_L3:;
14035
14036 /* "View.MemoryView":837
14037 *
14038 *
14039 * dst.memview = p_src.memview # <<<<<<<<<<<<<<
14040 * dst.data = p_src.data
14041 *
14042*/
14043 __pyx_t_3 = __pyx_v_p_src->memview;
14044
14045 __pyx_v_dst.memview = __pyx_t_3;
14046
14047 /* "View.MemoryView":838
14048 *
14049 * dst.memview = p_src.memview
14050 * dst.data = p_src.data # <<<<<<<<<<<<<<
14051 *
14052 *
14053*/
14054 __pyx_t_4 = __pyx_v_p_src->data;
14055
14056 __pyx_v_dst.data = __pyx_t_4;
14057
14058 /* "View.MemoryView":843
14059 *
14060 *
14061 * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
14062 * cdef int *p_suboffset_dim = &suboffset_dim
14063 * cdef Py_ssize_t start, stop, step, cindex
14064*/
14065 __pyx_v_p_dst = (&__pyx_v_dst);
14066
14067 /* "View.MemoryView":844
14068 *
14069 * cdef __Pyx_memviewslice *p_dst = &dst
14070 * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
14071 * cdef Py_ssize_t start, stop, step, cindex
14072 * cdef bint have_start, have_stop, have_step
14073*/
14074 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
14075
14076 /* "View.MemoryView":848
14077 * cdef bint have_start, have_stop, have_step
14078 *
14079 * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
14080 * if PyIndex_Check(index):
14081 * cindex = index
14082*/
14083
14084 __pyx_t_5 = 0;
14085 __pyx_t_2 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_2);
14086 __pyx_t_6 = 0;
14087 for (;;) {
14088 {
14089 Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
14090 #if !CYTHON_ASSUME_SAFE_SIZE
14091 if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 848, __pyx_L1_error)
14092 #endif
14093 if (__pyx_t_6 >= __pyx_temp) break;
14094 }
14095 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14096 __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6));
14097 #else
14098 __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6);
14099 #endif
14100 ++__pyx_t_6;
14101 if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 848, __pyx_L1_error)
14102 __Pyx_GOTREF(__pyx_t_7);
14103 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_7);
14104 __pyx_t_7 = 0;
14105 __pyx_v_dim = __pyx_t_5;
14106 __pyx_t_5 = (__pyx_t_5 + 1);
14107
14108 /* "View.MemoryView":849
14109 *
14110 * for dim, index in enumerate(indices):
14111 * if PyIndex_Check(index): # <<<<<<<<<<<<<<
14112 * cindex = index
14113 * slice_memviewslice(
14114*/
14115 __pyx_t_1 = (PyIndex_Check(__pyx_v_index) != 0);
14116
14117 if (__pyx_t_1) {
14118
14119
14120 /* "View.MemoryView":850
14121 * for dim, index in enumerate(indices):
14122 * if PyIndex_Check(index):
14123 * cindex = index # <<<<<<<<<<<<<<
14124 * slice_memviewslice(
14125 * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14126*/
14127 __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 850, __pyx_L1_error)
14128 __pyx_v_cindex = __pyx_t_8;
14129
14130 /* "View.MemoryView":851
14131 * if PyIndex_Check(index):
14132 * cindex = index
14133 * slice_memviewslice( # <<<<<<<<<<<<<<
14134 * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14135 * dim, new_ndim, p_suboffset_dim,
14136*/
14137 __pyx_t_9 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_cindex, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 851, __pyx_L1_error)
14138
14139
14140 /* "View.MemoryView":849
14141 *
14142 * for dim, index in enumerate(indices):
14143 * if PyIndex_Check(index): # <<<<<<<<<<<<<<
14144 * cindex = index
14145 * slice_memviewslice(
14146*/
14147 goto __pyx_L6;
14148 }
14149
14150 /* "View.MemoryView":857
14151 * 0, 0, 0, # have_{start,stop,step}
14152 * False)
14153 * elif index is None: # <<<<<<<<<<<<<<
14154 * p_dst.shape[new_ndim] = 1
14155 * p_dst.strides[new_ndim] = 0
14156*/
14157 __pyx_t_1 = (__pyx_v_index == Py_None);
14158 if (__pyx_t_1) {
14159
14160
14161 /* "View.MemoryView":858
14162 * False)
14163 * elif index is None:
14164 * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
14165 * p_dst.strides[new_ndim] = 0
14166 * p_dst.suboffsets[new_ndim] = -1
14167*/
14168 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
14169
14170 /* "View.MemoryView":859
14171 * elif index is None:
14172 * p_dst.shape[new_ndim] = 1
14173 * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
14174 * p_dst.suboffsets[new_ndim] = -1
14175 * new_ndim += 1
14176*/
14177 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
14178
14179 /* "View.MemoryView":860
14180 * p_dst.shape[new_ndim] = 1
14181 * p_dst.strides[new_ndim] = 0
14182 * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
14183 * new_ndim += 1
14184 * else:
14185*/
14186 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
14187
14188 /* "View.MemoryView":861
14189 * p_dst.strides[new_ndim] = 0
14190 * p_dst.suboffsets[new_ndim] = -1
14191 * new_ndim += 1 # <<<<<<<<<<<<<<
14192 * else:
14193 * start = index.start or 0
14194*/
14195 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
14196
14197 /* "View.MemoryView":857
14198 * 0, 0, 0, # have_{start,stop,step}
14199 * False)
14200 * elif index is None: # <<<<<<<<<<<<<<
14201 * p_dst.shape[new_ndim] = 1
14202 * p_dst.strides[new_ndim] = 0
14203*/
14204 goto __pyx_L6;
14205 }
14206
14207 /* "View.MemoryView":863
14208 * new_ndim += 1
14209 * else:
14210 * start = index.start or 0 # <<<<<<<<<<<<<<
14211 * stop = index.stop or 0
14212 * step = index.step or 0
14213*/
14214 /*else*/ {
14215 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 863, __pyx_L1_error)
14216 __Pyx_GOTREF(__pyx_t_7);
14217 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 863, __pyx_L1_error)
14218 if (!__pyx_t_1) {
14219 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14220 } else {
14221 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 863, __pyx_L1_error)
14222 __pyx_t_8 = __pyx_t_10;
14223 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14224 goto __pyx_L7_bool_binop_done;
14225 }
14226
14227 __pyx_t_8 = 0;
14228 __pyx_L7_bool_binop_done:;
14229 __pyx_v_start = __pyx_t_8;
14230
14231 /* "View.MemoryView":864
14232 * else:
14233 * start = index.start or 0
14234 * stop = index.stop or 0 # <<<<<<<<<<<<<<
14235 * step = index.step or 0
14236 *
14237*/
14238 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_stop); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 864, __pyx_L1_error)
14239 __Pyx_GOTREF(__pyx_t_7);
14240 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 864, __pyx_L1_error)
14241 if (!__pyx_t_1) {
14242 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14243 } else {
14244 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 864, __pyx_L1_error)
14245 __pyx_t_8 = __pyx_t_10;
14246 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14247 goto __pyx_L9_bool_binop_done;
14248 }
14249
14250 __pyx_t_8 = 0;
14251 __pyx_L9_bool_binop_done:;
14252 __pyx_v_stop = __pyx_t_8;
14253
14254 /* "View.MemoryView":865
14255 * start = index.start or 0
14256 * stop = index.stop or 0
14257 * step = index.step or 0 # <<<<<<<<<<<<<<
14258 *
14259 * have_start = index.start is not None
14260*/
14261 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_step); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 865, __pyx_L1_error)
14262 __Pyx_GOTREF(__pyx_t_7);
14263 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 865, __pyx_L1_error)
14264 if (!__pyx_t_1) {
14265 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14266 } else {
14267 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 865, __pyx_L1_error)
14268 __pyx_t_8 = __pyx_t_10;
14269 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14270 goto __pyx_L11_bool_binop_done;
14271 }
14272
14273 __pyx_t_8 = 0;
14274 __pyx_L11_bool_binop_done:;
14275 __pyx_v_step = __pyx_t_8;
14276
14277 /* "View.MemoryView":867
14278 * step = index.step or 0
14279 *
14280 * have_start = index.start is not None # <<<<<<<<<<<<<<
14281 * have_stop = index.stop is not None
14282 * have_step = index.step is not None
14283*/
14284 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 867, __pyx_L1_error)
14285 __Pyx_GOTREF(__pyx_t_7);
14286 __pyx_t_1 = (__pyx_t_7 != Py_None);
14287 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14288 __pyx_v_have_start = __pyx_t_1;
14289
14290 /* "View.MemoryView":868
14291 *
14292 * have_start = index.start is not None
14293 * have_stop = index.stop is not None # <<<<<<<<<<<<<<
14294 * have_step = index.step is not None
14295 *
14296*/
14297 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_stop); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 868, __pyx_L1_error)
14298 __Pyx_GOTREF(__pyx_t_7);
14299 __pyx_t_1 = (__pyx_t_7 != Py_None);
14300 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14301 __pyx_v_have_stop = __pyx_t_1;
14302
14303 /* "View.MemoryView":869
14304 * have_start = index.start is not None
14305 * have_stop = index.stop is not None
14306 * have_step = index.step is not None # <<<<<<<<<<<<<<
14307 *
14308 * slice_memviewslice(
14309*/
14310 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_mstate_global->__pyx_n_u_step); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 869, __pyx_L1_error)
14311 __Pyx_GOTREF(__pyx_t_7);
14312 __pyx_t_1 = (__pyx_t_7 != Py_None);
14313 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14314 __pyx_v_have_step = __pyx_t_1;
14315
14316 /* "View.MemoryView":871
14317 * have_step = index.step is not None
14318 *
14319 * slice_memviewslice( # <<<<<<<<<<<<<<
14320 * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14321 * dim, new_ndim, p_suboffset_dim,
14322*/
14323 __pyx_t_9 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 871, __pyx_L1_error)
14324
14325
14326 /* "View.MemoryView":877
14327 * have_start, have_stop, have_step,
14328 * True)
14329 * new_ndim += 1 # <<<<<<<<<<<<<<
14330 *
14331 * if isinstance(memview, _memoryviewslice):
14332*/
14333 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
14334 }
14335 __pyx_L6:;
14336
14337 /* "View.MemoryView":848
14338 * cdef bint have_start, have_stop, have_step
14339 *
14340 * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
14341 * if PyIndex_Check(index):
14342 * cindex = index
14343*/
14344 }
14345 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14346
14347 /* "View.MemoryView":879
14348 * new_ndim += 1
14349 *
14350 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14351 * return memoryview_fromslice(dst, new_ndim,
14352 * memviewsliceobj.to_object_func,
14353*/
14354 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
14355 if (__pyx_t_1) {
14356
14357
14358 /* "View.MemoryView":881
14359 * if isinstance(memview, _memoryviewslice):
14360 * return memoryview_fromslice(dst, new_ndim,
14361 * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
14362 * memviewsliceobj.to_dtype_func,
14363 * memview.dtype_is_object)
14364*/
14365 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 881, __pyx_L1_error) }
14366
14367 /* "View.MemoryView":882
14368 * return memoryview_fromslice(dst, new_ndim,
14369 * memviewsliceobj.to_object_func,
14370 * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
14371 * memview.dtype_is_object)
14372 * else:
14373*/
14374 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 882, __pyx_L1_error) }
14375
14376 /* "View.MemoryView":880
14377 *
14378 * if isinstance(memview, _memoryviewslice):
14379 * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
14380 * memviewsliceobj.to_object_func,
14381 * memviewsliceobj.to_dtype_func,
14382*/
14383 __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 880, __pyx_L1_error)
14384 __Pyx_GOTREF(__pyx_t_2);
14385 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 880, __pyx_L1_error)
14386 {
14387 struct __pyx_memoryview_obj *__pyx_temp;
14388 {
14389 __pyx_temp = __pyx_r;
14390 __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
14391 }
14392 __Pyx_XDECREF((PyObject *)__pyx_temp);
14393 }
14394 __pyx_t_2 = 0;
14395 goto __pyx_L0;
14396
14397 /* "View.MemoryView":879
14398 * new_ndim += 1
14399 *
14400 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14401 * return memoryview_fromslice(dst, new_ndim,
14402 * memviewsliceobj.to_object_func,
14403*/
14404 }
14405
14406 /* "View.MemoryView":885
14407 * memview.dtype_is_object)
14408 * else:
14409 * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
14410 * memview.dtype_is_object)
14411 *
14412*/
14413 /*else*/ {
14414
14415 /* "View.MemoryView":886
14416 * else:
14417 * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
14418 * memview.dtype_is_object) # <<<<<<<<<<<<<<
14419 *
14420 *
14421*/
14422 __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 885, __pyx_L1_error)
14423 __Pyx_GOTREF(__pyx_t_2);
14424
14425 /* "View.MemoryView":885
14426 * memview.dtype_is_object)
14427 * else:
14428 * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
14429 * memview.dtype_is_object)
14430 *
14431*/
14432 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(1, 885, __pyx_L1_error)
14433 {
14434 struct __pyx_memoryview_obj *__pyx_temp;
14435 {
14436 __pyx_temp = __pyx_r;
14437 __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
14438 }
14439 __Pyx_XDECREF((PyObject *)__pyx_temp);
14440 }
14441 __pyx_t_2 = 0;
14442 goto __pyx_L0;
14443 }
14444
14445 /* "View.MemoryView":811
14446 *
14447 *
14448 * @cname('__pyx_memview_slice') # <<<<<<<<<<<<<<
14449 * cdef memoryview memview_slice(memoryview memview, tuple indices):
14450 * cdef int new_ndim = 0, suboffset_dim = -1, dim
14451*/
14452
14453 /* function exit code */
14454 __pyx_L1_error:;
14455 __Pyx_XDECREF(__pyx_t_2);
14456 __Pyx_XDECREF(__pyx_t_7);
14457 __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14458 __pyx_r = 0;
14459 __pyx_L0:;
14460
14461
14462
14463
14464
14465
14466 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476 __Pyx_XDECREF(__pyx_v_index);
14477 __Pyx_XGIVEREF((PyObject *)__pyx_r);
14478 __Pyx_RefNannyFinishContext();
14479 return __pyx_r;
14480}
14481
14482/* "View.MemoryView":892
14483 *
14484 *
14485 * @cname('__pyx_pybuffer_index') # <<<<<<<<<<<<<<
14486 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
14487 * Py_ssize_t dim) except NULL:
14488*/
14489
14490static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
14491 Py_ssize_t __pyx_v_shape;
14492 Py_ssize_t __pyx_v_stride;
14493 Py_ssize_t __pyx_v_suboffset;
14494 Py_ssize_t __pyx_v_itemsize;
14495 char *__pyx_v_resultp;
14496 char *__pyx_r;
14497 Py_ssize_t __pyx_t_1;
14498 int __pyx_t_2;
14499 int __pyx_t_3;
14500 int __pyx_lineno = 0;
14501 const char *__pyx_filename = NULL;
14502 int __pyx_clineno = 0;
14503
14504
14505 /* "View.MemoryView":895
14506 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
14507 * Py_ssize_t dim) except NULL:
14508 * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
14509 * cdef Py_ssize_t itemsize = view.itemsize
14510 * cdef char *resultp
14511*/
14512 __pyx_v_suboffset = -1L;
14513
14514 /* "View.MemoryView":896
14515 * Py_ssize_t dim) except NULL:
14516 * cdef Py_ssize_t shape, stride, suboffset = -1
14517 * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
14518 * cdef char *resultp
14519 *
14520*/
14521 __pyx_t_1 = __pyx_v_view->itemsize;
14522
14523 __pyx_v_itemsize = __pyx_t_1;
14524
14525 /* "View.MemoryView":899
14526 * cdef char *resultp
14527 *
14528 * if view.ndim == 0: # <<<<<<<<<<<<<<
14529 * shape = view.len // itemsize
14530 * stride = itemsize
14531*/
14532 __pyx_t_2 = (__pyx_v_view->ndim == 0);
14533
14534 if (__pyx_t_2) {
14535
14536
14537 /* "View.MemoryView":900
14538 *
14539 * if view.ndim == 0:
14540 * shape = view.len // itemsize # <<<<<<<<<<<<<<
14541 * stride = itemsize
14542 * else:
14543*/
14544 if (unlikely(__pyx_v_itemsize == 0)) {
14545 PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
14546 __PYX_ERR(1, 900, __pyx_L1_error)
14547 }
14548 else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
14549 PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
14550 __PYX_ERR(1, 900, __pyx_L1_error)
14551 }
14552 __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize, 0);
14553
14554 /* "View.MemoryView":901
14555 * if view.ndim == 0:
14556 * shape = view.len // itemsize
14557 * stride = itemsize # <<<<<<<<<<<<<<
14558 * else:
14559 * shape = view.shape[dim]
14560*/
14561 __pyx_v_stride = __pyx_v_itemsize;
14562
14563 /* "View.MemoryView":899
14564 * cdef char *resultp
14565 *
14566 * if view.ndim == 0: # <<<<<<<<<<<<<<
14567 * shape = view.len // itemsize
14568 * stride = itemsize
14569*/
14570 goto __pyx_L3;
14571 }
14572
14573 /* "View.MemoryView":903
14574 * stride = itemsize
14575 * else:
14576 * shape = view.shape[dim] # <<<<<<<<<<<<<<
14577 * stride = view.strides[dim]
14578 * if view.suboffsets != NULL:
14579*/
14580 /*else*/ {
14581 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
14582
14583 /* "View.MemoryView":904
14584 * else:
14585 * shape = view.shape[dim]
14586 * stride = view.strides[dim] # <<<<<<<<<<<<<<
14587 * if view.suboffsets != NULL:
14588 * suboffset = view.suboffsets[dim]
14589*/
14590 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
14591
14592 /* "View.MemoryView":905
14593 * shape = view.shape[dim]
14594 * stride = view.strides[dim]
14595 * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
14596 * suboffset = view.suboffsets[dim]
14597 *
14598*/
14599 __pyx_t_2 = (__pyx_v_view->suboffsets != NULL);
14600
14601 if (__pyx_t_2) {
14602
14603
14604 /* "View.MemoryView":906
14605 * stride = view.strides[dim]
14606 * if view.suboffsets != NULL:
14607 * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
14608 *
14609 * if index < 0:
14610*/
14611 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
14612
14613 /* "View.MemoryView":905
14614 * shape = view.shape[dim]
14615 * stride = view.strides[dim]
14616 * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
14617 * suboffset = view.suboffsets[dim]
14618 *
14619*/
14620 }
14621 }
14622 __pyx_L3:;
14623
14624 /* "View.MemoryView":908
14625 * suboffset = view.suboffsets[dim]
14626 *
14627 * if index < 0: # <<<<<<<<<<<<<<
14628 * index += view.shape[dim]
14629 * if cython.unlikely(index < 0):
14630*/
14631 __pyx_t_2 = (__pyx_v_index < 0);
14632
14633 if (__pyx_t_2) {
14634
14635
14636 /* "View.MemoryView":909
14637 *
14638 * if index < 0:
14639 * index += view.shape[dim] # <<<<<<<<<<<<<<
14640 * if cython.unlikely(index < 0):
14641 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14642*/
14643 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
14644
14645 /* "View.MemoryView":910
14646 * if index < 0:
14647 * index += view.shape[dim]
14648 * if cython.unlikely(index < 0): # <<<<<<<<<<<<<<
14649 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14650 *
14651*/
14652 __pyx_t_2 = (__pyx_v_index < 0);
14653
14654 if (unlikely(__pyx_t_2)) {
14655
14656
14657 /* "View.MemoryView":911
14658 * index += view.shape[dim]
14659 * if cython.unlikely(index < 0):
14660 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim) # <<<<<<<<<<<<<<
14661 *
14662 * if cython.unlikely(index >= shape):
14663*/
14664 __pyx_t_3 = __pyx_memoryview_err_IndexError(__pyx_k_Out_of_bounds_on_buffer_access_a, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 911, __pyx_L1_error)
14665
14666
14667 /* "View.MemoryView":910
14668 * if index < 0:
14669 * index += view.shape[dim]
14670 * if cython.unlikely(index < 0): # <<<<<<<<<<<<<<
14671 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14672 *
14673*/
14674 }
14675
14676 /* "View.MemoryView":908
14677 * suboffset = view.suboffsets[dim]
14678 *
14679 * if index < 0: # <<<<<<<<<<<<<<
14680 * index += view.shape[dim]
14681 * if cython.unlikely(index < 0):
14682*/
14683 }
14684
14685 /* "View.MemoryView":913
14686 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14687 *
14688 * if cython.unlikely(index >= shape): # <<<<<<<<<<<<<<
14689 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14690 *
14691*/
14692 __pyx_t_2 = (__pyx_v_index >= __pyx_v_shape);
14693
14694 if (unlikely(__pyx_t_2)) {
14695
14696
14697 /* "View.MemoryView":914
14698 *
14699 * if cython.unlikely(index >= shape):
14700 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim) # <<<<<<<<<<<<<<
14701 *
14702 * resultp = bufp + index * stride
14703*/
14704 __pyx_t_3 = __pyx_memoryview_err_IndexError(__pyx_k_Out_of_bounds_on_buffer_access_a, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 914, __pyx_L1_error)
14705
14706
14707 /* "View.MemoryView":913
14708 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14709 *
14710 * if cython.unlikely(index >= shape): # <<<<<<<<<<<<<<
14711 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14712 *
14713*/
14714 }
14715
14716 /* "View.MemoryView":916
14717 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14718 *
14719 * resultp = bufp + index * stride # <<<<<<<<<<<<<<
14720 * if suboffset >= 0:
14721 * resultp = (<char **> resultp)[0] + suboffset
14722*/
14723 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
14724
14725 /* "View.MemoryView":917
14726 *
14727 * resultp = bufp + index * stride
14728 * if suboffset >= 0: # <<<<<<<<<<<<<<
14729 * resultp = (<char **> resultp)[0] + suboffset
14730 *
14731*/
14732 __pyx_t_2 = (__pyx_v_suboffset >= 0);
14733
14734 if (__pyx_t_2) {
14735
14736
14737 /* "View.MemoryView":918
14738 * resultp = bufp + index * stride
14739 * if suboffset >= 0:
14740 * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
14741 *
14742 * return resultp
14743*/
14744 __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
14745
14746 /* "View.MemoryView":917
14747 *
14748 * resultp = bufp + index * stride
14749 * if suboffset >= 0: # <<<<<<<<<<<<<<
14750 * resultp = (<char **> resultp)[0] + suboffset
14751 *
14752*/
14753 }
14754
14755 /* "View.MemoryView":920
14756 * resultp = (<char **> resultp)[0] + suboffset
14757 *
14758 * return resultp # <<<<<<<<<<<<<<
14759 *
14760 *
14761*/
14762 {
14763
14764 __pyx_r = __pyx_v_resultp;
14765 }
14766 goto __pyx_L0;
14767
14768 /* "View.MemoryView":892
14769 *
14770 *
14771 * @cname('__pyx_pybuffer_index') # <<<<<<<<<<<<<<
14772 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
14773 * Py_ssize_t dim) except NULL:
14774*/
14775
14776 /* function exit code */
14777 __pyx_L1_error:;
14778 __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
14779 __pyx_r = NULL;
14780 __pyx_L0:;
14781
14782
14783
14784
14785
14786
14787
14788 return __pyx_r;
14789}
14790
14791/* "View.MemoryView":925
14792 *
14793 *
14794 * @cname('__pyx_memslice_transpose') # <<<<<<<<<<<<<<
14795 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
14796 * cdef int ndim = memslice.memview.view.ndim
14797*/
14798
14799static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
14800 int __pyx_v_ndim;
14801 Py_ssize_t *__pyx_v_shape;
14802 Py_ssize_t *__pyx_v_strides;
14803 int __pyx_v_i;
14804 int __pyx_v_j;
14805 int __pyx_r;
14806 int __pyx_t_1;
14807 Py_ssize_t *__pyx_t_2;
14808 long __pyx_t_3;
14809 long __pyx_t_4;
14810 Py_ssize_t __pyx_t_5;
14811 Py_ssize_t __pyx_t_6;
14812 int __pyx_t_7;
14813 int __pyx_t_8;
14814 int __pyx_t_9;
14815 int __pyx_lineno = 0;
14816 const char *__pyx_filename = NULL;
14817 int __pyx_clineno = 0;
14818 PyGILState_STATE __pyx_gilstate_save;
14819
14820 /* "View.MemoryView":927
14821 * @cname('__pyx_memslice_transpose')
14822 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
14823 * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
14824 *
14825 * cdef Py_ssize_t *shape = memslice.shape
14826*/
14827 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
14828
14829 __pyx_v_ndim = __pyx_t_1;
14830
14831 /* "View.MemoryView":929
14832 * cdef int ndim = memslice.memview.view.ndim
14833 *
14834 * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
14835 * cdef Py_ssize_t *strides = memslice.strides
14836 *
14837*/
14838 __pyx_t_2 = __pyx_v_memslice->shape;
14839
14840 __pyx_v_shape = __pyx_t_2;
14841
14842 /* "View.MemoryView":930
14843 *
14844 * cdef Py_ssize_t *shape = memslice.shape
14845 * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
14846 *
14847 *
14848*/
14849 __pyx_t_2 = __pyx_v_memslice->strides;
14850
14851 __pyx_v_strides = __pyx_t_2;
14852
14853 /* "View.MemoryView":934
14854 *
14855 * cdef int i, j
14856 * for i in range(ndim // 2): # <<<<<<<<<<<<<<
14857 * j = ndim - 1 - i
14858 * strides[i], strides[j] = strides[j], strides[i]
14859*/
14860
14861 __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2, 1);
14862 __pyx_t_4 = __pyx_t_3;
14863
14864 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
14865 __pyx_v_i = __pyx_t_1;
14866
14867 /* "View.MemoryView":935
14868 * cdef int i, j
14869 * for i in range(ndim // 2):
14870 * j = ndim - 1 - i # <<<<<<<<<<<<<<
14871 * strides[i], strides[j] = strides[j], strides[i]
14872 * shape[i], shape[j] = shape[j], shape[i]
14873*/
14874 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
14875
14876 /* "View.MemoryView":936
14877 * for i in range(ndim // 2):
14878 * j = ndim - 1 - i
14879 * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
14880 * shape[i], shape[j] = shape[j], shape[i]
14881 *
14882*/
14883 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
14884
14885 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
14886
14887 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
14888
14889 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
14890
14891
14892 /* "View.MemoryView":937
14893 * j = ndim - 1 - i
14894 * strides[i], strides[j] = strides[j], strides[i]
14895 * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
14896 *
14897 * if cython.unlikely(memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0):
14898*/
14899 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
14900
14901 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
14902
14903 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
14904
14905 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
14906
14907
14908 /* "View.MemoryView":939
14909 * shape[i], shape[j] = shape[j], shape[i]
14910 *
14911 * if cython.unlikely(memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0): # <<<<<<<<<<<<<<
14912 * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14913 *
14914*/
14915 __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0);
14916
14917 if (!__pyx_t_8) {
14918
14919 } else {
14920
14921 __pyx_t_7 = __pyx_t_8;
14922
14923 goto __pyx_L6_bool_binop_done;
14924 }
14925 __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0);
14926
14927
14928 __pyx_t_7 = __pyx_t_8;
14929
14930 __pyx_L6_bool_binop_done:;
14931 if (unlikely(__pyx_t_7)) {
14932
14933
14934 /* "View.MemoryView":940
14935 *
14936 * if cython.unlikely(memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0):
14937 * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
14938 *
14939 * return 0
14940*/
14941 __pyx_t_9 = __pyx_memoryview_err(PyExc_ValueError, __pyx_k_Cannot_transpose_memoryview_with); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 940, __pyx_L1_error)
14942
14943
14944 /* "View.MemoryView":939
14945 * shape[i], shape[j] = shape[j], shape[i]
14946 *
14947 * if cython.unlikely(memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0): # <<<<<<<<<<<<<<
14948 * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14949 *
14950*/
14951 }
14952 }
14953
14954
14955 /* "View.MemoryView":942
14956 * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14957 *
14958 * return 0 # <<<<<<<<<<<<<<
14959 *
14960 *
14961*/
14962 {
14963
14964 __pyx_r = 0;
14965 }
14966 goto __pyx_L0;
14967
14968 /* "View.MemoryView":925
14969 *
14970 *
14971 * @cname('__pyx_memslice_transpose') # <<<<<<<<<<<<<<
14972 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
14973 * cdef int ndim = memslice.memview.view.ndim
14974*/
14975
14976 /* function exit code */
14977 __pyx_L1_error:;
14978 __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
14979 __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14980 __pyx_r = -1;
14981 __Pyx_PyGILState_Release(__pyx_gilstate_save);
14982 __pyx_L0:;
14983
14984
14985
14986
14987
14988 return __pyx_r;
14989}
14990
14991/* "View.MemoryView":960
14992 * cdef to_dtype_func_type to_dtype_func
14993 *
14994 * def __dealloc__(self): # <<<<<<<<<<<<<<
14995 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14996 *
14997*/
14998
14999/* Python wrapper */
15000static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
15001static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
15002 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
15003 __Pyx_RefNannyDeclarations
15004 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
15005 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
15006 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
15007
15008 /* function exit code */
15009 __Pyx_RefNannyFinishContext();
15010}
15011
15012static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
15013
15014 /* "View.MemoryView":961
15015 *
15016 * def __dealloc__(self):
15017 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
15018 *
15019 * cdef convert_item_to_object(self, char *itemp):
15020*/
15021 __PYX_XCLEAR_MEMVIEW((&__pyx_v_self->from_slice), 1);
15022
15023 /* "View.MemoryView":960
15024 * cdef to_dtype_func_type to_dtype_func
15025 *
15026 * def __dealloc__(self): # <<<<<<<<<<<<<<
15027 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
15028 *
15029*/
15030
15031 /* function exit code */
15032
15033}
15034
15035/* "View.MemoryView":963
15036 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
15037 *
15038 * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
15039 * if self.to_object_func != NULL:
15040 * return self.to_object_func(itemp)
15041*/
15042
15043static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
15044 PyObject *__pyx_r = NULL;
15045 __Pyx_RefNannyDeclarations
15046 int __pyx_t_1;
15047 PyObject *__pyx_t_2 = NULL;
15048 int __pyx_lineno = 0;
15049 const char *__pyx_filename = NULL;
15050 int __pyx_clineno = 0;
15051 __Pyx_RefNannySetupContext("convert_item_to_object", 0);
15052
15053 /* "View.MemoryView":964
15054 *
15055 * cdef convert_item_to_object(self, char *itemp):
15056 * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
15057 * return self.to_object_func(itemp)
15058 * else:
15059*/
15060 __pyx_t_1 = (__pyx_v_self->to_object_func != NULL);
15061
15062 if (__pyx_t_1) {
15063
15064
15065 /* "View.MemoryView":965
15066 * cdef convert_item_to_object(self, char *itemp):
15067 * if self.to_object_func != NULL:
15068 * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
15069 * else:
15070 * return memoryview.convert_item_to_object(self, itemp)
15071*/
15072 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 965, __pyx_L1_error)
15073 __Pyx_GOTREF(__pyx_t_2);
15074 {
15075 PyObject *__pyx_temp;
15076 {
15077 __pyx_temp = __pyx_r;
15078 __pyx_r = __pyx_t_2;
15079 }
15080 __Pyx_XDECREF(__pyx_temp);
15081 }
15082 __pyx_t_2 = 0;
15083 goto __pyx_L0;
15084
15085 /* "View.MemoryView":964
15086 *
15087 * cdef convert_item_to_object(self, char *itemp):
15088 * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
15089 * return self.to_object_func(itemp)
15090 * else:
15091*/
15092 }
15093
15094 /* "View.MemoryView":967
15095 * return self.to_object_func(itemp)
15096 * else:
15097 * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
15098 *
15099 * cdef assign_item_from_object(self, char *itemp, object value):
15100*/
15101 /*else*/ {
15102 __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 967, __pyx_L1_error)
15103 __Pyx_GOTREF(__pyx_t_2);
15104 {
15105 PyObject *__pyx_temp;
15106 {
15107 __pyx_temp = __pyx_r;
15108 __pyx_r = __pyx_t_2;
15109 }
15110 __Pyx_XDECREF(__pyx_temp);
15111 }
15112 __pyx_t_2 = 0;
15113 goto __pyx_L0;
15114 }
15115
15116 /* "View.MemoryView":963
15117 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
15118 *
15119 * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
15120 * if self.to_object_func != NULL:
15121 * return self.to_object_func(itemp)
15122*/
15123
15124 /* function exit code */
15125 __pyx_L1_error:;
15126 __Pyx_XDECREF(__pyx_t_2);
15127 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
15128 __pyx_r = 0;
15129 __pyx_L0:;
15130 __Pyx_XGIVEREF(__pyx_r);
15131 __Pyx_RefNannyFinishContext();
15132 return __pyx_r;
15133}
15134
15135/* "View.MemoryView":969
15136 * return memoryview.convert_item_to_object(self, itemp)
15137 *
15138 * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
15139 * if self.to_dtype_func != NULL:
15140 * self.to_dtype_func(itemp, value)
15141*/
15142
15143static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
15144 PyObject *__pyx_r = NULL;
15145 __Pyx_RefNannyDeclarations
15146 int __pyx_t_1;
15147 int __pyx_t_2;
15148 PyObject *__pyx_t_3 = NULL;
15149 int __pyx_lineno = 0;
15150 const char *__pyx_filename = NULL;
15151 int __pyx_clineno = 0;
15152 __Pyx_RefNannySetupContext("assign_item_from_object", 0);
15153
15154 /* "View.MemoryView":970
15155 *
15156 * cdef assign_item_from_object(self, char *itemp, object value):
15157 * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
15158 * self.to_dtype_func(itemp, value)
15159 * else:
15160*/
15161 __pyx_t_1 = (__pyx_v_self->to_dtype_func != NULL);
15162
15163 if (__pyx_t_1) {
15164
15165
15166 /* "View.MemoryView":971
15167 * cdef assign_item_from_object(self, char *itemp, object value):
15168 * if self.to_dtype_func != NULL:
15169 * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
15170 * else:
15171 * memoryview.assign_item_from_object(self, itemp, value)
15172*/
15173 __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 971, __pyx_L1_error)
15174
15175
15176 /* "View.MemoryView":970
15177 *
15178 * cdef assign_item_from_object(self, char *itemp, object value):
15179 * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
15180 * self.to_dtype_func(itemp, value)
15181 * else:
15182*/
15183 goto __pyx_L3;
15184 }
15185
15186 /* "View.MemoryView":973
15187 * self.to_dtype_func(itemp, value)
15188 * else:
15189 * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
15190 *
15191 * cdef _get_base(self):
15192*/
15193 /*else*/ {
15194 __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 973, __pyx_L1_error)
15195 __Pyx_GOTREF(__pyx_t_3);
15196 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15197 }
15198 __pyx_L3:;
15199
15200 /* "View.MemoryView":969
15201 * return memoryview.convert_item_to_object(self, itemp)
15202 *
15203 * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
15204 * if self.to_dtype_func != NULL:
15205 * self.to_dtype_func(itemp, value)
15206*/
15207
15208 /* function exit code */
15209 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15210 goto __pyx_L0;
15211 __pyx_L1_error:;
15212 __Pyx_XDECREF(__pyx_t_3);
15213 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
15214 __pyx_r = 0;
15215 __pyx_L0:;
15216 __Pyx_XGIVEREF(__pyx_r);
15217 __Pyx_RefNannyFinishContext();
15218 return __pyx_r;
15219}
15220
15221/* "View.MemoryView":975
15222 * memoryview.assign_item_from_object(self, itemp, value)
15223 *
15224 * cdef _get_base(self): # <<<<<<<<<<<<<<
15225 * return self.from_object
15226 *
15227*/
15228
15229static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
15230 PyObject *__pyx_r = NULL;
15231 __Pyx_RefNannyDeclarations
15232 __Pyx_RefNannySetupContext("_get_base", 0);
15233
15234 /* "View.MemoryView":976
15235 *
15236 * cdef _get_base(self):
15237 * return self.from_object # <<<<<<<<<<<<<<
15238 *
15239 *
15240*/
15241 {
15242 PyObject *__pyx_temp;
15243 {
15244 __pyx_temp = __pyx_r;
15245 __Pyx_INCREF(__pyx_v_self->from_object);
15246 __pyx_r = __pyx_v_self->from_object;
15247 }
15248 __Pyx_XDECREF(__pyx_temp);
15249 }
15250 goto __pyx_L0;
15251
15252 /* "View.MemoryView":975
15253 * memoryview.assign_item_from_object(self, itemp, value)
15254 *
15255 * cdef _get_base(self): # <<<<<<<<<<<<<<
15256 * return self.from_object
15257 *
15258*/
15259
15260 /* function exit code */
15261 __pyx_L0:;
15262 __Pyx_XGIVEREF(__pyx_r);
15263 __Pyx_RefNannyFinishContext();
15264 return __pyx_r;
15265}
15266
15267/* "(tree fragment)":1
15268 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
15269 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15270 * def __setstate_cython__(self, __pyx_state):
15271*/
15272
15273/* Python wrapper */
15274static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
15275#if CYTHON_VECTORCALL
15276PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
15277#else
15278PyObject *__pyx_args, PyObject *__pyx_kwds
15279#endif
15280); /*proto*/
15281static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
15282#if CYTHON_VECTORCALL
15283PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
15284#else
15285PyObject *__pyx_args, PyObject *__pyx_kwds
15286#endif
15287) {
15288 #if !CYTHON_VECTORCALL
15289 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
15290 #endif
15291 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
15292 PyObject *__pyx_r = 0;
15293 __Pyx_RefNannyDeclarations
15294 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
15295 #if !CYTHON_VECTORCALL
15296 #if CYTHON_ASSUME_SAFE_SIZE
15297 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
15298 #else
15299 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
15300 #endif
15301 #endif
15302 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
15303 if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
15304 const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
15305 if (unlikely(__pyx_kwds_len < 0)) return NULL;
15306 if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
15307 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
15308
15309 /* function exit code */
15310 __Pyx_RefNannyFinishContext();
15311 return __pyx_r;
15312}
15313
15314static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
15315 PyObject *__pyx_r = NULL;
15316 __Pyx_RefNannyDeclarations
15317 int __pyx_lineno = 0;
15318 const char *__pyx_filename = NULL;
15319 int __pyx_clineno = 0;
15320 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
15321
15322 /* "(tree fragment)":2
15323 * def __reduce_cython__(self):
15324 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
15325 * def __setstate_cython__(self, __pyx_state):
15326 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15327*/
15328 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
15329 __PYX_ERR(1, 2, __pyx_L1_error)
15330
15331 /* "(tree fragment)":1
15332 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
15333 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15334 * def __setstate_cython__(self, __pyx_state):
15335*/
15336
15337 /* function exit code */
15338 __pyx_L1_error:;
15339 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15340 __pyx_r = NULL;
15341 __Pyx_XGIVEREF(__pyx_r);
15342 __Pyx_RefNannyFinishContext();
15343 return __pyx_r;
15344}
15345
15346/* "(tree fragment)":3
15347 * def __reduce_cython__(self):
15348 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15349 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15350 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15351*/
15352
15353/* Python wrapper */
15354static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
15355#if CYTHON_VECTORCALL
15356PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
15357#else
15358PyObject *__pyx_args, PyObject *__pyx_kwds
15359#endif
15360); /*proto*/
15361static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
15362#if CYTHON_VECTORCALL
15363PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
15364#else
15365PyObject *__pyx_args, PyObject *__pyx_kwds
15366#endif
15367) {
15368 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
15369 #if !CYTHON_VECTORCALL
15370 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
15371 #endif
15372 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
15373 PyObject* values[1] = {0};
15374 int __pyx_lineno = 0;
15375 const char *__pyx_filename = NULL;
15376 int __pyx_clineno = 0;
15377 PyObject *__pyx_r = 0;
15378 __Pyx_RefNannyDeclarations
15379 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
15380 #if !CYTHON_VECTORCALL
15381 #if CYTHON_ASSUME_SAFE_SIZE
15382 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
15383 #else
15384 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
15385 #endif
15386 #endif
15387 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
15388 {
15389 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
15390 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
15391 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
15392 if (__pyx_kwds_len > 0) {
15393 switch (__pyx_nargs) {
15394 case 1:
15395 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
15396 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
15397 CYTHON_FALLTHROUGH;
15398 case 0: break;
15399 default: goto __pyx_L5_argtuple_error;
15400 }
15401 const Py_ssize_t kwd_pos_args = __pyx_nargs;
15402 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(1, 3, __pyx_L3_error)
15403 for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
15404 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
15405 }
15406 } else if (unlikely(__pyx_nargs != 1)) {
15407 goto __pyx_L5_argtuple_error;
15408 } else {
15409 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
15410 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
15411 }
15412 __pyx_v___pyx_state = values[0];
15413 }
15414 goto __pyx_L6_skip;
15415 __pyx_L5_argtuple_error:;
15416 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
15417 __pyx_L6_skip:;
15418 goto __pyx_L4_argument_unpacking_done;
15419 __pyx_L3_error:;
15420 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
15421 Py_XDECREF(values[__pyx_temp]);
15422 }
15423 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15424 __Pyx_RefNannyFinishContext();
15425 return NULL;
15426 __pyx_L4_argument_unpacking_done:;
15427 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), __pyx_v___pyx_state);
15428
15429 /* function exit code */
15430 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
15431 Py_XDECREF(values[__pyx_temp]);
15432 }
15433 __Pyx_RefNannyFinishContext();
15434 return __pyx_r;
15435}
15436
15437static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
15438 PyObject *__pyx_r = NULL;
15439 __Pyx_RefNannyDeclarations
15440 int __pyx_lineno = 0;
15441 const char *__pyx_filename = NULL;
15442 int __pyx_clineno = 0;
15443 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
15444
15445 /* "(tree fragment)":4
15446 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15447 * def __setstate_cython__(self, __pyx_state):
15448 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
15449*/
15450 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
15451 __PYX_ERR(1, 4, __pyx_L1_error)
15452
15453 /* "(tree fragment)":3
15454 * def __reduce_cython__(self):
15455 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15456 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15457 * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15458*/
15459
15460 /* function exit code */
15461 __pyx_L1_error:;
15462 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15463 __pyx_r = NULL;
15464 __Pyx_XGIVEREF(__pyx_r);
15465 __Pyx_RefNannyFinishContext();
15466 return __pyx_r;
15467}
15468
15469/* "View.MemoryView":995
15470 * pass # ignore failure, it's a minor issue
15471 *
15472 * @cname('__pyx_memoryview_fromslice') # <<<<<<<<<<<<<<
15473 * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,
15474 * int ndim,
15475*/
15476
15477static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), __pyx_memoryview_to_dtype_func_type __pyx_v_to_dtype_func, int __pyx_v_dtype_is_object) {
15478 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
15479 Py_ssize_t __pyx_v_suboffset;
15480 Py_ssize_t __pyx_v_length;
15481 PyObject *__pyx_r = NULL;
15482 __Pyx_RefNannyDeclarations
15483 int __pyx_t_1;
15484 PyObject *__pyx_t_2 = NULL;
15485 PyObject *__pyx_t_3 = NULL;
15486 __Pyx_TypeInfo const *__pyx_t_4;
15487 Py_buffer __pyx_t_5;
15488 Py_ssize_t *__pyx_t_6;
15489 Py_ssize_t *__pyx_t_7;
15490 Py_ssize_t *__pyx_t_8;
15491 Py_ssize_t __pyx_t_9;
15492 int __pyx_lineno = 0;
15493 const char *__pyx_filename = NULL;
15494 int __pyx_clineno = 0;
15495 __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
15496
15497 /* "View.MemoryView":1004
15498 * cdef _memoryviewslice result
15499 *
15500 * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
15501 * return None
15502 *
15503*/
15504 __pyx_t_1 = (((PyObject *)__pyx_v_memviewslice.memview) == Py_None);
15505
15506 if (__pyx_t_1) {
15507
15508
15509 /* "View.MemoryView":1005
15510 *
15511 * if <PyObject *> memviewslice.memview == Py_None:
15512 * return None # <<<<<<<<<<<<<<
15513 *
15514 *
15515*/
15516 {
15517 PyObject *__pyx_temp;
15518 {
15519 __pyx_temp = __pyx_r;
15520 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15521 }
15522 __Pyx_XDECREF(__pyx_temp);
15523 }
15524 goto __pyx_L0;
15525
15526 /* "View.MemoryView":1004
15527 * cdef _memoryviewslice result
15528 *
15529 * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
15530 * return None
15531 *
15532*/
15533 }
15534
15535 /* "View.MemoryView":1010
15536 *
15537 *
15538 * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object) # <<<<<<<<<<<<<<
15539 *
15540 * result.from_slice = memviewslice
15541*/
15542 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1010, __pyx_L1_error)
15543 __Pyx_GOTREF(__pyx_t_2);
15544 __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1010, __pyx_L1_error)
15545 __Pyx_GOTREF(__pyx_t_3);
15546 __Pyx_INCREF(Py_None);
15547 __Pyx_GIVEREF(Py_None);
15548 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None) != (0)) __PYX_ERR(1, 1010, __pyx_L1_error);
15549 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
15550 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
15551 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(1, 1010, __pyx_L1_error);
15552 __Pyx_GIVEREF(__pyx_t_2);
15553 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2) != (0)) __PYX_ERR(1, 1010, __pyx_L1_error);
15554 __pyx_t_2 = 0;
15555 __pyx_t_2 = ((PyObject *)__pyx_tp_new__memoryviewslice(((PyTypeObject *)__pyx_mstate_global->__pyx_memoryviewslice_type), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1010, __pyx_L1_error)
15556 __Pyx_GOTREF(__pyx_t_2);
15557 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15558 __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
15559 __pyx_t_2 = 0;
15560
15561 /* "View.MemoryView":1012
15562 * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object)
15563 *
15564 * result.from_slice = memviewslice # <<<<<<<<<<<<<<
15565 * __PYX_INC_MEMVIEW(&memviewslice, 1)
15566 *
15567*/
15568 __pyx_v_result->from_slice = __pyx_v_memviewslice;
15569
15570 /* "View.MemoryView":1013
15571 *
15572 * result.from_slice = memviewslice
15573 * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
15574 *
15575 * result.from_object = (<memoryview> memviewslice.memview)._get_base()
15576*/
15577 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
15578
15579 /* "View.MemoryView":1015
15580 * __PYX_INC_MEMVIEW(&memviewslice, 1)
15581 *
15582 * result.from_object = (<memoryview> memviewslice.memview)._get_base() # <<<<<<<<<<<<<<
15583 * result.typeinfo = memviewslice.memview.typeinfo
15584 *
15585*/
15586 __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->__pyx_vtab)->_get_base(((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1015, __pyx_L1_error)
15587 __Pyx_GOTREF(__pyx_t_2);
15588 __Pyx_GIVEREF(__pyx_t_2);
15589 __Pyx_GOTREF(__pyx_v_result->from_object);
15590 __Pyx_DECREF(__pyx_v_result->from_object);
15591 __pyx_v_result->from_object = __pyx_t_2;
15592 __pyx_t_2 = 0;
15593
15594 /* "View.MemoryView":1016
15595 *
15596 * result.from_object = (<memoryview> memviewslice.memview)._get_base()
15597 * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
15598 *
15599 * result.view = memviewslice.memview.view
15600*/
15601 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
15602
15603 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
15604
15605 /* "View.MemoryView":1018
15606 * result.typeinfo = memviewslice.memview.typeinfo
15607 *
15608 * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
15609 * result.view.buf = <void *> memviewslice.data
15610 * result.view.ndim = ndim
15611*/
15612 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
15613
15614 __pyx_v_result->__pyx_base.view = __pyx_t_5;
15615
15616 /* "View.MemoryView":1019
15617 *
15618 * result.view = memviewslice.memview.view
15619 * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
15620 * result.view.ndim = ndim
15621 * (<__pyx_buffer *> &result.view).obj = Py_None
15622*/
15623 __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
15624
15625 /* "View.MemoryView":1020
15626 * result.view = memviewslice.memview.view
15627 * result.view.buf = <void *> memviewslice.data
15628 * result.view.ndim = ndim # <<<<<<<<<<<<<<
15629 * (<__pyx_buffer *> &result.view).obj = Py_None
15630 * Py_INCREF(Py_None)
15631*/
15632 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
15633
15634 /* "View.MemoryView":1021
15635 * result.view.buf = <void *> memviewslice.data
15636 * result.view.ndim = ndim
15637 * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
15638 * Py_INCREF(Py_None)
15639 *
15640*/
15641 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
15642
15643 /* "View.MemoryView":1022
15644 * result.view.ndim = ndim
15645 * (<__pyx_buffer *> &result.view).obj = Py_None
15646 * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
15647 *
15648 * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
15649*/
15650 Py_INCREF(Py_None);
15651
15652 /* "View.MemoryView":1024
15653 * Py_INCREF(Py_None)
15654 *
15655 * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
15656 * result.flags = PyBUF_RECORDS
15657 * else:
15658*/
15659 __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
15660
15661 if (__pyx_t_1) {
15662
15663
15664 /* "View.MemoryView":1025
15665 *
15666 * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
15667 * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
15668 * else:
15669 * result.flags = PyBUF_RECORDS_RO
15670*/
15671 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
15672
15673 /* "View.MemoryView":1024
15674 * Py_INCREF(Py_None)
15675 *
15676 * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
15677 * result.flags = PyBUF_RECORDS
15678 * else:
15679*/
15680 goto __pyx_L4;
15681 }
15682
15683 /* "View.MemoryView":1027
15684 * result.flags = PyBUF_RECORDS
15685 * else:
15686 * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
15687 *
15688 * result.view.shape = <Py_ssize_t *> result.from_slice.shape
15689*/
15690 /*else*/ {
15691 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
15692 }
15693 __pyx_L4:;
15694
15695 /* "View.MemoryView":1029
15696 * result.flags = PyBUF_RECORDS_RO
15697 *
15698 * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
15699 * result.view.strides = <Py_ssize_t *> result.from_slice.strides
15700 *
15701*/
15702 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
15703
15704 /* "View.MemoryView":1030
15705 *
15706 * result.view.shape = <Py_ssize_t *> result.from_slice.shape
15707 * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
15708 *
15709 *
15710*/
15711 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
15712
15713 /* "View.MemoryView":1033
15714 *
15715 *
15716 * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
15717 * for suboffset in result.from_slice.suboffsets[:ndim]:
15718 * if suboffset >= 0:
15719*/
15720 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
15721
15722 /* "View.MemoryView":1034
15723 *
15724 * result.view.suboffsets = NULL
15725 * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
15726 * if suboffset >= 0:
15727 * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15728*/
15729 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
15730
15731 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15732 __pyx_t_6 = __pyx_t_8;
15733 __pyx_v_suboffset = (__pyx_t_6[0]);
15734
15735 /* "View.MemoryView":1035
15736 * result.view.suboffsets = NULL
15737 * for suboffset in result.from_slice.suboffsets[:ndim]:
15738 * if suboffset >= 0: # <<<<<<<<<<<<<<
15739 * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15740 * break
15741*/
15742 __pyx_t_1 = (__pyx_v_suboffset >= 0);
15743
15744 if (__pyx_t_1) {
15745
15746
15747 /* "View.MemoryView":1036
15748 * for suboffset in result.from_slice.suboffsets[:ndim]:
15749 * if suboffset >= 0:
15750 * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
15751 * break
15752 *
15753*/
15754 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
15755
15756 /* "View.MemoryView":1037
15757 * if suboffset >= 0:
15758 * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15759 * break # <<<<<<<<<<<<<<
15760 *
15761 * cdef Py_ssize_t length
15762*/
15763 goto __pyx_L6_break;
15764
15765 /* "View.MemoryView":1035
15766 * result.view.suboffsets = NULL
15767 * for suboffset in result.from_slice.suboffsets[:ndim]:
15768 * if suboffset >= 0: # <<<<<<<<<<<<<<
15769 * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15770 * break
15771*/
15772 }
15773 }
15774 __pyx_L6_break:;
15775
15776
15777 /* "View.MemoryView":1040
15778 *
15779 * cdef Py_ssize_t length
15780 * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
15781 * for length in result.view.shape[:ndim]:
15782 * result.view.len *= length
15783*/
15784 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
15785
15786 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
15787
15788 /* "View.MemoryView":1041
15789 * cdef Py_ssize_t length
15790 * result.view.len = result.view.itemsize
15791 * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
15792 * result.view.len *= length
15793 *
15794*/
15795 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
15796
15797 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15798 __pyx_t_6 = __pyx_t_8;
15799 __pyx_v_length = (__pyx_t_6[0]);
15800
15801 /* "View.MemoryView":1042
15802 * result.view.len = result.view.itemsize
15803 * for length in result.view.shape[:ndim]:
15804 * result.view.len *= length # <<<<<<<<<<<<<<
15805 *
15806 * result.to_object_func = to_object_func
15807*/
15808 __pyx_v_result->__pyx_base.view.len = (__pyx_v_result->__pyx_base.view.len * __pyx_v_length);
15809 }
15810
15811
15812 /* "View.MemoryView":1044
15813 * result.view.len *= length
15814 *
15815 * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
15816 * result.to_dtype_func = to_dtype_func
15817 *
15818*/
15819 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
15820
15821 /* "View.MemoryView":1045
15822 *
15823 * result.to_object_func = to_object_func
15824 * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
15825 *
15826 * return result
15827*/
15828 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
15829
15830 /* "View.MemoryView":1047
15831 * result.to_dtype_func = to_dtype_func
15832 *
15833 * return result # <<<<<<<<<<<<<<
15834 *
15835 * @cname('__pyx_memoryview_get_slice_from_memoryview')
15836*/
15837 {
15838 PyObject *__pyx_temp;
15839 {
15840 __pyx_temp = __pyx_r;
15841 __Pyx_INCREF((PyObject *)__pyx_v_result);
15842 __pyx_r = ((PyObject *)__pyx_v_result);
15843 }
15844 __Pyx_XDECREF(__pyx_temp);
15845 }
15846 goto __pyx_L0;
15847
15848 /* "View.MemoryView":995
15849 * pass # ignore failure, it's a minor issue
15850 *
15851 * @cname('__pyx_memoryview_fromslice') # <<<<<<<<<<<<<<
15852 * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,
15853 * int ndim,
15854*/
15855
15856 /* function exit code */
15857 __pyx_L1_error:;
15858 __Pyx_XDECREF(__pyx_t_2);
15859 __Pyx_XDECREF(__pyx_t_3);
15860 __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15861 __pyx_r = 0;
15862 __pyx_L0:;
15863 __Pyx_XDECREF((PyObject *)__pyx_v_result);
15864
15865
15866 __Pyx_XGIVEREF(__pyx_r);
15867 __Pyx_RefNannyFinishContext();
15868 return __pyx_r;
15869}
15870
15871/* "View.MemoryView":1049
15872 * return result
15873 *
15874 * @cname('__pyx_memoryview_get_slice_from_memoryview') # <<<<<<<<<<<<<<
15875 * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,
15876 * __Pyx_memviewslice *mslice) except NULL:
15877*/
15878
15879static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
15880 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
15881 __Pyx_memviewslice *__pyx_r;
15882 __Pyx_RefNannyDeclarations
15883 int __pyx_t_1;
15884 PyObject *__pyx_t_2 = NULL;
15885 int __pyx_lineno = 0;
15886 const char *__pyx_filename = NULL;
15887 int __pyx_clineno = 0;
15888 __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
15889
15890 /* "View.MemoryView":1053
15891 * __Pyx_memviewslice *mslice) except NULL:
15892 * cdef _memoryviewslice obj
15893 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15894 * obj = memview
15895 * return &obj.from_slice
15896*/
15897 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
15898 if (__pyx_t_1) {
15899
15900
15901 /* "View.MemoryView":1054
15902 * cdef _memoryviewslice obj
15903 * if isinstance(memview, _memoryviewslice):
15904 * obj = memview # <<<<<<<<<<<<<<
15905 * return &obj.from_slice
15906 * else:
15907*/
15908 __pyx_t_2 = ((PyObject *)__pyx_v_memview);
15909 __Pyx_INCREF(__pyx_t_2);
15910 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryviewslice_type))))) __PYX_ERR(1, 1054, __pyx_L1_error)
15911 __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
15912 __pyx_t_2 = 0;
15913
15914 /* "View.MemoryView":1055
15915 * if isinstance(memview, _memoryviewslice):
15916 * obj = memview
15917 * return &obj.from_slice # <<<<<<<<<<<<<<
15918 * else:
15919 * slice_copy(memview, mslice)
15920*/
15921 {
15922
15923 __pyx_r = (&__pyx_v_obj->from_slice);
15924 }
15925 goto __pyx_L0;
15926
15927 /* "View.MemoryView":1053
15928 * __Pyx_memviewslice *mslice) except NULL:
15929 * cdef _memoryviewslice obj
15930 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15931 * obj = memview
15932 * return &obj.from_slice
15933*/
15934 }
15935
15936 /* "View.MemoryView":1057
15937 * return &obj.from_slice
15938 * else:
15939 * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
15940 * return mslice
15941 *
15942*/
15943 /*else*/ {
15944 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
15945
15946 /* "View.MemoryView":1058
15947 * else:
15948 * slice_copy(memview, mslice)
15949 * return mslice # <<<<<<<<<<<<<<
15950 *
15951 * @cname('__pyx_memoryview_slice_copy')
15952*/
15953 {
15954
15955 __pyx_r = __pyx_v_mslice;
15956 }
15957 goto __pyx_L0;
15958 }
15959
15960 /* "View.MemoryView":1049
15961 * return result
15962 *
15963 * @cname('__pyx_memoryview_get_slice_from_memoryview') # <<<<<<<<<<<<<<
15964 * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,
15965 * __Pyx_memviewslice *mslice) except NULL:
15966*/
15967
15968 /* function exit code */
15969 __pyx_L1_error:;
15970 __Pyx_XDECREF(__pyx_t_2);
15971 __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
15972 __pyx_r = NULL;
15973 __pyx_L0:;
15974 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
15975
15976 __Pyx_RefNannyFinishContext();
15977 return __pyx_r;
15978}
15979
15980/* "View.MemoryView":1060
15981 * return mslice
15982 *
15983 * @cname('__pyx_memoryview_slice_copy') # <<<<<<<<<<<<<<
15984 * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept:
15985 * cdef int dim
15986*/
15987
15988static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
15989 int __pyx_v_dim;
15990 Py_ssize_t *__pyx_v_shape;
15991 Py_ssize_t *__pyx_v_strides;
15992 Py_ssize_t *__pyx_v_suboffsets;
15993 Py_ssize_t *__pyx_t_1;
15994 int __pyx_t_2;
15995 int __pyx_t_3;
15996 int __pyx_t_4;
15997 Py_ssize_t __pyx_t_5;
15998 int __pyx_t_6;
15999
16000 /* "View.MemoryView":1065
16001 * cdef (Py_ssize_t*) shape, strides, suboffsets
16002 *
16003 * shape = memview.view.shape # <<<<<<<<<<<<<<
16004 * strides = memview.view.strides
16005 * suboffsets = memview.view.suboffsets
16006*/
16007 __pyx_t_1 = __pyx_v_memview->view.shape;
16008
16009 __pyx_v_shape = __pyx_t_1;
16010
16011 /* "View.MemoryView":1066
16012 *
16013 * shape = memview.view.shape
16014 * strides = memview.view.strides # <<<<<<<<<<<<<<
16015 * suboffsets = memview.view.suboffsets
16016 *
16017*/
16018 __pyx_t_1 = __pyx_v_memview->view.strides;
16019
16020 __pyx_v_strides = __pyx_t_1;
16021
16022 /* "View.MemoryView":1067
16023 * shape = memview.view.shape
16024 * strides = memview.view.strides
16025 * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
16026 *
16027 * dst.memview = <__pyx_memoryview *> memview
16028*/
16029 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
16030
16031 __pyx_v_suboffsets = __pyx_t_1;
16032
16033 /* "View.MemoryView":1069
16034 * suboffsets = memview.view.suboffsets
16035 *
16036 * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
16037 * dst.data = <char *> memview.view.buf
16038 *
16039*/
16040 __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
16041
16042 /* "View.MemoryView":1070
16043 *
16044 * dst.memview = <__pyx_memoryview *> memview
16045 * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
16046 *
16047 * for dim in range(memview.view.ndim):
16048*/
16049 __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
16050
16051 /* "View.MemoryView":1072
16052 * dst.data = <char *> memview.view.buf
16053 *
16054 * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
16055 * dst.shape[dim] = shape[dim]
16056 * dst.strides[dim] = strides[dim]
16057*/
16058
16059 __pyx_t_2 = __pyx_v_memview->view.ndim;
16060 __pyx_t_3 = __pyx_t_2;
16061
16062 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16063 __pyx_v_dim = __pyx_t_4;
16064
16065 /* "View.MemoryView":1073
16066 *
16067 * for dim in range(memview.view.ndim):
16068 * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
16069 * dst.strides[dim] = strides[dim]
16070 * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
16071*/
16072 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
16073
16074 /* "View.MemoryView":1074
16075 * for dim in range(memview.view.ndim):
16076 * dst.shape[dim] = shape[dim]
16077 * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
16078 * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
16079 *
16080*/
16081 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
16082
16083 /* "View.MemoryView":1075
16084 * dst.shape[dim] = shape[dim]
16085 * dst.strides[dim] = strides[dim]
16086 * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
16087 *
16088 * @cname('__pyx_memoryview_copy_object')
16089*/
16090 __pyx_t_6 = (__pyx_v_suboffsets != 0);
16091
16092 if (__pyx_t_6) {
16093
16094 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
16095 } else {
16096
16097 __pyx_t_5 = -1L;
16098 }
16099
16100 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
16101
16102 }
16103
16104
16105 /* "View.MemoryView":1060
16106 * return mslice
16107 *
16108 * @cname('__pyx_memoryview_slice_copy') # <<<<<<<<<<<<<<
16109 * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept:
16110 * cdef int dim
16111*/
16112
16113 /* function exit code */
16114
16115
16116
16117
16118
16119}
16120
16121/* "View.MemoryView":1077
16122 * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
16123 *
16124 * @cname('__pyx_memoryview_copy_object') # <<<<<<<<<<<<<<
16125 * cdef memoryview_copy(memoryview memview):
16126 * "Create a new memoryview object"
16127*/
16128
16129static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
16130 __Pyx_memviewslice __pyx_v_memviewslice;
16131 PyObject *__pyx_r = NULL;
16132 __Pyx_RefNannyDeclarations
16133 PyObject *__pyx_t_1 = NULL;
16134 int __pyx_lineno = 0;
16135 const char *__pyx_filename = NULL;
16136 int __pyx_clineno = 0;
16137 __Pyx_RefNannySetupContext("memoryview_copy", 0);
16138
16139 /* "View.MemoryView":1081
16140 * "Create a new memoryview object"
16141 * cdef __Pyx_memviewslice memviewslice
16142 * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
16143 * return memoryview_copy_from_slice(memview, &memviewslice)
16144 *
16145*/
16146 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
16147
16148 /* "View.MemoryView":1082
16149 * cdef __Pyx_memviewslice memviewslice
16150 * slice_copy(memview, &memviewslice)
16151 * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
16152 *
16153 * @cname('__pyx_memoryview_copy_object_from_slice')
16154*/
16155 __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1082, __pyx_L1_error)
16156 __Pyx_GOTREF(__pyx_t_1);
16157 {
16158 PyObject *__pyx_temp;
16159 {
16160 __pyx_temp = __pyx_r;
16161 __pyx_r = __pyx_t_1;
16162 }
16163 __Pyx_XDECREF(__pyx_temp);
16164 }
16165 __pyx_t_1 = 0;
16166 goto __pyx_L0;
16167
16168 /* "View.MemoryView":1077
16169 * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
16170 *
16171 * @cname('__pyx_memoryview_copy_object') # <<<<<<<<<<<<<<
16172 * cdef memoryview_copy(memoryview memview):
16173 * "Create a new memoryview object"
16174*/
16175
16176 /* function exit code */
16177 __pyx_L1_error:;
16178 __Pyx_XDECREF(__pyx_t_1);
16179 __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
16180 __pyx_r = 0;
16181 __pyx_L0:;
16182
16183 __Pyx_XGIVEREF(__pyx_r);
16184 __Pyx_RefNannyFinishContext();
16185 return __pyx_r;
16186}
16187
16188/* "View.MemoryView":1084
16189 * return memoryview_copy_from_slice(memview, &memviewslice)
16190 *
16191 * @cname('__pyx_memoryview_copy_object_from_slice') # <<<<<<<<<<<<<<
16192 * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):
16193 * """
16194*/
16195
16196static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
16197 PyObject *(*__pyx_v_to_object_func)(char *);
16198 __pyx_memoryview_to_dtype_func_type __pyx_v_to_dtype_func;
16199 PyObject *__pyx_r = NULL;
16200 __Pyx_RefNannyDeclarations
16201 int __pyx_t_1;
16202 PyObject *(*__pyx_t_2)(char *);
16203 __pyx_memoryview_to_dtype_func_type __pyx_t_3;
16204 PyObject *__pyx_t_4 = NULL;
16205 int __pyx_lineno = 0;
16206 const char *__pyx_filename = NULL;
16207 int __pyx_clineno = 0;
16208 __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
16209
16210 /* "View.MemoryView":1092
16211 * cdef to_dtype_func_type to_dtype_func
16212 *
16213 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16214 * to_object_func = (<_memoryviewslice> memview).to_object_func
16215 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
16216*/
16217 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
16218 if (__pyx_t_1) {
16219
16220
16221 /* "View.MemoryView":1093
16222 *
16223 * if isinstance(memview, _memoryviewslice):
16224 * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
16225 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
16226 * else:
16227*/
16228 __pyx_t_2 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
16229
16230 __pyx_v_to_object_func = __pyx_t_2;
16231
16232 /* "View.MemoryView":1094
16233 * if isinstance(memview, _memoryviewslice):
16234 * to_object_func = (<_memoryviewslice> memview).to_object_func
16235 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
16236 * else:
16237 * to_object_func = NULL
16238*/
16239 __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
16240
16241 __pyx_v_to_dtype_func = __pyx_t_3;
16242
16243 /* "View.MemoryView":1092
16244 * cdef to_dtype_func_type to_dtype_func
16245 *
16246 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16247 * to_object_func = (<_memoryviewslice> memview).to_object_func
16248 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
16249*/
16250 goto __pyx_L3;
16251 }
16252
16253 /* "View.MemoryView":1096
16254 * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
16255 * else:
16256 * to_object_func = NULL # <<<<<<<<<<<<<<
16257 * to_dtype_func = NULL
16258 *
16259*/
16260 /*else*/ {
16261 __pyx_v_to_object_func = NULL;
16262
16263 /* "View.MemoryView":1097
16264 * else:
16265 * to_object_func = NULL
16266 * to_dtype_func = NULL # <<<<<<<<<<<<<<
16267 *
16268 * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
16269*/
16270 __pyx_v_to_dtype_func = NULL;
16271 }
16272 __pyx_L3:;
16273
16274 /* "View.MemoryView":1099
16275 * to_dtype_func = NULL
16276 *
16277 * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
16278 * to_object_func, to_dtype_func,
16279 * memview.dtype_is_object)
16280*/
16281 __pyx_t_4 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1099, __pyx_L1_error)
16282 __Pyx_GOTREF(__pyx_t_4);
16283 {
16284 PyObject *__pyx_temp;
16285 {
16286 __pyx_temp = __pyx_r;
16287 __pyx_r = __pyx_t_4;
16288 }
16289 __Pyx_XDECREF(__pyx_temp);
16290 }
16291 __pyx_t_4 = 0;
16292 goto __pyx_L0;
16293
16294 /* "View.MemoryView":1084
16295 * return memoryview_copy_from_slice(memview, &memviewslice)
16296 *
16297 * @cname('__pyx_memoryview_copy_object_from_slice') # <<<<<<<<<<<<<<
16298 * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):
16299 * """
16300*/
16301
16302 /* function exit code */
16303 __pyx_L1_error:;
16304 __Pyx_XDECREF(__pyx_t_4);
16305 __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16306 __pyx_r = 0;
16307 __pyx_L0:;
16308
16309
16310 __Pyx_XGIVEREF(__pyx_r);
16311 __Pyx_RefNannyFinishContext();
16312 return __pyx_r;
16313}
16314
16315/* "View.MemoryView":1107
16316 *
16317 *
16318 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<<
16319 * return -arg if arg < 0 else arg
16320 *
16321*/
16322
16323static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
16324 Py_ssize_t __pyx_r;
16325 Py_ssize_t __pyx_t_1;
16326 int __pyx_t_2;
16327
16328 /* "View.MemoryView":1108
16329 *
16330 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil:
16331 * return -arg if arg < 0 else arg # <<<<<<<<<<<<<<
16332 *
16333 * @cname('__pyx_get_best_slice_order')
16334*/
16335 __pyx_t_2 = (__pyx_v_arg < 0);
16336
16337 if (__pyx_t_2) {
16338
16339 __pyx_t_1 = (-__pyx_v_arg);
16340 } else {
16341
16342 __pyx_t_1 = __pyx_v_arg;
16343 }
16344
16345 {
16346 __pyx_r = __pyx_t_1;
16347 }
16348 goto __pyx_L0;
16349
16350 /* "View.MemoryView":1107
16351 *
16352 *
16353 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<<
16354 * return -arg if arg < 0 else arg
16355 *
16356*/
16357
16358 /* function exit code */
16359 __pyx_L0:;
16360 return __pyx_r;
16361}
16362
16363/* "View.MemoryView":1110
16364 * return -arg if arg < 0 else arg
16365 *
16366 * @cname('__pyx_get_best_slice_order') # <<<<<<<<<<<<<<
16367 * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil:
16368 * """
16369*/
16370
16371static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
16372 int __pyx_v_i;
16373 Py_ssize_t __pyx_v_c_stride;
16374 Py_ssize_t __pyx_v_f_stride;
16375 char __pyx_r;
16376 int __pyx_t_1;
16377 int __pyx_t_2;
16378 int __pyx_t_3;
16379 int __pyx_t_4;
16380
16381 /* "View.MemoryView":1116
16382 * """
16383 * cdef int i
16384 * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
16385 * cdef Py_ssize_t f_stride = 0
16386 *
16387*/
16388 __pyx_v_c_stride = 0;
16389
16390 /* "View.MemoryView":1117
16391 * cdef int i
16392 * cdef Py_ssize_t c_stride = 0
16393 * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
16394 *
16395 * for i in range(ndim - 1, -1, -1):
16396*/
16397 __pyx_v_f_stride = 0;
16398
16399 /* "View.MemoryView":1119
16400 * cdef Py_ssize_t f_stride = 0
16401 *
16402 * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
16403 * if mslice.shape[i] > 1:
16404 * c_stride = mslice.strides[i]
16405*/
16406 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
16407 __pyx_v_i = __pyx_t_1;
16408
16409 /* "View.MemoryView":1120
16410 *
16411 * for i in range(ndim - 1, -1, -1):
16412 * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
16413 * c_stride = mslice.strides[i]
16414 * break
16415*/
16416 __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
16417
16418 if (__pyx_t_2) {
16419
16420
16421 /* "View.MemoryView":1121
16422 * for i in range(ndim - 1, -1, -1):
16423 * if mslice.shape[i] > 1:
16424 * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
16425 * break
16426 *
16427*/
16428 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
16429
16430 /* "View.MemoryView":1122
16431 * if mslice.shape[i] > 1:
16432 * c_stride = mslice.strides[i]
16433 * break # <<<<<<<<<<<<<<
16434 *
16435 * for i in range(ndim):
16436*/
16437 goto __pyx_L4_break;
16438
16439 /* "View.MemoryView":1120
16440 *
16441 * for i in range(ndim - 1, -1, -1):
16442 * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
16443 * c_stride = mslice.strides[i]
16444 * break
16445*/
16446 }
16447 }
16448 __pyx_L4_break:;
16449
16450 /* "View.MemoryView":1124
16451 * break
16452 *
16453 * for i in range(ndim): # <<<<<<<<<<<<<<
16454 * if mslice.shape[i] > 1:
16455 * f_stride = mslice.strides[i]
16456*/
16457
16458 __pyx_t_1 = __pyx_v_ndim;
16459 __pyx_t_3 = __pyx_t_1;
16460
16461 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16462 __pyx_v_i = __pyx_t_4;
16463
16464 /* "View.MemoryView":1125
16465 *
16466 * for i in range(ndim):
16467 * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
16468 * f_stride = mslice.strides[i]
16469 * break
16470*/
16471 __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
16472
16473 if (__pyx_t_2) {
16474
16475
16476 /* "View.MemoryView":1126
16477 * for i in range(ndim):
16478 * if mslice.shape[i] > 1:
16479 * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
16480 * break
16481 *
16482*/
16483 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
16484
16485 /* "View.MemoryView":1127
16486 * if mslice.shape[i] > 1:
16487 * f_stride = mslice.strides[i]
16488 * break # <<<<<<<<<<<<<<
16489 *
16490 * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
16491*/
16492 goto __pyx_L7_break;
16493
16494 /* "View.MemoryView":1125
16495 *
16496 * for i in range(ndim):
16497 * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
16498 * f_stride = mslice.strides[i]
16499 * break
16500*/
16501 }
16502 }
16503 __pyx_L7_break:;
16504
16505
16506 /* "View.MemoryView":1129
16507 * break
16508 *
16509 * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
16510 * return 'C'
16511 * else:
16512*/
16513 __pyx_t_2 = (abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride));
16514
16515 if (__pyx_t_2) {
16516
16517
16518 /* "View.MemoryView":1130
16519 *
16520 * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
16521 * return 'C' # <<<<<<<<<<<<<<
16522 * else:
16523 * return 'F'
16524*/
16525 {
16526
16527 __pyx_r = 'C';
16528 }
16529 goto __pyx_L0;
16530
16531 /* "View.MemoryView":1129
16532 * break
16533 *
16534 * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
16535 * return 'C'
16536 * else:
16537*/
16538 }
16539
16540 /* "View.MemoryView":1132
16541 * return 'C'
16542 * else:
16543 * return 'F' # <<<<<<<<<<<<<<
16544 *
16545 * @cython.cdivision(True)
16546*/
16547 /*else*/ {
16548 {
16549
16550 __pyx_r = 'F';
16551 }
16552 goto __pyx_L0;
16553 }
16554
16555 /* "View.MemoryView":1110
16556 * return -arg if arg < 0 else arg
16557 *
16558 * @cname('__pyx_get_best_slice_order') # <<<<<<<<<<<<<<
16559 * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil:
16560 * """
16561*/
16562
16563 /* function exit code */
16564 __pyx_L0:;
16565
16566
16567
16568 return __pyx_r;
16569}
16570
16571/* "View.MemoryView":1134
16572 * return 'F'
16573 *
16574 * @cython.cdivision(True) # <<<<<<<<<<<<<<
16575 * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,
16576 * char *dst_data, Py_ssize_t *dst_strides,
16577*/
16578
16579static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
16580 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
16581 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
16582 Py_ssize_t __pyx_v_dst_extent;
16583 Py_ssize_t __pyx_v_src_stride;
16584 Py_ssize_t __pyx_v_dst_stride;
16585 int __pyx_t_1;
16586 int __pyx_t_2;
16587 Py_ssize_t __pyx_t_3;
16588 Py_ssize_t __pyx_t_4;
16589 Py_ssize_t __pyx_t_5;
16590
16591
16592
16593 /* "View.MemoryView":1142
16594 *
16595 * cdef Py_ssize_t i
16596 * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
16597 * cdef Py_ssize_t dst_extent = dst_shape[0]
16598 * cdef Py_ssize_t src_stride = src_strides[0]
16599*/
16600 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
16601
16602 /* "View.MemoryView":1143
16603 * cdef Py_ssize_t i
16604 * cdef Py_ssize_t src_extent = src_shape[0]
16605 * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
16606 * cdef Py_ssize_t src_stride = src_strides[0]
16607 * cdef Py_ssize_t dst_stride = dst_strides[0]
16608*/
16609 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
16610
16611 /* "View.MemoryView":1144
16612 * cdef Py_ssize_t src_extent = src_shape[0]
16613 * cdef Py_ssize_t dst_extent = dst_shape[0]
16614 * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
16615 * cdef Py_ssize_t dst_stride = dst_strides[0]
16616 *
16617*/
16618 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
16619
16620 /* "View.MemoryView":1145
16621 * cdef Py_ssize_t dst_extent = dst_shape[0]
16622 * cdef Py_ssize_t src_stride = src_strides[0]
16623 * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
16624 *
16625 * if ndim == 1:
16626*/
16627 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
16628
16629 /* "View.MemoryView":1147
16630 * cdef Py_ssize_t dst_stride = dst_strides[0]
16631 *
16632 * if ndim == 1: # <<<<<<<<<<<<<<
16633 * if (src_stride > 0 and dst_stride > 0 and
16634 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16635*/
16636 __pyx_t_1 = (__pyx_v_ndim == 1);
16637
16638 if (__pyx_t_1) {
16639
16640
16641 /* "View.MemoryView":1148
16642 *
16643 * if ndim == 1:
16644 * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16645 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16646 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent)
16647*/
16648 __pyx_t_2 = (__pyx_v_src_stride > 0);
16649
16650 if (__pyx_t_2) {
16651
16652 } else {
16653
16654 __pyx_t_1 = __pyx_t_2;
16655
16656 goto __pyx_L5_bool_binop_done;
16657 }
16658 __pyx_t_2 = (__pyx_v_dst_stride > 0);
16659
16660 if (__pyx_t_2) {
16661
16662 } else {
16663
16664 __pyx_t_1 = __pyx_t_2;
16665
16666 goto __pyx_L5_bool_binop_done;
16667 }
16668
16669 /* "View.MemoryView":1149
16670 * if ndim == 1:
16671 * if (src_stride > 0 and dst_stride > 0 and
16672 * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
16673 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent)
16674 * else:
16675*/
16676 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
16677 if (__pyx_t_2) {
16678 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
16679 }
16680
16681 __pyx_t_1 = __pyx_t_2;
16682
16683 __pyx_L5_bool_binop_done:;
16684
16685 /* "View.MemoryView":1148
16686 *
16687 * if ndim == 1:
16688 * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16689 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16690 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent)
16691*/
16692 if (__pyx_t_1) {
16693
16694
16695 /* "View.MemoryView":1150
16696 * if (src_stride > 0 and dst_stride > 0 and
16697 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16698 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent) # <<<<<<<<<<<<<<
16699 * else:
16700 * for i in range(dst_extent):
16701*/
16702 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * ((size_t)__pyx_v_dst_extent))));
16703
16704 /* "View.MemoryView":1148
16705 *
16706 * if ndim == 1:
16707 * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16708 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16709 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent)
16710*/
16711 goto __pyx_L4;
16712 }
16713
16714 /* "View.MemoryView":1152
16715 * memcpy(dst_data, src_data, itemsize * <size_t> dst_extent)
16716 * else:
16717 * for i in range(dst_extent): # <<<<<<<<<<<<<<
16718 * memcpy(dst_data, src_data, itemsize)
16719 * src_data += src_stride
16720*/
16721 /*else*/ {
16722
16723 __pyx_t_3 = __pyx_v_dst_extent;
16724 __pyx_t_4 = __pyx_t_3;
16725
16726 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16727 __pyx_v_i = __pyx_t_5;
16728
16729 /* "View.MemoryView":1153
16730 * else:
16731 * for i in range(dst_extent):
16732 * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
16733 * src_data += src_stride
16734 * dst_data += dst_stride
16735*/
16736 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
16737
16738 /* "View.MemoryView":1154
16739 * for i in range(dst_extent):
16740 * memcpy(dst_data, src_data, itemsize)
16741 * src_data += src_stride # <<<<<<<<<<<<<<
16742 * dst_data += dst_stride
16743 * else:
16744*/
16745 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16746
16747 /* "View.MemoryView":1155
16748 * memcpy(dst_data, src_data, itemsize)
16749 * src_data += src_stride
16750 * dst_data += dst_stride # <<<<<<<<<<<<<<
16751 * else:
16752 * for i in range(dst_extent):
16753*/
16754 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16755 }
16756
16757 }
16758 __pyx_L4:;
16759
16760 /* "View.MemoryView":1147
16761 * cdef Py_ssize_t dst_stride = dst_strides[0]
16762 *
16763 * if ndim == 1: # <<<<<<<<<<<<<<
16764 * if (src_stride > 0 and dst_stride > 0 and
16765 * <size_t> src_stride == itemsize == <size_t> dst_stride):
16766*/
16767 goto __pyx_L3;
16768 }
16769
16770 /* "View.MemoryView":1157
16771 * dst_data += dst_stride
16772 * else:
16773 * for i in range(dst_extent): # <<<<<<<<<<<<<<
16774 * _copy_strided_to_strided(src_data, src_strides + 1,
16775 * dst_data, dst_strides + 1,
16776*/
16777 /*else*/ {
16778
16779 __pyx_t_3 = __pyx_v_dst_extent;
16780 __pyx_t_4 = __pyx_t_3;
16781
16782 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16783 __pyx_v_i = __pyx_t_5;
16784
16785 /* "View.MemoryView":1158
16786 * else:
16787 * for i in range(dst_extent):
16788 * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
16789 * dst_data, dst_strides + 1,
16790 * src_shape + 1, dst_shape + 1,
16791*/
16792 _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
16793
16794 /* "View.MemoryView":1162
16795 * src_shape + 1, dst_shape + 1,
16796 * ndim - 1, itemsize)
16797 * src_data += src_stride # <<<<<<<<<<<<<<
16798 * dst_data += dst_stride
16799 *
16800*/
16801 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16802
16803 /* "View.MemoryView":1163
16804 * ndim - 1, itemsize)
16805 * src_data += src_stride
16806 * dst_data += dst_stride # <<<<<<<<<<<<<<
16807 *
16808 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
16809*/
16810 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16811 }
16812
16813 }
16814 __pyx_L3:;
16815
16816 /* "View.MemoryView":1134
16817 * return 'F'
16818 *
16819 * @cython.cdivision(True) # <<<<<<<<<<<<<<
16820 * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,
16821 * char *dst_data, Py_ssize_t *dst_strides,
16822*/
16823
16824 /* function exit code */
16825
16826
16827
16828
16829
16830
16831
16832}
16833
16834/* "View.MemoryView":1165
16835 * dst_data += dst_stride
16836 *
16837 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16838 * __Pyx_memviewslice *dst,
16839 * int ndim, size_t itemsize) noexcept nogil:
16840*/
16841
16842static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
16843
16844 /* "View.MemoryView":1168
16845 * __Pyx_memviewslice *dst,
16846 * int ndim, size_t itemsize) noexcept nogil:
16847 * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
16848 * src.shape, dst.shape, ndim, itemsize)
16849 *
16850*/
16851 _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
16852
16853 /* "View.MemoryView":1165
16854 * dst_data += dst_stride
16855 *
16856 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16857 * __Pyx_memviewslice *dst,
16858 * int ndim, size_t itemsize) noexcept nogil:
16859*/
16860
16861 /* function exit code */
16862}
16863
16864/* "View.MemoryView":1171
16865 * src.shape, dst.shape, ndim, itemsize)
16866 *
16867 * @cname('__pyx_memoryview_slice_get_size') # <<<<<<<<<<<<<<
16868 * cdef size_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:
16869 * "Return the size of the memory occupied by the slice in number of bytes"
16870*/
16871
16872static size_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
16873 Py_ssize_t __pyx_v_shape;
16874 size_t __pyx_v_size;
16875 size_t __pyx_r;
16876 Py_ssize_t *__pyx_t_1;
16877 Py_ssize_t *__pyx_t_2;
16878 Py_ssize_t *__pyx_t_3;
16879
16880 /* "View.MemoryView":1175
16881 * "Return the size of the memory occupied by the slice in number of bytes"
16882 * cdef Py_ssize_t shape
16883 * cdef size_t size = <size_t> src.memview.view.itemsize # <<<<<<<<<<<<<<
16884 *
16885 * for shape in src.shape[:ndim]:
16886*/
16887 __pyx_v_size = ((size_t)__pyx_v_src->memview->view.itemsize);
16888
16889 /* "View.MemoryView":1177
16890 * cdef size_t size = <size_t> src.memview.view.itemsize
16891 *
16892 * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
16893 * size *= <size_t> shape
16894 *
16895*/
16896 __pyx_t_2 = (__pyx_v_src->shape + __pyx_v_ndim);
16897
16898 for (__pyx_t_3 = __pyx_v_src->shape; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
16899 __pyx_t_1 = __pyx_t_3;
16900 __pyx_v_shape = (__pyx_t_1[0]);
16901
16902 /* "View.MemoryView":1178
16903 *
16904 * for shape in src.shape[:ndim]:
16905 * size *= <size_t> shape # <<<<<<<<<<<<<<
16906 *
16907 * return size
16908*/
16909 __pyx_v_size = (__pyx_v_size * ((size_t)__pyx_v_shape));
16910 }
16911
16912
16913 /* "View.MemoryView":1180
16914 * size *= <size_t> shape
16915 *
16916 * return size # <<<<<<<<<<<<<<
16917 *
16918 * @cname('__pyx_fill_contig_strides_array')
16919*/
16920 {
16921
16922 __pyx_r = __pyx_v_size;
16923 }
16924 goto __pyx_L0;
16925
16926 /* "View.MemoryView":1171
16927 * src.shape, dst.shape, ndim, itemsize)
16928 *
16929 * @cname('__pyx_memoryview_slice_get_size') # <<<<<<<<<<<<<<
16930 * cdef size_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:
16931 * "Return the size of the memory occupied by the slice in number of bytes"
16932*/
16933
16934 /* function exit code */
16935 __pyx_L0:;
16936
16937
16938 return __pyx_r;
16939}
16940
16941/* "View.MemoryView":1182
16942 * return size
16943 *
16944 * @cname('__pyx_fill_contig_strides_array') # <<<<<<<<<<<<<<
16945 * cdef Py_ssize_t fill_contig_strides_array(
16946 * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
16947*/
16948
16949static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
16950 int __pyx_v_idx;
16951 Py_ssize_t __pyx_r;
16952 int __pyx_t_1;
16953 int __pyx_t_2;
16954 int __pyx_t_3;
16955 int __pyx_t_4;
16956
16957
16958 /* "View.MemoryView":1192
16959 * cdef int idx
16960 *
16961 * if order == 'F': # <<<<<<<<<<<<<<
16962 * for idx in range(ndim):
16963 * strides[idx] = stride
16964*/
16965 __pyx_t_1 = (__pyx_v_order == 'F');
16966
16967 if (__pyx_t_1) {
16968
16969
16970 /* "View.MemoryView":1193
16971 *
16972 * if order == 'F':
16973 * for idx in range(ndim): # <<<<<<<<<<<<<<
16974 * strides[idx] = stride
16975 * stride *= shape[idx]
16976*/
16977
16978 __pyx_t_2 = __pyx_v_ndim;
16979 __pyx_t_3 = __pyx_t_2;
16980
16981 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16982 __pyx_v_idx = __pyx_t_4;
16983
16984 /* "View.MemoryView":1194
16985 * if order == 'F':
16986 * for idx in range(ndim):
16987 * strides[idx] = stride # <<<<<<<<<<<<<<
16988 * stride *= shape[idx]
16989 * else:
16990*/
16991 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16992
16993 /* "View.MemoryView":1195
16994 * for idx in range(ndim):
16995 * strides[idx] = stride
16996 * stride *= shape[idx] # <<<<<<<<<<<<<<
16997 * else:
16998 * for idx in range(ndim - 1, -1, -1):
16999*/
17000 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
17001 }
17002
17003
17004 /* "View.MemoryView":1192
17005 * cdef int idx
17006 *
17007 * if order == 'F': # <<<<<<<<<<<<<<
17008 * for idx in range(ndim):
17009 * strides[idx] = stride
17010*/
17011 goto __pyx_L3;
17012 }
17013
17014 /* "View.MemoryView":1197
17015 * stride *= shape[idx]
17016 * else:
17017 * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
17018 * strides[idx] = stride
17019 * stride *= shape[idx]
17020*/
17021 /*else*/ {
17022 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
17023 __pyx_v_idx = __pyx_t_2;
17024
17025 /* "View.MemoryView":1198
17026 * else:
17027 * for idx in range(ndim - 1, -1, -1):
17028 * strides[idx] = stride # <<<<<<<<<<<<<<
17029 * stride *= shape[idx]
17030 *
17031*/
17032 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
17033
17034 /* "View.MemoryView":1199
17035 * for idx in range(ndim - 1, -1, -1):
17036 * strides[idx] = stride
17037 * stride *= shape[idx] # <<<<<<<<<<<<<<
17038 *
17039 * return stride
17040*/
17041 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
17042 }
17043 }
17044 __pyx_L3:;
17045
17046 /* "View.MemoryView":1201
17047 * stride *= shape[idx]
17048 *
17049 * return stride # <<<<<<<<<<<<<<
17050 *
17051 * @cname('__pyx_memoryview_copy_data_to_temp')
17052*/
17053 {
17054
17055 __pyx_r = __pyx_v_stride;
17056 }
17057 goto __pyx_L0;
17058
17059 /* "View.MemoryView":1182
17060 * return size
17061 *
17062 * @cname('__pyx_fill_contig_strides_array') # <<<<<<<<<<<<<<
17063 * cdef Py_ssize_t fill_contig_strides_array(
17064 * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
17065*/
17066
17067 /* function exit code */
17068 __pyx_L0:;
17069
17070
17071 return __pyx_r;
17072}
17073
17074/* "View.MemoryView":1203
17075 * return stride
17076 *
17077 * @cname('__pyx_memoryview_copy_data_to_temp') # <<<<<<<<<<<<<<
17078 * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,
17079 * __Pyx_memviewslice *tmpslice,
17080*/
17081
17082static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
17083 int __pyx_v_i;
17084 void *__pyx_v_result;
17085 size_t __pyx_v_itemsize;
17086 size_t __pyx_v_size;
17087 void *__pyx_r;
17088 int __pyx_t_1;
17089 int __pyx_t_2;
17090 struct __pyx_memoryview_obj *__pyx_t_3;
17091 int __pyx_t_4;
17092 int __pyx_t_5;
17093 int __pyx_lineno = 0;
17094 const char *__pyx_filename = NULL;
17095 int __pyx_clineno = 0;
17096 PyGILState_STATE __pyx_gilstate_save;
17097
17098 /* "View.MemoryView":1215
17099 * cdef void *result
17100 *
17101 * cdef size_t itemsize = <size_t> src.memview.view.itemsize # <<<<<<<<<<<<<<
17102 * cdef size_t size = slice_get_size(src, ndim)
17103 *
17104*/
17105 __pyx_v_itemsize = ((size_t)__pyx_v_src->memview->view.itemsize);
17106
17107 /* "View.MemoryView":1216
17108 *
17109 * cdef size_t itemsize = <size_t> src.memview.view.itemsize
17110 * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
17111 *
17112 * result = malloc(size)
17113*/
17114 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
17115
17116 /* "View.MemoryView":1218
17117 * cdef size_t size = slice_get_size(src, ndim)
17118 *
17119 * result = malloc(size) # <<<<<<<<<<<<<<
17120 * if cython.unlikely(not result):
17121 * _err_no_memory()
17122*/
17123 __pyx_v_result = malloc(__pyx_v_size);
17124
17125 /* "View.MemoryView":1219
17126 *
17127 * result = malloc(size)
17128 * if cython.unlikely(not result): # <<<<<<<<<<<<<<
17129 * _err_no_memory()
17130 *
17131*/
17132 __pyx_t_1 = (!(__pyx_v_result != 0));
17133
17134 if (unlikely(__pyx_t_1)) {
17135
17136
17137 /* "View.MemoryView":1220
17138 * result = malloc(size)
17139 * if cython.unlikely(not result):
17140 * _err_no_memory() # <<<<<<<<<<<<<<
17141 *
17142 *
17143*/
17144 __pyx_t_2 = __pyx_memoryview_err_no_memory(); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 1220, __pyx_L1_error)
17145
17146
17147 /* "View.MemoryView":1219
17148 *
17149 * result = malloc(size)
17150 * if cython.unlikely(not result): # <<<<<<<<<<<<<<
17151 * _err_no_memory()
17152 *
17153*/
17154 }
17155
17156 /* "View.MemoryView":1223
17157 *
17158 *
17159 * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
17160 * tmpslice.memview = src.memview
17161 * for i in range(ndim):
17162*/
17163 __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
17164
17165 /* "View.MemoryView":1224
17166 *
17167 * tmpslice.data = <char *> result
17168 * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
17169 * for i in range(ndim):
17170 * tmpslice.shape[i] = src.shape[i]
17171*/
17172 __pyx_t_3 = __pyx_v_src->memview;
17173
17174 __pyx_v_tmpslice->memview = __pyx_t_3;
17175
17176 /* "View.MemoryView":1225
17177 * tmpslice.data = <char *> result
17178 * tmpslice.memview = src.memview
17179 * for i in range(ndim): # <<<<<<<<<<<<<<
17180 * tmpslice.shape[i] = src.shape[i]
17181 * tmpslice.suboffsets[i] = -1
17182*/
17183
17184 __pyx_t_2 = __pyx_v_ndim;
17185 __pyx_t_4 = __pyx_t_2;
17186
17187 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
17188 __pyx_v_i = __pyx_t_5;
17189
17190 /* "View.MemoryView":1226
17191 * tmpslice.memview = src.memview
17192 * for i in range(ndim):
17193 * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
17194 * tmpslice.suboffsets[i] = -1
17195 *
17196*/
17197 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
17198
17199 /* "View.MemoryView":1227
17200 * for i in range(ndim):
17201 * tmpslice.shape[i] = src.shape[i]
17202 * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
17203 *
17204 * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], <Py_ssize_t> itemsize, ndim, order)
17205*/
17206 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
17207 }
17208
17209
17210 /* "View.MemoryView":1229
17211 * tmpslice.suboffsets[i] = -1
17212 *
17213 * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], <Py_ssize_t> itemsize, ndim, order) # <<<<<<<<<<<<<<
17214 *
17215 *
17216*/
17217 (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), ((Py_ssize_t)__pyx_v_itemsize), __pyx_v_ndim, __pyx_v_order));
17218
17219 /* "View.MemoryView":1232
17220 *
17221 *
17222 * for i in range(ndim): # <<<<<<<<<<<<<<
17223 * if tmpslice.shape[i] == 1:
17224 * tmpslice.strides[i] = 0
17225*/
17226
17227 __pyx_t_2 = __pyx_v_ndim;
17228 __pyx_t_4 = __pyx_t_2;
17229
17230 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
17231 __pyx_v_i = __pyx_t_5;
17232
17233 /* "View.MemoryView":1233
17234 *
17235 * for i in range(ndim):
17236 * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
17237 * tmpslice.strides[i] = 0
17238 *
17239*/
17240 __pyx_t_1 = ((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1);
17241
17242 if (__pyx_t_1) {
17243
17244
17245 /* "View.MemoryView":1234
17246 * for i in range(ndim):
17247 * if tmpslice.shape[i] == 1:
17248 * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
17249 *
17250 * if slice_is_contig(src[0], order, ndim):
17251*/
17252 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
17253
17254 /* "View.MemoryView":1233
17255 *
17256 * for i in range(ndim):
17257 * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
17258 * tmpslice.strides[i] = 0
17259 *
17260*/
17261 }
17262 }
17263
17264
17265 /* "View.MemoryView":1236
17266 * tmpslice.strides[i] = 0
17267 *
17268 * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
17269 * memcpy(result, src.data, size)
17270 * else:
17271*/
17272 __pyx_t_1 = __pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim);
17273
17274 if (__pyx_t_1) {
17275
17276
17277 /* "View.MemoryView":1237
17278 *
17279 * if slice_is_contig(src[0], order, ndim):
17280 * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
17281 * else:
17282 * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
17283*/
17284 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
17285
17286 /* "View.MemoryView":1236
17287 * tmpslice.strides[i] = 0
17288 *
17289 * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
17290 * memcpy(result, src.data, size)
17291 * else:
17292*/
17293 goto __pyx_L9;
17294 }
17295
17296 /* "View.MemoryView":1239
17297 * memcpy(result, src.data, size)
17298 * else:
17299 * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
17300 *
17301 * return result
17302*/
17303 /*else*/ {
17304 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
17305 }
17306 __pyx_L9:;
17307
17308 /* "View.MemoryView":1241
17309 * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
17310 *
17311 * return result # <<<<<<<<<<<<<<
17312 *
17313 *
17314*/
17315 {
17316
17317 __pyx_r = __pyx_v_result;
17318 }
17319 goto __pyx_L0;
17320
17321 /* "View.MemoryView":1203
17322 * return stride
17323 *
17324 * @cname('__pyx_memoryview_copy_data_to_temp') # <<<<<<<<<<<<<<
17325 * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,
17326 * __Pyx_memviewslice *tmpslice,
17327*/
17328
17329 /* function exit code */
17330 __pyx_L1_error:;
17331 __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17332 __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
17333 __pyx_r = NULL;
17334 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17335 __pyx_L0:;
17336
17337
17338
17339
17340 return __pyx_r;
17341}
17342
17343/* "View.MemoryView":1246
17344 *
17345 *
17346 * @cname('__pyx_memoryview_err_extents') # <<<<<<<<<<<<<<
17347 * cdef int _err_extents(int i, Py_ssize_t extent1,
17348 * Py_ssize_t extent2) except -1 with gil:
17349*/
17350
17351static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
17352 int __pyx_r;
17353 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17354
17355
17356
17357
17358 /* "View.MemoryView":1249
17359 * cdef int _err_extents(int i, Py_ssize_t extent1,
17360 * Py_ssize_t extent2) except -1 with gil:
17361 * PyErr_Format( # <<<<<<<<<<<<<<
17362 * PyExc_ValueError,
17363 * "got differing extents in dimension %d (got %zd and %zd)",
17364*/
17365 (void)(PyErr_Format(PyExc_ValueError, __pyx_k_got_differing_extents_in_dimensi, __pyx_v_i, __pyx_v_extent1, __pyx_v_extent2));
17366
17367 /* "View.MemoryView":1253
17368 * "got differing extents in dimension %d (got %zd and %zd)",
17369 * i, extent1, extent2)
17370 * return -1 # <<<<<<<<<<<<<<
17371 *
17372 * @cname('__pyx_memoryview_err_dim')
17373*/
17374 {
17375
17376 __pyx_r = -1;
17377 }
17378 goto __pyx_L0;
17379
17380 /* "View.MemoryView":1246
17381 *
17382 *
17383 * @cname('__pyx_memoryview_err_extents') # <<<<<<<<<<<<<<
17384 * cdef int _err_extents(int i, Py_ssize_t extent1,
17385 * Py_ssize_t extent2) except -1 with gil:
17386*/
17387
17388 /* function exit code */
17389 __pyx_L0:;
17390
17391
17392
17393
17394 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17395 return __pyx_r;
17396}
17397
17398/* "View.MemoryView":1255
17399 * return -1
17400 *
17401 * @cname('__pyx_memoryview_err_dim') # <<<<<<<<<<<<<<
17402 * cdef int _err_dim(PyObject *error, const char* msg, int dim) except -1 with gil:
17403 * PyErr_Format(error, msg, dim)
17404*/
17405
17406static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char const *__pyx_v_msg, int __pyx_v_dim) {
17407 int __pyx_r;
17408 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17409
17410
17411
17412
17413 /* "View.MemoryView":1257
17414 * @cname('__pyx_memoryview_err_dim')
17415 * cdef int _err_dim(PyObject *error, const char* msg, int dim) except -1 with gil:
17416 * PyErr_Format(error, msg, dim) # <<<<<<<<<<<<<<
17417 * return -1
17418 *
17419*/
17420 (void)(PyErr_Format(__pyx_v_error, __pyx_v_msg, __pyx_v_dim));
17421
17422 /* "View.MemoryView":1258
17423 * cdef int _err_dim(PyObject *error, const char* msg, int dim) except -1 with gil:
17424 * PyErr_Format(error, msg, dim)
17425 * return -1 # <<<<<<<<<<<<<<
17426 *
17427 * @cname('__pyx_memoryview_err')
17428*/
17429 {
17430
17431 __pyx_r = -1;
17432 }
17433 goto __pyx_L0;
17434
17435 /* "View.MemoryView":1255
17436 * return -1
17437 *
17438 * @cname('__pyx_memoryview_err_dim') # <<<<<<<<<<<<<<
17439 * cdef int _err_dim(PyObject *error, const char* msg, int dim) except -1 with gil:
17440 * PyErr_Format(error, msg, dim)
17441*/
17442
17443 /* function exit code */
17444 __pyx_L0:;
17445
17446
17447
17448
17449 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17450 return __pyx_r;
17451}
17452
17453/* "View.MemoryView":1260
17454 * return -1
17455 *
17456 * @cname('__pyx_memoryview_err') # <<<<<<<<<<<<<<
17457 * cdef int _err(PyObject *error, const char* msg) except -1 with gil:
17458 * PyErr_SetString(error, msg)
17459*/
17460
17461static int __pyx_memoryview_err(PyObject *__pyx_v_error, char const *__pyx_v_msg) {
17462 int __pyx_r;
17463 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17464
17465
17466
17467 /* "View.MemoryView":1262
17468 * @cname('__pyx_memoryview_err')
17469 * cdef int _err(PyObject *error, const char* msg) except -1 with gil:
17470 * PyErr_SetString(error, msg) # <<<<<<<<<<<<<<
17471 * return -1
17472 *
17473*/
17474 (void)(PyErr_SetString(__pyx_v_error, __pyx_v_msg));
17475
17476 /* "View.MemoryView":1263
17477 * cdef int _err(PyObject *error, const char* msg) except -1 with gil:
17478 * PyErr_SetString(error, msg)
17479 * return -1 # <<<<<<<<<<<<<<
17480 *
17481 * @cname('__pyx_memoryview_err_no_memory')
17482*/
17483 {
17484
17485 __pyx_r = -1;
17486 }
17487 goto __pyx_L0;
17488
17489 /* "View.MemoryView":1260
17490 * return -1
17491 *
17492 * @cname('__pyx_memoryview_err') # <<<<<<<<<<<<<<
17493 * cdef int _err(PyObject *error, const char* msg) except -1 with gil:
17494 * PyErr_SetString(error, msg)
17495*/
17496
17497 /* function exit code */
17498 __pyx_L0:;
17499
17500
17501
17502 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17503 return __pyx_r;
17504}
17505
17506/* "View.MemoryView":1265
17507 * return -1
17508 *
17509 * @cname('__pyx_memoryview_err_no_memory') # <<<<<<<<<<<<<<
17510 * cdef int _err_no_memory() except -1 with gil:
17511 * raise MemoryError
17512*/
17513
17514static int __pyx_memoryview_err_no_memory(void) {
17515 int __pyx_r;
17516 int __pyx_lineno = 0;
17517 const char *__pyx_filename = NULL;
17518 int __pyx_clineno = 0;
17519 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17520
17521 /* "View.MemoryView":1267
17522 * @cname('__pyx_memoryview_err_no_memory')
17523 * cdef int _err_no_memory() except -1 with gil:
17524 * raise MemoryError # <<<<<<<<<<<<<<
17525 *
17526 *
17527*/
17528 PyErr_NoMemory(); __PYX_ERR(1, 1267, __pyx_L1_error)
17529
17530 /* "View.MemoryView":1265
17531 * return -1
17532 *
17533 * @cname('__pyx_memoryview_err_no_memory') # <<<<<<<<<<<<<<
17534 * cdef int _err_no_memory() except -1 with gil:
17535 * raise MemoryError
17536*/
17537
17538 /* function exit code */
17539 __pyx_L1_error:;
17540 __Pyx_AddTraceback("View.MemoryView._err_no_memory", __pyx_clineno, __pyx_lineno, __pyx_filename);
17541 __pyx_r = -1;
17542
17543 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17544 return __pyx_r;
17545}
17546
17547/* "View.MemoryView":1271
17548 *
17549 *
17550 * @cname('__pyx_memoryview_err_ValueError') # <<<<<<<<<<<<<<
17551 * cdef int _err_ValueError(const char* msg) except -1:
17552 * PyErr_SetString(PyExc_ValueError, msg)
17553*/
17554
17555static int __pyx_memoryview_err_ValueError(char const *__pyx_v_msg) {
17556 int __pyx_r;
17557
17558 /* "View.MemoryView":1273
17559 * @cname('__pyx_memoryview_err_ValueError')
17560 * cdef int _err_ValueError(const char* msg) except -1:
17561 * PyErr_SetString(PyExc_ValueError, msg) # <<<<<<<<<<<<<<
17562 * return -1
17563 *
17564*/
17565 (void)(PyErr_SetString(PyExc_ValueError, __pyx_v_msg));
17566
17567 /* "View.MemoryView":1274
17568 * cdef int _err_ValueError(const char* msg) except -1:
17569 * PyErr_SetString(PyExc_ValueError, msg)
17570 * return -1 # <<<<<<<<<<<<<<
17571 *
17572 * @cname('__pyx_memoryview_err_IndexError')
17573*/
17574 {
17575
17576 __pyx_r = -1;
17577 }
17578 goto __pyx_L0;
17579
17580 /* "View.MemoryView":1271
17581 *
17582 *
17583 * @cname('__pyx_memoryview_err_ValueError') # <<<<<<<<<<<<<<
17584 * cdef int _err_ValueError(const char* msg) except -1:
17585 * PyErr_SetString(PyExc_ValueError, msg)
17586*/
17587
17588 /* function exit code */
17589 __pyx_L0:;
17590
17591 return __pyx_r;
17592}
17593
17594/* "View.MemoryView":1276
17595 * return -1
17596 *
17597 * @cname('__pyx_memoryview_err_IndexError') # <<<<<<<<<<<<<<
17598 * cdef int _err_IndexError(const char* msg, Py_ssize_t index) except -1:
17599 * PyErr_Format(PyExc_IndexError, msg, index)
17600*/
17601
17602static int __pyx_memoryview_err_IndexError(char const *__pyx_v_msg, Py_ssize_t __pyx_v_index) {
17603 int __pyx_r;
17604
17605 /* "View.MemoryView":1278
17606 * @cname('__pyx_memoryview_err_IndexError')
17607 * cdef int _err_IndexError(const char* msg, Py_ssize_t index) except -1:
17608 * PyErr_Format(PyExc_IndexError, msg, index) # <<<<<<<<<<<<<<
17609 * return -1
17610 *
17611*/
17612 (void)(PyErr_Format(PyExc_IndexError, __pyx_v_msg, __pyx_v_index));
17613
17614 /* "View.MemoryView":1279
17615 * cdef int _err_IndexError(const char* msg, Py_ssize_t index) except -1:
17616 * PyErr_Format(PyExc_IndexError, msg, index)
17617 * return -1 # <<<<<<<<<<<<<<
17618 *
17619 *
17620*/
17621 {
17622
17623 __pyx_r = -1;
17624 }
17625 goto __pyx_L0;
17626
17627 /* "View.MemoryView":1276
17628 * return -1
17629 *
17630 * @cname('__pyx_memoryview_err_IndexError') # <<<<<<<<<<<<<<
17631 * cdef int _err_IndexError(const char* msg, Py_ssize_t index) except -1:
17632 * PyErr_Format(PyExc_IndexError, msg, index)
17633*/
17634
17635 /* function exit code */
17636 __pyx_L0:;
17637
17638 return __pyx_r;
17639}
17640
17641/* "View.MemoryView":1282
17642 *
17643 *
17644 * @cname('__pyx_memoryview_copy_contents') # <<<<<<<<<<<<<<
17645 * cdef int memoryview_copy_contents(__Pyx_memviewslice src,
17646 * __Pyx_memviewslice dst,
17647*/
17648
17649static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
17650 void *__pyx_v_tmpdata;
17651 size_t __pyx_v_itemsize;
17652 int __pyx_v_i;
17653 char __pyx_v_order;
17654 int __pyx_v_broadcasting;
17655 int __pyx_v_direct_copy;
17656 __Pyx_memviewslice __pyx_v_tmp;
17657 int __pyx_v_ndim;
17658 int __pyx_r;
17659 int __pyx_t_1;
17660 int __pyx_t_2;
17661 int __pyx_t_3;
17662 int __pyx_t_4;
17663 int __pyx_t_5;
17664 void *__pyx_t_6;
17665 int __pyx_lineno = 0;
17666 const char *__pyx_filename = NULL;
17667 int __pyx_clineno = 0;
17668 PyGILState_STATE __pyx_gilstate_save;
17669
17670
17671 /* "View.MemoryView":1291
17672 * Check for overlapping memory and verify the shapes.
17673 * """
17674 * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
17675 * cdef size_t itemsize = <size_t> src.memview.view.itemsize
17676 * cdef int i
17677*/
17678 __pyx_v_tmpdata = NULL;
17679
17680 /* "View.MemoryView":1292
17681 * """
17682 * cdef void *tmpdata = NULL
17683 * cdef size_t itemsize = <size_t> src.memview.view.itemsize # <<<<<<<<<<<<<<
17684 * cdef int i
17685 * cdef char order = get_best_order(&src, src_ndim)
17686*/
17687 __pyx_v_itemsize = ((size_t)__pyx_v_src.memview->view.itemsize);
17688
17689 /* "View.MemoryView":1294
17690 * cdef size_t itemsize = <size_t> src.memview.view.itemsize
17691 * cdef int i
17692 * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
17693 * cdef bint broadcasting = False
17694 * cdef bint direct_copy = False
17695*/
17696 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
17697
17698 /* "View.MemoryView":1295
17699 * cdef int i
17700 * cdef char order = get_best_order(&src, src_ndim)
17701 * cdef bint broadcasting = False # <<<<<<<<<<<<<<
17702 * cdef bint direct_copy = False
17703 * cdef __Pyx_memviewslice tmp
17704*/
17705 __pyx_v_broadcasting = 0;
17706
17707 /* "View.MemoryView":1296
17708 * cdef char order = get_best_order(&src, src_ndim)
17709 * cdef bint broadcasting = False
17710 * cdef bint direct_copy = False # <<<<<<<<<<<<<<
17711 * cdef __Pyx_memviewslice tmp
17712 *
17713*/
17714 __pyx_v_direct_copy = 0;
17715
17716 /* "View.MemoryView":1299
17717 * cdef __Pyx_memviewslice tmp
17718 *
17719 * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
17720 * broadcast_leading(&src, src_ndim, dst_ndim)
17721 * elif dst_ndim < src_ndim:
17722*/
17723 __pyx_t_1 = (__pyx_v_src_ndim < __pyx_v_dst_ndim);
17724
17725 if (__pyx_t_1) {
17726
17727
17728 /* "View.MemoryView":1300
17729 *
17730 * if src_ndim < dst_ndim:
17731 * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
17732 * elif dst_ndim < src_ndim:
17733 * broadcast_leading(&dst, dst_ndim, src_ndim)
17734*/
17735 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
17736
17737 /* "View.MemoryView":1299
17738 * cdef __Pyx_memviewslice tmp
17739 *
17740 * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
17741 * broadcast_leading(&src, src_ndim, dst_ndim)
17742 * elif dst_ndim < src_ndim:
17743*/
17744 goto __pyx_L3;
17745 }
17746
17747 /* "View.MemoryView":1301
17748 * if src_ndim < dst_ndim:
17749 * broadcast_leading(&src, src_ndim, dst_ndim)
17750 * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
17751 * broadcast_leading(&dst, dst_ndim, src_ndim)
17752 *
17753*/
17754 __pyx_t_1 = (__pyx_v_dst_ndim < __pyx_v_src_ndim);
17755
17756 if (__pyx_t_1) {
17757
17758
17759 /* "View.MemoryView":1302
17760 * broadcast_leading(&src, src_ndim, dst_ndim)
17761 * elif dst_ndim < src_ndim:
17762 * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
17763 *
17764 * cdef int ndim = max(src_ndim, dst_ndim)
17765*/
17766 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
17767
17768 /* "View.MemoryView":1301
17769 * if src_ndim < dst_ndim:
17770 * broadcast_leading(&src, src_ndim, dst_ndim)
17771 * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
17772 * broadcast_leading(&dst, dst_ndim, src_ndim)
17773 *
17774*/
17775 }
17776 __pyx_L3:;
17777
17778 /* "View.MemoryView":1304
17779 * broadcast_leading(&dst, dst_ndim, src_ndim)
17780 *
17781 * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
17782 *
17783 * for i in range(ndim):
17784*/
17785
17786 __pyx_t_2 = __pyx_v_dst_ndim;
17787
17788 __pyx_t_3 = __pyx_v_src_ndim;
17789 __pyx_t_1 = (__pyx_t_2 > __pyx_t_3);
17790
17791 if (__pyx_t_1) {
17792
17793 __pyx_t_4 = __pyx_t_2;
17794 } else {
17795
17796 __pyx_t_4 = __pyx_t_3;
17797 }
17798
17799 __pyx_v_ndim = __pyx_t_4;
17800
17801
17802 /* "View.MemoryView":1306
17803 * cdef int ndim = max(src_ndim, dst_ndim)
17804 *
17805 * for i in range(ndim): # <<<<<<<<<<<<<<
17806 * if src.shape[i] != dst.shape[i]:
17807 * if cython.likely(src.shape[i] == 1):
17808*/
17809
17810 __pyx_t_4 = __pyx_v_ndim;
17811 __pyx_t_2 = __pyx_t_4;
17812
17813 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17814 __pyx_v_i = __pyx_t_3;
17815
17816 /* "View.MemoryView":1307
17817 *
17818 * for i in range(ndim):
17819 * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
17820 * if cython.likely(src.shape[i] == 1):
17821 * broadcasting = True
17822*/
17823 __pyx_t_1 = ((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i]));
17824
17825 if (__pyx_t_1) {
17826
17827
17828 /* "View.MemoryView":1308
17829 * for i in range(ndim):
17830 * if src.shape[i] != dst.shape[i]:
17831 * if cython.likely(src.shape[i] == 1): # <<<<<<<<<<<<<<
17832 * broadcasting = True
17833 * src.strides[i] = 0
17834*/
17835 __pyx_t_1 = ((__pyx_v_src.shape[__pyx_v_i]) == 1);
17836
17837 if (likely(__pyx_t_1)) {
17838
17839
17840 /* "View.MemoryView":1309
17841 * if src.shape[i] != dst.shape[i]:
17842 * if cython.likely(src.shape[i] == 1):
17843 * broadcasting = True # <<<<<<<<<<<<<<
17844 * src.strides[i] = 0
17845 * else:
17846*/
17847 __pyx_v_broadcasting = 1;
17848
17849 /* "View.MemoryView":1310
17850 * if cython.likely(src.shape[i] == 1):
17851 * broadcasting = True
17852 * src.strides[i] = 0 # <<<<<<<<<<<<<<
17853 * else:
17854 * _err_extents(i, dst.shape[i], src.shape[i])
17855*/
17856 (__pyx_v_src.strides[__pyx_v_i]) = 0;
17857
17858 /* "View.MemoryView":1308
17859 * for i in range(ndim):
17860 * if src.shape[i] != dst.shape[i]:
17861 * if cython.likely(src.shape[i] == 1): # <<<<<<<<<<<<<<
17862 * broadcasting = True
17863 * src.strides[i] = 0
17864*/
17865 goto __pyx_L7;
17866 }
17867
17868 /* "View.MemoryView":1312
17869 * src.strides[i] = 0
17870 * else:
17871 * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
17872 *
17873 * if cython.unlikely(src.suboffsets[i] >= 0):
17874*/
17875 /*else*/ {
17876 __pyx_t_5 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1312, __pyx_L1_error)
17877
17878 }
17879 __pyx_L7:;
17880
17881 /* "View.MemoryView":1307
17882 *
17883 * for i in range(ndim):
17884 * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
17885 * if cython.likely(src.shape[i] == 1):
17886 * broadcasting = True
17887*/
17888 }
17889
17890 /* "View.MemoryView":1314
17891 * _err_extents(i, dst.shape[i], src.shape[i])
17892 *
17893 * if cython.unlikely(src.suboffsets[i] >= 0): # <<<<<<<<<<<<<<
17894 * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17895 *
17896*/
17897 __pyx_t_1 = ((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0);
17898
17899 if (unlikely(__pyx_t_1)) {
17900
17901
17902 /* "View.MemoryView":1315
17903 *
17904 * if cython.unlikely(src.suboffsets[i] >= 0):
17905 * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
17906 *
17907 * if slices_overlap(&src, &dst, ndim, itemsize):
17908*/
17909 __pyx_t_5 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_k_Dimension_d_is_not_direct, __pyx_v_i); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1315, __pyx_L1_error)
17910
17911
17912 /* "View.MemoryView":1314
17913 * _err_extents(i, dst.shape[i], src.shape[i])
17914 *
17915 * if cython.unlikely(src.suboffsets[i] >= 0): # <<<<<<<<<<<<<<
17916 * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17917 *
17918*/
17919 }
17920 }
17921
17922
17923 /* "View.MemoryView":1317
17924 * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17925 *
17926 * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
17927 *
17928 * if not slice_is_contig(src, order, ndim):
17929*/
17930 __pyx_t_1 = __pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
17931
17932 if (__pyx_t_1) {
17933
17934
17935 /* "View.MemoryView":1319
17936 * if slices_overlap(&src, &dst, ndim, itemsize):
17937 *
17938 * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
17939 * order = get_best_order(&dst, ndim)
17940 *
17941*/
17942 __pyx_t_1 = (!__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim));
17943
17944 if (__pyx_t_1) {
17945
17946
17947 /* "View.MemoryView":1320
17948 *
17949 * if not slice_is_contig(src, order, ndim):
17950 * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
17951 *
17952 * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
17953*/
17954 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
17955
17956 /* "View.MemoryView":1319
17957 * if slices_overlap(&src, &dst, ndim, itemsize):
17958 *
17959 * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
17960 * order = get_best_order(&dst, ndim)
17961 *
17962*/
17963 }
17964
17965 /* "View.MemoryView":1322
17966 * order = get_best_order(&dst, ndim)
17967 *
17968 * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
17969 * src = tmp
17970 *
17971*/
17972 __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == ((void *)NULL))) __PYX_ERR(1, 1322, __pyx_L1_error)
17973 __pyx_v_tmpdata = __pyx_t_6;
17974
17975 /* "View.MemoryView":1323
17976 *
17977 * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
17978 * src = tmp # <<<<<<<<<<<<<<
17979 *
17980 * if not broadcasting:
17981*/
17982 __pyx_v_src = __pyx_v_tmp;
17983
17984 /* "View.MemoryView":1317
17985 * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17986 *
17987 * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
17988 *
17989 * if not slice_is_contig(src, order, ndim):
17990*/
17991 }
17992
17993 /* "View.MemoryView":1325
17994 * src = tmp
17995 *
17996 * if not broadcasting: # <<<<<<<<<<<<<<
17997 *
17998 *
17999*/
18000 __pyx_t_1 = (!__pyx_v_broadcasting);
18001
18002 if (__pyx_t_1) {
18003
18004
18005 /* "View.MemoryView":1328
18006 *
18007 *
18008 * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
18009 * direct_copy = slice_is_contig(dst, 'C', ndim)
18010 * elif slice_is_contig(src, 'F', ndim):
18011*/
18012 __pyx_t_1 = __pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim);
18013
18014 if (__pyx_t_1) {
18015
18016
18017 /* "View.MemoryView":1329
18018 *
18019 * if slice_is_contig(src, 'C', ndim):
18020 * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
18021 * elif slice_is_contig(src, 'F', ndim):
18022 * direct_copy = slice_is_contig(dst, 'F', ndim)
18023*/
18024 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
18025
18026 /* "View.MemoryView":1328
18027 *
18028 *
18029 * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
18030 * direct_copy = slice_is_contig(dst, 'C', ndim)
18031 * elif slice_is_contig(src, 'F', ndim):
18032*/
18033 goto __pyx_L12;
18034 }
18035
18036 /* "View.MemoryView":1330
18037 * if slice_is_contig(src, 'C', ndim):
18038 * direct_copy = slice_is_contig(dst, 'C', ndim)
18039 * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
18040 * direct_copy = slice_is_contig(dst, 'F', ndim)
18041 *
18042*/
18043 __pyx_t_1 = __pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim);
18044
18045 if (__pyx_t_1) {
18046
18047
18048 /* "View.MemoryView":1331
18049 * direct_copy = slice_is_contig(dst, 'C', ndim)
18050 * elif slice_is_contig(src, 'F', ndim):
18051 * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
18052 *
18053 * if direct_copy:
18054*/
18055 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
18056
18057 /* "View.MemoryView":1330
18058 * if slice_is_contig(src, 'C', ndim):
18059 * direct_copy = slice_is_contig(dst, 'C', ndim)
18060 * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
18061 * direct_copy = slice_is_contig(dst, 'F', ndim)
18062 *
18063*/
18064 }
18065 __pyx_L12:;
18066
18067 /* "View.MemoryView":1333
18068 * direct_copy = slice_is_contig(dst, 'F', ndim)
18069 *
18070 * if direct_copy: # <<<<<<<<<<<<<<
18071 *
18072 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
18073*/
18074 if (__pyx_v_direct_copy) {
18075
18076 /* "View.MemoryView":1335
18077 * if direct_copy:
18078 *
18079 * refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
18080 * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
18081 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
18082*/
18083 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18084
18085 /* "View.MemoryView":1336
18086 *
18087 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
18088 * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
18089 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
18090 * free(tmpdata)
18091*/
18092 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
18093
18094 /* "View.MemoryView":1337
18095 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
18096 * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
18097 * refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
18098 * free(tmpdata)
18099 * return 0
18100*/
18101 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18102
18103 /* "View.MemoryView":1338
18104 * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
18105 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
18106 * free(tmpdata) # <<<<<<<<<<<<<<
18107 * return 0
18108 *
18109*/
18110 free(__pyx_v_tmpdata);
18111
18112 /* "View.MemoryView":1339
18113 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
18114 * free(tmpdata)
18115 * return 0 # <<<<<<<<<<<<<<
18116 *
18117 * if order == 'F' == get_best_order(&dst, ndim):
18118*/
18119 {
18120
18121 __pyx_r = 0;
18122 }
18123 goto __pyx_L0;
18124
18125 /* "View.MemoryView":1333
18126 * direct_copy = slice_is_contig(dst, 'F', ndim)
18127 *
18128 * if direct_copy: # <<<<<<<<<<<<<<
18129 *
18130 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
18131*/
18132 }
18133
18134 /* "View.MemoryView":1325
18135 * src = tmp
18136 *
18137 * if not broadcasting: # <<<<<<<<<<<<<<
18138 *
18139 *
18140*/
18141 }
18142
18143 /* "View.MemoryView":1341
18144 * return 0
18145 *
18146 * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
18147 *
18148 *
18149*/
18150 __pyx_t_1 = (__pyx_v_order == 'F');
18151 if (__pyx_t_1) {
18152 __pyx_t_1 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
18153 }
18154 if (__pyx_t_1) {
18155
18156
18157 /* "View.MemoryView":1344
18158 *
18159 *
18160 * transpose_memslice(&src) # <<<<<<<<<<<<<<
18161 * transpose_memslice(&dst)
18162 *
18163*/
18164 __pyx_t_4 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1344, __pyx_L1_error)
18165
18166
18167 /* "View.MemoryView":1345
18168 *
18169 * transpose_memslice(&src)
18170 * transpose_memslice(&dst) # <<<<<<<<<<<<<<
18171 *
18172 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
18173*/
18174 __pyx_t_4 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1345, __pyx_L1_error)
18175
18176
18177 /* "View.MemoryView":1341
18178 * return 0
18179 *
18180 * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
18181 *
18182 *
18183*/
18184 }
18185
18186 /* "View.MemoryView":1347
18187 * transpose_memslice(&dst)
18188 *
18189 * refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
18190 * copy_strided_to_strided(&src, &dst, ndim, itemsize)
18191 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
18192*/
18193 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18194
18195 /* "View.MemoryView":1348
18196 *
18197 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
18198 * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
18199 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
18200 *
18201*/
18202 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
18203
18204 /* "View.MemoryView":1349
18205 * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
18206 * copy_strided_to_strided(&src, &dst, ndim, itemsize)
18207 * refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
18208 *
18209 * free(tmpdata)
18210*/
18211 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18212
18213 /* "View.MemoryView":1351
18214 * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
18215 *
18216 * free(tmpdata) # <<<<<<<<<<<<<<
18217 * return 0
18218 *
18219*/
18220 free(__pyx_v_tmpdata);
18221
18222 /* "View.MemoryView":1352
18223 *
18224 * free(tmpdata)
18225 * return 0 # <<<<<<<<<<<<<<
18226 *
18227 * @cname('__pyx_memoryview_broadcast_leading')
18228*/
18229 {
18230
18231 __pyx_r = 0;
18232 }
18233 goto __pyx_L0;
18234
18235 /* "View.MemoryView":1282
18236 *
18237 *
18238 * @cname('__pyx_memoryview_copy_contents') # <<<<<<<<<<<<<<
18239 * cdef int memoryview_copy_contents(__Pyx_memviewslice src,
18240 * __Pyx_memviewslice dst,
18241*/
18242
18243 /* function exit code */
18244 __pyx_L1_error:;
18245 __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18246 __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
18247 __pyx_r = -1;
18248 __Pyx_PyGILState_Release(__pyx_gilstate_save);
18249 __pyx_L0:;
18250
18251
18252
18253
18254
18255
18256
18257
18258
18259 return __pyx_r;
18260}
18261
18262/* "View.MemoryView":1354
18263 * return 0
18264 *
18265 * @cname('__pyx_memoryview_broadcast_leading') # <<<<<<<<<<<<<<
18266 * cdef void broadcast_leading(__Pyx_memviewslice *mslice,
18267 * int ndim,
18268*/
18269
18270static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
18271 int __pyx_v_i;
18272 int __pyx_v_offset;
18273 int __pyx_t_1;
18274 int __pyx_t_2;
18275 int __pyx_t_3;
18276
18277 /* "View.MemoryView":1359
18278 * int ndim_other) noexcept nogil:
18279 * cdef int i
18280 * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
18281 *
18282 * for i in range(ndim - 1, -1, -1):
18283*/
18284 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
18285
18286 /* "View.MemoryView":1361
18287 * cdef int offset = ndim_other - ndim
18288 *
18289 * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18290 * mslice.shape[i + offset] = mslice.shape[i]
18291 * mslice.strides[i + offset] = mslice.strides[i]
18292*/
18293 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18294 __pyx_v_i = __pyx_t_1;
18295
18296 /* "View.MemoryView":1362
18297 *
18298 * for i in range(ndim - 1, -1, -1):
18299 * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
18300 * mslice.strides[i + offset] = mslice.strides[i]
18301 * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
18302*/
18303 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
18304
18305 /* "View.MemoryView":1363
18306 * for i in range(ndim - 1, -1, -1):
18307 * mslice.shape[i + offset] = mslice.shape[i]
18308 * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
18309 * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
18310 *
18311*/
18312 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
18313
18314 /* "View.MemoryView":1364
18315 * mslice.shape[i + offset] = mslice.shape[i]
18316 * mslice.strides[i + offset] = mslice.strides[i]
18317 * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
18318 *
18319 * for i in range(offset):
18320*/
18321 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
18322 }
18323
18324 /* "View.MemoryView":1366
18325 * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
18326 *
18327 * for i in range(offset): # <<<<<<<<<<<<<<
18328 * mslice.shape[i] = 1
18329 * mslice.strides[i] = mslice.strides[0]
18330*/
18331
18332 __pyx_t_1 = __pyx_v_offset;
18333 __pyx_t_2 = __pyx_t_1;
18334
18335 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
18336 __pyx_v_i = __pyx_t_3;
18337
18338 /* "View.MemoryView":1367
18339 *
18340 * for i in range(offset):
18341 * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
18342 * mslice.strides[i] = mslice.strides[0]
18343 * mslice.suboffsets[i] = -1
18344*/
18345 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
18346
18347 /* "View.MemoryView":1368
18348 * for i in range(offset):
18349 * mslice.shape[i] = 1
18350 * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
18351 * mslice.suboffsets[i] = -1
18352 *
18353*/
18354 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
18355
18356 /* "View.MemoryView":1369
18357 * mslice.shape[i] = 1
18358 * mslice.strides[i] = mslice.strides[0]
18359 * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
18360 *
18361 *
18362*/
18363 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
18364 }
18365
18366
18367 /* "View.MemoryView":1354
18368 * return 0
18369 *
18370 * @cname('__pyx_memoryview_broadcast_leading') # <<<<<<<<<<<<<<
18371 * cdef void broadcast_leading(__Pyx_memviewslice *mslice,
18372 * int ndim,
18373*/
18374
18375 /* function exit code */
18376
18377
18378}
18379
18380/* "View.MemoryView":1376
18381 *
18382 *
18383 * @cname('__pyx_memoryview_refcount_copying') # <<<<<<<<<<<<<<
18384 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
18385 *
18386*/
18387
18388static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
18389
18390 /* "View.MemoryView":1379
18391 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
18392 *
18393 * if dtype_is_object: # <<<<<<<<<<<<<<
18394 * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
18395 *
18396*/
18397 if (__pyx_v_dtype_is_object) {
18398
18399 /* "View.MemoryView":1380
18400 *
18401 * if dtype_is_object:
18402 * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc) # <<<<<<<<<<<<<<
18403 *
18404 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
18405*/
18406 __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
18407
18408 /* "View.MemoryView":1379
18409 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
18410 *
18411 * if dtype_is_object: # <<<<<<<<<<<<<<
18412 * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
18413 *
18414*/
18415 }
18416
18417 /* "View.MemoryView":1376
18418 *
18419 *
18420 * @cname('__pyx_memoryview_refcount_copying') # <<<<<<<<<<<<<<
18421 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
18422 *
18423*/
18424
18425 /* function exit code */
18426}
18427
18428/* "View.MemoryView":1382
18429 * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
18430 *
18431 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') # <<<<<<<<<<<<<<
18432 * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,
18433 * Py_ssize_t *strides, int ndim,
18434*/
18435
18436static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
18437 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18438
18439
18440
18441
18442
18443
18444 /* "View.MemoryView":1386
18445 * Py_ssize_t *strides, int ndim,
18446 * bint inc) noexcept with gil:
18447 * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
18448 *
18449 * @cname('__pyx_memoryview_refcount_objects_in_slice')
18450*/
18451 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
18452
18453 /* "View.MemoryView":1382
18454 * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
18455 *
18456 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil') # <<<<<<<<<<<<<<
18457 * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,
18458 * Py_ssize_t *strides, int ndim,
18459*/
18460
18461 /* function exit code */
18462
18463
18464
18465
18466
18467
18468 __Pyx_PyGILState_Release(__pyx_gilstate_save);
18469}
18470
18471/* "View.MemoryView":1388
18472 * refcount_objects_in_slice(data, shape, strides, ndim, inc)
18473 *
18474 * @cname('__pyx_memoryview_refcount_objects_in_slice') # <<<<<<<<<<<<<<
18475 * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,
18476 * Py_ssize_t *strides, int ndim, bint inc) noexcept:
18477*/
18478
18479static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
18480 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18481 Py_ssize_t __pyx_v_stride;
18482 Py_ssize_t __pyx_t_1;
18483 Py_ssize_t __pyx_t_2;
18484 Py_ssize_t __pyx_t_3;
18485 int __pyx_t_4;
18486
18487
18488 /* "View.MemoryView":1392
18489 * Py_ssize_t *strides, int ndim, bint inc) noexcept:
18490 * cdef Py_ssize_t i
18491 * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
18492 *
18493 * for i in range(shape[0]):
18494*/
18495 __pyx_v_stride = (__pyx_v_strides[0]);
18496
18497 /* "View.MemoryView":1394
18498 * cdef Py_ssize_t stride = strides[0]
18499 *
18500 * for i in range(shape[0]): # <<<<<<<<<<<<<<
18501 * if ndim == 1:
18502 * if inc:
18503*/
18504
18505 __pyx_t_1 = (__pyx_v_shape[0]);
18506 __pyx_t_2 = __pyx_t_1;
18507
18508 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
18509 __pyx_v_i = __pyx_t_3;
18510
18511 /* "View.MemoryView":1395
18512 *
18513 * for i in range(shape[0]):
18514 * if ndim == 1: # <<<<<<<<<<<<<<
18515 * if inc:
18516 * Py_INCREF((<PyObject **> data)[0])
18517*/
18518 __pyx_t_4 = (__pyx_v_ndim == 1);
18519
18520 if (__pyx_t_4) {
18521
18522
18523 /* "View.MemoryView":1396
18524 * for i in range(shape[0]):
18525 * if ndim == 1:
18526 * if inc: # <<<<<<<<<<<<<<
18527 * Py_INCREF((<PyObject **> data)[0])
18528 * else:
18529*/
18530 if (__pyx_v_inc) {
18531
18532 /* "View.MemoryView":1397
18533 * if ndim == 1:
18534 * if inc:
18535 * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
18536 * else:
18537 * Py_DECREF((<PyObject **> data)[0])
18538*/
18539 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
18540
18541 /* "View.MemoryView":1396
18542 * for i in range(shape[0]):
18543 * if ndim == 1:
18544 * if inc: # <<<<<<<<<<<<<<
18545 * Py_INCREF((<PyObject **> data)[0])
18546 * else:
18547*/
18548 goto __pyx_L6;
18549 }
18550
18551 /* "View.MemoryView":1399
18552 * Py_INCREF((<PyObject **> data)[0])
18553 * else:
18554 * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
18555 * else:
18556 * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
18557*/
18558 /*else*/ {
18559 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
18560 }
18561 __pyx_L6:;
18562
18563 /* "View.MemoryView":1395
18564 *
18565 * for i in range(shape[0]):
18566 * if ndim == 1: # <<<<<<<<<<<<<<
18567 * if inc:
18568 * Py_INCREF((<PyObject **> data)[0])
18569*/
18570 goto __pyx_L5;
18571 }
18572
18573 /* "View.MemoryView":1401
18574 * Py_DECREF((<PyObject **> data)[0])
18575 * else:
18576 * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc) # <<<<<<<<<<<<<<
18577 *
18578 * data += stride
18579*/
18580 /*else*/ {
18581 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
18582 }
18583 __pyx_L5:;
18584
18585 /* "View.MemoryView":1403
18586 * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
18587 *
18588 * data += stride # <<<<<<<<<<<<<<
18589 *
18590 *
18591*/
18592 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18593 }
18594
18595
18596 /* "View.MemoryView":1388
18597 * refcount_objects_in_slice(data, shape, strides, ndim, inc)
18598 *
18599 * @cname('__pyx_memoryview_refcount_objects_in_slice') # <<<<<<<<<<<<<<
18600 * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,
18601 * Py_ssize_t *strides, int ndim, bint inc) noexcept:
18602*/
18603
18604 /* function exit code */
18605
18606
18607
18608
18609}
18610
18611/* "View.MemoryView":1408
18612 *
18613 *
18614 * @cname('__pyx_memoryview_slice_assign_scalar') # <<<<<<<<<<<<<<
18615 * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,
18616 * size_t itemsize, void *item,
18617*/
18618
18619static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
18620
18621 /* "View.MemoryView":1412
18622 * size_t itemsize, void *item,
18623 * bint dtype_is_object) noexcept nogil:
18624 * refcount_copying(dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
18625 * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
18626 * refcount_copying(dst, dtype_is_object, ndim, inc=True)
18627*/
18628 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18629
18630 /* "View.MemoryView":1413
18631 * bint dtype_is_object) noexcept nogil:
18632 * refcount_copying(dst, dtype_is_object, ndim, inc=False)
18633 * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item) # <<<<<<<<<<<<<<
18634 * refcount_copying(dst, dtype_is_object, ndim, inc=True)
18635 *
18636*/
18637 __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
18638
18639 /* "View.MemoryView":1414
18640 * refcount_copying(dst, dtype_is_object, ndim, inc=False)
18641 * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
18642 * refcount_copying(dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
18643 *
18644 *
18645*/
18646 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18647
18648 /* "View.MemoryView":1408
18649 *
18650 *
18651 * @cname('__pyx_memoryview_slice_assign_scalar') # <<<<<<<<<<<<<<
18652 * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,
18653 * size_t itemsize, void *item,
18654*/
18655
18656 /* function exit code */
18657}
18658
18659/* "View.MemoryView":1417
18660 *
18661 *
18662 * @cname('__pyx_memoryview__slice_assign_scalar') # <<<<<<<<<<<<<<
18663 * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,
18664 * Py_ssize_t *strides, int ndim,
18665*/
18666
18667static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
18668 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18669 Py_ssize_t __pyx_v_stride;
18670 Py_ssize_t __pyx_v_extent;
18671 int __pyx_t_1;
18672 Py_ssize_t __pyx_t_2;
18673 Py_ssize_t __pyx_t_3;
18674 Py_ssize_t __pyx_t_4;
18675
18676
18677 /* "View.MemoryView":1422
18678 * size_t itemsize, void *item) noexcept nogil:
18679 * cdef Py_ssize_t i
18680 * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
18681 * cdef Py_ssize_t extent = shape[0]
18682 *
18683*/
18684 __pyx_v_stride = (__pyx_v_strides[0]);
18685
18686 /* "View.MemoryView":1423
18687 * cdef Py_ssize_t i
18688 * cdef Py_ssize_t stride = strides[0]
18689 * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
18690 *
18691 * if ndim == 1:
18692*/
18693 __pyx_v_extent = (__pyx_v_shape[0]);
18694
18695 /* "View.MemoryView":1425
18696 * cdef Py_ssize_t extent = shape[0]
18697 *
18698 * if ndim == 1: # <<<<<<<<<<<<<<
18699 * for i in range(extent):
18700 * memcpy(data, item, itemsize)
18701*/
18702 __pyx_t_1 = (__pyx_v_ndim == 1);
18703
18704 if (__pyx_t_1) {
18705
18706
18707 /* "View.MemoryView":1426
18708 *
18709 * if ndim == 1:
18710 * for i in range(extent): # <<<<<<<<<<<<<<
18711 * memcpy(data, item, itemsize)
18712 * data += stride
18713*/
18714
18715 __pyx_t_2 = __pyx_v_extent;
18716 __pyx_t_3 = __pyx_t_2;
18717
18718 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18719 __pyx_v_i = __pyx_t_4;
18720
18721 /* "View.MemoryView":1427
18722 * if ndim == 1:
18723 * for i in range(extent):
18724 * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
18725 * data += stride
18726 * else:
18727*/
18728 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
18729
18730 /* "View.MemoryView":1428
18731 * for i in range(extent):
18732 * memcpy(data, item, itemsize)
18733 * data += stride # <<<<<<<<<<<<<<
18734 * else:
18735 * for i in range(extent):
18736*/
18737 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18738 }
18739
18740
18741 /* "View.MemoryView":1425
18742 * cdef Py_ssize_t extent = shape[0]
18743 *
18744 * if ndim == 1: # <<<<<<<<<<<<<<
18745 * for i in range(extent):
18746 * memcpy(data, item, itemsize)
18747*/
18748 goto __pyx_L3;
18749 }
18750
18751 /* "View.MemoryView":1430
18752 * data += stride
18753 * else:
18754 * for i in range(extent): # <<<<<<<<<<<<<<
18755 * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
18756 * data += stride
18757*/
18758 /*else*/ {
18759
18760 __pyx_t_2 = __pyx_v_extent;
18761 __pyx_t_3 = __pyx_t_2;
18762
18763 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18764 __pyx_v_i = __pyx_t_4;
18765
18766 /* "View.MemoryView":1431
18767 * else:
18768 * for i in range(extent):
18769 * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item) # <<<<<<<<<<<<<<
18770 * data += stride
18771 *
18772*/
18773 __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
18774
18775 /* "View.MemoryView":1432
18776 * for i in range(extent):
18777 * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
18778 * data += stride # <<<<<<<<<<<<<<
18779 *
18780*/
18781 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18782 }
18783
18784 }
18785 __pyx_L3:;
18786
18787 /* "View.MemoryView":1417
18788 *
18789 *
18790 * @cname('__pyx_memoryview__slice_assign_scalar') # <<<<<<<<<<<<<<
18791 * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,
18792 * Py_ssize_t *strides, int ndim,
18793*/
18794
18795 /* function exit code */
18796
18797
18798
18799
18800}
18801
18802/* "(tree fragment)":4
18803 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
18804 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
18805 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<<
18806 * cdef object __pyx_result
18807 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
18808*/
18809
18810/* Python wrapper */
18811static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
18812#if CYTHON_VECTORCALL
18813PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
18814#else
18815PyObject *__pyx_args, PyObject *__pyx_kwds
18816#endif
18817); /*proto*/
18818static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
18819static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
18820#if CYTHON_VECTORCALL
18821PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
18822#else
18823PyObject *__pyx_args, PyObject *__pyx_kwds
18824#endif
18825) {
18826 PyObject *__pyx_v___pyx_type = 0;
18827 long __pyx_v___pyx_checksum;
18828 PyObject *__pyx_v___pyx_state = 0;
18829 #if !CYTHON_VECTORCALL
18830 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
18831 #endif
18832 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
18833 PyObject* values[3] = {0,0,0};
18834 int __pyx_lineno = 0;
18835 const char *__pyx_filename = NULL;
18836 int __pyx_clineno = 0;
18837 PyObject *__pyx_r = 0;
18838 __Pyx_RefNannyDeclarations
18839 __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
18840 #if !CYTHON_VECTORCALL
18841 #if CYTHON_ASSUME_SAFE_SIZE
18842 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
18843 #else
18844 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
18845 #endif
18846 #endif
18847 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
18848 {
18849 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
18850 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
18851 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(1, 4, __pyx_L3_error)
18852 if (__pyx_kwds_len > 0) {
18853 switch (__pyx_nargs) {
18854 case 3:
18855 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
18856 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
18857 CYTHON_FALLTHROUGH;
18858 case 2:
18859 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
18860 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
18861 CYTHON_FALLTHROUGH;
18862 case 1:
18863 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
18864 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 4, __pyx_L3_error)
18865 CYTHON_FALLTHROUGH;
18866 case 0: break;
18867 default: goto __pyx_L5_argtuple_error;
18868 }
18869 const Py_ssize_t kwd_pos_args = __pyx_nargs;
18870 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_Enum", 0) < (0)) __PYX_ERR(1, 4, __pyx_L3_error)
18871 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
18872 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, i); __PYX_ERR(1, 4, __pyx_L3_error) }
18873 }
18874 } else if (unlikely(__pyx_nargs != 3)) {
18875 goto __pyx_L5_argtuple_error;
18876 } else {
18877 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
18878 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 4, __pyx_L3_error)
18879 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
18880 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(1, 4, __pyx_L3_error)
18881 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
18882 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(1, 4, __pyx_L3_error)
18883 }
18884 __pyx_v___pyx_type = values[0];
18885 __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 4, __pyx_L3_error)
18886 __pyx_v___pyx_state = ((PyObject*)values[2]);
18887 }
18888 goto __pyx_L6_skip;
18889 __pyx_L5_argtuple_error:;
18890 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 4, __pyx_L3_error)
18891 __pyx_L6_skip:;
18892 goto __pyx_L4_argument_unpacking_done;
18893 __pyx_L3_error:;
18894 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
18895 Py_XDECREF(values[__pyx_temp]);
18896 }
18897 __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18898 __Pyx_RefNannyFinishContext();
18899 return NULL;
18900 __pyx_L4_argument_unpacking_done:;
18901 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(1, 4, __pyx_L1_error)
18902 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
18903
18904 /* function exit code */
18905 goto __pyx_L0;
18906 __pyx_L1_error:;
18907 __pyx_r = NULL;
18908 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
18909 Py_XDECREF(values[__pyx_temp]);
18910 }
18911 goto __pyx_L7_cleaned_up;
18912 __pyx_L0:;
18913 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
18914 Py_XDECREF(values[__pyx_temp]);
18915 }
18916 __pyx_L7_cleaned_up:;
18917
18918 __Pyx_RefNannyFinishContext();
18919 return __pyx_r;
18920}
18921
18922static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
18923 PyObject *__pyx_v___pyx_result = 0;
18924 PyObject *__pyx_r = NULL;
18925 __Pyx_RefNannyDeclarations
18926 int __pyx_t_1;
18927 PyObject *__pyx_t_2 = NULL;
18928 PyObject *__pyx_t_3 = NULL;
18929 size_t __pyx_t_4;
18930 int __pyx_t_5;
18931 int __pyx_lineno = 0;
18932 const char *__pyx_filename = NULL;
18933 int __pyx_clineno = 0;
18934 __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
18935
18936 /* "(tree fragment)":6
18937 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state):
18938 * cdef object __pyx_result
18939 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name') # <<<<<<<<<<<<<<
18940 * __pyx_result = Enum.__new__(__pyx_type)
18941 * if __pyx_state is not None:
18942*/
18943 __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, __pyx_k_name); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 6, __pyx_L1_error)
18944
18945
18946 /* "(tree fragment)":7
18947 * cdef object __pyx_result
18948 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
18949 * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
18950 * if __pyx_state is not None:
18951 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18952*/
18953 __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_MemviewEnum_type);
18954 __Pyx_INCREF(__pyx_t_3);
18955 __pyx_t_4 = 0;
18956 {
18957 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
18958 __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
18959 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18960 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
18961 __Pyx_GOTREF(__pyx_t_2);
18962 }
18963 __pyx_v___pyx_result = __pyx_t_2;
18964 __pyx_t_2 = 0;
18965
18966 /* "(tree fragment)":8
18967 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
18968 * __pyx_result = Enum.__new__(__pyx_type)
18969 * if __pyx_state is not None: # <<<<<<<<<<<<<<
18970 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18971 * return __pyx_result
18972*/
18973 __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
18974 if (__pyx_t_5) {
18975
18976
18977 /* "(tree fragment)":9
18978 * __pyx_result = Enum.__new__(__pyx_type)
18979 * if __pyx_state is not None:
18980 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
18981 * return __pyx_result
18982 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):
18983*/
18984 if (unlikely(__pyx_v___pyx_state == Py_None)) {
18985 PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared \047not None\047");
18986 __PYX_ERR(1, 9, __pyx_L1_error)
18987 }
18988 __pyx_t_2 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
18989 __Pyx_GOTREF(__pyx_t_2);
18990 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18991
18992 /* "(tree fragment)":8
18993 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
18994 * __pyx_result = Enum.__new__(__pyx_type)
18995 * if __pyx_state is not None: # <<<<<<<<<<<<<<
18996 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18997 * return __pyx_result
18998*/
18999 }
19000
19001 /* "(tree fragment)":10
19002 * if __pyx_state is not None:
19003 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19004 * return __pyx_result # <<<<<<<<<<<<<<
19005 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):
19006 * __pyx_result.name = __pyx_state[0]
19007*/
19008 {
19009 PyObject *__pyx_temp;
19010 {
19011 __pyx_temp = __pyx_r;
19012 __Pyx_INCREF(__pyx_v___pyx_result);
19013 __pyx_r = __pyx_v___pyx_result;
19014 }
19015 __Pyx_XDECREF(__pyx_temp);
19016 }
19017 goto __pyx_L0;
19018
19019 /* "(tree fragment)":4
19020 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
19021 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
19022 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<<
19023 * cdef object __pyx_result
19024 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
19025*/
19026
19027 /* function exit code */
19028 __pyx_L1_error:;
19029 __Pyx_XDECREF(__pyx_t_2);
19030 __Pyx_XDECREF(__pyx_t_3);
19031 __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
19032 __pyx_r = NULL;
19033 __pyx_L0:;
19034 __Pyx_XDECREF(__pyx_v___pyx_result);
19035 __Pyx_XGIVEREF(__pyx_r);
19036 __Pyx_RefNannyFinishContext();
19037 return __pyx_r;
19038}
19039
19040/* "(tree fragment)":11
19041 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19042 * return __pyx_result
19043 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple): # <<<<<<<<<<<<<<
19044 * __pyx_result.name = __pyx_state[0]
19045 * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
19046*/
19047
19048static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
19049 PyObject *__pyx_r = NULL;
19050 __Pyx_RefNannyDeclarations
19051 PyObject *__pyx_t_1 = NULL;
19052 int __pyx_t_2;
19053 int __pyx_lineno = 0;
19054 const char *__pyx_filename = NULL;
19055 int __pyx_clineno = 0;
19056 __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
19057
19058 /* "(tree fragment)":12
19059 * return __pyx_result
19060 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):
19061 * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
19062 * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
19063*/
19064 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
19065 __Pyx_GOTREF(__pyx_t_1);
19066 __Pyx_GIVEREF(__pyx_t_1);
19067 __Pyx_GOTREF(__pyx_v___pyx_result->name);
19068 __Pyx_DECREF(__pyx_v___pyx_result->name);
19069 __pyx_v___pyx_result->name = __pyx_t_1;
19070 __pyx_t_1 = 0;
19071
19072 /* "(tree fragment)":13
19073 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):
19074 * __pyx_result.name = __pyx_state[0]
19075 * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1) # <<<<<<<<<<<<<<
19076*/
19077 __pyx_t_2 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
19078
19079
19080 /* "(tree fragment)":11
19081 * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19082 * return __pyx_result
19083 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple): # <<<<<<<<<<<<<<
19084 * __pyx_result.name = __pyx_state[0]
19085 * __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
19086*/
19087
19088 /* function exit code */
19089 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19090 goto __pyx_L0;
19091 __pyx_L1_error:;
19092 __Pyx_XDECREF(__pyx_t_1);
19093 __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
19094 __pyx_r = 0;
19095 __pyx_L0:;
19096 __Pyx_XGIVEREF(__pyx_r);
19097 __Pyx_RefNannyFinishContext();
19098 return __pyx_r;
19099}
19100
19101/* "BufferFormatFromTypeInfo":1467
19102 *
19103 *
19104 * @cname('__pyx_format_from_typeinfo') # <<<<<<<<<<<<<<
19105 * cdef bytes format_from_typeinfo(const __Pyx_TypeInfo *type):
19106 * cdef const __Pyx_StructField *field
19107*/
19108
19109static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo const *__pyx_v_type) {
19110 __Pyx_StructField const *__pyx_v_field;
19111 struct __pyx_typeinfo_string __pyx_v_fmt;
19112 PyObject *__pyx_v_part = 0;
19113 PyObject *__pyx_v_result = 0;
19114 PyObject *__pyx_v_alignment = NULL;
19115 PyObject *__pyx_v_parts = NULL;
19116 PyObject *__pyx_v_extents = NULL;
19117 Py_ssize_t __pyx_7genexpr__pyx_v_i;
19118 PyObject *__pyx_r = NULL;
19119 __Pyx_RefNannyDeclarations
19120 int __pyx_t_1;
19121 PyObject *__pyx_t_2 = NULL;
19122 __Pyx_StructField const *__pyx_t_3;
19123 PyObject *__pyx_t_4 = NULL;
19124 PyObject *__pyx_t_5 = NULL;
19125 int __pyx_t_6;
19126 int __pyx_t_7;
19127 int __pyx_t_8;
19128 Py_ssize_t __pyx_t_9;
19129 PyObject *__pyx_t_10[3];
19130 int __pyx_lineno = 0;
19131 const char *__pyx_filename = NULL;
19132 int __pyx_clineno = 0;
19133 __Pyx_RefNannySetupContext("format_from_typeinfo", 0);
19134
19135 /* "BufferFormatFromTypeInfo":1474
19136 * cdef Py_ssize_t i
19137 *
19138 * if type.typegroup == 'S': # <<<<<<<<<<<<<<
19139 * assert type.fields != NULL
19140 * assert type.fields.type != NULL
19141*/
19142 __pyx_t_1 = (__pyx_v_type->typegroup == 'S');
19143
19144 if (__pyx_t_1) {
19145
19146
19147 /* "BufferFormatFromTypeInfo":1475
19148 *
19149 * if type.typegroup == 'S':
19150 * assert type.fields != NULL # <<<<<<<<<<<<<<
19151 * assert type.fields.type != NULL
19152 *
19153*/
19154 #ifndef CYTHON_WITHOUT_ASSERTIONS
19155 if (unlikely(__pyx_assertions_enabled())) {
19156 __pyx_t_1 = (__pyx_v_type->fields != NULL);
19157
19158 if (unlikely(!__pyx_t_1)) {
19159 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
19160 __PYX_ERR(1, 1475, __pyx_L1_error)
19161 }
19162
19163 }
19164 #else
19165 if ((1)); else __PYX_ERR(1, 1475, __pyx_L1_error)
19166 #endif
19167
19168 /* "BufferFormatFromTypeInfo":1476
19169 * if type.typegroup == 'S':
19170 * assert type.fields != NULL
19171 * assert type.fields.type != NULL # <<<<<<<<<<<<<<
19172 *
19173 * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
19174*/
19175 #ifndef CYTHON_WITHOUT_ASSERTIONS
19176 if (unlikely(__pyx_assertions_enabled())) {
19177 __pyx_t_1 = (__pyx_v_type->fields->type != NULL);
19178
19179 if (unlikely(!__pyx_t_1)) {
19180 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
19181 __PYX_ERR(1, 1476, __pyx_L1_error)
19182 }
19183
19184 }
19185 #else
19186 if ((1)); else __PYX_ERR(1, 1476, __pyx_L1_error)
19187 #endif
19188
19189 /* "BufferFormatFromTypeInfo":1478
19190 * assert type.fields.type != NULL
19191 *
19192 * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<<
19193 * alignment = b'^'
19194 * else:
19195*/
19196 __pyx_t_1 = ((__pyx_v_type->flags & __PYX_BUF_FLAGS_PACKED_STRUCT) != 0);
19197
19198 if (__pyx_t_1) {
19199
19200
19201 /* "BufferFormatFromTypeInfo":1479
19202 *
19203 * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
19204 * alignment = b'^' # <<<<<<<<<<<<<<
19205 * else:
19206 * alignment = b''
19207*/
19208 __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__5);
19209 __pyx_v_alignment = __pyx_mstate_global->__pyx_kp_b__5;
19210
19211 /* "BufferFormatFromTypeInfo":1478
19212 * assert type.fields.type != NULL
19213 *
19214 * if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT: # <<<<<<<<<<<<<<
19215 * alignment = b'^'
19216 * else:
19217*/
19218 goto __pyx_L4;
19219 }
19220
19221 /* "BufferFormatFromTypeInfo":1481
19222 * alignment = b'^'
19223 * else:
19224 * alignment = b'' # <<<<<<<<<<<<<<
19225 *
19226 * parts = [b"T{"]
19227*/
19228 /*else*/ {
19229 __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__6);
19230 __pyx_v_alignment = __pyx_mstate_global->__pyx_kp_b__6;
19231 }
19232 __pyx_L4:;
19233
19234 /* "BufferFormatFromTypeInfo":1483
19235 * alignment = b''
19236 *
19237 * parts = [b"T{"] # <<<<<<<<<<<<<<
19238 * field = type.fields
19239 *
19240*/
19241 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1483, __pyx_L1_error)
19242 __Pyx_GOTREF(__pyx_t_2);
19243 __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b_T);
19244 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_b_T);
19245 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_mstate_global->__pyx_kp_b_T) != (0)) __PYX_ERR(1, 1483, __pyx_L1_error);
19246 __pyx_v_parts = ((PyObject*)__pyx_t_2);
19247 __pyx_t_2 = 0;
19248
19249 /* "BufferFormatFromTypeInfo":1484
19250 *
19251 * parts = [b"T{"]
19252 * field = type.fields # <<<<<<<<<<<<<<
19253 *
19254 * while field.type:
19255*/
19256 __pyx_t_3 = __pyx_v_type->fields;
19257
19258 __pyx_v_field = __pyx_t_3;
19259
19260 /* "BufferFormatFromTypeInfo":1486
19261 * field = type.fields
19262 *
19263 * while field.type: # <<<<<<<<<<<<<<
19264 * part = format_from_typeinfo(field.type)
19265 * parts.append(part + b':' + field.name + b':')
19266*/
19267 while (1) {
19268 __pyx_t_1 = (__pyx_v_field->type != 0);
19269
19270
19271 if (!__pyx_t_1) break;
19272
19273 /* "BufferFormatFromTypeInfo":1487
19274 *
19275 * while field.type:
19276 * part = format_from_typeinfo(field.type) # <<<<<<<<<<<<<<
19277 * parts.append(part + b':' + field.name + b':')
19278 * field += 1
19279*/
19280 __pyx_t_2 = __pyx_format_from_typeinfo(__pyx_v_field->type); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1487, __pyx_L1_error)
19281 __Pyx_GOTREF(__pyx_t_2);
19282 __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_2));
19283 __pyx_t_2 = 0;
19284
19285 /* "BufferFormatFromTypeInfo":1488
19286 * while field.type:
19287 * part = format_from_typeinfo(field.type)
19288 * parts.append(part + b':' + field.name + b':') # <<<<<<<<<<<<<<
19289 * field += 1
19290 *
19291*/
19292 __pyx_t_2 = PyNumber_Add(__pyx_v_part, __pyx_mstate_global->__pyx_kp_b__7); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1488, __pyx_L1_error)
19293 __Pyx_GOTREF(__pyx_t_2);
19294 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_field->name); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1488, __pyx_L1_error)
19295 __Pyx_GOTREF(__pyx_t_4);
19296 __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1488, __pyx_L1_error)
19297 __Pyx_GOTREF(__pyx_t_5);
19298 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19299 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19300 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_mstate_global->__pyx_kp_b__7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1488, __pyx_L1_error)
19301 __Pyx_GOTREF(__pyx_t_4);
19302 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19303 __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_parts, __pyx_t_4); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1488, __pyx_L1_error)
19304 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19305
19306
19307 /* "BufferFormatFromTypeInfo":1489
19308 * part = format_from_typeinfo(field.type)
19309 * parts.append(part + b':' + field.name + b':')
19310 * field += 1 # <<<<<<<<<<<<<<
19311 *
19312 * result = alignment.join(parts) + b'}'
19313*/
19314 __pyx_v_field = (__pyx_v_field + 1);
19315 }
19316
19317 /* "BufferFormatFromTypeInfo":1491
19318 * field += 1
19319 *
19320 * result = alignment.join(parts) + b'}' # <<<<<<<<<<<<<<
19321 * else:
19322 * fmt = __Pyx_TypeInfoToFormat(type)
19323*/
19324 __pyx_t_4 = __Pyx_PyBytes_Join(__pyx_v_alignment, __pyx_v_parts); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1491, __pyx_L1_error)
19325 __Pyx_GOTREF(__pyx_t_4);
19326 __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_mstate_global->__pyx_kp_b__8); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1491, __pyx_L1_error)
19327 __Pyx_GOTREF(__pyx_t_5);
19328 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19329 __pyx_v_result = ((PyObject*)__pyx_t_5);
19330 __pyx_t_5 = 0;
19331
19332 /* "BufferFormatFromTypeInfo":1474
19333 * cdef Py_ssize_t i
19334 *
19335 * if type.typegroup == 'S': # <<<<<<<<<<<<<<
19336 * assert type.fields != NULL
19337 * assert type.fields.type != NULL
19338*/
19339 goto __pyx_L3;
19340 }
19341
19342 /* "BufferFormatFromTypeInfo":1493
19343 * result = alignment.join(parts) + b'}'
19344 * else:
19345 * fmt = __Pyx_TypeInfoToFormat(type) # <<<<<<<<<<<<<<
19346 * result = fmt.string
19347 * if type.arraysize[0]:
19348*/
19349 /*else*/ {
19350 __pyx_v_fmt = __Pyx_TypeInfoToFormat(__pyx_v_type);
19351
19352 /* "BufferFormatFromTypeInfo":1494
19353 * else:
19354 * fmt = __Pyx_TypeInfoToFormat(type)
19355 * result = fmt.string # <<<<<<<<<<<<<<
19356 * if type.arraysize[0]:
19357 * extents = [f"{type.arraysize[i]}" for i in range(type.ndim)]
19358*/
19359 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1494, __pyx_L1_error)
19360 __Pyx_GOTREF(__pyx_t_5);
19361 __pyx_v_result = ((PyObject*)__pyx_t_5);
19362 __pyx_t_5 = 0;
19363
19364 /* "BufferFormatFromTypeInfo":1495
19365 * fmt = __Pyx_TypeInfoToFormat(type)
19366 * result = fmt.string
19367 * if type.arraysize[0]: # <<<<<<<<<<<<<<
19368 * extents = [f"{type.arraysize[i]}" for i in range(type.ndim)]
19369 * result = f"({u','.join(extents)})".encode('ascii') + result
19370*/
19371 __pyx_t_1 = ((__pyx_v_type->arraysize[0]) != 0);
19372
19373 if (__pyx_t_1) {
19374
19375
19376 /* "BufferFormatFromTypeInfo":1496
19377 * result = fmt.string
19378 * if type.arraysize[0]:
19379 * extents = [f"{type.arraysize[i]}" for i in range(type.ndim)] # <<<<<<<<<<<<<<
19380 * result = f"({u','.join(extents)})".encode('ascii') + result
19381 *
19382*/
19383 { /* enter inner scope */
19384 __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1496, __pyx_L1_error)
19385 __Pyx_GOTREF(__pyx_t_5);
19386
19387 __pyx_t_7 = __pyx_v_type->ndim;
19388 __pyx_t_8 = __pyx_t_7;
19389
19390 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
19391 __pyx_7genexpr__pyx_v_i = __pyx_t_9;
19392 __pyx_t_4 = __Pyx_PyUnicode_From_size_t((__pyx_v_type->arraysize[__pyx_7genexpr__pyx_v_i]), 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1496, __pyx_L1_error)
19393 __Pyx_GOTREF(__pyx_t_4);
19394 __Pyx_GIVEREF(__pyx_t_4);
19395 if (unlikely(__Pyx_ListComp_AppendAndDecref(__pyx_t_5, __pyx_t_4))) __PYX_ERR(1, 1496, __pyx_L1_error)
19396 __pyx_t_4 = 0;
19397 }
19398
19399 } /* exit inner scope */
19400 __pyx_v_extents = ((PyObject*)__pyx_t_5);
19401 __pyx_t_5 = 0;
19402
19403 /* "BufferFormatFromTypeInfo":1497
19404 * if type.arraysize[0]:
19405 * extents = [f"{type.arraysize[i]}" for i in range(type.ndim)]
19406 * result = f"({u','.join(extents)})".encode('ascii') + result # <<<<<<<<<<<<<<
19407 *
19408 * return result
19409*/
19410 __pyx_t_5 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__10, __pyx_v_extents); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1497, __pyx_L1_error)
19411 __Pyx_GOTREF(__pyx_t_5);
19412 __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u__9;
19413 __pyx_t_10[1] = __pyx_t_5;
19414 __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u__11;
19415 __pyx_t_9 = 2;
19416 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
19417 __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10[1]);
19418 #endif
19419 __pyx_t_7 = 0;
19420 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
19421 __pyx_t_7 |= __Pyx_PyUnicode_KIND_04(__pyx_t_10[1]);
19422 #endif
19423 __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_10, 3, __pyx_t_9, __pyx_t_7);
19424 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1497, __pyx_L1_error)
19425 __Pyx_GOTREF(__pyx_t_4);
19426 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19427 __pyx_t_5 = PyUnicode_AsASCIIString(((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1497, __pyx_L1_error)
19428 __Pyx_GOTREF(__pyx_t_5);
19429 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19430 __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1497, __pyx_L1_error)
19431 __Pyx_GOTREF(__pyx_t_4);
19432 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19433 __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4));
19434 __pyx_t_4 = 0;
19435
19436 /* "BufferFormatFromTypeInfo":1495
19437 * fmt = __Pyx_TypeInfoToFormat(type)
19438 * result = fmt.string
19439 * if type.arraysize[0]: # <<<<<<<<<<<<<<
19440 * extents = [f"{type.arraysize[i]}" for i in range(type.ndim)]
19441 * result = f"({u','.join(extents)})".encode('ascii') + result
19442*/
19443 }
19444 }
19445 __pyx_L3:;
19446
19447 /* "BufferFormatFromTypeInfo":1499
19448 * result = f"({u','.join(extents)})".encode('ascii') + result
19449 *
19450 * return result # <<<<<<<<<<<<<<
19451*/
19452 {
19453 PyObject *__pyx_temp;
19454 {
19455 __pyx_temp = __pyx_r;
19456 __Pyx_INCREF(__pyx_v_result);
19457 __pyx_r = __pyx_v_result;
19458 }
19459 __Pyx_XDECREF(__pyx_temp);
19460 }
19461 goto __pyx_L0;
19462
19463 /* "BufferFormatFromTypeInfo":1467
19464 *
19465 *
19466 * @cname('__pyx_format_from_typeinfo') # <<<<<<<<<<<<<<
19467 * cdef bytes format_from_typeinfo(const __Pyx_TypeInfo *type):
19468 * cdef const __Pyx_StructField *field
19469*/
19470
19471 /* function exit code */
19472 __pyx_L1_error:;
19473 __Pyx_XDECREF(__pyx_t_2);
19474 __Pyx_XDECREF(__pyx_t_4);
19475 __Pyx_XDECREF(__pyx_t_5);
19476 __Pyx_AddTraceback("BufferFormatFromTypeInfo.format_from_typeinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
19477 __pyx_r = 0;
19478 __pyx_L0:;
19479
19480
19481 __Pyx_XDECREF(__pyx_v_part);
19482 __Pyx_XDECREF(__pyx_v_result);
19483 __Pyx_XDECREF(__pyx_v_alignment);
19484 __Pyx_XDECREF(__pyx_v_parts);
19485 __Pyx_XDECREF(__pyx_v_extents);
19486
19487 __Pyx_XGIVEREF(__pyx_r);
19488 __Pyx_RefNannyFinishContext();
19489 return __pyx_r;
19490}
19491
19492/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":230
19493 *
19494 * ctypedef class numpy.dtype [object PyArray_Descr, check_size ignore]:
19495 * @property # <<<<<<<<<<<<<<
19496 * cdef inline PyTypeObject* typeobj(self) noexcept nogil:
19497 * return PyDataType_TYPEOBJ(self)
19498*/
19499
19500static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self) {
19501 PyTypeObject *__pyx_r;
19502
19503 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":232
19504 * @property
19505 * cdef inline PyTypeObject* typeobj(self) noexcept nogil:
19506 * return PyDataType_TYPEOBJ(self) # <<<<<<<<<<<<<<
19507 *
19508 * @property
19509*/
19510 {
19511
19512 __pyx_r = PyDataType_TYPEOBJ(__pyx_v_self);
19513 }
19514 goto __pyx_L0;
19515
19516 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":230
19517 *
19518 * ctypedef class numpy.dtype [object PyArray_Descr, check_size ignore]:
19519 * @property # <<<<<<<<<<<<<<
19520 * cdef inline PyTypeObject* typeobj(self) noexcept nogil:
19521 * return PyDataType_TYPEOBJ(self)
19522*/
19523
19524 /* function exit code */
19525 __pyx_L0:;
19526 return __pyx_r;
19527}
19528
19529/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":234
19530 * return PyDataType_TYPEOBJ(self)
19531 *
19532 * @property # <<<<<<<<<<<<<<
19533 * cdef inline char kind(self) noexcept nogil:
19534 * return PyDataType_KIND(self)
19535*/
19536
19537static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self) {
19538 char __pyx_r;
19539
19540 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":236
19541 * @property
19542 * cdef inline char kind(self) noexcept nogil:
19543 * return PyDataType_KIND(self) # <<<<<<<<<<<<<<
19544 *
19545 * @property
19546*/
19547 {
19548
19549 __pyx_r = PyDataType_KIND(__pyx_v_self);
19550 }
19551 goto __pyx_L0;
19552
19553 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":234
19554 * return PyDataType_TYPEOBJ(self)
19555 *
19556 * @property # <<<<<<<<<<<<<<
19557 * cdef inline char kind(self) noexcept nogil:
19558 * return PyDataType_KIND(self)
19559*/
19560
19561 /* function exit code */
19562 __pyx_L0:;
19563 return __pyx_r;
19564}
19565
19566/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":238
19567 * return PyDataType_KIND(self)
19568 *
19569 * @property # <<<<<<<<<<<<<<
19570 * cdef inline char type(self) noexcept nogil:
19571 * return PyDataType_TYPE(self)
19572*/
19573
19574static CYTHON_INLINE char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self) {
19575 char __pyx_r;
19576
19577 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":240
19578 * @property
19579 * cdef inline char type(self) noexcept nogil:
19580 * return PyDataType_TYPE(self) # <<<<<<<<<<<<<<
19581 *
19582 * # Numpy sometimes mutates this without warning (e.g. it'll
19583*/
19584 {
19585
19586 __pyx_r = PyDataType_TYPE(__pyx_v_self);
19587 }
19588 goto __pyx_L0;
19589
19590 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":238
19591 * return PyDataType_KIND(self)
19592 *
19593 * @property # <<<<<<<<<<<<<<
19594 * cdef inline char type(self) noexcept nogil:
19595 * return PyDataType_TYPE(self)
19596*/
19597
19598 /* function exit code */
19599 __pyx_L0:;
19600 return __pyx_r;
19601}
19602
19603/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":247
19604 * # PyArray_IsNativeByteOrder(dtype.byteorder) instead of
19605 * # directly accessing this field.
19606 * @property # <<<<<<<<<<<<<<
19607 * cdef inline char byteorder(self) noexcept nogil:
19608 * return PyDataType_BYTEORDER(self)
19609*/
19610
19611static CYTHON_INLINE char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self) {
19612 char __pyx_r;
19613
19614 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":249
19615 * @property
19616 * cdef inline char byteorder(self) noexcept nogil:
19617 * return PyDataType_BYTEORDER(self) # <<<<<<<<<<<<<<
19618 *
19619 * @property
19620*/
19621 {
19622
19623 __pyx_r = PyDataType_BYTEORDER(__pyx_v_self);
19624 }
19625 goto __pyx_L0;
19626
19627 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":247
19628 * # PyArray_IsNativeByteOrder(dtype.byteorder) instead of
19629 * # directly accessing this field.
19630 * @property # <<<<<<<<<<<<<<
19631 * cdef inline char byteorder(self) noexcept nogil:
19632 * return PyDataType_BYTEORDER(self)
19633*/
19634
19635 /* function exit code */
19636 __pyx_L0:;
19637 return __pyx_r;
19638}
19639
19640/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":251
19641 * return PyDataType_BYTEORDER(self)
19642 *
19643 * @property # <<<<<<<<<<<<<<
19644 * cdef inline int type_num(self) noexcept nogil:
19645 * return PyDataType_TYPENUM(self)
19646*/
19647
19648static CYTHON_INLINE int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self) {
19649 int __pyx_r;
19650
19651 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":253
19652 * @property
19653 * cdef inline int type_num(self) noexcept nogil:
19654 * return PyDataType_TYPENUM(self) # <<<<<<<<<<<<<<
19655 *
19656 * @property
19657*/
19658 {
19659
19660 __pyx_r = PyDataType_TYPENUM(__pyx_v_self);
19661 }
19662 goto __pyx_L0;
19663
19664 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":251
19665 * return PyDataType_BYTEORDER(self)
19666 *
19667 * @property # <<<<<<<<<<<<<<
19668 * cdef inline int type_num(self) noexcept nogil:
19669 * return PyDataType_TYPENUM(self)
19670*/
19671
19672 /* function exit code */
19673 __pyx_L0:;
19674 return __pyx_r;
19675}
19676
19677/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":255
19678 * return PyDataType_TYPENUM(self)
19679 *
19680 * @property # <<<<<<<<<<<<<<
19681 * cdef inline npy_intp itemsize(self) noexcept nogil:
19682 * return PyDataType_ELSIZE(self)
19683*/
19684
19685static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self) {
19686 npy_intp __pyx_r;
19687
19688 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":257
19689 * @property
19690 * cdef inline npy_intp itemsize(self) noexcept nogil:
19691 * return PyDataType_ELSIZE(self) # <<<<<<<<<<<<<<
19692 *
19693 * @property
19694*/
19695 {
19696
19697 __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
19698 }
19699 goto __pyx_L0;
19700
19701 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":255
19702 * return PyDataType_TYPENUM(self)
19703 *
19704 * @property # <<<<<<<<<<<<<<
19705 * cdef inline npy_intp itemsize(self) noexcept nogil:
19706 * return PyDataType_ELSIZE(self)
19707*/
19708
19709 /* function exit code */
19710 __pyx_L0:;
19711 return __pyx_r;
19712}
19713
19714/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":259
19715 * return PyDataType_ELSIZE(self)
19716 *
19717 * @property # <<<<<<<<<<<<<<
19718 * cdef inline npy_intp alignment(self) noexcept nogil:
19719 * return PyDataType_ALIGNMENT(self)
19720*/
19721
19722static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self) {
19723 npy_intp __pyx_r;
19724
19725 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":261
19726 * @property
19727 * cdef inline npy_intp alignment(self) noexcept nogil:
19728 * return PyDataType_ALIGNMENT(self) # <<<<<<<<<<<<<<
19729 *
19730 * # Use fields/names with care as they may be NULL. You must check
19731*/
19732 {
19733
19734 __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
19735 }
19736 goto __pyx_L0;
19737
19738 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":259
19739 * return PyDataType_ELSIZE(self)
19740 *
19741 * @property # <<<<<<<<<<<<<<
19742 * cdef inline npy_intp alignment(self) noexcept nogil:
19743 * return PyDataType_ALIGNMENT(self)
19744*/
19745
19746 /* function exit code */
19747 __pyx_L0:;
19748 return __pyx_r;
19749}
19750
19751/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":265
19752 * # Use fields/names with care as they may be NULL. You must check
19753 * # for this using PyDataType_HASFIELDS.
19754 * @property # <<<<<<<<<<<<<<
19755 * cdef inline object fields(self):
19756 * return <object>PyDataType_FIELDS(self)
19757*/
19758
19759static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields___get__(PyArray_Descr *__pyx_v_self) {
19760 PyObject *__pyx_r = NULL;
19761 __Pyx_RefNannyDeclarations
19762 PyObject *__pyx_t_1;
19763 __Pyx_RefNannySetupContext("__get__", 0);
19764
19765 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":267
19766 * @property
19767 * cdef inline object fields(self):
19768 * return <object>PyDataType_FIELDS(self) # <<<<<<<<<<<<<<
19769 *
19770 * @property
19771*/
19772 __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
19773
19774 {
19775 PyObject *__pyx_temp;
19776 {
19777 __pyx_temp = __pyx_r;
19778 __Pyx_INCREF(((PyObject *)__pyx_t_1));
19779 __pyx_r = ((PyObject *)__pyx_t_1);
19780 }
19781 __Pyx_XDECREF(__pyx_temp);
19782 }
19783
19784 goto __pyx_L0;
19785
19786 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":265
19787 * # Use fields/names with care as they may be NULL. You must check
19788 * # for this using PyDataType_HASFIELDS.
19789 * @property # <<<<<<<<<<<<<<
19790 * cdef inline object fields(self):
19791 * return <object>PyDataType_FIELDS(self)
19792*/
19793
19794 /* function exit code */
19795 __pyx_L0:;
19796 __Pyx_XGIVEREF(__pyx_r);
19797 __Pyx_RefNannyFinishContext();
19798 return __pyx_r;
19799}
19800
19801/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":269
19802 * return <object>PyDataType_FIELDS(self)
19803 *
19804 * @property # <<<<<<<<<<<<<<
19805 * cdef inline tuple names(self):
19806 * return <tuple>PyDataType_NAMES(self)
19807*/
19808
19809static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names___get__(PyArray_Descr *__pyx_v_self) {
19810 PyObject *__pyx_r = NULL;
19811 __Pyx_RefNannyDeclarations
19812 PyObject *__pyx_t_1;
19813 __Pyx_RefNannySetupContext("__get__", 0);
19814
19815 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":271
19816 * @property
19817 * cdef inline tuple names(self):
19818 * return <tuple>PyDataType_NAMES(self) # <<<<<<<<<<<<<<
19819 *
19820 * # Use PyDataType_HASSUBARRAY to test whether this field is
19821*/
19822 __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
19823
19824 {
19825 PyObject *__pyx_temp;
19826 {
19827 __pyx_temp = __pyx_r;
19828 __Pyx_INCREF(((PyObject*)__pyx_t_1));
19829 __pyx_r = ((PyObject*)__pyx_t_1);
19830 }
19831 __Pyx_XDECREF(__pyx_temp);
19832 }
19833
19834 goto __pyx_L0;
19835
19836 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":269
19837 * return <object>PyDataType_FIELDS(self)
19838 *
19839 * @property # <<<<<<<<<<<<<<
19840 * cdef inline tuple names(self):
19841 * return <tuple>PyDataType_NAMES(self)
19842*/
19843
19844 /* function exit code */
19845 __pyx_L0:;
19846 __Pyx_XGIVEREF(__pyx_r);
19847 __Pyx_RefNannyFinishContext();
19848 return __pyx_r;
19849}
19850
19851/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":276
19852 * # valid (the pointer can be NULL). Most users should access
19853 * # this field via the inline helper method PyDataType_SHAPE.
19854 * @property # <<<<<<<<<<<<<<
19855 * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
19856 * return PyDataType_SUBARRAY(self)
19857*/
19858
19859static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self) {
19860 PyArray_ArrayDescr *__pyx_r;
19861
19862 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":278
19863 * @property
19864 * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
19865 * return PyDataType_SUBARRAY(self) # <<<<<<<<<<<<<<
19866 *
19867 * @property
19868*/
19869 {
19870
19871 __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
19872 }
19873 goto __pyx_L0;
19874
19875 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":276
19876 * # valid (the pointer can be NULL). Most users should access
19877 * # this field via the inline helper method PyDataType_SHAPE.
19878 * @property # <<<<<<<<<<<<<<
19879 * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
19880 * return PyDataType_SUBARRAY(self)
19881*/
19882
19883 /* function exit code */
19884 __pyx_L0:;
19885 return __pyx_r;
19886}
19887
19888/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":280
19889 * return PyDataType_SUBARRAY(self)
19890 *
19891 * @property # <<<<<<<<<<<<<<
19892 * cdef inline npy_uint64 flags(self) noexcept nogil:
19893 * """The data types flags."""
19894*/
19895
19896static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self) {
19897 npy_uint64 __pyx_r;
19898
19899 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":283
19900 * cdef inline npy_uint64 flags(self) noexcept nogil:
19901 * """The data types flags."""
19902 * return PyDataType_FLAGS(self) # <<<<<<<<<<<<<<
19903 *
19904 *
19905*/
19906 {
19907
19908 __pyx_r = PyDataType_FLAGS(__pyx_v_self);
19909 }
19910 goto __pyx_L0;
19911
19912 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":280
19913 * return PyDataType_SUBARRAY(self)
19914 *
19915 * @property # <<<<<<<<<<<<<<
19916 * cdef inline npy_uint64 flags(self) noexcept nogil:
19917 * """The data types flags."""
19918*/
19919
19920 /* function exit code */
19921 __pyx_L0:;
19922 return __pyx_r;
19923}
19924
19925/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":292
19926 * ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]:
19927 *
19928 * @property # <<<<<<<<<<<<<<
19929 * cdef inline int numiter(self) noexcept nogil:
19930 * """The number of arrays that need to be broadcast to the same shape."""
19931*/
19932
19933static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self) {
19934 int __pyx_r;
19935
19936 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":295
19937 * cdef inline int numiter(self) noexcept nogil:
19938 * """The number of arrays that need to be broadcast to the same shape."""
19939 * return PyArray_MultiIter_NUMITER(self) # <<<<<<<<<<<<<<
19940 *
19941 * @property
19942*/
19943 {
19944
19945 __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
19946 }
19947 goto __pyx_L0;
19948
19949 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":292
19950 * ctypedef class numpy.broadcast [object PyArrayMultiIterObject, check_size ignore]:
19951 *
19952 * @property # <<<<<<<<<<<<<<
19953 * cdef inline int numiter(self) noexcept nogil:
19954 * """The number of arrays that need to be broadcast to the same shape."""
19955*/
19956
19957 /* function exit code */
19958 __pyx_L0:;
19959 return __pyx_r;
19960}
19961
19962/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":297
19963 * return PyArray_MultiIter_NUMITER(self)
19964 *
19965 * @property # <<<<<<<<<<<<<<
19966 * cdef inline npy_intp size(self) noexcept nogil:
19967 * """The total broadcasted size."""
19968*/
19969
19970static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self) {
19971 npy_intp __pyx_r;
19972
19973 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":300
19974 * cdef inline npy_intp size(self) noexcept nogil:
19975 * """The total broadcasted size."""
19976 * return PyArray_MultiIter_SIZE(self) # <<<<<<<<<<<<<<
19977 *
19978 * @property
19979*/
19980 {
19981
19982 __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
19983 }
19984 goto __pyx_L0;
19985
19986 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":297
19987 * return PyArray_MultiIter_NUMITER(self)
19988 *
19989 * @property # <<<<<<<<<<<<<<
19990 * cdef inline npy_intp size(self) noexcept nogil:
19991 * """The total broadcasted size."""
19992*/
19993
19994 /* function exit code */
19995 __pyx_L0:;
19996 return __pyx_r;
19997}
19998
19999/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":302
20000 * return PyArray_MultiIter_SIZE(self)
20001 *
20002 * @property # <<<<<<<<<<<<<<
20003 * cdef inline npy_intp index(self) noexcept nogil:
20004 * """The current (1-d) index into the broadcasted result."""
20005*/
20006
20007static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self) {
20008 npy_intp __pyx_r;
20009
20010 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":305
20011 * cdef inline npy_intp index(self) noexcept nogil:
20012 * """The current (1-d) index into the broadcasted result."""
20013 * return PyArray_MultiIter_INDEX(self) # <<<<<<<<<<<<<<
20014 *
20015 * @property
20016*/
20017 {
20018
20019 __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
20020 }
20021 goto __pyx_L0;
20022
20023 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":302
20024 * return PyArray_MultiIter_SIZE(self)
20025 *
20026 * @property # <<<<<<<<<<<<<<
20027 * cdef inline npy_intp index(self) noexcept nogil:
20028 * """The current (1-d) index into the broadcasted result."""
20029*/
20030
20031 /* function exit code */
20032 __pyx_L0:;
20033 return __pyx_r;
20034}
20035
20036/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":307
20037 * return PyArray_MultiIter_INDEX(self)
20038 *
20039 * @property # <<<<<<<<<<<<<<
20040 * cdef inline int nd(self) noexcept nogil:
20041 * """The number of dimensions in the broadcasted result."""
20042*/
20043
20044static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self) {
20045 int __pyx_r;
20046
20047 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":310
20048 * cdef inline int nd(self) noexcept nogil:
20049 * """The number of dimensions in the broadcasted result."""
20050 * return PyArray_MultiIter_NDIM(self) # <<<<<<<<<<<<<<
20051 *
20052 * @property
20053*/
20054 {
20055
20056 __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
20057 }
20058 goto __pyx_L0;
20059
20060 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":307
20061 * return PyArray_MultiIter_INDEX(self)
20062 *
20063 * @property # <<<<<<<<<<<<<<
20064 * cdef inline int nd(self) noexcept nogil:
20065 * """The number of dimensions in the broadcasted result."""
20066*/
20067
20068 /* function exit code */
20069 __pyx_L0:;
20070 return __pyx_r;
20071}
20072
20073/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":312
20074 * return PyArray_MultiIter_NDIM(self)
20075 *
20076 * @property # <<<<<<<<<<<<<<
20077 * cdef inline npy_intp* dimensions(self) noexcept nogil:
20078 * """The shape of the broadcasted result."""
20079*/
20080
20081static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self) {
20082 npy_intp *__pyx_r;
20083
20084 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":315
20085 * cdef inline npy_intp* dimensions(self) noexcept nogil:
20086 * """The shape of the broadcasted result."""
20087 * return PyArray_MultiIter_DIMS(self) # <<<<<<<<<<<<<<
20088 *
20089 * @property
20090*/
20091 {
20092
20093 __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
20094 }
20095 goto __pyx_L0;
20096
20097 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":312
20098 * return PyArray_MultiIter_NDIM(self)
20099 *
20100 * @property # <<<<<<<<<<<<<<
20101 * cdef inline npy_intp* dimensions(self) noexcept nogil:
20102 * """The shape of the broadcasted result."""
20103*/
20104
20105 /* function exit code */
20106 __pyx_L0:;
20107 return __pyx_r;
20108}
20109
20110/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":317
20111 * return PyArray_MultiIter_DIMS(self)
20112 *
20113 * @property # <<<<<<<<<<<<<<
20114 * cdef inline void** iters(self) noexcept nogil:
20115 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
20116*/
20117
20118static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self) {
20119 void **__pyx_r;
20120
20121 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":321
20122 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
20123 * On return, the iterators are adjusted for broadcasting."""
20124 * return PyArray_MultiIter_ITERS(self) # <<<<<<<<<<<<<<
20125 *
20126 *
20127*/
20128 {
20129
20130 __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
20131 }
20132 goto __pyx_L0;
20133
20134 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":317
20135 * return PyArray_MultiIter_DIMS(self)
20136 *
20137 * @property # <<<<<<<<<<<<<<
20138 * cdef inline void** iters(self) noexcept nogil:
20139 * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
20140*/
20141
20142 /* function exit code */
20143 __pyx_L0:;
20144 return __pyx_r;
20145}
20146
20147/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":335
20148 * # Instead, we use properties that map to the corresponding C-API functions.
20149 *
20150 * @property # <<<<<<<<<<<<<<
20151 * cdef inline PyObject* base(self) noexcept nogil:
20152 * """Returns a borrowed reference to the object owning the data/memory.
20153*/
20154
20155static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self) {
20156 PyObject *__pyx_r;
20157
20158 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":339
20159 * """Returns a borrowed reference to the object owning the data/memory.
20160 * """
20161 * return PyArray_BASE(self) # <<<<<<<<<<<<<<
20162 *
20163 * @property
20164*/
20165 {
20166
20167 __pyx_r = PyArray_BASE(__pyx_v_self);
20168 }
20169 goto __pyx_L0;
20170
20171 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":335
20172 * # Instead, we use properties that map to the corresponding C-API functions.
20173 *
20174 * @property # <<<<<<<<<<<<<<
20175 * cdef inline PyObject* base(self) noexcept nogil:
20176 * """Returns a borrowed reference to the object owning the data/memory.
20177*/
20178
20179 /* function exit code */
20180 __pyx_L0:;
20181 return __pyx_r;
20182}
20183
20184/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":341
20185 * return PyArray_BASE(self)
20186 *
20187 * @property # <<<<<<<<<<<<<<
20188 * cdef inline dtype descr(self):
20189 * """Returns an owned reference to the dtype of the array.
20190*/
20191
20192static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr___get__(PyArrayObject *__pyx_v_self) {
20193 PyArray_Descr *__pyx_r = NULL;
20194 __Pyx_RefNannyDeclarations
20195 PyArray_Descr *__pyx_t_1;
20196 __Pyx_RefNannySetupContext("__get__", 0);
20197
20198 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":345
20199 * """Returns an owned reference to the dtype of the array.
20200 * """
20201 * return <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
20202 *
20203 * @property
20204*/
20205 __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
20206
20207 {
20208 PyArray_Descr *__pyx_temp;
20209 {
20210 __pyx_temp = __pyx_r;
20211 __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
20212 __pyx_r = ((PyArray_Descr *)__pyx_t_1);
20213 }
20214 __Pyx_XDECREF((PyObject *)__pyx_temp);
20215 }
20216
20217 goto __pyx_L0;
20218
20219 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":341
20220 * return PyArray_BASE(self)
20221 *
20222 * @property # <<<<<<<<<<<<<<
20223 * cdef inline dtype descr(self):
20224 * """Returns an owned reference to the dtype of the array.
20225*/
20226
20227 /* function exit code */
20228 __pyx_L0:;
20229 __Pyx_XGIVEREF((PyObject *)__pyx_r);
20230 __Pyx_RefNannyFinishContext();
20231 return __pyx_r;
20232}
20233
20234/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":347
20235 * return <dtype>PyArray_DESCR(self)
20236 *
20237 * @property # <<<<<<<<<<<<<<
20238 * cdef inline int ndim(self) noexcept nogil:
20239 * """Returns the number of dimensions in the array.
20240*/
20241
20242static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self) {
20243 int __pyx_r;
20244
20245 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":351
20246 * """Returns the number of dimensions in the array.
20247 * """
20248 * return PyArray_NDIM(self) # <<<<<<<<<<<<<<
20249 *
20250 * @property
20251*/
20252 {
20253
20254 __pyx_r = PyArray_NDIM(__pyx_v_self);
20255 }
20256 goto __pyx_L0;
20257
20258 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":347
20259 * return <dtype>PyArray_DESCR(self)
20260 *
20261 * @property # <<<<<<<<<<<<<<
20262 * cdef inline int ndim(self) noexcept nogil:
20263 * """Returns the number of dimensions in the array.
20264*/
20265
20266 /* function exit code */
20267 __pyx_L0:;
20268 return __pyx_r;
20269}
20270
20271/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":353
20272 * return PyArray_NDIM(self)
20273 *
20274 * @property # <<<<<<<<<<<<<<
20275 * cdef inline npy_intp *shape(self) noexcept nogil:
20276 * """Returns a pointer to the dimensions/shape of the array.
20277*/
20278
20279static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self) {
20280 npy_intp *__pyx_r;
20281
20282 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":359
20283 * Can return NULL for 0-dimensional arrays.
20284 * """
20285 * return PyArray_DIMS(self) # <<<<<<<<<<<<<<
20286 *
20287 * @property
20288*/
20289 {
20290
20291 __pyx_r = PyArray_DIMS(__pyx_v_self);
20292 }
20293 goto __pyx_L0;
20294
20295 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":353
20296 * return PyArray_NDIM(self)
20297 *
20298 * @property # <<<<<<<<<<<<<<
20299 * cdef inline npy_intp *shape(self) noexcept nogil:
20300 * """Returns a pointer to the dimensions/shape of the array.
20301*/
20302
20303 /* function exit code */
20304 __pyx_L0:;
20305 return __pyx_r;
20306}
20307
20308/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":361
20309 * return PyArray_DIMS(self)
20310 *
20311 * @property # <<<<<<<<<<<<<<
20312 * cdef inline npy_intp *strides(self) noexcept nogil:
20313 * """Returns a pointer to the strides of the array.
20314*/
20315
20316static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self) {
20317 npy_intp *__pyx_r;
20318
20319 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":366
20320 * The number of elements matches the number of dimensions of the array (ndim).
20321 * """
20322 * return PyArray_STRIDES(self) # <<<<<<<<<<<<<<
20323 *
20324 * @property
20325*/
20326 {
20327
20328 __pyx_r = PyArray_STRIDES(__pyx_v_self);
20329 }
20330 goto __pyx_L0;
20331
20332 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":361
20333 * return PyArray_DIMS(self)
20334 *
20335 * @property # <<<<<<<<<<<<<<
20336 * cdef inline npy_intp *strides(self) noexcept nogil:
20337 * """Returns a pointer to the strides of the array.
20338*/
20339
20340 /* function exit code */
20341 __pyx_L0:;
20342 return __pyx_r;
20343}
20344
20345/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":368
20346 * return PyArray_STRIDES(self)
20347 *
20348 * @property # <<<<<<<<<<<<<<
20349 * cdef inline npy_intp size(self) noexcept nogil:
20350 * """Returns the total size (in number of elements) of the array.
20351*/
20352
20353static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self) {
20354 npy_intp __pyx_r;
20355
20356 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":372
20357 * """Returns the total size (in number of elements) of the array.
20358 * """
20359 * return PyArray_SIZE(self) # <<<<<<<<<<<<<<
20360 *
20361 * @property
20362*/
20363 {
20364
20365 __pyx_r = PyArray_SIZE(__pyx_v_self);
20366 }
20367 goto __pyx_L0;
20368
20369 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":368
20370 * return PyArray_STRIDES(self)
20371 *
20372 * @property # <<<<<<<<<<<<<<
20373 * cdef inline npy_intp size(self) noexcept nogil:
20374 * """Returns the total size (in number of elements) of the array.
20375*/
20376
20377 /* function exit code */
20378 __pyx_L0:;
20379 return __pyx_r;
20380}
20381
20382/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":374
20383 * return PyArray_SIZE(self)
20384 *
20385 * @property # <<<<<<<<<<<<<<
20386 * cdef inline char* data(self) noexcept nogil:
20387 * """The pointer to the data buffer as a char*.
20388*/
20389
20390static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self) {
20391 char *__pyx_r;
20392
20393 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":381
20394 * of `PyArray_DATA()` instead, which returns a 'void*'.
20395 * """
20396 * return PyArray_BYTES(self) # <<<<<<<<<<<<<<
20397 *
20398 *
20399*/
20400 {
20401
20402 __pyx_r = PyArray_BYTES(__pyx_v_self);
20403 }
20404 goto __pyx_L0;
20405
20406 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":374
20407 * return PyArray_SIZE(self)
20408 *
20409 * @property # <<<<<<<<<<<<<<
20410 * cdef inline char* data(self) noexcept nogil:
20411 * """The pointer to the data buffer as a char*.
20412*/
20413
20414 /* function exit code */
20415 __pyx_L0:;
20416 return __pyx_r;
20417}
20418
20419/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":794
20420 * ctypedef long double complex clongdouble_t
20421 *
20422 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
20423 * return PyArray_MultiIterNew(1, <void*>a)
20424 *
20425*/
20426
20427static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
20428 PyObject *__pyx_r = NULL;
20429 __Pyx_RefNannyDeclarations
20430 PyObject *__pyx_t_1 = NULL;
20431 int __pyx_lineno = 0;
20432 const char *__pyx_filename = NULL;
20433 int __pyx_clineno = 0;
20434 __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
20435
20436 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":795
20437 *
20438 * cdef inline object PyArray_MultiIterNew1(a):
20439 * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
20440 *
20441 * cdef inline object PyArray_MultiIterNew2(a, b):
20442*/
20443 __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 795, __pyx_L1_error)
20444 __Pyx_GOTREF(__pyx_t_1);
20445 {
20446 PyObject *__pyx_temp;
20447 {
20448 __pyx_temp = __pyx_r;
20449 __pyx_r = __pyx_t_1;
20450 }
20451 __Pyx_XDECREF(__pyx_temp);
20452 }
20453 __pyx_t_1 = 0;
20454 goto __pyx_L0;
20455
20456 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":794
20457 * ctypedef long double complex clongdouble_t
20458 *
20459 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
20460 * return PyArray_MultiIterNew(1, <void*>a)
20461 *
20462*/
20463
20464 /* function exit code */
20465 __pyx_L1_error:;
20466 __Pyx_XDECREF(__pyx_t_1);
20467 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
20468 __pyx_r = 0;
20469 __pyx_L0:;
20470 __Pyx_XGIVEREF(__pyx_r);
20471 __Pyx_RefNannyFinishContext();
20472 return __pyx_r;
20473}
20474
20475/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":797
20476 * return PyArray_MultiIterNew(1, <void*>a)
20477 *
20478 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
20479 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
20480 *
20481*/
20482
20483static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
20484 PyObject *__pyx_r = NULL;
20485 __Pyx_RefNannyDeclarations
20486 PyObject *__pyx_t_1 = NULL;
20487 int __pyx_lineno = 0;
20488 const char *__pyx_filename = NULL;
20489 int __pyx_clineno = 0;
20490 __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
20491
20492 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":798
20493 *
20494 * cdef inline object PyArray_MultiIterNew2(a, b):
20495 * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
20496 *
20497 * cdef inline object PyArray_MultiIterNew3(a, b, c):
20498*/
20499 __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 798, __pyx_L1_error)
20500 __Pyx_GOTREF(__pyx_t_1);
20501 {
20502 PyObject *__pyx_temp;
20503 {
20504 __pyx_temp = __pyx_r;
20505 __pyx_r = __pyx_t_1;
20506 }
20507 __Pyx_XDECREF(__pyx_temp);
20508 }
20509 __pyx_t_1 = 0;
20510 goto __pyx_L0;
20511
20512 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":797
20513 * return PyArray_MultiIterNew(1, <void*>a)
20514 *
20515 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
20516 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
20517 *
20518*/
20519
20520 /* function exit code */
20521 __pyx_L1_error:;
20522 __Pyx_XDECREF(__pyx_t_1);
20523 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
20524 __pyx_r = 0;
20525 __pyx_L0:;
20526 __Pyx_XGIVEREF(__pyx_r);
20527 __Pyx_RefNannyFinishContext();
20528 return __pyx_r;
20529}
20530
20531/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":800
20532 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
20533 *
20534 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
20535 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
20536 *
20537*/
20538
20539static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
20540 PyObject *__pyx_r = NULL;
20541 __Pyx_RefNannyDeclarations
20542 PyObject *__pyx_t_1 = NULL;
20543 int __pyx_lineno = 0;
20544 const char *__pyx_filename = NULL;
20545 int __pyx_clineno = 0;
20546 __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
20547
20548 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":801
20549 *
20550 * cdef inline object PyArray_MultiIterNew3(a, b, c):
20551 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
20552 *
20553 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
20554*/
20555 __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(2, 801, __pyx_L1_error)
20556 __Pyx_GOTREF(__pyx_t_1);
20557 {
20558 PyObject *__pyx_temp;
20559 {
20560 __pyx_temp = __pyx_r;
20561 __pyx_r = __pyx_t_1;
20562 }
20563 __Pyx_XDECREF(__pyx_temp);
20564 }
20565 __pyx_t_1 = 0;
20566 goto __pyx_L0;
20567
20568 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":800
20569 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
20570 *
20571 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
20572 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
20573 *
20574*/
20575
20576 /* function exit code */
20577 __pyx_L1_error:;
20578 __Pyx_XDECREF(__pyx_t_1);
20579 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
20580 __pyx_r = 0;
20581 __pyx_L0:;
20582 __Pyx_XGIVEREF(__pyx_r);
20583 __Pyx_RefNannyFinishContext();
20584 return __pyx_r;
20585}
20586
20587/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":803
20588 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
20589 *
20590 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
20591 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
20592 *
20593*/
20594
20595static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
20596 PyObject *__pyx_r = NULL;
20597 __Pyx_RefNannyDeclarations
20598 PyObject *__pyx_t_1 = NULL;
20599 int __pyx_lineno = 0;
20600 const char *__pyx_filename = NULL;
20601 int __pyx_clineno = 0;
20602 __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
20603
20604 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":804
20605 *
20606 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
20607 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
20608 *
20609 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
20610*/
20611 __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(2, 804, __pyx_L1_error)
20612 __Pyx_GOTREF(__pyx_t_1);
20613 {
20614 PyObject *__pyx_temp;
20615 {
20616 __pyx_temp = __pyx_r;
20617 __pyx_r = __pyx_t_1;
20618 }
20619 __Pyx_XDECREF(__pyx_temp);
20620 }
20621 __pyx_t_1 = 0;
20622 goto __pyx_L0;
20623
20624 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":803
20625 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
20626 *
20627 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
20628 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
20629 *
20630*/
20631
20632 /* function exit code */
20633 __pyx_L1_error:;
20634 __Pyx_XDECREF(__pyx_t_1);
20635 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
20636 __pyx_r = 0;
20637 __pyx_L0:;
20638 __Pyx_XGIVEREF(__pyx_r);
20639 __Pyx_RefNannyFinishContext();
20640 return __pyx_r;
20641}
20642
20643/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":806
20644 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
20645 *
20646 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
20647 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20648 *
20649*/
20650
20651static 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) {
20652 PyObject *__pyx_r = NULL;
20653 __Pyx_RefNannyDeclarations
20654 PyObject *__pyx_t_1 = NULL;
20655 int __pyx_lineno = 0;
20656 const char *__pyx_filename = NULL;
20657 int __pyx_clineno = 0;
20658 __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
20659
20660 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":807
20661 *
20662 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
20663 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
20664 *
20665 * cdef inline tuple PyDataType_SHAPE(dtype d):
20666*/
20667 __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(2, 807, __pyx_L1_error)
20668 __Pyx_GOTREF(__pyx_t_1);
20669 {
20670 PyObject *__pyx_temp;
20671 {
20672 __pyx_temp = __pyx_r;
20673 __pyx_r = __pyx_t_1;
20674 }
20675 __Pyx_XDECREF(__pyx_temp);
20676 }
20677 __pyx_t_1 = 0;
20678 goto __pyx_L0;
20679
20680 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":806
20681 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
20682 *
20683 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
20684 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20685 *
20686*/
20687
20688 /* function exit code */
20689 __pyx_L1_error:;
20690 __Pyx_XDECREF(__pyx_t_1);
20691 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
20692 __pyx_r = 0;
20693 __pyx_L0:;
20694 __Pyx_XGIVEREF(__pyx_r);
20695 __Pyx_RefNannyFinishContext();
20696 return __pyx_r;
20697}
20698
20699/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":809
20700 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20701 *
20702 * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
20703 * if PyDataType_HASSUBARRAY(d):
20704 * return <tuple>d.subarray.shape
20705*/
20706
20707static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
20708 PyObject *__pyx_r = NULL;
20709 __Pyx_RefNannyDeclarations
20710 int __pyx_t_1;
20711 PyObject *__pyx_t_2;
20712 __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
20713
20714 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":810
20715 *
20716 * cdef inline tuple PyDataType_SHAPE(dtype d):
20717 * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
20718 * return <tuple>d.subarray.shape
20719 * else:
20720*/
20721 __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
20722
20723 if (__pyx_t_1) {
20724
20725
20726 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":811
20727 * cdef inline tuple PyDataType_SHAPE(dtype d):
20728 * if PyDataType_HASSUBARRAY(d):
20729 * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
20730 * else:
20731 * return ()
20732*/
20733 __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray___get__(__pyx_v_d)->shape;
20734
20735 {
20736 PyObject *__pyx_temp;
20737 {
20738 __pyx_temp = __pyx_r;
20739 __Pyx_INCREF(((PyObject*)__pyx_t_2));
20740 __pyx_r = ((PyObject*)__pyx_t_2);
20741 }
20742 __Pyx_XDECREF(__pyx_temp);
20743 }
20744
20745 goto __pyx_L0;
20746
20747 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":810
20748 *
20749 * cdef inline tuple PyDataType_SHAPE(dtype d):
20750 * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
20751 * return <tuple>d.subarray.shape
20752 * else:
20753*/
20754 }
20755
20756 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":813
20757 * return <tuple>d.subarray.shape
20758 * else:
20759 * return () # <<<<<<<<<<<<<<
20760 *
20761 *
20762*/
20763 /*else*/ {
20764 {
20765 PyObject *__pyx_temp;
20766 {
20767 __pyx_temp = __pyx_r;
20768 __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
20769 __pyx_r = __pyx_mstate_global->__pyx_empty_tuple;
20770 }
20771 __Pyx_XDECREF(__pyx_temp);
20772 }
20773 goto __pyx_L0;
20774 }
20775
20776 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":809
20777 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20778 *
20779 * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
20780 * if PyDataType_HASSUBARRAY(d):
20781 * return <tuple>d.subarray.shape
20782*/
20783
20784 /* function exit code */
20785 __pyx_L0:;
20786 __Pyx_XGIVEREF(__pyx_r);
20787 __Pyx_RefNannyFinishContext();
20788 return __pyx_r;
20789}
20790
20791/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":947
20792 *
20793 * ctypedef class numpy.ufunc [object PyUFuncObject, check_size ignore]:
20794 * @property # <<<<<<<<<<<<<<
20795 * cdef inline int nin(self) noexcept nogil:
20796 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
20797*/
20798
20799static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self) {
20800 int __pyx_r;
20801
20802 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":949
20803 * @property
20804 * cdef inline int nin(self) noexcept nogil:
20805 * return _PyUFuncObject_GET_ITEM_DATA(self).nin # <<<<<<<<<<<<<<
20806 *
20807 * @property
20808*/
20809 {
20810
20811 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nin;
20812 }
20813 goto __pyx_L0;
20814
20815 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":947
20816 *
20817 * ctypedef class numpy.ufunc [object PyUFuncObject, check_size ignore]:
20818 * @property # <<<<<<<<<<<<<<
20819 * cdef inline int nin(self) noexcept nogil:
20820 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
20821*/
20822
20823 /* function exit code */
20824 __pyx_L0:;
20825 return __pyx_r;
20826}
20827
20828/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":951
20829 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
20830 *
20831 * @property # <<<<<<<<<<<<<<
20832 * cdef inline int nout(self) noexcept nogil:
20833 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
20834*/
20835
20836static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self) {
20837 int __pyx_r;
20838
20839 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":953
20840 * @property
20841 * cdef inline int nout(self) noexcept nogil:
20842 * return _PyUFuncObject_GET_ITEM_DATA(self).nout # <<<<<<<<<<<<<<
20843 *
20844 * @property
20845*/
20846 {
20847
20848 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nout;
20849 }
20850 goto __pyx_L0;
20851
20852 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":951
20853 * return _PyUFuncObject_GET_ITEM_DATA(self).nin
20854 *
20855 * @property # <<<<<<<<<<<<<<
20856 * cdef inline int nout(self) noexcept nogil:
20857 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
20858*/
20859
20860 /* function exit code */
20861 __pyx_L0:;
20862 return __pyx_r;
20863}
20864
20865/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":955
20866 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
20867 *
20868 * @property # <<<<<<<<<<<<<<
20869 * cdef inline int nargs(self) noexcept nogil:
20870 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
20871*/
20872
20873static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self) {
20874 int __pyx_r;
20875
20876 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":957
20877 * @property
20878 * cdef inline int nargs(self) noexcept nogil:
20879 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs # <<<<<<<<<<<<<<
20880 *
20881 * @property
20882*/
20883 {
20884
20885 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nargs;
20886 }
20887 goto __pyx_L0;
20888
20889 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":955
20890 * return _PyUFuncObject_GET_ITEM_DATA(self).nout
20891 *
20892 * @property # <<<<<<<<<<<<<<
20893 * cdef inline int nargs(self) noexcept nogil:
20894 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
20895*/
20896
20897 /* function exit code */
20898 __pyx_L0:;
20899 return __pyx_r;
20900}
20901
20902/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":959
20903 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
20904 *
20905 * @property # <<<<<<<<<<<<<<
20906 * cdef inline PyUFuncGenericFunction* functions(self) noexcept nogil:
20907 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
20908*/
20909
20910static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self) {
20911 PyUFuncGenericFunction *__pyx_r;
20912
20913 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":961
20914 * @property
20915 * cdef inline PyUFuncGenericFunction* functions(self) noexcept nogil:
20916 * return _PyUFuncObject_GET_ITEM_DATA(self).functions # <<<<<<<<<<<<<<
20917 *
20918 * @property
20919*/
20920 {
20921
20922 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->functions;
20923 }
20924 goto __pyx_L0;
20925
20926 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":959
20927 * return _PyUFuncObject_GET_ITEM_DATA(self).nargs
20928 *
20929 * @property # <<<<<<<<<<<<<<
20930 * cdef inline PyUFuncGenericFunction* functions(self) noexcept nogil:
20931 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
20932*/
20933
20934 /* function exit code */
20935 __pyx_L0:;
20936 return __pyx_r;
20937}
20938
20939/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":963
20940 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
20941 *
20942 * @property # <<<<<<<<<<<<<<
20943 * cdef inline void ** data(self) noexcept nogil:
20944 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
20945*/
20946
20947static CYTHON_INLINE void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self) {
20948 void **__pyx_r;
20949
20950 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":965
20951 * @property
20952 * cdef inline void ** data(self) noexcept nogil:
20953 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data # <<<<<<<<<<<<<<
20954 *
20955 * @property
20956*/
20957 {
20958
20959 __pyx_r = ((void **)_PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->data);
20960 }
20961 goto __pyx_L0;
20962
20963 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":963
20964 * return _PyUFuncObject_GET_ITEM_DATA(self).functions
20965 *
20966 * @property # <<<<<<<<<<<<<<
20967 * cdef inline void ** data(self) noexcept nogil:
20968 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
20969*/
20970
20971 /* function exit code */
20972 __pyx_L0:;
20973 return __pyx_r;
20974}
20975
20976/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":967
20977 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
20978 *
20979 * @property # <<<<<<<<<<<<<<
20980 * cdef inline int ntypes(self) noexcept nogil:
20981 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
20982*/
20983
20984static CYTHON_INLINE int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self) {
20985 int __pyx_r;
20986
20987 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":969
20988 * @property
20989 * cdef inline int ntypes(self) noexcept nogil:
20990 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes # <<<<<<<<<<<<<<
20991 *
20992 * @property
20993*/
20994 {
20995
20996 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ntypes;
20997 }
20998 goto __pyx_L0;
20999
21000 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":967
21001 * return <void **>_PyUFuncObject_GET_ITEM_DATA(self).data
21002 *
21003 * @property # <<<<<<<<<<<<<<
21004 * cdef inline int ntypes(self) noexcept nogil:
21005 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
21006*/
21007
21008 /* function exit code */
21009 __pyx_L0:;
21010 return __pyx_r;
21011}
21012
21013/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":971
21014 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
21015 *
21016 * @property # <<<<<<<<<<<<<<
21017 * cdef inline const char* name(self) noexcept nogil:
21018 * return _PyUFuncObject_GET_ITEM_DATA(self).name
21019*/
21020
21021static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self) {
21022 char const *__pyx_r;
21023
21024 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":973
21025 * @property
21026 * cdef inline const char* name(self) noexcept nogil:
21027 * return _PyUFuncObject_GET_ITEM_DATA(self).name # <<<<<<<<<<<<<<
21028 *
21029 * @property
21030*/
21031 {
21032
21033 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->name;
21034 }
21035 goto __pyx_L0;
21036
21037 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":971
21038 * return _PyUFuncObject_GET_ITEM_DATA(self).ntypes
21039 *
21040 * @property # <<<<<<<<<<<<<<
21041 * cdef inline const char* name(self) noexcept nogil:
21042 * return _PyUFuncObject_GET_ITEM_DATA(self).name
21043*/
21044
21045 /* function exit code */
21046 __pyx_L0:;
21047 return __pyx_r;
21048}
21049
21050/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":975
21051 * return _PyUFuncObject_GET_ITEM_DATA(self).name
21052 *
21053 * @property # <<<<<<<<<<<<<<
21054 * cdef inline const char* doc(self) noexcept nogil:
21055 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
21056*/
21057
21058static CYTHON_INLINE char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self) {
21059 char const *__pyx_r;
21060
21061 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":977
21062 * @property
21063 * cdef inline const char* doc(self) noexcept nogil:
21064 * return _PyUFuncObject_GET_ITEM_DATA(self).doc # <<<<<<<<<<<<<<
21065 *
21066 * @property
21067*/
21068 {
21069
21070 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->doc;
21071 }
21072 goto __pyx_L0;
21073
21074 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":975
21075 * return _PyUFuncObject_GET_ITEM_DATA(self).name
21076 *
21077 * @property # <<<<<<<<<<<<<<
21078 * cdef inline const char* doc(self) noexcept nogil:
21079 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
21080*/
21081
21082 /* function exit code */
21083 __pyx_L0:;
21084 return __pyx_r;
21085}
21086
21087/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":979
21088 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
21089 *
21090 * @property # <<<<<<<<<<<<<<
21091 * cdef inline void* ptr(self) noexcept nogil:
21092 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
21093*/
21094
21095static CYTHON_INLINE void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self) {
21096 void *__pyx_r;
21097
21098 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":981
21099 * @property
21100 * cdef inline void* ptr(self) noexcept nogil:
21101 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr # <<<<<<<<<<<<<<
21102 *
21103 * @property
21104*/
21105 {
21106
21107 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ptr;
21108 }
21109 goto __pyx_L0;
21110
21111 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":979
21112 * return _PyUFuncObject_GET_ITEM_DATA(self).doc
21113 *
21114 * @property # <<<<<<<<<<<<<<
21115 * cdef inline void* ptr(self) noexcept nogil:
21116 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
21117*/
21118
21119 /* function exit code */
21120 __pyx_L0:;
21121 return __pyx_r;
21122}
21123
21124/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":983
21125 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
21126 *
21127 * @property # <<<<<<<<<<<<<<
21128 * cdef inline PyObject* obj(self) noexcept nogil:
21129 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
21130*/
21131
21132static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self) {
21133 PyObject *__pyx_r;
21134
21135 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":985
21136 * @property
21137 * cdef inline PyObject* obj(self) noexcept nogil:
21138 * return _PyUFuncObject_GET_ITEM_DATA(self).obj # <<<<<<<<<<<<<<
21139 *
21140 * @property
21141*/
21142 {
21143
21144 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->obj;
21145 }
21146 goto __pyx_L0;
21147
21148 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":983
21149 * return _PyUFuncObject_GET_ITEM_DATA(self).ptr
21150 *
21151 * @property # <<<<<<<<<<<<<<
21152 * cdef inline PyObject* obj(self) noexcept nogil:
21153 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
21154*/
21155
21156 /* function exit code */
21157 __pyx_L0:;
21158 return __pyx_r;
21159}
21160
21161/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":987
21162 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
21163 *
21164 * @property # <<<<<<<<<<<<<<
21165 * cdef inline PyObject* userloops(self) noexcept nogil:
21166 * return _PyUFuncObject_GET_ITEM_DATA(self).userloops
21167*/
21168
21169static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self) {
21170 PyObject *__pyx_r;
21171
21172 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":989
21173 * @property
21174 * cdef inline PyObject* userloops(self) noexcept nogil:
21175 * return _PyUFuncObject_GET_ITEM_DATA(self).userloops # <<<<<<<<<<<<<<
21176 *
21177 * PyUFuncObject_fields *_PyUFuncObject_GET_ITEM_DATA(ufunc) nogil
21178*/
21179 {
21180
21181 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->userloops;
21182 }
21183 goto __pyx_L0;
21184
21185 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":987
21186 * return _PyUFuncObject_GET_ITEM_DATA(self).obj
21187 *
21188 * @property # <<<<<<<<<<<<<<
21189 * cdef inline PyObject* userloops(self) noexcept nogil:
21190 * return _PyUFuncObject_GET_ITEM_DATA(self).userloops
21191*/
21192
21193 /* function exit code */
21194 __pyx_L0:;
21195 return __pyx_r;
21196}
21197
21198/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1065
21199 * int _import_umath() except -1
21200 *
21201 * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
21202 * Py_INCREF(base) # important to do this before stealing the reference below!
21203 * PyArray_SetBaseObject(arr, base)
21204*/
21205
21206static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
21207 int __pyx_t_1;
21208 int __pyx_lineno = 0;
21209 const char *__pyx_filename = NULL;
21210 int __pyx_clineno = 0;
21211
21212 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1066
21213 *
21214 * cdef inline void set_array_base(ndarray arr, object base) except *:
21215 * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
21216 * PyArray_SetBaseObject(arr, base)
21217 *
21218*/
21219 Py_INCREF(__pyx_v_base);
21220
21221 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1067
21222 * cdef inline void set_array_base(ndarray arr, object base) except *:
21223 * Py_INCREF(base) # important to do this before stealing the reference below!
21224 * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
21225 *
21226 * cdef inline object get_array_base(ndarray arr):
21227*/
21228 __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 1067, __pyx_L1_error)
21229
21230
21231 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1065
21232 * int _import_umath() except -1
21233 *
21234 * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
21235 * Py_INCREF(base) # important to do this before stealing the reference below!
21236 * PyArray_SetBaseObject(arr, base)
21237*/
21238
21239 /* function exit code */
21240 goto __pyx_L0;
21241 __pyx_L1_error:;
21242 __Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
21243 __pyx_L0:;
21244
21245}
21246
21247/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1069
21248 * PyArray_SetBaseObject(arr, base)
21249 *
21250 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
21251 * base = PyArray_BASE(arr)
21252 * if base is NULL:
21253*/
21254
21255static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
21256 PyObject *__pyx_v_base;
21257 PyObject *__pyx_r = NULL;
21258 __Pyx_RefNannyDeclarations
21259 int __pyx_t_1;
21260 __Pyx_RefNannySetupContext("get_array_base", 0);
21261
21262 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1070
21263 *
21264 * cdef inline object get_array_base(ndarray arr):
21265 * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
21266 * if base is NULL:
21267 * return None
21268*/
21269 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
21270
21271 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1071
21272 * cdef inline object get_array_base(ndarray arr):
21273 * base = PyArray_BASE(arr)
21274 * if base is NULL: # <<<<<<<<<<<<<<
21275 * return None
21276 * return <object>base
21277*/
21278 __pyx_t_1 = (__pyx_v_base == NULL);
21279
21280 if (__pyx_t_1) {
21281
21282
21283 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1072
21284 * base = PyArray_BASE(arr)
21285 * if base is NULL:
21286 * return None # <<<<<<<<<<<<<<
21287 * return <object>base
21288 *
21289*/
21290 {
21291 PyObject *__pyx_temp;
21292 {
21293 __pyx_temp = __pyx_r;
21294 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21295 }
21296 __Pyx_XDECREF(__pyx_temp);
21297 }
21298 goto __pyx_L0;
21299
21300 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1071
21301 * cdef inline object get_array_base(ndarray arr):
21302 * base = PyArray_BASE(arr)
21303 * if base is NULL: # <<<<<<<<<<<<<<
21304 * return None
21305 * return <object>base
21306*/
21307 }
21308
21309 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1073
21310 * if base is NULL:
21311 * return None
21312 * return <object>base # <<<<<<<<<<<<<<
21313 *
21314 * # Versions of the import_* functions which are more suitable for
21315*/
21316 {
21317 PyObject *__pyx_temp;
21318 {
21319 __pyx_temp = __pyx_r;
21320 __Pyx_INCREF(((PyObject *)__pyx_v_base));
21321 __pyx_r = ((PyObject *)__pyx_v_base);
21322 }
21323 __Pyx_XDECREF(__pyx_temp);
21324 }
21325 goto __pyx_L0;
21326
21327 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1069
21328 * PyArray_SetBaseObject(arr, base)
21329 *
21330 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
21331 * base = PyArray_BASE(arr)
21332 * if base is NULL:
21333*/
21334
21335 /* function exit code */
21336 __pyx_L0:;
21337
21338 __Pyx_XGIVEREF(__pyx_r);
21339 __Pyx_RefNannyFinishContext();
21340 return __pyx_r;
21341}
21342
21343/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1077
21344 * # Versions of the import_* functions which are more suitable for
21345 * # Cython code.
21346 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
21347 * try:
21348 * __pyx_import_array()
21349*/
21350
21351static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
21352 int __pyx_r;
21353 __Pyx_RefNannyDeclarations
21354 PyObject *__pyx_t_1 = NULL;
21355 PyObject *__pyx_t_2 = NULL;
21356 PyObject *__pyx_t_3 = NULL;
21357 int __pyx_t_4;
21358 PyObject *__pyx_t_5 = NULL;
21359 PyObject *__pyx_t_6 = NULL;
21360 PyObject *__pyx_t_7 = NULL;
21361 PyObject *__pyx_t_8 = NULL;
21362 PyObject *__pyx_t_9 = NULL;
21363 size_t __pyx_t_10;
21364 int __pyx_lineno = 0;
21365 const char *__pyx_filename = NULL;
21366 int __pyx_clineno = 0;
21367 __Pyx_RefNannySetupContext("import_array", 0);
21368
21369 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1078
21370 * # Cython code.
21371 * cdef inline int import_array() except -1:
21372 * try: # <<<<<<<<<<<<<<
21373 * __pyx_import_array()
21374 * except Exception:
21375*/
21376 {
21377 __Pyx_PyThreadState_declare
21378 __Pyx_PyThreadState_assign
21379 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
21380 __Pyx_XGOTREF(__pyx_t_1);
21381 __Pyx_XGOTREF(__pyx_t_2);
21382 __Pyx_XGOTREF(__pyx_t_3);
21383 /*try:*/ {
21384
21385 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1079
21386 * cdef inline int import_array() except -1:
21387 * try:
21388 * __pyx_import_array() # <<<<<<<<<<<<<<
21389 * except Exception:
21390 * raise ImportError("numpy._core.multiarray failed to import")
21391*/
21392 __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1079, __pyx_L3_error)
21393
21394
21395 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1078
21396 * # Cython code.
21397 * cdef inline int import_array() except -1:
21398 * try: # <<<<<<<<<<<<<<
21399 * __pyx_import_array()
21400 * except Exception:
21401*/
21402 }
21403 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21404 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21405 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
21406 goto __pyx_L8_try_end;
21407 __pyx_L3_error:;
21408
21409 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1080
21410 * try:
21411 * __pyx_import_array()
21412 * except Exception: # <<<<<<<<<<<<<<
21413 * raise ImportError("numpy._core.multiarray failed to import")
21414 *
21415*/
21416 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
21417 if (__pyx_t_4) {
21418 __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
21419 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1080, __pyx_L5_except_error)
21420 __Pyx_XGOTREF(__pyx_t_5);
21421 __Pyx_XGOTREF(__pyx_t_6);
21422 __Pyx_XGOTREF(__pyx_t_7);
21423
21424 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1081
21425 * __pyx_import_array()
21426 * except Exception:
21427 * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<<
21428 *
21429 * cdef inline int import_umath() except -1:
21430*/
21431 __pyx_t_9 = NULL;
21432 __pyx_t_10 = 1;
21433 {
21434 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to};
21435 __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));
21436 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
21437 if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1081, __pyx_L5_except_error)
21438 __Pyx_GOTREF(__pyx_t_8);
21439 }
21440 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
21441 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21442 __PYX_ERR(2, 1081, __pyx_L5_except_error)
21443 }
21444 goto __pyx_L5_except_error;
21445
21446 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1078
21447 * # Cython code.
21448 * cdef inline int import_array() except -1:
21449 * try: # <<<<<<<<<<<<<<
21450 * __pyx_import_array()
21451 * except Exception:
21452*/
21453 __pyx_L5_except_error:;
21454 __Pyx_XGIVEREF(__pyx_t_1);
21455 __Pyx_XGIVEREF(__pyx_t_2);
21456 __Pyx_XGIVEREF(__pyx_t_3);
21457 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
21458 goto __pyx_L1_error;
21459 __pyx_L8_try_end:;
21460 }
21461
21462 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1077
21463 * # Versions of the import_* functions which are more suitable for
21464 * # Cython code.
21465 * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
21466 * try:
21467 * __pyx_import_array()
21468*/
21469
21470 /* function exit code */
21471 __pyx_r = 0;
21472 goto __pyx_L0;
21473 __pyx_L1_error:;
21474 __Pyx_XDECREF(__pyx_t_5);
21475 __Pyx_XDECREF(__pyx_t_6);
21476 __Pyx_XDECREF(__pyx_t_7);
21477 __Pyx_XDECREF(__pyx_t_8);
21478 __Pyx_XDECREF(__pyx_t_9);
21479 __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
21480 __pyx_r = -1;
21481 __pyx_L0:;
21482
21483 __Pyx_RefNannyFinishContext();
21484 return __pyx_r;
21485}
21486
21487/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1083
21488 * raise ImportError("numpy._core.multiarray failed to import")
21489 *
21490 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
21491 * try:
21492 * _import_umath()
21493*/
21494
21495static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
21496 int __pyx_r;
21497 __Pyx_RefNannyDeclarations
21498 PyObject *__pyx_t_1 = NULL;
21499 PyObject *__pyx_t_2 = NULL;
21500 PyObject *__pyx_t_3 = NULL;
21501 int __pyx_t_4;
21502 PyObject *__pyx_t_5 = NULL;
21503 PyObject *__pyx_t_6 = NULL;
21504 PyObject *__pyx_t_7 = NULL;
21505 PyObject *__pyx_t_8 = NULL;
21506 PyObject *__pyx_t_9 = NULL;
21507 size_t __pyx_t_10;
21508 int __pyx_lineno = 0;
21509 const char *__pyx_filename = NULL;
21510 int __pyx_clineno = 0;
21511 __Pyx_RefNannySetupContext("import_umath", 0);
21512
21513 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1084
21514 *
21515 * cdef inline int import_umath() except -1:
21516 * try: # <<<<<<<<<<<<<<
21517 * _import_umath()
21518 * except Exception:
21519*/
21520 {
21521 __Pyx_PyThreadState_declare
21522 __Pyx_PyThreadState_assign
21523 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
21524 __Pyx_XGOTREF(__pyx_t_1);
21525 __Pyx_XGOTREF(__pyx_t_2);
21526 __Pyx_XGOTREF(__pyx_t_3);
21527 /*try:*/ {
21528
21529 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1085
21530 * cdef inline int import_umath() except -1:
21531 * try:
21532 * _import_umath() # <<<<<<<<<<<<<<
21533 * except Exception:
21534 * raise ImportError("numpy._core.umath failed to import")
21535*/
21536 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1085, __pyx_L3_error)
21537
21538
21539 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1084
21540 *
21541 * cdef inline int import_umath() except -1:
21542 * try: # <<<<<<<<<<<<<<
21543 * _import_umath()
21544 * except Exception:
21545*/
21546 }
21547 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21548 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21549 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
21550 goto __pyx_L8_try_end;
21551 __pyx_L3_error:;
21552
21553 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1086
21554 * try:
21555 * _import_umath()
21556 * except Exception: # <<<<<<<<<<<<<<
21557 * raise ImportError("numpy._core.umath failed to import")
21558 *
21559*/
21560 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
21561 if (__pyx_t_4) {
21562 __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
21563 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1086, __pyx_L5_except_error)
21564 __Pyx_XGOTREF(__pyx_t_5);
21565 __Pyx_XGOTREF(__pyx_t_6);
21566 __Pyx_XGOTREF(__pyx_t_7);
21567
21568 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1087
21569 * _import_umath()
21570 * except Exception:
21571 * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
21572 *
21573 * cdef inline int import_ufunc() except -1:
21574*/
21575 __pyx_t_9 = NULL;
21576 __pyx_t_10 = 1;
21577 {
21578 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
21579 __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));
21580 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
21581 if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1087, __pyx_L5_except_error)
21582 __Pyx_GOTREF(__pyx_t_8);
21583 }
21584 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
21585 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21586 __PYX_ERR(2, 1087, __pyx_L5_except_error)
21587 }
21588 goto __pyx_L5_except_error;
21589
21590 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1084
21591 *
21592 * cdef inline int import_umath() except -1:
21593 * try: # <<<<<<<<<<<<<<
21594 * _import_umath()
21595 * except Exception:
21596*/
21597 __pyx_L5_except_error:;
21598 __Pyx_XGIVEREF(__pyx_t_1);
21599 __Pyx_XGIVEREF(__pyx_t_2);
21600 __Pyx_XGIVEREF(__pyx_t_3);
21601 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
21602 goto __pyx_L1_error;
21603 __pyx_L8_try_end:;
21604 }
21605
21606 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1083
21607 * raise ImportError("numpy._core.multiarray failed to import")
21608 *
21609 * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
21610 * try:
21611 * _import_umath()
21612*/
21613
21614 /* function exit code */
21615 __pyx_r = 0;
21616 goto __pyx_L0;
21617 __pyx_L1_error:;
21618 __Pyx_XDECREF(__pyx_t_5);
21619 __Pyx_XDECREF(__pyx_t_6);
21620 __Pyx_XDECREF(__pyx_t_7);
21621 __Pyx_XDECREF(__pyx_t_8);
21622 __Pyx_XDECREF(__pyx_t_9);
21623 __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
21624 __pyx_r = -1;
21625 __pyx_L0:;
21626
21627 __Pyx_RefNannyFinishContext();
21628 return __pyx_r;
21629}
21630
21631/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1089
21632 * raise ImportError("numpy._core.umath failed to import")
21633 *
21634 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
21635 * try:
21636 * _import_umath()
21637*/
21638
21639static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
21640 int __pyx_r;
21641 __Pyx_RefNannyDeclarations
21642 PyObject *__pyx_t_1 = NULL;
21643 PyObject *__pyx_t_2 = NULL;
21644 PyObject *__pyx_t_3 = NULL;
21645 int __pyx_t_4;
21646 PyObject *__pyx_t_5 = NULL;
21647 PyObject *__pyx_t_6 = NULL;
21648 PyObject *__pyx_t_7 = NULL;
21649 PyObject *__pyx_t_8 = NULL;
21650 PyObject *__pyx_t_9 = NULL;
21651 size_t __pyx_t_10;
21652 int __pyx_lineno = 0;
21653 const char *__pyx_filename = NULL;
21654 int __pyx_clineno = 0;
21655 __Pyx_RefNannySetupContext("import_ufunc", 0);
21656
21657 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1090
21658 *
21659 * cdef inline int import_ufunc() except -1:
21660 * try: # <<<<<<<<<<<<<<
21661 * _import_umath()
21662 * except Exception:
21663*/
21664 {
21665 __Pyx_PyThreadState_declare
21666 __Pyx_PyThreadState_assign
21667 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
21668 __Pyx_XGOTREF(__pyx_t_1);
21669 __Pyx_XGOTREF(__pyx_t_2);
21670 __Pyx_XGOTREF(__pyx_t_3);
21671 /*try:*/ {
21672
21673 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1091
21674 * cdef inline int import_ufunc() except -1:
21675 * try:
21676 * _import_umath() # <<<<<<<<<<<<<<
21677 * except Exception:
21678 * raise ImportError("numpy._core.umath failed to import")
21679*/
21680 __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1091, __pyx_L3_error)
21681
21682
21683 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1090
21684 *
21685 * cdef inline int import_ufunc() except -1:
21686 * try: # <<<<<<<<<<<<<<
21687 * _import_umath()
21688 * except Exception:
21689*/
21690 }
21691 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
21692 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21693 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
21694 goto __pyx_L8_try_end;
21695 __pyx_L3_error:;
21696
21697 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1092
21698 * try:
21699 * _import_umath()
21700 * except Exception: # <<<<<<<<<<<<<<
21701 * raise ImportError("numpy._core.umath failed to import")
21702 *
21703*/
21704 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
21705 if (__pyx_t_4) {
21706 __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
21707 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1092, __pyx_L5_except_error)
21708 __Pyx_XGOTREF(__pyx_t_5);
21709 __Pyx_XGOTREF(__pyx_t_6);
21710 __Pyx_XGOTREF(__pyx_t_7);
21711
21712 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1093
21713 * _import_umath()
21714 * except Exception:
21715 * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
21716 *
21717 *
21718*/
21719 __pyx_t_9 = NULL;
21720 __pyx_t_10 = 1;
21721 {
21722 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo};
21723 __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));
21724 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
21725 if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1093, __pyx_L5_except_error)
21726 __Pyx_GOTREF(__pyx_t_8);
21727 }
21728 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
21729 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
21730 __PYX_ERR(2, 1093, __pyx_L5_except_error)
21731 }
21732 goto __pyx_L5_except_error;
21733
21734 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1090
21735 *
21736 * cdef inline int import_ufunc() except -1:
21737 * try: # <<<<<<<<<<<<<<
21738 * _import_umath()
21739 * except Exception:
21740*/
21741 __pyx_L5_except_error:;
21742 __Pyx_XGIVEREF(__pyx_t_1);
21743 __Pyx_XGIVEREF(__pyx_t_2);
21744 __Pyx_XGIVEREF(__pyx_t_3);
21745 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
21746 goto __pyx_L1_error;
21747 __pyx_L8_try_end:;
21748 }
21749
21750 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1089
21751 * raise ImportError("numpy._core.umath failed to import")
21752 *
21753 * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
21754 * try:
21755 * _import_umath()
21756*/
21757
21758 /* function exit code */
21759 __pyx_r = 0;
21760 goto __pyx_L0;
21761 __pyx_L1_error:;
21762 __Pyx_XDECREF(__pyx_t_5);
21763 __Pyx_XDECREF(__pyx_t_6);
21764 __Pyx_XDECREF(__pyx_t_7);
21765 __Pyx_XDECREF(__pyx_t_8);
21766 __Pyx_XDECREF(__pyx_t_9);
21767 __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
21768 __pyx_r = -1;
21769 __pyx_L0:;
21770
21771 __Pyx_RefNannyFinishContext();
21772 return __pyx_r;
21773}
21774
21775/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1096
21776 *
21777 *
21778 * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
21779 * """
21780 * Cython equivalent of `isinstance(obj, np.timedelta64)`
21781*/
21782
21783static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
21784 int __pyx_r;
21785
21786 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1108
21787 * bool
21788 * """
21789 * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
21790 *
21791 *
21792*/
21793 {
21794
21795 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
21796 }
21797 goto __pyx_L0;
21798
21799 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1096
21800 *
21801 *
21802 * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
21803 * """
21804 * Cython equivalent of `isinstance(obj, np.timedelta64)`
21805*/
21806
21807 /* function exit code */
21808 __pyx_L0:;
21809
21810 return __pyx_r;
21811}
21812
21813/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1111
21814 *
21815 *
21816 * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
21817 * """
21818 * Cython equivalent of `isinstance(obj, np.datetime64)`
21819*/
21820
21821static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
21822 int __pyx_r;
21823
21824 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1123
21825 * bool
21826 * """
21827 * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
21828 *
21829 *
21830*/
21831 {
21832
21833 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
21834 }
21835 goto __pyx_L0;
21836
21837 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1111
21838 *
21839 *
21840 * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
21841 * """
21842 * Cython equivalent of `isinstance(obj, np.datetime64)`
21843*/
21844
21845 /* function exit code */
21846 __pyx_L0:;
21847
21848 return __pyx_r;
21849}
21850
21851/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1126
21852 *
21853 *
21854 * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21855 * """
21856 * returns the int64 value underlying scalar numpy datetime64 object
21857*/
21858
21859static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
21860 npy_datetime __pyx_r;
21861
21862 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1133
21863 * also needed. That can be found using `get_datetime64_unit`.
21864 * """
21865 * return _PyDatetimeScalarObject_GetValue(obj) # <<<<<<<<<<<<<<
21866 *
21867 *
21868*/
21869 {
21870
21871 __pyx_r = _PyDatetimeScalarObject_GetValue(__pyx_v_obj);
21872 }
21873 goto __pyx_L0;
21874
21875 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1126
21876 *
21877 *
21878 * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21879 * """
21880 * returns the int64 value underlying scalar numpy datetime64 object
21881*/
21882
21883 /* function exit code */
21884 __pyx_L0:;
21885 return __pyx_r;
21886}
21887
21888/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1136
21889 *
21890 *
21891 * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21892 * """
21893 * returns the int64 value underlying scalar numpy timedelta64 object
21894*/
21895
21896static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
21897 npy_timedelta __pyx_r;
21898
21899 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1140
21900 * returns the int64 value underlying scalar numpy timedelta64 object
21901 * """
21902 * return _PyTimedeltaScalarObject_GetValue(obj) # <<<<<<<<<<<<<<
21903 *
21904 *
21905*/
21906 {
21907
21908 __pyx_r = _PyTimedeltaScalarObject_GetValue(__pyx_v_obj);
21909 }
21910 goto __pyx_L0;
21911
21912 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1136
21913 *
21914 *
21915 * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21916 * """
21917 * returns the int64 value underlying scalar numpy timedelta64 object
21918*/
21919
21920 /* function exit code */
21921 __pyx_L0:;
21922 return __pyx_r;
21923}
21924
21925/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1143
21926 *
21927 *
21928 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21929 * """
21930 * returns the unit part of the dtype for a numpy datetime64 object.
21931*/
21932
21933static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
21934 NPY_DATETIMEUNIT __pyx_r;
21935
21936 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1147
21937 * returns the unit part of the dtype for a numpy datetime64 object.
21938 * """
21939 * return _PyDatetimeScalarObject_GetMetadata(obj).base # <<<<<<<<<<<<<<
21940 *
21941 *
21942*/
21943 {
21944
21945 __pyx_r = _PyDatetimeScalarObject_GetMetadata(__pyx_v_obj).base;
21946 }
21947 goto __pyx_L0;
21948
21949 /* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":1143
21950 *
21951 *
21952 * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
21953 * """
21954 * returns the unit part of the dtype for a numpy datetime64 object.
21955*/
21956
21957 /* function exit code */
21958 __pyx_L0:;
21959 return __pyx_r;
21960}
21961
21962/* "cpartitioning.pyx":36
21963 * buildDiscontinuousGalerkinSubdomain2GlobalMappings)
21964 *
21965 * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
21966 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
21967 * c_partitionElements(comm.ob_mpi,
21968*/
21969
21970/* Python wrapper */
21971static PyObject *__pyx_pw_13cpartitioning_1partitionElements(PyObject *__pyx_self,
21972#if CYTHON_VECTORCALL
21973PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21974#else
21975PyObject *__pyx_args, PyObject *__pyx_kwds
21976#endif
21977); /*proto*/
21978static PyMethodDef __pyx_mdef_13cpartitioning_1partitionElements = {"partitionElements", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cpartitioning_1partitionElements, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
21979static PyObject *__pyx_pw_13cpartitioning_1partitionElements(PyObject *__pyx_self,
21980#if CYTHON_VECTORCALL
21981PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21982#else
21983PyObject *__pyx_args, PyObject *__pyx_kwds
21984#endif
21985) {
21986 struct PyMPICommObject *__pyx_v_comm = 0;
21987 int __pyx_v_nLayersOfOverlap;
21988 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
21989 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
21990 #if !CYTHON_VECTORCALL
21991 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21992 #endif
21993 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
21994 PyObject* values[4] = {0,0,0,0};
21995 int __pyx_lineno = 0;
21996 const char *__pyx_filename = NULL;
21997 int __pyx_clineno = 0;
21998 PyObject *__pyx_r = 0;
21999 __Pyx_RefNannyDeclarations
22000 __Pyx_RefNannySetupContext("partitionElements (wrapper)", 0);
22001 #if !CYTHON_VECTORCALL
22002 #if CYTHON_ASSUME_SAFE_SIZE
22003 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22004 #else
22005 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
22006 #endif
22007 #endif
22008 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
22009 {
22010 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,&__pyx_mstate_global->__pyx_n_u_nLayersOfOverlap,&__pyx_mstate_global->__pyx_n_u_cmesh,&__pyx_mstate_global->__pyx_n_u_subdomain_cmesh,0};
22011 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
22012 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 36, __pyx_L3_error)
22013 if (__pyx_kwds_len > 0) {
22014 switch (__pyx_nargs) {
22015 case 4:
22016 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
22017 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 36, __pyx_L3_error)
22018 CYTHON_FALLTHROUGH;
22019 case 3:
22020 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
22021 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 36, __pyx_L3_error)
22022 CYTHON_FALLTHROUGH;
22023 case 2:
22024 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
22025 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 36, __pyx_L3_error)
22026 CYTHON_FALLTHROUGH;
22027 case 1:
22028 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22029 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 36, __pyx_L3_error)
22030 CYTHON_FALLTHROUGH;
22031 case 0: break;
22032 default: goto __pyx_L5_argtuple_error;
22033 }
22034 const Py_ssize_t kwd_pos_args = __pyx_nargs;
22035 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "partitionElements", 0) < (0)) __PYX_ERR(0, 36, __pyx_L3_error)
22036 for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
22037 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("partitionElements", 1, 4, 4, i); __PYX_ERR(0, 36, __pyx_L3_error) }
22038 }
22039 } else if (unlikely(__pyx_nargs != 4)) {
22040 goto __pyx_L5_argtuple_error;
22041 } else {
22042 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22043 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 36, __pyx_L3_error)
22044 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
22045 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 36, __pyx_L3_error)
22046 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
22047 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 36, __pyx_L3_error)
22048 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
22049 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 36, __pyx_L3_error)
22050 }
22051 __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
22052 __pyx_v_nLayersOfOverlap = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_nLayersOfOverlap == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L3_error)
22053 __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
22054 __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
22055 }
22056 goto __pyx_L6_skip;
22057 __pyx_L5_argtuple_error:;
22058 __Pyx_RaiseArgtupleInvalid("partitionElements", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 36, __pyx_L3_error)
22059 __pyx_L6_skip:;
22060 goto __pyx_L4_argument_unpacking_done;
22061 __pyx_L3_error:;
22062 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22063 Py_XDECREF(values[__pyx_temp]);
22064 }
22065 __Pyx_AddTraceback("cpartitioning.partitionElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
22066 __Pyx_RefNannyFinishContext();
22067 return NULL;
22068 __pyx_L4_argument_unpacking_done:;
22069 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 36, __pyx_L1_error)
22070 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_mstate_global->__pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 36, __pyx_L1_error)
22071 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_mstate_global->__pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 36, __pyx_L1_error)
22072 __pyx_r = __pyx_pf_13cpartitioning_partitionElements(__pyx_self, __pyx_v_comm, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
22073
22074 /* function exit code */
22075 goto __pyx_L0;
22076 __pyx_L1_error:;
22077 __pyx_r = NULL;
22078 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22079 Py_XDECREF(values[__pyx_temp]);
22080 }
22081 goto __pyx_L7_cleaned_up;
22082 __pyx_L0:;
22083 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22084 Py_XDECREF(values[__pyx_temp]);
22085 }
22086 __pyx_L7_cleaned_up:;
22087
22088 __Pyx_RefNannyFinishContext();
22089 return __pyx_r;
22090}
22091
22092static PyObject *__pyx_pf_13cpartitioning_partitionElements(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
22093 PyObject *__pyx_r = NULL;
22094 __Pyx_RefNannyDeclarations
22095 PyObject *__pyx_t_1 = NULL;
22096 PyObject *__pyx_t_2 = NULL;
22097 PyObject *__pyx_t_3 = NULL;
22098 PyObject *__pyx_t_4 = NULL;
22099 int *__pyx_t_5;
22100 PyObject *__pyx_t_6 = NULL;
22101 Py_ssize_t __pyx_t_7;
22102 struct __pyx_array_obj *__pyx_t_8 = NULL;
22103 char *__pyx_t_9;
22104 size_t __pyx_t_10;
22105 PyObject *__pyx_t_11 = NULL;
22106 PyObject *__pyx_t_12 = NULL;
22107 PyObject *__pyx_t_13 = NULL;
22108 PyObject *__pyx_t_14 = NULL;
22109 PyObject *__pyx_t_15 = NULL;
22110 PyObject *__pyx_t_16 = NULL;
22111 PyObject *__pyx_t_17 = NULL;
22112 int __pyx_lineno = 0;
22113 const char *__pyx_filename = NULL;
22114 int __pyx_clineno = 0;
22115 __Pyx_RefNannySetupContext("partitionElements", 0);
22116
22117 /* "cpartitioning.pyx":37
22118 *
22119 * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
22120 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
22121 * c_partitionElements(comm.ob_mpi,
22122 * cmesh.mesh,
22123*/
22124 __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
22125
22126 /* "cpartitioning.pyx":38
22127 * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
22128 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
22129 * c_partitionElements(comm.ob_mpi, # <<<<<<<<<<<<<<
22130 * cmesh.mesh,
22131 * nLayersOfOverlap)
22132*/
22133 (void)(proteus::partitionElements(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, __pyx_v_nLayersOfOverlap));
22134
22135 /* "cpartitioning.pyx":42
22136 * nLayersOfOverlap)
22137 * return (
22138 * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
22139 * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
22140 * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
22141*/
22142 __pyx_t_2 = NULL;
22143 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
22144 __Pyx_GOTREF(__pyx_t_3);
22145 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 42, __pyx_L1_error)
22146 __Pyx_GOTREF(__pyx_t_4);
22147 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22148 __pyx_t_5 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
22149
22150 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
22151 __Pyx_GOTREF(__pyx_t_3);
22152 __pyx_t_6 = __Pyx_PyLong_AddObjC(__pyx_t_3, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 42, __pyx_L1_error)
22153 __Pyx_GOTREF(__pyx_t_6);
22154 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22155 __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 42, __pyx_L1_error)
22156 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22157 if (!__pyx_t_5) {
22158 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
22159 __PYX_ERR(0, 42, __pyx_L1_error)
22160 }
22161 __pyx_t_3 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
22162 __Pyx_GOTREF(__pyx_t_3);
22163 __pyx_t_6 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_7)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 42, __pyx_L1_error)
22164 __Pyx_GOTREF(__pyx_t_6);
22165 #if CYTHON_COMPILING_IN_LIMITED_API
22166 __pyx_t_9 = PyBytes_AsString(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 42, __pyx_L1_error)
22167 #else
22168 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_3);
22169 #endif
22170 __pyx_t_8 = __pyx_array_new(__pyx_t_6, sizeof(int), __pyx_t_9, "c", (char *) __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 42, __pyx_L1_error)
22171 __Pyx_GOTREF((PyObject *)__pyx_t_8);
22172 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22173 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22174
22175
22176 __pyx_t_10 = 1;
22177 #if CYTHON_UNPACK_METHODS
22178 if (unlikely(PyMethod_Check(__pyx_t_4))) {
22179 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
22180 assert(__pyx_t_2);
22181 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
22182 __Pyx_INCREF(__pyx_t_2);
22183 __Pyx_INCREF(__pyx__function);
22184 __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
22185 __pyx_t_10 = 0;
22186 }
22187 #endif
22188 {
22189 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_8)};
22190 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22191 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22192 __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
22193 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22194 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
22195 __Pyx_GOTREF(__pyx_t_1);
22196 }
22197
22198 /* "cpartitioning.pyx":43
22199 * return (
22200 * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned),
22201 * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
22202 * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
22203 * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
22204*/
22205 __pyx_t_2 = NULL;
22206 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error)
22207 __Pyx_GOTREF(__pyx_t_3);
22208 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 43, __pyx_L1_error)
22209 __Pyx_GOTREF(__pyx_t_6);
22210 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22211 __pyx_t_5 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
22212
22213 if (!__pyx_t_5) {
22214 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
22215 __PYX_ERR(0, 43, __pyx_L1_error)
22216 }
22217 __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 43, __pyx_L1_error)
22218 __Pyx_GOTREF(__pyx_t_11);
22219 __pyx_t_3 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error)
22220 __Pyx_GOTREF(__pyx_t_3);
22221 #if CYTHON_COMPILING_IN_LIMITED_API
22222 __pyx_t_9 = PyBytes_AsString(__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 43, __pyx_L1_error)
22223 #else
22224 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_11);
22225 #endif
22226 __pyx_t_8 = __pyx_array_new(__pyx_t_3, sizeof(int), __pyx_t_9, "c", (char *) __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 43, __pyx_L1_error)
22227 __Pyx_GOTREF((PyObject *)__pyx_t_8);
22228 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22229 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22230
22231 __pyx_t_10 = 1;
22232 #if CYTHON_UNPACK_METHODS
22233 if (unlikely(PyMethod_Check(__pyx_t_6))) {
22234 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
22235 assert(__pyx_t_2);
22236 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
22237 __Pyx_INCREF(__pyx_t_2);
22238 __Pyx_INCREF(__pyx__function);
22239 __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
22240 __pyx_t_10 = 0;
22241 }
22242 #endif
22243 {
22244 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_8)};
22245 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22246 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22247 __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
22248 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22249 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 43, __pyx_L1_error)
22250 __Pyx_GOTREF(__pyx_t_4);
22251 }
22252
22253 /* "cpartitioning.pyx":44
22254 * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned),
22255 * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
22256 * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
22257 * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
22258 * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
22259*/
22260 __pyx_t_2 = NULL;
22261 __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 44, __pyx_L1_error)
22262 __Pyx_GOTREF(__pyx_t_11);
22263 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error)
22264 __Pyx_GOTREF(__pyx_t_3);
22265 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22266 __pyx_t_5 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
22267
22268 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 44, __pyx_L1_error)
22269 __Pyx_GOTREF(__pyx_t_11);
22270 __pyx_t_12 = __Pyx_PyLong_AddObjC(__pyx_t_11, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 44, __pyx_L1_error)
22271 __Pyx_GOTREF(__pyx_t_12);
22272 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22273 __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L1_error)
22274 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
22275 if (!__pyx_t_5) {
22276 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
22277 __PYX_ERR(0, 44, __pyx_L1_error)
22278 }
22279 __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 44, __pyx_L1_error)
22280 __Pyx_GOTREF(__pyx_t_11);
22281 __pyx_t_12 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_7)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 44, __pyx_L1_error)
22282 __Pyx_GOTREF(__pyx_t_12);
22283 #if CYTHON_COMPILING_IN_LIMITED_API
22284 __pyx_t_9 = PyBytes_AsString(__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 44, __pyx_L1_error)
22285 #else
22286 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_11);
22287 #endif
22288 __pyx_t_8 = __pyx_array_new(__pyx_t_12, sizeof(int), __pyx_t_9, "c", (char *) __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 44, __pyx_L1_error)
22289 __Pyx_GOTREF((PyObject *)__pyx_t_8);
22290 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
22291 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22292
22293
22294 __pyx_t_10 = 1;
22295 #if CYTHON_UNPACK_METHODS
22296 if (unlikely(PyMethod_Check(__pyx_t_3))) {
22297 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
22298 assert(__pyx_t_2);
22299 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
22300 __Pyx_INCREF(__pyx_t_2);
22301 __Pyx_INCREF(__pyx__function);
22302 __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
22303 __pyx_t_10 = 0;
22304 }
22305 #endif
22306 {
22307 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_8)};
22308 __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22309 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22310 __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
22311 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22312 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 44, __pyx_L1_error)
22313 __Pyx_GOTREF(__pyx_t_6);
22314 }
22315
22316 /* "cpartitioning.pyx":45
22317 * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
22318 * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
22319 * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
22320 * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
22321 * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
22322*/
22323 __pyx_t_2 = NULL;
22324 __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 45, __pyx_L1_error)
22325 __Pyx_GOTREF(__pyx_t_11);
22326 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 45, __pyx_L1_error)
22327 __Pyx_GOTREF(__pyx_t_12);
22328 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22329 __pyx_t_5 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
22330
22331 if (!__pyx_t_5) {
22332 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
22333 __PYX_ERR(0, 45, __pyx_L1_error)
22334 }
22335 __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 45, __pyx_L1_error)
22336 __Pyx_GOTREF(__pyx_t_13);
22337 __pyx_t_11 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 45, __pyx_L1_error)
22338 __Pyx_GOTREF(__pyx_t_11);
22339 #if CYTHON_COMPILING_IN_LIMITED_API
22340 __pyx_t_9 = PyBytes_AsString(__pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 45, __pyx_L1_error)
22341 #else
22342 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_13);
22343 #endif
22344 __pyx_t_8 = __pyx_array_new(__pyx_t_11, sizeof(int), __pyx_t_9, "c", (char *) __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 45, __pyx_L1_error)
22345 __Pyx_GOTREF((PyObject *)__pyx_t_8);
22346 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22347 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22348
22349 __pyx_t_10 = 1;
22350 #if CYTHON_UNPACK_METHODS
22351 if (unlikely(PyMethod_Check(__pyx_t_12))) {
22352 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_12);
22353 assert(__pyx_t_2);
22354 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
22355 __Pyx_INCREF(__pyx_t_2);
22356 __Pyx_INCREF(__pyx__function);
22357 __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
22358 __pyx_t_10 = 0;
22359 }
22360 #endif
22361 {
22362 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_8)};
22363 __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22364 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22365 __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
22366 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
22367 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error)
22368 __Pyx_GOTREF(__pyx_t_3);
22369 }
22370
22371 /* "cpartitioning.pyx":46
22372 * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
22373 * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
22374 * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
22375 * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
22376 * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned),
22377*/
22378 __pyx_t_2 = NULL;
22379 __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 46, __pyx_L1_error)
22380 __Pyx_GOTREF(__pyx_t_13);
22381 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 46, __pyx_L1_error)
22382 __Pyx_GOTREF(__pyx_t_11);
22383 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22384 __pyx_t_5 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
22385
22386 __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 46, __pyx_L1_error)
22387 __Pyx_GOTREF(__pyx_t_13);
22388 __pyx_t_14 = __Pyx_PyLong_AddObjC(__pyx_t_13, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 46, __pyx_L1_error)
22389 __Pyx_GOTREF(__pyx_t_14);
22390 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22391 __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L1_error)
22392 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
22393 if (!__pyx_t_5) {
22394 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
22395 __PYX_ERR(0, 46, __pyx_L1_error)
22396 }
22397 __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 46, __pyx_L1_error)
22398 __Pyx_GOTREF(__pyx_t_13);
22399 __pyx_t_14 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_7)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 46, __pyx_L1_error)
22400 __Pyx_GOTREF(__pyx_t_14);
22401 #if CYTHON_COMPILING_IN_LIMITED_API
22402 __pyx_t_9 = PyBytes_AsString(__pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 46, __pyx_L1_error)
22403 #else
22404 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_13);
22405 #endif
22406 __pyx_t_8 = __pyx_array_new(__pyx_t_14, sizeof(int), __pyx_t_9, "c", (char *) __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 46, __pyx_L1_error)
22407 __Pyx_GOTREF((PyObject *)__pyx_t_8);
22408 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
22409 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22410
22411
22412 __pyx_t_10 = 1;
22413 #if CYTHON_UNPACK_METHODS
22414 if (unlikely(PyMethod_Check(__pyx_t_11))) {
22415 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11);
22416 assert(__pyx_t_2);
22417 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
22418 __Pyx_INCREF(__pyx_t_2);
22419 __Pyx_INCREF(__pyx__function);
22420 __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
22421 __pyx_t_10 = 0;
22422 }
22423 #endif
22424 {
22425 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_8)};
22426 __pyx_t_12 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22427 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22428 __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
22429 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22430 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 46, __pyx_L1_error)
22431 __Pyx_GOTREF(__pyx_t_12);
22432 }
22433
22434 /* "cpartitioning.pyx":47
22435 * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
22436 * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
22437 * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
22438 * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned),
22439 * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
22440*/
22441 __pyx_t_2 = NULL;
22442 __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 47, __pyx_L1_error)
22443 __Pyx_GOTREF(__pyx_t_13);
22444 __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 47, __pyx_L1_error)
22445 __Pyx_GOTREF(__pyx_t_14);
22446 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22447 __pyx_t_5 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
22448
22449 if (!__pyx_t_5) {
22450 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
22451 __PYX_ERR(0, 47, __pyx_L1_error)
22452 }
22453 __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 47, __pyx_L1_error)
22454 __Pyx_GOTREF(__pyx_t_15);
22455 __pyx_t_13 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 47, __pyx_L1_error)
22456 __Pyx_GOTREF(__pyx_t_13);
22457 #if CYTHON_COMPILING_IN_LIMITED_API
22458 __pyx_t_9 = PyBytes_AsString(__pyx_t_15); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 47, __pyx_L1_error)
22459 #else
22460 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_15);
22461 #endif
22462 __pyx_t_8 = __pyx_array_new(__pyx_t_13, sizeof(int), __pyx_t_9, "c", (char *) __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 47, __pyx_L1_error)
22463 __Pyx_GOTREF((PyObject *)__pyx_t_8);
22464 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22465 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
22466
22467 __pyx_t_10 = 1;
22468 #if CYTHON_UNPACK_METHODS
22469 if (unlikely(PyMethod_Check(__pyx_t_14))) {
22470 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_14);
22471 assert(__pyx_t_2);
22472 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
22473 __Pyx_INCREF(__pyx_t_2);
22474 __Pyx_INCREF(__pyx__function);
22475 __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
22476 __pyx_t_10 = 0;
22477 }
22478 #endif
22479 {
22480 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_8)};
22481 __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22482 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22483 __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
22484 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
22485 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 47, __pyx_L1_error)
22486 __Pyx_GOTREF(__pyx_t_11);
22487 }
22488
22489 /* "cpartitioning.pyx":48
22490 * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
22491 * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
22492 * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
22493 * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
22494 * )
22495*/
22496 __pyx_t_2 = NULL;
22497 __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 48, __pyx_L1_error)
22498 __Pyx_GOTREF(__pyx_t_15);
22499 __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 48, __pyx_L1_error)
22500 __Pyx_GOTREF(__pyx_t_13);
22501 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
22502 __pyx_t_5 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
22503
22504 __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 48, __pyx_L1_error)
22505 __Pyx_GOTREF(__pyx_t_15);
22506 __pyx_t_16 = __Pyx_PyLong_AddObjC(__pyx_t_15, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 48, __pyx_L1_error)
22507 __Pyx_GOTREF(__pyx_t_16);
22508 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
22509 __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_16); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 48, __pyx_L1_error)
22510 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
22511 if (!__pyx_t_5) {
22512 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
22513 __PYX_ERR(0, 48, __pyx_L1_error)
22514 }
22515 __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 48, __pyx_L1_error)
22516 __Pyx_GOTREF(__pyx_t_15);
22517 __pyx_t_16 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_7)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 48, __pyx_L1_error)
22518 __Pyx_GOTREF(__pyx_t_16);
22519 #if CYTHON_COMPILING_IN_LIMITED_API
22520 __pyx_t_9 = PyBytes_AsString(__pyx_t_15); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 48, __pyx_L1_error)
22521 #else
22522 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_15);
22523 #endif
22524 __pyx_t_8 = __pyx_array_new(__pyx_t_16, sizeof(int), __pyx_t_9, "c", (char *) __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 48, __pyx_L1_error)
22525 __Pyx_GOTREF((PyObject *)__pyx_t_8);
22526 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
22527 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
22528
22529
22530 __pyx_t_10 = 1;
22531 #if CYTHON_UNPACK_METHODS
22532 if (unlikely(PyMethod_Check(__pyx_t_13))) {
22533 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_13);
22534 assert(__pyx_t_2);
22535 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
22536 __Pyx_INCREF(__pyx_t_2);
22537 __Pyx_INCREF(__pyx__function);
22538 __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
22539 __pyx_t_10 = 0;
22540 }
22541 #endif
22542 {
22543 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_8)};
22544 __pyx_t_14 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22545 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22546 __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
22547 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
22548 if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 48, __pyx_L1_error)
22549 __Pyx_GOTREF(__pyx_t_14);
22550 }
22551
22552 /* "cpartitioning.pyx":49
22553 * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
22554 * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.edgeOffsets_subdomain_owned),
22555 * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
22556 * )
22557 *
22558*/
22559 __pyx_t_2 = NULL;
22560 __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 49, __pyx_L1_error)
22561 __Pyx_GOTREF(__pyx_t_15);
22562 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 49, __pyx_L1_error)
22563 __Pyx_GOTREF(__pyx_t_16);
22564 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
22565 __pyx_t_5 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
22566
22567 if (!__pyx_t_5) {
22568 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
22569 __PYX_ERR(0, 49, __pyx_L1_error)
22570 }
22571 __pyx_t_17 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 49, __pyx_L1_error)
22572 __Pyx_GOTREF(__pyx_t_17);
22573 __pyx_t_15 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 49, __pyx_L1_error)
22574 __Pyx_GOTREF(__pyx_t_15);
22575 #if CYTHON_COMPILING_IN_LIMITED_API
22576 __pyx_t_9 = PyBytes_AsString(__pyx_t_17); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 49, __pyx_L1_error)
22577 #else
22578 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_17);
22579 #endif
22580 __pyx_t_8 = __pyx_array_new(__pyx_t_15, sizeof(int), __pyx_t_9, "c", (char *) __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 49, __pyx_L1_error)
22581 __Pyx_GOTREF((PyObject *)__pyx_t_8);
22582 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
22583 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
22584
22585 __pyx_t_10 = 1;
22586 #if CYTHON_UNPACK_METHODS
22587 if (unlikely(PyMethod_Check(__pyx_t_16))) {
22588 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_16);
22589 assert(__pyx_t_2);
22590 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
22591 __Pyx_INCREF(__pyx_t_2);
22592 __Pyx_INCREF(__pyx__function);
22593 __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
22594 __pyx_t_10 = 0;
22595 }
22596 #endif
22597 {
22598 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_8)};
22599 __pyx_t_13 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_16, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22600 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22601 __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
22602 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
22603 if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 49, __pyx_L1_error)
22604 __Pyx_GOTREF(__pyx_t_13);
22605 }
22606
22607 /* "cpartitioning.pyx":42
22608 * nLayersOfOverlap)
22609 * return (
22610 * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
22611 * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
22612 * np.asarray(<int[:(comm.size+1)]> cmesh.mesh.nodeOffsets_subdomain_owned),
22613*/
22614 __pyx_t_16 = PyTuple_New(8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 42, __pyx_L1_error)
22615 __Pyx_GOTREF(__pyx_t_16);
22616 __Pyx_GIVEREF(__pyx_t_1);
22617 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 42, __pyx_L1_error);
22618 __Pyx_GIVEREF(__pyx_t_4);
22619 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 42, __pyx_L1_error);
22620 __Pyx_GIVEREF(__pyx_t_6);
22621 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_6) != (0)) __PYX_ERR(0, 42, __pyx_L1_error);
22622 __Pyx_GIVEREF(__pyx_t_3);
22623 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_3) != (0)) __PYX_ERR(0, 42, __pyx_L1_error);
22624 __Pyx_GIVEREF(__pyx_t_12);
22625 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_12) != (0)) __PYX_ERR(0, 42, __pyx_L1_error);
22626 __Pyx_GIVEREF(__pyx_t_11);
22627 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_11) != (0)) __PYX_ERR(0, 42, __pyx_L1_error);
22628 __Pyx_GIVEREF(__pyx_t_14);
22629 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_t_14) != (0)) __PYX_ERR(0, 42, __pyx_L1_error);
22630 __Pyx_GIVEREF(__pyx_t_13);
22631 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_t_13) != (0)) __PYX_ERR(0, 42, __pyx_L1_error);
22632 __pyx_t_1 = 0;
22633 __pyx_t_4 = 0;
22634 __pyx_t_6 = 0;
22635 __pyx_t_3 = 0;
22636 __pyx_t_12 = 0;
22637 __pyx_t_11 = 0;
22638 __pyx_t_14 = 0;
22639 __pyx_t_13 = 0;
22640 {
22641 PyObject *__pyx_temp;
22642 {
22643 __pyx_temp = __pyx_r;
22644 __pyx_r = __pyx_t_16;
22645 }
22646 __Pyx_XDECREF(__pyx_temp);
22647 }
22648 __pyx_t_16 = 0;
22649 goto __pyx_L0;
22650
22651 /* "cpartitioning.pyx":36
22652 * buildDiscontinuousGalerkinSubdomain2GlobalMappings)
22653 *
22654 * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
22655 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
22656 * c_partitionElements(comm.ob_mpi,
22657*/
22658
22659 /* function exit code */
22660 __pyx_L1_error:;
22661 __Pyx_XDECREF(__pyx_t_1);
22662 __Pyx_XDECREF(__pyx_t_2);
22663 __Pyx_XDECREF(__pyx_t_3);
22664 __Pyx_XDECREF(__pyx_t_4);
22665 __Pyx_XDECREF(__pyx_t_6);
22666 __Pyx_XDECREF((PyObject *)__pyx_t_8);
22667 __Pyx_XDECREF(__pyx_t_11);
22668 __Pyx_XDECREF(__pyx_t_12);
22669 __Pyx_XDECREF(__pyx_t_13);
22670 __Pyx_XDECREF(__pyx_t_14);
22671 __Pyx_XDECREF(__pyx_t_15);
22672 __Pyx_XDECREF(__pyx_t_16);
22673 __Pyx_XDECREF(__pyx_t_17);
22674 __Pyx_AddTraceback("cpartitioning.partitionElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
22675 __pyx_r = NULL;
22676 __pyx_L0:;
22677 __Pyx_XGIVEREF(__pyx_r);
22678 __Pyx_RefNannyFinishContext();
22679 return __pyx_r;
22680}
22681
22682/* "cpartitioning.pyx":52
22683 * )
22684 *
22685 * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
22686 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
22687 * c_partitionNodes(comm.ob_mpi,
22688*/
22689
22690/* Python wrapper */
22691static PyObject *__pyx_pw_13cpartitioning_3partitionNodes(PyObject *__pyx_self,
22692#if CYTHON_VECTORCALL
22693PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22694#else
22695PyObject *__pyx_args, PyObject *__pyx_kwds
22696#endif
22697); /*proto*/
22698static PyMethodDef __pyx_mdef_13cpartitioning_3partitionNodes = {"partitionNodes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cpartitioning_3partitionNodes, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
22699static PyObject *__pyx_pw_13cpartitioning_3partitionNodes(PyObject *__pyx_self,
22700#if CYTHON_VECTORCALL
22701PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22702#else
22703PyObject *__pyx_args, PyObject *__pyx_kwds
22704#endif
22705) {
22706 struct PyMPICommObject *__pyx_v_comm = 0;
22707 int __pyx_v_nLayersOfOverlap;
22708 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
22709 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
22710 #if !CYTHON_VECTORCALL
22711 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22712 #endif
22713 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
22714 PyObject* values[4] = {0,0,0,0};
22715 int __pyx_lineno = 0;
22716 const char *__pyx_filename = NULL;
22717 int __pyx_clineno = 0;
22718 PyObject *__pyx_r = 0;
22719 __Pyx_RefNannyDeclarations
22720 __Pyx_RefNannySetupContext("partitionNodes (wrapper)", 0);
22721 #if !CYTHON_VECTORCALL
22722 #if CYTHON_ASSUME_SAFE_SIZE
22723 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22724 #else
22725 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
22726 #endif
22727 #endif
22728 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
22729 {
22730 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,&__pyx_mstate_global->__pyx_n_u_nLayersOfOverlap,&__pyx_mstate_global->__pyx_n_u_cmesh,&__pyx_mstate_global->__pyx_n_u_subdomain_cmesh,0};
22731 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
22732 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 52, __pyx_L3_error)
22733 if (__pyx_kwds_len > 0) {
22734 switch (__pyx_nargs) {
22735 case 4:
22736 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
22737 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 52, __pyx_L3_error)
22738 CYTHON_FALLTHROUGH;
22739 case 3:
22740 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
22741 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 52, __pyx_L3_error)
22742 CYTHON_FALLTHROUGH;
22743 case 2:
22744 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
22745 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 52, __pyx_L3_error)
22746 CYTHON_FALLTHROUGH;
22747 case 1:
22748 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22749 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 52, __pyx_L3_error)
22750 CYTHON_FALLTHROUGH;
22751 case 0: break;
22752 default: goto __pyx_L5_argtuple_error;
22753 }
22754 const Py_ssize_t kwd_pos_args = __pyx_nargs;
22755 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "partitionNodes", 0) < (0)) __PYX_ERR(0, 52, __pyx_L3_error)
22756 for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
22757 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("partitionNodes", 1, 4, 4, i); __PYX_ERR(0, 52, __pyx_L3_error) }
22758 }
22759 } else if (unlikely(__pyx_nargs != 4)) {
22760 goto __pyx_L5_argtuple_error;
22761 } else {
22762 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
22763 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 52, __pyx_L3_error)
22764 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
22765 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 52, __pyx_L3_error)
22766 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
22767 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 52, __pyx_L3_error)
22768 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
22769 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 52, __pyx_L3_error)
22770 }
22771 __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
22772 __pyx_v_nLayersOfOverlap = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_nLayersOfOverlap == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L3_error)
22773 __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
22774 __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
22775 }
22776 goto __pyx_L6_skip;
22777 __pyx_L5_argtuple_error:;
22778 __Pyx_RaiseArgtupleInvalid("partitionNodes", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 52, __pyx_L3_error)
22779 __pyx_L6_skip:;
22780 goto __pyx_L4_argument_unpacking_done;
22781 __pyx_L3_error:;
22782 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22783 Py_XDECREF(values[__pyx_temp]);
22784 }
22785 __Pyx_AddTraceback("cpartitioning.partitionNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
22786 __Pyx_RefNannyFinishContext();
22787 return NULL;
22788 __pyx_L4_argument_unpacking_done:;
22789 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 52, __pyx_L1_error)
22790 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_mstate_global->__pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 52, __pyx_L1_error)
22791 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_mstate_global->__pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 52, __pyx_L1_error)
22792 __pyx_r = __pyx_pf_13cpartitioning_2partitionNodes(__pyx_self, __pyx_v_comm, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
22793
22794 /* function exit code */
22795 goto __pyx_L0;
22796 __pyx_L1_error:;
22797 __pyx_r = NULL;
22798 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22799 Py_XDECREF(values[__pyx_temp]);
22800 }
22801 goto __pyx_L7_cleaned_up;
22802 __pyx_L0:;
22803 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22804 Py_XDECREF(values[__pyx_temp]);
22805 }
22806 __pyx_L7_cleaned_up:;
22807
22808 __Pyx_RefNannyFinishContext();
22809 return __pyx_r;
22810}
22811
22812static PyObject *__pyx_pf_13cpartitioning_2partitionNodes(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
22813 PyObject *__pyx_r = NULL;
22814 __Pyx_RefNannyDeclarations
22815 PyObject *__pyx_t_1 = NULL;
22816 PyObject *__pyx_t_2 = NULL;
22817 PyObject *__pyx_t_3 = NULL;
22818 PyObject *__pyx_t_4 = NULL;
22819 int *__pyx_t_5;
22820 PyObject *__pyx_t_6 = NULL;
22821 Py_ssize_t __pyx_t_7;
22822 struct __pyx_array_obj *__pyx_t_8 = NULL;
22823 char *__pyx_t_9;
22824 size_t __pyx_t_10;
22825 PyObject *__pyx_t_11 = NULL;
22826 PyObject *__pyx_t_12 = NULL;
22827 PyObject *__pyx_t_13 = NULL;
22828 PyObject *__pyx_t_14 = NULL;
22829 PyObject *__pyx_t_15 = NULL;
22830 PyObject *__pyx_t_16 = NULL;
22831 PyObject *__pyx_t_17 = NULL;
22832 int __pyx_lineno = 0;
22833 const char *__pyx_filename = NULL;
22834 int __pyx_clineno = 0;
22835 __Pyx_RefNannySetupContext("partitionNodes", 0);
22836
22837 /* "cpartitioning.pyx":53
22838 *
22839 * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
22840 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
22841 * c_partitionNodes(comm.ob_mpi,
22842 * cmesh.mesh,
22843*/
22844 __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
22845
22846 /* "cpartitioning.pyx":54
22847 * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
22848 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
22849 * c_partitionNodes(comm.ob_mpi, # <<<<<<<<<<<<<<
22850 * cmesh.mesh,
22851 * nLayersOfOverlap)
22852*/
22853 (void)(proteus::partitionNodes(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, __pyx_v_nLayersOfOverlap));
22854
22855 /* "cpartitioning.pyx":58
22856 * nLayersOfOverlap)
22857 * return (
22858 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
22859 * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
22860 * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
22861*/
22862 __pyx_t_2 = NULL;
22863 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error)
22864 __Pyx_GOTREF(__pyx_t_3);
22865 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L1_error)
22866 __Pyx_GOTREF(__pyx_t_4);
22867 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22868 __pyx_t_5 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
22869
22870 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error)
22871 __Pyx_GOTREF(__pyx_t_3);
22872 __pyx_t_6 = __Pyx_PyLong_AddObjC(__pyx_t_3, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 58, __pyx_L1_error)
22873 __Pyx_GOTREF(__pyx_t_6);
22874 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22875 __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error)
22876 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22877 if (!__pyx_t_5) {
22878 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
22879 __PYX_ERR(0, 58, __pyx_L1_error)
22880 }
22881 __pyx_t_3 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error)
22882 __Pyx_GOTREF(__pyx_t_3);
22883 __pyx_t_6 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_7)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 58, __pyx_L1_error)
22884 __Pyx_GOTREF(__pyx_t_6);
22885 #if CYTHON_COMPILING_IN_LIMITED_API
22886 __pyx_t_9 = PyBytes_AsString(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 58, __pyx_L1_error)
22887 #else
22888 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_3);
22889 #endif
22890 __pyx_t_8 = __pyx_array_new(__pyx_t_6, sizeof(int), __pyx_t_9, "c", (char *) __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 58, __pyx_L1_error)
22891 __Pyx_GOTREF((PyObject *)__pyx_t_8);
22892 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22893 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22894
22895
22896 __pyx_t_10 = 1;
22897 #if CYTHON_UNPACK_METHODS
22898 if (unlikely(PyMethod_Check(__pyx_t_4))) {
22899 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
22900 assert(__pyx_t_2);
22901 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
22902 __Pyx_INCREF(__pyx_t_2);
22903 __Pyx_INCREF(__pyx__function);
22904 __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
22905 __pyx_t_10 = 0;
22906 }
22907 #endif
22908 {
22909 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_8)};
22910 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22911 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22912 __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
22913 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22914 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error)
22915 __Pyx_GOTREF(__pyx_t_1);
22916 }
22917
22918 /* "cpartitioning.pyx":59
22919 * return (
22920 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
22921 * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
22922 * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
22923 * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
22924*/
22925 __pyx_t_2 = NULL;
22926 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error)
22927 __Pyx_GOTREF(__pyx_t_3);
22928 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 59, __pyx_L1_error)
22929 __Pyx_GOTREF(__pyx_t_6);
22930 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22931 __pyx_t_5 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
22932
22933 if (!__pyx_t_5) {
22934 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
22935 __PYX_ERR(0, 59, __pyx_L1_error)
22936 }
22937 __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 59, __pyx_L1_error)
22938 __Pyx_GOTREF(__pyx_t_11);
22939 __pyx_t_3 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error)
22940 __Pyx_GOTREF(__pyx_t_3);
22941 #if CYTHON_COMPILING_IN_LIMITED_API
22942 __pyx_t_9 = PyBytes_AsString(__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 59, __pyx_L1_error)
22943 #else
22944 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_11);
22945 #endif
22946 __pyx_t_8 = __pyx_array_new(__pyx_t_3, sizeof(int), __pyx_t_9, "c", (char *) __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 59, __pyx_L1_error)
22947 __Pyx_GOTREF((PyObject *)__pyx_t_8);
22948 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22949 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22950
22951 __pyx_t_10 = 1;
22952 #if CYTHON_UNPACK_METHODS
22953 if (unlikely(PyMethod_Check(__pyx_t_6))) {
22954 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
22955 assert(__pyx_t_2);
22956 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
22957 __Pyx_INCREF(__pyx_t_2);
22958 __Pyx_INCREF(__pyx__function);
22959 __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
22960 __pyx_t_10 = 0;
22961 }
22962 #endif
22963 {
22964 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_8)};
22965 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
22966 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22967 __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
22968 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22969 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 59, __pyx_L1_error)
22970 __Pyx_GOTREF(__pyx_t_4);
22971 }
22972
22973 /* "cpartitioning.pyx":60
22974 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
22975 * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
22976 * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
22977 * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
22978 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
22979*/
22980 __pyx_t_2 = NULL;
22981 __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 60, __pyx_L1_error)
22982 __Pyx_GOTREF(__pyx_t_11);
22983 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error)
22984 __Pyx_GOTREF(__pyx_t_3);
22985 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22986 __pyx_t_5 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
22987
22988 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 60, __pyx_L1_error)
22989 __Pyx_GOTREF(__pyx_t_11);
22990 __pyx_t_12 = __Pyx_PyLong_AddObjC(__pyx_t_11, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 60, __pyx_L1_error)
22991 __Pyx_GOTREF(__pyx_t_12);
22992 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22993 __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L1_error)
22994 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
22995 if (!__pyx_t_5) {
22996 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
22997 __PYX_ERR(0, 60, __pyx_L1_error)
22998 }
22999 __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 60, __pyx_L1_error)
23000 __Pyx_GOTREF(__pyx_t_11);
23001 __pyx_t_12 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_7)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 60, __pyx_L1_error)
23002 __Pyx_GOTREF(__pyx_t_12);
23003 #if CYTHON_COMPILING_IN_LIMITED_API
23004 __pyx_t_9 = PyBytes_AsString(__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 60, __pyx_L1_error)
23005 #else
23006 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_11);
23007 #endif
23008 __pyx_t_8 = __pyx_array_new(__pyx_t_12, sizeof(int), __pyx_t_9, "c", (char *) __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 60, __pyx_L1_error)
23009 __Pyx_GOTREF((PyObject *)__pyx_t_8);
23010 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
23011 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
23012
23013
23014 __pyx_t_10 = 1;
23015 #if CYTHON_UNPACK_METHODS
23016 if (unlikely(PyMethod_Check(__pyx_t_3))) {
23017 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
23018 assert(__pyx_t_2);
23019 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
23020 __Pyx_INCREF(__pyx_t_2);
23021 __Pyx_INCREF(__pyx__function);
23022 __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
23023 __pyx_t_10 = 0;
23024 }
23025 #endif
23026 {
23027 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_8)};
23028 __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
23029 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23030 __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
23031 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23032 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 60, __pyx_L1_error)
23033 __Pyx_GOTREF(__pyx_t_6);
23034 }
23035
23036 /* "cpartitioning.pyx":61
23037 * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
23038 * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
23039 * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
23040 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
23041 * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
23042*/
23043 __pyx_t_2 = NULL;
23044 __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 61, __pyx_L1_error)
23045 __Pyx_GOTREF(__pyx_t_11);
23046 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 61, __pyx_L1_error)
23047 __Pyx_GOTREF(__pyx_t_12);
23048 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
23049 __pyx_t_5 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
23050
23051 if (!__pyx_t_5) {
23052 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
23053 __PYX_ERR(0, 61, __pyx_L1_error)
23054 }
23055 __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 61, __pyx_L1_error)
23056 __Pyx_GOTREF(__pyx_t_13);
23057 __pyx_t_11 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 61, __pyx_L1_error)
23058 __Pyx_GOTREF(__pyx_t_11);
23059 #if CYTHON_COMPILING_IN_LIMITED_API
23060 __pyx_t_9 = PyBytes_AsString(__pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 61, __pyx_L1_error)
23061 #else
23062 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_13);
23063 #endif
23064 __pyx_t_8 = __pyx_array_new(__pyx_t_11, sizeof(int), __pyx_t_9, "c", (char *) __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 61, __pyx_L1_error)
23065 __Pyx_GOTREF((PyObject *)__pyx_t_8);
23066 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
23067 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
23068
23069 __pyx_t_10 = 1;
23070 #if CYTHON_UNPACK_METHODS
23071 if (unlikely(PyMethod_Check(__pyx_t_12))) {
23072 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_12);
23073 assert(__pyx_t_2);
23074 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
23075 __Pyx_INCREF(__pyx_t_2);
23076 __Pyx_INCREF(__pyx__function);
23077 __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
23078 __pyx_t_10 = 0;
23079 }
23080 #endif
23081 {
23082 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_8)};
23083 __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
23084 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23085 __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
23086 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
23087 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error)
23088 __Pyx_GOTREF(__pyx_t_3);
23089 }
23090
23091 /* "cpartitioning.pyx":62
23092 * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
23093 * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
23094 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
23095 * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
23096 * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
23097*/
23098 __pyx_t_2 = NULL;
23099 __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 62, __pyx_L1_error)
23100 __Pyx_GOTREF(__pyx_t_13);
23101 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 62, __pyx_L1_error)
23102 __Pyx_GOTREF(__pyx_t_11);
23103 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
23104 __pyx_t_5 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
23105
23106 __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 62, __pyx_L1_error)
23107 __Pyx_GOTREF(__pyx_t_13);
23108 __pyx_t_14 = __Pyx_PyLong_AddObjC(__pyx_t_13, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 62, __pyx_L1_error)
23109 __Pyx_GOTREF(__pyx_t_14);
23110 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
23111 __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 62, __pyx_L1_error)
23112 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
23113 if (!__pyx_t_5) {
23114 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
23115 __PYX_ERR(0, 62, __pyx_L1_error)
23116 }
23117 __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 62, __pyx_L1_error)
23118 __Pyx_GOTREF(__pyx_t_13);
23119 __pyx_t_14 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_7)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 62, __pyx_L1_error)
23120 __Pyx_GOTREF(__pyx_t_14);
23121 #if CYTHON_COMPILING_IN_LIMITED_API
23122 __pyx_t_9 = PyBytes_AsString(__pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 62, __pyx_L1_error)
23123 #else
23124 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_13);
23125 #endif
23126 __pyx_t_8 = __pyx_array_new(__pyx_t_14, sizeof(int), __pyx_t_9, "c", (char *) __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 62, __pyx_L1_error)
23127 __Pyx_GOTREF((PyObject *)__pyx_t_8);
23128 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
23129 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
23130
23131
23132 __pyx_t_10 = 1;
23133 #if CYTHON_UNPACK_METHODS
23134 if (unlikely(PyMethod_Check(__pyx_t_11))) {
23135 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11);
23136 assert(__pyx_t_2);
23137 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
23138 __Pyx_INCREF(__pyx_t_2);
23139 __Pyx_INCREF(__pyx__function);
23140 __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
23141 __pyx_t_10 = 0;
23142 }
23143 #endif
23144 {
23145 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_8)};
23146 __pyx_t_12 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
23147 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23148 __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
23149 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
23150 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 62, __pyx_L1_error)
23151 __Pyx_GOTREF(__pyx_t_12);
23152 }
23153
23154 /* "cpartitioning.pyx":63
23155 * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
23156 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
23157 * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
23158 * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
23159 * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
23160*/
23161 __pyx_t_2 = NULL;
23162 __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 63, __pyx_L1_error)
23163 __Pyx_GOTREF(__pyx_t_13);
23164 __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 63, __pyx_L1_error)
23165 __Pyx_GOTREF(__pyx_t_14);
23166 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
23167 __pyx_t_5 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
23168
23169 if (!__pyx_t_5) {
23170 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
23171 __PYX_ERR(0, 63, __pyx_L1_error)
23172 }
23173 __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 63, __pyx_L1_error)
23174 __Pyx_GOTREF(__pyx_t_15);
23175 __pyx_t_13 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 63, __pyx_L1_error)
23176 __Pyx_GOTREF(__pyx_t_13);
23177 #if CYTHON_COMPILING_IN_LIMITED_API
23178 __pyx_t_9 = PyBytes_AsString(__pyx_t_15); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 63, __pyx_L1_error)
23179 #else
23180 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_15);
23181 #endif
23182 __pyx_t_8 = __pyx_array_new(__pyx_t_13, sizeof(int), __pyx_t_9, "c", (char *) __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 63, __pyx_L1_error)
23183 __Pyx_GOTREF((PyObject *)__pyx_t_8);
23184 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
23185 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
23186
23187 __pyx_t_10 = 1;
23188 #if CYTHON_UNPACK_METHODS
23189 if (unlikely(PyMethod_Check(__pyx_t_14))) {
23190 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_14);
23191 assert(__pyx_t_2);
23192 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
23193 __Pyx_INCREF(__pyx_t_2);
23194 __Pyx_INCREF(__pyx__function);
23195 __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
23196 __pyx_t_10 = 0;
23197 }
23198 #endif
23199 {
23200 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_8)};
23201 __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
23202 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23203 __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
23204 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
23205 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 63, __pyx_L1_error)
23206 __Pyx_GOTREF(__pyx_t_11);
23207 }
23208
23209 /* "cpartitioning.pyx":64
23210 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
23211 * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
23212 * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
23213 * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
23214 * )
23215*/
23216 __pyx_t_2 = NULL;
23217 __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 64, __pyx_L1_error)
23218 __Pyx_GOTREF(__pyx_t_15);
23219 __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 64, __pyx_L1_error)
23220 __Pyx_GOTREF(__pyx_t_13);
23221 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
23222 __pyx_t_5 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
23223
23224 __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 64, __pyx_L1_error)
23225 __Pyx_GOTREF(__pyx_t_15);
23226 __pyx_t_16 = __Pyx_PyLong_AddObjC(__pyx_t_15, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 64, __pyx_L1_error)
23227 __Pyx_GOTREF(__pyx_t_16);
23228 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
23229 __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_16); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 64, __pyx_L1_error)
23230 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
23231 if (!__pyx_t_5) {
23232 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
23233 __PYX_ERR(0, 64, __pyx_L1_error)
23234 }
23235 __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 64, __pyx_L1_error)
23236 __Pyx_GOTREF(__pyx_t_15);
23237 __pyx_t_16 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_7)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 64, __pyx_L1_error)
23238 __Pyx_GOTREF(__pyx_t_16);
23239 #if CYTHON_COMPILING_IN_LIMITED_API
23240 __pyx_t_9 = PyBytes_AsString(__pyx_t_15); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 64, __pyx_L1_error)
23241 #else
23242 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_15);
23243 #endif
23244 __pyx_t_8 = __pyx_array_new(__pyx_t_16, sizeof(int), __pyx_t_9, "c", (char *) __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 64, __pyx_L1_error)
23245 __Pyx_GOTREF((PyObject *)__pyx_t_8);
23246 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
23247 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
23248
23249
23250 __pyx_t_10 = 1;
23251 #if CYTHON_UNPACK_METHODS
23252 if (unlikely(PyMethod_Check(__pyx_t_13))) {
23253 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_13);
23254 assert(__pyx_t_2);
23255 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
23256 __Pyx_INCREF(__pyx_t_2);
23257 __Pyx_INCREF(__pyx__function);
23258 __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
23259 __pyx_t_10 = 0;
23260 }
23261 #endif
23262 {
23263 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_8)};
23264 __pyx_t_14 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
23265 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23266 __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
23267 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
23268 if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 64, __pyx_L1_error)
23269 __Pyx_GOTREF(__pyx_t_14);
23270 }
23271
23272 /* "cpartitioning.pyx":65
23273 * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
23274 * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
23275 * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
23276 * )
23277 *
23278*/
23279 __pyx_t_2 = NULL;
23280 __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 65, __pyx_L1_error)
23281 __Pyx_GOTREF(__pyx_t_15);
23282 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 65, __pyx_L1_error)
23283 __Pyx_GOTREF(__pyx_t_16);
23284 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
23285 __pyx_t_5 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
23286
23287 if (!__pyx_t_5) {
23288 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
23289 __PYX_ERR(0, 65, __pyx_L1_error)
23290 }
23291 __pyx_t_17 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 65, __pyx_L1_error)
23292 __Pyx_GOTREF(__pyx_t_17);
23293 __pyx_t_15 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 65, __pyx_L1_error)
23294 __Pyx_GOTREF(__pyx_t_15);
23295 #if CYTHON_COMPILING_IN_LIMITED_API
23296 __pyx_t_9 = PyBytes_AsString(__pyx_t_17); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 65, __pyx_L1_error)
23297 #else
23298 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_17);
23299 #endif
23300 __pyx_t_8 = __pyx_array_new(__pyx_t_15, sizeof(int), __pyx_t_9, "c", (char *) __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 65, __pyx_L1_error)
23301 __Pyx_GOTREF((PyObject *)__pyx_t_8);
23302 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
23303 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
23304
23305 __pyx_t_10 = 1;
23306 #if CYTHON_UNPACK_METHODS
23307 if (unlikely(PyMethod_Check(__pyx_t_16))) {
23308 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_16);
23309 assert(__pyx_t_2);
23310 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
23311 __Pyx_INCREF(__pyx_t_2);
23312 __Pyx_INCREF(__pyx__function);
23313 __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
23314 __pyx_t_10 = 0;
23315 }
23316 #endif
23317 {
23318 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_8)};
23319 __pyx_t_13 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_16, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
23320 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23321 __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
23322 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
23323 if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 65, __pyx_L1_error)
23324 __Pyx_GOTREF(__pyx_t_13);
23325 }
23326
23327 /* "cpartitioning.pyx":58
23328 * nLayersOfOverlap)
23329 * return (
23330 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
23331 * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
23332 * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
23333*/
23334 __pyx_t_16 = PyTuple_New(8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 58, __pyx_L1_error)
23335 __Pyx_GOTREF(__pyx_t_16);
23336 __Pyx_GIVEREF(__pyx_t_1);
23337 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 58, __pyx_L1_error);
23338 __Pyx_GIVEREF(__pyx_t_4);
23339 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 58, __pyx_L1_error);
23340 __Pyx_GIVEREF(__pyx_t_6);
23341 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_6) != (0)) __PYX_ERR(0, 58, __pyx_L1_error);
23342 __Pyx_GIVEREF(__pyx_t_3);
23343 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_3) != (0)) __PYX_ERR(0, 58, __pyx_L1_error);
23344 __Pyx_GIVEREF(__pyx_t_12);
23345 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_12) != (0)) __PYX_ERR(0, 58, __pyx_L1_error);
23346 __Pyx_GIVEREF(__pyx_t_11);
23347 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_11) != (0)) __PYX_ERR(0, 58, __pyx_L1_error);
23348 __Pyx_GIVEREF(__pyx_t_14);
23349 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_t_14) != (0)) __PYX_ERR(0, 58, __pyx_L1_error);
23350 __Pyx_GIVEREF(__pyx_t_13);
23351 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_t_13) != (0)) __PYX_ERR(0, 58, __pyx_L1_error);
23352 __pyx_t_1 = 0;
23353 __pyx_t_4 = 0;
23354 __pyx_t_6 = 0;
23355 __pyx_t_3 = 0;
23356 __pyx_t_12 = 0;
23357 __pyx_t_11 = 0;
23358 __pyx_t_14 = 0;
23359 __pyx_t_13 = 0;
23360 {
23361 PyObject *__pyx_temp;
23362 {
23363 __pyx_temp = __pyx_r;
23364 __pyx_r = __pyx_t_16;
23365 }
23366 __Pyx_XDECREF(__pyx_temp);
23367 }
23368 __pyx_t_16 = 0;
23369 goto __pyx_L0;
23370
23371 /* "cpartitioning.pyx":52
23372 * )
23373 *
23374 * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23375 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23376 * c_partitionNodes(comm.ob_mpi,
23377*/
23378
23379 /* function exit code */
23380 __pyx_L1_error:;
23381 __Pyx_XDECREF(__pyx_t_1);
23382 __Pyx_XDECREF(__pyx_t_2);
23383 __Pyx_XDECREF(__pyx_t_3);
23384 __Pyx_XDECREF(__pyx_t_4);
23385 __Pyx_XDECREF(__pyx_t_6);
23386 __Pyx_XDECREF((PyObject *)__pyx_t_8);
23387 __Pyx_XDECREF(__pyx_t_11);
23388 __Pyx_XDECREF(__pyx_t_12);
23389 __Pyx_XDECREF(__pyx_t_13);
23390 __Pyx_XDECREF(__pyx_t_14);
23391 __Pyx_XDECREF(__pyx_t_15);
23392 __Pyx_XDECREF(__pyx_t_16);
23393 __Pyx_XDECREF(__pyx_t_17);
23394 __Pyx_AddTraceback("cpartitioning.partitionNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
23395 __pyx_r = NULL;
23396 __pyx_L0:;
23397 __Pyx_XGIVEREF(__pyx_r);
23398 __Pyx_RefNannyFinishContext();
23399 return __pyx_r;
23400}
23401
23402/* "cpartitioning.pyx":68
23403 * )
23404 *
23405 * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
23406 * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
23407 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23408*/
23409
23410/* Python wrapper */
23411static PyObject *__pyx_pw_13cpartitioning_5convertPUMIPartitionToPython(PyObject *__pyx_self,
23412#if CYTHON_VECTORCALL
23413PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23414#else
23415PyObject *__pyx_args, PyObject *__pyx_kwds
23416#endif
23417); /*proto*/
23418static PyMethodDef __pyx_mdef_13cpartitioning_5convertPUMIPartitionToPython = {"convertPUMIPartitionToPython", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cpartitioning_5convertPUMIPartitionToPython, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
23419static PyObject *__pyx_pw_13cpartitioning_5convertPUMIPartitionToPython(PyObject *__pyx_self,
23420#if CYTHON_VECTORCALL
23421PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
23422#else
23423PyObject *__pyx_args, PyObject *__pyx_kwds
23424#endif
23425) {
23426 CYTHON_UNUSED struct PyMPICommObject *__pyx_v_comm = 0;
23427 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
23428 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
23429 #if !CYTHON_VECTORCALL
23430 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
23431 #endif
23432 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
23433 PyObject* values[3] = {0,0,0};
23434 int __pyx_lineno = 0;
23435 const char *__pyx_filename = NULL;
23436 int __pyx_clineno = 0;
23437 PyObject *__pyx_r = 0;
23438 __Pyx_RefNannyDeclarations
23439 __Pyx_RefNannySetupContext("convertPUMIPartitionToPython (wrapper)", 0);
23440 #if !CYTHON_VECTORCALL
23441 #if CYTHON_ASSUME_SAFE_SIZE
23442 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
23443 #else
23444 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
23445 #endif
23446 #endif
23447 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
23448 {
23449 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,&__pyx_mstate_global->__pyx_n_u_cmesh,&__pyx_mstate_global->__pyx_n_u_subdomain_cmesh,0};
23450 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
23451 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 68, __pyx_L3_error)
23452 if (__pyx_kwds_len > 0) {
23453 switch (__pyx_nargs) {
23454 case 3:
23455 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
23456 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 68, __pyx_L3_error)
23457 CYTHON_FALLTHROUGH;
23458 case 2:
23459 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
23460 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 68, __pyx_L3_error)
23461 CYTHON_FALLTHROUGH;
23462 case 1:
23463 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
23464 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 68, __pyx_L3_error)
23465 CYTHON_FALLTHROUGH;
23466 case 0: break;
23467 default: goto __pyx_L5_argtuple_error;
23468 }
23469 const Py_ssize_t kwd_pos_args = __pyx_nargs;
23470 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "convertPUMIPartitionToPython", 0) < (0)) __PYX_ERR(0, 68, __pyx_L3_error)
23471 for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
23472 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("convertPUMIPartitionToPython", 1, 3, 3, i); __PYX_ERR(0, 68, __pyx_L3_error) }
23473 }
23474 } else if (unlikely(__pyx_nargs != 3)) {
23475 goto __pyx_L5_argtuple_error;
23476 } else {
23477 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
23478 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 68, __pyx_L3_error)
23479 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
23480 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 68, __pyx_L3_error)
23481 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
23482 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 68, __pyx_L3_error)
23483 }
23484 __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
23485 __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[1]);
23486 __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
23487 }
23488 goto __pyx_L6_skip;
23489 __pyx_L5_argtuple_error:;
23490 __Pyx_RaiseArgtupleInvalid("convertPUMIPartitionToPython", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 68, __pyx_L3_error)
23491 __pyx_L6_skip:;
23492 goto __pyx_L4_argument_unpacking_done;
23493 __pyx_L3_error:;
23494 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23495 Py_XDECREF(values[__pyx_temp]);
23496 }
23497 __Pyx_AddTraceback("cpartitioning.convertPUMIPartitionToPython", __pyx_clineno, __pyx_lineno, __pyx_filename);
23498 __Pyx_RefNannyFinishContext();
23499 return NULL;
23500 __pyx_L4_argument_unpacking_done:;
23501 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 68, __pyx_L1_error)
23502 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_mstate_global->__pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 68, __pyx_L1_error)
23503 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_mstate_global->__pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 68, __pyx_L1_error)
23504 __pyx_r = __pyx_pf_13cpartitioning_4convertPUMIPartitionToPython(__pyx_self, __pyx_v_comm, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
23505
23506 /* function exit code */
23507 goto __pyx_L0;
23508 __pyx_L1_error:;
23509 __pyx_r = NULL;
23510 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23511 Py_XDECREF(values[__pyx_temp]);
23512 }
23513 goto __pyx_L7_cleaned_up;
23514 __pyx_L0:;
23515 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23516 Py_XDECREF(values[__pyx_temp]);
23517 }
23518 __pyx_L7_cleaned_up:;
23519 __Pyx_RefNannyFinishContext();
23520 return __pyx_r;
23521}
23522
23523static PyObject *__pyx_pf_13cpartitioning_4convertPUMIPartitionToPython(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED struct PyMPICommObject *__pyx_v_comm, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
23524 PyObject *__pyx_r = NULL;
23525 __Pyx_RefNannyDeclarations
23526 PyObject *__pyx_t_1 = NULL;
23527 PyObject *__pyx_t_2 = NULL;
23528 PyObject *__pyx_t_3 = NULL;
23529 PyObject *__pyx_t_4 = NULL;
23530 int *__pyx_t_5;
23531 PyObject *__pyx_t_6 = NULL;
23532 Py_ssize_t __pyx_t_7;
23533 struct __pyx_array_obj *__pyx_t_8 = NULL;
23534 char *__pyx_t_9;
23535 size_t __pyx_t_10;
23536 PyObject *__pyx_t_11 = NULL;
23537 PyObject *__pyx_t_12 = NULL;
23538 PyObject *__pyx_t_13 = NULL;
23539 PyObject *__pyx_t_14 = NULL;
23540 PyObject *__pyx_t_15 = NULL;
23541 PyObject *__pyx_t_16 = NULL;
23542 PyObject *__pyx_t_17 = NULL;
23543 int __pyx_lineno = 0;
23544 const char *__pyx_filename = NULL;
23545 int __pyx_clineno = 0;
23546 __Pyx_RefNannySetupContext("convertPUMIPartitionToPython", 0);
23547
23548 /* "cpartitioning.pyx":70
23549 * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
23550 * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
23551 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
23552 * return (
23553 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
23554*/
23555 __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
23556
23557 /* "cpartitioning.pyx":72
23558 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
23559 * return (
23560 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
23561 * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
23562 * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
23563*/
23564 __pyx_t_2 = NULL;
23565 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error)
23566 __Pyx_GOTREF(__pyx_t_3);
23567 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error)
23568 __Pyx_GOTREF(__pyx_t_4);
23569 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23570 __pyx_t_5 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
23571
23572 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error)
23573 __Pyx_GOTREF(__pyx_t_3);
23574 __pyx_t_6 = __Pyx_PyLong_AddObjC(__pyx_t_3, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 72, __pyx_L1_error)
23575 __Pyx_GOTREF(__pyx_t_6);
23576 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23577 __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L1_error)
23578 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23579 if (!__pyx_t_5) {
23580 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
23581 __PYX_ERR(0, 72, __pyx_L1_error)
23582 }
23583 __pyx_t_3 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error)
23584 __Pyx_GOTREF(__pyx_t_3);
23585 __pyx_t_6 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_7)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 72, __pyx_L1_error)
23586 __Pyx_GOTREF(__pyx_t_6);
23587 #if CYTHON_COMPILING_IN_LIMITED_API
23588 __pyx_t_9 = PyBytes_AsString(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 72, __pyx_L1_error)
23589 #else
23590 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_3);
23591 #endif
23592 __pyx_t_8 = __pyx_array_new(__pyx_t_6, sizeof(int), __pyx_t_9, "c", (char *) __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 72, __pyx_L1_error)
23593 __Pyx_GOTREF((PyObject *)__pyx_t_8);
23594 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23595 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23596
23597
23598 __pyx_t_10 = 1;
23599 #if CYTHON_UNPACK_METHODS
23600 if (unlikely(PyMethod_Check(__pyx_t_4))) {
23601 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
23602 assert(__pyx_t_2);
23603 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
23604 __Pyx_INCREF(__pyx_t_2);
23605 __Pyx_INCREF(__pyx__function);
23606 __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
23607 __pyx_t_10 = 0;
23608 }
23609 #endif
23610 {
23611 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_8)};
23612 __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
23613 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23614 __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
23615 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23616 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error)
23617 __Pyx_GOTREF(__pyx_t_1);
23618 }
23619
23620 /* "cpartitioning.pyx":73
23621 * return (
23622 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
23623 * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
23624 * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
23625 * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
23626*/
23627 __pyx_t_2 = NULL;
23628 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error)
23629 __Pyx_GOTREF(__pyx_t_3);
23630 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 73, __pyx_L1_error)
23631 __Pyx_GOTREF(__pyx_t_6);
23632 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23633 __pyx_t_5 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
23634
23635 if (!__pyx_t_5) {
23636 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
23637 __PYX_ERR(0, 73, __pyx_L1_error)
23638 }
23639 __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 73, __pyx_L1_error)
23640 __Pyx_GOTREF(__pyx_t_11);
23641 __pyx_t_3 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error)
23642 __Pyx_GOTREF(__pyx_t_3);
23643 #if CYTHON_COMPILING_IN_LIMITED_API
23644 __pyx_t_9 = PyBytes_AsString(__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 73, __pyx_L1_error)
23645 #else
23646 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_11);
23647 #endif
23648 __pyx_t_8 = __pyx_array_new(__pyx_t_3, sizeof(int), __pyx_t_9, "c", (char *) __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 73, __pyx_L1_error)
23649 __Pyx_GOTREF((PyObject *)__pyx_t_8);
23650 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23651 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
23652
23653 __pyx_t_10 = 1;
23654 #if CYTHON_UNPACK_METHODS
23655 if (unlikely(PyMethod_Check(__pyx_t_6))) {
23656 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
23657 assert(__pyx_t_2);
23658 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
23659 __Pyx_INCREF(__pyx_t_2);
23660 __Pyx_INCREF(__pyx__function);
23661 __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
23662 __pyx_t_10 = 0;
23663 }
23664 #endif
23665 {
23666 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_8)};
23667 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
23668 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23669 __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
23670 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23671 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error)
23672 __Pyx_GOTREF(__pyx_t_4);
23673 }
23674
23675 /* "cpartitioning.pyx":74
23676 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
23677 * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
23678 * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
23679 * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
23680 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
23681*/
23682 __pyx_t_2 = NULL;
23683 __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 74, __pyx_L1_error)
23684 __Pyx_GOTREF(__pyx_t_11);
23685 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error)
23686 __Pyx_GOTREF(__pyx_t_3);
23687 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
23688 __pyx_t_5 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
23689
23690 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 74, __pyx_L1_error)
23691 __Pyx_GOTREF(__pyx_t_11);
23692 __pyx_t_12 = __Pyx_PyLong_AddObjC(__pyx_t_11, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 74, __pyx_L1_error)
23693 __Pyx_GOTREF(__pyx_t_12);
23694 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
23695 __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 74, __pyx_L1_error)
23696 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
23697 if (!__pyx_t_5) {
23698 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
23699 __PYX_ERR(0, 74, __pyx_L1_error)
23700 }
23701 __pyx_t_11 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 74, __pyx_L1_error)
23702 __Pyx_GOTREF(__pyx_t_11);
23703 __pyx_t_12 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_7)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 74, __pyx_L1_error)
23704 __Pyx_GOTREF(__pyx_t_12);
23705 #if CYTHON_COMPILING_IN_LIMITED_API
23706 __pyx_t_9 = PyBytes_AsString(__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 74, __pyx_L1_error)
23707 #else
23708 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_11);
23709 #endif
23710 __pyx_t_8 = __pyx_array_new(__pyx_t_12, sizeof(int), __pyx_t_9, "c", (char *) __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 74, __pyx_L1_error)
23711 __Pyx_GOTREF((PyObject *)__pyx_t_8);
23712 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
23713 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
23714
23715
23716 __pyx_t_10 = 1;
23717 #if CYTHON_UNPACK_METHODS
23718 if (unlikely(PyMethod_Check(__pyx_t_3))) {
23719 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
23720 assert(__pyx_t_2);
23721 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
23722 __Pyx_INCREF(__pyx_t_2);
23723 __Pyx_INCREF(__pyx__function);
23724 __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
23725 __pyx_t_10 = 0;
23726 }
23727 #endif
23728 {
23729 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_8)};
23730 __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
23731 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23732 __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
23733 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23734 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 74, __pyx_L1_error)
23735 __Pyx_GOTREF(__pyx_t_6);
23736 }
23737
23738 /* "cpartitioning.pyx":75
23739 * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
23740 * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
23741 * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
23742 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
23743 * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
23744*/
23745 __pyx_t_2 = NULL;
23746 __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 75, __pyx_L1_error)
23747 __Pyx_GOTREF(__pyx_t_11);
23748 __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 75, __pyx_L1_error)
23749 __Pyx_GOTREF(__pyx_t_12);
23750 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
23751 __pyx_t_5 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
23752
23753 if (!__pyx_t_5) {
23754 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
23755 __PYX_ERR(0, 75, __pyx_L1_error)
23756 }
23757 __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 75, __pyx_L1_error)
23758 __Pyx_GOTREF(__pyx_t_13);
23759 __pyx_t_11 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 75, __pyx_L1_error)
23760 __Pyx_GOTREF(__pyx_t_11);
23761 #if CYTHON_COMPILING_IN_LIMITED_API
23762 __pyx_t_9 = PyBytes_AsString(__pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 75, __pyx_L1_error)
23763 #else
23764 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_13);
23765 #endif
23766 __pyx_t_8 = __pyx_array_new(__pyx_t_11, sizeof(int), __pyx_t_9, "c", (char *) __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 75, __pyx_L1_error)
23767 __Pyx_GOTREF((PyObject *)__pyx_t_8);
23768 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
23769 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
23770
23771 __pyx_t_10 = 1;
23772 #if CYTHON_UNPACK_METHODS
23773 if (unlikely(PyMethod_Check(__pyx_t_12))) {
23774 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_12);
23775 assert(__pyx_t_2);
23776 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
23777 __Pyx_INCREF(__pyx_t_2);
23778 __Pyx_INCREF(__pyx__function);
23779 __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
23780 __pyx_t_10 = 0;
23781 }
23782 #endif
23783 {
23784 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_8)};
23785 __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_12, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
23786 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23787 __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
23788 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
23789 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error)
23790 __Pyx_GOTREF(__pyx_t_3);
23791 }
23792
23793 /* "cpartitioning.pyx":76
23794 * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
23795 * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
23796 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
23797 * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
23798 * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
23799*/
23800 __pyx_t_2 = NULL;
23801 __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 76, __pyx_L1_error)
23802 __Pyx_GOTREF(__pyx_t_13);
23803 __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 76, __pyx_L1_error)
23804 __Pyx_GOTREF(__pyx_t_11);
23805 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
23806 __pyx_t_5 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
23807
23808 __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 76, __pyx_L1_error)
23809 __Pyx_GOTREF(__pyx_t_13);
23810 __pyx_t_14 = __Pyx_PyLong_AddObjC(__pyx_t_13, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 76, __pyx_L1_error)
23811 __Pyx_GOTREF(__pyx_t_14);
23812 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
23813 __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L1_error)
23814 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
23815 if (!__pyx_t_5) {
23816 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
23817 __PYX_ERR(0, 76, __pyx_L1_error)
23818 }
23819 __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 76, __pyx_L1_error)
23820 __Pyx_GOTREF(__pyx_t_13);
23821 __pyx_t_14 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_7)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 76, __pyx_L1_error)
23822 __Pyx_GOTREF(__pyx_t_14);
23823 #if CYTHON_COMPILING_IN_LIMITED_API
23824 __pyx_t_9 = PyBytes_AsString(__pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 76, __pyx_L1_error)
23825 #else
23826 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_13);
23827 #endif
23828 __pyx_t_8 = __pyx_array_new(__pyx_t_14, sizeof(int), __pyx_t_9, "c", (char *) __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 76, __pyx_L1_error)
23829 __Pyx_GOTREF((PyObject *)__pyx_t_8);
23830 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
23831 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
23832
23833
23834 __pyx_t_10 = 1;
23835 #if CYTHON_UNPACK_METHODS
23836 if (unlikely(PyMethod_Check(__pyx_t_11))) {
23837 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11);
23838 assert(__pyx_t_2);
23839 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_11);
23840 __Pyx_INCREF(__pyx_t_2);
23841 __Pyx_INCREF(__pyx__function);
23842 __Pyx_DECREF_SET(__pyx_t_11, __pyx__function);
23843 __pyx_t_10 = 0;
23844 }
23845 #endif
23846 {
23847 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_8)};
23848 __pyx_t_12 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_11, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
23849 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23850 __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
23851 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
23852 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 76, __pyx_L1_error)
23853 __Pyx_GOTREF(__pyx_t_12);
23854 }
23855
23856 /* "cpartitioning.pyx":77
23857 * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
23858 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
23859 * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
23860 * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
23861 * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
23862*/
23863 __pyx_t_2 = NULL;
23864 __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 77, __pyx_L1_error)
23865 __Pyx_GOTREF(__pyx_t_13);
23866 __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 77, __pyx_L1_error)
23867 __Pyx_GOTREF(__pyx_t_14);
23868 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
23869 __pyx_t_5 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
23870
23871 if (!__pyx_t_5) {
23872 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
23873 __PYX_ERR(0, 77, __pyx_L1_error)
23874 }
23875 __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 77, __pyx_L1_error)
23876 __Pyx_GOTREF(__pyx_t_15);
23877 __pyx_t_13 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 77, __pyx_L1_error)
23878 __Pyx_GOTREF(__pyx_t_13);
23879 #if CYTHON_COMPILING_IN_LIMITED_API
23880 __pyx_t_9 = PyBytes_AsString(__pyx_t_15); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 77, __pyx_L1_error)
23881 #else
23882 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_15);
23883 #endif
23884 __pyx_t_8 = __pyx_array_new(__pyx_t_13, sizeof(int), __pyx_t_9, "c", (char *) __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 77, __pyx_L1_error)
23885 __Pyx_GOTREF((PyObject *)__pyx_t_8);
23886 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
23887 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
23888
23889 __pyx_t_10 = 1;
23890 #if CYTHON_UNPACK_METHODS
23891 if (unlikely(PyMethod_Check(__pyx_t_14))) {
23892 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_14);
23893 assert(__pyx_t_2);
23894 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
23895 __Pyx_INCREF(__pyx_t_2);
23896 __Pyx_INCREF(__pyx__function);
23897 __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
23898 __pyx_t_10 = 0;
23899 }
23900 #endif
23901 {
23902 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_8)};
23903 __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
23904 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23905 __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
23906 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
23907 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 77, __pyx_L1_error)
23908 __Pyx_GOTREF(__pyx_t_11);
23909 }
23910
23911 /* "cpartitioning.pyx":78
23912 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
23913 * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
23914 * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
23915 * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
23916 * )
23917*/
23918 __pyx_t_2 = NULL;
23919 __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 78, __pyx_L1_error)
23920 __Pyx_GOTREF(__pyx_t_15);
23921 __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 78, __pyx_L1_error)
23922 __Pyx_GOTREF(__pyx_t_13);
23923 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
23924 __pyx_t_5 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
23925
23926 __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 78, __pyx_L1_error)
23927 __Pyx_GOTREF(__pyx_t_15);
23928 __pyx_t_16 = __Pyx_PyLong_AddObjC(__pyx_t_15, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 78, __pyx_L1_error)
23929 __Pyx_GOTREF(__pyx_t_16);
23930 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
23931 __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_16); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L1_error)
23932 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
23933 if (!__pyx_t_5) {
23934 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
23935 __PYX_ERR(0, 78, __pyx_L1_error)
23936 }
23937 __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 78, __pyx_L1_error)
23938 __Pyx_GOTREF(__pyx_t_15);
23939 __pyx_t_16 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_7)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 78, __pyx_L1_error)
23940 __Pyx_GOTREF(__pyx_t_16);
23941 #if CYTHON_COMPILING_IN_LIMITED_API
23942 __pyx_t_9 = PyBytes_AsString(__pyx_t_15); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 78, __pyx_L1_error)
23943 #else
23944 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_15);
23945 #endif
23946 __pyx_t_8 = __pyx_array_new(__pyx_t_16, sizeof(int), __pyx_t_9, "c", (char *) __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 78, __pyx_L1_error)
23947 __Pyx_GOTREF((PyObject *)__pyx_t_8);
23948 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
23949 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
23950
23951
23952 __pyx_t_10 = 1;
23953 #if CYTHON_UNPACK_METHODS
23954 if (unlikely(PyMethod_Check(__pyx_t_13))) {
23955 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_13);
23956 assert(__pyx_t_2);
23957 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
23958 __Pyx_INCREF(__pyx_t_2);
23959 __Pyx_INCREF(__pyx__function);
23960 __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
23961 __pyx_t_10 = 0;
23962 }
23963 #endif
23964 {
23965 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_8)};
23966 __pyx_t_14 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
23967 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
23968 __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
23969 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
23970 if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 78, __pyx_L1_error)
23971 __Pyx_GOTREF(__pyx_t_14);
23972 }
23973
23974 /* "cpartitioning.pyx":79
23975 * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
23976 * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
23977 * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
23978 * )
23979 *
23980*/
23981 __pyx_t_2 = NULL;
23982 __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 79, __pyx_L1_error)
23983 __Pyx_GOTREF(__pyx_t_15);
23984 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 79, __pyx_L1_error)
23985 __Pyx_GOTREF(__pyx_t_16);
23986 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
23987 __pyx_t_5 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
23988
23989 if (!__pyx_t_5) {
23990 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
23991 __PYX_ERR(0, 79, __pyx_L1_error)
23992 }
23993 __pyx_t_17 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 79, __pyx_L1_error)
23994 __Pyx_GOTREF(__pyx_t_17);
23995 __pyx_t_15 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 79, __pyx_L1_error)
23996 __Pyx_GOTREF(__pyx_t_15);
23997 #if CYTHON_COMPILING_IN_LIMITED_API
23998 __pyx_t_9 = PyBytes_AsString(__pyx_t_17); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 79, __pyx_L1_error)
23999 #else
24000 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_17);
24001 #endif
24002 __pyx_t_8 = __pyx_array_new(__pyx_t_15, sizeof(int), __pyx_t_9, "c", (char *) __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 79, __pyx_L1_error)
24003 __Pyx_GOTREF((PyObject *)__pyx_t_8);
24004 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
24005 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
24006
24007 __pyx_t_10 = 1;
24008 #if CYTHON_UNPACK_METHODS
24009 if (unlikely(PyMethod_Check(__pyx_t_16))) {
24010 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_16);
24011 assert(__pyx_t_2);
24012 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
24013 __Pyx_INCREF(__pyx_t_2);
24014 __Pyx_INCREF(__pyx__function);
24015 __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
24016 __pyx_t_10 = 0;
24017 }
24018 #endif
24019 {
24020 PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_8)};
24021 __pyx_t_13 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_16, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
24022 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
24023 __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
24024 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
24025 if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 79, __pyx_L1_error)
24026 __Pyx_GOTREF(__pyx_t_13);
24027 }
24028
24029 /* "cpartitioning.pyx":72
24030 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
24031 * return (
24032 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
24033 * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
24034 * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
24035*/
24036 __pyx_t_16 = PyTuple_New(8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 72, __pyx_L1_error)
24037 __Pyx_GOTREF(__pyx_t_16);
24038 __Pyx_GIVEREF(__pyx_t_1);
24039 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 72, __pyx_L1_error);
24040 __Pyx_GIVEREF(__pyx_t_4);
24041 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 72, __pyx_L1_error);
24042 __Pyx_GIVEREF(__pyx_t_6);
24043 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_6) != (0)) __PYX_ERR(0, 72, __pyx_L1_error);
24044 __Pyx_GIVEREF(__pyx_t_3);
24045 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_3) != (0)) __PYX_ERR(0, 72, __pyx_L1_error);
24046 __Pyx_GIVEREF(__pyx_t_12);
24047 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_12) != (0)) __PYX_ERR(0, 72, __pyx_L1_error);
24048 __Pyx_GIVEREF(__pyx_t_11);
24049 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 5, __pyx_t_11) != (0)) __PYX_ERR(0, 72, __pyx_L1_error);
24050 __Pyx_GIVEREF(__pyx_t_14);
24051 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 6, __pyx_t_14) != (0)) __PYX_ERR(0, 72, __pyx_L1_error);
24052 __Pyx_GIVEREF(__pyx_t_13);
24053 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_t_13) != (0)) __PYX_ERR(0, 72, __pyx_L1_error);
24054 __pyx_t_1 = 0;
24055 __pyx_t_4 = 0;
24056 __pyx_t_6 = 0;
24057 __pyx_t_3 = 0;
24058 __pyx_t_12 = 0;
24059 __pyx_t_11 = 0;
24060 __pyx_t_14 = 0;
24061 __pyx_t_13 = 0;
24062 {
24063 PyObject *__pyx_temp;
24064 {
24065 __pyx_temp = __pyx_r;
24066 __pyx_r = __pyx_t_16;
24067 }
24068 __Pyx_XDECREF(__pyx_temp);
24069 }
24070 __pyx_t_16 = 0;
24071 goto __pyx_L0;
24072
24073 /* "cpartitioning.pyx":68
24074 * )
24075 *
24076 * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
24077 * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
24078 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
24079*/
24080
24081 /* function exit code */
24082 __pyx_L1_error:;
24083 __Pyx_XDECREF(__pyx_t_1);
24084 __Pyx_XDECREF(__pyx_t_2);
24085 __Pyx_XDECREF(__pyx_t_3);
24086 __Pyx_XDECREF(__pyx_t_4);
24087 __Pyx_XDECREF(__pyx_t_6);
24088 __Pyx_XDECREF((PyObject *)__pyx_t_8);
24089 __Pyx_XDECREF(__pyx_t_11);
24090 __Pyx_XDECREF(__pyx_t_12);
24091 __Pyx_XDECREF(__pyx_t_13);
24092 __Pyx_XDECREF(__pyx_t_14);
24093 __Pyx_XDECREF(__pyx_t_15);
24094 __Pyx_XDECREF(__pyx_t_16);
24095 __Pyx_XDECREF(__pyx_t_17);
24096 __Pyx_AddTraceback("cpartitioning.convertPUMIPartitionToPython", __pyx_clineno, __pyx_lineno, __pyx_filename);
24097 __pyx_r = NULL;
24098 __pyx_L0:;
24099 __Pyx_XGIVEREF(__pyx_r);
24100 __Pyx_RefNannyFinishContext();
24101 return __pyx_r;
24102}
24103
24104/* "cpartitioning.pyx":82
24105 * )
24106 *
24107 * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh, double memHardLimit): # <<<<<<<<<<<<<<
24108 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
24109 * if not isinstance(filebase, bytes):
24110*/
24111
24112/* Python wrapper */
24113static PyObject *__pyx_pw_13cpartitioning_7partitionNodesFromTetgenFiles(PyObject *__pyx_self,
24114#if CYTHON_VECTORCALL
24115PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24116#else
24117PyObject *__pyx_args, PyObject *__pyx_kwds
24118#endif
24119); /*proto*/
24120static PyMethodDef __pyx_mdef_13cpartitioning_7partitionNodesFromTetgenFiles = {"partitionNodesFromTetgenFiles", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cpartitioning_7partitionNodesFromTetgenFiles, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
24121static PyObject *__pyx_pw_13cpartitioning_7partitionNodesFromTetgenFiles(PyObject *__pyx_self,
24122#if CYTHON_VECTORCALL
24123PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24124#else
24125PyObject *__pyx_args, PyObject *__pyx_kwds
24126#endif
24127) {
24128 struct PyMPICommObject *__pyx_v_comm = 0;
24129 PyObject *__pyx_v_filebase = 0;
24130 int __pyx_v_indexBase;
24131 int __pyx_v_nLayersOfOverlap;
24132 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
24133 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
24134 double __pyx_v_memHardLimit;
24135 #if !CYTHON_VECTORCALL
24136 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
24137 #endif
24138 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
24139 PyObject* values[7] = {0,0,0,0,0,0,0};
24140 int __pyx_lineno = 0;
24141 const char *__pyx_filename = NULL;
24142 int __pyx_clineno = 0;
24143 PyObject *__pyx_r = 0;
24144 __Pyx_RefNannyDeclarations
24145 __Pyx_RefNannySetupContext("partitionNodesFromTetgenFiles (wrapper)", 0);
24146 #if !CYTHON_VECTORCALL
24147 #if CYTHON_ASSUME_SAFE_SIZE
24148 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
24149 #else
24150 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
24151 #endif
24152 #endif
24153 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
24154 {
24155 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,&__pyx_mstate_global->__pyx_n_u_filebase,&__pyx_mstate_global->__pyx_n_u_indexBase,&__pyx_mstate_global->__pyx_n_u_nLayersOfOverlap,&__pyx_mstate_global->__pyx_n_u_cmesh,&__pyx_mstate_global->__pyx_n_u_subdomain_cmesh,&__pyx_mstate_global->__pyx_n_u_memHardLimit,0};
24156 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
24157 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 82, __pyx_L3_error)
24158 if (__pyx_kwds_len > 0) {
24159 switch (__pyx_nargs) {
24160 case 7:
24161 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
24162 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 82, __pyx_L3_error)
24163 CYTHON_FALLTHROUGH;
24164 case 6:
24165 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
24166 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 82, __pyx_L3_error)
24167 CYTHON_FALLTHROUGH;
24168 case 5:
24169 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
24170 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 82, __pyx_L3_error)
24171 CYTHON_FALLTHROUGH;
24172 case 4:
24173 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
24174 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 82, __pyx_L3_error)
24175 CYTHON_FALLTHROUGH;
24176 case 3:
24177 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
24178 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 82, __pyx_L3_error)
24179 CYTHON_FALLTHROUGH;
24180 case 2:
24181 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
24182 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 82, __pyx_L3_error)
24183 CYTHON_FALLTHROUGH;
24184 case 1:
24185 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24186 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 82, __pyx_L3_error)
24187 CYTHON_FALLTHROUGH;
24188 case 0: break;
24189 default: goto __pyx_L5_argtuple_error;
24190 }
24191 const Py_ssize_t kwd_pos_args = __pyx_nargs;
24192 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "partitionNodesFromTetgenFiles", 0) < (0)) __PYX_ERR(0, 82, __pyx_L3_error)
24193 for (Py_ssize_t i = __pyx_nargs; i < 7; i++) {
24194 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 7, 7, i); __PYX_ERR(0, 82, __pyx_L3_error) }
24195 }
24196 } else if (unlikely(__pyx_nargs != 7)) {
24197 goto __pyx_L5_argtuple_error;
24198 } else {
24199 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24200 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 82, __pyx_L3_error)
24201 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
24202 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 82, __pyx_L3_error)
24203 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
24204 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 82, __pyx_L3_error)
24205 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
24206 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 82, __pyx_L3_error)
24207 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
24208 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 82, __pyx_L3_error)
24209 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
24210 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 82, __pyx_L3_error)
24211 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
24212 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 82, __pyx_L3_error)
24213 }
24214 __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
24215 __pyx_v_filebase = values[1];
24216 __pyx_v_indexBase = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_indexBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L3_error)
24217 __pyx_v_nLayersOfOverlap = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nLayersOfOverlap == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L3_error)
24218 __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[4]);
24219 __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[5]);
24220 __pyx_v_memHardLimit = __Pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_memHardLimit == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L3_error)
24221 }
24222 goto __pyx_L6_skip;
24223 __pyx_L5_argtuple_error:;
24224 __Pyx_RaiseArgtupleInvalid("partitionNodesFromTetgenFiles", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 82, __pyx_L3_error)
24225 __pyx_L6_skip:;
24226 goto __pyx_L4_argument_unpacking_done;
24227 __pyx_L3_error:;
24228 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24229 Py_XDECREF(values[__pyx_temp]);
24230 }
24231 __Pyx_AddTraceback("cpartitioning.partitionNodesFromTetgenFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
24232 __Pyx_RefNannyFinishContext();
24233 return NULL;
24234 __pyx_L4_argument_unpacking_done:;
24235 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 82, __pyx_L1_error)
24236 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_mstate_global->__pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 82, __pyx_L1_error)
24237 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_mstate_global->__pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 82, __pyx_L1_error)
24238 __pyx_r = __pyx_pf_13cpartitioning_6partitionNodesFromTetgenFiles(__pyx_self, __pyx_v_comm, __pyx_v_filebase, __pyx_v_indexBase, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh, __pyx_v_memHardLimit);
24239
24240 /* function exit code */
24241 goto __pyx_L0;
24242 __pyx_L1_error:;
24243 __pyx_r = NULL;
24244 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24245 Py_XDECREF(values[__pyx_temp]);
24246 }
24247 goto __pyx_L7_cleaned_up;
24248 __pyx_L0:;
24249 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24250 Py_XDECREF(values[__pyx_temp]);
24251 }
24252 __pyx_L7_cleaned_up:;
24253
24254
24255
24256 __Pyx_RefNannyFinishContext();
24257 return __pyx_r;
24258}
24259
24260static PyObject *__pyx_pf_13cpartitioning_6partitionNodesFromTetgenFiles(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, PyObject *__pyx_v_filebase, int __pyx_v_indexBase, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, double __pyx_v_memHardLimit) {
24261 PyObject *__pyx_r = NULL;
24262 __Pyx_RefNannyDeclarations
24263 int __pyx_t_1;
24264 int __pyx_t_2;
24265 PyObject *__pyx_t_3 = NULL;
24266 PyObject *__pyx_t_4 = NULL;
24267 size_t __pyx_t_5;
24268 char *__pyx_t_6;
24269 PyObject *__pyx_t_7 = NULL;
24270 PyObject *__pyx_t_8 = NULL;
24271 int *__pyx_t_9;
24272 PyObject *__pyx_t_10 = NULL;
24273 Py_ssize_t __pyx_t_11;
24274 struct __pyx_array_obj *__pyx_t_12 = NULL;
24275 PyObject *__pyx_t_13 = NULL;
24276 PyObject *__pyx_t_14 = NULL;
24277 PyObject *__pyx_t_15 = NULL;
24278 PyObject *__pyx_t_16 = NULL;
24279 PyObject *__pyx_t_17 = NULL;
24280 PyObject *__pyx_t_18 = NULL;
24281 PyObject *__pyx_t_19 = NULL;
24282 int __pyx_lineno = 0;
24283 const char *__pyx_filename = NULL;
24284 int __pyx_clineno = 0;
24285 __Pyx_RefNannySetupContext("partitionNodesFromTetgenFiles", 0);
24286 __Pyx_INCREF(__pyx_v_filebase);
24287
24288 /* "cpartitioning.pyx":83
24289 *
24290 * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh, double memHardLimit):
24291 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
24292 * if not isinstance(filebase, bytes):
24293 * filebase = filebase.encode()
24294*/
24295 __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
24296
24297 /* "cpartitioning.pyx":84
24298 * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh, double memHardLimit):
24299 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
24300 * if not isinstance(filebase, bytes): # <<<<<<<<<<<<<<
24301 * filebase = filebase.encode()
24302 * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
24303*/
24304 __pyx_t_1 = PyBytes_Check(__pyx_v_filebase);
24305 __pyx_t_2 = (!__pyx_t_1);
24306
24307
24308 if (__pyx_t_2) {
24309
24310
24311 /* "cpartitioning.pyx":85
24312 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
24313 * if not isinstance(filebase, bytes):
24314 * filebase = filebase.encode() # <<<<<<<<<<<<<<
24315 * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
24316 * <const char*>(<char*>filebase),
24317*/
24318 __pyx_t_4 = __pyx_v_filebase;
24319 __Pyx_INCREF(__pyx_t_4);
24320 __pyx_t_5 = 0;
24321 {
24322 PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
24323 __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
24324 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
24325 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
24326 __Pyx_GOTREF(__pyx_t_3);
24327 }
24328 __Pyx_DECREF_SET(__pyx_v_filebase, __pyx_t_3);
24329 __pyx_t_3 = 0;
24330
24331 /* "cpartitioning.pyx":84
24332 * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh, double memHardLimit):
24333 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
24334 * if not isinstance(filebase, bytes): # <<<<<<<<<<<<<<
24335 * filebase = filebase.encode()
24336 * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
24337*/
24338 }
24339
24340 /* "cpartitioning.pyx":87
24341 * filebase = filebase.encode()
24342 * c_partitionNodesFromTetgenFiles(comm.ob_mpi,
24343 * <const char*>(<char*>filebase), # <<<<<<<<<<<<<<
24344 * indexBase,
24345 * cmesh.mesh,
24346*/
24347 __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_filebase); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L1_error)
24348
24349 /* "cpartitioning.pyx":86
24350 * if not isinstance(filebase, bytes):
24351 * filebase = filebase.encode()
24352 * c_partitionNodesFromTetgenFiles(comm.ob_mpi, # <<<<<<<<<<<<<<
24353 * <const char*>(<char*>filebase),
24354 * indexBase,
24355*/
24356 (void)(proteus::partitionNodesFromTetgenFiles(__pyx_v_comm->ob_mpi, ((char const *)((char *)__pyx_t_6)), __pyx_v_indexBase, __pyx_v_cmesh->mesh, __pyx_v_nLayersOfOverlap, __pyx_v_memHardLimit));
24357
24358
24359 /* "cpartitioning.pyx":93
24360 * memHardLimit)
24361 * return (
24362 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
24363 * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
24364 * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
24365*/
24366 __pyx_t_4 = NULL;
24367 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 93, __pyx_L1_error)
24368 __Pyx_GOTREF(__pyx_t_7);
24369 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 93, __pyx_L1_error)
24370 __Pyx_GOTREF(__pyx_t_8);
24371 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24372 __pyx_t_9 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
24373
24374 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 93, __pyx_L1_error)
24375 __Pyx_GOTREF(__pyx_t_7);
24376 __pyx_t_10 = __Pyx_PyLong_AddObjC(__pyx_t_7, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 93, __pyx_L1_error)
24377 __Pyx_GOTREF(__pyx_t_10);
24378 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24379 __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_10); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L1_error)
24380 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
24381 if (!__pyx_t_9) {
24382 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
24383 __PYX_ERR(0, 93, __pyx_L1_error)
24384 }
24385 __pyx_t_7 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 93, __pyx_L1_error)
24386 __Pyx_GOTREF(__pyx_t_7);
24387 __pyx_t_10 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_11)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 93, __pyx_L1_error)
24388 __Pyx_GOTREF(__pyx_t_10);
24389 #if CYTHON_COMPILING_IN_LIMITED_API
24390 __pyx_t_6 = PyBytes_AsString(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 93, __pyx_L1_error)
24391 #else
24392 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_7);
24393 #endif
24394 __pyx_t_12 = __pyx_array_new(__pyx_t_10, sizeof(int), __pyx_t_6, "c", (char *) __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 93, __pyx_L1_error)
24395 __Pyx_GOTREF((PyObject *)__pyx_t_12);
24396 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
24397 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24398
24399
24400 __pyx_t_5 = 1;
24401 #if CYTHON_UNPACK_METHODS
24402 if (unlikely(PyMethod_Check(__pyx_t_8))) {
24403 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
24404 assert(__pyx_t_4);
24405 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
24406 __Pyx_INCREF(__pyx_t_4);
24407 __Pyx_INCREF(__pyx__function);
24408 __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
24409 __pyx_t_5 = 0;
24410 }
24411 #endif
24412 {
24413 PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_t_12)};
24414 __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
24415 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
24416 __Pyx_DECREF((PyObject *)__pyx_t_12); __pyx_t_12 = 0;
24417 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
24418 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error)
24419 __Pyx_GOTREF(__pyx_t_3);
24420 }
24421
24422 /* "cpartitioning.pyx":94
24423 * return (
24424 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
24425 * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
24426 * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
24427 * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
24428*/
24429 __pyx_t_4 = NULL;
24430 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 94, __pyx_L1_error)
24431 __Pyx_GOTREF(__pyx_t_7);
24432 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 94, __pyx_L1_error)
24433 __Pyx_GOTREF(__pyx_t_10);
24434 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24435 __pyx_t_9 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
24436
24437 if (!__pyx_t_9) {
24438 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
24439 __PYX_ERR(0, 94, __pyx_L1_error)
24440 }
24441 __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 94, __pyx_L1_error)
24442 __Pyx_GOTREF(__pyx_t_13);
24443 __pyx_t_7 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 94, __pyx_L1_error)
24444 __Pyx_GOTREF(__pyx_t_7);
24445 #if CYTHON_COMPILING_IN_LIMITED_API
24446 __pyx_t_6 = PyBytes_AsString(__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 94, __pyx_L1_error)
24447 #else
24448 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_13);
24449 #endif
24450 __pyx_t_12 = __pyx_array_new(__pyx_t_7, sizeof(int), __pyx_t_6, "c", (char *) __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 94, __pyx_L1_error)
24451 __Pyx_GOTREF((PyObject *)__pyx_t_12);
24452 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24453 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
24454
24455 __pyx_t_5 = 1;
24456 #if CYTHON_UNPACK_METHODS
24457 if (unlikely(PyMethod_Check(__pyx_t_10))) {
24458 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
24459 assert(__pyx_t_4);
24460 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
24461 __Pyx_INCREF(__pyx_t_4);
24462 __Pyx_INCREF(__pyx__function);
24463 __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
24464 __pyx_t_5 = 0;
24465 }
24466 #endif
24467 {
24468 PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_t_12)};
24469 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
24470 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
24471 __Pyx_DECREF((PyObject *)__pyx_t_12); __pyx_t_12 = 0;
24472 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
24473 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 94, __pyx_L1_error)
24474 __Pyx_GOTREF(__pyx_t_8);
24475 }
24476
24477 /* "cpartitioning.pyx":95
24478 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
24479 * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
24480 * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
24481 * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
24482 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
24483*/
24484 __pyx_t_4 = NULL;
24485 __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 95, __pyx_L1_error)
24486 __Pyx_GOTREF(__pyx_t_13);
24487 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 95, __pyx_L1_error)
24488 __Pyx_GOTREF(__pyx_t_7);
24489 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
24490 __pyx_t_9 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
24491
24492 __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 95, __pyx_L1_error)
24493 __Pyx_GOTREF(__pyx_t_13);
24494 __pyx_t_14 = __Pyx_PyLong_AddObjC(__pyx_t_13, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 95, __pyx_L1_error)
24495 __Pyx_GOTREF(__pyx_t_14);
24496 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
24497 __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 95, __pyx_L1_error)
24498 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
24499 if (!__pyx_t_9) {
24500 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
24501 __PYX_ERR(0, 95, __pyx_L1_error)
24502 }
24503 __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 95, __pyx_L1_error)
24504 __Pyx_GOTREF(__pyx_t_13);
24505 __pyx_t_14 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_11)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 95, __pyx_L1_error)
24506 __Pyx_GOTREF(__pyx_t_14);
24507 #if CYTHON_COMPILING_IN_LIMITED_API
24508 __pyx_t_6 = PyBytes_AsString(__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 95, __pyx_L1_error)
24509 #else
24510 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_13);
24511 #endif
24512 __pyx_t_12 = __pyx_array_new(__pyx_t_14, sizeof(int), __pyx_t_6, "c", (char *) __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 95, __pyx_L1_error)
24513 __Pyx_GOTREF((PyObject *)__pyx_t_12);
24514 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
24515 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
24516
24517
24518 __pyx_t_5 = 1;
24519 #if CYTHON_UNPACK_METHODS
24520 if (unlikely(PyMethod_Check(__pyx_t_7))) {
24521 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
24522 assert(__pyx_t_4);
24523 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
24524 __Pyx_INCREF(__pyx_t_4);
24525 __Pyx_INCREF(__pyx__function);
24526 __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
24527 __pyx_t_5 = 0;
24528 }
24529 #endif
24530 {
24531 PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_t_12)};
24532 __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
24533 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
24534 __Pyx_DECREF((PyObject *)__pyx_t_12); __pyx_t_12 = 0;
24535 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
24536 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 95, __pyx_L1_error)
24537 __Pyx_GOTREF(__pyx_t_10);
24538 }
24539
24540 /* "cpartitioning.pyx":96
24541 * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
24542 * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
24543 * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
24544 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
24545 * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
24546*/
24547 __pyx_t_4 = NULL;
24548 __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 96, __pyx_L1_error)
24549 __Pyx_GOTREF(__pyx_t_13);
24550 __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 96, __pyx_L1_error)
24551 __Pyx_GOTREF(__pyx_t_14);
24552 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
24553 __pyx_t_9 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
24554
24555 if (!__pyx_t_9) {
24556 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
24557 __PYX_ERR(0, 96, __pyx_L1_error)
24558 }
24559 __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 96, __pyx_L1_error)
24560 __Pyx_GOTREF(__pyx_t_15);
24561 __pyx_t_13 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 96, __pyx_L1_error)
24562 __Pyx_GOTREF(__pyx_t_13);
24563 #if CYTHON_COMPILING_IN_LIMITED_API
24564 __pyx_t_6 = PyBytes_AsString(__pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 96, __pyx_L1_error)
24565 #else
24566 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_15);
24567 #endif
24568 __pyx_t_12 = __pyx_array_new(__pyx_t_13, sizeof(int), __pyx_t_6, "c", (char *) __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 96, __pyx_L1_error)
24569 __Pyx_GOTREF((PyObject *)__pyx_t_12);
24570 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
24571 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
24572
24573 __pyx_t_5 = 1;
24574 #if CYTHON_UNPACK_METHODS
24575 if (unlikely(PyMethod_Check(__pyx_t_14))) {
24576 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_14);
24577 assert(__pyx_t_4);
24578 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
24579 __Pyx_INCREF(__pyx_t_4);
24580 __Pyx_INCREF(__pyx__function);
24581 __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
24582 __pyx_t_5 = 0;
24583 }
24584 #endif
24585 {
24586 PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_t_12)};
24587 __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
24588 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
24589 __Pyx_DECREF((PyObject *)__pyx_t_12); __pyx_t_12 = 0;
24590 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
24591 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 96, __pyx_L1_error)
24592 __Pyx_GOTREF(__pyx_t_7);
24593 }
24594
24595 /* "cpartitioning.pyx":97
24596 * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
24597 * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
24598 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
24599 * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
24600 * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
24601*/
24602 __pyx_t_4 = NULL;
24603 __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 97, __pyx_L1_error)
24604 __Pyx_GOTREF(__pyx_t_15);
24605 __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 97, __pyx_L1_error)
24606 __Pyx_GOTREF(__pyx_t_13);
24607 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
24608 __pyx_t_9 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
24609
24610 __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 97, __pyx_L1_error)
24611 __Pyx_GOTREF(__pyx_t_15);
24612 __pyx_t_16 = __Pyx_PyLong_AddObjC(__pyx_t_15, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 97, __pyx_L1_error)
24613 __Pyx_GOTREF(__pyx_t_16);
24614 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
24615 __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_16); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L1_error)
24616 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
24617 if (!__pyx_t_9) {
24618 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
24619 __PYX_ERR(0, 97, __pyx_L1_error)
24620 }
24621 __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 97, __pyx_L1_error)
24622 __Pyx_GOTREF(__pyx_t_15);
24623 __pyx_t_16 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_11)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 97, __pyx_L1_error)
24624 __Pyx_GOTREF(__pyx_t_16);
24625 #if CYTHON_COMPILING_IN_LIMITED_API
24626 __pyx_t_6 = PyBytes_AsString(__pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 97, __pyx_L1_error)
24627 #else
24628 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_15);
24629 #endif
24630 __pyx_t_12 = __pyx_array_new(__pyx_t_16, sizeof(int), __pyx_t_6, "c", (char *) __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 97, __pyx_L1_error)
24631 __Pyx_GOTREF((PyObject *)__pyx_t_12);
24632 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
24633 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
24634
24635
24636 __pyx_t_5 = 1;
24637 #if CYTHON_UNPACK_METHODS
24638 if (unlikely(PyMethod_Check(__pyx_t_13))) {
24639 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
24640 assert(__pyx_t_4);
24641 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
24642 __Pyx_INCREF(__pyx_t_4);
24643 __Pyx_INCREF(__pyx__function);
24644 __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
24645 __pyx_t_5 = 0;
24646 }
24647 #endif
24648 {
24649 PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_t_12)};
24650 __pyx_t_14 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
24651 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
24652 __Pyx_DECREF((PyObject *)__pyx_t_12); __pyx_t_12 = 0;
24653 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
24654 if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 97, __pyx_L1_error)
24655 __Pyx_GOTREF(__pyx_t_14);
24656 }
24657
24658 /* "cpartitioning.pyx":98
24659 * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
24660 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
24661 * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
24662 * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
24663 * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
24664*/
24665 __pyx_t_4 = NULL;
24666 __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 98, __pyx_L1_error)
24667 __Pyx_GOTREF(__pyx_t_15);
24668 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 98, __pyx_L1_error)
24669 __Pyx_GOTREF(__pyx_t_16);
24670 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
24671 __pyx_t_9 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
24672
24673 if (!__pyx_t_9) {
24674 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
24675 __PYX_ERR(0, 98, __pyx_L1_error)
24676 }
24677 __pyx_t_17 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 98, __pyx_L1_error)
24678 __Pyx_GOTREF(__pyx_t_17);
24679 __pyx_t_15 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 98, __pyx_L1_error)
24680 __Pyx_GOTREF(__pyx_t_15);
24681 #if CYTHON_COMPILING_IN_LIMITED_API
24682 __pyx_t_6 = PyBytes_AsString(__pyx_t_17); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 98, __pyx_L1_error)
24683 #else
24684 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_17);
24685 #endif
24686 __pyx_t_12 = __pyx_array_new(__pyx_t_15, sizeof(int), __pyx_t_6, "c", (char *) __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 98, __pyx_L1_error)
24687 __Pyx_GOTREF((PyObject *)__pyx_t_12);
24688 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
24689 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
24690
24691 __pyx_t_5 = 1;
24692 #if CYTHON_UNPACK_METHODS
24693 if (unlikely(PyMethod_Check(__pyx_t_16))) {
24694 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_16);
24695 assert(__pyx_t_4);
24696 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
24697 __Pyx_INCREF(__pyx_t_4);
24698 __Pyx_INCREF(__pyx__function);
24699 __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
24700 __pyx_t_5 = 0;
24701 }
24702 #endif
24703 {
24704 PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_t_12)};
24705 __pyx_t_13 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_16, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
24706 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
24707 __Pyx_DECREF((PyObject *)__pyx_t_12); __pyx_t_12 = 0;
24708 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
24709 if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 98, __pyx_L1_error)
24710 __Pyx_GOTREF(__pyx_t_13);
24711 }
24712
24713 /* "cpartitioning.pyx":99
24714 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
24715 * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
24716 * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
24717 * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
24718 * )
24719*/
24720 __pyx_t_4 = NULL;
24721 __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 99, __pyx_L1_error)
24722 __Pyx_GOTREF(__pyx_t_17);
24723 __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 99, __pyx_L1_error)
24724 __Pyx_GOTREF(__pyx_t_15);
24725 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
24726 __pyx_t_9 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
24727
24728 __pyx_t_17 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 99, __pyx_L1_error)
24729 __Pyx_GOTREF(__pyx_t_17);
24730 __pyx_t_18 = __Pyx_PyLong_AddObjC(__pyx_t_17, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 99, __pyx_L1_error)
24731 __Pyx_GOTREF(__pyx_t_18);
24732 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
24733 __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_18); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L1_error)
24734 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
24735 if (!__pyx_t_9) {
24736 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
24737 __PYX_ERR(0, 99, __pyx_L1_error)
24738 }
24739 __pyx_t_17 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 99, __pyx_L1_error)
24740 __Pyx_GOTREF(__pyx_t_17);
24741 __pyx_t_18 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_11)); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 99, __pyx_L1_error)
24742 __Pyx_GOTREF(__pyx_t_18);
24743 #if CYTHON_COMPILING_IN_LIMITED_API
24744 __pyx_t_6 = PyBytes_AsString(__pyx_t_17); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 99, __pyx_L1_error)
24745 #else
24746 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_17);
24747 #endif
24748 __pyx_t_12 = __pyx_array_new(__pyx_t_18, sizeof(int), __pyx_t_6, "c", (char *) __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 99, __pyx_L1_error)
24749 __Pyx_GOTREF((PyObject *)__pyx_t_12);
24750 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
24751 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
24752
24753
24754 __pyx_t_5 = 1;
24755 #if CYTHON_UNPACK_METHODS
24756 if (unlikely(PyMethod_Check(__pyx_t_15))) {
24757 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_15);
24758 assert(__pyx_t_4);
24759 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_15);
24760 __Pyx_INCREF(__pyx_t_4);
24761 __Pyx_INCREF(__pyx__function);
24762 __Pyx_DECREF_SET(__pyx_t_15, __pyx__function);
24763 __pyx_t_5 = 0;
24764 }
24765 #endif
24766 {
24767 PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_t_12)};
24768 __pyx_t_16 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_15, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
24769 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
24770 __Pyx_DECREF((PyObject *)__pyx_t_12); __pyx_t_12 = 0;
24771 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
24772 if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 99, __pyx_L1_error)
24773 __Pyx_GOTREF(__pyx_t_16);
24774 }
24775
24776 /* "cpartitioning.pyx":100
24777 * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
24778 * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
24779 * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
24780 * )
24781 *
24782*/
24783 __pyx_t_4 = NULL;
24784 __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 100, __pyx_L1_error)
24785 __Pyx_GOTREF(__pyx_t_17);
24786 __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 100, __pyx_L1_error)
24787 __Pyx_GOTREF(__pyx_t_18);
24788 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
24789 __pyx_t_9 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
24790
24791 if (!__pyx_t_9) {
24792 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
24793 __PYX_ERR(0, 100, __pyx_L1_error)
24794 }
24795 __pyx_t_19 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 100, __pyx_L1_error)
24796 __Pyx_GOTREF(__pyx_t_19);
24797 __pyx_t_17 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global)); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 100, __pyx_L1_error)
24798 __Pyx_GOTREF(__pyx_t_17);
24799 #if CYTHON_COMPILING_IN_LIMITED_API
24800 __pyx_t_6 = PyBytes_AsString(__pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 100, __pyx_L1_error)
24801 #else
24802 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_19);
24803 #endif
24804 __pyx_t_12 = __pyx_array_new(__pyx_t_17, sizeof(int), __pyx_t_6, "c", (char *) __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 100, __pyx_L1_error)
24805 __Pyx_GOTREF((PyObject *)__pyx_t_12);
24806 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
24807 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
24808
24809 __pyx_t_5 = 1;
24810 #if CYTHON_UNPACK_METHODS
24811 if (unlikely(PyMethod_Check(__pyx_t_18))) {
24812 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_18);
24813 assert(__pyx_t_4);
24814 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_18);
24815 __Pyx_INCREF(__pyx_t_4);
24816 __Pyx_INCREF(__pyx__function);
24817 __Pyx_DECREF_SET(__pyx_t_18, __pyx__function);
24818 __pyx_t_5 = 0;
24819 }
24820 #endif
24821 {
24822 PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_t_12)};
24823 __pyx_t_15 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_18, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
24824 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
24825 __Pyx_DECREF((PyObject *)__pyx_t_12); __pyx_t_12 = 0;
24826 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
24827 if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 100, __pyx_L1_error)
24828 __Pyx_GOTREF(__pyx_t_15);
24829 }
24830
24831 /* "cpartitioning.pyx":93
24832 * memHardLimit)
24833 * return (
24834 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
24835 * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
24836 * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
24837*/
24838 __pyx_t_18 = PyTuple_New(8); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 93, __pyx_L1_error)
24839 __Pyx_GOTREF(__pyx_t_18);
24840 __Pyx_GIVEREF(__pyx_t_3);
24841 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 93, __pyx_L1_error);
24842 __Pyx_GIVEREF(__pyx_t_8);
24843 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 93, __pyx_L1_error);
24844 __Pyx_GIVEREF(__pyx_t_10);
24845 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_t_10) != (0)) __PYX_ERR(0, 93, __pyx_L1_error);
24846 __Pyx_GIVEREF(__pyx_t_7);
24847 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 3, __pyx_t_7) != (0)) __PYX_ERR(0, 93, __pyx_L1_error);
24848 __Pyx_GIVEREF(__pyx_t_14);
24849 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 4, __pyx_t_14) != (0)) __PYX_ERR(0, 93, __pyx_L1_error);
24850 __Pyx_GIVEREF(__pyx_t_13);
24851 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 5, __pyx_t_13) != (0)) __PYX_ERR(0, 93, __pyx_L1_error);
24852 __Pyx_GIVEREF(__pyx_t_16);
24853 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 6, __pyx_t_16) != (0)) __PYX_ERR(0, 93, __pyx_L1_error);
24854 __Pyx_GIVEREF(__pyx_t_15);
24855 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 7, __pyx_t_15) != (0)) __PYX_ERR(0, 93, __pyx_L1_error);
24856 __pyx_t_3 = 0;
24857 __pyx_t_8 = 0;
24858 __pyx_t_10 = 0;
24859 __pyx_t_7 = 0;
24860 __pyx_t_14 = 0;
24861 __pyx_t_13 = 0;
24862 __pyx_t_16 = 0;
24863 __pyx_t_15 = 0;
24864 {
24865 PyObject *__pyx_temp;
24866 {
24867 __pyx_temp = __pyx_r;
24868 __pyx_r = __pyx_t_18;
24869 }
24870 __Pyx_XDECREF(__pyx_temp);
24871 }
24872 __pyx_t_18 = 0;
24873 goto __pyx_L0;
24874
24875 /* "cpartitioning.pyx":82
24876 * )
24877 *
24878 * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh, double memHardLimit): # <<<<<<<<<<<<<<
24879 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
24880 * if not isinstance(filebase, bytes):
24881*/
24882
24883 /* function exit code */
24884 __pyx_L1_error:;
24885 __Pyx_XDECREF(__pyx_t_3);
24886 __Pyx_XDECREF(__pyx_t_4);
24887 __Pyx_XDECREF(__pyx_t_7);
24888 __Pyx_XDECREF(__pyx_t_8);
24889 __Pyx_XDECREF(__pyx_t_10);
24890 __Pyx_XDECREF((PyObject *)__pyx_t_12);
24891 __Pyx_XDECREF(__pyx_t_13);
24892 __Pyx_XDECREF(__pyx_t_14);
24893 __Pyx_XDECREF(__pyx_t_15);
24894 __Pyx_XDECREF(__pyx_t_16);
24895 __Pyx_XDECREF(__pyx_t_17);
24896 __Pyx_XDECREF(__pyx_t_18);
24897 __Pyx_XDECREF(__pyx_t_19);
24898 __Pyx_AddTraceback("cpartitioning.partitionNodesFromTetgenFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
24899 __pyx_r = NULL;
24900 __pyx_L0:;
24901 __Pyx_XDECREF(__pyx_v_filebase);
24902 __Pyx_XGIVEREF(__pyx_r);
24903 __Pyx_RefNannyFinishContext();
24904 return __pyx_r;
24905}
24906
24907/* "cpartitioning.pyx":103
24908 * )
24909 *
24910 * def partitionNodesFromTriangleFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
24911 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
24912 * if not isinstance(filebase, bytes):
24913*/
24914
24915/* Python wrapper */
24916static PyObject *__pyx_pw_13cpartitioning_9partitionNodesFromTriangleFiles(PyObject *__pyx_self,
24917#if CYTHON_VECTORCALL
24918PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24919#else
24920PyObject *__pyx_args, PyObject *__pyx_kwds
24921#endif
24922); /*proto*/
24923static PyMethodDef __pyx_mdef_13cpartitioning_9partitionNodesFromTriangleFiles = {"partitionNodesFromTriangleFiles", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cpartitioning_9partitionNodesFromTriangleFiles, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
24924static PyObject *__pyx_pw_13cpartitioning_9partitionNodesFromTriangleFiles(PyObject *__pyx_self,
24925#if CYTHON_VECTORCALL
24926PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24927#else
24928PyObject *__pyx_args, PyObject *__pyx_kwds
24929#endif
24930) {
24931 struct PyMPICommObject *__pyx_v_comm = 0;
24932 PyObject *__pyx_v_filebase = 0;
24933 int __pyx_v_indexBase;
24934 int __pyx_v_nLayersOfOverlap;
24935 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
24936 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
24937 #if !CYTHON_VECTORCALL
24938 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
24939 #endif
24940 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
24941 PyObject* values[6] = {0,0,0,0,0,0};
24942 int __pyx_lineno = 0;
24943 const char *__pyx_filename = NULL;
24944 int __pyx_clineno = 0;
24945 PyObject *__pyx_r = 0;
24946 __Pyx_RefNannyDeclarations
24947 __Pyx_RefNannySetupContext("partitionNodesFromTriangleFiles (wrapper)", 0);
24948 #if !CYTHON_VECTORCALL
24949 #if CYTHON_ASSUME_SAFE_SIZE
24950 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
24951 #else
24952 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
24953 #endif
24954 #endif
24955 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
24956 {
24957 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,&__pyx_mstate_global->__pyx_n_u_filebase,&__pyx_mstate_global->__pyx_n_u_indexBase,&__pyx_mstate_global->__pyx_n_u_nLayersOfOverlap,&__pyx_mstate_global->__pyx_n_u_cmesh,&__pyx_mstate_global->__pyx_n_u_subdomain_cmesh,0};
24958 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
24959 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 103, __pyx_L3_error)
24960 if (__pyx_kwds_len > 0) {
24961 switch (__pyx_nargs) {
24962 case 6:
24963 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
24964 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 103, __pyx_L3_error)
24965 CYTHON_FALLTHROUGH;
24966 case 5:
24967 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
24968 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 103, __pyx_L3_error)
24969 CYTHON_FALLTHROUGH;
24970 case 4:
24971 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
24972 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 103, __pyx_L3_error)
24973 CYTHON_FALLTHROUGH;
24974 case 3:
24975 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
24976 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 103, __pyx_L3_error)
24977 CYTHON_FALLTHROUGH;
24978 case 2:
24979 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
24980 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 103, __pyx_L3_error)
24981 CYTHON_FALLTHROUGH;
24982 case 1:
24983 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24984 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 103, __pyx_L3_error)
24985 CYTHON_FALLTHROUGH;
24986 case 0: break;
24987 default: goto __pyx_L5_argtuple_error;
24988 }
24989 const Py_ssize_t kwd_pos_args = __pyx_nargs;
24990 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "partitionNodesFromTriangleFiles", 0) < (0)) __PYX_ERR(0, 103, __pyx_L3_error)
24991 for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
24992 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("partitionNodesFromTriangleFiles", 1, 6, 6, i); __PYX_ERR(0, 103, __pyx_L3_error) }
24993 }
24994 } else if (unlikely(__pyx_nargs != 6)) {
24995 goto __pyx_L5_argtuple_error;
24996 } else {
24997 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
24998 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 103, __pyx_L3_error)
24999 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
25000 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 103, __pyx_L3_error)
25001 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
25002 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 103, __pyx_L3_error)
25003 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
25004 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 103, __pyx_L3_error)
25005 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
25006 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 103, __pyx_L3_error)
25007 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
25008 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 103, __pyx_L3_error)
25009 }
25010 __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
25011 __pyx_v_filebase = values[1];
25012 __pyx_v_indexBase = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_indexBase == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L3_error)
25013 __pyx_v_nLayersOfOverlap = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_nLayersOfOverlap == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L3_error)
25014 __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[4]);
25015 __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[5]);
25016 }
25017 goto __pyx_L6_skip;
25018 __pyx_L5_argtuple_error:;
25019 __Pyx_RaiseArgtupleInvalid("partitionNodesFromTriangleFiles", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 103, __pyx_L3_error)
25020 __pyx_L6_skip:;
25021 goto __pyx_L4_argument_unpacking_done;
25022 __pyx_L3_error:;
25023 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
25024 Py_XDECREF(values[__pyx_temp]);
25025 }
25026 __Pyx_AddTraceback("cpartitioning.partitionNodesFromTriangleFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
25027 __Pyx_RefNannyFinishContext();
25028 return NULL;
25029 __pyx_L4_argument_unpacking_done:;
25030 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 103, __pyx_L1_error)
25031 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_mstate_global->__pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 103, __pyx_L1_error)
25032 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_mstate_global->__pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 103, __pyx_L1_error)
25033 __pyx_r = __pyx_pf_13cpartitioning_8partitionNodesFromTriangleFiles(__pyx_self, __pyx_v_comm, __pyx_v_filebase, __pyx_v_indexBase, __pyx_v_nLayersOfOverlap, __pyx_v_cmesh, __pyx_v_subdomain_cmesh);
25034
25035 /* function exit code */
25036 goto __pyx_L0;
25037 __pyx_L1_error:;
25038 __pyx_r = NULL;
25039 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
25040 Py_XDECREF(values[__pyx_temp]);
25041 }
25042 goto __pyx_L7_cleaned_up;
25043 __pyx_L0:;
25044 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
25045 Py_XDECREF(values[__pyx_temp]);
25046 }
25047 __pyx_L7_cleaned_up:;
25048
25049
25050 __Pyx_RefNannyFinishContext();
25051 return __pyx_r;
25052}
25053
25054static PyObject *__pyx_pf_13cpartitioning_8partitionNodesFromTriangleFiles(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, PyObject *__pyx_v_filebase, int __pyx_v_indexBase, int __pyx_v_nLayersOfOverlap, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh) {
25055 PyObject *__pyx_r = NULL;
25056 __Pyx_RefNannyDeclarations
25057 int __pyx_t_1;
25058 int __pyx_t_2;
25059 PyObject *__pyx_t_3 = NULL;
25060 PyObject *__pyx_t_4 = NULL;
25061 size_t __pyx_t_5;
25062 char *__pyx_t_6;
25063 PyObject *__pyx_t_7 = NULL;
25064 PyObject *__pyx_t_8 = NULL;
25065 int *__pyx_t_9;
25066 PyObject *__pyx_t_10 = NULL;
25067 Py_ssize_t __pyx_t_11;
25068 struct __pyx_array_obj *__pyx_t_12 = NULL;
25069 PyObject *__pyx_t_13 = NULL;
25070 PyObject *__pyx_t_14 = NULL;
25071 PyObject *__pyx_t_15 = NULL;
25072 PyObject *__pyx_t_16 = NULL;
25073 PyObject *__pyx_t_17 = NULL;
25074 PyObject *__pyx_t_18 = NULL;
25075 PyObject *__pyx_t_19 = NULL;
25076 int __pyx_lineno = 0;
25077 const char *__pyx_filename = NULL;
25078 int __pyx_clineno = 0;
25079 __Pyx_RefNannySetupContext("partitionNodesFromTriangleFiles", 0);
25080 __Pyx_INCREF(__pyx_v_filebase);
25081
25082 /* "cpartitioning.pyx":104
25083 *
25084 * def partitionNodesFromTriangleFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
25085 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh # <<<<<<<<<<<<<<
25086 * if not isinstance(filebase, bytes):
25087 * filebase = filebase.encode()
25088*/
25089 __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
25090
25091 /* "cpartitioning.pyx":105
25092 * def partitionNodesFromTriangleFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
25093 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
25094 * if not isinstance(filebase, bytes): # <<<<<<<<<<<<<<
25095 * filebase = filebase.encode()
25096 * c_partitionNodesFromTriangleFiles(comm.ob_mpi,
25097*/
25098 __pyx_t_1 = PyBytes_Check(__pyx_v_filebase);
25099 __pyx_t_2 = (!__pyx_t_1);
25100
25101
25102 if (__pyx_t_2) {
25103
25104
25105 /* "cpartitioning.pyx":106
25106 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
25107 * if not isinstance(filebase, bytes):
25108 * filebase = filebase.encode() # <<<<<<<<<<<<<<
25109 * c_partitionNodesFromTriangleFiles(comm.ob_mpi,
25110 * <const char*>(<char*>filebase),
25111*/
25112 __pyx_t_4 = __pyx_v_filebase;
25113 __Pyx_INCREF(__pyx_t_4);
25114 __pyx_t_5 = 0;
25115 {
25116 PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
25117 __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
25118 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
25119 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error)
25120 __Pyx_GOTREF(__pyx_t_3);
25121 }
25122 __Pyx_DECREF_SET(__pyx_v_filebase, __pyx_t_3);
25123 __pyx_t_3 = 0;
25124
25125 /* "cpartitioning.pyx":105
25126 * def partitionNodesFromTriangleFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh):
25127 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
25128 * if not isinstance(filebase, bytes): # <<<<<<<<<<<<<<
25129 * filebase = filebase.encode()
25130 * c_partitionNodesFromTriangleFiles(comm.ob_mpi,
25131*/
25132 }
25133
25134 /* "cpartitioning.pyx":108
25135 * filebase = filebase.encode()
25136 * c_partitionNodesFromTriangleFiles(comm.ob_mpi,
25137 * <const char*>(<char*>filebase), # <<<<<<<<<<<<<<
25138 * indexBase,
25139 * cmesh.mesh,
25140*/
25141 __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_filebase); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error)
25142
25143 /* "cpartitioning.pyx":107
25144 * if not isinstance(filebase, bytes):
25145 * filebase = filebase.encode()
25146 * c_partitionNodesFromTriangleFiles(comm.ob_mpi, # <<<<<<<<<<<<<<
25147 * <const char*>(<char*>filebase),
25148 * indexBase,
25149*/
25150 (void)(proteus::partitionNodesFromTriangleFiles(__pyx_v_comm->ob_mpi, ((char const *)((char *)__pyx_t_6)), __pyx_v_indexBase, __pyx_v_cmesh->mesh, __pyx_v_nLayersOfOverlap));
25151
25152
25153 /* "cpartitioning.pyx":113
25154 * nLayersOfOverlap)
25155 * return (
25156 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
25157 * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
25158 * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
25159*/
25160 __pyx_t_4 = NULL;
25161 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 113, __pyx_L1_error)
25162 __Pyx_GOTREF(__pyx_t_7);
25163 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 113, __pyx_L1_error)
25164 __Pyx_GOTREF(__pyx_t_8);
25165 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25166 __pyx_t_9 = __pyx_v_cmesh->mesh.elementOffsets_subdomain_owned;
25167
25168 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 113, __pyx_L1_error)
25169 __Pyx_GOTREF(__pyx_t_7);
25170 __pyx_t_10 = __Pyx_PyLong_AddObjC(__pyx_t_7, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 113, __pyx_L1_error)
25171 __Pyx_GOTREF(__pyx_t_10);
25172 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25173 __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_10); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 113, __pyx_L1_error)
25174 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
25175 if (!__pyx_t_9) {
25176 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
25177 __PYX_ERR(0, 113, __pyx_L1_error)
25178 }
25179 __pyx_t_7 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 113, __pyx_L1_error)
25180 __Pyx_GOTREF(__pyx_t_7);
25181 __pyx_t_10 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_11)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 113, __pyx_L1_error)
25182 __Pyx_GOTREF(__pyx_t_10);
25183 #if CYTHON_COMPILING_IN_LIMITED_API
25184 __pyx_t_6 = PyBytes_AsString(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 113, __pyx_L1_error)
25185 #else
25186 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_7);
25187 #endif
25188 __pyx_t_12 = __pyx_array_new(__pyx_t_10, sizeof(int), __pyx_t_6, "c", (char *) __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 113, __pyx_L1_error)
25189 __Pyx_GOTREF((PyObject *)__pyx_t_12);
25190 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
25191 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25192
25193
25194 __pyx_t_5 = 1;
25195 #if CYTHON_UNPACK_METHODS
25196 if (unlikely(PyMethod_Check(__pyx_t_8))) {
25197 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
25198 assert(__pyx_t_4);
25199 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
25200 __Pyx_INCREF(__pyx_t_4);
25201 __Pyx_INCREF(__pyx__function);
25202 __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
25203 __pyx_t_5 = 0;
25204 }
25205 #endif
25206 {
25207 PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_t_12)};
25208 __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
25209 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
25210 __Pyx_DECREF((PyObject *)__pyx_t_12); __pyx_t_12 = 0;
25211 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
25212 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
25213 __Pyx_GOTREF(__pyx_t_3);
25214 }
25215
25216 /* "cpartitioning.pyx":114
25217 * return (
25218 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
25219 * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global), # <<<<<<<<<<<<<<
25220 * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
25221 * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
25222*/
25223 __pyx_t_4 = NULL;
25224 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 114, __pyx_L1_error)
25225 __Pyx_GOTREF(__pyx_t_7);
25226 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 114, __pyx_L1_error)
25227 __Pyx_GOTREF(__pyx_t_10);
25228 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25229 __pyx_t_9 = __pyx_v_cmesh->mesh.elementNumbering_subdomain2global;
25230
25231 if (!__pyx_t_9) {
25232 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
25233 __PYX_ERR(0, 114, __pyx_L1_error)
25234 }
25235 __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 114, __pyx_L1_error)
25236 __Pyx_GOTREF(__pyx_t_13);
25237 __pyx_t_7 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElements_global)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 114, __pyx_L1_error)
25238 __Pyx_GOTREF(__pyx_t_7);
25239 #if CYTHON_COMPILING_IN_LIMITED_API
25240 __pyx_t_6 = PyBytes_AsString(__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 114, __pyx_L1_error)
25241 #else
25242 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_13);
25243 #endif
25244 __pyx_t_12 = __pyx_array_new(__pyx_t_7, sizeof(int), __pyx_t_6, "c", (char *) __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 114, __pyx_L1_error)
25245 __Pyx_GOTREF((PyObject *)__pyx_t_12);
25246 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25247 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
25248
25249 __pyx_t_5 = 1;
25250 #if CYTHON_UNPACK_METHODS
25251 if (unlikely(PyMethod_Check(__pyx_t_10))) {
25252 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
25253 assert(__pyx_t_4);
25254 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
25255 __Pyx_INCREF(__pyx_t_4);
25256 __Pyx_INCREF(__pyx__function);
25257 __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
25258 __pyx_t_5 = 0;
25259 }
25260 #endif
25261 {
25262 PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_t_12)};
25263 __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
25264 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
25265 __Pyx_DECREF((PyObject *)__pyx_t_12); __pyx_t_12 = 0;
25266 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
25267 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 114, __pyx_L1_error)
25268 __Pyx_GOTREF(__pyx_t_8);
25269 }
25270
25271 /* "cpartitioning.pyx":115
25272 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned),
25273 * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
25274 * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
25275 * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
25276 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
25277*/
25278 __pyx_t_4 = NULL;
25279 __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 115, __pyx_L1_error)
25280 __Pyx_GOTREF(__pyx_t_13);
25281 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 115, __pyx_L1_error)
25282 __Pyx_GOTREF(__pyx_t_7);
25283 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
25284 __pyx_t_9 = __pyx_v_cmesh->mesh.nodeOffsets_subdomain_owned;
25285
25286 __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 115, __pyx_L1_error)
25287 __Pyx_GOTREF(__pyx_t_13);
25288 __pyx_t_14 = __Pyx_PyLong_AddObjC(__pyx_t_13, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 115, __pyx_L1_error)
25289 __Pyx_GOTREF(__pyx_t_14);
25290 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
25291 __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 115, __pyx_L1_error)
25292 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
25293 if (!__pyx_t_9) {
25294 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
25295 __PYX_ERR(0, 115, __pyx_L1_error)
25296 }
25297 __pyx_t_13 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 115, __pyx_L1_error)
25298 __Pyx_GOTREF(__pyx_t_13);
25299 __pyx_t_14 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_11)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 115, __pyx_L1_error)
25300 __Pyx_GOTREF(__pyx_t_14);
25301 #if CYTHON_COMPILING_IN_LIMITED_API
25302 __pyx_t_6 = PyBytes_AsString(__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 115, __pyx_L1_error)
25303 #else
25304 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_13);
25305 #endif
25306 __pyx_t_12 = __pyx_array_new(__pyx_t_14, sizeof(int), __pyx_t_6, "c", (char *) __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 115, __pyx_L1_error)
25307 __Pyx_GOTREF((PyObject *)__pyx_t_12);
25308 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
25309 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
25310
25311
25312 __pyx_t_5 = 1;
25313 #if CYTHON_UNPACK_METHODS
25314 if (unlikely(PyMethod_Check(__pyx_t_7))) {
25315 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
25316 assert(__pyx_t_4);
25317 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
25318 __Pyx_INCREF(__pyx_t_4);
25319 __Pyx_INCREF(__pyx__function);
25320 __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
25321 __pyx_t_5 = 0;
25322 }
25323 #endif
25324 {
25325 PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_t_12)};
25326 __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
25327 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
25328 __Pyx_DECREF((PyObject *)__pyx_t_12); __pyx_t_12 = 0;
25329 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25330 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 115, __pyx_L1_error)
25331 __Pyx_GOTREF(__pyx_t_10);
25332 }
25333
25334 /* "cpartitioning.pyx":116
25335 * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
25336 * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
25337 * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global), # <<<<<<<<<<<<<<
25338 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
25339 * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
25340*/
25341 __pyx_t_4 = NULL;
25342 __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 116, __pyx_L1_error)
25343 __Pyx_GOTREF(__pyx_t_13);
25344 __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 116, __pyx_L1_error)
25345 __Pyx_GOTREF(__pyx_t_14);
25346 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
25347 __pyx_t_9 = __pyx_v_cmesh->mesh.nodeNumbering_subdomain2global;
25348
25349 if (!__pyx_t_9) {
25350 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
25351 __PYX_ERR(0, 116, __pyx_L1_error)
25352 }
25353 __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 116, __pyx_L1_error)
25354 __Pyx_GOTREF(__pyx_t_15);
25355 __pyx_t_13 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nNodes_global)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 116, __pyx_L1_error)
25356 __Pyx_GOTREF(__pyx_t_13);
25357 #if CYTHON_COMPILING_IN_LIMITED_API
25358 __pyx_t_6 = PyBytes_AsString(__pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 116, __pyx_L1_error)
25359 #else
25360 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_15);
25361 #endif
25362 __pyx_t_12 = __pyx_array_new(__pyx_t_13, sizeof(int), __pyx_t_6, "c", (char *) __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 116, __pyx_L1_error)
25363 __Pyx_GOTREF((PyObject *)__pyx_t_12);
25364 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
25365 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
25366
25367 __pyx_t_5 = 1;
25368 #if CYTHON_UNPACK_METHODS
25369 if (unlikely(PyMethod_Check(__pyx_t_14))) {
25370 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_14);
25371 assert(__pyx_t_4);
25372 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
25373 __Pyx_INCREF(__pyx_t_4);
25374 __Pyx_INCREF(__pyx__function);
25375 __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
25376 __pyx_t_5 = 0;
25377 }
25378 #endif
25379 {
25380 PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_t_12)};
25381 __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
25382 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
25383 __Pyx_DECREF((PyObject *)__pyx_t_12); __pyx_t_12 = 0;
25384 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
25385 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 116, __pyx_L1_error)
25386 __Pyx_GOTREF(__pyx_t_7);
25387 }
25388
25389 /* "cpartitioning.pyx":117
25390 * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
25391 * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
25392 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned), # <<<<<<<<<<<<<<
25393 * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
25394 * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
25395*/
25396 __pyx_t_4 = NULL;
25397 __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 117, __pyx_L1_error)
25398 __Pyx_GOTREF(__pyx_t_15);
25399 __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 117, __pyx_L1_error)
25400 __Pyx_GOTREF(__pyx_t_13);
25401 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
25402 __pyx_t_9 = __pyx_v_cmesh->mesh.elementBoundaryOffsets_subdomain_owned;
25403
25404 __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 117, __pyx_L1_error)
25405 __Pyx_GOTREF(__pyx_t_15);
25406 __pyx_t_16 = __Pyx_PyLong_AddObjC(__pyx_t_15, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 117, __pyx_L1_error)
25407 __Pyx_GOTREF(__pyx_t_16);
25408 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
25409 __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_16); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L1_error)
25410 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
25411 if (!__pyx_t_9) {
25412 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
25413 __PYX_ERR(0, 117, __pyx_L1_error)
25414 }
25415 __pyx_t_15 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 117, __pyx_L1_error)
25416 __Pyx_GOTREF(__pyx_t_15);
25417 __pyx_t_16 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_11)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 117, __pyx_L1_error)
25418 __Pyx_GOTREF(__pyx_t_16);
25419 #if CYTHON_COMPILING_IN_LIMITED_API
25420 __pyx_t_6 = PyBytes_AsString(__pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 117, __pyx_L1_error)
25421 #else
25422 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_15);
25423 #endif
25424 __pyx_t_12 = __pyx_array_new(__pyx_t_16, sizeof(int), __pyx_t_6, "c", (char *) __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 117, __pyx_L1_error)
25425 __Pyx_GOTREF((PyObject *)__pyx_t_12);
25426 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
25427 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
25428
25429
25430 __pyx_t_5 = 1;
25431 #if CYTHON_UNPACK_METHODS
25432 if (unlikely(PyMethod_Check(__pyx_t_13))) {
25433 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
25434 assert(__pyx_t_4);
25435 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
25436 __Pyx_INCREF(__pyx_t_4);
25437 __Pyx_INCREF(__pyx__function);
25438 __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
25439 __pyx_t_5 = 0;
25440 }
25441 #endif
25442 {
25443 PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_t_12)};
25444 __pyx_t_14 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_13, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
25445 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
25446 __Pyx_DECREF((PyObject *)__pyx_t_12); __pyx_t_12 = 0;
25447 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
25448 if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 117, __pyx_L1_error)
25449 __Pyx_GOTREF(__pyx_t_14);
25450 }
25451
25452 /* "cpartitioning.pyx":118
25453 * np.asarray(<int[:cmesh.mesh.subdomainp.nNodes_global]> cmesh.mesh.nodeNumbering_subdomain2global),
25454 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
25455 * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global), # <<<<<<<<<<<<<<
25456 * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
25457 * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
25458*/
25459 __pyx_t_4 = NULL;
25460 __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 118, __pyx_L1_error)
25461 __Pyx_GOTREF(__pyx_t_15);
25462 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 118, __pyx_L1_error)
25463 __Pyx_GOTREF(__pyx_t_16);
25464 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
25465 __pyx_t_9 = __pyx_v_cmesh->mesh.elementBoundaryNumbering_subdomain2global;
25466
25467 if (!__pyx_t_9) {
25468 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
25469 __PYX_ERR(0, 118, __pyx_L1_error)
25470 }
25471 __pyx_t_17 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 118, __pyx_L1_error)
25472 __Pyx_GOTREF(__pyx_t_17);
25473 __pyx_t_15 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nElementBoundaries_global)); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 118, __pyx_L1_error)
25474 __Pyx_GOTREF(__pyx_t_15);
25475 #if CYTHON_COMPILING_IN_LIMITED_API
25476 __pyx_t_6 = PyBytes_AsString(__pyx_t_17); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 118, __pyx_L1_error)
25477 #else
25478 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_17);
25479 #endif
25480 __pyx_t_12 = __pyx_array_new(__pyx_t_15, sizeof(int), __pyx_t_6, "c", (char *) __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 118, __pyx_L1_error)
25481 __Pyx_GOTREF((PyObject *)__pyx_t_12);
25482 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
25483 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
25484
25485 __pyx_t_5 = 1;
25486 #if CYTHON_UNPACK_METHODS
25487 if (unlikely(PyMethod_Check(__pyx_t_16))) {
25488 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_16);
25489 assert(__pyx_t_4);
25490 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_16);
25491 __Pyx_INCREF(__pyx_t_4);
25492 __Pyx_INCREF(__pyx__function);
25493 __Pyx_DECREF_SET(__pyx_t_16, __pyx__function);
25494 __pyx_t_5 = 0;
25495 }
25496 #endif
25497 {
25498 PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_t_12)};
25499 __pyx_t_13 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_16, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
25500 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
25501 __Pyx_DECREF((PyObject *)__pyx_t_12); __pyx_t_12 = 0;
25502 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
25503 if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 118, __pyx_L1_error)
25504 __Pyx_GOTREF(__pyx_t_13);
25505 }
25506
25507 /* "cpartitioning.pyx":119
25508 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementBoundaryOffsets_subdomain_owned),
25509 * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
25510 * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned), # <<<<<<<<<<<<<<
25511 * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global)
25512 * )
25513*/
25514 __pyx_t_4 = NULL;
25515 __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 119, __pyx_L1_error)
25516 __Pyx_GOTREF(__pyx_t_17);
25517 __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 119, __pyx_L1_error)
25518 __Pyx_GOTREF(__pyx_t_15);
25519 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
25520 __pyx_t_9 = __pyx_v_cmesh->mesh.edgeOffsets_subdomain_owned;
25521
25522 __pyx_t_17 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 119, __pyx_L1_error)
25523 __Pyx_GOTREF(__pyx_t_17);
25524 __pyx_t_18 = __Pyx_PyLong_AddObjC(__pyx_t_17, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 119, __pyx_L1_error)
25525 __Pyx_GOTREF(__pyx_t_18);
25526 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
25527 __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_18); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L1_error)
25528 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
25529 if (!__pyx_t_9) {
25530 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
25531 __PYX_ERR(0, 119, __pyx_L1_error)
25532 }
25533 __pyx_t_17 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 119, __pyx_L1_error)
25534 __Pyx_GOTREF(__pyx_t_17);
25535 __pyx_t_18 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_t_11)); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 119, __pyx_L1_error)
25536 __Pyx_GOTREF(__pyx_t_18);
25537 #if CYTHON_COMPILING_IN_LIMITED_API
25538 __pyx_t_6 = PyBytes_AsString(__pyx_t_17); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 119, __pyx_L1_error)
25539 #else
25540 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_17);
25541 #endif
25542 __pyx_t_12 = __pyx_array_new(__pyx_t_18, sizeof(int), __pyx_t_6, "c", (char *) __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 119, __pyx_L1_error)
25543 __Pyx_GOTREF((PyObject *)__pyx_t_12);
25544 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
25545 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
25546
25547
25548 __pyx_t_5 = 1;
25549 #if CYTHON_UNPACK_METHODS
25550 if (unlikely(PyMethod_Check(__pyx_t_15))) {
25551 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_15);
25552 assert(__pyx_t_4);
25553 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_15);
25554 __Pyx_INCREF(__pyx_t_4);
25555 __Pyx_INCREF(__pyx__function);
25556 __Pyx_DECREF_SET(__pyx_t_15, __pyx__function);
25557 __pyx_t_5 = 0;
25558 }
25559 #endif
25560 {
25561 PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_t_12)};
25562 __pyx_t_16 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_15, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
25563 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
25564 __Pyx_DECREF((PyObject *)__pyx_t_12); __pyx_t_12 = 0;
25565 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
25566 if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 119, __pyx_L1_error)
25567 __Pyx_GOTREF(__pyx_t_16);
25568 }
25569
25570 /* "cpartitioning.pyx":120
25571 * np.asarray(<int[:cmesh.mesh.subdomainp.nElementBoundaries_global]> cmesh.mesh.elementBoundaryNumbering_subdomain2global),
25572 * np.asarray(<int[:comm.size+1]> cmesh.mesh.edgeOffsets_subdomain_owned),
25573 * np.asarray(<int[:cmesh.mesh.subdomainp.nEdges_global]> cmesh.mesh.edgeNumbering_subdomain2global) # <<<<<<<<<<<<<<
25574 * )
25575 *
25576*/
25577 __pyx_t_4 = NULL;
25578 __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_np); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 120, __pyx_L1_error)
25579 __Pyx_GOTREF(__pyx_t_17);
25580 __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_mstate_global->__pyx_n_u_asarray); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 120, __pyx_L1_error)
25581 __Pyx_GOTREF(__pyx_t_18);
25582 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
25583 __pyx_t_9 = __pyx_v_cmesh->mesh.edgeNumbering_subdomain2global;
25584
25585 if (!__pyx_t_9) {
25586 PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
25587 __PYX_ERR(0, 120, __pyx_L1_error)
25588 }
25589 __pyx_t_19 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_int); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 120, __pyx_L1_error)
25590 __Pyx_GOTREF(__pyx_t_19);
25591 __pyx_t_17 = Py_BuildValue("(" __PYX_BUILD_PY_SSIZE_T ")", ((Py_ssize_t)__pyx_v_cmesh->mesh.subdomainp->nEdges_global)); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 120, __pyx_L1_error)
25592 __Pyx_GOTREF(__pyx_t_17);
25593 #if CYTHON_COMPILING_IN_LIMITED_API
25594 __pyx_t_6 = PyBytes_AsString(__pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 120, __pyx_L1_error)
25595 #else
25596 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_19);
25597 #endif
25598 __pyx_t_12 = __pyx_array_new(__pyx_t_17, sizeof(int), __pyx_t_6, "c", (char *) __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 120, __pyx_L1_error)
25599 __Pyx_GOTREF((PyObject *)__pyx_t_12);
25600 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
25601 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
25602
25603 __pyx_t_5 = 1;
25604 #if CYTHON_UNPACK_METHODS
25605 if (unlikely(PyMethod_Check(__pyx_t_18))) {
25606 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_18);
25607 assert(__pyx_t_4);
25608 PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_18);
25609 __Pyx_INCREF(__pyx_t_4);
25610 __Pyx_INCREF(__pyx__function);
25611 __Pyx_DECREF_SET(__pyx_t_18, __pyx__function);
25612 __pyx_t_5 = 0;
25613 }
25614 #endif
25615 {
25616 PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_t_12)};
25617 __pyx_t_15 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_18, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
25618 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
25619 __Pyx_DECREF((PyObject *)__pyx_t_12); __pyx_t_12 = 0;
25620 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
25621 if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 120, __pyx_L1_error)
25622 __Pyx_GOTREF(__pyx_t_15);
25623 }
25624
25625 /* "cpartitioning.pyx":113
25626 * nLayersOfOverlap)
25627 * return (
25628 * np.asarray(<int[:comm.size+1]> cmesh.mesh.elementOffsets_subdomain_owned), # <<<<<<<<<<<<<<
25629 * np.asarray(<int[:cmesh.mesh.subdomainp.nElements_global]> cmesh.mesh.elementNumbering_subdomain2global),
25630 * np.asarray(<int[:comm.size+1]> cmesh.mesh.nodeOffsets_subdomain_owned),
25631*/
25632 __pyx_t_18 = PyTuple_New(8); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 113, __pyx_L1_error)
25633 __Pyx_GOTREF(__pyx_t_18);
25634 __Pyx_GIVEREF(__pyx_t_3);
25635 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 113, __pyx_L1_error);
25636 __Pyx_GIVEREF(__pyx_t_8);
25637 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_8) != (0)) __PYX_ERR(0, 113, __pyx_L1_error);
25638 __Pyx_GIVEREF(__pyx_t_10);
25639 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_t_10) != (0)) __PYX_ERR(0, 113, __pyx_L1_error);
25640 __Pyx_GIVEREF(__pyx_t_7);
25641 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 3, __pyx_t_7) != (0)) __PYX_ERR(0, 113, __pyx_L1_error);
25642 __Pyx_GIVEREF(__pyx_t_14);
25643 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 4, __pyx_t_14) != (0)) __PYX_ERR(0, 113, __pyx_L1_error);
25644 __Pyx_GIVEREF(__pyx_t_13);
25645 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 5, __pyx_t_13) != (0)) __PYX_ERR(0, 113, __pyx_L1_error);
25646 __Pyx_GIVEREF(__pyx_t_16);
25647 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 6, __pyx_t_16) != (0)) __PYX_ERR(0, 113, __pyx_L1_error);
25648 __Pyx_GIVEREF(__pyx_t_15);
25649 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_18, 7, __pyx_t_15) != (0)) __PYX_ERR(0, 113, __pyx_L1_error);
25650 __pyx_t_3 = 0;
25651 __pyx_t_8 = 0;
25652 __pyx_t_10 = 0;
25653 __pyx_t_7 = 0;
25654 __pyx_t_14 = 0;
25655 __pyx_t_13 = 0;
25656 __pyx_t_16 = 0;
25657 __pyx_t_15 = 0;
25658 {
25659 PyObject *__pyx_temp;
25660 {
25661 __pyx_temp = __pyx_r;
25662 __pyx_r = __pyx_t_18;
25663 }
25664 __Pyx_XDECREF(__pyx_temp);
25665 }
25666 __pyx_t_18 = 0;
25667 goto __pyx_L0;
25668
25669 /* "cpartitioning.pyx":103
25670 * )
25671 *
25672 * def partitionNodesFromTriangleFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
25673 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
25674 * if not isinstance(filebase, bytes):
25675*/
25676
25677 /* function exit code */
25678 __pyx_L1_error:;
25679 __Pyx_XDECREF(__pyx_t_3);
25680 __Pyx_XDECREF(__pyx_t_4);
25681 __Pyx_XDECREF(__pyx_t_7);
25682 __Pyx_XDECREF(__pyx_t_8);
25683 __Pyx_XDECREF(__pyx_t_10);
25684 __Pyx_XDECREF((PyObject *)__pyx_t_12);
25685 __Pyx_XDECREF(__pyx_t_13);
25686 __Pyx_XDECREF(__pyx_t_14);
25687 __Pyx_XDECREF(__pyx_t_15);
25688 __Pyx_XDECREF(__pyx_t_16);
25689 __Pyx_XDECREF(__pyx_t_17);
25690 __Pyx_XDECREF(__pyx_t_18);
25691 __Pyx_XDECREF(__pyx_t_19);
25692 __Pyx_AddTraceback("cpartitioning.partitionNodesFromTriangleFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
25693 __pyx_r = NULL;
25694 __pyx_L0:;
25695 __Pyx_XDECREF(__pyx_v_filebase);
25696 __Pyx_XGIVEREF(__pyx_r);
25697 __Pyx_RefNannyFinishContext();
25698 return __pyx_r;
25699}
25700
25701/* "cpartitioning.pyx":123
25702 * )
25703 *
25704 * def buildQuadraticLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
25705 * int nSpace,
25706 * cmeshTools.CMesh cmesh,
25707*/
25708
25709/* Python wrapper */
25710static PyObject *__pyx_pw_13cpartitioning_11buildQuadraticLocal2GlobalMappings(PyObject *__pyx_self,
25711#if CYTHON_VECTORCALL
25712PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
25713#else
25714PyObject *__pyx_args, PyObject *__pyx_kwds
25715#endif
25716); /*proto*/
25717static PyMethodDef __pyx_mdef_13cpartitioning_11buildQuadraticLocal2GlobalMappings = {"buildQuadraticLocal2GlobalMappings", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cpartitioning_11buildQuadraticLocal2GlobalMappings, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
25718static PyObject *__pyx_pw_13cpartitioning_11buildQuadraticLocal2GlobalMappings(PyObject *__pyx_self,
25719#if CYTHON_VECTORCALL
25720PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
25721#else
25722PyObject *__pyx_args, PyObject *__pyx_kwds
25723#endif
25724) {
25725 struct PyMPICommObject *__pyx_v_comm = 0;
25726 int __pyx_v_nSpace;
25727 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
25728 CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
25729 PyArrayObject *__pyx_v_elementOffsets_subdomain_owned = 0;
25730 PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned = 0;
25731 PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned = 0;
25732 PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned = 0;
25733 PyArrayObject *__pyx_v_elementNumbering_subdomain2global = 0;
25734 PyArrayObject *__pyx_v_nodeNumbering_subdomain2global = 0;
25735 PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global = 0;
25736 PyArrayObject *__pyx_v_edgeNumbering_subdomain2global = 0;
25737 PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned = 0;
25738 PyArrayObject *__pyx_v_quadratic_subdomain_l2g = 0;
25739 PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global = 0;
25740 PyArrayObject *__pyx_v_quadratic_lagrangeNodes = 0;
25741 #if !CYTHON_VECTORCALL
25742 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
25743 #endif
25744 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
25745 PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
25746 int __pyx_lineno = 0;
25747 const char *__pyx_filename = NULL;
25748 int __pyx_clineno = 0;
25749 PyObject *__pyx_r = 0;
25750 __Pyx_RefNannyDeclarations
25751 __Pyx_RefNannySetupContext("buildQuadraticLocal2GlobalMappings (wrapper)", 0);
25752 #if !CYTHON_VECTORCALL
25753 #if CYTHON_ASSUME_SAFE_SIZE
25754 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
25755 #else
25756 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
25757 #endif
25758 #endif
25759 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
25760 {
25761 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,&__pyx_mstate_global->__pyx_n_u_nSpace,&__pyx_mstate_global->__pyx_n_u_cmesh,&__pyx_mstate_global->__pyx_n_u_subdomain_cmesh,&__pyx_mstate_global->__pyx_n_u_elementOffsets_subdomain_owned,&__pyx_mstate_global->__pyx_n_u_nodeOffsets_subdomain_owned,&__pyx_mstate_global->__pyx_n_u_elementBoundaryOffsets_subdomain,&__pyx_mstate_global->__pyx_n_u_edgeOffsets_subdomain_owned,&__pyx_mstate_global->__pyx_n_u_elementNumbering_subdomain2globa,&__pyx_mstate_global->__pyx_n_u_nodeNumbering_subdomain2global,&__pyx_mstate_global->__pyx_n_u_elementBoundaryNumbering_subdoma,&__pyx_mstate_global->__pyx_n_u_edgeNumbering_subdomain2global,&__pyx_mstate_global->__pyx_n_u_quadratic_dof_offsets_subdomain,&__pyx_mstate_global->__pyx_n_u_quadratic_subdomain_l2g,&__pyx_mstate_global->__pyx_n_u_quadraticNumbering_subdomain2glo,&__pyx_mstate_global->__pyx_n_u_quadratic_lagrangeNodes,0};
25762 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
25763 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 123, __pyx_L3_error)
25764 if (__pyx_kwds_len > 0) {
25765 switch (__pyx_nargs) {
25766 case 16:
25767 values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
25768 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 123, __pyx_L3_error)
25769 CYTHON_FALLTHROUGH;
25770 case 15:
25771 values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
25772 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 123, __pyx_L3_error)
25773 CYTHON_FALLTHROUGH;
25774 case 14:
25775 values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
25776 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 123, __pyx_L3_error)
25777 CYTHON_FALLTHROUGH;
25778 case 13:
25779 values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
25780 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 123, __pyx_L3_error)
25781 CYTHON_FALLTHROUGH;
25782 case 12:
25783 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
25784 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 123, __pyx_L3_error)
25785 CYTHON_FALLTHROUGH;
25786 case 11:
25787 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
25788 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 123, __pyx_L3_error)
25789 CYTHON_FALLTHROUGH;
25790 case 10:
25791 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
25792 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 123, __pyx_L3_error)
25793 CYTHON_FALLTHROUGH;
25794 case 9:
25795 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
25796 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 123, __pyx_L3_error)
25797 CYTHON_FALLTHROUGH;
25798 case 8:
25799 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
25800 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 123, __pyx_L3_error)
25801 CYTHON_FALLTHROUGH;
25802 case 7:
25803 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
25804 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 123, __pyx_L3_error)
25805 CYTHON_FALLTHROUGH;
25806 case 6:
25807 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
25808 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 123, __pyx_L3_error)
25809 CYTHON_FALLTHROUGH;
25810 case 5:
25811 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
25812 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 123, __pyx_L3_error)
25813 CYTHON_FALLTHROUGH;
25814 case 4:
25815 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
25816 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 123, __pyx_L3_error)
25817 CYTHON_FALLTHROUGH;
25818 case 3:
25819 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
25820 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 123, __pyx_L3_error)
25821 CYTHON_FALLTHROUGH;
25822 case 2:
25823 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
25824 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 123, __pyx_L3_error)
25825 CYTHON_FALLTHROUGH;
25826 case 1:
25827 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
25828 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 123, __pyx_L3_error)
25829 CYTHON_FALLTHROUGH;
25830 case 0: break;
25831 default: goto __pyx_L5_argtuple_error;
25832 }
25833 const Py_ssize_t kwd_pos_args = __pyx_nargs;
25834 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "buildQuadraticLocal2GlobalMappings", 0) < (0)) __PYX_ERR(0, 123, __pyx_L3_error)
25835 for (Py_ssize_t i = __pyx_nargs; i < 16; i++) {
25836 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, i); __PYX_ERR(0, 123, __pyx_L3_error) }
25837 }
25838 } else if (unlikely(__pyx_nargs != 16)) {
25839 goto __pyx_L5_argtuple_error;
25840 } else {
25841 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
25842 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 123, __pyx_L3_error)
25843 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
25844 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 123, __pyx_L3_error)
25845 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
25846 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 123, __pyx_L3_error)
25847 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
25848 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 123, __pyx_L3_error)
25849 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
25850 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 123, __pyx_L3_error)
25851 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
25852 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 123, __pyx_L3_error)
25853 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
25854 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 123, __pyx_L3_error)
25855 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
25856 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 123, __pyx_L3_error)
25857 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
25858 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 123, __pyx_L3_error)
25859 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
25860 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 123, __pyx_L3_error)
25861 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
25862 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 123, __pyx_L3_error)
25863 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
25864 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 123, __pyx_L3_error)
25865 values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
25866 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 123, __pyx_L3_error)
25867 values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
25868 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 123, __pyx_L3_error)
25869 values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
25870 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 123, __pyx_L3_error)
25871 values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
25872 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 123, __pyx_L3_error)
25873 }
25874 __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
25875 __pyx_v_nSpace = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_nSpace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L3_error)
25876 __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
25877 __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
25878 __pyx_v_elementOffsets_subdomain_owned = ((PyArrayObject *)values[4]);
25879 __pyx_v_nodeOffsets_subdomain_owned = ((PyArrayObject *)values[5]);
25880 __pyx_v_elementBoundaryOffsets_subdomain_owned = ((PyArrayObject *)values[6]);
25881 __pyx_v_edgeOffsets_subdomain_owned = ((PyArrayObject *)values[7]);
25882 __pyx_v_elementNumbering_subdomain2global = ((PyArrayObject *)values[8]);
25883 __pyx_v_nodeNumbering_subdomain2global = ((PyArrayObject *)values[9]);
25884 __pyx_v_elementBoundaryNumbering_subdomain2global = ((PyArrayObject *)values[10]);
25885 __pyx_v_edgeNumbering_subdomain2global = ((PyArrayObject *)values[11]);
25886 __pyx_v_quadratic_dof_offsets_subdomain_owned = ((PyArrayObject *)values[12]);
25887 __pyx_v_quadratic_subdomain_l2g = ((PyArrayObject *)values[13]);
25888 __pyx_v_quadraticNumbering_subdomain2global = ((PyArrayObject *)values[14]);
25889 __pyx_v_quadratic_lagrangeNodes = ((PyArrayObject *)values[15]);
25890 }
25891 goto __pyx_L6_skip;
25892 __pyx_L5_argtuple_error:;
25893 __Pyx_RaiseArgtupleInvalid("buildQuadraticLocal2GlobalMappings", 1, 16, 16, __pyx_nargs); __PYX_ERR(0, 123, __pyx_L3_error)
25894 __pyx_L6_skip:;
25895 goto __pyx_L4_argument_unpacking_done;
25896 __pyx_L3_error:;
25897 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
25898 Py_XDECREF(values[__pyx_temp]);
25899 }
25900 __Pyx_AddTraceback("cpartitioning.buildQuadraticLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
25901 __Pyx_RefNannyFinishContext();
25902 return NULL;
25903 __pyx_L4_argument_unpacking_done:;
25904 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 123, __pyx_L1_error)
25905 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_mstate_global->__pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 125, __pyx_L1_error)
25906 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_mstate_global->__pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 126, __pyx_L1_error)
25907 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementOffsets_subdomain_owned), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementOffsets_subdomain_owned", 0))) __PYX_ERR(0, 127, __pyx_L1_error)
25908 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeOffsets_subdomain_owned), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "nodeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 128, __pyx_L1_error)
25909 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryOffsets_subdomain_owned), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBoundaryOffsets_subdomain_owned", 0))) __PYX_ERR(0, 129, __pyx_L1_error)
25910 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeOffsets_subdomain_owned), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "edgeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 130, __pyx_L1_error)
25911 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNumbering_subdomain2global), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementNumbering_subdomain2global", 0))) __PYX_ERR(0, 131, __pyx_L1_error)
25912 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeNumbering_subdomain2global), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "nodeNumbering_subdomain2global", 0))) __PYX_ERR(0, 132, __pyx_L1_error)
25913 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryNumbering_subdomain2global), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBoundaryNumbering_subdomain2global", 0))) __PYX_ERR(0, 133, __pyx_L1_error)
25914 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeNumbering_subdomain2global), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "edgeNumbering_subdomain2global", 0))) __PYX_ERR(0, 134, __pyx_L1_error)
25915 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_dof_offsets_subdomain_owned), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "quadratic_dof_offsets_subdomain_owned", 0))) __PYX_ERR(0, 135, __pyx_L1_error)
25916 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_subdomain_l2g), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "quadratic_subdomain_l2g", 0))) __PYX_ERR(0, 136, __pyx_L1_error)
25917 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadraticNumbering_subdomain2global), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "quadraticNumbering_subdomain2global", 0))) __PYX_ERR(0, 137, __pyx_L1_error)
25918 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_lagrangeNodes), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "quadratic_lagrangeNodes", 0))) __PYX_ERR(0, 138, __pyx_L1_error)
25919 __pyx_r = __pyx_pf_13cpartitioning_10buildQuadraticLocal2GlobalMappings(__pyx_self, __pyx_v_comm, __pyx_v_nSpace, __pyx_v_cmesh, __pyx_v_subdomain_cmesh, __pyx_v_elementOffsets_subdomain_owned, __pyx_v_nodeOffsets_subdomain_owned, __pyx_v_elementBoundaryOffsets_subdomain_owned, __pyx_v_edgeOffsets_subdomain_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_nodeNumbering_subdomain2global, __pyx_v_elementBoundaryNumbering_subdomain2global, __pyx_v_edgeNumbering_subdomain2global, __pyx_v_quadratic_dof_offsets_subdomain_owned, __pyx_v_quadratic_subdomain_l2g, __pyx_v_quadraticNumbering_subdomain2global, __pyx_v_quadratic_lagrangeNodes);
25920
25921 /* function exit code */
25922 goto __pyx_L0;
25923 __pyx_L1_error:;
25924 __pyx_r = NULL;
25925 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
25926 Py_XDECREF(values[__pyx_temp]);
25927 }
25928 goto __pyx_L7_cleaned_up;
25929 __pyx_L0:;
25930 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
25931 Py_XDECREF(values[__pyx_temp]);
25932 }
25933 __pyx_L7_cleaned_up:;
25934
25935 __Pyx_RefNannyFinishContext();
25936 return __pyx_r;
25937}
25938
25939static PyObject *__pyx_pf_13cpartitioning_10buildQuadraticLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nSpace, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes) {
25940 int __pyx_v_nDOF_all_processes;
25941 int __pyx_v_nDOF_subdomain;
25942 int __pyx_v_max_dof_neighbors;
25943 PyObject *__pyx_r = NULL;
25944 __Pyx_RefNannyDeclarations
25945 PyObject *__pyx_t_1 = NULL;
25946 PyObject *__pyx_t_2 = NULL;
25947 PyObject *__pyx_t_3 = NULL;
25948 PyObject *__pyx_t_4 = NULL;
25949 int __pyx_lineno = 0;
25950 const char *__pyx_filename = NULL;
25951 int __pyx_clineno = 0;
25952 __Pyx_RefNannySetupContext("buildQuadraticLocal2GlobalMappings", 0);
25953
25954 /* "cpartitioning.pyx":139
25955 * np.ndarray quadraticNumbering_subdomain2global,
25956 * np.ndarray quadratic_lagrangeNodes):
25957 * cdef int nDOF_all_processes=0 # <<<<<<<<<<<<<<
25958 * cdef int nDOF_subdomain=0
25959 * cdef int max_dof_neighbors=0
25960*/
25961 __pyx_v_nDOF_all_processes = 0;
25962
25963 /* "cpartitioning.pyx":140
25964 * np.ndarray quadratic_lagrangeNodes):
25965 * cdef int nDOF_all_processes=0
25966 * cdef int nDOF_subdomain=0 # <<<<<<<<<<<<<<
25967 * cdef int max_dof_neighbors=0
25968 * if nSpace == 1:
25969*/
25970 __pyx_v_nDOF_subdomain = 0;
25971
25972 /* "cpartitioning.pyx":141
25973 * cdef int nDOF_all_processes=0
25974 * cdef int nDOF_subdomain=0
25975 * cdef int max_dof_neighbors=0 # <<<<<<<<<<<<<<
25976 * if nSpace == 1:
25977 * buildQuadraticSubdomain2GlobalMappings_1d(comm.ob_mpi,
25978*/
25979 __pyx_v_max_dof_neighbors = 0;
25980
25981 /* "cpartitioning.pyx":142
25982 * cdef int nDOF_subdomain=0
25983 * cdef int max_dof_neighbors=0
25984 * if nSpace == 1: # <<<<<<<<<<<<<<
25985 * buildQuadraticSubdomain2GlobalMappings_1d(comm.ob_mpi,
25986 * cmesh.mesh,
25987*/
25988 switch (__pyx_v_nSpace) {
25989 case 1:
25990
25991 /* "cpartitioning.pyx":143
25992 * cdef int max_dof_neighbors=0
25993 * if nSpace == 1:
25994 * buildQuadraticSubdomain2GlobalMappings_1d(comm.ob_mpi, # <<<<<<<<<<<<<<
25995 * cmesh.mesh,
25996 * <int*>(elementOffsets_subdomain_owned.data),
25997*/
25998 (void)(proteus::buildQuadraticSubdomain2GlobalMappings_1d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementOffsets_subdomain_owned)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_nodeOffsets_subdomain_owned)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementNumbering_subdomain2global)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_nodeNumbering_subdomain2global)), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_quadratic_dof_offsets_subdomain_owned)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_quadratic_subdomain_l2g)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_quadraticNumbering_subdomain2global)), ((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_quadratic_lagrangeNodes))));
25999
26000 /* "cpartitioning.pyx":142
26001 * cdef int nDOF_subdomain=0
26002 * cdef int max_dof_neighbors=0
26003 * if nSpace == 1: # <<<<<<<<<<<<<<
26004 * buildQuadraticSubdomain2GlobalMappings_1d(comm.ob_mpi,
26005 * cmesh.mesh,
26006*/
26007 break;
26008 case 2:
26009
26010 /* "cpartitioning.pyx":157
26011 * <double*>(quadratic_lagrangeNodes.data));
26012 * elif nSpace == 2:
26013 * buildQuadraticSubdomain2GlobalMappings_2d(comm.ob_mpi, # <<<<<<<<<<<<<<
26014 * cmesh.mesh,
26015 * <int*>(elementBoundaryOffsets_subdomain_owned.data),
26016*/
26017 (void)(proteus::buildQuadraticSubdomain2GlobalMappings_2d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementBoundaryOffsets_subdomain_owned)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_nodeOffsets_subdomain_owned)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementBoundaryNumbering_subdomain2global)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_nodeNumbering_subdomain2global)), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_quadratic_dof_offsets_subdomain_owned)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_quadratic_subdomain_l2g)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_quadraticNumbering_subdomain2global)), ((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_quadratic_lagrangeNodes))));
26018
26019 /* "cpartitioning.pyx":156
26020 * <int*>(quadraticNumbering_subdomain2global.data),
26021 * <double*>(quadratic_lagrangeNodes.data));
26022 * elif nSpace == 2: # <<<<<<<<<<<<<<
26023 * buildQuadraticSubdomain2GlobalMappings_2d(comm.ob_mpi,
26024 * cmesh.mesh,
26025*/
26026 break;
26027 default:
26028
26029 /* "cpartitioning.pyx":171
26030 * <double*>(quadratic_lagrangeNodes.data))
26031 * else:
26032 * buildQuadraticSubdomain2GlobalMappings_3d(comm.ob_mpi, # <<<<<<<<<<<<<<
26033 * cmesh.mesh,
26034 * <int*>(edgeOffsets_subdomain_owned.data),
26035*/
26036 (void)(proteus::buildQuadraticSubdomain2GlobalMappings_3d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_edgeOffsets_subdomain_owned)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_nodeOffsets_subdomain_owned)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_edgeNumbering_subdomain2global)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_nodeNumbering_subdomain2global)), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_quadratic_dof_offsets_subdomain_owned)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_quadratic_subdomain_l2g)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_quadraticNumbering_subdomain2global)), ((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_quadratic_lagrangeNodes))));
26037 break;
26038 }
26039
26040 /* "cpartitioning.pyx":184
26041 * <int*>(quadraticNumbering_subdomain2global.data),
26042 * <double*>(quadratic_lagrangeNodes.data))
26043 * return (nDOF_all_processes, # <<<<<<<<<<<<<<
26044 * nDOF_subdomain,
26045 * max_dof_neighbors)
26046*/
26047 __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_nDOF_all_processes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error)
26048 __Pyx_GOTREF(__pyx_t_1);
26049
26050 /* "cpartitioning.pyx":185
26051 * <double*>(quadratic_lagrangeNodes.data))
26052 * return (nDOF_all_processes,
26053 * nDOF_subdomain, # <<<<<<<<<<<<<<
26054 * max_dof_neighbors)
26055 *
26056*/
26057 __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_nDOF_subdomain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error)
26058 __Pyx_GOTREF(__pyx_t_2);
26059
26060 /* "cpartitioning.pyx":186
26061 * return (nDOF_all_processes,
26062 * nDOF_subdomain,
26063 * max_dof_neighbors) # <<<<<<<<<<<<<<
26064 *
26065 * def buildQuadraticCubeLocal2GlobalMappings(Comm comm,
26066*/
26067 __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_max_dof_neighbors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error)
26068 __Pyx_GOTREF(__pyx_t_3);
26069
26070 /* "cpartitioning.pyx":184
26071 * <int*>(quadraticNumbering_subdomain2global.data),
26072 * <double*>(quadratic_lagrangeNodes.data))
26073 * return (nDOF_all_processes, # <<<<<<<<<<<<<<
26074 * nDOF_subdomain,
26075 * max_dof_neighbors)
26076*/
26077 __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error)
26078 __Pyx_GOTREF(__pyx_t_4);
26079 __Pyx_GIVEREF(__pyx_t_1);
26080 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 184, __pyx_L1_error);
26081 __Pyx_GIVEREF(__pyx_t_2);
26082 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 184, __pyx_L1_error);
26083 __Pyx_GIVEREF(__pyx_t_3);
26084 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 184, __pyx_L1_error);
26085 __pyx_t_1 = 0;
26086 __pyx_t_2 = 0;
26087 __pyx_t_3 = 0;
26088 {
26089 PyObject *__pyx_temp;
26090 {
26091 __pyx_temp = __pyx_r;
26092 __pyx_r = __pyx_t_4;
26093 }
26094 __Pyx_XDECREF(__pyx_temp);
26095 }
26096 __pyx_t_4 = 0;
26097 goto __pyx_L0;
26098
26099 /* "cpartitioning.pyx":123
26100 * )
26101 *
26102 * def buildQuadraticLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
26103 * int nSpace,
26104 * cmeshTools.CMesh cmesh,
26105*/
26106
26107 /* function exit code */
26108 __pyx_L1_error:;
26109 __Pyx_XDECREF(__pyx_t_1);
26110 __Pyx_XDECREF(__pyx_t_2);
26111 __Pyx_XDECREF(__pyx_t_3);
26112 __Pyx_XDECREF(__pyx_t_4);
26113 __Pyx_AddTraceback("cpartitioning.buildQuadraticLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
26114 __pyx_r = NULL;
26115 __pyx_L0:;
26116
26117
26118
26119 __Pyx_XGIVEREF(__pyx_r);
26120 __Pyx_RefNannyFinishContext();
26121 return __pyx_r;
26122}
26123
26124/* "cpartitioning.pyx":188
26125 * max_dof_neighbors)
26126 *
26127 * def buildQuadraticCubeLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
26128 * int nSpace,
26129 * cmeshTools.CMesh cmesh,
26130*/
26131
26132/* Python wrapper */
26133static PyObject *__pyx_pw_13cpartitioning_13buildQuadraticCubeLocal2GlobalMappings(PyObject *__pyx_self,
26134#if CYTHON_VECTORCALL
26135PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
26136#else
26137PyObject *__pyx_args, PyObject *__pyx_kwds
26138#endif
26139); /*proto*/
26140static PyMethodDef __pyx_mdef_13cpartitioning_13buildQuadraticCubeLocal2GlobalMappings = {"buildQuadraticCubeLocal2GlobalMappings", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cpartitioning_13buildQuadraticCubeLocal2GlobalMappings, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
26141static PyObject *__pyx_pw_13cpartitioning_13buildQuadraticCubeLocal2GlobalMappings(PyObject *__pyx_self,
26142#if CYTHON_VECTORCALL
26143PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
26144#else
26145PyObject *__pyx_args, PyObject *__pyx_kwds
26146#endif
26147) {
26148 struct PyMPICommObject *__pyx_v_comm = 0;
26149 int __pyx_v_nSpace;
26150 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
26151 CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
26152 CYTHON_UNUSED PyArrayObject *__pyx_v_elementOffsets_subdomain_owned = 0;
26153 PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned = 0;
26154 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned = 0;
26155 PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned = 0;
26156 CYTHON_UNUSED PyArrayObject *__pyx_v_elementNumbering_subdomain2global = 0;
26157 PyArrayObject *__pyx_v_nodeNumbering_subdomain2global = 0;
26158 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global = 0;
26159 PyArrayObject *__pyx_v_edgeNumbering_subdomain2global = 0;
26160 PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned = 0;
26161 PyArrayObject *__pyx_v_quadratic_subdomain_l2g = 0;
26162 PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global = 0;
26163 PyArrayObject *__pyx_v_quadratic_lagrangeNodes = 0;
26164 #if !CYTHON_VECTORCALL
26165 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
26166 #endif
26167 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
26168 PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
26169 int __pyx_lineno = 0;
26170 const char *__pyx_filename = NULL;
26171 int __pyx_clineno = 0;
26172 PyObject *__pyx_r = 0;
26173 __Pyx_RefNannyDeclarations
26174 __Pyx_RefNannySetupContext("buildQuadraticCubeLocal2GlobalMappings (wrapper)", 0);
26175 #if !CYTHON_VECTORCALL
26176 #if CYTHON_ASSUME_SAFE_SIZE
26177 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
26178 #else
26179 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
26180 #endif
26181 #endif
26182 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
26183 {
26184 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,&__pyx_mstate_global->__pyx_n_u_nSpace,&__pyx_mstate_global->__pyx_n_u_cmesh,&__pyx_mstate_global->__pyx_n_u_subdomain_cmesh,&__pyx_mstate_global->__pyx_n_u_elementOffsets_subdomain_owned,&__pyx_mstate_global->__pyx_n_u_nodeOffsets_subdomain_owned,&__pyx_mstate_global->__pyx_n_u_elementBoundaryOffsets_subdomain,&__pyx_mstate_global->__pyx_n_u_edgeOffsets_subdomain_owned,&__pyx_mstate_global->__pyx_n_u_elementNumbering_subdomain2globa,&__pyx_mstate_global->__pyx_n_u_nodeNumbering_subdomain2global,&__pyx_mstate_global->__pyx_n_u_elementBoundaryNumbering_subdoma,&__pyx_mstate_global->__pyx_n_u_edgeNumbering_subdomain2global,&__pyx_mstate_global->__pyx_n_u_quadratic_dof_offsets_subdomain,&__pyx_mstate_global->__pyx_n_u_quadratic_subdomain_l2g,&__pyx_mstate_global->__pyx_n_u_quadraticNumbering_subdomain2glo,&__pyx_mstate_global->__pyx_n_u_quadratic_lagrangeNodes,0};
26185 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
26186 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 188, __pyx_L3_error)
26187 if (__pyx_kwds_len > 0) {
26188 switch (__pyx_nargs) {
26189 case 16:
26190 values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
26191 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 188, __pyx_L3_error)
26192 CYTHON_FALLTHROUGH;
26193 case 15:
26194 values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
26195 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 188, __pyx_L3_error)
26196 CYTHON_FALLTHROUGH;
26197 case 14:
26198 values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
26199 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 188, __pyx_L3_error)
26200 CYTHON_FALLTHROUGH;
26201 case 13:
26202 values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
26203 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 188, __pyx_L3_error)
26204 CYTHON_FALLTHROUGH;
26205 case 12:
26206 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
26207 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 188, __pyx_L3_error)
26208 CYTHON_FALLTHROUGH;
26209 case 11:
26210 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
26211 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 188, __pyx_L3_error)
26212 CYTHON_FALLTHROUGH;
26213 case 10:
26214 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
26215 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 188, __pyx_L3_error)
26216 CYTHON_FALLTHROUGH;
26217 case 9:
26218 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
26219 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 188, __pyx_L3_error)
26220 CYTHON_FALLTHROUGH;
26221 case 8:
26222 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
26223 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 188, __pyx_L3_error)
26224 CYTHON_FALLTHROUGH;
26225 case 7:
26226 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
26227 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 188, __pyx_L3_error)
26228 CYTHON_FALLTHROUGH;
26229 case 6:
26230 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
26231 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 188, __pyx_L3_error)
26232 CYTHON_FALLTHROUGH;
26233 case 5:
26234 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
26235 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 188, __pyx_L3_error)
26236 CYTHON_FALLTHROUGH;
26237 case 4:
26238 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
26239 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 188, __pyx_L3_error)
26240 CYTHON_FALLTHROUGH;
26241 case 3:
26242 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
26243 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 188, __pyx_L3_error)
26244 CYTHON_FALLTHROUGH;
26245 case 2:
26246 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
26247 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 188, __pyx_L3_error)
26248 CYTHON_FALLTHROUGH;
26249 case 1:
26250 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
26251 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 188, __pyx_L3_error)
26252 CYTHON_FALLTHROUGH;
26253 case 0: break;
26254 default: goto __pyx_L5_argtuple_error;
26255 }
26256 const Py_ssize_t kwd_pos_args = __pyx_nargs;
26257 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "buildQuadraticCubeLocal2GlobalMappings", 0) < (0)) __PYX_ERR(0, 188, __pyx_L3_error)
26258 for (Py_ssize_t i = __pyx_nargs; i < 16; i++) {
26259 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, i); __PYX_ERR(0, 188, __pyx_L3_error) }
26260 }
26261 } else if (unlikely(__pyx_nargs != 16)) {
26262 goto __pyx_L5_argtuple_error;
26263 } else {
26264 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
26265 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 188, __pyx_L3_error)
26266 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
26267 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 188, __pyx_L3_error)
26268 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
26269 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 188, __pyx_L3_error)
26270 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
26271 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 188, __pyx_L3_error)
26272 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
26273 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 188, __pyx_L3_error)
26274 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
26275 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 188, __pyx_L3_error)
26276 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
26277 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 188, __pyx_L3_error)
26278 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
26279 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 188, __pyx_L3_error)
26280 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
26281 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 188, __pyx_L3_error)
26282 values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
26283 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 188, __pyx_L3_error)
26284 values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
26285 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 188, __pyx_L3_error)
26286 values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
26287 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 188, __pyx_L3_error)
26288 values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
26289 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 188, __pyx_L3_error)
26290 values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
26291 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 188, __pyx_L3_error)
26292 values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
26293 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 188, __pyx_L3_error)
26294 values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
26295 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 188, __pyx_L3_error)
26296 }
26297 __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
26298 __pyx_v_nSpace = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_nSpace == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 189, __pyx_L3_error)
26299 __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
26300 __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
26301 __pyx_v_elementOffsets_subdomain_owned = ((PyArrayObject *)values[4]);
26302 __pyx_v_nodeOffsets_subdomain_owned = ((PyArrayObject *)values[5]);
26303 __pyx_v_elementBoundaryOffsets_subdomain_owned = ((PyArrayObject *)values[6]);
26304 __pyx_v_edgeOffsets_subdomain_owned = ((PyArrayObject *)values[7]);
26305 __pyx_v_elementNumbering_subdomain2global = ((PyArrayObject *)values[8]);
26306 __pyx_v_nodeNumbering_subdomain2global = ((PyArrayObject *)values[9]);
26307 __pyx_v_elementBoundaryNumbering_subdomain2global = ((PyArrayObject *)values[10]);
26308 __pyx_v_edgeNumbering_subdomain2global = ((PyArrayObject *)values[11]);
26309 __pyx_v_quadratic_dof_offsets_subdomain_owned = ((PyArrayObject *)values[12]);
26310 __pyx_v_quadratic_subdomain_l2g = ((PyArrayObject *)values[13]);
26311 __pyx_v_quadraticNumbering_subdomain2global = ((PyArrayObject *)values[14]);
26312 __pyx_v_quadratic_lagrangeNodes = ((PyArrayObject *)values[15]);
26313 }
26314 goto __pyx_L6_skip;
26315 __pyx_L5_argtuple_error:;
26316 __Pyx_RaiseArgtupleInvalid("buildQuadraticCubeLocal2GlobalMappings", 1, 16, 16, __pyx_nargs); __PYX_ERR(0, 188, __pyx_L3_error)
26317 __pyx_L6_skip:;
26318 goto __pyx_L4_argument_unpacking_done;
26319 __pyx_L3_error:;
26320 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
26321 Py_XDECREF(values[__pyx_temp]);
26322 }
26323 __Pyx_AddTraceback("cpartitioning.buildQuadraticCubeLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
26324 __Pyx_RefNannyFinishContext();
26325 return NULL;
26326 __pyx_L4_argument_unpacking_done:;
26327 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 188, __pyx_L1_error)
26328 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_mstate_global->__pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 190, __pyx_L1_error)
26329 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_mstate_global->__pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 191, __pyx_L1_error)
26330 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementOffsets_subdomain_owned), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementOffsets_subdomain_owned", 0))) __PYX_ERR(0, 192, __pyx_L1_error)
26331 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeOffsets_subdomain_owned), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "nodeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 193, __pyx_L1_error)
26332 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryOffsets_subdomain_owned), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBoundaryOffsets_subdomain_owned", 0))) __PYX_ERR(0, 194, __pyx_L1_error)
26333 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeOffsets_subdomain_owned), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "edgeOffsets_subdomain_owned", 0))) __PYX_ERR(0, 195, __pyx_L1_error)
26334 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNumbering_subdomain2global), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementNumbering_subdomain2global", 0))) __PYX_ERR(0, 196, __pyx_L1_error)
26335 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nodeNumbering_subdomain2global), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "nodeNumbering_subdomain2global", 0))) __PYX_ERR(0, 197, __pyx_L1_error)
26336 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryNumbering_subdomain2global), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementBoundaryNumbering_subdomain2global", 0))) __PYX_ERR(0, 198, __pyx_L1_error)
26337 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edgeNumbering_subdomain2global), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "edgeNumbering_subdomain2global", 0))) __PYX_ERR(0, 199, __pyx_L1_error)
26338 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_dof_offsets_subdomain_owned), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "quadratic_dof_offsets_subdomain_owned", 0))) __PYX_ERR(0, 200, __pyx_L1_error)
26339 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_subdomain_l2g), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "quadratic_subdomain_l2g", 0))) __PYX_ERR(0, 201, __pyx_L1_error)
26340 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadraticNumbering_subdomain2global), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "quadraticNumbering_subdomain2global", 0))) __PYX_ERR(0, 202, __pyx_L1_error)
26341 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_quadratic_lagrangeNodes), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "quadratic_lagrangeNodes", 0))) __PYX_ERR(0, 203, __pyx_L1_error)
26342 __pyx_r = __pyx_pf_13cpartitioning_12buildQuadraticCubeLocal2GlobalMappings(__pyx_self, __pyx_v_comm, __pyx_v_nSpace, __pyx_v_cmesh, __pyx_v_subdomain_cmesh, __pyx_v_elementOffsets_subdomain_owned, __pyx_v_nodeOffsets_subdomain_owned, __pyx_v_elementBoundaryOffsets_subdomain_owned, __pyx_v_edgeOffsets_subdomain_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_nodeNumbering_subdomain2global, __pyx_v_elementBoundaryNumbering_subdomain2global, __pyx_v_edgeNumbering_subdomain2global, __pyx_v_quadratic_dof_offsets_subdomain_owned, __pyx_v_quadratic_subdomain_l2g, __pyx_v_quadraticNumbering_subdomain2global, __pyx_v_quadratic_lagrangeNodes);
26343
26344 /* function exit code */
26345 goto __pyx_L0;
26346 __pyx_L1_error:;
26347 __pyx_r = NULL;
26348 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
26349 Py_XDECREF(values[__pyx_temp]);
26350 }
26351 goto __pyx_L7_cleaned_up;
26352 __pyx_L0:;
26353 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
26354 Py_XDECREF(values[__pyx_temp]);
26355 }
26356 __pyx_L7_cleaned_up:;
26357
26358 __Pyx_RefNannyFinishContext();
26359 return __pyx_r;
26360}
26361
26362static PyObject *__pyx_pf_13cpartitioning_12buildQuadraticCubeLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nSpace, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, CYTHON_UNUSED PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_nodeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryOffsets_subdomain_owned, PyArrayObject *__pyx_v_edgeOffsets_subdomain_owned, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_nodeNumbering_subdomain2global, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundaryNumbering_subdomain2global, PyArrayObject *__pyx_v_edgeNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_quadratic_subdomain_l2g, PyArrayObject *__pyx_v_quadraticNumbering_subdomain2global, PyArrayObject *__pyx_v_quadratic_lagrangeNodes) {
26363 int __pyx_v_nDOF_all_processes;
26364 int __pyx_v_nDOF_subdomain;
26365 int __pyx_v_max_dof_neighbors;
26366 PyObject *__pyx_r = NULL;
26367 __Pyx_RefNannyDeclarations
26368 PyObject *__pyx_t_1 = NULL;
26369 PyObject *__pyx_t_2 = NULL;
26370 PyObject *__pyx_t_3 = NULL;
26371 PyObject *__pyx_t_4 = NULL;
26372 int __pyx_lineno = 0;
26373 const char *__pyx_filename = NULL;
26374 int __pyx_clineno = 0;
26375 __Pyx_RefNannySetupContext("buildQuadraticCubeLocal2GlobalMappings", 0);
26376
26377 /* "cpartitioning.pyx":204
26378 * np.ndarray quadraticNumbering_subdomain2global,
26379 * np.ndarray quadratic_lagrangeNodes):
26380 * cdef int nDOF_all_processes=0 # <<<<<<<<<<<<<<
26381 * cdef int nDOF_subdomain=0
26382 * cdef int max_dof_neighbors=0
26383*/
26384 __pyx_v_nDOF_all_processes = 0;
26385
26386 /* "cpartitioning.pyx":205
26387 * np.ndarray quadratic_lagrangeNodes):
26388 * cdef int nDOF_all_processes=0
26389 * cdef int nDOF_subdomain=0 # <<<<<<<<<<<<<<
26390 * cdef int max_dof_neighbors=0
26391 * if nSpace == 1:
26392*/
26393 __pyx_v_nDOF_subdomain = 0;
26394
26395 /* "cpartitioning.pyx":206
26396 * cdef int nDOF_all_processes=0
26397 * cdef int nDOF_subdomain=0
26398 * cdef int max_dof_neighbors=0 # <<<<<<<<<<<<<<
26399 * if nSpace == 1:
26400 * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
26401*/
26402 __pyx_v_max_dof_neighbors = 0;
26403
26404 /* "cpartitioning.pyx":207
26405 * cdef int nDOF_subdomain=0
26406 * cdef int max_dof_neighbors=0
26407 * if nSpace == 1: # <<<<<<<<<<<<<<
26408 * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
26409 * elif nSpace == 2:
26410*/
26411 switch (__pyx_v_nSpace) {
26412 case 1:
26413
26414 /* "cpartitioning.pyx":208
26415 * cdef int max_dof_neighbors=0
26416 * if nSpace == 1:
26417 * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!" # <<<<<<<<<<<<<<
26418 * elif nSpace == 2:
26419 * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!"
26420*/
26421 #ifndef CYTHON_WITHOUT_ASSERTIONS
26422 if (unlikely(__pyx_assertions_enabled())) {
26423 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_buildQuadraticCubeSubdomain2Glob, 0, 0);
26424 __PYX_ERR(0, 208, __pyx_L1_error)
26425 }
26426 #else
26427 if ((1)); else __PYX_ERR(0, 208, __pyx_L1_error)
26428 #endif
26429
26430 /* "cpartitioning.pyx":207
26431 * cdef int nDOF_subdomain=0
26432 * cdef int max_dof_neighbors=0
26433 * if nSpace == 1: # <<<<<<<<<<<<<<
26434 * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
26435 * elif nSpace == 2:
26436*/
26437 break;
26438 case 2:
26439
26440 /* "cpartitioning.pyx":210
26441 * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
26442 * elif nSpace == 2:
26443 * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!" # <<<<<<<<<<<<<<
26444 * else:
26445 * buildQuadraticCubeSubdomain2GlobalMappings_3d(comm.ob_mpi,
26446*/
26447 #ifndef CYTHON_WITHOUT_ASSERTIONS
26448 if (unlikely(__pyx_assertions_enabled())) {
26449 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_buildQuadraticCubeSubdomain2Glob_2, 0, 0);
26450 __PYX_ERR(0, 210, __pyx_L1_error)
26451 }
26452 #else
26453 if ((1)); else __PYX_ERR(0, 210, __pyx_L1_error)
26454 #endif
26455
26456 /* "cpartitioning.pyx":209
26457 * if nSpace == 1:
26458 * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!"
26459 * elif nSpace == 2: # <<<<<<<<<<<<<<
26460 * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!"
26461 * else:
26462*/
26463 break;
26464 default:
26465
26466 /* "cpartitioning.pyx":212
26467 * assert(False),"buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!"
26468 * else:
26469 * buildQuadraticCubeSubdomain2GlobalMappings_3d(comm.ob_mpi, # <<<<<<<<<<<<<<
26470 * cmesh.mesh,
26471 * <int*>(edgeOffsets_subdomain_owned.data),
26472*/
26473 (void)(proteus::buildQuadraticCubeSubdomain2GlobalMappings_3d(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_edgeOffsets_subdomain_owned)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_nodeOffsets_subdomain_owned)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_edgeNumbering_subdomain2global)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_nodeNumbering_subdomain2global)), __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_quadratic_dof_offsets_subdomain_owned)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_quadratic_subdomain_l2g)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_quadraticNumbering_subdomain2global)), ((double *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_quadratic_lagrangeNodes))));
26474 break;
26475 }
26476
26477 /* "cpartitioning.pyx":225
26478 * <int*>(quadraticNumbering_subdomain2global.data),
26479 * <double*>(quadratic_lagrangeNodes.data))
26480 * return (nDOF_all_processes, # <<<<<<<<<<<<<<
26481 * nDOF_subdomain,
26482 * max_dof_neighbors)
26483*/
26484 __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_nDOF_all_processes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error)
26485 __Pyx_GOTREF(__pyx_t_1);
26486
26487 /* "cpartitioning.pyx":226
26488 * <double*>(quadratic_lagrangeNodes.data))
26489 * return (nDOF_all_processes,
26490 * nDOF_subdomain, # <<<<<<<<<<<<<<
26491 * max_dof_neighbors)
26492 *
26493*/
26494 __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_nDOF_subdomain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error)
26495 __Pyx_GOTREF(__pyx_t_2);
26496
26497 /* "cpartitioning.pyx":227
26498 * return (nDOF_all_processes,
26499 * nDOF_subdomain,
26500 * max_dof_neighbors) # <<<<<<<<<<<<<<
26501 *
26502 * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm,
26503*/
26504 __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_max_dof_neighbors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error)
26505 __Pyx_GOTREF(__pyx_t_3);
26506
26507 /* "cpartitioning.pyx":225
26508 * <int*>(quadraticNumbering_subdomain2global.data),
26509 * <double*>(quadratic_lagrangeNodes.data))
26510 * return (nDOF_all_processes, # <<<<<<<<<<<<<<
26511 * nDOF_subdomain,
26512 * max_dof_neighbors)
26513*/
26514 __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error)
26515 __Pyx_GOTREF(__pyx_t_4);
26516 __Pyx_GIVEREF(__pyx_t_1);
26517 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 225, __pyx_L1_error);
26518 __Pyx_GIVEREF(__pyx_t_2);
26519 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 225, __pyx_L1_error);
26520 __Pyx_GIVEREF(__pyx_t_3);
26521 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 225, __pyx_L1_error);
26522 __pyx_t_1 = 0;
26523 __pyx_t_2 = 0;
26524 __pyx_t_3 = 0;
26525 {
26526 PyObject *__pyx_temp;
26527 {
26528 __pyx_temp = __pyx_r;
26529 __pyx_r = __pyx_t_4;
26530 }
26531 __Pyx_XDECREF(__pyx_temp);
26532 }
26533 __pyx_t_4 = 0;
26534 goto __pyx_L0;
26535
26536 /* "cpartitioning.pyx":188
26537 * max_dof_neighbors)
26538 *
26539 * def buildQuadraticCubeLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
26540 * int nSpace,
26541 * cmeshTools.CMesh cmesh,
26542*/
26543
26544 /* function exit code */
26545 __pyx_L1_error:;
26546 __Pyx_XDECREF(__pyx_t_1);
26547 __Pyx_XDECREF(__pyx_t_2);
26548 __Pyx_XDECREF(__pyx_t_3);
26549 __Pyx_XDECREF(__pyx_t_4);
26550 __Pyx_AddTraceback("cpartitioning.buildQuadraticCubeLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
26551 __pyx_r = NULL;
26552 __pyx_L0:;
26553
26554
26555
26556 __Pyx_XGIVEREF(__pyx_r);
26557 __Pyx_RefNannyFinishContext();
26558 return __pyx_r;
26559}
26560
26561/* "cpartitioning.pyx":229
26562 * max_dof_neighbors)
26563 *
26564 * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
26565 * int nDOF_element,
26566 * cmeshTools.CMesh cmesh,
26567*/
26568
26569/* Python wrapper */
26570static PyObject *__pyx_pw_13cpartitioning_15buildDiscontinuousGalerkinLocal2GlobalMappings(PyObject *__pyx_self,
26571#if CYTHON_VECTORCALL
26572PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
26573#else
26574PyObject *__pyx_args, PyObject *__pyx_kwds
26575#endif
26576); /*proto*/
26577static PyMethodDef __pyx_mdef_13cpartitioning_15buildDiscontinuousGalerkinLocal2GlobalMappings = {"buildDiscontinuousGalerkinLocal2GlobalMappings", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_13cpartitioning_15buildDiscontinuousGalerkinLocal2GlobalMappings, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
26578static PyObject *__pyx_pw_13cpartitioning_15buildDiscontinuousGalerkinLocal2GlobalMappings(PyObject *__pyx_self,
26579#if CYTHON_VECTORCALL
26580PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
26581#else
26582PyObject *__pyx_args, PyObject *__pyx_kwds
26583#endif
26584) {
26585 struct PyMPICommObject *__pyx_v_comm = 0;
26586 int __pyx_v_nDOF_element;
26587 struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh = 0;
26588 CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh = 0;
26589 PyArrayObject *__pyx_v_elementOffsets_subdomain_owned = 0;
26590 PyArrayObject *__pyx_v_elementNumbering_subdomain2global = 0;
26591 PyArrayObject *__pyx_v_dg_dof_offsets_subdomain_owned = 0;
26592 PyArrayObject *__pyx_v_dg_subdomain_l2g = 0;
26593 PyArrayObject *__pyx_v_dgNumbering_subdomain2global = 0;
26594 #if !CYTHON_VECTORCALL
26595 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
26596 #endif
26597 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
26598 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
26599 int __pyx_lineno = 0;
26600 const char *__pyx_filename = NULL;
26601 int __pyx_clineno = 0;
26602 PyObject *__pyx_r = 0;
26603 __Pyx_RefNannyDeclarations
26604 __Pyx_RefNannySetupContext("buildDiscontinuousGalerkinLocal2GlobalMappings (wrapper)", 0);
26605 #if !CYTHON_VECTORCALL
26606 #if CYTHON_ASSUME_SAFE_SIZE
26607 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
26608 #else
26609 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
26610 #endif
26611 #endif
26612 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
26613 {
26614 PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,&__pyx_mstate_global->__pyx_n_u_nDOF_element,&__pyx_mstate_global->__pyx_n_u_cmesh,&__pyx_mstate_global->__pyx_n_u_subdomain_cmesh,&__pyx_mstate_global->__pyx_n_u_elementOffsets_subdomain_owned,&__pyx_mstate_global->__pyx_n_u_elementNumbering_subdomain2globa,&__pyx_mstate_global->__pyx_n_u_dg_dof_offsets_subdomain_owned,&__pyx_mstate_global->__pyx_n_u_dg_subdomain_l2g,&__pyx_mstate_global->__pyx_n_u_dgNumbering_subdomain2global,0};
26615 const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
26616 if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(0, 229, __pyx_L3_error)
26617 if (__pyx_kwds_len > 0) {
26618 switch (__pyx_nargs) {
26619 case 9:
26620 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
26621 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 229, __pyx_L3_error)
26622 CYTHON_FALLTHROUGH;
26623 case 8:
26624 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
26625 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 229, __pyx_L3_error)
26626 CYTHON_FALLTHROUGH;
26627 case 7:
26628 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
26629 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 229, __pyx_L3_error)
26630 CYTHON_FALLTHROUGH;
26631 case 6:
26632 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
26633 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 229, __pyx_L3_error)
26634 CYTHON_FALLTHROUGH;
26635 case 5:
26636 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
26637 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 229, __pyx_L3_error)
26638 CYTHON_FALLTHROUGH;
26639 case 4:
26640 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
26641 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 229, __pyx_L3_error)
26642 CYTHON_FALLTHROUGH;
26643 case 3:
26644 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
26645 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 229, __pyx_L3_error)
26646 CYTHON_FALLTHROUGH;
26647 case 2:
26648 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
26649 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 229, __pyx_L3_error)
26650 CYTHON_FALLTHROUGH;
26651 case 1:
26652 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
26653 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 229, __pyx_L3_error)
26654 CYTHON_FALLTHROUGH;
26655 case 0: break;
26656 default: goto __pyx_L5_argtuple_error;
26657 }
26658 const Py_ssize_t kwd_pos_args = __pyx_nargs;
26659 if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "buildDiscontinuousGalerkinLocal2GlobalMappings", 0) < (0)) __PYX_ERR(0, 229, __pyx_L3_error)
26660 for (Py_ssize_t i = __pyx_nargs; i < 9; i++) {
26661 if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, i); __PYX_ERR(0, 229, __pyx_L3_error) }
26662 }
26663 } else if (unlikely(__pyx_nargs != 9)) {
26664 goto __pyx_L5_argtuple_error;
26665 } else {
26666 values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
26667 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 229, __pyx_L3_error)
26668 values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
26669 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 229, __pyx_L3_error)
26670 values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
26671 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 229, __pyx_L3_error)
26672 values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
26673 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 229, __pyx_L3_error)
26674 values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
26675 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 229, __pyx_L3_error)
26676 values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
26677 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 229, __pyx_L3_error)
26678 values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
26679 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 229, __pyx_L3_error)
26680 values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
26681 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 229, __pyx_L3_error)
26682 values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
26683 if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 229, __pyx_L3_error)
26684 }
26685 __pyx_v_comm = ((struct PyMPICommObject *)values[0]);
26686 __pyx_v_nDOF_element = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_nDOF_element == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L3_error)
26687 __pyx_v_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[2]);
26688 __pyx_v_subdomain_cmesh = ((struct __pyx_obj_7proteus_10cmeshTools_CMesh *)values[3]);
26689 __pyx_v_elementOffsets_subdomain_owned = ((PyArrayObject *)values[4]);
26690 __pyx_v_elementNumbering_subdomain2global = ((PyArrayObject *)values[5]);
26691 __pyx_v_dg_dof_offsets_subdomain_owned = ((PyArrayObject *)values[6]);
26692 __pyx_v_dg_subdomain_l2g = ((PyArrayObject *)values[7]);
26693 __pyx_v_dgNumbering_subdomain2global = ((PyArrayObject *)values[8]);
26694 }
26695 goto __pyx_L6_skip;
26696 __pyx_L5_argtuple_error:;
26697 __Pyx_RaiseArgtupleInvalid("buildDiscontinuousGalerkinLocal2GlobalMappings", 1, 9, 9, __pyx_nargs); __PYX_ERR(0, 229, __pyx_L3_error)
26698 __pyx_L6_skip:;
26699 goto __pyx_L4_argument_unpacking_done;
26700 __pyx_L3_error:;
26701 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
26702 Py_XDECREF(values[__pyx_temp]);
26703 }
26704 __Pyx_AddTraceback("cpartitioning.buildDiscontinuousGalerkinLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
26705 __Pyx_RefNannyFinishContext();
26706 return NULL;
26707 __pyx_L4_argument_unpacking_done:;
26708 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_comm), __pyx_mstate_global->__pyx_ptype_6mpi4py_3MPI_Comm, 1, "comm", 0))) __PYX_ERR(0, 229, __pyx_L1_error)
26709 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmesh), __pyx_mstate_global->__pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "cmesh", 0))) __PYX_ERR(0, 231, __pyx_L1_error)
26710 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdomain_cmesh), __pyx_mstate_global->__pyx_ptype_7proteus_10cmeshTools_CMesh, 1, "subdomain_cmesh", 0))) __PYX_ERR(0, 232, __pyx_L1_error)
26711 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementOffsets_subdomain_owned), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementOffsets_subdomain_owned", 0))) __PYX_ERR(0, 233, __pyx_L1_error)
26712 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNumbering_subdomain2global), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "elementNumbering_subdomain2global", 0))) __PYX_ERR(0, 234, __pyx_L1_error)
26713 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dg_dof_offsets_subdomain_owned), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "dg_dof_offsets_subdomain_owned", 0))) __PYX_ERR(0, 235, __pyx_L1_error)
26714 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dg_subdomain_l2g), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "dg_subdomain_l2g", 0))) __PYX_ERR(0, 236, __pyx_L1_error)
26715 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dgNumbering_subdomain2global), __pyx_mstate_global->__pyx_ptype_5numpy_ndarray, 1, "dgNumbering_subdomain2global", 0))) __PYX_ERR(0, 237, __pyx_L1_error)
26716 __pyx_r = __pyx_pf_13cpartitioning_14buildDiscontinuousGalerkinLocal2GlobalMappings(__pyx_self, __pyx_v_comm, __pyx_v_nDOF_element, __pyx_v_cmesh, __pyx_v_subdomain_cmesh, __pyx_v_elementOffsets_subdomain_owned, __pyx_v_elementNumbering_subdomain2global, __pyx_v_dg_dof_offsets_subdomain_owned, __pyx_v_dg_subdomain_l2g, __pyx_v_dgNumbering_subdomain2global);
26717
26718 /* function exit code */
26719 goto __pyx_L0;
26720 __pyx_L1_error:;
26721 __pyx_r = NULL;
26722 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
26723 Py_XDECREF(values[__pyx_temp]);
26724 }
26725 goto __pyx_L7_cleaned_up;
26726 __pyx_L0:;
26727 for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
26728 Py_XDECREF(values[__pyx_temp]);
26729 }
26730 __pyx_L7_cleaned_up:;
26731
26732 __Pyx_RefNannyFinishContext();
26733 return __pyx_r;
26734}
26735
26736static PyObject *__pyx_pf_13cpartitioning_14buildDiscontinuousGalerkinLocal2GlobalMappings(CYTHON_UNUSED PyObject *__pyx_self, struct PyMPICommObject *__pyx_v_comm, int __pyx_v_nDOF_element, struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_cmesh, CYTHON_UNUSED struct __pyx_obj_7proteus_10cmeshTools_CMesh *__pyx_v_subdomain_cmesh, PyArrayObject *__pyx_v_elementOffsets_subdomain_owned, PyArrayObject *__pyx_v_elementNumbering_subdomain2global, PyArrayObject *__pyx_v_dg_dof_offsets_subdomain_owned, PyArrayObject *__pyx_v_dg_subdomain_l2g, PyArrayObject *__pyx_v_dgNumbering_subdomain2global) {
26737 int __pyx_v_nDOF_all_processes;
26738 int __pyx_v_nDOF_subdomain;
26739 int __pyx_v_max_dof_neighbors;
26740 PyObject *__pyx_r = NULL;
26741 __Pyx_RefNannyDeclarations
26742 PyObject *__pyx_t_1 = NULL;
26743 PyObject *__pyx_t_2 = NULL;
26744 PyObject *__pyx_t_3 = NULL;
26745 PyObject *__pyx_t_4 = NULL;
26746 int __pyx_lineno = 0;
26747 const char *__pyx_filename = NULL;
26748 int __pyx_clineno = 0;
26749 __Pyx_RefNannySetupContext("buildDiscontinuousGalerkinLocal2GlobalMappings", 0);
26750
26751 /* "cpartitioning.pyx":238
26752 * np.ndarray dg_subdomain_l2g,
26753 * np.ndarray dgNumbering_subdomain2global):
26754 * cdef int nDOF_all_processes=0 # <<<<<<<<<<<<<<
26755 * cdef int nDOF_subdomain=0
26756 * cdef int max_dof_neighbors=0
26757*/
26758 __pyx_v_nDOF_all_processes = 0;
26759
26760 /* "cpartitioning.pyx":239
26761 * np.ndarray dgNumbering_subdomain2global):
26762 * cdef int nDOF_all_processes=0
26763 * cdef int nDOF_subdomain=0 # <<<<<<<<<<<<<<
26764 * cdef int max_dof_neighbors=0
26765 * buildDiscontinuousGalerkinSubdomain2GlobalMappings(comm.ob_mpi,
26766*/
26767 __pyx_v_nDOF_subdomain = 0;
26768
26769 /* "cpartitioning.pyx":240
26770 * cdef int nDOF_all_processes=0
26771 * cdef int nDOF_subdomain=0
26772 * cdef int max_dof_neighbors=0 # <<<<<<<<<<<<<<
26773 * buildDiscontinuousGalerkinSubdomain2GlobalMappings(comm.ob_mpi,
26774 * cmesh.mesh,
26775*/
26776 __pyx_v_max_dof_neighbors = 0;
26777
26778 /* "cpartitioning.pyx":241
26779 * cdef int nDOF_subdomain=0
26780 * cdef int max_dof_neighbors=0
26781 * buildDiscontinuousGalerkinSubdomain2GlobalMappings(comm.ob_mpi, # <<<<<<<<<<<<<<
26782 * cmesh.mesh,
26783 * <int*>(elementOffsets_subdomain_owned.data),
26784*/
26785 (void)(proteus::buildDiscontinuousGalerkinSubdomain2GlobalMappings(__pyx_v_comm->ob_mpi, __pyx_v_cmesh->mesh, ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementOffsets_subdomain_owned)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_elementNumbering_subdomain2global)), __pyx_v_nDOF_element, __pyx_v_nDOF_all_processes, __pyx_v_nDOF_subdomain, __pyx_v_max_dof_neighbors, ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_dg_dof_offsets_subdomain_owned)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_dg_subdomain_l2g)), ((int *)__pyx_f_5numpy_7ndarray_4data___get__(__pyx_v_dgNumbering_subdomain2global))));
26786
26787 /* "cpartitioning.pyx":252
26788 * <int*>(dg_subdomain_l2g.data),
26789 * <int*>(dgNumbering_subdomain2global.data))
26790 * return (nDOF_all_processes, # <<<<<<<<<<<<<<
26791 * nDOF_subdomain,
26792 * max_dof_neighbors)
26793*/
26794 __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_nDOF_all_processes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error)
26795 __Pyx_GOTREF(__pyx_t_1);
26796
26797 /* "cpartitioning.pyx":253
26798 * <int*>(dgNumbering_subdomain2global.data))
26799 * return (nDOF_all_processes,
26800 * nDOF_subdomain, # <<<<<<<<<<<<<<
26801 * max_dof_neighbors)
26802*/
26803 __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_nDOF_subdomain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error)
26804 __Pyx_GOTREF(__pyx_t_2);
26805
26806 /* "cpartitioning.pyx":254
26807 * return (nDOF_all_processes,
26808 * nDOF_subdomain,
26809 * max_dof_neighbors) # <<<<<<<<<<<<<<
26810*/
26811 __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_max_dof_neighbors); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 254, __pyx_L1_error)
26812 __Pyx_GOTREF(__pyx_t_3);
26813
26814 /* "cpartitioning.pyx":252
26815 * <int*>(dg_subdomain_l2g.data),
26816 * <int*>(dgNumbering_subdomain2global.data))
26817 * return (nDOF_all_processes, # <<<<<<<<<<<<<<
26818 * nDOF_subdomain,
26819 * max_dof_neighbors)
26820*/
26821 __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
26822 __Pyx_GOTREF(__pyx_t_4);
26823 __Pyx_GIVEREF(__pyx_t_1);
26824 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 252, __pyx_L1_error);
26825 __Pyx_GIVEREF(__pyx_t_2);
26826 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 252, __pyx_L1_error);
26827 __Pyx_GIVEREF(__pyx_t_3);
26828 if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 252, __pyx_L1_error);
26829 __pyx_t_1 = 0;
26830 __pyx_t_2 = 0;
26831 __pyx_t_3 = 0;
26832 {
26833 PyObject *__pyx_temp;
26834 {
26835 __pyx_temp = __pyx_r;
26836 __pyx_r = __pyx_t_4;
26837 }
26838 __Pyx_XDECREF(__pyx_temp);
26839 }
26840 __pyx_t_4 = 0;
26841 goto __pyx_L0;
26842
26843 /* "cpartitioning.pyx":229
26844 * max_dof_neighbors)
26845 *
26846 * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
26847 * int nDOF_element,
26848 * cmeshTools.CMesh cmesh,
26849*/
26850
26851 /* function exit code */
26852 __pyx_L1_error:;
26853 __Pyx_XDECREF(__pyx_t_1);
26854 __Pyx_XDECREF(__pyx_t_2);
26855 __Pyx_XDECREF(__pyx_t_3);
26856 __Pyx_XDECREF(__pyx_t_4);
26857 __Pyx_AddTraceback("cpartitioning.buildDiscontinuousGalerkinLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
26858 __pyx_r = NULL;
26859 __pyx_L0:;
26860
26861
26862
26863 __Pyx_XGIVEREF(__pyx_r);
26864 __Pyx_RefNannyFinishContext();
26865 return __pyx_r;
26866}
26867/* #### Code section: module_exttypes ### */
26868static struct __pyx_vtabstruct_array __pyx_vtable_array;
26869
26870static PyObject *__pyx_tp_new__initialisation_array(PyObject *o,
26871#if CYTHON_VECTORCALL_TPNEW
26872 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
26873#else
26874 PyObject *a, PyObject *k
26875#endif
26876) {
26877 struct __pyx_array_obj *p = ((struct __pyx_array_obj *)o);
26878 p->__pyx_vtab = __pyx_vtabptr_array;
26879 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
26880 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
26881 {
26882 int cinit_result = __pyx_array___cinit__(o,
26883#if CYTHON_VECTORCALL_TPNEW
26884 args, nargs, kwnames
26885#else
26886 a, k
26887#endif
26888);
26889 if (unlikely(cinit_result)) goto bad;
26890 }
26891 return o;
26892 bad:
26893 Py_DECREF(o); o = 0;
26894 return NULL;
26895}
26896
26897static PyObject *__pyx_tp_new_vectorcall_array(PyTypeObject *t,
26898#if CYTHON_VECTORCALL_TPNEW
26899 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
26900#else
26901 PyObject *a, PyObject *k
26902#endif
26903) {
26904 PyObject *o;
26905 o = __Pyx_AllocateExtensionType(t, 0);
26906 if (unlikely(!o)) return 0;
26907 return __pyx_tp_new__initialisation_array(o,
26908#if CYTHON_VECTORCALL_TPNEW
26909 args, nargs, kwnames
26910#else
26911 a, k
26912#endif
26913);
26914}
26915
26916#if CYTHON_VECTORCALL_TPNEW
26917static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
26918 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_array, t, a, k);
26919}
26920#endif
26921
26922#if CYTHON_VECTORCALL_TPNEW
26923static PyObject *__pyx_tp_vectorcall_array(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
26924 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_array_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
26925 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
26926 }
26927 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
26928 PyObject *o = __pyx_tp_new_vectorcall_array((PyTypeObject*)t, args, nargs, kwnames);
26929 return o;
26930}
26931#endif
26932
26933static void __pyx_tp_dealloc_array(PyObject *o) {
26934 struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
26935 #if CYTHON_USE_TP_FINALIZE
26936 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
26937 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_array) {
26938 if (PyObject_CallFinalizerFromDealloc(o)) return;
26939 }
26940 }
26941 #endif
26942 {
26943 PyObject *etype, *eval, *etb;
26944 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
26945 __Pyx_DeallocKeepAliveBegin(o);
26946 __pyx_array___dealloc__(o);
26947 __Pyx_DeallocKeepAliveEnd(o);
26948 __Pyx_PyErr_RestoreException(etype, eval, etb);
26949 }
26950 Py_CLEAR(p->mode);
26951 Py_CLEAR(p->_format);
26952 PyTypeObject *tp = Py_TYPE(o);
26953 #if CYTHON_USE_TYPE_SLOTS
26954 (*tp->tp_free)(o);
26955 #else
26956 {
26957 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
26958 if (tp_free) tp_free(o);
26959 }
26960 #endif
26961 #if CYTHON_USE_TYPE_SPECS
26962 Py_DECREF(tp);
26963 #endif
26964}
26965
26966static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
26967 PyObject *r;
26968 PyObject *x = PyLong_FromSsize_t(i); if (unlikely(!x)) return NULL;
26969 #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
26970 binaryfunc f = Py_TYPE(o)->tp_as_mapping->mp_subscript;
26971 #else
26972 binaryfunc f = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript));
26973 #endif
26974 r = f(o, x);
26975 Py_DECREF(x);
26976 return r;
26977}
26978
26979static PyObject *__pyx_mp_subscript_array(PyObject *o, PyObject *i) {
26980 return __pyx_array___getitem__(o, i);
26981}
26982
26983static int __pyx_sq_ass_item_array(PyObject *o, Py_ssize_t i, PyObject *v) {
26984 if (likely(v)) {
26985 PyObject *x = PyLong_FromSsize_t(i); if (unlikely(!x)) return -1;
26986 int r = __pyx_array___setitem__(o, x, v);
26987 Py_DECREF(x);
26988 return r;
26989 } else {
26990 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError, "Subscript %.10s not supported by " __Pyx_FMT_TYPENAME, "deletion", o);
26991 return -1;
26992 }
26993}
26994
26995static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
26996 if (likely(v)) {
26997 return __pyx_array___setitem__(o, i, v);
26998 } else {
26999 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError, "Subscript %.10s not supported by " __Pyx_FMT_TYPENAME, "deletion", o);
27000 return -1;
27001 }
27002}
27003
27004static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
27005 PyObject *v = PyObject_GenericGetAttr(o, n);
27006 if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
27007 PyErr_Clear();
27008 v = __pyx_array___getattr__(o, n);
27009 }
27010 return v;
27011}
27012
27013static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
27014 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
27015}
27016
27017static PyMethodDef __pyx_methods_array[] = {
27018 {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
27019 {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27020 {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27021 {0, 0, 0, 0}
27022};
27023
27024static struct PyGetSetDef __pyx_getsets_array[] = {
27025 {"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
27026 {0, 0, 0, 0, 0}
27027};
27028#if CYTHON_USE_TYPE_SPECS
27029#if !CYTHON_COMPILING_IN_LIMITED_API
27030
27031static PyBufferProcs __pyx_tp_as_buffer_array = {
27032 __pyx_array_getbuffer, /*bf_getbuffer*/
27033 0, /*bf_releasebuffer*/
27034};
27035#endif
27036static PyType_Slot __pyx_type___pyx_array_slots[] = {
27037 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_array},
27038 {Py_sq_length, (void *)__pyx_array___len__},
27039 {Py_sq_item, (void *)__pyx_sq_item_array},
27040 {Py_sq_ass_item, (void *)__pyx_sq_ass_item_array},
27041 {Py_mp_length, (void *)__pyx_array___len__},
27042 {Py_mp_subscript, (void *)__pyx_mp_subscript_array},
27043 {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_array},
27044 {Py_tp_getattro, (void *)__pyx_tp_getattro_array},
27045 #if defined(Py_bf_getbuffer)
27046 {Py_bf_getbuffer, (void *)__pyx_array_getbuffer},
27047 #endif
27048 {Py_tp_methods, (void *)__pyx_methods_array},
27049 {Py_tp_getset, (void *)__pyx_getsets_array},
27050 {Py_tp_new, (void *)__pyx_tp_new_array},
27051 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
27052 #if CYTHON_VECTORCALL_TPNEW
27053 {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_array},
27054 #endif
27055 #endif
27056 {0, 0},
27057};
27058static PyType_Spec __pyx_type___pyx_array_spec = {
27059 "cpartitioning.array",
27060 sizeof(struct __pyx_array_obj),
27061 0,
27062 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE,
27063 __pyx_type___pyx_array_slots,
27064};
27065#else
27066
27067static PySequenceMethods __pyx_tp_as_sequence_array = {
27068 __pyx_array___len__, /*sq_length*/
27069 0, /*sq_concat*/
27070 0, /*sq_repeat*/
27071 __pyx_sq_item_array, /*sq_item*/
27072 0, /*sq_slice*/
27073 __pyx_sq_ass_item_array, /*sq_ass_item*/
27074 0, /*sq_ass_slice*/
27075 0, /*sq_contains*/
27076 0, /*sq_inplace_concat*/
27077 0, /*sq_inplace_repeat*/
27078};
27079
27080static PyMappingMethods __pyx_tp_as_mapping_array = {
27081 __pyx_array___len__, /*mp_length*/
27082 __pyx_mp_subscript_array, /*mp_subscript*/
27083 __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
27084};
27085
27086static PyBufferProcs __pyx_tp_as_buffer_array = {
27087 __pyx_array_getbuffer, /*bf_getbuffer*/
27088 0, /*bf_releasebuffer*/
27089};
27090
27091static PyTypeObject __pyx_type___pyx_array = {
27092 PyVarObject_HEAD_INIT(0, 0)
27093 "cpartitioning.""array", /*tp_name*/
27094 sizeof(struct __pyx_array_obj), /*tp_basicsize*/
27095 0, /*tp_itemsize*/
27096 __pyx_tp_dealloc_array, /*tp_dealloc*/
27097 0, /*tp_vectorcall_offset*/
27098 0, /*tp_getattr*/
27099 0, /*tp_setattr*/
27100 0, /*tp_as_async*/
27101 0, /*tp_repr*/
27102 0, /*tp_as_number*/
27103 &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
27104 &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
27105 0, /*tp_hash*/
27106 0, /*tp_call*/
27107 0, /*tp_str*/
27108 __pyx_tp_getattro_array, /*tp_getattro*/
27109 0, /*tp_setattro*/
27110 &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
27111 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
27112 0, /*tp_doc*/
27113 0, /*tp_traverse*/
27114 0, /*tp_clear*/
27115 0, /*tp_richcompare*/
27116 0, /*tp_weaklistoffset*/
27117 0, /*tp_iter*/
27118 0, /*tp_iternext*/
27119 __pyx_methods_array, /*tp_methods*/
27120 0, /*tp_members*/
27121 __pyx_getsets_array, /*tp_getset*/
27122 0, /*tp_base*/
27123 0, /*tp_dict*/
27124 0, /*tp_descr_get*/
27125 0, /*tp_descr_set*/
27126 #if !CYTHON_USE_TYPE_SPECS
27127 0, /*tp_dictoffset*/
27128 #endif
27129 0, /*tp_init*/
27130 0, /*tp_alloc*/
27131 __pyx_tp_new_array, /*tp_new*/
27132 0, /*tp_free*/
27133 0, /*tp_is_gc*/
27134 0, /*tp_bases*/
27135 0, /*tp_mro*/
27136 0, /*tp_cache*/
27137 0, /*tp_subclasses*/
27138 0, /*tp_weaklist*/
27139 0, /*tp_del*/
27140 0, /*tp_version_tag*/
27141 #if CYTHON_USE_TP_FINALIZE
27142 0, /*tp_finalize*/
27143 #else
27144 NULL, /*tp_finalize*/
27145 #endif
27146 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
27147 #if CYTHON_VECTORCALL_TPNEW
27148 __pyx_tp_vectorcall_array, /*tp_vectorcall*/
27149 #else
27150 NULL, /*tp_vectorcall*/
27151 #endif
27152 #endif
27153 #if __PYX_NEED_TP_PRINT_SLOT == 1
27154 0, /*tp_print*/
27155 #endif
27156 #if PY_VERSION_HEX >= 0x030C0000
27157 0, /*tp_watched*/
27158 #endif
27159 #if PY_VERSION_HEX >= 0x030d00A4
27160 0, /*tp_versions_used*/
27161 #endif
27162 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
27163 0, /*tp_pypy_flags*/
27164 #endif
27165};
27166#endif
27167
27168static PyObject *__pyx_tp_new__initialisation_Enum(PyObject *o,
27169#if CYTHON_VECTORCALL_TPNEW
27170 CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
27171#else
27172 CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
27173#endif
27174) {
27175 struct __pyx_MemviewEnum_obj *p = ((struct __pyx_MemviewEnum_obj *)o);
27176 p->name = Py_None; Py_INCREF(Py_None);
27177 return o;
27178}
27179
27180static PyObject *__pyx_tp_new_vectorcall_Enum(PyTypeObject *t,
27181#if CYTHON_VECTORCALL_TPNEW
27182 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
27183#else
27184 PyObject *a, PyObject *k
27185#endif
27186) {
27187 PyObject *o;
27188 o = __Pyx_AllocateExtensionType(t, 0);
27189 if (unlikely(!o)) return 0;
27190 return __pyx_tp_new__initialisation_Enum(o,
27191#if CYTHON_VECTORCALL_TPNEW
27192 args, nargs, kwnames
27193#else
27194 a, k
27195#endif
27196);
27197}
27198
27199#if CYTHON_VECTORCALL_TPNEW
27200static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k) {
27201 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_Enum, t, a, k);
27202}
27203#endif
27204
27205#if CYTHON_VECTORCALL_TPNEW
27206static PyObject *__pyx_tp_vectorcall_Enum(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
27207 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_MemviewEnum_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
27208 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
27209 }
27210 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
27211 PyObject *o = __pyx_tp_new_vectorcall_Enum((PyTypeObject*)t, args, nargs, kwnames);
27212 if (likely(o)) {
27213 assert(Py_TYPE(o) == (PyTypeObject*)t);
27214 if (unlikely(__pyx_MemviewEnum___init__(o, args, nargs, kwnames) < 0)) {
27215 Py_CLEAR(o);
27216 }
27217 }
27218 return o;
27219}
27220#endif
27221
27222#if CYTHON_VECTORCALL_TPNEW
27223static int __pyx_tp_init_Enum(PyObject *o, PyObject *args, PyObject *kwds) {
27224 return __Pyx_CallTpinitAsVectorcall(__pyx_MemviewEnum___init__, o, args, kwds);
27225}
27226#endif
27227
27228static void __pyx_tp_dealloc_Enum(PyObject *o) {
27229 struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
27230 #if CYTHON_USE_TP_FINALIZE
27231 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
27232 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_Enum) {
27233 if (PyObject_CallFinalizerFromDealloc(o)) return;
27234 }
27235 }
27236 #endif
27237 PyObject_GC_UnTrack(o);
27238 Py_CLEAR(p->name);
27239 PyTypeObject *tp = Py_TYPE(o);
27240 #if CYTHON_USE_TYPE_SLOTS
27241 (*tp->tp_free)(o);
27242 #else
27243 {
27244 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
27245 if (tp_free) tp_free(o);
27246 }
27247 #endif
27248 #if CYTHON_USE_TYPE_SPECS
27249 Py_DECREF(tp);
27250 #endif
27251}
27252
27253static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
27254 int e;
27255 struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
27256 {
27257 e = __Pyx_call_type_traverse(o, 1, v, a);
27258 if (e) return e;
27259 }
27260 if (p->name) {
27261 e = (*v)(p->name, a); if (e) return e;
27262 }
27263 return 0;
27264}
27265
27266static int __pyx_tp_clear_Enum(PyObject *o) {
27267 PyObject* tmp;
27268 struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
27269 tmp = ((PyObject*)p->name);
27270 p->name = Py_None; Py_INCREF(Py_None);
27271 Py_XDECREF(tmp);
27272 return 0;
27273}
27274
27275static PyMethodDef __pyx_methods_Enum[] = {
27276 {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27277 {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27278 {0, 0, 0, 0}
27279};
27280#if CYTHON_USE_TYPE_SPECS
27281static PyType_Slot __pyx_type___pyx_MemviewEnum_slots[] = {
27282 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_Enum},
27283 {Py_tp_repr, (void *)__pyx_MemviewEnum___repr__},
27284 {Py_tp_traverse, (void *)__pyx_tp_traverse_Enum},
27285 {Py_tp_clear, (void *)__pyx_tp_clear_Enum},
27286 {Py_tp_methods, (void *)__pyx_methods_Enum},
27287 {Py_tp_init, (void *)__pyx_tp_init_Enum},
27288 {Py_tp_new, (void *)__pyx_tp_new_Enum},
27289 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
27290 #if CYTHON_VECTORCALL_TPNEW
27291 {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_Enum},
27292 #endif
27293 #endif
27294 {0, 0},
27295};
27296static PyType_Spec __pyx_type___pyx_MemviewEnum_spec = {
27297 "cpartitioning.Enum",
27298 sizeof(struct __pyx_MemviewEnum_obj),
27299 0,
27300 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
27301 __pyx_type___pyx_MemviewEnum_slots,
27302};
27303#else
27304
27305static PyTypeObject __pyx_type___pyx_MemviewEnum = {
27306 PyVarObject_HEAD_INIT(0, 0)
27307 "cpartitioning.""Enum", /*tp_name*/
27308 sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
27309 0, /*tp_itemsize*/
27310 __pyx_tp_dealloc_Enum, /*tp_dealloc*/
27311 0, /*tp_vectorcall_offset*/
27312 0, /*tp_getattr*/
27313 0, /*tp_setattr*/
27314 0, /*tp_as_async*/
27315 __pyx_MemviewEnum___repr__, /*tp_repr*/
27316 0, /*tp_as_number*/
27317 0, /*tp_as_sequence*/
27318 0, /*tp_as_mapping*/
27319 0, /*tp_hash*/
27320 0, /*tp_call*/
27321 0, /*tp_str*/
27322 0, /*tp_getattro*/
27323 0, /*tp_setattro*/
27324 0, /*tp_as_buffer*/
27325 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
27326 0, /*tp_doc*/
27327 __pyx_tp_traverse_Enum, /*tp_traverse*/
27328 __pyx_tp_clear_Enum, /*tp_clear*/
27329 0, /*tp_richcompare*/
27330 0, /*tp_weaklistoffset*/
27331 0, /*tp_iter*/
27332 0, /*tp_iternext*/
27333 __pyx_methods_Enum, /*tp_methods*/
27334 0, /*tp_members*/
27335 0, /*tp_getset*/
27336 0, /*tp_base*/
27337 0, /*tp_dict*/
27338 0, /*tp_descr_get*/
27339 0, /*tp_descr_set*/
27340 #if !CYTHON_USE_TYPE_SPECS
27341 0, /*tp_dictoffset*/
27342 #endif
27343 __pyx_tp_init_Enum, /*tp_init*/
27344 0, /*tp_alloc*/
27345 __pyx_tp_new_Enum, /*tp_new*/
27346 0, /*tp_free*/
27347 0, /*tp_is_gc*/
27348 0, /*tp_bases*/
27349 0, /*tp_mro*/
27350 0, /*tp_cache*/
27351 0, /*tp_subclasses*/
27352 0, /*tp_weaklist*/
27353 0, /*tp_del*/
27354 0, /*tp_version_tag*/
27355 #if CYTHON_USE_TP_FINALIZE
27356 0, /*tp_finalize*/
27357 #else
27358 NULL, /*tp_finalize*/
27359 #endif
27360 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
27361 #if CYTHON_VECTORCALL_TPNEW
27362 __pyx_tp_vectorcall_Enum, /*tp_vectorcall*/
27363 #else
27364 NULL, /*tp_vectorcall*/
27365 #endif
27366 #endif
27367 #if __PYX_NEED_TP_PRINT_SLOT == 1
27368 0, /*tp_print*/
27369 #endif
27370 #if PY_VERSION_HEX >= 0x030C0000
27371 0, /*tp_watched*/
27372 #endif
27373 #if PY_VERSION_HEX >= 0x030d00A4
27374 0, /*tp_versions_used*/
27375 #endif
27376 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
27377 0, /*tp_pypy_flags*/
27378 #endif
27379};
27380#endif
27381static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
27382
27383static PyObject *__pyx_tp_new__initialisation_memoryview(PyObject *o,
27384#if CYTHON_VECTORCALL_TPNEW
27385 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
27386#else
27387 PyObject *a, PyObject *k
27388#endif
27389) {
27390 struct __pyx_memoryview_obj *p = ((struct __pyx_memoryview_obj *)o);
27391 p->__pyx_vtab = __pyx_vtabptr_memoryview;
27392 p->obj = Py_None; Py_INCREF(Py_None);
27393 p->_size = Py_None; Py_INCREF(Py_None);
27394 p->view.obj = NULL;
27395 {
27396 int cinit_result = __pyx_memoryview___cinit__(o,
27397#if CYTHON_VECTORCALL_TPNEW
27398 args, nargs, kwnames
27399#else
27400 a, k
27401#endif
27402);
27403 if (unlikely(cinit_result)) goto bad;
27404 }
27405 return o;
27406 bad:
27407 Py_DECREF(o); o = 0;
27408 return NULL;
27409}
27410
27411static PyObject *__pyx_tp_new_vectorcall_memoryview(PyTypeObject *t,
27412#if CYTHON_VECTORCALL_TPNEW
27413 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
27414#else
27415 PyObject *a, PyObject *k
27416#endif
27417) {
27418 PyObject *o;
27419 o = __Pyx_AllocateExtensionType(t, 0);
27420 if (unlikely(!o)) return 0;
27421 return __pyx_tp_new__initialisation_memoryview(o,
27422#if CYTHON_VECTORCALL_TPNEW
27423 args, nargs, kwnames
27424#else
27425 a, k
27426#endif
27427);
27428}
27429
27430#if CYTHON_VECTORCALL_TPNEW
27431static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
27432 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall_memoryview, t, a, k);
27433}
27434#endif
27435
27436#if CYTHON_VECTORCALL_TPNEW
27437static PyObject *__pyx_tp_vectorcall_memoryview(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
27438 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_memoryview_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
27439 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
27440 }
27441 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
27442 PyObject *o = __pyx_tp_new_vectorcall_memoryview((PyTypeObject*)t, args, nargs, kwnames);
27443 return o;
27444}
27445#endif
27446
27447static void __pyx_tp_dealloc_memoryview(PyObject *o) {
27448 struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
27449 #if CYTHON_USE_TP_FINALIZE
27450 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
27451 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_memoryview) {
27452 if (PyObject_CallFinalizerFromDealloc(o)) return;
27453 }
27454 }
27455 #endif
27456 PyObject_GC_UnTrack(o);
27457 {
27458 PyObject *etype, *eval, *etb;
27459 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
27460 __Pyx_DeallocKeepAliveBegin(o);
27461 __pyx_memoryview___dealloc__(o);
27462 __Pyx_DeallocKeepAliveEnd(o);
27463 __Pyx_PyErr_RestoreException(etype, eval, etb);
27464 }
27465 Py_CLEAR(p->obj);
27466 Py_CLEAR(p->_size);
27467 PyTypeObject *tp = Py_TYPE(o);
27468 #if CYTHON_USE_TYPE_SLOTS
27469 (*tp->tp_free)(o);
27470 #else
27471 {
27472 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
27473 if (tp_free) tp_free(o);
27474 }
27475 #endif
27476 #if CYTHON_USE_TYPE_SPECS
27477 Py_DECREF(tp);
27478 #endif
27479}
27480
27481static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
27482 int e;
27483 struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
27484 {
27485 e = __Pyx_call_type_traverse(o, 1, v, a);
27486 if (e) return e;
27487 }
27488 if (p->obj) {
27489 e = (*v)(p->obj, a); if (e) return e;
27490 }
27491 if (p->_size) {
27492 e = (*v)(p->_size, a); if (e) return e;
27493 }
27494 if (p->view.obj) {
27495 e = (*v)(p->view.obj, a); if (e) return e;
27496 }
27497 return 0;
27498}
27499
27500static int __pyx_tp_clear_memoryview(PyObject *o) {
27501 PyObject* tmp;
27502 struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
27503 tmp = ((PyObject*)p->obj);
27504 p->obj = Py_None; Py_INCREF(Py_None);
27505 Py_XDECREF(tmp);
27506 tmp = ((PyObject*)p->_size);
27507 p->_size = Py_None; Py_INCREF(Py_None);
27508 Py_XDECREF(tmp);
27509 Py_CLEAR(p->view.obj);
27510 return 0;
27511}
27512
27513static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
27514 PyObject *r;
27515 PyObject *x = PyLong_FromSsize_t(i); if (unlikely(!x)) return NULL;
27516 #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
27517 binaryfunc f = Py_TYPE(o)->tp_as_mapping->mp_subscript;
27518 #else
27519 binaryfunc f = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript));
27520 #endif
27521 r = f(o, x);
27522 Py_DECREF(x);
27523 return r;
27524}
27525
27526static PyObject *__pyx_mp_subscript_memoryview(PyObject *o, PyObject *i) {
27527 return __pyx_memoryview___getitem__(o, i);
27528}
27529
27530static int __pyx_sq_ass_item_memoryview(PyObject *o, Py_ssize_t i, PyObject *v) {
27531 if (likely(v)) {
27532 PyObject *x = PyLong_FromSsize_t(i); if (unlikely(!x)) return -1;
27533 int r = __pyx_memoryview___setitem__(o, x, v);
27534 Py_DECREF(x);
27535 return r;
27536 } else {
27537 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError, "Subscript %.10s not supported by " __Pyx_FMT_TYPENAME, "deletion", o);
27538 return -1;
27539 }
27540}
27541
27542static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
27543 if (likely(v)) {
27544 return __pyx_memoryview___setitem__(o, i, v);
27545 } else {
27546 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError, "Subscript %.10s not supported by " __Pyx_FMT_TYPENAME, "deletion", o);
27547 return -1;
27548 }
27549}
27550
27551static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
27552 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
27553}
27554
27555static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
27556 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
27557}
27558
27559static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
27560 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
27561}
27562
27563static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
27564 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
27565}
27566
27567static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
27568 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
27569}
27570
27571static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
27572 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
27573}
27574
27575static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
27576 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
27577}
27578
27579static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
27580 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
27581}
27582
27583static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
27584 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
27585}
27586
27587static PyMethodDef __pyx_methods_memoryview[] = {
27588 {"is_c_contig", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_c_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27589 {"is_f_contig", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_f_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27590 {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27591 {"copy_fortran", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy_fortran, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27592 {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27593 {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27594 {0, 0, 0, 0}
27595};
27596
27597static struct PyGetSetDef __pyx_getsets_memoryview[] = {
27598 {"T", __pyx_getprop___pyx_memoryview_T, 0, 0, 0},
27599 {"base", __pyx_getprop___pyx_memoryview_base, 0, 0, 0},
27600 {"shape", __pyx_getprop___pyx_memoryview_shape, 0, 0, 0},
27601 {"strides", __pyx_getprop___pyx_memoryview_strides, 0, 0, 0},
27602 {"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, 0, 0},
27603 {"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, 0, 0},
27604 {"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, 0, 0},
27605 {"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, 0, 0},
27606 {"size", __pyx_getprop___pyx_memoryview_size, 0, 0, 0},
27607 {0, 0, 0, 0, 0}
27608};
27609#if CYTHON_USE_TYPE_SPECS
27610#if !CYTHON_COMPILING_IN_LIMITED_API
27611
27612static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
27613 __pyx_memoryview_getbuffer, /*bf_getbuffer*/
27614 0, /*bf_releasebuffer*/
27615};
27616#endif
27617static PyType_Slot __pyx_type___pyx_memoryview_slots[] = {
27618 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_memoryview},
27619 {Py_tp_repr, (void *)__pyx_memoryview___repr__},
27620 {Py_sq_length, (void *)__pyx_memoryview___len__},
27621 {Py_sq_item, (void *)__pyx_sq_item_memoryview},
27622 {Py_sq_ass_item, (void *)__pyx_sq_ass_item_memoryview},
27623 {Py_mp_length, (void *)__pyx_memoryview___len__},
27624 {Py_mp_subscript, (void *)__pyx_mp_subscript_memoryview},
27625 {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_memoryview},
27626 {Py_tp_str, (void *)__pyx_memoryview___str__},
27627 #if defined(Py_bf_getbuffer)
27628 {Py_bf_getbuffer, (void *)__pyx_memoryview_getbuffer},
27629 #endif
27630 {Py_tp_traverse, (void *)__pyx_tp_traverse_memoryview},
27631 {Py_tp_clear, (void *)__pyx_tp_clear_memoryview},
27632 {Py_tp_methods, (void *)__pyx_methods_memoryview},
27633 {Py_tp_getset, (void *)__pyx_getsets_memoryview},
27634 {Py_tp_new, (void *)__pyx_tp_new_memoryview},
27635 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
27636 #if CYTHON_VECTORCALL_TPNEW
27637 {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall_memoryview},
27638 #endif
27639 #endif
27640 {0, 0},
27641};
27642static PyType_Spec __pyx_type___pyx_memoryview_spec = {
27643 "cpartitioning.memoryview",
27644 sizeof(struct __pyx_memoryview_obj),
27645 0,
27646 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
27647 __pyx_type___pyx_memoryview_slots,
27648};
27649#else
27650
27651static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
27652 __pyx_memoryview___len__, /*sq_length*/
27653 0, /*sq_concat*/
27654 0, /*sq_repeat*/
27655 __pyx_sq_item_memoryview, /*sq_item*/
27656 0, /*sq_slice*/
27657 __pyx_sq_ass_item_memoryview, /*sq_ass_item*/
27658 0, /*sq_ass_slice*/
27659 0, /*sq_contains*/
27660 0, /*sq_inplace_concat*/
27661 0, /*sq_inplace_repeat*/
27662};
27663
27664static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
27665 __pyx_memoryview___len__, /*mp_length*/
27666 __pyx_mp_subscript_memoryview, /*mp_subscript*/
27667 __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
27668};
27669
27670static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
27671 __pyx_memoryview_getbuffer, /*bf_getbuffer*/
27672 0, /*bf_releasebuffer*/
27673};
27674
27675static PyTypeObject __pyx_type___pyx_memoryview = {
27676 PyVarObject_HEAD_INIT(0, 0)
27677 "cpartitioning.""memoryview", /*tp_name*/
27678 sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
27679 0, /*tp_itemsize*/
27680 __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
27681 0, /*tp_vectorcall_offset*/
27682 0, /*tp_getattr*/
27683 0, /*tp_setattr*/
27684 0, /*tp_as_async*/
27685 __pyx_memoryview___repr__, /*tp_repr*/
27686 0, /*tp_as_number*/
27687 &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
27688 &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
27689 0, /*tp_hash*/
27690 0, /*tp_call*/
27691 __pyx_memoryview___str__, /*tp_str*/
27692 0, /*tp_getattro*/
27693 0, /*tp_setattro*/
27694 &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
27695 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
27696 0, /*tp_doc*/
27697 __pyx_tp_traverse_memoryview, /*tp_traverse*/
27698 __pyx_tp_clear_memoryview, /*tp_clear*/
27699 0, /*tp_richcompare*/
27700 0, /*tp_weaklistoffset*/
27701 0, /*tp_iter*/
27702 0, /*tp_iternext*/
27703 __pyx_methods_memoryview, /*tp_methods*/
27704 0, /*tp_members*/
27705 __pyx_getsets_memoryview, /*tp_getset*/
27706 0, /*tp_base*/
27707 0, /*tp_dict*/
27708 0, /*tp_descr_get*/
27709 0, /*tp_descr_set*/
27710 #if !CYTHON_USE_TYPE_SPECS
27711 0, /*tp_dictoffset*/
27712 #endif
27713 0, /*tp_init*/
27714 0, /*tp_alloc*/
27715 __pyx_tp_new_memoryview, /*tp_new*/
27716 0, /*tp_free*/
27717 0, /*tp_is_gc*/
27718 0, /*tp_bases*/
27719 0, /*tp_mro*/
27720 0, /*tp_cache*/
27721 0, /*tp_subclasses*/
27722 0, /*tp_weaklist*/
27723 0, /*tp_del*/
27724 0, /*tp_version_tag*/
27725 #if CYTHON_USE_TP_FINALIZE
27726 0, /*tp_finalize*/
27727 #else
27728 NULL, /*tp_finalize*/
27729 #endif
27730 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
27731 #if CYTHON_VECTORCALL_TPNEW
27732 __pyx_tp_vectorcall_memoryview, /*tp_vectorcall*/
27733 #else
27734 NULL, /*tp_vectorcall*/
27735 #endif
27736 #endif
27737 #if __PYX_NEED_TP_PRINT_SLOT == 1
27738 0, /*tp_print*/
27739 #endif
27740 #if PY_VERSION_HEX >= 0x030C0000
27741 0, /*tp_watched*/
27742 #endif
27743 #if PY_VERSION_HEX >= 0x030d00A4
27744 0, /*tp_versions_used*/
27745 #endif
27746 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
27747 0, /*tp_pypy_flags*/
27748 #endif
27749};
27750#endif
27751static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
27752
27753static PyObject *__pyx_tp_new__initialisation__memoryviewslice(PyObject *o,
27754#if CYTHON_VECTORCALL_TPNEW
27755 CYTHON_UNUSED PyObject *const *args, CYTHON_UNUSED Py_ssize_t nargs, CYTHON_UNUSED PyObject *kwnames
27756#else
27757 CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
27758#endif
27759) {
27760 struct __pyx_memoryviewslice_obj *p = ((struct __pyx_memoryviewslice_obj *)o);
27761 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
27762 __Pyx_default_placement_construct(&(p->from_slice));
27763 p->from_object = Py_None; Py_INCREF(Py_None);
27764 p->from_slice.memview = NULL;
27765 return o;
27766}
27767
27768static PyObject *__pyx_tp_new_vectorcall__memoryviewslice(PyTypeObject *t,
27769#if CYTHON_VECTORCALL_TPNEW
27770 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
27771#else
27772 PyObject *a, PyObject *k
27773#endif
27774) {
27775 PyObject *o;
27776 o = __pyx_tp_new_vectorcall_memoryview(t,
27777#if CYTHON_VECTORCALL_TPNEW
27778 args, nargs, kwnames
27779#else
27780 a, k
27781#endif
27782);
27783 if (unlikely(!o)) return 0;
27784 return __pyx_tp_new__initialisation__memoryviewslice(o,
27785#if CYTHON_VECTORCALL_TPNEW
27786 args, nargs, kwnames
27787#else
27788 a, k
27789#endif
27790);
27791}
27792
27793#if CYTHON_VECTORCALL_TPNEW
27794static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
27795 return __Pyx_CallTpnewAsVectorcall(__pyx_tp_new_vectorcall__memoryviewslice, t, a, k);
27796}
27797#endif
27798
27799#if CYTHON_VECTORCALL_TPNEW
27800static PyObject *__pyx_tp_vectorcall__memoryviewslice(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
27801 if (unlikely((PyTypeObject*)t != __pyx_mstate_global->__pyx_memoryviewslice_type || __Pyx_PyType_HasFeature((PyTypeObject*)t, Py_TPFLAGS_IS_ABSTRACT))) {
27802 return __Pyx_CallNewInitFromVectorcall((PyTypeObject*)t, args, nargsf, kwnames);
27803 }
27804 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
27805 PyObject *o = __pyx_tp_new_vectorcall__memoryviewslice((PyTypeObject*)t, args, nargs, kwnames);
27806 return o;
27807}
27808#endif
27809
27810static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
27811 struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
27812 #if CYTHON_USE_TP_FINALIZE
27813 if (unlikely(__Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
27814 if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc__memoryviewslice) {
27815 if (PyObject_CallFinalizerFromDealloc(o)) return;
27816 }
27817 }
27818 #endif
27819 PyObject_GC_UnTrack(o);
27820 {
27821 PyObject *etype, *eval, *etb;
27822 __Pyx_PyErr_FetchException(&etype, &eval, &etb);
27823 __Pyx_DeallocKeepAliveBegin(o);
27824 __pyx_memoryviewslice___dealloc__(o);
27825 __Pyx_DeallocKeepAliveEnd(o);
27826 __Pyx_PyErr_RestoreException(etype, eval, etb);
27827 }
27828 __Pyx_call_destructor(p->from_slice);
27829 Py_CLEAR(p->from_object);
27830 PyObject_GC_Track(o);
27831 __pyx_tp_dealloc_memoryview(o);
27832}
27833
27834static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
27835 int e;
27836 struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
27837 e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
27838 if (p->from_object) {
27839 e = (*v)(p->from_object, a); if (e) return e;
27840 }
27841 return 0;
27842}
27843
27844static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
27845 PyObject* tmp;
27846 struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
27847 __pyx_tp_clear_memoryview(o);
27848 tmp = ((PyObject*)p->from_object);
27849 p->from_object = Py_None; Py_INCREF(Py_None);
27850 Py_XDECREF(tmp);
27851 __PYX_XCLEAR_MEMVIEW(&p->from_slice, 1);
27852 return 0;
27853}
27854
27855static PyMethodDef __pyx_methods__memoryviewslice[] = {
27856 {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27857 {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
27858 {0, 0, 0, 0}
27859};
27860#if CYTHON_USE_TYPE_SPECS
27861static PyType_Slot __pyx_type___pyx_memoryviewslice_slots[] = {
27862 {Py_tp_dealloc, (void *)__pyx_tp_dealloc__memoryviewslice},
27863 {Py_tp_doc, (void *)PyDoc_STR("Internal class for passing memoryview slices to Python")},
27864 {Py_tp_traverse, (void *)__pyx_tp_traverse__memoryviewslice},
27865 {Py_tp_clear, (void *)__pyx_tp_clear__memoryviewslice},
27866 {Py_tp_methods, (void *)__pyx_methods__memoryviewslice},
27867 {Py_tp_new, (void *)__pyx_tp_new__memoryviewslice},
27868 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
27869 #if CYTHON_VECTORCALL_TPNEW
27870 {Py_tp_vectorcall, (void *)__pyx_tp_vectorcall__memoryviewslice},
27871 #endif
27872 #endif
27873 {0, 0},
27874};
27875static PyType_Spec __pyx_type___pyx_memoryviewslice_spec = {
27876 "cpartitioning._memoryviewslice",
27877 sizeof(struct __pyx_memoryviewslice_obj),
27878 0,
27879 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE,
27880 __pyx_type___pyx_memoryviewslice_slots,
27881};
27882#else
27883
27884static PyTypeObject __pyx_type___pyx_memoryviewslice = {
27885 PyVarObject_HEAD_INIT(0, 0)
27886 "cpartitioning.""_memoryviewslice", /*tp_name*/
27887 sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
27888 0, /*tp_itemsize*/
27889 __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
27890 0, /*tp_vectorcall_offset*/
27891 0, /*tp_getattr*/
27892 0, /*tp_setattr*/
27893 0, /*tp_as_async*/
27894 #if CYTHON_COMPILING_IN_PYPY || 0
27895 __pyx_memoryview___repr__, /*tp_repr*/
27896 #else
27897 0, /*tp_repr*/
27898 #endif
27899 0, /*tp_as_number*/
27900 0, /*tp_as_sequence*/
27901 0, /*tp_as_mapping*/
27902 0, /*tp_hash*/
27903 0, /*tp_call*/
27904 #if CYTHON_COMPILING_IN_PYPY || 0
27905 __pyx_memoryview___str__, /*tp_str*/
27906 #else
27907 0, /*tp_str*/
27908 #endif
27909 0, /*tp_getattro*/
27910 0, /*tp_setattro*/
27911 0, /*tp_as_buffer*/
27912 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
27913 PyDoc_STR("Internal class for passing memoryview slices to Python"), /*tp_doc*/
27914 __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
27915 __pyx_tp_clear__memoryviewslice, /*tp_clear*/
27916 0, /*tp_richcompare*/
27917 0, /*tp_weaklistoffset*/
27918 0, /*tp_iter*/
27919 0, /*tp_iternext*/
27920 __pyx_methods__memoryviewslice, /*tp_methods*/
27921 0, /*tp_members*/
27922 0, /*tp_getset*/
27923 0, /*tp_base*/
27924 0, /*tp_dict*/
27925 0, /*tp_descr_get*/
27926 0, /*tp_descr_set*/
27927 #if !CYTHON_USE_TYPE_SPECS
27928 0, /*tp_dictoffset*/
27929 #endif
27930 0, /*tp_init*/
27931 0, /*tp_alloc*/
27932 __pyx_tp_new__memoryviewslice, /*tp_new*/
27933 0, /*tp_free*/
27934 0, /*tp_is_gc*/
27935 0, /*tp_bases*/
27936 0, /*tp_mro*/
27937 0, /*tp_cache*/
27938 0, /*tp_subclasses*/
27939 0, /*tp_weaklist*/
27940 0, /*tp_del*/
27941 0, /*tp_version_tag*/
27942 #if CYTHON_USE_TP_FINALIZE
27943 0, /*tp_finalize*/
27944 #else
27945 NULL, /*tp_finalize*/
27946 #endif
27947 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) && (!CYTHON_COMPILING_IN_LIMITED_API || __PYX_LIMITED_VERSION_HEX >= 0x030E0000)
27948 #if CYTHON_VECTORCALL_TPNEW
27949 __pyx_tp_vectorcall__memoryviewslice, /*tp_vectorcall*/
27950 #else
27951 NULL, /*tp_vectorcall*/
27952 #endif
27953 #endif
27954 #if __PYX_NEED_TP_PRINT_SLOT == 1
27955 0, /*tp_print*/
27956 #endif
27957 #if PY_VERSION_HEX >= 0x030C0000
27958 0, /*tp_watched*/
27959 #endif
27960 #if PY_VERSION_HEX >= 0x030d00A4
27961 0, /*tp_versions_used*/
27962 #endif
27963 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
27964 0, /*tp_pypy_flags*/
27965 #endif
27966};
27967#endif
27968
27969static PyMethodDef __pyx_methods[] = {
27970 {0, 0, 0, 0}
27971};
27972/* #### Code section: initfunc_declarations ### */
27973static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/
27974static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
27975static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/
27976static CYTHON_SMALL_CODE int __Pyx_InitAfterSharedUtility(void); /*proto*/
27977static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
27978static CYTHON_SMALL_CODE int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
27979static CYTHON_SMALL_CODE int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
27980static CYTHON_SMALL_CODE int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
27981static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_array_obj(__pyx_mstatetype *__pyx_mstate); /*proto*/
27982static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_MemviewEnum_obj(__pyx_mstatetype *__pyx_mstate); /*proto*/
27983static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_memoryview_obj(__pyx_mstatetype *__pyx_mstate); /*proto*/
27984static CYTHON_SMALL_CODE int __Pyx_modinit_Exttype___pyx_memoryviewslice_obj(__pyx_mstatetype *__pyx_mstate); /*proto*/
27985static CYTHON_SMALL_CODE int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
27986static CYTHON_SMALL_CODE int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
27987static CYTHON_SMALL_CODE int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
27988static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/
27989/* #### Code section: init_module ### */
27990
27991static int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate) {
27992 __Pyx_RefNannyDeclarations
27993 CYTHON_UNUSED_VAR(__pyx_mstate);
27994 __Pyx_RefNannySetupContext("__Pyx_modinit_Global_init_code", 0);
27995 /*--- Global init code ---*/
27996 __pyx_collections_abc_Sequence = Py_None; Py_INCREF(Py_None);
27997 generic = Py_None; Py_INCREF(Py_None);
27998 strided = Py_None; Py_INCREF(Py_None);
27999 indirect = Py_None; Py_INCREF(Py_None);
28000 contiguous = Py_None; Py_INCREF(Py_None);
28001 indirect_contiguous = Py_None; Py_INCREF(Py_None);
28002 __Pyx_RefNannyFinishContext();
28003 return 0;
28004}
28005
28006static int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate) {
28007 __Pyx_RefNannyDeclarations
28008 CYTHON_UNUSED_VAR(__pyx_mstate);
28009 __Pyx_RefNannySetupContext("__Pyx_modinit_Variable_export_code", 0);
28010 /*--- Variable export code ---*/
28011 __Pyx_RefNannyFinishContext();
28012 return 0;
28013}
28014
28015static int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate) {
28016 __Pyx_RefNannyDeclarations
28017 CYTHON_UNUSED_VAR(__pyx_mstate);
28018 __Pyx_RefNannySetupContext("__Pyx_modinit_Function_export_code", 0);
28019 /*--- Function export code ---*/
28020 __Pyx_RefNannyFinishContext();
28021 return 0;
28022}
28023
28024static int __Pyx_modinit_Exttype___pyx_array_obj(__pyx_mstatetype *__pyx_mstate) {
28025 __Pyx_RefNannyDeclarations
28026 int __pyx_lineno = 0;
28027 const char *__pyx_filename = NULL;
28028 int __pyx_clineno = 0;
28029 CYTHON_UNUSED_VAR(__pyx_mstate);
28030 __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_array_obj", 0);
28031 /*--- Exttype __pyx_array_obj ---*/
28032 __pyx_vtabptr_array = &__pyx_vtable_array;
28033 __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
28034 #if CYTHON_USE_TYPE_SPECS
28035 __pyx_mstate->__pyx_array_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_array_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_array_type)) __PYX_ERR(1, 128, __pyx_L1_error)
28036 #if !CYTHON_COMPILING_IN_LIMITED_API
28037 __pyx_mstate->__pyx_array_type->tp_as_buffer = &__pyx_tp_as_buffer_array;
28038 if (!__pyx_mstate->__pyx_array_type->tp_as_buffer->bf_releasebuffer && __pyx_mstate->__pyx_array_type->tp_base->tp_as_buffer && __pyx_mstate->__pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer) {
28039 __pyx_mstate->__pyx_array_type->tp_as_buffer->bf_releasebuffer = __pyx_mstate->__pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer;
28040 }
28041 #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
28042 /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
28043 #elif defined(_MSC_VER)
28044 #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
28045 #else
28046 #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
28047 #endif
28048 #else
28049 __pyx_mstate->__pyx_array_type = &__pyx_type___pyx_array;
28050 #endif
28051 if (__Pyx_ApplySequenceOrMappingFlag(__pyx_mstate->__pyx_array_type, 1) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
28052 #if !CYTHON_COMPILING_IN_LIMITED_API
28053 #endif
28054 #if !CYTHON_USE_TYPE_SPECS
28055 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_array_type) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
28056 #endif
28057 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28058 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_array_type);
28059 #endif
28060 if (__Pyx_SetVtable(__pyx_mstate->__pyx_array_type, __pyx_vtabptr_array) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
28061 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_array_type) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
28062 __Pyx_RefNannyFinishContext();
28063 return 0;
28064 __pyx_L1_error:;
28065 __Pyx_RefNannyFinishContext();
28066 return -1;
28067}
28068
28069static int __Pyx_modinit_Exttype___pyx_MemviewEnum_obj(__pyx_mstatetype *__pyx_mstate) {
28070 __Pyx_RefNannyDeclarations
28071 int __pyx_lineno = 0;
28072 const char *__pyx_filename = NULL;
28073 int __pyx_clineno = 0;
28074 CYTHON_UNUSED_VAR(__pyx_mstate);
28075 __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_MemviewEnum_obj", 0);
28076 /*--- Exttype __pyx_MemviewEnum_obj ---*/
28077 #if CYTHON_USE_TYPE_SPECS
28078 __pyx_mstate->__pyx_MemviewEnum_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_MemviewEnum_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_MemviewEnum_type)) __PYX_ERR(1, 318, __pyx_L1_error)
28079 #else
28080 __pyx_mstate->__pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
28081 #endif
28082 #if !CYTHON_COMPILING_IN_LIMITED_API
28083 #endif
28084 #if !CYTHON_USE_TYPE_SPECS
28085 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_MemviewEnum_type) < (0)) __PYX_ERR(1, 318, __pyx_L1_error)
28086 #endif
28087 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28088 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_MemviewEnum_type);
28089 #endif
28090 #if !CYTHON_COMPILING_IN_LIMITED_API
28091 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_MemviewEnum_type->tp_dictoffset && __pyx_mstate->__pyx_MemviewEnum_type->tp_getattro == PyObject_GenericGetAttr)) {
28092 __pyx_mstate->__pyx_MemviewEnum_type->tp_getattro = PyObject_GenericGetAttr;
28093 }
28094 #endif
28095 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_MemviewEnum_type) < (0)) __PYX_ERR(1, 318, __pyx_L1_error)
28096 __Pyx_RefNannyFinishContext();
28097 return 0;
28098 __pyx_L1_error:;
28099 __Pyx_RefNannyFinishContext();
28100 return -1;
28101}
28102
28103static int __Pyx_modinit_Exttype___pyx_memoryview_obj(__pyx_mstatetype *__pyx_mstate) {
28104 __Pyx_RefNannyDeclarations
28105 int __pyx_lineno = 0;
28106 const char *__pyx_filename = NULL;
28107 int __pyx_clineno = 0;
28108 CYTHON_UNUSED_VAR(__pyx_mstate);
28109 __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_memoryview_obj", 0);
28110 /*--- Exttype __pyx_memoryview_obj ---*/
28111 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
28112 __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
28113 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
28114 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
28115 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
28116 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
28117 __pyx_vtable_memoryview.setitem_indexed1 = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed1;
28118 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
28119 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
28120 __pyx_vtable_memoryview._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryview__get_base;
28121 #if CYTHON_USE_TYPE_SPECS
28122 __pyx_mstate->__pyx_memoryview_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryview_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_memoryview_type)) __PYX_ERR(1, 353, __pyx_L1_error)
28123 #if !CYTHON_COMPILING_IN_LIMITED_API
28124 __pyx_mstate->__pyx_memoryview_type->tp_as_buffer = &__pyx_tp_as_buffer_memoryview;
28125 if (!__pyx_mstate->__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer && __pyx_mstate->__pyx_memoryview_type->tp_base->tp_as_buffer && __pyx_mstate->__pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer) {
28126 __pyx_mstate->__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer = __pyx_mstate->__pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer;
28127 }
28128 #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
28129 /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
28130 #elif defined(_MSC_VER)
28131 #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
28132 #else
28133 #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
28134 #endif
28135 #else
28136 __pyx_mstate->__pyx_memoryview_type = &__pyx_type___pyx_memoryview;
28137 #endif
28138 #if !CYTHON_COMPILING_IN_LIMITED_API
28139 #endif
28140 #if !CYTHON_USE_TYPE_SPECS
28141 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_memoryview_type) < (0)) __PYX_ERR(1, 353, __pyx_L1_error)
28142 #endif
28143 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28144 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_memoryview_type);
28145 #endif
28146 #if !CYTHON_COMPILING_IN_LIMITED_API
28147 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_memoryview_type->tp_dictoffset && __pyx_mstate->__pyx_memoryview_type->tp_getattro == PyObject_GenericGetAttr)) {
28148 __pyx_mstate->__pyx_memoryview_type->tp_getattro = PyObject_GenericGetAttr;
28149 }
28150 #endif
28151 if (__Pyx_SetVtable(__pyx_mstate->__pyx_memoryview_type, __pyx_vtabptr_memoryview) < (0)) __PYX_ERR(1, 353, __pyx_L1_error)
28152 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_memoryview_type) < (0)) __PYX_ERR(1, 353, __pyx_L1_error)
28153 __Pyx_RefNannyFinishContext();
28154 return 0;
28155 __pyx_L1_error:;
28156 __Pyx_RefNannyFinishContext();
28157 return -1;
28158}
28159
28160static int __Pyx_modinit_Exttype___pyx_memoryviewslice_obj(__pyx_mstatetype *__pyx_mstate) {
28161 __Pyx_RefNannyDeclarations
28162 PyObject *__pyx_t_1 = NULL;
28163 int __pyx_lineno = 0;
28164 const char *__pyx_filename = NULL;
28165 int __pyx_clineno = 0;
28166 CYTHON_UNUSED_VAR(__pyx_mstate);
28167 __Pyx_RefNannySetupContext("__Pyx_modinit_Exttype___pyx_memoryviewslice_obj", 0);
28168 /*--- Exttype __pyx_memoryviewslice_obj ---*/
28169 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
28170 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
28171 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
28172 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
28173 __pyx_vtable__memoryviewslice.__pyx_base._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryviewslice__get_base;
28174 #if CYTHON_USE_TYPE_SPECS
28175 __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_memoryview_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 947, __pyx_L1_error)
28176 __Pyx_GOTREF(__pyx_t_1);
28177 __pyx_mstate->__pyx_memoryviewslice_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryviewslice_spec, __pyx_t_1);
28178 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
28179 if (unlikely(!__pyx_mstate->__pyx_memoryviewslice_type)) __PYX_ERR(1, 947, __pyx_L1_error)
28180 #else
28181 __pyx_mstate->__pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
28182 #endif
28183 if (__Pyx_ApplySequenceOrMappingFlag(__pyx_mstate->__pyx_memoryviewslice_type, 1) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
28184 #if !CYTHON_COMPILING_IN_LIMITED_API
28185 __pyx_mstate_global->__pyx_memoryviewslice_type->tp_base = __pyx_mstate_global->__pyx_memoryview_type;
28186 #endif
28187 #if !CYTHON_USE_TYPE_SPECS
28188 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_memoryviewslice_type) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
28189 #endif
28190 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28191 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_memoryviewslice_type);
28192 #endif
28193 #if !CYTHON_COMPILING_IN_LIMITED_API
28194 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_memoryviewslice_type->tp_dictoffset && __pyx_mstate->__pyx_memoryviewslice_type->tp_getattro == PyObject_GenericGetAttr)) {
28195 __pyx_mstate->__pyx_memoryviewslice_type->tp_getattro = PyObject_GenericGetAttr;
28196 }
28197 #endif
28198 if (__Pyx_SetVtable(__pyx_mstate->__pyx_memoryviewslice_type, __pyx_vtabptr__memoryviewslice) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
28199 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_memoryviewslice_type) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
28200 __Pyx_RefNannyFinishContext();
28201 return 0;
28202 __pyx_L1_error:;
28203 __Pyx_XDECREF(__pyx_t_1);
28204 __Pyx_RefNannyFinishContext();
28205 return -1;
28206}
28207
28208static int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate) {
28209 __Pyx_RefNannyDeclarations
28210 PyObject *__pyx_t_1 = NULL;
28211 int __pyx_lineno = 0;
28212 const char *__pyx_filename = NULL;
28213 int __pyx_clineno = 0;
28214 CYTHON_UNUSED_VAR(__pyx_mstate);
28215 __Pyx_RefNannySetupContext("__Pyx_modinit_Type_import_code", 0);
28216 /*--- Type import code ---*/
28217 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
28218 __Pyx_GOTREF(__pyx_t_1);
28219 __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_3_0(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
28220 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28221 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyTypeObject),
28222 #elif CYTHON_COMPILING_IN_LIMITED_API
28223 0, 0,
28224 #else
28225 sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyHeapTypeObject),
28226 #endif
28227 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
28228 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28229 __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 229, __pyx_L1_error)
28230 __Pyx_GOTREF(__pyx_t_1);
28231 __pyx_mstate->__pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "dtype",
28232 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28233 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
28234 #elif CYTHON_COMPILING_IN_LIMITED_API
28235 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
28236 #else
28237 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
28238 #endif
28239 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 229, __pyx_L1_error)
28240 __pyx_mstate->__pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "flatiter",
28241 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28242 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
28243 #elif CYTHON_COMPILING_IN_LIMITED_API
28244 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
28245 #else
28246 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
28247 #endif
28248 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 286, __pyx_L1_error)
28249 __pyx_mstate->__pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "broadcast",
28250 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28251 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
28252 #elif CYTHON_COMPILING_IN_LIMITED_API
28253 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
28254 #else
28255 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
28256 #endif
28257 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 290, __pyx_L1_error)
28258 __pyx_mstate->__pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "ndarray",
28259 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28260 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
28261 #elif CYTHON_COMPILING_IN_LIMITED_API
28262 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
28263 #else
28264 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
28265 #endif
28266 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 329, __pyx_L1_error)
28267 __pyx_mstate->__pyx_ptype_5numpy_generic = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "generic",
28268 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28269 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28270 #elif CYTHON_COMPILING_IN_LIMITED_API
28271 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28272 #else
28273 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28274 #endif
28275 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_generic) __PYX_ERR(2, 847, __pyx_L1_error)
28276 __pyx_mstate->__pyx_ptype_5numpy_number = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "number",
28277 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28278 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28279 #elif CYTHON_COMPILING_IN_LIMITED_API
28280 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28281 #else
28282 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28283 #endif
28284 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_number) __PYX_ERR(2, 849, __pyx_L1_error)
28285 __pyx_mstate->__pyx_ptype_5numpy_integer = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "integer",
28286 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28287 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28288 #elif CYTHON_COMPILING_IN_LIMITED_API
28289 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28290 #else
28291 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28292 #endif
28293 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_integer) __PYX_ERR(2, 851, __pyx_L1_error)
28294 __pyx_mstate->__pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "signedinteger",
28295 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28296 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28297 #elif CYTHON_COMPILING_IN_LIMITED_API
28298 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28299 #else
28300 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28301 #endif
28302 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 853, __pyx_L1_error)
28303 __pyx_mstate->__pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "unsignedinteger",
28304 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28305 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28306 #elif CYTHON_COMPILING_IN_LIMITED_API
28307 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28308 #else
28309 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28310 #endif
28311 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 855, __pyx_L1_error)
28312 __pyx_mstate->__pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "inexact",
28313 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28314 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28315 #elif CYTHON_COMPILING_IN_LIMITED_API
28316 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28317 #else
28318 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28319 #endif
28320 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 857, __pyx_L1_error)
28321 __pyx_mstate->__pyx_ptype_5numpy_floating = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "floating",
28322 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28323 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28324 #elif CYTHON_COMPILING_IN_LIMITED_API
28325 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28326 #else
28327 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28328 #endif
28329 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_floating) __PYX_ERR(2, 859, __pyx_L1_error)
28330 __pyx_mstate->__pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "complexfloating",
28331 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28332 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28333 #elif CYTHON_COMPILING_IN_LIMITED_API
28334 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28335 #else
28336 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28337 #endif
28338 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 861, __pyx_L1_error)
28339 __pyx_mstate->__pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "flexible",
28340 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28341 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28342 #elif CYTHON_COMPILING_IN_LIMITED_API
28343 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28344 #else
28345 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28346 #endif
28347 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 863, __pyx_L1_error)
28348 __pyx_mstate->__pyx_ptype_5numpy_character = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "character",
28349 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28350 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28351 #elif CYTHON_COMPILING_IN_LIMITED_API
28352 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28353 #else
28354 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
28355 #endif
28356 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_character) __PYX_ERR(2, 865, __pyx_L1_error)
28357 __pyx_mstate->__pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_3_0(__pyx_t_1, "numpy", "ufunc",
28358 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28359 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
28360 #elif CYTHON_COMPILING_IN_LIMITED_API
28361 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
28362 #else
28363 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
28364 #endif
28365 __Pyx_ImportType_CheckSize_Ignore_3_3_0); if (!__pyx_mstate->__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 946, __pyx_L1_error)
28366 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28367 __pyx_t_1 = PyImport_ImportModule("mpi4py.MPI"); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 44, __pyx_L1_error)
28368 __Pyx_GOTREF(__pyx_t_1);
28369 __pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Datatype = __Pyx_ImportType_3_3_0(__pyx_t_1, "mpi4py.MPI", "Datatype",
28370 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28371 sizeof(struct PyMPIDatatypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIDatatypeObject),
28372 #elif CYTHON_COMPILING_IN_LIMITED_API
28373 sizeof(struct PyMPIDatatypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIDatatypeObject),
28374 #else
28375 sizeof(struct PyMPIDatatypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIDatatypeObject),
28376 #endif
28377 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Datatype) __PYX_ERR(4, 44, __pyx_L1_error)
28378 __pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Status = __Pyx_ImportType_3_3_0(__pyx_t_1, "mpi4py.MPI", "Status",
28379 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28380 sizeof(struct PyMPIStatusObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIStatusObject),
28381 #elif CYTHON_COMPILING_IN_LIMITED_API
28382 sizeof(struct PyMPIStatusObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIStatusObject),
28383 #else
28384 sizeof(struct PyMPIStatusObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIStatusObject),
28385 #endif
28386 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Status) __PYX_ERR(4, 52, __pyx_L1_error)
28387 __pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Request = __Pyx_ImportType_3_3_0(__pyx_t_1, "mpi4py.MPI", "Request",
28388 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28389 sizeof(struct PyMPIRequestObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIRequestObject),
28390 #elif CYTHON_COMPILING_IN_LIMITED_API
28391 sizeof(struct PyMPIRequestObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIRequestObject),
28392 #else
28393 sizeof(struct PyMPIRequestObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIRequestObject),
28394 #endif
28395 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Request) __PYX_ERR(4, 60, __pyx_L1_error)
28396 __pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Prequest = __Pyx_ImportType_3_3_0(__pyx_t_1, "mpi4py.MPI", "Prequest",
28397 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28398 sizeof(struct PyMPIPrequestObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIPrequestObject),
28399 #elif CYTHON_COMPILING_IN_LIMITED_API
28400 sizeof(struct PyMPIPrequestObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIPrequestObject),
28401 #else
28402 sizeof(struct PyMPIPrequestObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIPrequestObject),
28403 #endif
28404 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Prequest) __PYX_ERR(4, 69, __pyx_L1_error)
28405 __pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Grequest = __Pyx_ImportType_3_3_0(__pyx_t_1, "mpi4py.MPI", "Grequest",
28406 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28407 sizeof(struct PyMPIGrequestObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIGrequestObject),
28408 #elif CYTHON_COMPILING_IN_LIMITED_API
28409 sizeof(struct PyMPIGrequestObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIGrequestObject),
28410 #else
28411 sizeof(struct PyMPIGrequestObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIGrequestObject),
28412 #endif
28413 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Grequest) __PYX_ERR(4, 75, __pyx_L1_error)
28414 __pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Message = __Pyx_ImportType_3_3_0(__pyx_t_1, "mpi4py.MPI", "Message",
28415 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28416 sizeof(struct PyMPIMessageObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIMessageObject),
28417 #elif CYTHON_COMPILING_IN_LIMITED_API
28418 sizeof(struct PyMPIMessageObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIMessageObject),
28419 #else
28420 sizeof(struct PyMPIMessageObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIMessageObject),
28421 #endif
28422 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Message) __PYX_ERR(4, 81, __pyx_L1_error)
28423 __pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Op = __Pyx_ImportType_3_3_0(__pyx_t_1, "mpi4py.MPI", "Op",
28424 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28425 sizeof(struct PyMPIOpObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIOpObject),
28426 #elif CYTHON_COMPILING_IN_LIMITED_API
28427 sizeof(struct PyMPIOpObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIOpObject),
28428 #else
28429 sizeof(struct PyMPIOpObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIOpObject),
28430 #endif
28431 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Op) __PYX_ERR(4, 90, __pyx_L1_error)
28432 __pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Group = __Pyx_ImportType_3_3_0(__pyx_t_1, "mpi4py.MPI", "Group",
28433 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28434 sizeof(struct PyMPIGroupObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIGroupObject),
28435 #elif CYTHON_COMPILING_IN_LIMITED_API
28436 sizeof(struct PyMPIGroupObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIGroupObject),
28437 #else
28438 sizeof(struct PyMPIGroupObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIGroupObject),
28439 #endif
28440 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Group) __PYX_ERR(4, 98, __pyx_L1_error)
28441 __pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Info = __Pyx_ImportType_3_3_0(__pyx_t_1, "mpi4py.MPI", "Info",
28442 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28443 sizeof(struct PyMPIInfoObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIInfoObject),
28444 #elif CYTHON_COMPILING_IN_LIMITED_API
28445 sizeof(struct PyMPIInfoObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIInfoObject),
28446 #else
28447 sizeof(struct PyMPIInfoObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIInfoObject),
28448 #endif
28449 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Info) __PYX_ERR(4, 106, __pyx_L1_error)
28450 __pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Errhandler = __Pyx_ImportType_3_3_0(__pyx_t_1, "mpi4py.MPI", "Errhandler",
28451 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28452 sizeof(struct PyMPIErrhandlerObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIErrhandlerObject),
28453 #elif CYTHON_COMPILING_IN_LIMITED_API
28454 sizeof(struct PyMPIErrhandlerObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIErrhandlerObject),
28455 #else
28456 sizeof(struct PyMPIErrhandlerObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIErrhandlerObject),
28457 #endif
28458 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Errhandler) __PYX_ERR(4, 114, __pyx_L1_error)
28459 __pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Session = __Pyx_ImportType_3_3_0(__pyx_t_1, "mpi4py.MPI", "Session",
28460 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28461 sizeof(struct PyMPISessionObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPISessionObject),
28462 #elif CYTHON_COMPILING_IN_LIMITED_API
28463 sizeof(struct PyMPISessionObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPISessionObject),
28464 #else
28465 sizeof(struct PyMPISessionObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPISessionObject),
28466 #endif
28467 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Session) __PYX_ERR(4, 122, __pyx_L1_error)
28468 __pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Comm = __Pyx_ImportType_3_3_0(__pyx_t_1, "mpi4py.MPI", "Comm",
28469 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28470 sizeof(struct PyMPICommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPICommObject),
28471 #elif CYTHON_COMPILING_IN_LIMITED_API
28472 sizeof(struct PyMPICommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPICommObject),
28473 #else
28474 sizeof(struct PyMPICommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPICommObject),
28475 #endif
28476 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Comm) __PYX_ERR(4, 130, __pyx_L1_error)
28477 __pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Intracomm = __Pyx_ImportType_3_3_0(__pyx_t_1, "mpi4py.MPI", "Intracomm",
28478 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28479 sizeof(struct PyMPIIntracommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIIntracommObject),
28480 #elif CYTHON_COMPILING_IN_LIMITED_API
28481 sizeof(struct PyMPIIntracommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIIntracommObject),
28482 #else
28483 sizeof(struct PyMPIIntracommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIIntracommObject),
28484 #endif
28485 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Intracomm) __PYX_ERR(4, 138, __pyx_L1_error)
28486 __pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Topocomm = __Pyx_ImportType_3_3_0(__pyx_t_1, "mpi4py.MPI", "Topocomm",
28487 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28488 sizeof(struct PyMPITopocommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPITopocommObject),
28489 #elif CYTHON_COMPILING_IN_LIMITED_API
28490 sizeof(struct PyMPITopocommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPITopocommObject),
28491 #else
28492 sizeof(struct PyMPITopocommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPITopocommObject),
28493 #endif
28494 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Topocomm) __PYX_ERR(4, 144, __pyx_L1_error)
28495 __pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Cartcomm = __Pyx_ImportType_3_3_0(__pyx_t_1, "mpi4py.MPI", "Cartcomm",
28496 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28497 sizeof(struct PyMPICartcommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPICartcommObject),
28498 #elif CYTHON_COMPILING_IN_LIMITED_API
28499 sizeof(struct PyMPICartcommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPICartcommObject),
28500 #else
28501 sizeof(struct PyMPICartcommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPICartcommObject),
28502 #endif
28503 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Cartcomm) __PYX_ERR(4, 150, __pyx_L1_error)
28504 __pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Graphcomm = __Pyx_ImportType_3_3_0(__pyx_t_1, "mpi4py.MPI", "Graphcomm",
28505 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28506 sizeof(struct PyMPIGraphcommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIGraphcommObject),
28507 #elif CYTHON_COMPILING_IN_LIMITED_API
28508 sizeof(struct PyMPIGraphcommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIGraphcommObject),
28509 #else
28510 sizeof(struct PyMPIGraphcommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIGraphcommObject),
28511 #endif
28512 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Graphcomm) __PYX_ERR(4, 156, __pyx_L1_error)
28513 __pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Distgraphcomm = __Pyx_ImportType_3_3_0(__pyx_t_1, "mpi4py.MPI", "Distgraphcomm",
28514 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28515 sizeof(struct PyMPIDistgraphcommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIDistgraphcommObject),
28516 #elif CYTHON_COMPILING_IN_LIMITED_API
28517 sizeof(struct PyMPIDistgraphcommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIDistgraphcommObject),
28518 #else
28519 sizeof(struct PyMPIDistgraphcommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIDistgraphcommObject),
28520 #endif
28521 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Distgraphcomm) __PYX_ERR(4, 162, __pyx_L1_error)
28522 __pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Intercomm = __Pyx_ImportType_3_3_0(__pyx_t_1, "mpi4py.MPI", "Intercomm",
28523 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28524 sizeof(struct PyMPIIntercommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIIntercommObject),
28525 #elif CYTHON_COMPILING_IN_LIMITED_API
28526 sizeof(struct PyMPIIntercommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIIntercommObject),
28527 #else
28528 sizeof(struct PyMPIIntercommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIIntercommObject),
28529 #endif
28530 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Intercomm) __PYX_ERR(4, 168, __pyx_L1_error)
28531 __pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Win = __Pyx_ImportType_3_3_0(__pyx_t_1, "mpi4py.MPI", "Win",
28532 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28533 sizeof(struct PyMPIWinObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIWinObject),
28534 #elif CYTHON_COMPILING_IN_LIMITED_API
28535 sizeof(struct PyMPIWinObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIWinObject),
28536 #else
28537 sizeof(struct PyMPIWinObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIWinObject),
28538 #endif
28539 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_6mpi4py_3MPI_Win) __PYX_ERR(4, 174, __pyx_L1_error)
28540 __pyx_mstate->__pyx_ptype_6mpi4py_3MPI_File = __Pyx_ImportType_3_3_0(__pyx_t_1, "mpi4py.MPI", "File",
28541 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28542 sizeof(struct PyMPIFileObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIFileObject),
28543 #elif CYTHON_COMPILING_IN_LIMITED_API
28544 sizeof(struct PyMPIFileObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIFileObject),
28545 #else
28546 sizeof(struct PyMPIFileObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct PyMPIFileObject),
28547 #endif
28548 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_6mpi4py_3MPI_File) __PYX_ERR(4, 183, __pyx_L1_error)
28549 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28550 __pyx_t_1 = PyImport_ImportModule("proteus.cmeshTools"); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 6, __pyx_L1_error)
28551 __Pyx_GOTREF(__pyx_t_1);
28552 __pyx_mstate->__pyx_ptype_7proteus_10cmeshTools_CMesh = __Pyx_ImportType_3_3_0(__pyx_t_1, "proteus.cmeshTools", "CMesh",
28553 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
28554 sizeof(struct __pyx_obj_7proteus_10cmeshTools_CMesh), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct __pyx_obj_7proteus_10cmeshTools_CMesh),
28555 #elif CYTHON_COMPILING_IN_LIMITED_API
28556 sizeof(struct __pyx_obj_7proteus_10cmeshTools_CMesh), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct __pyx_obj_7proteus_10cmeshTools_CMesh),
28557 #else
28558 sizeof(struct __pyx_obj_7proteus_10cmeshTools_CMesh), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(struct __pyx_obj_7proteus_10cmeshTools_CMesh),
28559 #endif
28560 __Pyx_ImportType_CheckSize_Warn_3_3_0); if (!__pyx_mstate->__pyx_ptype_7proteus_10cmeshTools_CMesh) __PYX_ERR(5, 6, __pyx_L1_error)
28561 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28562 __Pyx_RefNannyFinishContext();
28563 return 0;
28564 __pyx_L1_error:;
28565 __Pyx_XDECREF(__pyx_t_1);
28566 __Pyx_RefNannyFinishContext();
28567 return -1;
28568}
28569
28570static int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate) {
28571 __Pyx_RefNannyDeclarations
28572 CYTHON_UNUSED_VAR(__pyx_mstate);
28573 __Pyx_RefNannySetupContext("__Pyx_modinit_Variable_import_code", 0);
28574 /*--- Variable import code ---*/
28575 __Pyx_RefNannyFinishContext();
28576 return 0;
28577}
28578
28579static int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate) {
28580 __Pyx_RefNannyDeclarations
28581 CYTHON_UNUSED_VAR(__pyx_mstate);
28582 __Pyx_RefNannySetupContext("__Pyx_modinit_Function_import_code", 0);
28583 /*--- Function import code ---*/
28584 __Pyx_RefNannyFinishContext();
28585 return 0;
28586}
28587
28588#if CYTHON_PEP489_MULTI_PHASE_INIT
28589static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
28590static int __pyx_pymod_exec_cpartitioning(PyObject* module); /*proto*/
28591static PyModuleDef_Slot __pyx_moduledef_slots[] = {
28592 {Py_mod_create, (void*)__pyx_pymod_create},
28593 {Py_mod_exec, (void*)__pyx_pymod_exec_cpartitioning},
28594 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
28595 {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE},
28596 #endif
28597 #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
28598 {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
28599 #endif
28600 {0, NULL}
28601};
28602#endif
28603
28604#ifdef __cplusplus
28605namespace {
28606 struct PyModuleDef __pyx_moduledef =
28607 #else
28608 static struct PyModuleDef __pyx_moduledef =
28609 #endif
28610 {
28611 PyModuleDef_HEAD_INIT,
28612 "cpartitioning",
28613 0, /* m_doc */
28614 #if CYTHON_USE_MODULE_STATE
28615 sizeof(__pyx_mstatetype), /* m_size */
28616 #else
28617 (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */
28618 #endif
28619 __pyx_methods /* m_methods */,
28620 #if CYTHON_PEP489_MULTI_PHASE_INIT
28621 __pyx_moduledef_slots, /* m_slots */
28622 #else
28623 NULL, /* m_reload */
28624 #endif
28625 #if CYTHON_USE_MODULE_STATE
28626 __pyx_m_traverse, /* m_traverse */
28627 __pyx_m_clear, /* m_clear */
28628 NULL /* m_free */
28629 #else
28630 NULL, /* m_traverse */
28631 NULL, /* m_clear */
28632 NULL /* m_free */
28633 #endif
28634 };
28635 #ifdef __cplusplus
28636} /* anonymous namespace */
28637#endif
28638
28639/* PyModInitFuncType */
28640#ifndef CYTHON_NO_PYINIT_EXPORT
28641 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
28642#else
28643 #ifdef __cplusplus
28644 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
28645 #else
28646 #define __Pyx_PyMODINIT_FUNC PyObject *
28647 #endif
28648#endif
28649
28650__Pyx_PyMODINIT_FUNC PyInit_cpartitioning(void) CYTHON_SMALL_CODE; /*proto*/
28651__Pyx_PyMODINIT_FUNC PyInit_cpartitioning(void)
28652#if CYTHON_PEP489_MULTI_PHASE_INIT
28653{
28654 return PyModuleDef_Init(&__pyx_moduledef);
28655}
28656/* ModuleCreationPEP489 */
28657#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
28658 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
28659static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) {
28660 {
28661 PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think
28662 if (!module) {
28663 if (!PyErr_ExceptionMatches(PyExc_Exception)) {
28664 goto bad; // BaseException
28665 }
28666 PyErr_Clear(); // just try the 3.8-3.12 version
28667 module = PyImport_ImportModule("_xxsubinterpreters");
28668 if (!module) goto bad;
28669 }
28670 PyObject *current = PyObject_CallMethod(module, "get_current", NULL);
28671 Py_DECREF(module);
28672 if (!current) goto bad;
28673 if (PyTuple_Check(current)) {
28674 PyObject *new_current = PySequence_GetItem(current, 0);
28675 Py_DECREF(current);
28676 current = new_current;
28677 if (!new_current) goto bad;
28678 }
28679 long long as_c_int = PyLong_AsLongLong(current);
28680 Py_DECREF(current);
28681 return as_c_int;
28682 }
28683 bad:
28684 PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
28685 return -1;
28686}
28687#endif
28688#if !CYTHON_USE_MODULE_STATE
28689static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
28690 static PY_INT64_T main_interpreter_id = -1;
28691#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
28692 PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
28693#elif CYTHON_COMPILING_IN_GRAAL
28694 PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
28695#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x030A0000 &&\
28696 (defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)))
28697 PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
28698#elif CYTHON_COMPILING_IN_LIMITED_API
28699 PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
28700#else
28701 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
28702#endif
28703 if (unlikely(current_id == -1)) {
28704 return -1;
28705 }
28706 if (main_interpreter_id == -1) {
28707 main_interpreter_id = current_id;
28708 return 0;
28709 } else if (unlikely(main_interpreter_id != current_id)) {
28710 PyErr_SetString(
28711 PyExc_ImportError,
28712 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
28713 return -1;
28714 }
28715 return 0;
28716}
28717#endif
28718static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
28719{
28720 PyObject *value = PyObject_GetAttrString(spec, from_name);
28721 int result = 0;
28722 if (likely(value)) {
28723 if (allow_none || value != Py_None) {
28724 result = PyDict_SetItemString(moddict, to_name, value);
28725 }
28726 Py_DECREF(value);
28727 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
28728 PyErr_Clear();
28729 } else {
28730 result = -1;
28731 }
28732 return result;
28733}
28734static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
28735 PyObject *module = NULL, *moddict, *modname;
28736 CYTHON_UNUSED_VAR(def);
28737 #if !CYTHON_USE_MODULE_STATE
28738 if (__Pyx_check_single_interpreter())
28739 return NULL;
28740 #endif
28741 if (__pyx_m)
28742 return __Pyx_NewRef(__pyx_m);
28743 modname = PyObject_GetAttrString(spec, "name");
28744 if (unlikely(!modname)) goto bad;
28745 module = PyModule_NewObject(modname);
28746 Py_DECREF(modname);
28747 if (unlikely(!module)) goto bad;
28748 moddict = PyModule_GetDict(module);
28749 if (unlikely(!moddict)) goto bad;
28750 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
28751 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
28752 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
28753 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
28754 return module;
28755bad:
28756 Py_XDECREF(module);
28757 return NULL;
28758}
28759
28760
28761static CYTHON_SMALL_CODE int __pyx_pymod_exec_cpartitioning(PyObject *__pyx_pyinit_module)
28762#endif
28763{
28764 int stringtab_initialized = 0;
28765 #if CYTHON_USE_MODULE_STATE
28766 int pystate_addmodule_run = 0;
28767 #endif
28768 __pyx_mstatetype *__pyx_mstate = NULL;
28769 PyObject *__pyx_t_1 = NULL;
28770 PyObject *__pyx_t_2 = NULL;
28771 PyObject *__pyx_t_3 = NULL;
28772 PyObject *__pyx_t_4 = NULL;
28773 PyObject *__pyx_t_5 = NULL;
28774 size_t __pyx_t_6;
28775 static PyThread_type_lock __pyx_t_7[8];
28776 int __pyx_t_8;
28777 Py_ssize_t __pyx_t_9;
28778 int __pyx_lineno = 0;
28779 const char *__pyx_filename = NULL;
28780 int __pyx_clineno = 0;
28781 __Pyx_RefNannyDeclarations
28782 #if CYTHON_PEP489_MULTI_PHASE_INIT
28783 if (__pyx_m) {
28784 if (__pyx_m == __pyx_pyinit_module) return 0;
28785 PyErr_SetString(PyExc_RuntimeError, "Module 'cpartitioning' has already been imported. Re-initialisation is not supported.");
28786 return -1;
28787 }
28788 #else
28789 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
28790 #endif
28791 /*--- Module creation code ---*/
28792 #if CYTHON_PEP489_MULTI_PHASE_INIT
28793 __pyx_t_1 = __pyx_pyinit_module;
28794 Py_INCREF(__pyx_t_1);
28795 #else
28796 __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
28797 #endif
28798 #if CYTHON_USE_MODULE_STATE
28799 {
28800 int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
28801 __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "cpartitioning" pseudovariable */
28802 if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
28803 pystate_addmodule_run = 1;
28804 }
28805 #else
28806 __pyx_m = __pyx_t_1;
28807 #endif
28808 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
28809 PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
28810 #endif
28811 __pyx_mstate = __pyx_mstate_global;
28812 CYTHON_UNUSED_VAR(__pyx_t_1);
28813 __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
28814 Py_INCREF(__pyx_mstate->__pyx_d);
28815 __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
28816 __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
28817 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
28818 /* ImportRefnannyAPI */
28819 #if CYTHON_REFNANNY
28820 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
28821 if (!__Pyx_RefNanny) {
28822 if (PyErr_ExceptionMatches(PyExc_Exception)) {
28823 PyErr_Clear();
28824 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
28825 }
28826 if (!__Pyx_RefNanny)
28827 Py_FatalError("failed to import 'refnanny' module");
28828 }
28829 #endif
28830
28831__Pyx_RefNannySetupContext("PyInit_cpartitioning", 0);
28832 __Pyx_init_runtime_version();
28833 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)
28834 __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
28835 __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
28836 __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
28837 /*--- Library function declarations ---*/
28838 /*--- Initialize various global constants etc. ---*/
28839 if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
28840 stringtab_initialized = 1;
28841 if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
28842 if (__pyx_module_is_main_cpartitioning) {
28843 if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name_2, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
28844 }
28845 {
28846 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
28847 if (!PyDict_GetItemString(modules, "cpartitioning")) {
28848 if (unlikely((PyDict_SetItemString(modules, "cpartitioning", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
28849 }
28850 }
28851 /*--- Builtin init code ---*/
28852 if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
28853 /*--- Constants init code ---*/
28854 if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
28855 if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
28856 /*--- Global type/function init code ---*/
28857 (void)__Pyx_modinit_Global_init_code(__pyx_mstate);
28858 (void)__Pyx_modinit_Variable_export_code(__pyx_mstate);
28859 (void)__Pyx_modinit_Function_export_code(__pyx_mstate);
28860 /*--- Type init code ---*/
28861 if (unlikely((__Pyx_modinit_Exttype___pyx_array_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
28862 if (unlikely((__Pyx_modinit_Exttype___pyx_MemviewEnum_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
28863 if (unlikely((__Pyx_modinit_Exttype___pyx_memoryview_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
28864 if (unlikely((__Pyx_modinit_Exttype___pyx_memoryviewslice_obj(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
28865 if (unlikely((__Pyx_modinit_Type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
28866 (void)__Pyx_modinit_Variable_import_code(__pyx_mstate);
28867 (void)__Pyx_modinit_Function_import_code(__pyx_mstate);
28868 if (__Pyx_InitAfterSharedUtility() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
28869 /*--- Execution code ---*/
28870
28871 /* "View.MemoryView":118
28872 *
28873 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
28874 * try: # <<<<<<<<<<<<<<
28875 * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
28876 * except:
28877*/
28878 {
28879 __Pyx_PyThreadState_declare
28880 __Pyx_PyThreadState_assign
28881 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
28882 __Pyx_XGOTREF(__pyx_t_1);
28883 __Pyx_XGOTREF(__pyx_t_2);
28884 __Pyx_XGOTREF(__pyx_t_3);
28885 /*try:*/ {
28886
28887 /* "View.MemoryView":119
28888 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
28889 * try:
28890 * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence # <<<<<<<<<<<<<<
28891 * except:
28892 *
28893*/
28894 __pyx_t_5 = NULL;
28895 __pyx_t_6 = 1;
28896 {
28897 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_collections_abc};
28898 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin___import__, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
28899 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28900 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 119, __pyx_L2_error)
28901 __Pyx_GOTREF(__pyx_t_4);
28902 }
28903 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_abc); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 119, __pyx_L2_error)
28904 __Pyx_GOTREF(__pyx_t_5);
28905 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28906 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Sequence); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 119, __pyx_L2_error)
28907 __Pyx_GOTREF(__pyx_t_4);
28908 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
28909 __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
28910 __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_4);
28911 __Pyx_GIVEREF(__pyx_t_4);
28912 __pyx_t_4 = 0;
28913
28914 /* "View.MemoryView":118
28915 *
28916 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
28917 * try: # <<<<<<<<<<<<<<
28918 * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
28919 * except:
28920*/
28921 }
28922 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
28923 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
28924 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
28925 goto __pyx_L7_try_end;
28926 __pyx_L2_error:;
28927 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
28928 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28929
28930 /* "View.MemoryView":120
28931 * try:
28932 * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
28933 * except: # <<<<<<<<<<<<<<
28934 *
28935 * __pyx_collections_abc_Sequence = None
28936*/
28937 /*except:*/ {
28938 __Pyx_ErrRestore(0,0,0);
28939
28940 /* "View.MemoryView":122
28941 * except:
28942 *
28943 * __pyx_collections_abc_Sequence = None # <<<<<<<<<<<<<<
28944 *
28945 *
28946*/
28947 __Pyx_INCREF(Py_None);
28948 __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
28949 __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, Py_None);
28950 __Pyx_GIVEREF(Py_None);
28951 goto __pyx_L3_exception_handled;
28952 }
28953 __pyx_L3_exception_handled:;
28954 __Pyx_XGIVEREF(__pyx_t_1);
28955 __Pyx_XGIVEREF(__pyx_t_2);
28956 __Pyx_XGIVEREF(__pyx_t_3);
28957 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
28958 __pyx_L7_try_end:;
28959 }
28960
28961 /* "View.MemoryView":258
28962 *
28963 *
28964 * try: # <<<<<<<<<<<<<<
28965 * count = __pyx_collections_abc_Sequence.count
28966 * index = __pyx_collections_abc_Sequence.index
28967*/
28968 {
28969 __Pyx_PyThreadState_declare
28970 __Pyx_PyThreadState_assign
28971 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
28972 __Pyx_XGOTREF(__pyx_t_3);
28973 __Pyx_XGOTREF(__pyx_t_2);
28974 __Pyx_XGOTREF(__pyx_t_1);
28975 /*try:*/ {
28976
28977 /* "View.MemoryView":259
28978 *
28979 * try:
28980 * count = __pyx_collections_abc_Sequence.count # <<<<<<<<<<<<<<
28981 * index = __pyx_collections_abc_Sequence.index
28982 * except:
28983*/
28984 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 259, __pyx_L10_error)
28985 __Pyx_GOTREF(__pyx_t_4);
28986 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_array_type, __pyx_mstate_global->__pyx_n_u_count, __pyx_t_4) < (0)) __PYX_ERR(1, 259, __pyx_L10_error)
28987 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28988
28989 /* "View.MemoryView":260
28990 * try:
28991 * count = __pyx_collections_abc_Sequence.count
28992 * index = __pyx_collections_abc_Sequence.index # <<<<<<<<<<<<<<
28993 * except:
28994 * pass
28995*/
28996 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 260, __pyx_L10_error)
28997 __Pyx_GOTREF(__pyx_t_4);
28998 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_array_type, __pyx_mstate_global->__pyx_n_u_index, __pyx_t_4) < (0)) __PYX_ERR(1, 260, __pyx_L10_error)
28999 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29000
29001 /* "View.MemoryView":258
29002 *
29003 *
29004 * try: # <<<<<<<<<<<<<<
29005 * count = __pyx_collections_abc_Sequence.count
29006 * index = __pyx_collections_abc_Sequence.index
29007*/
29008 }
29009 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
29010 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
29011 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
29012 goto __pyx_L15_try_end;
29013 __pyx_L10_error:;
29014 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
29015 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
29016
29017 /* "View.MemoryView":261
29018 * count = __pyx_collections_abc_Sequence.count
29019 * index = __pyx_collections_abc_Sequence.index
29020 * except: # <<<<<<<<<<<<<<
29021 * pass
29022 *
29023*/
29024 /*except:*/ {
29025 __Pyx_ErrRestore(0,0,0);
29026 goto __pyx_L11_exception_handled;
29027 }
29028 __pyx_L11_exception_handled:;
29029 __Pyx_XGIVEREF(__pyx_t_3);
29030 __Pyx_XGIVEREF(__pyx_t_2);
29031 __Pyx_XGIVEREF(__pyx_t_1);
29032 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
29033 __pyx_L15_try_end:;
29034 }
29035
29036 /* "View.MemoryView":326
29037 * return self.name
29038 *
29039 * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
29040 * cdef strided = Enum("<strided and direct>") # default
29041 * cdef indirect = Enum("<strided and indirect>")
29042*/
29043 __pyx_t_5 = NULL;
29044 __pyx_t_6 = 1;
29045 {
29046 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_direct_or_indirect};
29047 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
29048 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
29049 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 326, __pyx_L1_error)
29050 __Pyx_GOTREF((PyObject *)__pyx_t_4);
29051 }
29052 __Pyx_XGOTREF(generic);
29053 __Pyx_DECREF_SET(generic, ((PyObject *)__pyx_t_4));
29054 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
29055 __pyx_t_4 = 0;
29056
29057 /* "View.MemoryView":327
29058 *
29059 * cdef generic = Enum("<strided and direct or indirect>")
29060 * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
29061 * cdef indirect = Enum("<strided and indirect>")
29062 *
29063*/
29064 __pyx_t_5 = NULL;
29065 __pyx_t_6 = 1;
29066 {
29067 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_direct};
29068 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
29069 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
29070 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 327, __pyx_L1_error)
29071 __Pyx_GOTREF((PyObject *)__pyx_t_4);
29072 }
29073 __Pyx_XGOTREF(strided);
29074 __Pyx_DECREF_SET(strided, ((PyObject *)__pyx_t_4));
29075 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
29076 __pyx_t_4 = 0;
29077
29078 /* "View.MemoryView":328
29079 * cdef generic = Enum("<strided and direct or indirect>")
29080 * cdef strided = Enum("<strided and direct>") # default
29081 * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
29082 *
29083 *
29084*/
29085 __pyx_t_5 = NULL;
29086 __pyx_t_6 = 1;
29087 {
29088 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_indirect};
29089 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
29090 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
29091 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 328, __pyx_L1_error)
29092 __Pyx_GOTREF((PyObject *)__pyx_t_4);
29093 }
29094 __Pyx_XGOTREF(indirect);
29095 __Pyx_DECREF_SET(indirect, ((PyObject *)__pyx_t_4));
29096 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
29097 __pyx_t_4 = 0;
29098
29099 /* "View.MemoryView":331
29100 *
29101 *
29102 * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
29103 * cdef indirect_contiguous = Enum("<contiguous and indirect>")
29104 *
29105*/
29106 __pyx_t_5 = NULL;
29107 __pyx_t_6 = 1;
29108 {
29109 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_contiguous_and_direct};
29110 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
29111 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
29112 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 331, __pyx_L1_error)
29113 __Pyx_GOTREF((PyObject *)__pyx_t_4);
29114 }
29115 __Pyx_XGOTREF(contiguous);
29116 __Pyx_DECREF_SET(contiguous, ((PyObject *)__pyx_t_4));
29117 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
29118 __pyx_t_4 = 0;
29119
29120 /* "View.MemoryView":332
29121 *
29122 * cdef contiguous = Enum("<contiguous and direct>")
29123 * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
29124 *
29125 *
29126*/
29127 __pyx_t_5 = NULL;
29128 __pyx_t_6 = 1;
29129 {
29130 PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_contiguous_and_indirect};
29131 __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
29132 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
29133 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 332, __pyx_L1_error)
29134 __Pyx_GOTREF((PyObject *)__pyx_t_4);
29135 }
29136 __Pyx_XGOTREF(indirect_contiguous);
29137 __Pyx_DECREF_SET(indirect_contiguous, ((PyObject *)__pyx_t_4));
29138 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
29139 __pyx_t_4 = 0;
29140
29141 /* "View.MemoryView":340
29142 *
29143 *
29144 * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
29145 * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [
29146 * PyThread_allocate_lock(),
29147*/
29148 __pyx_memoryview_thread_locks_used = 0;
29149
29150 /* "View.MemoryView":341
29151 *
29152 * cdef int __pyx_memoryview_thread_locks_used = 0
29153 * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
29154 * PyThread_allocate_lock(),
29155 * PyThread_allocate_lock(),
29156*/
29157 __pyx_t_7[0] = PyThread_allocate_lock();
29158 __pyx_t_7[1] = PyThread_allocate_lock();
29159 __pyx_t_7[2] = PyThread_allocate_lock();
29160 __pyx_t_7[3] = PyThread_allocate_lock();
29161 __pyx_t_7[4] = PyThread_allocate_lock();
29162 __pyx_t_7[5] = PyThread_allocate_lock();
29163 __pyx_t_7[6] = PyThread_allocate_lock();
29164 __pyx_t_7[7] = PyThread_allocate_lock();
29165 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_7, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
29166
29167 /* "View.MemoryView":979
29168 *
29169 *
29170 * try: # <<<<<<<<<<<<<<
29171 * count = __pyx_collections_abc_Sequence.count
29172 * index = __pyx_collections_abc_Sequence.index
29173*/
29174 {
29175 __Pyx_PyThreadState_declare
29176 __Pyx_PyThreadState_assign
29177 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
29178 __Pyx_XGOTREF(__pyx_t_1);
29179 __Pyx_XGOTREF(__pyx_t_2);
29180 __Pyx_XGOTREF(__pyx_t_3);
29181 /*try:*/ {
29182
29183 /* "View.MemoryView":980
29184 *
29185 * try:
29186 * count = __pyx_collections_abc_Sequence.count # <<<<<<<<<<<<<<
29187 * index = __pyx_collections_abc_Sequence.index
29188 * except:
29189*/
29190 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 980, __pyx_L18_error)
29191 __Pyx_GOTREF(__pyx_t_4);
29192 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_memoryviewslice_type, __pyx_mstate_global->__pyx_n_u_count, __pyx_t_4) < (0)) __PYX_ERR(1, 980, __pyx_L18_error)
29193 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29194
29195 /* "View.MemoryView":981
29196 * try:
29197 * count = __pyx_collections_abc_Sequence.count
29198 * index = __pyx_collections_abc_Sequence.index # <<<<<<<<<<<<<<
29199 * except:
29200 * pass
29201*/
29202 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 981, __pyx_L18_error)
29203 __Pyx_GOTREF(__pyx_t_4);
29204 if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_memoryviewslice_type, __pyx_mstate_global->__pyx_n_u_index, __pyx_t_4) < (0)) __PYX_ERR(1, 981, __pyx_L18_error)
29205 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29206
29207 /* "View.MemoryView":979
29208 *
29209 *
29210 * try: # <<<<<<<<<<<<<<
29211 * count = __pyx_collections_abc_Sequence.count
29212 * index = __pyx_collections_abc_Sequence.index
29213*/
29214 }
29215 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
29216 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
29217 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
29218 goto __pyx_L23_try_end;
29219 __pyx_L18_error:;
29220 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
29221 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
29222
29223 /* "View.MemoryView":982
29224 * count = __pyx_collections_abc_Sequence.count
29225 * index = __pyx_collections_abc_Sequence.index
29226 * except: # <<<<<<<<<<<<<<
29227 * pass
29228 *
29229*/
29230 /*except:*/ {
29231 __Pyx_ErrRestore(0,0,0);
29232 goto __pyx_L19_exception_handled;
29233 }
29234 __pyx_L19_exception_handled:;
29235 __Pyx_XGIVEREF(__pyx_t_1);
29236 __Pyx_XGIVEREF(__pyx_t_2);
29237 __Pyx_XGIVEREF(__pyx_t_3);
29238 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
29239 __pyx_L23_try_end:;
29240 }
29241
29242 /* "View.MemoryView":985
29243 * pass
29244 *
29245 * try: # <<<<<<<<<<<<<<
29246 * if __pyx_collections_abc_Sequence:
29247 *
29248*/
29249 {
29250 __Pyx_PyThreadState_declare
29251 __Pyx_PyThreadState_assign
29252 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
29253 __Pyx_XGOTREF(__pyx_t_3);
29254 __Pyx_XGOTREF(__pyx_t_2);
29255 __Pyx_XGOTREF(__pyx_t_1);
29256 /*try:*/ {
29257
29258 /* "View.MemoryView":986
29259 *
29260 * try:
29261 * if __pyx_collections_abc_Sequence: # <<<<<<<<<<<<<<
29262 *
29263 *
29264*/
29265 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_collections_abc_Sequence); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 986, __pyx_L26_error)
29266 if (__pyx_t_8) {
29267
29268
29269 /* "View.MemoryView":990
29270 *
29271 *
29272 * __pyx_collections_abc_Sequence.register(_memoryviewslice) # <<<<<<<<<<<<<<
29273 * __pyx_collections_abc_Sequence.register(array)
29274 * except:
29275*/
29276 __pyx_t_5 = __pyx_collections_abc_Sequence;
29277 __Pyx_INCREF(__pyx_t_5);
29278 __pyx_t_6 = 0;
29279 {
29280 PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_mstate_global->__pyx_memoryviewslice_type)};
29281 __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_register, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
29282 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
29283 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 990, __pyx_L26_error)
29284 __Pyx_GOTREF(__pyx_t_4);
29285 }
29286 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29287
29288 /* "View.MemoryView":991
29289 *
29290 * __pyx_collections_abc_Sequence.register(_memoryviewslice)
29291 * __pyx_collections_abc_Sequence.register(array) # <<<<<<<<<<<<<<
29292 * except:
29293 * pass # ignore failure, it's a minor issue
29294*/
29295 __pyx_t_5 = __pyx_collections_abc_Sequence;
29296 __Pyx_INCREF(__pyx_t_5);
29297 __pyx_t_6 = 0;
29298 {
29299 PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_mstate_global->__pyx_array_type)};
29300 __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_register, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
29301 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
29302 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 991, __pyx_L26_error)
29303 __Pyx_GOTREF(__pyx_t_4);
29304 }
29305 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29306
29307 /* "View.MemoryView":986
29308 *
29309 * try:
29310 * if __pyx_collections_abc_Sequence: # <<<<<<<<<<<<<<
29311 *
29312 *
29313*/
29314 }
29315
29316 /* "View.MemoryView":985
29317 * pass
29318 *
29319 * try: # <<<<<<<<<<<<<<
29320 * if __pyx_collections_abc_Sequence:
29321 *
29322*/
29323 }
29324 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
29325 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
29326 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
29327 goto __pyx_L31_try_end;
29328 __pyx_L26_error:;
29329 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
29330 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
29331
29332 /* "View.MemoryView":992
29333 * __pyx_collections_abc_Sequence.register(_memoryviewslice)
29334 * __pyx_collections_abc_Sequence.register(array)
29335 * except: # <<<<<<<<<<<<<<
29336 * pass # ignore failure, it's a minor issue
29337 *
29338*/
29339 /*except:*/ {
29340 __Pyx_ErrRestore(0,0,0);
29341 goto __pyx_L27_exception_handled;
29342 }
29343 __pyx_L27_exception_handled:;
29344 __Pyx_XGIVEREF(__pyx_t_3);
29345 __Pyx_XGIVEREF(__pyx_t_2);
29346 __Pyx_XGIVEREF(__pyx_t_1);
29347 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
29348 __pyx_L31_try_end:;
29349 }
29350
29351 /* "(tree fragment)":4
29352 * int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
29353 * int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
29354 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state): # <<<<<<<<<<<<<<
29355 * cdef object __pyx_result
29356 * __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
29357*/
29358 __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_mstate_global->__pyx_n_u_View_MemoryView); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4, __pyx_L1_error)
29359 __Pyx_GOTREF(__pyx_t_4);
29360 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Enum, __pyx_t_4) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
29361 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29362
29363 /* "cpartitioning.pyx":3
29364 * # A type of -*- python -*- file
29365 * # cython: language_level = 3
29366 * from proteus import Comm as proteus_Comm # <<<<<<<<<<<<<<
29367 * import numpy as np
29368 * cimport numpy as np
29369*/
29370 {
29371 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Comm};
29372 __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, 3, __pyx_L1_error)
29373 }
29374 __pyx_t_4 = __pyx_t_1;
29375 __Pyx_GOTREF(__pyx_t_4);
29376 {
29377 PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Comm};
29378 __pyx_t_9 = 0; {
29379 __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_imported_names[__pyx_t_9]); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3, __pyx_L1_error)
29380 __Pyx_GOTREF(__pyx_t_5);
29381 switch (__pyx_t_9) {
29382 case 0:
29383 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_proteus_Comm, __pyx_t_5) < (0)) __PYX_ERR(0, 3, __pyx_L1_error)
29384 break;
29385 default:;
29386 }
29387 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
29388 }
29389 }
29390 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29391
29392 /* "cpartitioning.pyx":4
29393 * # cython: language_level = 3
29394 * from proteus import Comm as proteus_Comm
29395 * import numpy as np # <<<<<<<<<<<<<<
29396 * cimport numpy as np
29397 * cdef extern from *:
29398*/
29399 __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_numpy, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
29400 __pyx_t_4 = __pyx_t_1;
29401 __Pyx_GOTREF(__pyx_t_4);
29402 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_np, __pyx_t_4) < (0)) __PYX_ERR(0, 4, __pyx_L1_error)
29403 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29404
29405 /* "cpartitioning.pyx":36
29406 * buildDiscontinuousGalerkinSubdomain2GlobalMappings)
29407 *
29408 * def partitionElements(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
29409 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
29410 * c_partitionElements(comm.ob_mpi,
29411*/
29412 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_13cpartitioning_1partitionElements, 0, __pyx_mstate_global->__pyx_n_u_partitionElements, NULL, __pyx_mstate_global->__pyx_n_u_cpartitioning, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error)
29413 __Pyx_GOTREF(__pyx_t_4);
29414 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
29415 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
29416 #endif
29417 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_partitionElements, __pyx_t_4) < (0)) __PYX_ERR(0, 36, __pyx_L1_error)
29418 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29419
29420 /* "cpartitioning.pyx":52
29421 * )
29422 *
29423 * def partitionNodes(Comm comm, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
29424 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
29425 * c_partitionNodes(comm.ob_mpi,
29426*/
29427 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_13cpartitioning_3partitionNodes, 0, __pyx_mstate_global->__pyx_n_u_partitionNodes, NULL, __pyx_mstate_global->__pyx_n_u_cpartitioning, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 52, __pyx_L1_error)
29428 __Pyx_GOTREF(__pyx_t_4);
29429 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
29430 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
29431 #endif
29432 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_partitionNodes, __pyx_t_4) < (0)) __PYX_ERR(0, 52, __pyx_L1_error)
29433 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29434
29435 /* "cpartitioning.pyx":68
29436 * )
29437 *
29438 * def convertPUMIPartitionToPython(Comm comm, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
29439 * #need to have Python handles for the cmesh arrays created from apf/PUMI mesh
29440 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
29441*/
29442 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_13cpartitioning_5convertPUMIPartitionToPython, 0, __pyx_mstate_global->__pyx_n_u_convertPUMIPartitionToPython, NULL, __pyx_mstate_global->__pyx_n_u_cpartitioning, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 68, __pyx_L1_error)
29443 __Pyx_GOTREF(__pyx_t_4);
29444 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
29445 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
29446 #endif
29447 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_convertPUMIPartitionToPython, __pyx_t_4) < (0)) __PYX_ERR(0, 68, __pyx_L1_error)
29448 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29449
29450 /* "cpartitioning.pyx":82
29451 * )
29452 *
29453 * def partitionNodesFromTetgenFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh, double memHardLimit): # <<<<<<<<<<<<<<
29454 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
29455 * if not isinstance(filebase, bytes):
29456*/
29457 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_13cpartitioning_7partitionNodesFromTetgenFiles, 0, __pyx_mstate_global->__pyx_n_u_partitionNodesFromTetgenFiles, NULL, __pyx_mstate_global->__pyx_n_u_cpartitioning, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error)
29458 __Pyx_GOTREF(__pyx_t_4);
29459 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
29460 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
29461 #endif
29462 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_partitionNodesFromTetgenFiles, __pyx_t_4) < (0)) __PYX_ERR(0, 82, __pyx_L1_error)
29463 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29464
29465 /* "cpartitioning.pyx":103
29466 * )
29467 *
29468 * def partitionNodesFromTriangleFiles(Comm comm, object filebase, int indexBase, int nLayersOfOverlap, cmeshTools.CMesh cmesh, cmeshTools.CMesh subdomain_cmesh): # <<<<<<<<<<<<<<
29469 * cmesh.mesh.subdomainp = &subdomain_cmesh.mesh
29470 * if not isinstance(filebase, bytes):
29471*/
29472 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_13cpartitioning_9partitionNodesFromTriangleFiles, 0, __pyx_mstate_global->__pyx_n_u_partitionNodesFromTriangleFiles, NULL, __pyx_mstate_global->__pyx_n_u_cpartitioning, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L1_error)
29473 __Pyx_GOTREF(__pyx_t_4);
29474 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
29475 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
29476 #endif
29477 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_partitionNodesFromTriangleFiles, __pyx_t_4) < (0)) __PYX_ERR(0, 103, __pyx_L1_error)
29478 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29479
29480 /* "cpartitioning.pyx":123
29481 * )
29482 *
29483 * def buildQuadraticLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
29484 * int nSpace,
29485 * cmeshTools.CMesh cmesh,
29486*/
29487 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_13cpartitioning_11buildQuadraticLocal2GlobalMappings, 0, __pyx_mstate_global->__pyx_n_u_buildQuadraticLocal2GlobalMappin, NULL, __pyx_mstate_global->__pyx_n_u_cpartitioning, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
29488 __Pyx_GOTREF(__pyx_t_4);
29489 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
29490 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
29491 #endif
29492 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_buildQuadraticLocal2GlobalMappin, __pyx_t_4) < (0)) __PYX_ERR(0, 123, __pyx_L1_error)
29493 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29494
29495 /* "cpartitioning.pyx":188
29496 * max_dof_neighbors)
29497 *
29498 * def buildQuadraticCubeLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
29499 * int nSpace,
29500 * cmeshTools.CMesh cmesh,
29501*/
29502 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_13cpartitioning_13buildQuadraticCubeLocal2GlobalMappings, 0, __pyx_mstate_global->__pyx_n_u_buildQuadraticCubeLocal2GlobalMa, NULL, __pyx_mstate_global->__pyx_n_u_cpartitioning, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error)
29503 __Pyx_GOTREF(__pyx_t_4);
29504 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
29505 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
29506 #endif
29507 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_buildQuadraticCubeLocal2GlobalMa, __pyx_t_4) < (0)) __PYX_ERR(0, 188, __pyx_L1_error)
29508 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29509
29510 /* "cpartitioning.pyx":229
29511 * max_dof_neighbors)
29512 *
29513 * def buildDiscontinuousGalerkinLocal2GlobalMappings(Comm comm, # <<<<<<<<<<<<<<
29514 * int nDOF_element,
29515 * cmeshTools.CMesh cmesh,
29516*/
29517 __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_13cpartitioning_15buildDiscontinuousGalerkinLocal2GlobalMappings, 0, __pyx_mstate_global->__pyx_n_u_buildDiscontinuousGalerkinLocal2, NULL, __pyx_mstate_global->__pyx_n_u_cpartitioning, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __pyx_L1_error)
29518 __Pyx_GOTREF(__pyx_t_4);
29519 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
29520 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
29521 #endif
29522 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_buildDiscontinuousGalerkinLocal2, __pyx_t_4) < (0)) __PYX_ERR(0, 229, __pyx_L1_error)
29523 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29524
29525 /* "cpartitioning.pyx":1
29526 * # A type of -*- python -*- file # <<<<<<<<<<<<<<
29527 * # cython: language_level = 3
29528 * from proteus import Comm as proteus_Comm
29529*/
29530 __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
29531 __Pyx_GOTREF(__pyx_t_4);
29532 if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_4) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
29533 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29534
29535 /*--- Wrapped vars code ---*/
29536
29537 goto __pyx_L0;
29538 __pyx_L1_error:;
29539 __Pyx_XDECREF(__pyx_t_4);
29540 __Pyx_XDECREF(__pyx_t_5);
29541 if (__pyx_m) {
29542 if (__pyx_mstate->__pyx_d && stringtab_initialized) {
29543 __Pyx_AddTraceback("init cpartitioning", __pyx_clineno, __pyx_lineno, __pyx_filename);
29544 }
29545 #if !CYTHON_USE_MODULE_STATE
29546 Py_CLEAR(__pyx_m);
29547 #else
29548 Py_DECREF(__pyx_m);
29549 if (pystate_addmodule_run) {
29550 PyObject *tp, *value, *tb;
29551 __Pyx_PyErr_FetchException(&tp, &value, &tb);
29552 __Pyx_State_RemoveModule(&__pyx_moduledef);
29553 __Pyx_PyErr_RestoreException(tp, value, tb);
29554 }
29555 #endif
29556 } else if (!PyErr_Occurred()) {
29557 PyErr_SetString(PyExc_ImportError, "init cpartitioning");
29558 }
29559 __pyx_L0:;
29560 __Pyx_RefNannyFinishContext();
29561 #if CYTHON_PEP489_MULTI_PHASE_INIT
29562 return (__pyx_m != NULL) ? 0 : -1;
29563 #else
29564 return __pyx_m;
29565 #endif
29566}
29567/* #### Code section: pystring_table ### */
29568/* #### Code section: cached_builtins ### */
29569
29570static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
29571 int __pyx_lineno = 0;
29572 const char *__pyx_filename = NULL;
29573 int __pyx_clineno = 0;
29574 CYTHON_UNUSED_VAR(__pyx_mstate);
29575 __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_import); if (!__pyx_builtin___import__) __PYX_ERR(1, 119, __pyx_L1_error)
29576 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 175, __pyx_L1_error)
29577 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 436, __pyx_L1_error)
29578 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_id); if (!__pyx_builtin_id) __PYX_ERR(1, 662, __pyx_L1_error)
29579
29580 /* Cached unbound methods */
29581 __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
29582 __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items;
29583 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
29584 __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
29585 __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
29586 __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values;
29587 return 0;
29588 __pyx_L1_error:;
29589 return -1;
29590}
29591/* #### Code section: cached_constants ### */
29592
29593static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
29594 __Pyx_RefNannyDeclarations
29595 int __pyx_lineno = 0;
29596 const char *__pyx_filename = NULL;
29597 int __pyx_clineno = 0;
29598 CYTHON_UNUSED_VAR(__pyx_mstate);
29599 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
29600
29601 /* "View.MemoryView":625
29602 * def suboffsets(self):
29603 * if self.view.suboffsets == NULL:
29604 * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
29605 *
29606 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
29607*/
29608 __pyx_mstate_global->__pyx_tuple[0] = PyTuple_New(1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(1, 625, __pyx_L1_error)
29609 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
29610 __Pyx_INCREF(__pyx_mstate_global->__pyx_int_neg_1);
29611 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_neg_1);
29612 if (__Pyx_PyTuple_SET_ITEM(__pyx_mstate_global->__pyx_tuple[0], 0, __pyx_mstate_global->__pyx_int_neg_1) != (0)) __PYX_ERR(1, 625, __pyx_L1_error);
29613 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);
29614
29615 /* "View.MemoryView":745
29616 *
29617 * if first_ellipsis_index >= 0:
29618 * result = [slice(None)] * ndim # <<<<<<<<<<<<<<
29619 *
29620 * for idx in range(first_ellipsis_index):
29621*/
29622 __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(1, 745, __pyx_L1_error)
29623 __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]);
29624 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
29625
29626 /* "View.MemoryView":763
29627 *
29628 * have_slices = True
29629 * index_tuple += (slice(None),) * (ndim - idx) # <<<<<<<<<<<<<<
29630 *
29631 * return have_slices, index_tuple
29632*/
29633 __pyx_mstate_global->__pyx_tuple[1] = PyTuple_New(1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(1, 763, __pyx_L1_error)
29634 __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
29635 __Pyx_INCREF(__pyx_mstate_global->__pyx_slice[0]);
29636 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
29637 if (__Pyx_PyTuple_SET_ITEM(__pyx_mstate_global->__pyx_tuple[1], 0, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(1, 763, __pyx_L1_error);
29638 __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);
29639 #if CYTHON_IMMORTAL_CONSTANTS
29640 {
29641 PyObject **table = __pyx_mstate->__pyx_tuple;
29642 for (Py_ssize_t i=0; i<2; ++i) {
29643 #if PY_VERSION_HEX >= 0x030F0000
29644 PyUnstable_SetImmortal(table[i]);
29645 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
29646 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
29647 #if PY_VERSION_HEX < 0x030E0000
29648 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
29649 #else
29650 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
29651 #endif
29652 {
29653 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
29654 }
29655 #else
29656 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
29657 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
29658 #endif
29659 }
29660 }
29661 #endif
29662 #if CYTHON_IMMORTAL_CONSTANTS
29663 {
29664 PyObject **table = __pyx_mstate->__pyx_slice;
29665 for (Py_ssize_t i=0; i<1; ++i) {
29666 #if PY_VERSION_HEX >= 0x030F0000
29667 PyUnstable_SetImmortal(table[i]);
29668 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
29669 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
29670 #if PY_VERSION_HEX < 0x030E0000
29671 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
29672 #else
29673 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
29674 #endif
29675 {
29676 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
29677 }
29678 #else
29679 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
29680 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
29681 #endif
29682 }
29683 }
29684 #endif
29685 __Pyx_RefNannyFinishContext();
29686 return 0;
29687 __pyx_L1_error:;
29688 __Pyx_RefNannyFinishContext();
29689 return -1;
29690}
29691/* #### Code section: init_constants ### */
29692
29693static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
29694 int __pyx_lineno = 0;
29695 const char *__pyx_filename = NULL;
29696 int __pyx_clineno = 0;
29697 CYTHON_UNUSED_VAR(__pyx_mstate);
29698 {
29699 const struct { const unsigned int length: 8; } str_length_index[] = {{6},{8},{1},{1},{1},{1},{2},{15},{23},{25},{32},{20},{22},{1},{1},{37},{45},{22},{179},{8},{63},{63},{15},{7},{6},{2},{9},{50},{39},{34},{25},{30},{37},{5},{4},{8},{8},{15},{20},{12},{9},{17},{8},{8},{12},{10},{8},{10},{8},{7},{14},{11},{10},{19},{14},{12},{10},{17},{13},{12},{12},{19},{8},{13},{3},{15},{7},{18},{4},{46},{38},{34},{1},{18},{5},{4},{28},{5},{13},{28},{30},{16},{15},{30},{27},{41},{38},{33},{30},{6},{9},{5},{8},{5},{6},{7},{2},{5},{9},{5},{8},{4},{17},{12},{7},{4},{18},{12},{14},{16},{6},{4},{4},{30},{27},{2},{5},{3},{4},{17},{14},{29},{31},{3},{7},{12},{35},{37},{23},{23},{8},{10},{5},{4},{5},{4},{4},{6},{15},{6},{6},{6},{1}};
29700 const struct { const unsigned int length: 9; } bytes_length_index[] = {{0},{1},{1},{2},{1},{1},{260},{257},{225},{225},{208},{100},{155},{331}};
29701 #ifndef CYTHON_COMPRESS_STRINGS
29702 #define CYTHON_COMPRESS_STRINGS 90
29703 #endif
29704 #if (CYTHON_COMPRESS_STRINGS) == 1 /* compression: zlib (1516 bytes) */
29705static const char cstring[] = "x\332\335U\313s\0237\030o\246f\200\016\2356-ii\247\235\312\323d\0023\3406)$<B\300\344\321f\n\211\323$@\201\"\344\225\274\026\331\2256\253Ub\267\323\231\034s\364\321G\037s\3641G\2169\356q\217\374\t\375\023\372I\353W\336\241\267\342Y\257\276\325\367\320\367\375\276\207\020\211\320\217\025$\213\257\231\023M^\276r5w\033M<b\276\014\253\2179\333@\262\204&\034)\"\356j\251\025\"\202\"\312C#\273\177\233\2136CE!\247\214\366\010#\031\036\313\337\273\327\221\234\2747E\204\220\021\"JqW\240H\242\220\021zM\n\257\212|\353\344:89\047\326\211\307)\362%eW\021\253\004\240\013\246\206\235as\356pI\206QH\304\360U\344\202\251\266\260*\223\200\301Q\210T\270B\3632b(*\003\030S\325\250,\005\202=\312<^d!\211\030\234f\374\003\253\241\021\022\2500S\270v\375\346u\353m\310\014t\n)]t<p\224)\003ZQs/\002\353Q5`*\207\346J\250*5\022\014\374\202(\002\220\353U\210\312L \305\"C\240a\0333\211\270\024\030\324\271p\207[0\361uf\264g\211\247X\216P\212A\216\231\223\350\242&\024<\345\316\224.\262%]\244\322\047\\\214\376\354\311\"\361\036\221\300XQx\204\"\203&\367\003\217\371L\000H\331\354;\250\217\036\242\356H\3173\236I\241r\244\350P\256H\321cL\230\267\353p\225RTH\200\263D\264\027!\214CF\265\3030FT\333x\204\024\327\000\336uN<\340:\\\360\010c\241\375\240\232\303\216\014Y\316\007=N\302\220TQ\211p/\305\020\334\200\304\366\212i\237D\345\003\022A\010 i\365\203\023\2200\342\306S\010&\027T+\332\272f\004\211\347I\007\362\214\3223(\211H\356\020nZ2&\347i\265\252\\~ijnnJ\372\376\214\347\361@q\265\304\3264\023\0163\275\223\353\266\021\306\205j\005\376\323PCx\236U\242\337X\t\343V\236\001\t\210\332TB\227p\031\270\312|\263A\215\016\374JZ8f\005\226jk\245\021\032\312\344\313\256\222j\317\362\004\361\323\325\034\2171\004\214\2352sV\225\366\323\257\226\025C\232*M)-\002\356\254\202\205\031\321\226[\217\014\022\306\306\232&^\333l;\211\035\312\261\215\323\263\301*\346\003\252\272\343\212\352q\275Cw\365\"\246L,\\\231tJ\r\355\303\240\244\332\360\343\242.\225\240\035\225M\022QU\341p\231\353H\252\"Qi/LseG\2230\243\351g\342\261p\225\213""\207`\303\333W\320\007K\377d\251\303$\034\307\003\0070$\000\346\214\303\212\304Yu|\246\312\016\024\006x\262\316\302\250\260\362h\256\320\256\277eY\2601;R\213hOYRw^\3730s\200\304\252\323\206\256=\215\272\230\312\022\226\245\222\201\256\313\306rC0J{\024\2607\352R\233R\2002\235\354\214\272\354h\323\206\273p\270]\226\266\372\003p\225\222\260z\214\215\275\202\307\233;\321\314Q\352\200\031\205\351\242};\227Y\030\312\260\004\355nr_\362\210\253`\326\303\020hM|N\341&a\025\373z\000\022\246\243T\372\372\223\275\226\\\370\244b1\025\214\273\345\242\014\025\334)\277\220\220>\344>\217\2006\227\213\271T\304\364\302,\206:\3040K\034f&\266\335i\371j\351\216\243\342!\251\262P-\224\026 \357\036\t\304R\0005a:\000n5_\200\265\243\2037\334#\"\027\201\235t\220M0\267\332\251\231\231\324\005\325\331\230\007\023\373\276fC\351/\263\310eb\026\240:\214\031r\"\\\217\245l\031\264&fk\301f\276\255\265\353\377h\347;\"\307\225iW\010\262\005)\202\2524^t\267\367\024q\310\\\256\340\322\005K\255\333\303\216`\223>\230\035!\014\020\026\250H\302?\324p\005wTm\367\301$\003\244t\000\323\234\301\225\257\231\252\334^X\376\353\345\337\233}I\346\374\326\300\226\250\347\353x;\237d\316nF[\267k\213\265\327\215\276\344\334\347\265\233\365\361F6\311|\337\030iLo\367%\203\243\315\341\235\376dp(\031\274\262\235\256CI\346Lr\356\243\255\313\265lm\254~\261\276\322\3106\2567\364\366L\263\277\273=Pg\215;q\356\301\233\2417z7\177Z\361{;\372\315\314n\377i\305\177\335\275\021\027V\342\225\307\357h\377\224\030\0145\026\033t;{\010\006\357\035\000\027k\371\332r\275?\031\370\272\236M\006\276x\377\002\374\262\266V\317\324\363\311\245o\353\213\311\245\257z\002\034\257\017\202\352Hcf{`\2335GN\n\360$\361}\001\236$~ \300S\332\337\354{\2737\300\377}\302\376\371\354\2033Y\350\277\3147\220\246\314w\365\265$3\326$\315hg$\031\237\330\311\047\343\223\361\344\213\370\305\037\226\3001~\225\214\337\354yz\271\363\273\304\256\317\342g\317\223\314\205\255|r\341cx\340\014t\340\214\263\233\033[N\r\374\372dk\243F\222\363\237\326>\254\215\264\276\336\236""\273\321\\l\322\235l2v\007\334\030\273\033\337}\032?\375}/\361<~\376\242\207\030o?\260S\214\213\216%\226\343\345\025K\274\212_\221d\354~|\377I\374\344\351\251]\033i\3667\007\233$\031\035o\256%\243\267\342[V\333\020\326\260!l\250]\326O\355\007v^\306/\261%\nqa\321\022\026\250\321\211xb)^Z\356\204|\340\024\013\362\236Sl@\377\351\224\267\007\315w\254v\210NX\357\036D\027\312\177\001o\\Tt";
29706 PyObject *data = __Pyx_DecompressString(cstring, 1516, 1);
29707 #define __Pyx_DecompressString_LZSS_UNUSED
29708 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
29709 const char* const bytes = __Pyx_PyBytes_AsString(data);
29710 #if !CYTHON_ASSUME_SAFE_MACROS
29711 if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
29712 #endif
29713 #elif (CYTHON_COMPRESS_STRINGS) > 0 && (CYTHON_COMPRESS_STRINGS) <= 90 /* compression: lzss (1947 bytes) */
29714static const char cstring[] = "\377 at 0x o\377bject>()\377,.: <Mem\377oryView \377of <cont\377iguous a?nd dir(\001\007\r\373in\021\005strid{ed\"\010 or \004\031\363><(\tA\006>?Ca\377nnot ass\377ign to r\377ead-only\353 m\240\002v\242\000Inv\377alid mod?e, exp\310\000|\000\367\047c\047t\001\047for\377tran\047, g|H\000%\005shape\222\000\377 axis No\337te th\212 Cy\337thon \021\000de\377liberate\274k\000\320\001cter!\001n\377 PEP-484\366\212\"re\267!s su\267bcl\246\000es\261!b\337uilti\260\000yp\377es. If y\237ou ne\224 \303\000p\374\316\000%\tthen s\273et\200\000e \047\357\002a\377tion_typoing\047\355$iv\242\000\377o False.\257add_\231 ef\001d\357Quad\247\000icC\377ubeSubdo\377main2Glo\277balMapB\001s\357_1d \312!imp\377lemented\353!!\024(2,\020col\371l\267`\251\000s.abc\377disablee\275n\002\001gcis\004\003d\377no defau\377lt __red\377uce__ du\336\313\002non-\260`vi\373al\033\000cinit\377__numpy.\177_core.m5\000\377iarray f\207ail\276#\303\000\326@\033\tuomath\021\016pr\331@\377us/cpart\371i\322!\317 .pyxu|\240\002\321aalloc\345@} ^\003data.\013\020\370\255c\377\204\001\334\204\003s.ASC\377IICommEl\377lipsisSe\277quence\270\205\001.\276\275\205\007__Pyx\001\000D\377ict_Next\237Ref__\341D\207 _m_\266b__\001\005ge\250\000\313em\r\001d0\001\027\000fu\363nc\035\001\030\000stat\3401\002\376\0033\001\353A\003\002odu\335lM\002nam\002\003ew\374T\001\356\000_check\003suT\000\n\001?\004\025\001\344`\215@~\037\001unpick?\000\233En \005vt\317A\230\001qGualO\005\275E\306Fc\264\205\002\354\277\001\331Dex\314\001set\035_\203\005set\262\006\003\006.\007wtes\366@_is\362A?outine\320`\225E\377_buffera\375s\204basynci\363o.\235`$\003sbas\256\206\205\003Dis\255\210\002n\256\210\001G\377alerkinL\302\336@l\201\205\014\250\205\017\004\0374\021cc\375l\250\000_in_tr\377acebackc\337meshc\226`co\377nvertPUM\273IP\370eToP\340\207\002c\357ount\212\204\ndgN\377umbering\353_s\275\206\006g\301\206\002dg_\177dof_off\303!\376\025\007_ownedd>&\010_l2gd\316B\310 \236\324\212\003edgeA\027\032\001O\352B\023e\244\207\003B\250\000dar""\301y)\030\033\0131\033&\036v\025nc\177odeenum\223\212\002\377errorfil\376\360 seflags\277format\353\212\004i\277dindex\000\002B\276\233`items\000\002i\377zejoinma\375x\317\"neighb\377orsmemHa\377rdLimitm\363em\331\213\001\321\213\001nDOF\377_all_pro?cesses\r\002\225$\374\031\002\245FnLayer\357sOfO\365@lap\347nSp\221`\211\206\001ndi\217mnod\3558\032\001\3614n]p\214\211\002objL\000k\302\210\006\365E\303\212\003s\323\210\006Node\376\000\013sFromTe\177tgenFil\010\022\177riangle\031\003Sop\253\211\004\262\211\004_\334\210\001q\330\213\005\240\206\204\027\032\006\213\204\031\033\007\253@rs\000e\360\254\0022\007\355\204\006\301\204\001regi\233st\313 et\267\213\004\261\216\002s\276\274@start\031\000p\367sto\001\000ruct\3541\007\371\205\002un\246!upd\377atevalue\377sx:OT{^}\377\200\001\330\004\t\210\025\210\377n\230A\230_\250A\330\377\004\007\200t\210:\220Q\377\220j\240\001\330\010\023\220\3778\2307\240!\330\004#\377\2401\240D\250\001\330$\3772\260\047\270\021\330$%\357\330$)\250\002\003%\330\004\377\005\330\010\n\210(\220!\377\2206\230\024\230U\240!\377\2404\240u\250E\260\021\376\r\007\025\230e\240;\320.\177B\300%\300u\310A\007%\177?\270u\300E\310\0216%\377K\3105\320PU\320U\371V1,\335\200$%\240Q\240d\363\250!\361\0200\316\024\220A\220\377T\230\021\330\025\032\230!\367\330\025\026\220\201\317\027\220q\230\377\004\230A\330\030\035\230Q\367\330\030\031\270\204\0107\230$\230\377e\2401\240E\250\025\250\007e\2601\243\204\035\017\035\264\204\014>\035\262\204\016\3169$\200\001\340\271\206\013\322\204\276\360\022\377\000\005!\240\001\330\004\034\376\244@\004\037\230q\330\0046\377\260a\260t\2701\3307\377<\270A\3307>\320>\357\\\320\\]\004\002_\320_\217`\33078\000\000\000\003\020\013N\373\310a*\002Z\320Z[\330\177\004\014\210A\330\014\r\000\000\357\200\001\360 S\016\007\200w\377\210c\220\021\330\010\017\210\377w\220a\330\t\020\220\003\373\2201\007\004\340\0105\260Q\177\260d\270!\3306;\204\000\3776=\320=X\320XY\371\330\000\006\016\001[\320[\\\330\216\000\00667\330\000\000\002\001*\000b""\367\320bc(\002T\320TU\3761\002`\320`a\3306@\277\320@W\320WXr&1\377\260\021\260$\260a\3302\3777\260q\33029\3209\3009\002\005\001T\002\016\001\346\002\021\0073\330\3652\000\0003(\002^\320^_\2361\002P\320PQ:\002\302\"2\177<\320<S\320ST\352\006`U\016\340\"Y\n\314\00212\340\010\264\016\000\263\006\274\006\316\006\332\003\231\200)\334G";
29715 PyObject *data = __Pyx_DecompressString_LZSS(cstring, 1947, 4052);
29716 #define __Pyx_DecompressString_UNUSED
29717 if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
29718 const char* const bytes = __Pyx_PyBytes_AsString(data);
29719 #if !CYTHON_ASSUME_SAFE_MACROS
29720 if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
29721 #endif
29722 #else /* compression: none (4052 bytes) */
29723static const char bytes[] = " at 0x object>(),.: <MemoryView of <contiguous and direct><contiguous and indirect><strided and direct or indirect><strided and direct><strided and indirect>>?Cannot assign to read-only memoryviewInvalid mode, expected \047c\047 or \047fortran\047, got Invalid shape in axis Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the \047annotation_typing\047 directive to False.add_notebuildQuadraticCubeSubdomain2GlobalMappings_1d not implemented!!buildQuadraticCubeSubdomain2GlobalMappings_2d not implemented!!collections.abcdisableenablegcisenabledno default __reduce__ due to non-trivial __cinit__numpy._core.multiarray failed to importnumpy._core.umath failed to importproteus/cpartitioning.pyxunable to allocate array data.unable to allocate shape and strides.ASCIICommEllipsisSequenceView.MemoryView__Pyx_PyDict_NextRef__annotate____class____class_getitem____dict____func____getstate____import____main____module____name____new____pyx_checksum__pyx_state__pyx_type__pyx_unpickle_Enum__pyx_vtable____qualname____reduce____reduce_cython____reduce_ex____set_name____setstate____setstate_cython____test___is_coroutineabcallocate_bufferasarrayasyncio.coroutinesbasebuildDiscontinuousGalerkinLocal2GlobalMappingsbuildQuadraticCubeLocal2GlobalMappingsbuildQuadraticLocal2GlobalMappingsccline_in_tracebackcmeshcommconvertPUMIPartitionToPythoncountcpartitioningdgNumbering_subdomain2globaldg_dof_offsets_subdomain_owneddg_subdomain_l2gdtype_is_objectedgeNumbering_subdomain2globaledgeOffsets_subdomain_ownedelementBoundaryNumbering_subdomain2globalelementBoundaryOffsets_subdomain_ownedelementNumbering_subdomain2globalelementOffsets_subdomain_ownedencodeenumerateerrorfilebaseflagsformatfortranidindexindexBaseitemsitemsizejoinmax_dof_neighborsmemHardLimitmemviewmodenDOF_all_processesnDOF_elementnDOF_subdomainnLayersOfOverlapnSpacenamendimnodeNumbering_subdomain2globalnodeOffsets_subdomain_ownednpnumpyobjpackpartitio""nElementspartitionNodespartitionNodesFromTetgenFilespartitionNodesFromTriangleFilespopproteusproteus_CommquadraticNumbering_subdomain2globalquadratic_dof_offsets_subdomain_ownedquadratic_lagrangeNodesquadratic_subdomain_l2gregistersetdefaultshapesizestartstepstopstructsubdomain_cmeshunpackupdatevaluesx:OT{^}\200\001\330\004\t\210\025\210n\230A\230_\250A\330\004\007\200t\210:\220Q\220j\240\001\330\010\023\2208\2307\240!\330\004#\2401\240D\250\001\330$2\260\047\270\021\330$%\330$)\250\021\330$%\330$%\330\004\005\330\010\n\210(\220!\2206\230\024\230U\240!\2404\240u\250E\260\021\330\010\n\210(\220!\2206\230\025\230e\240;\320.B\300%\300u\310A\330\010\n\210(\220!\2206\230\024\230U\240!\2404\240u\250E\260\021\330\010\n\210(\220!\2206\230\025\230e\240;\320.?\270u\300E\310\021\330\010\n\210(\220!\2206\230\024\230U\240!\2404\240u\250E\260\021\330\010\n\210(\220!\2206\230\025\230e\240;\320.K\3105\320PU\320UV\330\010\n\210(\220!\2206\230\024\230U\240!\2404\240u\250E\260\021\330\010\n\210(\220!\2206\230\025\230e\240;\320.?\270u\300E\310\021\200\001\330\004\t\210\025\210n\230A\230_\250A\330\004\007\200t\210:\220Q\220j\240\001\330\010\023\2208\2307\240!\330\004%\240Q\240d\250!\330$2\260\047\270\021\330$%\330$)\250\021\330$%\330\004\005\330\010\n\210(\220!\2206\230\024\230U\240!\2404\240u\250E\260\021\330\010\n\210(\220!\2206\230\025\230e\240;\320.B\300%\300u\310A\330\010\n\210(\220!\2206\230\024\230U\240!\2404\240u\250E\260\021\330\010\n\210(\220!\2206\230\025\230e\240;\320.?\270u\300E\310\021\330\010\n\210(\220!\2206\230\024\230U\240!\2404\240u\250E\260\021\330\010\n\210(\220!\2206\230\025\230e\240;\320.K\3105\320PU\320UV\330\010\n\210(\220!\2206\230\024\230U\240!\2404\240u\250E\260\021\330\010\n\210(\220!\2206\230\025\230e\240;\320.?\270u\300E\310\021\200\001\330\004\t\210\025\210n\230A\230_\250A\330\004\024\220A\220T\230\021\330\025\032\230!\330\025\026\330\004\005\330\010\n\210(\220!\2206\230\024\230U\240!\2404\240u\250E\260\021\330\010\n\210(\220!\2206\230\025\230e\240;\320.B""\300%\300u\310A\330\010\n\210(\220!\2206\230\024\230U\240!\2404\240u\250E\260\021\330\010\n\210(\220!\2206\230\025\230e\240;\320.?\270u\300E\310\021\330\010\n\210(\220!\2206\230\024\230U\240!\2404\240u\250E\260\021\330\010\n\210(\220!\2206\230\025\230e\240;\320.K\3105\320PU\320UV\330\010\n\210(\220!\2206\230\024\230U\240!\2404\240u\250E\260\021\330\010\n\210(\220!\2206\230\025\230e\240;\320.?\270u\300E\310\021\200\001\330\004\t\210\025\210n\230A\230_\250A\330\004\027\220q\230\004\230A\330\030\035\230Q\330\030\031\330\004\005\330\010\n\210(\220!\2207\230$\230e\2401\240E\250\025\250e\2601\330\010\n\210(\220!\2206\230\025\230e\240;\320.B\300%\300u\310A\330\010\n\210(\220!\2207\230$\230e\2401\240E\250\025\250e\2601\330\010\n\210(\220!\2206\230\025\230e\240;\320.?\270u\300E\310\021\330\010\n\210(\220!\2207\230$\230e\2401\240E\250\025\250e\2601\330\010\n\210(\220!\2206\230\025\230e\240;\320.K\3105\320PU\320UV\330\010\n\210(\220!\2207\230$\230e\2401\240E\250\025\250e\2601\330\010\n\210(\220!\2206\230\025\230e\240;\320.?\270u\300E\310\021\200\001\340\004\t\210\025\210n\230A\230_\250A\330\004\005\330\010\n\210(\220!\2206\230\024\230U\240!\2404\240u\250E\260\021\330\010\n\210(\220!\2206\230\025\230e\240;\320.B\300%\300u\310A\330\010\n\210(\220!\2206\230\024\230U\240!\2404\240u\250E\260\021\330\010\n\210(\220!\2206\230\025\230e\240;\320.?\270u\300E\310\021\330\010\n\210(\220!\2206\230\024\230U\240!\2404\240u\250E\260\021\330\010\n\210(\220!\2206\230\025\230e\240;\320.K\3105\320PU\320UV\330\010\n\210(\220!\2206\230\024\230U\240!\2404\240u\250E\260\021\330\010\n\210(\220!\2206\230\025\230e\240;\320.?\270u\300E\310\021\200\001\360\022\000\005!\240\001\330\004\034\230A\330\004\037\230q\330\0046\260a\260t\2701\3307<\270A\3307>\320>\\\320\\]\3307>\320>_\320_`\33078\33078\33078\33078\3307>\320>\\\320\\]\3307>\320>N\310a\3307>\320>Z\320Z[\330\004\014\210A\330\014\r\330\014\r\200\001\360 \000\005!\240\001\330\004\034\230A\330\004\037\230q\330\004\007\200w\210c\220\021\330\010\017\210w""\220a\330\t\020\220\003\2201\330\010\017\210w\220a\340\0105\260Q\260d\270!\3306;\2701\3306=\320=X\320XY\3306=\320=X\320XY\3306=\320=[\320[\\\3306=\320=[\320[\\\33067\33067\33067\3306=\320=b\320bc\3306=\320=T\320TU\3306=\320=`\320`a\3306@\320@W\320WX\330\004\014\210A\330\014\r\330\014\r\200\001\360 \000\005!\240\001\330\004\034\230A\330\004\037\230q\330\004\007\200w\210c\220\021\330\0101\260\021\260$\260a\33027\260q\33029\3209W\320WX\33029\3209T\320TU\33029\3209Z\320Z[\33029\3209W\320WX\33023\33023\33023\33029\3209^\320^_\33029\3209P\320PQ\33029\3209\\\320\\]\3302<\320<S\320ST\330\t\020\220\003\2201\330\0101\260\021\260$\260a\33027\260q\33029\3209_\320_`\33029\3209T\320TU\33029\3209b\320bc\33029\3209W\320WX\33023\33023\33023\33029\3209^\320^_\33029\3209P\320PQ\33029\3209\\\320\\]\3302<\320<S\320ST\340\0101\260\021\260$\260a\33027\260q\33029\3209T\320TU\33029\3209T\320TU\33029\3209W\320WX\33029\3209W\320WX\33023\33023\33023\33029\3209^\320^_\33029\3209P\320PQ\33029\3209\\\320\\]\3302<\320<S\320ST\330\004\014\210A\330\014\r\330\014\r";
29724 PyObject *data = NULL;
29725 #define __Pyx_DecompressString_UNUSED
29726 #define __Pyx_DecompressString_LZSS_UNUSED
29727 #endif
29728 PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
29729 Py_ssize_t pos = 0;
29730 for (int i = 0; i < 143; i++) {
29731 Py_ssize_t bytes_length = str_length_index[i].length;
29732 PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
29733 if (likely(string) && i >= 33) PyUnicode_InternInPlace(&string);
29734 if (unlikely(!string)) {
29735 Py_XDECREF(data);
29736 __PYX_ERR(0, 1, __pyx_L1_error)
29737 }
29738 stringtab[i] = string;
29739 pos += bytes_length;
29740 }
29741 for (int i = 143; i < 157; i++) {
29742 Py_ssize_t bytes_length = bytes_length_index[i-143].length;
29743 PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length);
29744 stringtab[i] = string;
29745 pos += bytes_length;
29746 if (unlikely(!string)) {
29747 Py_XDECREF(data);
29748 __PYX_ERR(0, 1, __pyx_L1_error)
29749 }
29750 }
29751 Py_XDECREF(data);
29752 for (Py_ssize_t i = 0; i < 157; i++) {
29753 if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
29754 __PYX_ERR(0, 1, __pyx_L1_error)
29755 }
29756 }
29757 #if CYTHON_IMMORTAL_CONSTANTS
29758 {
29759 PyObject **table = stringtab + 143;
29760 for (Py_ssize_t i=0; i<14; ++i) {
29761 #if PY_VERSION_HEX >= 0x030F0000
29762 PyUnstable_SetImmortal(table[i]);
29763 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
29764 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
29765 #if PY_VERSION_HEX < 0x030E0000
29766 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
29767 #else
29768 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
29769 #endif
29770 {
29771 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
29772 }
29773 #else
29774 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
29775 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
29776 #endif
29777 }
29778 }
29779 #endif
29780 }
29781 {
29782 PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 0;
29783 int8_t const cint_constants_1[] = {0,-1,1};
29784 int32_t const cint_constants_4[] = {136983863L};
29785 for (int i = 0; i < 4; i++) {
29786 numbertab[i] = PyLong_FromLong((i < 3 ? cint_constants_1[i - 0] : cint_constants_4[i - 3]));
29787 if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
29788 }
29789 }
29790 #if CYTHON_IMMORTAL_CONSTANTS
29791 {
29792 PyObject **table = __pyx_mstate->__pyx_number_tab;
29793 for (Py_ssize_t i=0; i<4; ++i) {
29794 #if PY_VERSION_HEX >= 0x030F0000
29795 PyUnstable_SetImmortal(table[i]);
29796 #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
29797 if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
29798 #if PY_VERSION_HEX < 0x030E0000
29799 if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
29800 #else
29801 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
29802 #endif
29803 {
29804 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
29805 }
29806 #else
29807 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
29808 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
29809 #endif
29810 }
29811 }
29812 #endif
29813 return 0;
29814 __pyx_L1_error:;
29815 return -1;
29816}
29817/* #### Code section: init_codeobjects ### */
29818#ifdef __cplusplus
29819namespace {
29820#endif
29821typedef struct {
29822 unsigned int argcount : 5;
29823 unsigned int num_posonly_args : 1;
29824 unsigned int num_kwonly_args : 1;
29825 unsigned int nlocals : 5;
29826 unsigned int flags : 10;
29827 unsigned int first_line : 8;
29828} __Pyx_PyCode_New_function_description;
29829#ifdef __cplusplus
29830} /* anonymous namespace */
29831#endif
29832/* NewCodeObj.proto */
29833static PyObject* __Pyx_PyCode_New(
29834 const __Pyx_PyCode_New_function_description descr,
29835 PyObject * const *varnames,
29836 PyObject *filename,
29837 PyObject *funcname,
29838 PyObject *line_table,
29839 PyObject *tuple_dedup_map
29840);
29841
29842
29843static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
29844 PyObject* tuple_dedup_map = PyDict_New();
29845 if (unlikely(!tuple_dedup_map)) return -1;
29846 {
29847 const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 36};
29848 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_nLayersOfOverlap, __pyx_mstate->__pyx_n_u_cmesh, __pyx_mstate->__pyx_n_u_subdomain_cmesh};
29849 __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_cpartitioning_pyx, __pyx_mstate->__pyx_n_u_partitionElements, __pyx_mstate->__pyx_kp_b_iso88591_nA_A_q_A_Q_7_e1E_e1_6_e_B_uA_7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad;
29850 }
29851 {
29852 const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 52};
29853 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_nLayersOfOverlap, __pyx_mstate->__pyx_n_u_cmesh, __pyx_mstate->__pyx_n_u_subdomain_cmesh};
29854 __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_cpartitioning_pyx, __pyx_mstate->__pyx_n_u_partitionNodes, __pyx_mstate->__pyx_kp_b_iso88591_nA_A_AT_6_U_4uE_6_e_B_uA_6_U_4u, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad;
29855 }
29856 {
29857 const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 68};
29858 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_cmesh, __pyx_mstate->__pyx_n_u_subdomain_cmesh};
29859 __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_cpartitioning_pyx, __pyx_mstate->__pyx_n_u_convertPUMIPartitionToPython, __pyx_mstate->__pyx_kp_b_iso88591_nA_A_6_U_4uE_6_e_B_uA_6_U_4uE_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad;
29860 }
29861 {
29862 const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 82};
29863 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_filebase, __pyx_mstate->__pyx_n_u_indexBase, __pyx_mstate->__pyx_n_u_nLayersOfOverlap, __pyx_mstate->__pyx_n_u_cmesh, __pyx_mstate->__pyx_n_u_subdomain_cmesh, __pyx_mstate->__pyx_n_u_memHardLimit};
29864 __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_cpartitioning_pyx, __pyx_mstate->__pyx_n_u_partitionNodesFromTetgenFiles, __pyx_mstate->__pyx_kp_b_iso88591_nA_A_t_Qj_87_1D_2_6_U_4uE_6_e_B, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad;
29865 }
29866 {
29867 const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 103};
29868 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_filebase, __pyx_mstate->__pyx_n_u_indexBase, __pyx_mstate->__pyx_n_u_nLayersOfOverlap, __pyx_mstate->__pyx_n_u_cmesh, __pyx_mstate->__pyx_n_u_subdomain_cmesh};
29869 __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_cpartitioning_pyx, __pyx_mstate->__pyx_n_u_partitionNodesFromTriangleFiles, __pyx_mstate->__pyx_kp_b_iso88591_nA_A_t_Qj_87_Qd_2_6_U_4uE_6_e_B, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad;
29870 }
29871 {
29872 const __Pyx_PyCode_New_function_description descr = {16, 0, 0, 19, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 123};
29873 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_nSpace, __pyx_mstate->__pyx_n_u_cmesh, __pyx_mstate->__pyx_n_u_subdomain_cmesh, __pyx_mstate->__pyx_n_u_elementOffsets_subdomain_owned, __pyx_mstate->__pyx_n_u_nodeOffsets_subdomain_owned, __pyx_mstate->__pyx_n_u_elementBoundaryOffsets_subdomain, __pyx_mstate->__pyx_n_u_edgeOffsets_subdomain_owned, __pyx_mstate->__pyx_n_u_elementNumbering_subdomain2globa, __pyx_mstate->__pyx_n_u_nodeNumbering_subdomain2global, __pyx_mstate->__pyx_n_u_elementBoundaryNumbering_subdoma, __pyx_mstate->__pyx_n_u_edgeNumbering_subdomain2global, __pyx_mstate->__pyx_n_u_quadratic_dof_offsets_subdomain, __pyx_mstate->__pyx_n_u_quadratic_subdomain_l2g, __pyx_mstate->__pyx_n_u_quadraticNumbering_subdomain2glo, __pyx_mstate->__pyx_n_u_quadratic_lagrangeNodes, __pyx_mstate->__pyx_n_u_nDOF_all_processes, __pyx_mstate->__pyx_n_u_nDOF_subdomain, __pyx_mstate->__pyx_n_u_max_dof_neighbors};
29874 __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_cpartitioning_pyx, __pyx_mstate->__pyx_n_u_buildQuadraticLocal2GlobalMappin, __pyx_mstate->__pyx_kp_b_iso88591_A_q_wc_1_a27q299WWX299TTU299ZZ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad;
29875 }
29876 {
29877 const __Pyx_PyCode_New_function_description descr = {16, 0, 0, 19, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 188};
29878 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_nSpace, __pyx_mstate->__pyx_n_u_cmesh, __pyx_mstate->__pyx_n_u_subdomain_cmesh, __pyx_mstate->__pyx_n_u_elementOffsets_subdomain_owned, __pyx_mstate->__pyx_n_u_nodeOffsets_subdomain_owned, __pyx_mstate->__pyx_n_u_elementBoundaryOffsets_subdomain, __pyx_mstate->__pyx_n_u_edgeOffsets_subdomain_owned, __pyx_mstate->__pyx_n_u_elementNumbering_subdomain2globa, __pyx_mstate->__pyx_n_u_nodeNumbering_subdomain2global, __pyx_mstate->__pyx_n_u_elementBoundaryNumbering_subdoma, __pyx_mstate->__pyx_n_u_edgeNumbering_subdomain2global, __pyx_mstate->__pyx_n_u_quadratic_dof_offsets_subdomain, __pyx_mstate->__pyx_n_u_quadratic_subdomain_l2g, __pyx_mstate->__pyx_n_u_quadraticNumbering_subdomain2glo, __pyx_mstate->__pyx_n_u_quadratic_lagrangeNodes, __pyx_mstate->__pyx_n_u_nDOF_all_processes, __pyx_mstate->__pyx_n_u_nDOF_subdomain, __pyx_mstate->__pyx_n_u_max_dof_neighbors};
29879 __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_cpartitioning_pyx, __pyx_mstate->__pyx_n_u_buildQuadraticCubeLocal2GlobalMa, __pyx_mstate->__pyx_kp_b_iso88591_A_q_wc_wa_1_wa_5Qd_6_16_XXY6_XX, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad;
29880 }
29881 {
29882 const __Pyx_PyCode_New_function_description descr = {9, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 229};
29883 PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_nDOF_element, __pyx_mstate->__pyx_n_u_cmesh, __pyx_mstate->__pyx_n_u_subdomain_cmesh, __pyx_mstate->__pyx_n_u_elementOffsets_subdomain_owned, __pyx_mstate->__pyx_n_u_elementNumbering_subdomain2globa, __pyx_mstate->__pyx_n_u_dg_dof_offsets_subdomain_owned, __pyx_mstate->__pyx_n_u_dg_subdomain_l2g, __pyx_mstate->__pyx_n_u_dgNumbering_subdomain2global, __pyx_mstate->__pyx_n_u_nDOF_all_processes, __pyx_mstate->__pyx_n_u_nDOF_subdomain, __pyx_mstate->__pyx_n_u_max_dof_neighbors};
29884 __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_proteus_cpartitioning_pyx, __pyx_mstate->__pyx_n_u_buildDiscontinuousGalerkinLocal2, __pyx_mstate->__pyx_kp_b_iso88591_A_q_6at17_A7_7____787878787_7_N, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad;
29885 }
29886 Py_DECREF(tuple_dedup_map);
29887 return 0;
29888 bad:
29889 Py_DECREF(tuple_dedup_map);
29890 return -1;
29891}
29892/* #### Code section: init_globals ### */
29893
29894static int __Pyx_InitGlobals(void) {
29895 int __pyx_lineno = 0;
29896 const char *__pyx_filename = NULL;
29897 int __pyx_clineno = 0;
29898 /* PythonCompatibility.init */
29899 if (likely(__Pyx_init_co_variables() == 0 && __Pyx_init_tpflags_variables() == 0)); else
29900
29901 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
29902
29903 /* PyFrozenDict.init */
29904 #if CYTHON_COMPILING_IN_LIMITED_API
29905 {
29906 PyObject *builtins = PyEval_GetBuiltins(); // borrowed
29907 if (likely(builtins)) {
29908 PyObject *type_name = PyUnicode_FromStringAndSize("frozendict", sizeof("frozendict")-1);
29909 if (likely(type_name)) {
29910 PyObject *frozendict_type = PyObject_GetItem(builtins, type_name);
29911 Py_DECREF(type_name);
29912 if (!frozendict_type && PyErr_ExceptionMatches(PyExc_KeyError)) {
29913 PyErr_Clear();
29914 frozendict_type = (PyObject*) &PyDict_Type;
29915 Py_INCREF(frozendict_type);
29916 }
29917 __pyx_mstate_global->__Pyx_PyFrozenDictType = frozendict_type;
29918 }
29919 }
29920 } // error handling follows
29921 #endif
29922
29923 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
29924
29925 /* AssertionsEnabled.init */
29926 if (likely(__Pyx_init_assertions_enabled() == 0)); else
29927
29928 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
29929
29930 /* NumpyImportArray.init */
29931 /*
29932 * Cython has automatically inserted a call to _import_array since
29933 * you didn't include one when you cimported numpy. To disable this
29934 * add the line
29935 * <void>numpy._import_array
29936 */
29937 #ifdef NPY_FEATURE_VERSION
29938 #ifndef NO_IMPORT_ARRAY
29939 if (unlikely(_import_array() == -1)) {
29940 PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import "
29941 "(auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; "
29942 "use '<void>numpy._import_array' to disable if you are certain you don't need it).");
29943 }
29944 #endif
29945 #endif
29946
29947 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
29948
29949 /* CommonTypesMetaclass.init */
29950 if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else
29951
29952 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
29953
29954 /* CachedMethodType.init */
29955 #if CYTHON_COMPILING_IN_LIMITED_API
29956 {
29957 PyObject *typesModule=NULL;
29958 typesModule = PyImport_ImportModule("types");
29959 if (typesModule) {
29960 __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType");
29961 Py_DECREF(typesModule);
29962 }
29963 } // error handling follows
29964 #endif
29965
29966 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
29967
29968 return 0;
29969 __pyx_L1_error:;
29970 return -1;
29971}
29972/* #### Code section: init_after_shared_utility ### */
29973
29974static int __Pyx_InitAfterSharedUtility(void) {
29975 int __pyx_lineno = 0;
29976 const char *__pyx_filename = NULL;
29977 int __pyx_clineno = 0;
29978 /* CythonFunctionPerModule.init */
29979 if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else
29980
29981 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
29982
29983 return 0;
29984 __pyx_L1_error:;
29985 return -1;
29986}
29987/* #### Code section: cleanup_globals ### */
29988/* #### Code section: cleanup_module ### */
29989/* #### Code section: main_method ### */
29990/* #### Code section: utility_code_pragmas ### */
29991#ifdef _MSC_VER
29992#pragma warning( push )
29993/* Warning 4127: conditional expression is constant
29994 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
29995 * compile-time, so this warning is not useful
29996 */
29997#pragma warning( disable : 4127 )
29998#endif
29999
30000
30001
30002/* #### Code section: utility_code_def ### */
30003
30004/* --- Runtime support code --- */
30005/* Refnanny */
30006#if CYTHON_REFNANNY
30007static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
30008 PyObject *m = NULL, *p = NULL;
30009 void *r = NULL;
30010 m = PyImport_ImportModule(modname);
30011 if (!m) goto end;
30012 p = PyObject_GetAttrString(m, "RefNannyAPI");
30013 if (!p) goto end;
30014 r = PyLong_AsVoidPtr(p);
30015end:
30016 Py_XDECREF(p);
30017 Py_XDECREF(m);
30018 return (__Pyx_RefNannyAPIStruct *)r;
30019}
30020#endif
30021
30022/* CopyObjectArray (used by TupleOrListFromArrayImpl) */
30023#if CYTHON_COMPILING_IN_CPYTHON
30024static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
30025 PyObject *v;
30026 Py_ssize_t i;
30027 for (i = 0; i < length; i++) {
30028 v = dest[i] = src[i];
30029 Py_INCREF(v);
30030 }
30031}
30032#endif
30033
30034/* TupleOrListFromArrayImpl (used by TupleFromArray) */
30035#if !(PY_VERSION_HEX >= 0x030F0000 && !CYTHON_COMPILING_IN_LIMITED_API)
30036CYTHON_UNUSED static PyObject *
30037__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) {
30038 if (n <= 0) {
30039 return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
30040 }
30041 PyObject *res = PyTuple_New(n);
30042 if (unlikely(res == NULL)) return NULL;
30043 #if CYTHON_COMPILING_IN_CPYTHON
30044 __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
30045 #else
30046 Py_ssize_t i;
30047 for (i = 0; i < n; i++) {
30048 Py_INCREF(src[i]);
30049 if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
30050 Py_DECREF(res);
30051 return NULL;
30052 }
30053 }
30054 #endif
30055 return res;
30056}
30057#endif
30058
30059/* PyObjectCompare (used by UnicodeEquals) */
30060#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
30061#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
30062static CYTHON_INLINE int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
30063 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
30064 int result = PyUnicode_Equal(s1, s2);
30065 #if !CYTHON_COMPILING_IN_CPYTHON
30066 if (unlikely(result == -1)) return -1;
30067 #endif
30068 if (result == 0) goto __pyx_return_false; else goto __pyx_return_true;
30069 #else
30070 int result = PyUnicode_Compare(s1, s2);
30071 if (unlikely((result == -1) && PyErr_Occurred())) return -1;
30072 if (result == 0) goto __pyx_return_true; else goto __pyx_return_false;
30073 #endif
30074__pyx_return_true:
30075 return 1;
30076__pyx_return_false:
30077 return 0;
30078}
30079#endif
30080static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2, int pyop) {
30081 CYTHON_UNUSED_VAR(pyop);
30082 if (unlikely(op1 == Py_None)) {
30083 if (op2 == Py_None) goto __pyx_return_true; else goto __pyx_return_false;
30084 }
30085 if (unlikely(op2 == Py_None)) {
30086 if (op1 == Py_None) goto __pyx_return_true; else goto __pyx_return_false;
30087 }
30088
30089 if (likely(op1 != Py_None)) {
30090 if (op1 == op2) goto __pyx_return_true;
30091 if (likely(op2 != Py_None)) {
30092 return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
30093 }
30094 goto __pyx_richcmp;
30095 }
30096
30097 if ((0)) goto __pyx_richcmp;
30098 if ((0)) goto __pyx_return_true;
30099 if ((0)) goto __pyx_return_false;
30100__pyx_richcmp:
30101 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
30102__pyx_return_true:
30103 return 1;
30104__pyx_return_false:
30105 return 0;
30106}
30107
30108/* fastcall */
30109#if CYTHON_VECTORCALL
30110static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
30111{
30112 Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames);
30113 #if !CYTHON_ASSUME_SAFE_SIZE
30114 if (unlikely(n == -1)) return NULL;
30115 #endif
30116 for (i = 0; i < n; i++)
30117 {
30118 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
30119 #if !CYTHON_ASSUME_SAFE_MACROS
30120 if (unlikely(!namei)) return NULL;
30121 #endif
30122 if (s == namei) return kwvalues[i];
30123 }
30124 for (i = 0; i < n; i++)
30125 {
30126 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
30127 #if !CYTHON_ASSUME_SAFE_MACROS
30128 if (unlikely(!namei)) return NULL;
30129 #endif
30130 int eq = __Pyx_PyUnicode_Equals(s, namei);
30131 if (unlikely(eq != 0)) {
30132 if (unlikely(eq < 0)) return NULL;
30133 return kwvalues[i];
30134 }
30135 }
30136 return NULL;
30137}
30138#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL
30139CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
30140 Py_ssize_t i, nkwargs;
30141 PyObject *dict;
30142#if !CYTHON_ASSUME_SAFE_SIZE
30143 nkwargs = PyTuple_Size(kwnames);
30144 if (unlikely(nkwargs < 0)) return NULL;
30145#else
30146 nkwargs = PyTuple_GET_SIZE(kwnames);
30147#endif
30148 dict = PyDict_New();
30149 if (unlikely(!dict))
30150 return NULL;
30151 for (i=0; i<nkwargs; i++) {
30152#if !CYTHON_ASSUME_SAFE_MACROS
30153 PyObject *key = PyTuple_GetItem(kwnames, i);
30154 if (!key) goto bad;
30155#else
30156 PyObject *key = PyTuple_GET_ITEM(kwnames, i);
30157#endif
30158 if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
30159 goto bad;
30160 }
30161 return dict;
30162bad:
30163 Py_DECREF(dict);
30164 return NULL;
30165}
30166#endif
30167#endif
30168
30169/* PyObjectCall (used by PyObjectFastCall) */
30170#if CYTHON_COMPILING_IN_CPYTHON
30171static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
30172 PyObject *result;
30173 ternaryfunc call = Py_TYPE(func)->tp_call;
30174 if (unlikely(!call))
30175 return PyObject_Call(func, arg, kw);
30176 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
30177 return NULL;
30178 result = (*call)(func, arg, kw);
30179 Py_LeaveRecursiveCall();
30180 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
30181 PyErr_SetString(
30182 PyExc_SystemError,
30183 "NULL result without error in PyObject_Call");
30184 }
30185 return result;
30186}
30187#endif
30188
30189/* PyObjectCallMethO (used by PyObjectFastCall) */
30190#if CYTHON_COMPILING_IN_CPYTHON
30191static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
30192 PyObject *self, *result;
30193 PyCFunction cfunc;
30194 cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
30195 self = __Pyx_CyOrPyCFunction_GET_SELF(func);
30196 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
30197 return NULL;
30198 result = cfunc(self, arg);
30199 Py_LeaveRecursiveCall();
30200 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
30201 PyErr_SetString(
30202 PyExc_SystemError,
30203 "NULL result without error in PyObject_Call");
30204 }
30205 return result;
30206}
30207#endif
30208
30209/* PyObjectFastCall (used by PyObjectCallOneArg) */
30210#if CYTHON_COMPILING_IN_LIMITED_API
30211static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) {
30212 PyObject *argstuple;
30213 PyObject *result = 0;
30214 size_t i;
30215 argstuple = PyTuple_New((Py_ssize_t)nargs);
30216 if (unlikely(!argstuple)) return NULL;
30217 for (i = 0; i < nargs; i++) {
30218 Py_INCREF(args[i]);
30219 if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad;
30220 }
30221 result = __Pyx_PyObject_Call(func, argstuple, kwargs);
30222 bad:
30223 Py_DECREF(argstuple);
30224 return result;
30225}
30226#endif
30227#if CYTHON_VECTORCALL && !(CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY)
30228 #if CYTHON_COMPILING_IN_CPYTHON
30229static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
30230 PyTypeObject *tp = Py_TYPE(callable);
30231 #if defined(__Pyx_CyFunction_USED)
30232 if (__Pyx_CyFunction_CheckExact(callable)) {
30233 return __Pyx_CyFunction_func_vectorcall(callable);
30234 }
30235 #endif
30236 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
30237 return NULL;
30238 }
30239 assert(PyCallable_Check(callable));
30240 Py_ssize_t offset = tp->tp_vectorcall_offset;
30241 assert(offset > 0);
30242 vectorcallfunc ptr;
30243 memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
30244 return ptr;
30245}
30246 #else
30247 #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
30248 #endif
30249#endif
30250static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwargs) {
30251 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
30252#if CYTHON_COMPILING_IN_CPYTHON
30253 if (nargs == 0 && kwargs == NULL) {
30254 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
30255 return __Pyx_PyObject_CallMethO(func, NULL);
30256 }
30257 else if (nargs == 1 && kwargs == NULL) {
30258 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
30259 return __Pyx_PyObject_CallMethO(func, args[0]);
30260 }
30261#endif
30262 if (kwargs == NULL) {
30263 #if CYTHON_VECTORCALL
30264 #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
30265 return PyObject_Vectorcall(func, args, nargsf, NULL);
30266 #else
30267 vectorcallfunc f = __Pyx_PyVectorcall_Function(func);
30268 if (f) {
30269 return f(func, args, nargsf, NULL);
30270 }
30271 #endif
30272 #endif
30273 }
30274 if (nargs == 0) {
30275 return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
30276 }
30277 #if CYTHON_COMPILING_IN_LIMITED_API
30278 return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
30279 #elif CYTHON_COMPILING_IN_PYPY
30280 return PyObject_VectorcallDict(func, args, (size_t) nargs, kwargs);
30281 #else
30282 return PyObject_VectorcallDict(func, args, nargsf, kwargs);
30283 #endif
30284}
30285
30286/* PyObjectCallOneArg (used by CallUnboundCMethod0) */
30287static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
30288 PyObject *args[2] = {NULL, arg};
30289 return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
30290}
30291
30292/* IgnoreException (used by UnpackUnboundCMethod_impl) */
30293static CYTHON_INLINE int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception) {
30294 if (PyErr_GivenExceptionMatches(given_exception ? given_exception : PyErr_Occurred(), ignorable_exception)) {
30295 PyErr_Clear();
30296 return 1;
30297 }
30298 return 0;
30299}
30300
30301/* FastTypeChecks (used by UnpackUnboundCMethod_impl) */
30302#if CYTHON_COMPILING_IN_CPYTHON
30303static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
30304 while (a) {
30305 a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
30306 if (a == b)
30307 return 1;
30308 }
30309 return b == &PyBaseObject_Type;
30310}
30311static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
30312 PyObject *mro;
30313 if (a == b) return 1;
30314 mro = a->tp_mro;
30315 if (likely(mro)) {
30316 Py_ssize_t i, n;
30317 n = PyTuple_GET_SIZE(mro);
30318 for (i = 0; i < n; i++) {
30319 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
30320 return 1;
30321 }
30322 return 0;
30323 }
30324 return __Pyx_InBases(a, b);
30325}
30326static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
30327 PyObject *mro;
30328 if (cls == a || cls == b) return 1;
30329 mro = cls->tp_mro;
30330 if (likely(mro)) {
30331 Py_ssize_t i, n;
30332 n = PyTuple_GET_SIZE(mro);
30333 for (i = 0; i < n; i++) {
30334 PyObject *base = PyTuple_GET_ITEM(mro, i);
30335 if (base == (PyObject *)a || base == (PyObject *)b)
30336 return 1;
30337 }
30338 return 0;
30339 }
30340 return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
30341}
30342#endif
30343
30344/* PyObjectGetAttrStr (used by UnpackUnboundCMethod_impl) */
30345#if CYTHON_USE_TYPE_SLOTS
30346static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
30347 PyTypeObject* tp = Py_TYPE(obj);
30348 if (likely(tp->tp_getattro))
30349 return tp->tp_getattro(obj, attr_name);
30350 return PyObject_GetAttr(obj, attr_name);
30351}
30352#endif
30353
30354/* UnpackUnboundCMethod_impl (used by UnpackUnboundCMethod) */
30355#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
30356static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
30357 PyObject *result;
30358 PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
30359 if (unlikely(!selfless_args)) return NULL;
30360 result = PyObject_Call(method, selfless_args, kwargs);
30361 Py_DECREF(selfless_args);
30362 return result;
30363}
30364#else
30365static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) {
30366 return PyObject_Vectorcall(method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames);
30367}
30368#endif
30369static PyMethodDef __Pyx_UnboundCMethod_Def = {
30370 "CythonUnboundCMethod",
30371 __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
30372#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
30373 METH_VARARGS | METH_KEYWORDS,
30374#else
30375 METH_FASTCALL | METH_KEYWORDS,
30376#endif
30377 NULL
30378};
30379static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
30380 PyObject *method, *result=NULL;
30381 method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
30382 if (unlikely(!method))
30383 return -1;
30384 result = method;
30385#if CYTHON_COMPILING_IN_CPYTHON
30386 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
30387 {
30388 PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
30389 target->func = descr->d_method->ml_meth;
30390 target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
30391 } else
30392#endif
30393#if CYTHON_COMPILING_IN_PYPY
30394#else
30395 if (PyCFunction_Check(method))
30396#endif
30397 {
30398 PyObject *self;
30399 int self_found;
30400#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
30401 self = PyObject_GetAttrString(method, "__self__");
30402 if (!self && !__Pyx_IgnoreException(PyExc_AttributeError)) {
30403 return -1;
30404 }
30405#else
30406 self = PyCFunction_GET_SELF(method);
30407#endif
30408 self_found = (self && self != Py_None);
30409#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
30410 Py_XDECREF(self);
30411#endif
30412 if (self_found) {
30413 PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
30414 if (unlikely(!unbound_method)) return -1;
30415 Py_DECREF(method);
30416 result = unbound_method;
30417 }
30418 }
30419#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
30420 if (unlikely(target->method)) {
30421 Py_DECREF(result);
30422 } else
30423#endif
30424 target->method = result;
30425 return 0;
30426}
30427
30428/* CallUnboundCMethod0 */
30429#if CYTHON_COMPILING_IN_CPYTHON
30430static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
30431 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
30432 if (likely(was_initialized == 2 && cfunc->func)) {
30433 if (likely(cfunc->flag == METH_NOARGS))
30434 return __Pyx_CallCFunction(cfunc, self, NULL);
30435 if (likely(cfunc->flag == METH_FASTCALL))
30436 return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
30437 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
30438 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
30439 if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
30440 return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
30441 if (cfunc->flag == METH_VARARGS)
30442 return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
30443 return __Pyx__CallUnboundCMethod0(cfunc, self);
30444 }
30445#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
30446 else if (unlikely(was_initialized == 1)) {
30447 __Pyx_CachedCFunction tmp_cfunc = {
30448#ifndef __cplusplus
30449 0
30450#endif
30451 };
30452 tmp_cfunc.type = cfunc->type;
30453 tmp_cfunc.method_name = cfunc->method_name;
30454 return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
30455 }
30456#endif
30457 PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
30458 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
30459 return result;
30460}
30461#endif
30462static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
30463 PyObject *result;
30464 if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
30465 result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
30466 return result;
30467}
30468
30469/* py_dict_items (used by OwnedDictNext) */
30470static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
30471 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
30472}
30473
30474/* py_dict_values (used by OwnedDictNext) */
30475static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
30476 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
30477}
30478
30479/* OwnedDictNext (used by ParseKeywordsImpl) */
30480#if CYTHON_AVOID_BORROWED_REFS
30481static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
30482 PyObject *next = NULL;
30483 if (!*ppos) {
30484 if (pvalue) {
30485 PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p);
30486 if (unlikely(!dictview)) goto bad;
30487 *ppos = PyObject_GetIter(dictview);
30488 Py_DECREF(dictview);
30489 } else {
30490 *ppos = PyObject_GetIter(p);
30491 }
30492 if (unlikely(!*ppos)) goto bad;
30493 }
30494 next = PyIter_Next(*ppos);
30495 if (!next) {
30496 if (PyErr_Occurred()) goto bad;
30497 return 0;
30498 }
30499 if (pkey && pvalue) {
30500 *pkey = __Pyx_PySequence_ITEM(next, 0);
30501 if (unlikely(*pkey)) goto bad;
30502 *pvalue = __Pyx_PySequence_ITEM(next, 1);
30503 if (unlikely(*pvalue)) goto bad;
30504 Py_DECREF(next);
30505 } else if (pkey) {
30506 *pkey = next;
30507 } else {
30508 assert(pvalue);
30509 *pvalue = next;
30510 }
30511 return 1;
30512 bad:
30513 Py_XDECREF(next);
30514#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
30515 PyErr_FormatUnraisable("Exception ignored in __Pyx_PyDict_NextRef");
30516#else
30517 PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
30518#endif
30519 if (pkey) *pkey = NULL;
30520 if (pvalue) *pvalue = NULL;
30521 return 0;
30522}
30523#else // !CYTHON_AVOID_BORROWED_REFS
30524static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) {
30525 int result = PyDict_Next(p, ppos, pkey, pvalue);
30526 if (likely(result == 1)) {
30527 if (pkey) Py_INCREF(*pkey);
30528 if (pvalue) Py_INCREF(*pvalue);
30529 }
30530 return result;
30531}
30532#endif
30533
30534/* RaiseDoubleKeywords (used by ParseKeywordsImpl) */
30535static void __Pyx_RaiseDoubleKeywordsError(
30536 const char* func_name,
30537 PyObject* kw_name)
30538{
30539 PyErr_Format(PyExc_TypeError,
30540 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
30541}
30542
30543/* CallUnboundCMethod2 */
30544#if CYTHON_COMPILING_IN_CPYTHON
30545static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
30546 int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
30547 if (likely(was_initialized == 2 && cfunc->func)) {
30548 PyObject *args[2] = {arg1, arg2};
30549 if (cfunc->flag == METH_FASTCALL) {
30550 return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
30551 }
30552 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
30553 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
30554 }
30555#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
30556 else if (unlikely(was_initialized == 1)) {
30557 __Pyx_CachedCFunction tmp_cfunc = {
30558#ifndef __cplusplus
30559 0
30560#endif
30561 };
30562 tmp_cfunc.type = cfunc->type;
30563 tmp_cfunc.method_name = cfunc->method_name;
30564 return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
30565 }
30566#endif
30567 PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
30568 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
30569 return result;
30570}
30571#endif
30572static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
30573 if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
30574#if CYTHON_COMPILING_IN_CPYTHON
30575 if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
30576 PyObject *result = NULL;
30577 PyObject *args = PyTuple_New(2);
30578 if (unlikely(!args)) return NULL;
30579 Py_INCREF(arg1);
30580 PyTuple_SET_ITEM(args, 0, arg1);
30581 Py_INCREF(arg2);
30582 PyTuple_SET_ITEM(args, 1, arg2);
30583 if (cfunc->flag & METH_KEYWORDS)
30584 result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
30585 else
30586 result = __Pyx_CallCFunction(cfunc, self, args);
30587 Py_DECREF(args);
30588 return result;
30589 }
30590#endif
30591 {
30592 PyObject *args[4] = {NULL, self, arg1, arg2};
30593 return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
30594 }
30595}
30596
30597/* ParseKeywordsImpl (used by ParseKeywords) */
30598static int __Pyx_ValidateDuplicatePosArgs(
30599 PyObject *kwds,
30600 PyObject ** const argnames[],
30601 PyObject ** const *first_kw_arg,
30602 const char* function_name)
30603{
30604 PyObject ** const *name = argnames;
30605 while (name != first_kw_arg) {
30606 PyObject *key = **name;
30607 int found = PyDict_Contains(kwds, key);
30608 if (unlikely(found)) {
30609 if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
30610 goto bad;
30611 }
30612 name++;
30613 }
30614 return 0;
30615bad:
30616 return -1;
30617}
30618#if CYTHON_USE_UNICODE_INTERNALS
30619static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
30620 int kind;
30621 Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
30622 if (len != PyUnicode_GET_LENGTH(s2)) return 0;
30623 kind = PyUnicode_KIND(s1);
30624 if (kind != PyUnicode_KIND(s2)) return 0;
30625 const void *data1 = PyUnicode_DATA(s1);
30626 const void *data2 = PyUnicode_DATA(s2);
30627 return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0);
30628}
30629#endif
30630static int __Pyx_MatchKeywordArg_str(
30631 PyObject *key,
30632 PyObject ** const argnames[],
30633 PyObject ** const *first_kw_arg,
30634 size_t *index_found,
30635 const char *function_name)
30636{
30637 PyObject ** const *name;
30638 #if CYTHON_USE_UNICODE_INTERNALS
30639 Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
30640 if (unlikely(key_hash == -1)) {
30641 key_hash = PyObject_Hash(key);
30642 if (unlikely(key_hash == -1))
30643 goto bad;
30644 }
30645 #endif
30646 name = first_kw_arg;
30647 while (*name) {
30648 PyObject *name_str = **name;
30649 #if CYTHON_USE_UNICODE_INTERNALS
30650 if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
30651 *index_found = (size_t) (name - argnames);
30652 return 1;
30653 }
30654 #else
30655 #if CYTHON_ASSUME_SAFE_SIZE
30656 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
30657 #endif
30658 {
30659 int cmp = PyUnicode_Compare(name_str, key);
30660 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
30661 if (cmp == 0) {
30662 *index_found = (size_t) (name - argnames);
30663 return 1;
30664 }
30665 }
30666 #endif
30667 name++;
30668 }
30669 name = argnames;
30670 while (name != first_kw_arg) {
30671 PyObject *name_str = **name;
30672 #if CYTHON_USE_UNICODE_INTERNALS
30673 if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
30674 if (__Pyx_UnicodeKeywordsEqual(name_str, key))
30675 goto arg_passed_twice;
30676 }
30677 #else
30678 #if CYTHON_ASSUME_SAFE_SIZE
30679 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
30680 #endif
30681 {
30682 if (unlikely(name_str == key)) goto arg_passed_twice;
30683 int cmp = PyUnicode_Compare(name_str, key);
30684 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
30685 if (cmp == 0) goto arg_passed_twice;
30686 }
30687 #endif
30688 name++;
30689 }
30690 return 0;
30691arg_passed_twice:
30692 __Pyx_RaiseDoubleKeywordsError(function_name, key);
30693 goto bad;
30694bad:
30695 return -1;
30696}
30697static int __Pyx_MatchKeywordArg_nostr(
30698 PyObject *key,
30699 PyObject ** const argnames[],
30700 PyObject ** const *first_kw_arg,
30701 size_t *index_found,
30702 const char *function_name)
30703{
30704 PyObject ** const *name;
30705 if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type;
30706 name = first_kw_arg;
30707 while (*name) {
30708 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
30709 if (cmp == 1) {
30710 *index_found = (size_t) (name - argnames);
30711 return 1;
30712 }
30713 if (unlikely(cmp == -1)) goto bad;
30714 name++;
30715 }
30716 name = argnames;
30717 while (name != first_kw_arg) {
30718 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
30719 if (unlikely(cmp != 0)) {
30720 if (cmp == 1) goto arg_passed_twice;
30721 else goto bad;
30722 }
30723 name++;
30724 }
30725 return 0;
30726arg_passed_twice:
30727 __Pyx_RaiseDoubleKeywordsError(function_name, key);
30728 goto bad;
30729invalid_keyword_type:
30730 PyErr_Format(PyExc_TypeError,
30731 "%.200s() keywords must be strings", function_name);
30732 goto bad;
30733bad:
30734 return -1;
30735}
30736static CYTHON_INLINE int __Pyx_MatchKeywordArg(
30737 PyObject *key,
30738 PyObject ** const argnames[],
30739 PyObject ** const *first_kw_arg,
30740 size_t *index_found,
30741 const char *function_name)
30742{
30743 return likely(PyUnicode_CheckExact(key)) ?
30744 __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
30745 __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
30746}
30747static void __Pyx_RejectUnknownKeyword(
30748 PyObject *kwds,
30749 PyObject ** const argnames[],
30750 PyObject ** const *first_kw_arg,
30751 const char *function_name)
30752{
30753 #if CYTHON_AVOID_BORROWED_REFS
30754 PyObject *pos = NULL;
30755 #else
30756 Py_ssize_t pos = 0;
30757 #endif
30758 PyObject *key = NULL;
30759 __Pyx_BEGIN_CRITICAL_SECTION(kwds);
30760 #if CYTHON_AVOID_BORROWED_REFS
30761 while (__Pyx_PyDict_NextRef(kwds, &pos, &key, NULL))
30762 #else
30763 (void) __Pyx_PyDict_NextRef;
30764 while (PyDict_Next(kwds, &pos, &key, NULL))
30765 #endif
30766 {
30767 PyObject** const *name = first_kw_arg;
30768 while (*name && (**name != key)) name++;
30769 if (!*name) {
30770 size_t index_found = 0;
30771 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
30772 if (cmp != 1) {
30773 if (cmp == 0) {
30774 PyErr_Format(PyExc_TypeError,
30775 "%s() got an unexpected keyword argument '%U'",
30776 function_name, key);
30777 }
30778 #if CYTHON_AVOID_BORROWED_REFS
30779 Py_DECREF(key);
30780 #endif
30781 break;
30782 }
30783 }
30784 #if CYTHON_AVOID_BORROWED_REFS
30785 Py_DECREF(key);
30786 #endif
30787 }
30788 __Pyx_END_CRITICAL_SECTION();
30789 #if CYTHON_AVOID_BORROWED_REFS
30790 Py_XDECREF(pos);
30791 #endif
30792 assert(PyErr_Occurred());
30793}
30794static int __Pyx_ParseKeywordDict(
30795 PyObject *kwds,
30796 PyObject ** const argnames[],
30797 PyObject *values[],
30798 Py_ssize_t num_pos_args,
30799 Py_ssize_t num_kwargs,
30800 const char* function_name,
30801 int ignore_unknown_kwargs)
30802{
30803 PyObject** const *name;
30804 PyObject** const *first_kw_arg = argnames + num_pos_args;
30805 Py_ssize_t extracted = 0;
30806#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
30807 if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
30808#endif
30809 name = first_kw_arg;
30810 while (*name && num_kwargs > extracted) {
30811 PyObject * key = **name;
30812 PyObject *value;
30813 int found = 0;
30814 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
30815 found = PyDict_GetItemRef(kwds, key, &value);
30816 #else
30817 value = PyDict_GetItemWithError(kwds, key);
30818 if (value) {
30819 Py_INCREF(value);
30820 found = 1;
30821 } else {
30822 if (unlikely(PyErr_Occurred())) goto bad;
30823 }
30824 #endif
30825 if (found) {
30826 if (unlikely(found < 0)) goto bad;
30827 values[name-argnames] = value;
30828 extracted++;
30829 }
30830 name++;
30831 }
30832 if (num_kwargs > extracted) {
30833 if (ignore_unknown_kwargs) {
30834 if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
30835 goto bad;
30836 } else {
30837 __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
30838 goto bad;
30839 }
30840 }
30841 return 0;
30842bad:
30843 return -1;
30844}
30845static int __Pyx_ParseKeywordDictToDict(
30846 PyObject *kwds,
30847 PyObject ** const argnames[],
30848 PyObject *kwds2,
30849 PyObject *values[],
30850 Py_ssize_t num_pos_args,
30851 const char* function_name)
30852{
30853 PyObject** const *name;
30854 PyObject** const *first_kw_arg = argnames + num_pos_args;
30855 Py_ssize_t len;
30856#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
30857 if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
30858#endif
30859 if (PyDict_Update(kwds2, kwds) < 0) goto bad;
30860 name = first_kw_arg;
30861 while (*name) {
30862 PyObject *key = **name;
30863 PyObject *value;
30864#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
30865 int found = PyDict_Pop(kwds2, key, &value);
30866 if (found) {
30867 if (unlikely(found < 0)) goto bad;
30868 values[name-argnames] = value;
30869 }
30870#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
30871 int found = PyDict_GetItemRef(kwds2, key, &value);
30872 if (found) {
30873 if (unlikely(found < 0)) goto bad;
30874 values[name-argnames] = value;
30875 if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad;
30876 }
30877#else
30878 #if CYTHON_COMPILING_IN_CPYTHON
30879 value = _PyDict_Pop(kwds2, key, kwds2);
30880 #else
30881 value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
30882 #endif
30883 if (value == kwds2) {
30884 Py_DECREF(value);
30885 } else {
30886 if (unlikely(!value)) goto bad;
30887 values[name-argnames] = value;
30888 }
30889#endif
30890 name++;
30891 }
30892 len = PyDict_Size(kwds2);
30893 if (len > 0) {
30894 return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
30895 } else if (unlikely(len == -1)) {
30896 goto bad;
30897 }
30898 return 0;
30899bad:
30900 return -1;
30901}
30902static int __Pyx_ParseKeywordsTuple(
30903 PyObject *kwds,
30904 PyObject * const *kwvalues,
30905 PyObject ** const argnames[],
30906 PyObject *kwds2,
30907 PyObject *values[],
30908 Py_ssize_t num_pos_args,
30909 Py_ssize_t num_kwargs,
30910 const char* function_name,
30911 int ignore_unknown_kwargs)
30912{
30913 PyObject *key = NULL;
30914 PyObject** const * name;
30915 PyObject** const *first_kw_arg = argnames + num_pos_args;
30916 for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
30917#if CYTHON_AVOID_BORROWED_REFS
30918 key = __Pyx_PySequence_ITEM(kwds, pos);
30919#else
30920 key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
30921#endif
30922#if !CYTHON_ASSUME_SAFE_MACROS
30923 if (unlikely(!key)) goto bad;
30924#endif
30925 name = first_kw_arg;
30926 while (*name && (**name != key)) name++;
30927 if (*name) {
30928 PyObject *value = kwvalues[pos];
30929 values[name-argnames] = __Pyx_NewRef(value);
30930 } else {
30931 size_t index_found = 0;
30932 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
30933 if (cmp == 1) {
30934 PyObject *value = kwvalues[pos];
30935 values[index_found] = __Pyx_NewRef(value);
30936 } else {
30937 if (unlikely(cmp == -1)) goto bad;
30938 if (kwds2) {
30939 PyObject *value = kwvalues[pos];
30940 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
30941 } else if (!ignore_unknown_kwargs) {
30942 goto invalid_keyword;
30943 }
30944 }
30945 }
30946 #if CYTHON_AVOID_BORROWED_REFS
30947 Py_DECREF(key);
30948 key = NULL;
30949 #endif
30950 }
30951 return 0;
30952invalid_keyword:
30953 PyErr_Format(PyExc_TypeError,
30954 "%s() got an unexpected keyword argument '%U'",
30955 function_name, key);
30956 goto bad;
30957bad:
30958 #if CYTHON_AVOID_BORROWED_REFS
30959 Py_XDECREF(key);
30960 #endif
30961 return -1;
30962}
30963
30964/* ParseKeywords */
30965static int __Pyx_ParseKeywords(
30966 PyObject *kwds,
30967 PyObject * const *kwvalues,
30968 PyObject ** const argnames[],
30969 PyObject *kwds2,
30970 PyObject *values[],
30971 Py_ssize_t num_pos_args,
30972 Py_ssize_t num_kwargs,
30973 const char* function_name,
30974 int ignore_unknown_kwargs)
30975{
30976 if (CYTHON_VECTORCALL && likely(PyTuple_Check(kwds)))
30977 return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
30978 else if (kwds2)
30979 return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
30980 else
30981 return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
30982}
30983
30984/* RaiseArgTupleInvalid */
30985static void __Pyx_RaiseArgtupleInvalid(
30986 const char* func_name,
30987 int exact,
30988 Py_ssize_t num_min,
30989 Py_ssize_t num_max,
30990 Py_ssize_t num_found)
30991{
30992 Py_ssize_t num_expected;
30993 const char *more_or_less;
30994 if (num_found < num_min) {
30995 num_expected = num_min;
30996 more_or_less = "at least";
30997 } else {
30998 num_expected = num_max;
30999 more_or_less = "at most";
31000 }
31001 if (exact) {
31002 more_or_less = "exactly";
31003 }
31004 PyErr_Format(PyExc_TypeError,
31005 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
31006 func_name, more_or_less, num_expected,
31007 (num_expected == 1) ? "" : "s", num_found);
31008}
31009
31010/* ArgTypeTestError (used by ArgTypeTest) */
31011static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type, const char *name, int exact)
31012{
31013 __Pyx_TypeName type_name;
31014 __Pyx_TypeName obj_type_name;
31015 PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode;
31016 int from_annotation_subclass = 0;
31017 if (unlikely(!type)) {
31018 PyErr_SetString(PyExc_SystemError, "Missing type object");
31019 return;
31020 } else if (exact == 2) {
31021 if (__Pyx_TypeCheck(obj, type)) {
31022 from_annotation_subclass = 1;
31023 extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately;
31024 }
31025 }
31026 type_name = __Pyx_PyType_GetFullyQualifiedName(type);
31027 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
31028 if (unlikely(!type_name)) return;
31029 #endif
31030 obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
31031 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
31032 if (unlikely(!obj_type_name)) goto obj_type_name_failed;
31033 #endif
31034 PyErr_Format(PyExc_TypeError,
31035 "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME ", got " __Pyx_FMT_TYPENAME ")"
31036#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
31037 "%s%U"
31038#endif
31039 , name, type_name, obj_type_name
31040#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
31041 , (from_annotation_subclass ? ". " : ""), extra_info
31042#endif
31043 );
31044#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
31045 if (exact == 2 && from_annotation_subclass) {
31046 PyObject *res;
31047 PyObject *vargs[2];
31048 vargs[0] = PyErr_GetRaisedException();
31049 vargs[1] = extra_info;
31050 res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL);
31051 Py_XDECREF(res);
31052 PyErr_SetRaisedException(vargs[0]);
31053 }
31054#endif
31055 __Pyx_DECREF_TypeName(obj_type_name);
31056#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
31057obj_type_name_failed:
31058#endif
31059 __Pyx_DECREF_TypeName(type_name);
31060 return;
31061}
31062
31063/* ArgTypeTest */
31064static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact) {
31065 if (likely(Py_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None))))
31066 return 1;
31067 if (!exact && likely(type) && likely(__Pyx_TypeCheck(obj, type)))
31068 return 1;
31069 __Pyx_ArgTypeError(obj, type, name, exact);
31070 return 0;
31071}
31072
31073/* PyErrFetchRestore (used by GivenExceptionMatches) */
31074#if CYTHON_FAST_THREAD_STATE
31075static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
31076#if PY_VERSION_HEX >= 0x030C00A6
31077 PyObject *tmp_value;
31078 assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
31079 if (value) {
31080 #if CYTHON_COMPILING_IN_CPYTHON
31081 if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
31082 #endif
31083 PyException_SetTraceback(value, tb);
31084 }
31085 tmp_value = tstate->current_exception;
31086 tstate->current_exception = value;
31087 Py_XDECREF(tmp_value);
31088 Py_XDECREF(type);
31089 Py_XDECREF(tb);
31090#else
31091 PyObject *tmp_type, *tmp_value, *tmp_tb;
31092 tmp_type = tstate->curexc_type;
31093 tmp_value = tstate->curexc_value;
31094 tmp_tb = tstate->curexc_traceback;
31095 tstate->curexc_type = type;
31096 tstate->curexc_value = value;
31097 tstate->curexc_traceback = tb;
31098 Py_XDECREF(tmp_type);
31099 Py_XDECREF(tmp_value);
31100 Py_XDECREF(tmp_tb);
31101#endif
31102}
31103static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
31104#if PY_VERSION_HEX >= 0x030C00A6
31105 PyObject* exc_value;
31106 exc_value = tstate->current_exception;
31107 tstate->current_exception = 0;
31108 *value = exc_value;
31109 *type = NULL;
31110 *tb = NULL;
31111 if (exc_value) {
31112 *type = (PyObject*) Py_TYPE(exc_value);
31113 Py_INCREF(*type);
31114 #if CYTHON_COMPILING_IN_CPYTHON
31115 *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
31116 Py_XINCREF(*tb);
31117 #else
31118 *tb = PyException_GetTraceback(exc_value);
31119 #endif
31120 }
31121#else
31122 *type = tstate->curexc_type;
31123 *value = tstate->curexc_value;
31124 *tb = tstate->curexc_traceback;
31125 tstate->curexc_type = 0;
31126 tstate->curexc_value = 0;
31127 tstate->curexc_traceback = 0;
31128#endif
31129}
31130#endif
31131
31132/* GivenExceptionMatches (used by PyErrExceptionMatches) */
31133#if CYTHON_COMPILING_IN_CPYTHON
31134static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
31135 if (exc_type1) {
31136 return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
31137 } else {
31138 return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
31139 }
31140}
31141static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
31142 Py_ssize_t i, n;
31143 assert(PyExceptionClass_Check(exc_type));
31144 n = PyTuple_GET_SIZE(tuple);
31145 for (i=0; i<n; i++) {
31146 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
31147 }
31148 for (i=0; i<n; i++) {
31149 PyObject *t = PyTuple_GET_ITEM(tuple, i);
31150 if (likely(PyExceptionClass_Check(t))) {
31151 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
31152 } else {
31153 }
31154 }
31155 return 0;
31156}
31157static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
31158 if (likely(err == exc_type)) return 1;
31159 if (likely(PyExceptionClass_Check(err))) {
31160 if (likely(PyExceptionClass_Check(exc_type))) {
31161 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
31162 } else if (likely(PyTuple_Check(exc_type))) {
31163 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
31164 } else {
31165 }
31166 }
31167 return PyErr_GivenExceptionMatches(err, exc_type);
31168}
31169static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
31170 assert(PyExceptionClass_Check(exc_type1));
31171 assert(PyExceptionClass_Check(exc_type2));
31172 if (likely(err == exc_type1 || err == exc_type2)) return 1;
31173 if (likely(PyExceptionClass_Check(err))) {
31174 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
31175 }
31176 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
31177}
31178#endif
31179
31180/* PyErrExceptionMatches (used by PyObjectGetAttrStrNoError) */
31181#if CYTHON_FAST_THREAD_STATE
31182static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
31183 Py_ssize_t i, n;
31184 n = PyTuple_GET_SIZE(tuple);
31185 for (i=0; i<n; i++) {
31186 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
31187 }
31188 for (i=0; i<n; i++) {
31189 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
31190 }
31191 return 0;
31192}
31193static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
31194 int result;
31195 PyObject *exc_type;
31196#if PY_VERSION_HEX >= 0x030C00A6
31197 PyObject *current_exception = tstate->current_exception;
31198 if (unlikely(!current_exception)) return 0;
31199 exc_type = (PyObject*) Py_TYPE(current_exception);
31200 if (exc_type == err) return 1;
31201#else
31202 exc_type = tstate->curexc_type;
31203 if (exc_type == err) return 1;
31204 if (unlikely(!exc_type)) return 0;
31205#endif
31206 #if CYTHON_AVOID_BORROWED_REFS
31207 Py_INCREF(exc_type);
31208 #endif
31209 if (unlikely(PyTuple_Check(err))) {
31210 result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
31211 } else {
31212 result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
31213 }
31214 #if CYTHON_AVOID_BORROWED_REFS
31215 Py_DECREF(exc_type);
31216 #endif
31217 return result;
31218}
31219#endif
31220
31221/* PyObjectGetAttrStrNoError (used by GetBuiltinName) */
31222#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
31223static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
31224 __Pyx_PyThreadState_declare
31225 __Pyx_PyThreadState_assign
31226 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
31227 __Pyx_PyErr_Clear();
31228}
31229#endif
31230static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
31231 PyObject *result;
31232#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
31233 (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
31234 return result;
31235#else
31236#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
31237 PyTypeObject* tp = Py_TYPE(obj);
31238 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
31239 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
31240 }
31241#endif
31242 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
31243 if (unlikely(!result)) {
31244 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
31245 }
31246 return result;
31247#endif
31248}
31249
31250/* GetBuiltinName */
31251static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
31252 PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name);
31253 if (unlikely(!result) && !PyErr_Occurred()) {
31254 PyErr_Format(PyExc_NameError,
31255 "name '%U' is not defined", name);
31256 }
31257 return result;
31258}
31259
31260/* PyObjectFastCallMethod */
31261#if !CYTHON_VECTORCALL
31262static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) {
31263 PyObject *result;
31264 switch (__Pyx_PyVectorcall_NARGS(nargsf)) {
31265 case 1:
31266 return PyObject_CallMethodObjArgs(args[0], name, NULL);
31267 case 2:
31268 return PyObject_CallMethodObjArgs(args[0], name, args[1], NULL);
31269 case 3:
31270 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], NULL);
31271 case 4:
31272 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], NULL);
31273 case 5:
31274 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], args[4], NULL);
31275 }
31276 PyObject *attr = PyObject_GetAttr(args[0], name);
31277 if (unlikely(!attr))
31278 return NULL;
31279 result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1);
31280 Py_DECREF(attr);
31281 return result;
31282}
31283#endif
31284
31285/* FormatTypeName (used by RaiseErrorWithObjectType1) */
31286#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
31287static __Pyx_TypeName
31288__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
31289{
31290 PyObject *module = NULL, *name = NULL, *result = NULL;
31291 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
31292 name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
31293 __pyx_mstate_global->__pyx_n_u_qualname);
31294 #else
31295 name = PyType_GetQualName(tp);
31296 #endif
31297 if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad;
31298 module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
31299 __pyx_mstate_global->__pyx_n_u_module);
31300 if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad;
31301 if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) {
31302 result = name;
31303 name = NULL;
31304 goto done;
31305 }
31306 result = PyUnicode_FromFormat("%U.%U", module, name);
31307 if (unlikely(result == NULL)) goto bad;
31308 done:
31309 Py_XDECREF(name);
31310 Py_XDECREF(module);
31311 return result;
31312 bad:
31313 PyErr_Clear();
31314 if (name) {
31315 result = name;
31316 name = NULL;
31317 } else {
31318 result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u_);
31319 }
31320 goto done;
31321}
31322#endif
31323
31324/* RaiseErrorWithObjectType1 (used by RaiseUnexpectedTypeError) */
31325static void __Pyx_RaiseErrorWithType1(PyObject* exc_type, const char* message, const char *arg, PyTypeObject *type_obj) {
31326 __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(type_obj);
31327 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
31328 if (unlikely(!type_name)) return;
31329 #endif
31330 PyErr_Format(exc_type, message, arg, type_name);
31331 __Pyx_DECREF_TypeName(type_name);
31332}
31333
31334/* RaiseUnexpectedTypeError */
31335static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) {
31336 __Pyx_RaiseTypeErrorWithObjectType1(
31337 "Expected %.42s, got " __Pyx_FMT_TYPENAME,
31338 expected, obj);
31339 return 0;
31340}
31341
31342/* RaiseException */
31343static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
31344 PyObject* owned_instance = NULL;
31345 if (tb == Py_None) {
31346 tb = 0;
31347 } else if (tb && !PyTraceBack_Check(tb)) {
31348 PyErr_SetString(PyExc_TypeError,
31349 "raise: arg 3 must be a traceback or None");
31350 goto bad;
31351 }
31352 if (value == Py_None)
31353 value = 0;
31354 if (PyExceptionInstance_Check(type)) {
31355 if (value) {
31356 PyErr_SetString(PyExc_TypeError,
31357 "instance exception may not have a separate value");
31358 goto bad;
31359 }
31360 value = type;
31361 type = (PyObject*) Py_TYPE(value);
31362 } else if (PyExceptionClass_Check(type)) {
31363 PyObject *instance_class = NULL;
31364 if (value && PyExceptionInstance_Check(value)) {
31365 instance_class = (PyObject*) Py_TYPE(value);
31366 if (instance_class != type) {
31367 int is_subclass = PyObject_IsSubclass(instance_class, type);
31368 if (!is_subclass) {
31369 instance_class = NULL;
31370 } else if (unlikely(is_subclass == -1)) {
31371 goto bad;
31372 } else {
31373 type = instance_class;
31374 }
31375 }
31376 }
31377 if (!instance_class) {
31378 PyObject *args;
31379 if (!value)
31380 args = PyTuple_New(0);
31381 else if (PyTuple_Check(value)) {
31382 Py_INCREF(value);
31383 args = value;
31384 } else
31385 args = PyTuple_Pack(1, value);
31386 if (!args)
31387 goto bad;
31388 owned_instance = PyObject_Call(type, args, NULL);
31389 Py_DECREF(args);
31390 if (!owned_instance)
31391 goto bad;
31392 value = owned_instance;
31393 if (!PyExceptionInstance_Check(value)) {
31394 PyErr_Format(PyExc_TypeError,
31395 "calling %R should have returned an instance of "
31396 "BaseException, not %R",
31397 type, Py_TYPE(value));
31398 goto bad;
31399 }
31400 }
31401 } else {
31402 PyErr_SetString(PyExc_TypeError,
31403 "raise: exception class must be a subclass of BaseException");
31404 goto bad;
31405 }
31406 if (cause) {
31407 PyObject *fixed_cause;
31408 if (cause == Py_None) {
31409 fixed_cause = NULL;
31410 } else if (PyExceptionClass_Check(cause)) {
31411 fixed_cause = PyObject_CallObject(cause, NULL);
31412 if (fixed_cause == NULL)
31413 goto bad;
31414 } else if (PyExceptionInstance_Check(cause)) {
31415 fixed_cause = cause;
31416 Py_INCREF(fixed_cause);
31417 } else {
31418 PyErr_SetString(PyExc_TypeError,
31419 "exception causes must derive from "
31420 "BaseException");
31421 goto bad;
31422 }
31423 PyException_SetCause(value, fixed_cause);
31424 }
31425 PyErr_SetObject(type, value);
31426 if (tb) {
31427#if PY_VERSION_HEX >= 0x030C00A6
31428 PyException_SetTraceback(value, tb);
31429#elif CYTHON_FAST_THREAD_STATE
31430 PyThreadState *tstate = __Pyx_PyThreadState_Current;
31431 PyObject* tmp_tb = tstate->curexc_traceback;
31432 if (tb != tmp_tb) {
31433 Py_INCREF(tb);
31434 tstate->curexc_traceback = tb;
31435 Py_XDECREF(tmp_tb);
31436 }
31437#else
31438 PyObject *tmp_type, *tmp_value, *tmp_tb;
31439 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
31440 Py_INCREF(tb);
31441 PyErr_Restore(tmp_type, tmp_value, tb);
31442 Py_XDECREF(tmp_tb);
31443#endif
31444 }
31445bad:
31446 Py_XDECREF(owned_instance);
31447 return;
31448}
31449
31450/* CIntToDigits (used by CIntToPyUnicode) */
31451static const char DIGIT_PAIRS_10[2*10*10+1] = {
31452 "00010203040506070809"
31453 "10111213141516171819"
31454 "20212223242526272829"
31455 "30313233343536373839"
31456 "40414243444546474849"
31457 "50515253545556575859"
31458 "60616263646566676869"
31459 "70717273747576777879"
31460 "80818283848586878889"
31461 "90919293949596979899"
31462};
31463static const char DIGIT_PAIRS_8[2*8*8+1] = {
31464 "0001020304050607"
31465 "1011121314151617"
31466 "2021222324252627"
31467 "3031323334353637"
31468 "4041424344454647"
31469 "5051525354555657"
31470 "6061626364656667"
31471 "7071727374757677"
31472};
31473static const char DIGITS_HEX[2*16+1] = {
31474 "0123456789abcdef"
31475 "0123456789ABCDEF"
31476};
31477
31478/* BuildPyUnicode (used by COrdinalToPyUnicode) */
31479static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, const char* chars, int clength,
31480 int prepend_sign, char padding_char) {
31481 PyObject *uval;
31482 Py_ssize_t uoffset = ulength - clength;
31483#if CYTHON_USE_UNICODE_INTERNALS
31484 Py_ssize_t i;
31485 void *udata;
31486 uval = PyUnicode_New(ulength, 127);
31487 if (unlikely(!uval)) return NULL;
31488 udata = PyUnicode_DATA(uval);
31489 if (uoffset > 0) {
31490 i = 0;
31491 if (prepend_sign) {
31492 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
31493 i++;
31494 }
31495 for (; i < uoffset; i++) {
31496 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
31497 }
31498 }
31499 for (i=0; i < clength; i++) {
31500 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
31501 }
31502#else
31503 {
31504 PyObject *sign = NULL, *padding = NULL;
31505 uval = NULL;
31506 if (uoffset > 0) {
31507 prepend_sign = !!prepend_sign;
31508 if (uoffset > prepend_sign) {
31509 padding = PyUnicode_FromOrdinal(padding_char);
31510 if (likely(padding) && uoffset > prepend_sign + 1) {
31511 PyObject *tmp = PySequence_Repeat(padding, uoffset - prepend_sign);
31512 Py_DECREF(padding);
31513 padding = tmp;
31514 }
31515 if (unlikely(!padding)) goto done_or_error;
31516 }
31517 if (prepend_sign) {
31518 sign = PyUnicode_FromOrdinal('-');
31519 if (unlikely(!sign)) goto done_or_error;
31520 }
31521 }
31522 uval = PyUnicode_DecodeASCII(chars, clength, NULL);
31523 if (likely(uval) && padding) {
31524 PyObject *tmp = PyUnicode_Concat(padding, uval);
31525 Py_DECREF(uval);
31526 uval = tmp;
31527 }
31528 if (likely(uval) && sign) {
31529 PyObject *tmp = PyUnicode_Concat(sign, uval);
31530 Py_DECREF(uval);
31531 uval = tmp;
31532 }
31533done_or_error:
31534 Py_XDECREF(padding);
31535 Py_XDECREF(sign);
31536 }
31537#endif
31538 return uval;
31539}
31540
31541/* COrdinalToPyUnicode (used by CIntToPyUnicode) */
31542static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value) {
31543 return value <= 1114111;
31544}
31545static PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t ulength, char padding_char) {
31546 Py_ssize_t padding_length = ulength - 1;
31547 if (likely((padding_length <= 250) && (value < 0xD800 || value > 0xDFFF))) {
31548 char chars[256];
31549 if (value <= 255) {
31550 memset(chars, padding_char, (size_t) padding_length);
31551 chars[ulength-1] = (char) value;
31552 return PyUnicode_DecodeLatin1(chars, ulength, NULL);
31553 }
31554 char *cpos = chars + sizeof(chars);
31555 if (value < 0x800) {
31556 *--cpos = (char) (0x80 | (value & 0x3f));
31557 value >>= 6;
31558 *--cpos = (char) (0xc0 | (value & 0x1f));
31559 } else if (value < 0x10000) {
31560 *--cpos = (char) (0x80 | (value & 0x3f));
31561 value >>= 6;
31562 *--cpos = (char) (0x80 | (value & 0x3f));
31563 value >>= 6;
31564 *--cpos = (char) (0xe0 | (value & 0x0f));
31565 } else {
31566 *--cpos = (char) (0x80 | (value & 0x3f));
31567 value >>= 6;
31568 *--cpos = (char) (0x80 | (value & 0x3f));
31569 value >>= 6;
31570 *--cpos = (char) (0x80 | (value & 0x3f));
31571 value >>= 6;
31572 *--cpos = (char) (0xf0 | (value & 0x07));
31573 }
31574 cpos -= padding_length;
31575 memset(cpos, padding_char, (size_t) padding_length);
31576 return PyUnicode_DecodeUTF8(cpos, chars + sizeof(chars) - cpos, NULL);
31577 }
31578 if (value <= 127 && CYTHON_USE_UNICODE_INTERNALS) {
31579 const char chars[1] = {(char) value};
31580 return __Pyx_PyUnicode_BuildFromAscii(ulength, chars, 1, 0, padding_char);
31581 }
31582 {
31583 PyObject *uchar, *padding_uchar, *padding, *result;
31584 padding_uchar = PyUnicode_FromOrdinal(padding_char);
31585 if (unlikely(!padding_uchar)) return NULL;
31586 padding = PySequence_Repeat(padding_uchar, padding_length);
31587 Py_DECREF(padding_uchar);
31588 if (unlikely(!padding)) return NULL;
31589 uchar = PyUnicode_FromOrdinal(value);
31590 if (unlikely(!uchar)) {
31591 Py_DECREF(padding);
31592 return NULL;
31593 }
31594 result = PyUnicode_Concat(padding, uchar);
31595 Py_DECREF(padding);
31596 Py_DECREF(uchar);
31597 return result;
31598 }
31599}
31600
31601/* CIntToPyUnicode */
31602static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char) {
31603#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31604#pragma GCC diagnostic push
31605#pragma GCC diagnostic ignored "-Wconversion"
31606#endif
31607 const int neg_one = (int) -1, const_zero = (int) 0;
31608#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31609#pragma GCC diagnostic pop
31610#endif
31611 const int is_unsigned = neg_one > const_zero;
31612 if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
31613 !(sizeof(value) <= 2 || value & ~ (int) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
31614 PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
31615 return NULL;
31616 }
31617 if (width <= 1) {
31618 return PyUnicode_FromOrdinal((int) value);
31619 }
31620 return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
31621}
31622static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) {
31623 char digits[sizeof(int)*3+2];
31624 char *dpos, *end = digits + sizeof(int)*3+2;
31625 const char *hex_digits = DIGITS_HEX;
31626 Py_ssize_t length, ulength;
31627 int prepend_sign, last_one_off;
31628 int remaining;
31629#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31630#pragma GCC diagnostic push
31631#pragma GCC diagnostic ignored "-Wconversion"
31632#endif
31633 const int neg_one = (int) -1, const_zero = (int) 0;
31634#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31635#pragma GCC diagnostic pop
31636#endif
31637 const int is_unsigned = neg_one > const_zero;
31638 if (format_char == 'X') {
31639 hex_digits += 16;
31640 format_char = 'x';
31641 }
31642 remaining = value;
31643 last_one_off = 0;
31644 dpos = end;
31645 do {
31646 int digit_pos;
31647 switch (format_char) {
31648 case 'o':
31649 digit_pos = abs((int)(remaining % (8*8)));
31650 remaining = (int) (remaining / (8*8));
31651 dpos -= 2;
31652 memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
31653 last_one_off = (digit_pos < 8);
31654 break;
31655 case 'd':
31656 digit_pos = abs((int)(remaining % (10*10)));
31657 remaining = (int) (remaining / (10*10));
31658 dpos -= 2;
31659 memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
31660 last_one_off = (digit_pos < 10);
31661 break;
31662 case 'x':
31663 *(--dpos) = hex_digits[abs((int)(remaining % 16))];
31664 remaining = (int) (remaining / 16);
31665 break;
31666 default:
31667 assert(0);
31668 break;
31669 }
31670 } while (unlikely(remaining != 0));
31671 assert(!last_one_off || *dpos == '0');
31672 dpos += last_one_off;
31673 length = end - dpos;
31674 ulength = length;
31675 prepend_sign = 0;
31676 if (!is_unsigned && value <= neg_one) {
31677 if (padding_char == ' ' || width <= length + 1) {
31678 *(--dpos) = '-';
31679 ++length;
31680 } else {
31681 prepend_sign = 1;
31682 }
31683 ++ulength;
31684 }
31685 if (width > ulength) {
31686 ulength = width;
31687 }
31688 if (ulength == 1) {
31689 return PyUnicode_FromOrdinal(*dpos);
31690 }
31691 return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
31692}
31693
31694/* CIntToPyUnicode */
31695static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char) {
31696#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31697#pragma GCC diagnostic push
31698#pragma GCC diagnostic ignored "-Wconversion"
31699#endif
31700 const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
31701#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31702#pragma GCC diagnostic pop
31703#endif
31704 const int is_unsigned = neg_one > const_zero;
31705 if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
31706 !(sizeof(value) <= 2 || value & ~ (Py_ssize_t) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
31707 PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
31708 return NULL;
31709 }
31710 if (width <= 1) {
31711 return PyUnicode_FromOrdinal((int) value);
31712 }
31713 return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
31714}
31715static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) {
31716 char digits[sizeof(Py_ssize_t)*3+2];
31717 char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2;
31718 const char *hex_digits = DIGITS_HEX;
31719 Py_ssize_t length, ulength;
31720 int prepend_sign, last_one_off;
31721 Py_ssize_t remaining;
31722#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31723#pragma GCC diagnostic push
31724#pragma GCC diagnostic ignored "-Wconversion"
31725#endif
31726 const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
31727#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31728#pragma GCC diagnostic pop
31729#endif
31730 const int is_unsigned = neg_one > const_zero;
31731 if (format_char == 'X') {
31732 hex_digits += 16;
31733 format_char = 'x';
31734 }
31735 remaining = value;
31736 last_one_off = 0;
31737 dpos = end;
31738 do {
31739 int digit_pos;
31740 switch (format_char) {
31741 case 'o':
31742 digit_pos = abs((int)(remaining % (8*8)));
31743 remaining = (Py_ssize_t) (remaining / (8*8));
31744 dpos -= 2;
31745 memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
31746 last_one_off = (digit_pos < 8);
31747 break;
31748 case 'd':
31749 digit_pos = abs((int)(remaining % (10*10)));
31750 remaining = (Py_ssize_t) (remaining / (10*10));
31751 dpos -= 2;
31752 memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
31753 last_one_off = (digit_pos < 10);
31754 break;
31755 case 'x':
31756 *(--dpos) = hex_digits[abs((int)(remaining % 16))];
31757 remaining = (Py_ssize_t) (remaining / 16);
31758 break;
31759 default:
31760 assert(0);
31761 break;
31762 }
31763 } while (unlikely(remaining != 0));
31764 assert(!last_one_off || *dpos == '0');
31765 dpos += last_one_off;
31766 length = end - dpos;
31767 ulength = length;
31768 prepend_sign = 0;
31769 if (!is_unsigned && value <= neg_one) {
31770 if (padding_char == ' ' || width <= length + 1) {
31771 *(--dpos) = '-';
31772 ++length;
31773 } else {
31774 prepend_sign = 1;
31775 }
31776 ++ulength;
31777 }
31778 if (width > ulength) {
31779 ulength = width;
31780 }
31781 if (ulength == 1) {
31782 return PyUnicode_FromOrdinal(*dpos);
31783 }
31784 return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
31785}
31786
31787/* JoinPyUnicode */
31788static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, int kind) {
31789#if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH && CYTHON_USE_UNICODE_INTERNALS
31790 PyObject *result_uval;
31791 int result_ukind, kind_shift;
31792 Py_ssize_t i, char_pos;
31793 void *result_udata;
31794 static const Py_UCS4 max_char[5] = {0x7fU, 0xffU, 0xffffU, 0xffffU, 0x10ffffU};
31795 assert (kind >= 0);
31796 if (kind > PyUnicode_4BYTE_KIND) kind = PyUnicode_4BYTE_KIND;
31797 result_uval = PyUnicode_New(result_ulength, max_char[kind]);
31798 if (unlikely(!result_uval)) return NULL;
31799 kind_shift = kind >> 1; // 0, 1, 2
31800 result_ukind = 1 << kind_shift; // 1, 2, 4
31801 result_udata = PyUnicode_DATA(result_uval);
31802 assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
31803 if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0))
31804 goto overflow;
31805 char_pos = 0;
31806 for (i=0; i < value_count; i++) {
31807 int ukind;
31808 Py_ssize_t ulength;
31809 void *udata;
31810 PyObject *uval = values[i];
31811 if (__Pyx_PyUnicode_READY(uval) == (-1))
31812 goto bad;
31813 ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
31814 #if !CYTHON_ASSUME_SAFE_SIZE
31815 if (unlikely(ulength < 0)) goto bad;
31816 #endif
31817 if (unlikely(!ulength))
31818 continue;
31819 if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
31820 goto overflow;
31821 ukind = __Pyx_PyUnicode_KIND(uval);
31822 udata = __Pyx_PyUnicode_DATA(uval);
31823 if (ukind == result_ukind) {
31824 memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
31825 } else {
31826 #if PY_VERSION_HEX >= 0x030d0000
31827 if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
31828 #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters)
31829 _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
31830 #else
31831 Py_ssize_t j;
31832 for (j=0; j < ulength; j++) {
31833 Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
31834 __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
31835 }
31836 #endif
31837 }
31838 char_pos += ulength;
31839 }
31840 return result_uval;
31841overflow:
31842 PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
31843bad:
31844 Py_DECREF(result_uval);
31845 return NULL;
31846#else
31847 Py_ssize_t i;
31848 PyObject *result = NULL;
31849 PyObject *value_tuple = PyTuple_New(value_count);
31850 if (unlikely(!value_tuple)) return NULL;
31851 CYTHON_UNUSED_VAR(kind);
31852 CYTHON_UNUSED_VAR(result_ulength);
31853 for (i=0; i<value_count; i++) {
31854 Py_INCREF(values[i]);
31855 if (__Pyx_PyTuple_SET_ITEM(value_tuple, i, values[i]) != (0)) goto bad;
31856 }
31857 result = PyUnicode_Join(__pyx_mstate_global->__pyx_empty_unicode, value_tuple);
31858bad:
31859 Py_DECREF(value_tuple);
31860 return result;
31861#endif
31862}
31863
31864/* UnicodeEqualsUCS4 (used by UnicodeEquals_uchar) */
31865#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL)
31866static CYTHON_INLINE int __Pyx__PyUnicode_EqualsUCS4(PyObject* s1, Py_UCS4 ch2, int equals) {
31867 Py_ssize_t length;
31868 Py_UCS4 ch1;
31869 int kind;
31870 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0)) goto bad;
31871 length = __Pyx_PyUnicode_GET_LENGTH(s1);
31872 #if !CYTHON_ASSUME_SAFE_SIZE
31873 if (unlikely(length < 0)) goto bad;
31874 #endif
31875 if (length != 1) goto return_ne;
31876 kind = PyUnicode_KIND(s1);
31877 if (ch2 < 256) {
31878 if (likely(kind == PyUnicode_1BYTE_KIND)) {
31879 ch1 = PyUnicode_1BYTE_DATA(s1)[0];
31880 } else if (kind == PyUnicode_2BYTE_KIND) {
31881 ch1 = PyUnicode_2BYTE_DATA(s1)[0];
31882 } else {
31883 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
31884 }
31885 } else if (ch2 < 65536) {
31886 if (kind == PyUnicode_2BYTE_KIND) {
31887 ch1 = PyUnicode_2BYTE_DATA(s1)[0];
31888 } else if (kind == PyUnicode_4BYTE_KIND) {
31889 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
31890 } else {
31891 goto return_ne;
31892 }
31893 } else {
31894 if (kind == PyUnicode_4BYTE_KIND){
31895 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
31896 } else {
31897 goto return_ne;
31898 }
31899 }
31900 if (ch1 == ch2) {
31901 goto return_eq;
31902 } else {
31903 goto return_ne;
31904 }
31905return_eq:
31906 return (equals == Py_EQ);
31907return_ne:
31908 return (equals == Py_NE);
31909bad:
31910 return -1;
31911}
31912#endif
31913
31914/* PyObjectCompare */
31915#ifndef __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
31916#define __Pyx_DEFINED_PyObject_CompareStrStrBoolEq
31917static CYTHON_INLINE int __Pyx_PyObject_CompareStrStrBoolEq(PyObject* s1, PyObject* s2) {
31918 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
31919 int result = PyUnicode_Equal(s1, s2);
31920 #if !CYTHON_COMPILING_IN_CPYTHON
31921 if (unlikely(result == -1)) return -1;
31922 #endif
31923 if (result == 0) goto __pyx_return_false; else goto __pyx_return_true;
31924 #else
31925 int result = PyUnicode_Compare(s1, s2);
31926 if (unlikely((result == -1) && PyErr_Occurred())) return -1;
31927 if (result == 0) goto __pyx_return_true; else goto __pyx_return_false;
31928 #endif
31929__pyx_return_true:
31930 return 1;
31931__pyx_return_false:
31932 return 0;
31933}
31934#endif
31935static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_object_str(PyObject *op1, PyObject *op2, int pyop) {
31936 CYTHON_UNUSED_VAR(pyop);
31937 if (unlikely(op2 == Py_None)) {
31938 if (op1 == Py_None) goto __pyx_return_true; else goto __pyx_richcmp;
31939 }
31940 if (PyFloat_CheckExact(op1)) {
31941 goto __pyx_richcmp;
31942 }
31943 if (PyLong_CheckExact(op1)) {
31944 if (op1 == op2) goto __pyx_return_true;
31945 goto __pyx_richcmp;
31946 }
31947
31948 if (likely(PyUnicode_CheckExact(op1))) {
31949 if (op1 == op2) goto __pyx_return_true;
31950 if (likely(op2 != Py_None)) {
31951 return __Pyx_PyObject_CompareStrStrBoolEq(op1, op2);
31952 }
31953 goto __pyx_richcmp;
31954 }
31955
31956 if ((0)) goto __pyx_richcmp;
31957 if ((0)) goto __pyx_return_true;
31958 if ((0)) goto __pyx_return_false;
31959__pyx_richcmp:
31960 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
31961__pyx_return_true:
31962 return 1;
31963__pyx_return_false:
31964 return 0;
31965}
31966
31967/* PyObjectCompare */
31968#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
31969#ifndef __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesEq
31970#define __Pyx_DEFINED_PyObject_ComparePyBytesPyBytesEq
31971static CYTHON_INLINE PyObject* __Pyx_PyObject_ComparePyBytesPyBytesEq(PyObject* s1, PyObject* s2) {
31972 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
31973 const char *ps1, *ps2;
31974 Py_ssize_t length = PyBytes_GET_SIZE(s1);
31975 if (length != PyBytes_GET_SIZE(s2)) goto __pyx_return_false;
31976 ps1 = PyBytes_AS_STRING(s1);
31977 ps2 = PyBytes_AS_STRING(s2);
31978 #else
31979 char *ps1, *ps2;
31980 Py_ssize_t length, length2;
31981 if (unlikely(PyBytes_AsStringAndSize(s1, &ps1, &length) == -1)) return NULL;
31982 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1)) return NULL;
31983 if (length != length2) goto __pyx_return_false;
31984 #endif
31985 if (ps1[0] != ps2[0]) goto __pyx_return_false;
31986 if (length == 1) goto __pyx_return_true;
31987 {
31988 int cmp;
31989#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
31990 Py_hash_t hash1 = ((PyBytesObject*)s1)->ob_shash;
31991 Py_hash_t hash2 = ((PyBytesObject*)s2)->ob_shash;
31992 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) goto __pyx_return_false;
31993#endif
31994 cmp = memcmp(ps1, ps2, (size_t)length);
31995 if (cmp == 0) goto __pyx_return_true; else goto __pyx_return_false;
31996 }
31997__pyx_return_true:
31998 Py_RETURN_TRUE;
31999__pyx_return_false:
32000 Py_RETURN_FALSE;
32001}
32002#endif
32003#endif
32004#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
32005#ifndef __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesEq
32006#define __Pyx_DEFINED_PyObject_ComparePyByteArrayPyBytesEq
32007static CYTHON_INLINE PyObject* __Pyx_PyObject_ComparePyByteArrayPyBytesEq(PyObject* s1, PyObject* s2) {
32008 #if CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
32009 const char *ps1, *ps2;
32010 Py_ssize_t length = PyByteArray_GET_SIZE(s1);
32011 if (length != PyBytes_GET_SIZE(s2)) goto __pyx_return_false;
32012 ps1 = PyByteArray_AS_STRING(s1);
32013 ps2 = PyBytes_AS_STRING(s2);
32014 #else
32015 char *ps1, *ps2;
32016 Py_ssize_t length, length2;
32017 ps1 = __Pyx_PyByteArray_AsString(s1); if (unlikely(!ps1)) return NULL;
32018 length = __Pyx_PyByteArray_GET_SIZE(s1); if (unlikely(length == -1)) return NULL;
32019 if (unlikely(PyBytes_AsStringAndSize(s2, &ps2, &length2) == -1)) return NULL;
32020 if (length != length2) goto __pyx_return_false;
32021 #endif
32022 if (length == 0) goto __pyx_return_true;
32023 if (ps1[0] != ps2[0]) goto __pyx_return_false;
32024 if (length == 1) goto __pyx_return_true;
32025 {
32026 int cmp;
32027 cmp = memcmp(ps1, ps2, (size_t)length);
32028 if (cmp == 0) goto __pyx_return_true; else goto __pyx_return_false;
32029 }
32030__pyx_return_true:
32031 Py_RETURN_TRUE;
32032__pyx_return_false:
32033 Py_RETURN_FALSE;
32034}
32035#endif
32036#endif
32037static CYTHON_INLINE PyObject* __Pyx_PyObject_CompareEq_object_bytes(PyObject *op1, PyObject *op2, int pyop) {
32038 CYTHON_UNUSED_VAR(pyop);
32039 if (unlikely(op2 == Py_None)) {
32040 if (op1 == Py_None) goto __pyx_return_true; else goto __pyx_richcmp;
32041 }
32042 if (PyFloat_CheckExact(op1)) {
32043 goto __pyx_richcmp;
32044 }
32045 if (PyLong_CheckExact(op1)) {
32046 if (op1 == op2) goto __pyx_return_true;
32047 goto __pyx_richcmp;
32048 }
32049 #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL)
32050 if (likely(PyBytes_CheckExact(op1))) {
32051 if (op1 == op2) goto __pyx_return_true;
32052 if (likely(op2 != Py_None)) {
32053 return __Pyx_PyObject_ComparePyBytesPyBytesEq(op1, op2);
32054 }
32055 goto __pyx_richcmp;
32056 }
32057 #endif
32058 if ((0)) goto __pyx_richcmp;
32059 if ((0)) goto __pyx_return_true;
32060 if ((0)) goto __pyx_return_false;
32061__pyx_richcmp:
32062 return PyObject_RichCompare(op1, op2, Py_EQ);
32063__pyx_return_true:
32064 Py_RETURN_TRUE;
32065__pyx_return_false:
32066 Py_RETURN_FALSE;
32067}
32068
32069/* GetAttr */
32070static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
32071#if CYTHON_USE_TYPE_SLOTS
32072 if (likely(PyUnicode_Check(n)))
32073 return __Pyx_PyObject_GetAttrStr(o, n);
32074#endif
32075 return PyObject_GetAttr(o, n);
32076}
32077
32078/* PyFrozenDict (used by GetItemInt) */
32079#if CYTHON_COMPILING_IN_LIMITED_API
32080static CYTHON_INLINE PyObject* __Pyx__PyFrozenDict_New(PyObject* frozendict_type, PyObject* it) {
32081 return PyObject_CallFunctionObjArgs(frozendict_type, it, NULL);
32082}
32083#endif
32084
32085/* GettItemInt_wraparound (used by GetItemInt) */
32086#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
32087static int __Pyx_GetItemInt_wraparound(PyObject *o, PySequenceMethods *sm, Py_ssize_t *i) {
32088 assert(*i < 0);
32089 if (likely(sm->sq_length)) {
32090 Py_ssize_t l = sm->sq_length(o);
32091 if (likely(l >= 0)) {
32092 *i += l;
32093 } else {
32094 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
32095 return -1;
32096 PyErr_Clear();
32097 }
32098 }
32099 return 0;
32100}
32101#endif
32102
32103/* GetItemInt */
32104static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
32105 PyObject *r;
32106 if (unlikely(!j)) return NULL;
32107 r = PyObject_GetItem(o, j);
32108 Py_DECREF(j);
32109 return r;
32110}
32111static PyObject *__Pyx_GetItemInt_Generic_size(PyObject *o, Py_ssize_t i) {
32112 return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
32113}
32114static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
32115 int wraparound, int boundscheck, int unsafe_shared) {
32116 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
32117#if CYTHON_AVOID_BORROWED_REFS
32118 CYTHON_UNUSED_VAR(boundscheck);
32119 Py_ssize_t wrapped_i = i;
32120 if (wraparound & unlikely(i < 0)) {
32121 Py_ssize_t size = __Pyx_PyList_GET_SIZE(o);
32122 #if !CYTHON_ASSUME_SAFE_SIZE
32123 if (unlikely(size < 0)) return NULL;
32124 #endif
32125 wrapped_i += size;
32126 }
32127 return __Pyx_PyList_GetItemRef(o, wrapped_i);
32128#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
32129 Py_ssize_t wrapped_i = i;
32130 Py_ssize_t size = (wraparound | boundscheck) ? PyList_GET_SIZE(o) : -1;
32131 if (wraparound & unlikely(i < 0)) {
32132 wrapped_i += size;
32133 }
32134 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
32135 return __Pyx_PyList_GET_ITEM_REF(o, wrapped_i, unsafe_shared);
32136 }
32137 return __Pyx_GetItemInt_Generic_size(o, i);
32138#else
32139 (void)wraparound;
32140 (void)boundscheck;
32141 return PySequence_GetItem(o, i);
32142#endif
32143}
32144static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
32145 int wraparound, int boundscheck, int unsafe_shared) {
32146 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
32147#if CYTHON_AVOID_BORROWED_REFS
32148 CYTHON_UNUSED_VAR(boundscheck);
32149 Py_ssize_t wrapped_i = i;
32150 if (wraparound & unlikely(i < 0)) {
32151 Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(o);
32152 #if !CYTHON_ASSUME_SAFE_SIZE
32153 if (unlikely(size < 0)) return NULL;
32154 #endif
32155 wrapped_i += size;
32156 }
32157 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_LIMITED_API
32158 return PySequence_ITEM(o, wrapped_i);
32159 #else
32160 if (unlikely(wrapped_i < 0)) {
32161 PyErr_SetString(PyExc_IndexError, "tuple index out of range");
32162 return NULL;
32163 }
32164 return PySequence_GetItem(o, wrapped_i);
32165 #endif
32166#elif CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS
32167 Py_ssize_t wrapped_i = i;
32168 Py_ssize_t size = (wraparound | boundscheck) ? PyTuple_GET_SIZE(o) : -1;
32169 if (wraparound & unlikely(i < 0)) {
32170 wrapped_i += size;
32171 }
32172 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
32173 return __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(o, wrapped_i));
32174 }
32175 return __Pyx_GetItemInt_Generic_size(o, i);
32176#else
32177 (void)wraparound;
32178 (void)boundscheck;
32179 return PySequence_GetItem(o, i);
32180#endif
32181}
32182#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
32183static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast_mapping(PyObject *o, binaryfunc getitem, Py_ssize_t i) {
32184 PyObject *r, *key = PyLong_FromSsize_t(i);
32185 if (unlikely(!key)) return NULL;
32186 r = getitem(o, key);
32187 Py_DECREF(key);
32188 return r;
32189}
32190#endif
32191static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
32192 int wraparound, int boundscheck, int unsafe_shared) {
32193 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
32194#if CYTHON_ASSUME_SAFE_SIZE
32195 if (PyList_CheckExact(o)) {
32196 return __Pyx_GetItemInt_List_Fast(o, i, wraparound, boundscheck, unsafe_shared);
32197 } else
32198 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
32199 if (PyTuple_CheckExact(o)) {
32200 return __Pyx_GetItemInt_Tuple_Fast(o, i, wraparound, boundscheck, unsafe_shared);
32201 } else
32202 #endif
32203#else
32204 if ((!wraparound || i >= 0) & PyList_CheckExact(o)) {
32205 return boundscheck ? __Pyx_PyList_GetItemRef(o, i) : __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared);
32206 } else
32207#endif
32208#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
32209 if (PyDict_CheckExact(o)) {
32210 return __Pyx_GetItemInt_Fast_mapping(o, PyDict_Type.tp_as_mapping->mp_subscript, i);
32211 #if defined(PyFrozenDict_CheckExact)
32212 } else if (PyFrozenDict_CheckExact(o)) {
32213 return __Pyx_GetItemInt_Fast_mapping(o, PyFrozenDict_Type.tp_as_mapping->mp_subscript, i);
32214 #endif
32215 } else
32216 {
32217 PyTypeObject *obj_type = Py_TYPE(o);
32218 int seq_or_mapping = __Pyx_PyType_GetFlags(obj_type) & (Py_TPFLAGS_SEQUENCE|Py_TPFLAGS_MAPPING);
32219 if (seq_or_mapping != Py_TPFLAGS_SEQUENCE) {
32220 PyMappingMethods *mm = obj_type->tp_as_mapping;
32221 if (mm && mm->mp_subscript)
32222 return __Pyx_GetItemInt_Fast_mapping(o, mm->mp_subscript, i);
32223 }
32224 PySequenceMethods *sm = obj_type->tp_as_sequence;
32225 if (likely(sm && sm->sq_item)) {
32226 if (wraparound && (i < 0) && unlikely(__Pyx_GetItemInt_wraparound(o, sm, &i) == -1))
32227 return NULL;
32228 return sm->sq_item(o, i);
32229 }
32230 if (seq_or_mapping == Py_TPFLAGS_SEQUENCE) {
32231 PyMappingMethods *mm = obj_type->tp_as_mapping;
32232 if (likely(mm && mm->mp_subscript))
32233 return __Pyx_GetItemInt_Fast_mapping(o, mm->mp_subscript, i);
32234 }
32235 }
32236#else
32237 if (!PyMapping_Check(o)) {
32238 return PySequence_GetItem(o, i);
32239 }
32240#endif
32241 (void)wraparound;
32242 (void)boundscheck;
32243 return __Pyx_GetItemInt_Generic_size(o, i);
32244}
32245
32246/* RaiseErrorWithObjectType (used by ObjectGetItem) */
32247static void __Pyx_RaiseErrorWithType(PyObject* exc_type, const char* message, PyTypeObject *type_obj) {
32248 __Pyx_TypeName type_name = __Pyx_PyType_GetFullyQualifiedName(type_obj);
32249 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
32250 if (unlikely(!type_name)) return;
32251 #endif
32252 PyErr_Format(exc_type, message, type_name);
32253 __Pyx_DECREF_TypeName(type_name);
32254}
32255
32256/* ObjectGetItem */
32257#if CYTHON_USE_TYPE_SLOTS
32258static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
32259 PyObject *runerr = NULL;
32260 Py_ssize_t key_value;
32261 key_value = __Pyx_PyIndex_AsSsize_t(index);
32262 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
32263 return __Pyx_GetItemInt_Fast(obj, key_value, 1, 1, 1);
32264 }
32265 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
32266 PyErr_Clear();
32267 __Pyx_RaiseErrorWithObjectType(
32268 PyExc_IndexError,
32269 "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer",
32270 index);
32271 }
32272 return NULL;
32273}
32274static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
32275 if (likely(PyType_Check(obj))) {
32276 if ((PyTypeObject*)obj == &PyType_Type) {
32277 return Py_GenericAlias(obj, key);
32278 }
32279 PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem);
32280 if (!meth) {
32281 if (PyErr_Occurred()) {
32282 return NULL;
32283 }
32284 } else {
32285 PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
32286 Py_DECREF(meth);
32287 return result;
32288 }
32289 }
32290 __Pyx_RaiseTypeErrorWithObjectType(
32291 "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj);
32292 return NULL;
32293}
32294static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
32295 PyTypeObject *tp = Py_TYPE(obj);
32296 PyMappingMethods *mm = tp->tp_as_mapping;
32297 PySequenceMethods *sm = tp->tp_as_sequence;
32298 if (likely(mm && mm->mp_subscript)) {
32299 return mm->mp_subscript(obj, key);
32300 }
32301 if (likely(sm && sm->sq_item)) {
32302 return __Pyx_PyObject_GetIndex(obj, key);
32303 }
32304 return __Pyx_PyObject_GetItem_Slow(obj, key);
32305}
32306#endif
32307
32308/* RejectKeywords */
32309static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds) {
32310 PyObject *key = NULL;
32311 if (CYTHON_VECTORCALL && likely(PyTuple_Check(kwds))) {
32312 key = __Pyx_PySequence_ITEM(kwds, 0);
32313 } else {
32314#if CYTHON_AVOID_BORROWED_REFS
32315 PyObject *pos = NULL;
32316#else
32317 Py_ssize_t pos = 0;
32318#endif
32319#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
32320 if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return;
32321#endif
32322 __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL);
32323#if CYTHON_AVOID_BORROWED_REFS
32324 Py_XDECREF(pos);
32325#endif
32326 }
32327 if (likely(key)) {
32328 PyErr_Format(PyExc_TypeError,
32329 "%s() got an unexpected keyword argument '%U'",
32330 function_name, key);
32331 Py_DECREF(key);
32332 }
32333}
32334
32335/* DivInt[Py_ssize_t] */
32336static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b, int b_is_constant) {
32337 Py_ssize_t q = a / b;
32338 Py_ssize_t r = a - q*b;
32339 Py_ssize_t adapt_python = (b_is_constant ?
32340 ((r != 0) & ((r < 0) ^ (b < 0))) :
32341 ((r != 0) & ((r ^ b) < 0))
32342 );
32343 return q - adapt_python;
32344}
32345
32346/* GetAttr3 */
32347#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
32348static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
32349 __Pyx_PyThreadState_declare
32350 __Pyx_PyThreadState_assign
32351 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
32352 return NULL;
32353 __Pyx_PyErr_Clear();
32354 Py_INCREF(d);
32355 return d;
32356}
32357#endif
32358static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
32359 PyObject *r;
32360#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
32361 int res = PyObject_GetOptionalAttr(o, n, &r);
32362 return (res != 0) ? r : __Pyx_NewRef(d);
32363#else
32364 #if CYTHON_USE_TYPE_SLOTS
32365 if (likely(PyUnicode_Check(n))) {
32366 r = __Pyx_PyObject_GetAttrStrNoError(o, n);
32367 if (unlikely(!r) && likely(!PyErr_Occurred())) {
32368 r = __Pyx_NewRef(d);
32369 }
32370 return r;
32371 }
32372 #endif
32373 r = PyObject_GetAttr(o, n);
32374 return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
32375#endif
32376}
32377
32378/* PyDictVersioning (used by GetModuleGlobalName) */
32379#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
32380static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
32381 PyObject *dict = Py_TYPE(obj)->tp_dict;
32382 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
32383}
32384static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
32385 PyObject **dictptr = NULL;
32386 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
32387 if (offset) {
32388#if CYTHON_COMPILING_IN_CPYTHON
32389 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
32390#else
32391 dictptr = _PyObject_GetDictPtr(obj);
32392#endif
32393 }
32394 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
32395}
32396static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
32397 PyObject *dict = Py_TYPE(obj)->tp_dict;
32398 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
32399 return 0;
32400 return obj_dict_version == __Pyx_get_object_dict_version(obj);
32401}
32402#endif
32403
32404/* GetModuleGlobalName */
32405#if CYTHON_USE_DICT_VERSIONS
32406static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
32407#else
32408static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
32409#endif
32410{
32411 PyObject *result;
32412#if CYTHON_COMPILING_IN_LIMITED_API
32413 if (unlikely(!__pyx_m)) {
32414 if (!PyErr_Occurred())
32415 PyErr_SetNone(PyExc_NameError);
32416 return NULL;
32417 }
32418 result = PyObject_GetAttr(__pyx_m, name);
32419 if (likely(result)) {
32420 return result;
32421 }
32422 if (!__Pyx_IgnoreException(PyExc_Exception)) {
32423 return NULL; // BaseException
32424 }
32425#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
32426 if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) {
32427 if (!__Pyx_IgnoreException(PyExc_Exception)) {
32428 return NULL; // BaseException
32429 }
32430 }
32431 __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
32432 if (likely(result)) {
32433 return result;
32434 }
32435#else
32436 result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash);
32437 __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
32438 if (likely(result)) {
32439 return __Pyx_NewRef(result);
32440 }
32441 PyObject *exc = PyErr_Occurred();
32442 if (unlikely(exc) && !__Pyx_IgnoreGivenException(exc, PyExc_Exception)) {
32443 return NULL; // BaseException
32444 }
32445#endif
32446 return __Pyx_GetBuiltinName(name);
32447}
32448
32449/* RaiseTooManyValuesToUnpack */
32450static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
32451 PyErr_Format(PyExc_ValueError,
32452 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
32453}
32454
32455/* RaiseNeedMoreValuesToUnpack */
32456static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
32457 PyErr_Format(PyExc_ValueError,
32458 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
32459 index, (index == 1) ? "" : "s");
32460}
32461
32462/* RaiseNoneIterError */
32463static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
32464 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
32465}
32466
32467/* GetTopmostException (used by SaveResetException) */
32468#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
32469static _PyErr_StackItem *
32470__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
32471{
32472 _PyErr_StackItem *exc_info = tstate->exc_info;
32473 while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
32474 exc_info->previous_item != NULL)
32475 {
32476 exc_info = exc_info->previous_item;
32477 }
32478 return exc_info;
32479}
32480#endif
32481
32482/* SaveResetException */
32483#if CYTHON_FAST_THREAD_STATE
32484static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
32485 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
32486 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
32487 PyObject *exc_value = exc_info->exc_value;
32488 if (exc_value == NULL || exc_value == Py_None) {
32489 *value = NULL;
32490 *type = NULL;
32491 *tb = NULL;
32492 } else {
32493 *value = exc_value;
32494 Py_INCREF(*value);
32495 *type = (PyObject*) Py_TYPE(exc_value);
32496 Py_INCREF(*type);
32497 *tb = PyException_GetTraceback(exc_value);
32498 }
32499 #elif CYTHON_USE_EXC_INFO_STACK
32500 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
32501 *type = exc_info->exc_type;
32502 *value = exc_info->exc_value;
32503 *tb = exc_info->exc_traceback;
32504 Py_XINCREF(*type);
32505 Py_XINCREF(*value);
32506 Py_XINCREF(*tb);
32507 #else
32508 *type = tstate->exc_type;
32509 *value = tstate->exc_value;
32510 *tb = tstate->exc_traceback;
32511 Py_XINCREF(*type);
32512 Py_XINCREF(*value);
32513 Py_XINCREF(*tb);
32514 #endif
32515}
32516static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
32517 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
32518 _PyErr_StackItem *exc_info = tstate->exc_info;
32519 PyObject *tmp_value = exc_info->exc_value;
32520 exc_info->exc_value = value;
32521 Py_XDECREF(tmp_value);
32522 Py_XDECREF(type);
32523 Py_XDECREF(tb);
32524 #else
32525 PyObject *tmp_type, *tmp_value, *tmp_tb;
32526 #if CYTHON_USE_EXC_INFO_STACK
32527 _PyErr_StackItem *exc_info = tstate->exc_info;
32528 tmp_type = exc_info->exc_type;
32529 tmp_value = exc_info->exc_value;
32530 tmp_tb = exc_info->exc_traceback;
32531 exc_info->exc_type = type;
32532 exc_info->exc_value = value;
32533 exc_info->exc_traceback = tb;
32534 #else
32535 tmp_type = tstate->exc_type;
32536 tmp_value = tstate->exc_value;
32537 tmp_tb = tstate->exc_traceback;
32538 tstate->exc_type = type;
32539 tstate->exc_value = value;
32540 tstate->exc_traceback = tb;
32541 #endif
32542 Py_XDECREF(tmp_type);
32543 Py_XDECREF(tmp_value);
32544 Py_XDECREF(tmp_tb);
32545 #endif
32546}
32547#endif
32548
32549/* RaiseErrorWithObjectTypes (used by ExtTypeTest) */
32550static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type, const char *message, const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2) {
32551 __Pyx_TypeName type_name1 = __Pyx_PyType_GetFullyQualifiedName(type_obj1);
32552 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
32553 if (unlikely(!type_name1)) return;
32554 #endif
32555 __Pyx_TypeName type_name2 = __Pyx_PyType_GetFullyQualifiedName(type_obj2);
32556 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
32557 if (unlikely(!type_name2)) goto type2_failed;
32558 #endif
32559 PyErr_Format(exc_type, message, arg, type_name1, type_name2);
32560 __Pyx_DECREF_TypeName(type_name2);
32561#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
32562type2_failed:
32563#endif
32564 __Pyx_DECREF_TypeName(type_name1);
32565}
32566
32567/* ExtTypeTest */
32568static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
32569 if (unlikely(!type)) {
32570 PyErr_SetString(PyExc_SystemError, "Missing type object");
32571 return 0;
32572 }
32573 if (likely(__Pyx_TypeCheck(obj, type)))
32574 return 1;
32575 __Pyx_RaiseTypeErrorWithTypes(
32576 "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
32577 Py_TYPE(obj), type);
32578 return 0;
32579}
32580
32581/* GetException */
32582#if CYTHON_FAST_THREAD_STATE
32583static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
32584#else
32585static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
32586#endif
32587{
32588 PyObject *local_type = NULL, *local_value, *local_tb = NULL;
32589#if CYTHON_FAST_THREAD_STATE
32590 PyObject *tmp_type, *tmp_value, *tmp_tb;
32591 #if PY_VERSION_HEX >= 0x030C0000
32592 local_value = tstate->current_exception;
32593 tstate->current_exception = 0;
32594 #else
32595 local_type = tstate->curexc_type;
32596 local_value = tstate->curexc_value;
32597 local_tb = tstate->curexc_traceback;
32598 tstate->curexc_type = 0;
32599 tstate->curexc_value = 0;
32600 tstate->curexc_traceback = 0;
32601 #endif
32602#elif __PYX_LIMITED_VERSION_HEX >= 0x030C0000
32603 local_value = PyErr_GetRaisedException();
32604#else
32605 PyErr_Fetch(&local_type, &local_value, &local_tb);
32606#endif
32607#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
32608 if (likely(local_value)) {
32609 local_type = (PyObject*) Py_TYPE(local_value);
32610 Py_INCREF(local_type);
32611 local_tb = PyException_GetTraceback(local_value);
32612 }
32613#else
32614 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
32615#if CYTHON_FAST_THREAD_STATE
32616 if (unlikely(tstate->curexc_type))
32617#else
32618 if (unlikely(PyErr_Occurred()))
32619#endif
32620 goto bad;
32621 if (local_tb) {
32622 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
32623 goto bad;
32624 }
32625#endif // __PYX_LIMITED_VERSION_HEX >= 0x030C0000
32626 Py_XINCREF(local_tb);
32627 Py_XINCREF(local_type);
32628 Py_XINCREF(local_value);
32629 *type = local_type;
32630 *value = local_value;
32631 *tb = local_tb;
32632#if CYTHON_FAST_THREAD_STATE
32633 #if CYTHON_USE_EXC_INFO_STACK
32634 {
32635 _PyErr_StackItem *exc_info = tstate->exc_info;
32636 #if PY_VERSION_HEX >= 0x030B00a4
32637 tmp_value = exc_info->exc_value;
32638 exc_info->exc_value = local_value;
32639 tmp_type = NULL;
32640 tmp_tb = NULL;
32641 Py_XDECREF(local_type);
32642 Py_XDECREF(local_tb);
32643 #else
32644 tmp_type = exc_info->exc_type;
32645 tmp_value = exc_info->exc_value;
32646 tmp_tb = exc_info->exc_traceback;
32647 exc_info->exc_type = local_type;
32648 exc_info->exc_value = local_value;
32649 exc_info->exc_traceback = local_tb;
32650 #endif
32651 }
32652 #else
32653 tmp_type = tstate->exc_type;
32654 tmp_value = tstate->exc_value;
32655 tmp_tb = tstate->exc_traceback;
32656 tstate->exc_type = local_type;
32657 tstate->exc_value = local_value;
32658 tstate->exc_traceback = local_tb;
32659 #endif
32660 Py_XDECREF(tmp_type);
32661 Py_XDECREF(tmp_value);
32662 Py_XDECREF(tmp_tb);
32663#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000
32664 PyErr_SetHandledException(local_value);
32665 Py_XDECREF(local_value);
32666 Py_XDECREF(local_type);
32667 Py_XDECREF(local_tb);
32668#else
32669 PyErr_SetExcInfo(local_type, local_value, local_tb);
32670#endif
32671 return 0;
32672#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
32673bad:
32674 *type = 0;
32675 *value = 0;
32676 *tb = 0;
32677 Py_XDECREF(local_type);
32678 Py_XDECREF(local_value);
32679 Py_XDECREF(local_tb);
32680 return -1;
32681#endif
32682}
32683
32684/* SwapException */
32685#if CYTHON_FAST_THREAD_STATE
32686static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
32687 PyObject *tmp_type, *tmp_value, *tmp_tb;
32688 #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
32689 _PyErr_StackItem *exc_info = tstate->exc_info;
32690 tmp_value = exc_info->exc_value;
32691 exc_info->exc_value = *value;
32692 if (tmp_value == NULL || tmp_value == Py_None) {
32693 Py_XDECREF(tmp_value);
32694 tmp_value = NULL;
32695 tmp_type = NULL;
32696 tmp_tb = NULL;
32697 } else {
32698 tmp_type = (PyObject*) Py_TYPE(tmp_value);
32699 Py_INCREF(tmp_type);
32700 #if CYTHON_COMPILING_IN_CPYTHON
32701 tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
32702 Py_XINCREF(tmp_tb);
32703 #else
32704 tmp_tb = PyException_GetTraceback(tmp_value);
32705 #endif
32706 }
32707 #elif CYTHON_USE_EXC_INFO_STACK
32708 _PyErr_StackItem *exc_info = tstate->exc_info;
32709 tmp_type = exc_info->exc_type;
32710 tmp_value = exc_info->exc_value;
32711 tmp_tb = exc_info->exc_traceback;
32712 exc_info->exc_type = *type;
32713 exc_info->exc_value = *value;
32714 exc_info->exc_traceback = *tb;
32715 #else
32716 tmp_type = tstate->exc_type;
32717 tmp_value = tstate->exc_value;
32718 tmp_tb = tstate->exc_traceback;
32719 tstate->exc_type = *type;
32720 tstate->exc_value = *value;
32721 tstate->exc_traceback = *tb;
32722 #endif
32723 *type = tmp_type;
32724 *value = tmp_value;
32725 *tb = tmp_tb;
32726}
32727#else
32728static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
32729 PyObject *tmp_type, *tmp_value, *tmp_tb;
32730 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
32731 PyErr_SetExcInfo(*type, *value, *tb);
32732 *type = tmp_type;
32733 *value = tmp_value;
32734 *tb = tmp_tb;
32735}
32736#endif
32737
32738/* HasAttr (used by ImportImpl) */
32739#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
32740static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
32741 PyObject *r;
32742 if (unlikely(!PyUnicode_Check(n))) {
32743 PyErr_SetString(PyExc_TypeError,
32744 "hasattr(): attribute name must be string");
32745 return -1;
32746 }
32747 r = __Pyx_PyObject_GetAttrStrNoError(o, n);
32748 if (!r) {
32749 return (unlikely(PyErr_Occurred())) ? -1 : 0;
32750 } else {
32751 Py_DECREF(r);
32752 return 1;
32753 }
32754}
32755#endif
32756
32757/* TupleOrListFromArrayImpl (used by ListFromArray) */
32758CYTHON_UNUSED static PyObject *
32759__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) {
32760 PyObject *res = PyList_New(n);
32761 if (unlikely(res == NULL)) return NULL;
32762 #if CYTHON_COMPILING_IN_CPYTHON
32763 __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
32764 #else
32765 Py_ssize_t i;
32766 for (i = 0; i < n; i++) {
32767 Py_INCREF(src[i]);
32768 if (unlikely(__Pyx_PyList_SET_ITEM(res, i, src[i]) < (0))) {
32769 Py_DECREF(res);
32770 return NULL;
32771 }
32772 }
32773 #endif
32774 return res;
32775}
32776
32777/* ImportImpl (used by Import) */
32778static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
32779 PyObject *imported_module = PyImport_GetModule(qualname);
32780 if (unlikely(!imported_module)) {
32781 *module = NULL;
32782 if (PyErr_Occurred()) {
32783 return -1;
32784 }
32785 return 0;
32786 }
32787 *module = imported_module;
32788 return 1;
32789}
32790static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject **module) {
32791 PyObject *imported_module;
32792 PyObject *top_level_package_name;
32793 Py_ssize_t i;
32794 int status, module_found;
32795 Py_ssize_t dot_index;
32796 module_found = __Pyx__Import_GetModule(qualname, &imported_module);
32797 if (unlikely(!module_found || module_found == -1)) {
32798 *module = NULL;
32799 return module_found;
32800 }
32801 if (imported_names) {
32802 for (i = 0; i < len_imported_names; i++) {
32803 PyObject *imported_name = imported_names[i];
32804#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
32805 int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name);
32806#else
32807 int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
32808 if (unlikely(has_imported_attribute == -1)) goto error;
32809#endif
32810 if (!has_imported_attribute) {
32811 goto not_found;
32812 }
32813 }
32814 *module = imported_module;
32815 return 1;
32816 }
32817 dot_index = PyUnicode_FindChar(qualname, '.', 0, PY_SSIZE_T_MAX, 1);
32818 if (dot_index == -1) {
32819 *module = imported_module;
32820 return 1;
32821 }
32822 if (unlikely(dot_index == -2)) goto error;
32823 top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index);
32824 if (unlikely(!top_level_package_name)) goto error;
32825 Py_DECREF(imported_module);
32826 status = __Pyx__Import_GetModule(top_level_package_name, module);
32827 Py_DECREF(top_level_package_name);
32828 return status;
32829error:
32830 Py_DECREF(imported_module);
32831 *module = NULL;
32832 return -1;
32833not_found:
32834 Py_DECREF(imported_module);
32835 *module = NULL;
32836 return 0;
32837}
32838static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level) {
32839 PyObject *module = 0;
32840 PyObject *empty_dict = 0;
32841 PyObject *from_list = 0;
32842 int module_found;
32843 if (!qualname) {
32844 qualname = name;
32845 }
32846 module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
32847 if (likely(module_found == 1)) {
32848 return module;
32849 } else if (unlikely(module_found == -1)) {
32850 return NULL;
32851 }
32852 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030f00a6
32853 empty_dict = PyFrozenDict_New(NULL);
32854 #else
32855 empty_dict = PyDict_New();
32856 #endif
32857 if (unlikely(!empty_dict))
32858 goto bad;
32859 if (imported_names) {
32860 from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
32861 if (unlikely(!from_list))
32862 goto bad;
32863 }
32864 if (level == -1) {
32865 const char* package_sep = strchr(__Pyx_MODULE_NAME, '.');
32866 if (package_sep != (0)) {
32867 module = PyImport_ImportModuleLevelObject(
32868 name, moddict, empty_dict, from_list, 1);
32869 if (unlikely(!module)) {
32870 if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
32871 goto bad;
32872 PyErr_Clear();
32873 }
32874 }
32875 level = 0;
32876 }
32877 if (!module) {
32878 module = PyImport_ImportModuleLevelObject(
32879 name, moddict, empty_dict, from_list, level);
32880 }
32881bad:
32882 Py_XDECREF(from_list);
32883 Py_XDECREF(empty_dict);
32884 return module;
32885}
32886
32887/* Import */
32888static PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level) {
32889 return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level);
32890}
32891
32892/* ListAppendAndDecrefInternal (used by ListCompAppendAndDecref) */
32893#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
32894static CYTHON_INLINE void __Pyx__ListComp_AppendAndDecref(PyObject* list, Py_ssize_t len, PyObject* x) {
32895 PyList_SET_ITEM(list, len, x);
32896 Py_SET_SIZE(list, len + 1);
32897}
32898#endif
32899
32900/* ListCompAppendAndDecref */
32901#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
32902static CYTHON_INLINE int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x) {
32903 PyListObject* L = (PyListObject*) list;
32904 Py_ssize_t len = Py_SIZE(list);
32905 if (likely(L->allocated > len)) {
32906 __Pyx__ListComp_AppendAndDecref(list, len, x);
32907 return 0;
32908 }
32909 int result = PyList_Append(list, x);
32910 Py_DECREF(x);
32911 return result;
32912}
32913#else
32914static CYTHON_INLINE int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x) {
32915 int result = PyList_Append(list, x);
32916 Py_DECREF(x);
32917 return result;
32918}
32919#endif
32920
32921/* PySequenceMultiply */
32922#if CYTHON_USE_TYPE_SLOTS
32923static PyObject* __Pyx_PySequence_Multiply_Generic(PyObject *seq, Py_ssize_t mul) {
32924 PyObject *result, *pymul = PyLong_FromSsize_t(mul);
32925 if (unlikely(!pymul))
32926 return NULL;
32927 result = PyNumber_Multiply(seq, pymul);
32928 Py_DECREF(pymul);
32929 return result;
32930}
32931static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul) {
32932 PyTypeObject *type = Py_TYPE(seq);
32933 if (likely(type->tp_as_sequence && type->tp_as_sequence->sq_repeat)) {
32934 return type->tp_as_sequence->sq_repeat(seq, mul);
32935 } else {
32936 return __Pyx_PySequence_Multiply_Generic(seq, mul);
32937 }
32938}
32939#endif
32940
32941/* PyNumberBinop */
32942#if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_GRAAL || CYTHON_COMPILING_IN_LIMITED_API)
32943#if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
32944#ifndef __Pyx_DEFINED_BinopTypeError
32945#define __Pyx_DEFINED_BinopTypeError
32946static void __Pyx_BinopTypeError(PyObject *op1, PyObject *op2, const char* op, int inplace) {
32947 char opname[4] = {op[0], op[1], 0, 0};
32948 if (inplace) {
32949 opname[op[1] ? 2 : 1] = '=';
32950 }
32951 __Pyx_RaiseErrorWithObjectTypes1(
32952 PyExc_TypeError,
32953 "unsupported operand type(s) for %.3s: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'",
32954 opname, op1, op2);
32955}
32956#endif
32957#endif
32958#ifndef __Pyx_DEFINED_PyNumber_Multiply_xfloat_int
32959#define __Pyx_DEFINED_PyNumber_Multiply_xfloat_int
32960static PyObject* __Pyx_PyNumber_Multiply_xfloat_int(PyObject *op1, PyObject *op2, int inplace) {
32961 if (likely(op2 != Py_None)) {
32962 double int_op2;
32963 #if CYTHON_USE_PYLONG_INTERNALS
32964 if (__Pyx_PyLong_IsCompact(op2)) {
32965 Py_ssize_t compact_op2 = __Pyx_PyLong_CompactValue(op2);
32966 int_op2 = (double) compact_op2;
32967 } else
32968 #endif
32969 {
32970 int_op2 = PyLong_AsDouble(op2);
32971 if (unlikely((int_op2 == -1.) && PyErr_Occurred())) return NULL;
32972 }
32973 double float_op1 = __Pyx_PyFloat_AS_DOUBLE(op1);
32974 #if !CYTHON_ASSUME_SAFE_MACROS
32975 if (unlikely((float_op1 == -1.) && PyErr_Occurred())) return NULL;
32976 #endif
32977 if (float_op1 == 0.) return __Pyx_NewRef(op1);
32978 return PyFloat_FromDouble(float_op1 * int_op2);
32979 }
32980 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
32981 {
32982 PyTypeObject *type_op2 = Py_TYPE(op2);
32983 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
32984 if (likely(slot_func)) {
32985 PyObject *result = slot_func(op1, op2);
32986 if (likely(result != Py_NotImplemented)) {
32987 return result;
32988 }
32989 Py_DECREF(result);
32990 }
32991 __Pyx_BinopTypeError(op1, op2, "*", inplace);
32992 return NULL;
32993 }
32994 #else
32995 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
32996 #endif
32997}
32998#endif
32999#ifndef __Pyx_DEFINED_PyNumber_Multiply_xint_int
33000#define __Pyx_DEFINED_PyNumber_Multiply_xint_int
33001static PyObject* __Pyx_PyNumber_Multiply_xint_int(PyObject *op1, PyObject *op2, int inplace) {
33002 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
33003 {
33004 PyTypeObject *type_op2 = Py_TYPE(op2);
33005 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_number, nb_multiply, binaryfunc);
33006 if (likely(slot_func)) {
33007 PyObject *result = slot_func(op1, op2);
33008 if (likely(result != Py_NotImplemented)) {
33009 return result;
33010 }
33011 Py_DECREF(result);
33012 }
33013 ssizeargfunc repeat_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_sequence, sq_repeat, ssizeargfunc);
33014 if (likely(repeat_func)) {
33015 Py_ssize_t count;
33016 #if CYTHON_USE_PYLONG_INTERNALS
33017 if (__Pyx_PyLong_IsCompact(op1)) {
33018 count = __Pyx_PyLong_CompactValue(op1);
33019 } else
33020 #endif
33021 {
33022 count = PyLong_AsSsize_t(op1);
33023 if (unlikely((count == -1) && PyErr_Occurred())) return NULL;
33024 }
33025 return repeat_func(op2, count);
33026 }
33027 __Pyx_BinopTypeError(op1, op2, "*", inplace);
33028 return NULL;
33029 }
33030 #else
33031 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
33032 #endif
33033}
33034#endif
33035static CYTHON_INLINE PyObject* __Pyx__PyNumber_Multiply_object_int(PyObject *op1, PyObject *op2, int inplace) {
33036 if (PyFloat_CheckExact(op1)) {
33037 return __Pyx_PyNumber_Multiply_xfloat_int(op1, op2, inplace);
33038 }
33039 if (likely(PyLong_CheckExact(op1))) {
33040 if (likely(op2 != Py_None)) {
33041 #if CYTHON_USE_PYLONG_INTERNALS
33042 if (__Pyx_PyLong_IsCompact(op1)) {
33043 long long int_op1 = (long long) __Pyx_PyLong_CompactValue(op1);
33044 if (int_op1 == 0) return __Pyx_NewRef(op1);
33045 if (__Pyx_PyLong_IsCompact(op2)) {
33046 long long int_op2 = (long long) __Pyx_PyLong_CompactValue(op2);
33047 if (int_op2 == 0) return __Pyx_NewRef(op2);
33048 return PyLong_FromLongLong(int_op1 * int_op2);
33049 }
33050 }
33051 else if (__Pyx_PyLong_IsZero(op2)) return __Pyx_NewRef(op2);
33052 #endif
33053 binaryfunc slot_func = __Pyx_PyType_GetSubSlot(&PyLong_Type, tp_as_number, nb_multiply, binaryfunc);
33054 if (likely(slot_func)) {
33055 return slot_func(op1, op2);
33056 }
33057 }
33058 return __Pyx_PyNumber_Multiply_xint_int(op1, op2, inplace);
33059 }
33060 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
33061}
33062#endif
33063
33064/* PyObjectFormatAndDecref */
33065static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
33066 if (unlikely(!s)) return NULL;
33067 if (likely(PyUnicode_CheckExact(s))) return s;
33068 return __Pyx_PyObject_FormatAndDecref(s, f);
33069}
33070static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
33071 PyObject *result;
33072 if (unlikely(!s)) return NULL;
33073 result = PyObject_Format(s, f);
33074 Py_DECREF(s);
33075 return result;
33076}
33077
33078/* PyObjectFormat */
33079#if CYTHON_USE_UNICODE_WRITER
33080static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) {
33081 int ret;
33082 _PyUnicodeWriter writer;
33083 if (likely(PyFloat_CheckExact(obj))) {
33084 _PyUnicodeWriter_Init(&writer);
33085 ret = _PyFloat_FormatAdvancedWriter(
33086 &writer,
33087 obj,
33088 format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
33089 } else if (likely(PyLong_CheckExact(obj))) {
33090 _PyUnicodeWriter_Init(&writer);
33091 ret = _PyLong_FormatAdvancedWriter(
33092 &writer,
33093 obj,
33094 format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
33095 } else {
33096 return PyObject_Format(obj, format_spec);
33097 }
33098 if (unlikely(ret == -1)) {
33099 _PyUnicodeWriter_Dealloc(&writer);
33100 return NULL;
33101 }
33102 return _PyUnicodeWriter_Finish(&writer);
33103}
33104#endif
33105
33106/* SetItemInt */
33107static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
33108 int r;
33109 if (unlikely(!j)) return -1;
33110 r = PyObject_SetItem(o, j, v);
33111 Py_DECREF(j);
33112 return r;
33113}
33114#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
33115static CYTHON_INLINE int __Pyx_SetItemInt_Fast_mapping(PyObject *o, objobjargproc setitem, Py_ssize_t i, PyObject *value) {
33116 PyObject *key = PyLong_FromSsize_t(i);
33117 if (unlikely(!key)) return -1;
33118 int r = setitem(o, key, value);
33119 Py_DECREF(key);
33120 return r;
33121}
33122#endif
33123static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
33124 int wraparound, int boundscheck, int unsafe_shared) {
33125 CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
33126#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS
33127 if (PyList_CheckExact(o)) {
33128 Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
33129 if ((CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared))) {
33130 Py_INCREF(v);
33131 return PyList_SetItem(o, n, v);
33132 } else if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
33133 PyObject* old;
33134 Py_INCREF(v);
33135 old = PyList_GET_ITEM(o, n);
33136 PyList_SET_ITEM(o, n, v);
33137 Py_DECREF(old);
33138 return 0;
33139 }
33140 } else
33141#endif
33142#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
33143 if (PyDict_CheckExact(o)) {
33144 return __Pyx_SetItemInt_Fast_mapping(o, PyDict_Type.tp_as_mapping->mp_ass_subscript, i, v);
33145 } else
33146 {
33147 PyTypeObject *obj_type = Py_TYPE(o);
33148 int seq_or_mapping = __Pyx_PyType_GetFlags(obj_type) & (Py_TPFLAGS_SEQUENCE|Py_TPFLAGS_MAPPING);
33149 if (seq_or_mapping != Py_TPFLAGS_SEQUENCE) {
33150 PyMappingMethods *mm = obj_type->tp_as_mapping;
33151 if (mm && mm->mp_ass_subscript)
33152 return __Pyx_SetItemInt_Fast_mapping(o, mm->mp_ass_subscript, i, v);
33153 }
33154 PySequenceMethods *sm = obj_type->tp_as_sequence;
33155 if (likely(sm && sm->sq_ass_item)) {
33156 if (wraparound && (i < 0) && unlikely(__Pyx_GetItemInt_wraparound(o, sm, &i) == -1))
33157 return -1;
33158 return sm->sq_ass_item(o, i, v);
33159 }
33160 if (seq_or_mapping == Py_TPFLAGS_SEQUENCE) {
33161 PyMappingMethods *mm = obj_type->tp_as_mapping;
33162 if (likely(mm && mm->mp_ass_subscript))
33163 return __Pyx_SetItemInt_Fast_mapping(o, mm->mp_ass_subscript, i, v);
33164 }
33165 }
33166#else
33167 if (!PyMapping_Check(o)) {
33168 return PySequence_SetItem(o, i, v);
33169 }
33170#endif
33171 (void)wraparound;
33172 (void)boundscheck;
33173 return __Pyx_SetItemInt_Generic(o, PyLong_FromSsize_t(i), v);
33174}
33175
33176/* RaiseUnboundLocalError */
33177static void __Pyx_RaiseUnboundLocalError(const char *varname) {
33178 PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
33179}
33180
33181/* DivInt[long] */
33182static CYTHON_INLINE long __Pyx_div_long(long a, long b, int b_is_constant) {
33183 long q = a / b;
33184 long r = a - q*b;
33185 long adapt_python = (b_is_constant ?
33186 ((r != 0) & ((r < 0) ^ (b < 0))) :
33187 ((r != 0) & ((r ^ b) < 0))
33188 );
33189 return q - adapt_python;
33190}
33191
33192/* ListAppend */
33193#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
33194static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
33195 PyListObject* L = (PyListObject*) list;
33196 Py_ssize_t len = Py_SIZE(list);
33197 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
33198 Py_INCREF(x);
33199 __Pyx__ListComp_AppendAndDecref(list, len, x);
33200 return 0;
33201 }
33202 return PyList_Append(list, x);
33203}
33204#endif
33205
33206/* PyObjectCallMethod1 (used by StringJoin) */
33207static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
33208#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || !CYTHON_COMPILING_IN_LIMITED_API)
33209 PyObject *args[2] = {obj, arg};
33210 return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
33211#elif CYTHON_COMPILING_IN_LIMITED_API
33212 return PyObject_CallMethodObjArgs(obj, method_name, arg, NULL);
33213#else
33214 return PyObject_CallMethodOneArg(obj, method_name, arg);
33215#endif
33216}
33217
33218/* StringJoin */
33219static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
33220 (void) __Pyx_PyObject_CallMethod1;
33221#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030e0000 || defined(PyBytes_Join)
33222 return PyBytes_Join(sep, values);
33223#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyBytes_Join)
33224 return _PyBytes_Join(sep, values);
33225#else
33226 return __Pyx_PyObject_CallMethod1(sep, __pyx_mstate_global->__pyx_n_u_join, values);
33227#endif
33228}
33229
33230/* CIntToPyUnicode */
33231static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char) {
33232#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33233#pragma GCC diagnostic push
33234#pragma GCC diagnostic ignored "-Wconversion"
33235#endif
33236 const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
33237#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33238#pragma GCC diagnostic pop
33239#endif
33240 const int is_unsigned = neg_one > const_zero;
33241 if (unlikely(!(is_unsigned || value == 0 || value > 0) ||
33242 !(sizeof(value) <= 2 || value & ~ (size_t) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
33243 PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
33244 return NULL;
33245 }
33246 if (width <= 1) {
33247 return PyUnicode_FromOrdinal((int) value);
33248 }
33249 return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
33250}
33251static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char, char format_char) {
33252 char digits[sizeof(size_t)*3+2];
33253 char *dpos, *end = digits + sizeof(size_t)*3+2;
33254 const char *hex_digits = DIGITS_HEX;
33255 Py_ssize_t length, ulength;
33256 int prepend_sign, last_one_off;
33257 size_t remaining;
33258#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33259#pragma GCC diagnostic push
33260#pragma GCC diagnostic ignored "-Wconversion"
33261#endif
33262 const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
33263#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33264#pragma GCC diagnostic pop
33265#endif
33266 const int is_unsigned = neg_one > const_zero;
33267 if (format_char == 'X') {
33268 hex_digits += 16;
33269 format_char = 'x';
33270 }
33271 remaining = value;
33272 last_one_off = 0;
33273 dpos = end;
33274 do {
33275 int digit_pos;
33276 switch (format_char) {
33277 case 'o':
33278 digit_pos = abs((int)(remaining % (8*8)));
33279 remaining = (size_t) (remaining / (8*8));
33280 dpos -= 2;
33281 memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
33282 last_one_off = (digit_pos < 8);
33283 break;
33284 case 'd':
33285 digit_pos = abs((int)(remaining % (10*10)));
33286 remaining = (size_t) (remaining / (10*10));
33287 dpos -= 2;
33288 memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
33289 last_one_off = (digit_pos < 10);
33290 break;
33291 case 'x':
33292 *(--dpos) = hex_digits[abs((int)(remaining % 16))];
33293 remaining = (size_t) (remaining / 16);
33294 break;
33295 default:
33296 assert(0);
33297 break;
33298 }
33299 } while (unlikely(remaining != 0));
33300 assert(!last_one_off || *dpos == '0');
33301 dpos += last_one_off;
33302 length = end - dpos;
33303 ulength = length;
33304 prepend_sign = 0;
33305 if (!is_unsigned && value <= neg_one) {
33306 if (padding_char == ' ' || width <= length + 1) {
33307 *(--dpos) = '-';
33308 ++length;
33309 } else {
33310 prepend_sign = 1;
33311 }
33312 ++ulength;
33313 }
33314 if (width > ulength) {
33315 ulength = width;
33316 }
33317 if (ulength == 1) {
33318 return PyUnicode_FromOrdinal(*dpos);
33319 }
33320 return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
33321}
33322
33323/* PyLongBinop */
33324#if !CYTHON_COMPILING_IN_PYPY
33325static PyObject* __Pyx_Fallback___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, int inplace) {
33326 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
33327}
33328#if CYTHON_USE_PYLONG_INTERNALS
33329static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
33330 CYTHON_MAYBE_UNUSED_VAR(inplace);
33331 CYTHON_UNUSED_VAR(zerodivision_check);
33332 const long b = intval;
33333 long a;
33334 const PY_LONG_LONG llb = intval;
33335 PY_LONG_LONG lla;
33336 if (unlikely(__Pyx_PyLong_IsZero(op1))) {
33337 return __Pyx_NewRef(op2);
33338 }
33339 const int is_positive = __Pyx_PyLong_IsPos(op1);
33340 const digit* digits = __Pyx_PyLong_Digits(op1);
33341 const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
33342 if (likely(size == 1)) {
33343 a = (long) digits[0];
33344 if (!is_positive) a *= -1;
33345 } else {
33346 if (size == 2 && 8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
33347 a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
33348 if (!is_positive) a *= -1;
33349 goto calculate_long;
33350 } else if (size == 2 && 8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
33351 lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
33352 if (!is_positive) lla *= -1;
33353 goto calculate_long_long;
33354 } else
33355 if (size == 3 && 8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
33356 a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
33357 if (!is_positive) a *= -1;
33358 goto calculate_long;
33359 } else if (size == 3 && 8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
33360 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]));
33361 if (!is_positive) lla *= -1;
33362 goto calculate_long_long;
33363 } else
33364 if (size == 4 && 8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
33365 a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
33366 if (!is_positive) a *= -1;
33367 goto calculate_long;
33368 } else if (size == 4 && 8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
33369 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]));
33370 if (!is_positive) lla *= -1;
33371 goto calculate_long_long;
33372 } else
33373 {}
33374 return PyLong_Type.tp_as_number->nb_add(op1, op2);
33375 }
33376 calculate_long:
33377 {
33378 long x;
33379 x = a + b;
33380 return PyLong_FromLong(x);
33381 }
33382 calculate_long_long:
33383 {
33384 PY_LONG_LONG llx;
33385 llx = lla + llb;
33386 return PyLong_FromLongLong(llx);
33387 }
33388
33389}
33390#endif
33391static PyObject* __Pyx_Float___Pyx_PyLong_AddObjC(PyObject *float_val, long intval, int zerodivision_check) {
33392 CYTHON_UNUSED_VAR(zerodivision_check);
33393 const long b = intval;
33394 double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
33395 double result;
33396
33397 result = ((double)a) + (double)b;
33398 return PyFloat_FromDouble(result);
33399}
33400static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
33401 CYTHON_MAYBE_UNUSED_VAR(intval);
33402 CYTHON_UNUSED_VAR(zerodivision_check);
33403 #if CYTHON_USE_PYLONG_INTERNALS
33404 if (likely(PyLong_CheckExact(op1))) {
33405 return __Pyx_Unpacked___Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check);
33406 }
33407 #endif
33408 if (PyFloat_CheckExact(op1)) {
33409 return __Pyx_Float___Pyx_PyLong_AddObjC(op1, intval, zerodivision_check);
33410 }
33411 return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace);
33412}
33413#endif
33414
33415/* AllocateExtensionType */
33416static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final) {
33417 if (is_final || likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
33418 allocfunc alloc_func = __Pyx_PyType_GetSlot(t, tp_alloc, allocfunc);
33419 return alloc_func(t, 0);
33420 } else {
33421 newfunc tp_new = __Pyx_PyType_TryGetSlot(&PyBaseObject_Type, tp_new, newfunc);
33422 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
33423 if (!tp_new) {
33424 PyObject *new_str = PyUnicode_FromString("__new__");
33425 if (likely(new_str)) {
33426 PyObject *o = PyObject_CallMethodObjArgs((PyObject *)&PyBaseObject_Type, new_str, t, NULL);
33427 Py_DECREF(new_str);
33428 return o;
33429 } else
33430 return NULL;
33431 } else
33432 #endif
33433 return tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
33434 }
33435}
33436
33437/* CallSlotAsVectorcallUnpackDict (used by CallSlotAsVectorcall) */
33438static CYTHON_INLINE int __Pyx_CallSlotAsVectorcallUnpackDict(Py_ssize_t args_size, PyObject *keys_dict, PyObject **args, PyObject *kwnames) {
33439 Py_ssize_t pos = 0, i = 0;
33440 PyObject *key, *value;
33441 while (PyDict_Next(keys_dict, &pos, &key, &value)) {
33442 Py_INCREF(value);
33443 args[args_size+i] = value;
33444 Py_INCREF(key);
33445 if (unlikely(__Pyx_PyTuple_SET_ITEM(kwnames, i, key) == -1)) {
33446 return -1;
33447 }
33448 ++i;
33449 }
33450 return 0;
33451}
33452
33453/* CallSlotAsVectorcall */
33454#if CYTHON_VECTORCALL_TPNEW
33455static PyObject * __Pyx_CallTpnewAsVectorcall(__Pyx_tpnewvectorcallfunc f, PyTypeObject* o, PyObject *a, PyObject *k) {
33456 Py_ssize_t k_size = k ? __Pyx_PyDict_GET_SIZE(k) : 0;
33457#if !CYTHON_ASSUME_SAFE_SIZE
33458 if (unlikely(k_size < 0)) return NULL;
33459#endif
33460 Py_ssize_t a_size = __Pyx_PyTuple_GET_SIZE(a);
33461#if !CYTHON_ASSUME_SAFE_SIZE
33462 if (unlikely(a_size < 0)) return NULL;
33463#endif
33464#if CYTHON_ASSUME_SAFE_MACROS
33465 if (k_size == 0) {
33466 return f(o, &PyTuple_GET_ITEM(a, 0), a_size, NULL);
33467 }
33468#else
33469 if (k_size == 0 && a_size == 0) {
33470 return f(o, NULL, 0, NULL);
33471 }
33472#endif
33473 PyObject *stack_args[5];
33474 PyObject **args = stack_args;
33475 Py_ssize_t maxnargs = PY_SSIZE_T_MAX / sizeof(PyObject*) - 1;
33476 if (a_size > maxnargs - k_size) {
33477 PyErr_NoMemory();
33478 return NULL;
33479 }
33480 Py_ssize_t total_size = a_size + k_size;
33481 if (total_size > 5) {
33482 args = (PyObject**)PyMem_Malloc(((size_t)total_size)*sizeof(PyObject*));
33483 if (unlikely(!args)) {
33484 PyErr_NoMemory();
33485 return NULL;
33486 }
33487 }
33488 PyObject * result = NULL;
33489 PyObject *kwnames = NULL;
33490 int unpack_dict_result;
33491 Py_ssize_t i = 0;
33492 for (; i < a_size; ++i) {
33493 args[i] = __Pyx_PyTuple_GET_ITEM(a, i);
33494#if !CYTHON_ASSUME_SAFE_MACROS
33495 if (unlikely(!args[i])) goto cleanup;
33496#endif
33497 }
33498#if !CYTHON_ASSUME_SAFE_MACROS
33499 if (k) // There's a specific shortcut earlier for ASSUME_SAFE_MACROS with no keywords
33500#endif
33501 {
33502 kwnames = PyTuple_New(k_size);
33503 if (unlikely(!kwnames)) goto cleanup;
33504 __Pyx_BEGIN_CRITICAL_SECTION(k);
33505 unpack_dict_result = __Pyx_CallSlotAsVectorcallUnpackDict(a_size, k, args, kwnames);
33506 __Pyx_END_CRITICAL_SECTION();
33507 if (unlikely(unpack_dict_result == -1)) goto cleanup;
33508 }
33509 result = f(o, args, a_size, kwnames);
33510 cleanup:
33511 Py_XDECREF(kwnames);
33512 for (i=a_size; i<total_size; ++i) {
33513 Py_XDECREF(args[i]);
33514 }
33515 if (args != stack_args) {
33516 PyMem_Free(args);
33517 }
33518 return result;
33519}
33520#endif
33521
33522/* CallNewInitFromVectorcall */
33523#if CYTHON_VECTORCALL_TPNEW
33524static PyObject *__Pyx_CallNewInitFromVectorcall(PyTypeObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
33525 newfunc tp_new = __Pyx_PyType_GetSlot(t, tp_new, newfunc);
33526 if (unlikely(!tp_new)) {
33527 __Pyx_RaiseErrorWithType(PyExc_TypeError, "cannot create " __Pyx_FMT_TYPENAME " instances", t);
33528 return NULL;
33529 }
33530 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(nargsf);
33531 PyObject *result = NULL, *args_tuple = NULL, *kwds_dict = NULL;
33532 Py_ssize_t kw_size = kwnames ? __Pyx_PyTuple_GET_SIZE(kwnames) : 0;
33533#if !CYTHON_ASSUME_SAFE_SIZE
33534 if (unlikely(kw_size == -1)) {
33535 return NULL;
33536 }
33537#endif
33538 if (kw_size) {
33539 kwds_dict = __Pyx_PyDict_NewPresized(kw_size);
33540 if (unlikely(!kwds_dict)) {
33541 return NULL;
33542 }
33543 for (Py_ssize_t i=0; i<kw_size; ++i) {
33544 PyObject *v = args[nargs + i];
33545 PyObject *k = __Pyx_PyTuple_GET_ITEM(kwnames, i);
33546#if !CYTHON_ASSUME_SAFE_MACROS
33547 if (unlikely(!k)) {
33548 goto end;
33549 }
33550#endif
33551 if (unlikely(PyDict_SetItem(kwds_dict, k, v) < 0)) {
33552 goto end;
33553 }
33554 }
33555 }
33556 if (nargs) {
33557 args_tuple = __Pyx_PyTuple_FromArray(args, nargs);
33558 if (unlikely(!args_tuple)) {
33559 goto end;
33560 }
33561 } else {
33562 args_tuple = __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
33563 }
33564 result = tp_new(t, args_tuple, kwds_dict);
33565 if (unlikely(!result)) {
33566 goto end;
33567 }
33568 if (PyObject_TypeCheck(result, t)) {
33569 initproc tp_init = __Pyx_PyObject_GetSlot(result, tp_init, initproc);
33570 if (tp_init && unlikely(tp_init(result, args_tuple, kwds_dict) < 0)) {
33571 Py_CLEAR(result);
33572 }
33573 }
33574 end:
33575 Py_XDECREF(args_tuple);
33576 Py_XDECREF(kwds_dict);
33577 return result;
33578}
33579#endif
33580
33581/* CallSlotAsVectorcall */
33582#if CYTHON_VECTORCALL_TPNEW
33583static int __Pyx_CallTpinitAsVectorcall(__Pyx_tpinitvectorcallfunc f, PyObject* o, PyObject *a, PyObject *k) {
33584 Py_ssize_t k_size = k ? __Pyx_PyDict_GET_SIZE(k) : 0;
33585#if !CYTHON_ASSUME_SAFE_SIZE
33586 if (unlikely(k_size < 0)) return -1;
33587#endif
33588 Py_ssize_t a_size = __Pyx_PyTuple_GET_SIZE(a);
33589#if !CYTHON_ASSUME_SAFE_SIZE
33590 if (unlikely(a_size < 0)) return -1;
33591#endif
33592#if CYTHON_ASSUME_SAFE_MACROS
33593 if (k_size == 0) {
33594 return f(o, &PyTuple_GET_ITEM(a, 0), a_size, NULL);
33595 }
33596#else
33597 if (k_size == 0 && a_size == 0) {
33598 return f(o, NULL, 0, NULL);
33599 }
33600#endif
33601 PyObject *stack_args[5];
33602 PyObject **args = stack_args;
33603 Py_ssize_t maxnargs = PY_SSIZE_T_MAX / sizeof(PyObject*) - 1;
33604 if (a_size > maxnargs - k_size) {
33605 PyErr_NoMemory();
33606 return -1;
33607 }
33608 Py_ssize_t total_size = a_size + k_size;
33609 if (total_size > 5) {
33610 args = (PyObject**)PyMem_Malloc(((size_t)total_size)*sizeof(PyObject*));
33611 if (unlikely(!args)) {
33612 PyErr_NoMemory();
33613 return -1;
33614 }
33615 }
33616 int result = -1;
33617 PyObject *kwnames = NULL;
33618 int unpack_dict_result;
33619 Py_ssize_t i = 0;
33620 for (; i < a_size; ++i) {
33621 args[i] = __Pyx_PyTuple_GET_ITEM(a, i);
33622#if !CYTHON_ASSUME_SAFE_MACROS
33623 if (unlikely(!args[i])) goto cleanup;
33624#endif
33625 }
33626#if !CYTHON_ASSUME_SAFE_MACROS
33627 if (k) // There's a specific shortcut earlier for ASSUME_SAFE_MACROS with no keywords
33628#endif
33629 {
33630 kwnames = PyTuple_New(k_size);
33631 if (unlikely(!kwnames)) goto cleanup;
33632 __Pyx_BEGIN_CRITICAL_SECTION(k);
33633 unpack_dict_result = __Pyx_CallSlotAsVectorcallUnpackDict(a_size, k, args, kwnames);
33634 __Pyx_END_CRITICAL_SECTION();
33635 if (unlikely(unpack_dict_result == -1)) goto cleanup;
33636 }
33637 result = f(o, args, a_size, kwnames);
33638 cleanup:
33639 Py_XDECREF(kwnames);
33640 for (i=a_size; i<total_size; ++i) {
33641 Py_XDECREF(args[i]);
33642 }
33643 if (args != stack_args) {
33644 PyMem_Free(args);
33645 }
33646 return result;
33647}
33648#endif
33649
33650/* CallTypeTraverse */
33651#if !CYTHON_USE_TYPE_SPECS
33652#else
33653static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) {
33654 if (!always_call) {
33655 PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
33656 unsigned long flags = PyType_GetFlags(base);
33657 if (flags & Py_TPFLAGS_HEAPTYPE) {
33658 return 0;
33659 }
33660 }
33661 Py_VISIT((PyObject*)Py_TYPE(o));
33662 return 0;
33663}
33664#endif
33665
33666/* ApplySequenceOrMappingFlag */
33667#if CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_PYPY && CYTHON_USE_TYPE_SPECS)
33668int __Pyx_ApplySequenceOrMappingFlag(PyTypeObject *tp, int is_sequence) {
33669 PyObject *abc;
33670 PyObject *collections_abc = PyImport_ImportModule("collections.abc");
33671 if (unlikely(!collections_abc)) return -1;
33672 abc = PyObject_GetAttrString(collections_abc, is_sequence ? "Sequence": "Mapping");
33673 Py_DECREF(collections_abc);
33674 if (unlikely(!abc)) return -1;
33675 PyObject *register_result = PyObject_CallMethod(abc, "register", "O", (PyObject*)tp);
33676 Py_DECREF(abc);
33677 if (unlikely(!register_result)) return -1;
33678 Py_DECREF(register_result);
33679 return 0;
33680}
33681#elif CYTHON_COMPILING_IN_PYPY // && !CYTHON_USE_TYPE_SPECS
33682int __Pyx_ApplySequenceOrMappingFlag(PyTypeObject *tp, int is_sequence) {
33683 CYTHON_UNUSED_VAR(tp);
33684 CYTHON_UNUSED_VAR(is_sequence);
33685 return PyErr_WarnEx(
33686 PyExc_RuntimeWarning,
33687 "cython.collection_type only works on PyPy with the C flag CYTHON_USE_TYPE_SPECS=1",
33688 1
33689 );
33690}
33691#endif
33692
33693/* PyObjectCallMethod0 (used by PyType_Ready) */
33694static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
33695#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || !CYTHON_COMPILING_IN_LIMITED_API)
33696 return PyObject_VectorcallMethod(method_name, &obj, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
33697#elif CYTHON_COMPILING_IN_LIMITED_API
33698 return PyObject_CallMethodObjArgs(obj, method_name, NULL);
33699#else
33700 return PyObject_CallMethodNoArgs(obj, method_name);
33701#endif
33702}
33703
33704/* GetTypeDictOffset (used by ValidateBasesTuple) */
33705#if !CYTHON_USE_TYPE_SLOTS
33706CYTHON_UNUSED static Py_ssize_t __Pyx_GetTypeDictOffset(PyObject *tp, int require_cython_valid_result) {
33707 PyObject *tp_dictoffset_o;
33708 Py_ssize_t tp_dictoffset;
33709 tp_dictoffset_o = PyObject_GetAttrString(tp, "__dictoffset__");
33710 if (unlikely(!tp_dictoffset_o)) return -1;
33711 tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o);
33712 Py_DECREF(tp_dictoffset_o);
33713 if (unlikely(require_cython_valid_result && tp_dictoffset == 0)) {
33714 PyErr_SetString(
33715 PyExc_TypeError,
33716 "'type' doesn't have a dictoffset");
33717 return -1;
33718 } else if (unlikely(require_cython_valid_result && tp_dictoffset < 0)) {
33719 PyErr_SetString(
33720 PyExc_TypeError,
33721 "'type' has an unexpected negative dictoffset. "
33722 "Please report this as Cython bug");
33723 return -1;
33724 }
33725 return tp_dictoffset;
33726}
33727#endif
33728
33729/* ValidateBasesTuple (used by PyType_Ready) */
33730#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
33731static int __Pyx_validate_bases_tuple(const char *type_name, int has_dictoffset, PyObject *bases) {
33732 Py_ssize_t i, n;
33733#if CYTHON_ASSUME_SAFE_SIZE
33734 n = PyTuple_GET_SIZE(bases);
33735#else
33736 n = PyTuple_Size(bases);
33737 if (unlikely(n < 0)) return -1;
33738#endif
33739 if (!has_dictoffset) {
33740 PyObject *b;
33741#if CYTHON_AVOID_BORROWED_REFS
33742 b = PySequence_GetItem(bases, 0);
33743 if (!b) return -1;
33744#elif CYTHON_ASSUME_SAFE_MACROS
33745 b = PyTuple_GET_ITEM(bases, 0);
33746#else
33747 b = PyTuple_GetItem(bases, 0);
33748 if (!b) return -1;
33749#endif
33750#if CYTHON_USE_TYPE_SLOTS
33751 has_dictoffset = ((PyTypeObject*)b)->tp_dictoffset != 0;
33752#else
33753 Py_ssize_t dictoffset = __Pyx_GetTypeDictOffset(b, 0);
33754 has_dictoffset = dictoffset != 0;
33755#endif
33756#if CYTHON_AVOID_BORROWED_REFS
33757 Py_DECREF(b);
33758#endif
33759#if !CYTHON_USE_TYPE_SLOTS
33760 if (dictoffset == -1 && PyErr_Occurred()) return -1;
33761#endif
33762 }
33763 for (i = 1; i < n; i++)
33764 {
33765 PyTypeObject *b;
33766#if CYTHON_AVOID_BORROWED_REFS
33767 PyObject *b0 = PySequence_GetItem(bases, i);
33768 if (!b0) return -1;
33769#elif CYTHON_ASSUME_SAFE_MACROS
33770 PyObject *b0 = PyTuple_GET_ITEM(bases, i);
33771#else
33772 PyObject *b0 = PyTuple_GetItem(bases, i);
33773 if (!b0) return -1;
33774#endif
33775 b = (PyTypeObject*) b0;
33776 if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
33777 {
33778 __Pyx_RaiseErrorWithType(
33779 PyExc_TypeError, "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b);
33780#if CYTHON_AVOID_BORROWED_REFS
33781 Py_DECREF(b0);
33782#endif
33783 return -1;
33784 }
33785 if (!has_dictoffset)
33786 {
33787 Py_ssize_t b_dictoffset = 0;
33788#if CYTHON_USE_TYPE_SLOTS
33789 b_dictoffset = b->tp_dictoffset;
33790#else
33791 b_dictoffset = __Pyx_GetTypeDictOffset((PyObject*)b, 0);
33792 if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
33793#endif
33794 if (b_dictoffset) {
33795 __Pyx_RaiseErrorWithType1(
33796 PyExc_TypeError,
33797 "extension type '%.200s' has no __dict__ slot, "
33798 "but base type '" __Pyx_FMT_TYPENAME "' has: "
33799 "either add 'cdef dict __dict__' to the extension type "
33800 "or add '__slots__ = [...]' to the base type",
33801 type_name, b);
33802#if !CYTHON_USE_TYPE_SLOTS
33803 dictoffset_return:
33804#endif
33805#if CYTHON_AVOID_BORROWED_REFS
33806 Py_DECREF(b0);
33807#endif
33808 return -1;
33809 }
33810 }
33811#if CYTHON_AVOID_BORROWED_REFS
33812 Py_DECREF(b0);
33813#endif
33814 }
33815 return 0;
33816}
33817#endif
33818
33819/* PyType_Ready */
33820CYTHON_UNUSED static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) {
33821 while (t) {
33822 PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
33823 if (bases) {
33824 return 1;
33825 }
33826 t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*);
33827 }
33828 return 0;
33829}
33830static int __Pyx_PyType_Ready(PyTypeObject *t) {
33831#if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON
33832 (void)__Pyx_PyObject_CallMethod0;
33833#if CYTHON_USE_TYPE_SPECS
33834 (void)__Pyx_validate_bases_tuple;
33835#endif
33836 return PyType_Ready(t);
33837#else
33838 int r;
33839 if (!__Pyx_PyType_HasMultipleInheritance(t)) {
33840 return PyType_Ready(t);
33841 }
33842 PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
33843 if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset != 0, bases) == -1))
33844 return -1;
33845 {
33846 int gc_was_enabled;
33847 #if PY_VERSION_HEX >= 0x030A00b1
33848 gc_was_enabled = PyGC_Disable();
33849 (void)__Pyx_PyObject_CallMethod0;
33850 #else
33851 PyObject *ret, *py_status;
33852 PyObject *gc = NULL;
33853 #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\
33854 !CYTHON_COMPILING_IN_GRAAL
33855 gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc);
33856 #endif
33857 if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc);
33858 if (unlikely(!gc)) return -1;
33859 py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled);
33860 if (unlikely(!py_status)) {
33861 Py_DECREF(gc);
33862 return -1;
33863 }
33864 gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
33865 Py_DECREF(py_status);
33866 if (gc_was_enabled > 0) {
33867 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable);
33868 if (unlikely(!ret)) {
33869 Py_DECREF(gc);
33870 return -1;
33871 }
33872 Py_DECREF(ret);
33873 } else if (unlikely(gc_was_enabled == -1)) {
33874 Py_DECREF(gc);
33875 return -1;
33876 }
33877 #endif
33878 t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
33879#if PY_VERSION_HEX >= 0x030A0000
33880 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
33881#endif
33882 r = PyType_Ready(t);
33883 t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
33884 #if PY_VERSION_HEX >= 0x030A00b1
33885 if (gc_was_enabled)
33886 PyGC_Enable();
33887 #else
33888 if (gc_was_enabled) {
33889 PyObject *tp, *v, *tb;
33890 PyErr_Fetch(&tp, &v, &tb);
33891 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable);
33892 if (likely(ret || r == -1)) {
33893 Py_XDECREF(ret);
33894 PyErr_Restore(tp, v, tb);
33895 } else {
33896 Py_XDECREF(tp);
33897 Py_XDECREF(v);
33898 Py_XDECREF(tb);
33899 r = -1;
33900 }
33901 }
33902 Py_DECREF(gc);
33903 #endif
33904 }
33905 return r;
33906#endif
33907}
33908
33909/* GetVTable (used by MergeVTables) */
33910static int __Pyx_GetVtable(PyTypeObject *type, void** table) {
33911 void* ptr;
33912 *table = NULL;
33913#if CYTHON_COMPILING_IN_LIMITED_API
33914 PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
33915#else
33916 PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
33917#endif
33918 if (!ob)
33919 goto no_attr;
33920 ptr = PyCapsule_GetPointer(ob, 0);
33921 if (!ptr && !PyErr_Occurred())
33922 PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
33923 Py_DECREF(ob);
33924 *table = ptr;
33925 return 1;
33926no_attr:
33927 if (PyErr_ExceptionMatches(CYTHON_COMPILING_IN_LIMITED_API ? PyExc_AttributeError : PyExc_KeyError)) {
33928 return 0;
33929 }
33930 Py_XDECREF(ob);
33931 return -1;
33932}
33933
33934/* MergeVTables (used by SetVTable) */
33935static int __Pyx_MergeVtables(PyTypeObject *type) {
33936 int i=0;
33937 Py_ssize_t size;
33938 void** base_vtables;
33939 void* unknown = (void*)-1;
33940 PyObject* bases = __Pyx_PyType_GetSlot(type, tp_bases, PyObject*);
33941 int base_depth = 0;
33942 {
33943 PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
33944 while (base) {
33945 base_depth += 1;
33946 base = __Pyx_PyType_TryGetSlot(base, tp_base, PyTypeObject*);
33947 }
33948 }
33949 base_vtables = (void**) PyMem_Malloc(sizeof(void*) * (size_t)(base_depth + 1));
33950 if (unlikely(!base_vtables)) {
33951 PyErr_NoMemory();
33952 return -1;
33953 }
33954 base_vtables[0] = unknown;
33955#if CYTHON_COMPILING_IN_LIMITED_API
33956 size = PyTuple_Size(bases);
33957 if (size < 0) goto other_failure;
33958#else
33959 size = PyTuple_GET_SIZE(bases);
33960#endif
33961 for (i = 1; i < size; i++) {
33962 PyObject *basei;
33963 void* base_vtable;
33964#if CYTHON_AVOID_BORROWED_REFS
33965 basei = PySequence_GetItem(bases, i);
33966 if (unlikely(!basei)) goto other_failure;
33967#elif !CYTHON_ASSUME_SAFE_MACROS
33968 basei = PyTuple_GetItem(bases, i);
33969 if (unlikely(!basei)) goto other_failure;
33970#else
33971 basei = PyTuple_GET_ITEM(bases, i);
33972#endif
33973 int get_vtable_result = __Pyx_GetVtable((PyTypeObject*)basei, &base_vtable);
33974#if CYTHON_AVOID_BORROWED_REFS
33975 Py_DECREF(basei);
33976#endif
33977 if (get_vtable_result != 1) {
33978 if (get_vtable_result == -1) {
33979 goto other_failure;
33980 }
33981 PyErr_Clear(); // Class doesn't have a vtable.
33982 } else {
33983 assert(base_vtable != NULL);
33984 int j;
33985 PyTypeObject* base = __Pyx_PyType_TryGetSlot(type, tp_base, PyTypeObject*);
33986#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
33987 if (!base) goto bad;
33988#endif
33989 for (j = 0; j < base_depth; j++) {
33990 if (base_vtables[j] == unknown) {
33991 switch (__Pyx_GetVtable(base, &base_vtables[j])) {
33992 case 1:
33993 assert(base_vtables[j] == NULL);
33994 break;
33995 case 0:
33996 goto bad;
33997 case -1:
33998 default:
33999 goto other_failure;
34000 }
34001 base_vtables[j + 1] = unknown;
34002 }
34003 if (base_vtables[j] == base_vtable) {
34004 break;
34005 }
34006 base = __Pyx_PyType_TryGetSlot(base, tp_base, PyTypeObject*);
34007#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
34008 if (!base) goto bad;
34009#endif
34010 }
34011 }
34012 }
34013 PyMem_Free(base_vtables);
34014 return 0;
34015bad:
34016 {
34017 PyTypeObject* tp_base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
34018 PyTypeObject* basei;
34019#if CYTHON_AVOID_BORROWED_REFS
34020 basei = (PyTypeObject*)PySequence_GetItem(bases, i);
34021 if (unlikely(!basei)) goto other_failure;
34022#elif !CYTHON_ASSUME_SAFE_MACROS
34023 basei = (PyTypeObject*)PyTuple_GetItem(bases, i);
34024 if (unlikely(!basei)) goto other_failure;
34025#else
34026 basei = (PyTypeObject*)PyTuple_GET_ITEM(bases, i);
34027#endif
34028 __Pyx_RaiseTypeErrorWithTypes(
34029 "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base, basei);
34030#if CYTHON_AVOID_BORROWED_REFS
34031 Py_DECREF(basei);
34032#endif
34033 }
34034other_failure:
34035 PyMem_Free(base_vtables);
34036 return -1;
34037}
34038
34039/* SetVTable */
34040static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
34041 PyObject *ob = PyCapsule_New(vtable, 0, 0);
34042 if (unlikely(!ob))
34043 goto bad;
34044#if CYTHON_COMPILING_IN_LIMITED_API
34045 if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
34046#else
34047 if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
34048#endif
34049 goto bad;
34050 Py_DECREF(ob);
34051 return __Pyx_MergeVtables(type);
34052bad:
34053 Py_XDECREF(ob);
34054 return -1;
34055}
34056
34057/* LimitedApiGetTypeTypeDict (used by DelItemOnTypeDict) */
34058#if CYTHON_COMPILING_IN_LIMITED_API
34059static PyObject *__Pyx_GetTypeTypeDict(PyTypeObject *tp) {
34060 static Py_ssize_t tp_dictoffset = 0;
34061 if (unlikely(tp_dictoffset == 0)) {
34062 tp_dictoffset = __Pyx_GetTypeDictOffset((PyObject*)(&PyType_Type), 1);
34063 if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) {
34064 tp_dictoffset = 0; // try again next time?
34065 return NULL;
34066 }
34067 }
34068 return *(PyObject**)((char*)tp + tp_dictoffset);
34069}
34070#endif
34071
34072/* DelItemOnTypeDict (used by SetupReduce) */
34073static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k) {
34074 int result;
34075 PyObject *tp_dict;
34076#if CYTHON_COMPILING_IN_LIMITED_API
34077 tp_dict = __Pyx_GetTypeTypeDict(tp);
34078 if (unlikely(!tp_dict)) return -1;
34079#else
34080 tp_dict = tp->tp_dict;
34081#endif
34082 result = PyDict_DelItem(tp_dict, k);
34083 if (likely(!result)) PyType_Modified(tp);
34084 return result;
34085}
34086
34087/* SetItemOnTypeDict (used by SetupReduce) */
34088static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) {
34089 int result;
34090 PyObject *tp_dict;
34091#if CYTHON_COMPILING_IN_LIMITED_API
34092 tp_dict = __Pyx_GetTypeTypeDict(tp);
34093 if (unlikely(!tp_dict)) return -1;
34094#else
34095 tp_dict = tp->tp_dict;
34096#endif
34097 result = PyDict_SetItem(tp_dict, k, v);
34098 if (likely(!result)) {
34099 PyType_Modified(tp);
34100 if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) {
34101 PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name, (PyObject *) tp, k, NULL);
34102 if (!setNameResult) return -1;
34103 Py_DECREF(setNameResult);
34104 }
34105 }
34106 return result;
34107}
34108
34109/* SetupReduce */
34110static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
34111 int ret;
34112 PyObject *name_attr;
34113 name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_mstate_global->__pyx_n_u_name_2);
34114 if (likely(name_attr)) {
34115 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
34116 } else {
34117 ret = -1;
34118 }
34119 if (unlikely(ret < 0) && __Pyx_IgnoreException(PyExc_Exception)) {
34120 ret = 0; // But BaseException is still propagated.
34121 }
34122 Py_XDECREF(name_attr);
34123 return ret;
34124}
34125static PyObject *__Pyx_setup_reduce_get_reduce_attribute(PyObject *type_obj, PyObject *name, int allow_not_present) {
34126#if CYTHON_USE_PYTYPE_LOOKUP
34127 CYTHON_UNUSED_VAR(allow_not_present);
34128 return _PyType_Lookup((PyTypeObject*)type_obj, name);
34129#else
34130 if (allow_not_present) {
34131 return __Pyx_PyObject_GetAttrStrNoError(type_obj, name);
34132 } else {
34133 return __Pyx_PyObject_GetAttrStr(type_obj, name);
34134 }
34135#endif
34136}
34137static int __Pyx_setup_reduce(PyObject* type_obj) {
34138 int ret = 0;
34139 PyObject *object_reduce = NULL;
34140 PyObject *object_getstate = NULL;
34141 PyObject *object_reduce_ex = NULL;
34142 PyObject *reduce = NULL;
34143 PyObject *reduce_ex = NULL;
34144 PyObject *reduce_cython = NULL;
34145 PyObject *setstate = NULL;
34146 PyObject *setstate_cython = NULL;
34147 PyObject *getstate = NULL;
34148 getstate = __Pyx_setup_reduce_get_reduce_attribute(type_obj, __pyx_mstate_global->__pyx_n_u_getstate, 1);
34149 if (!getstate && PyErr_Occurred()) {
34150 goto __PYX_BAD;
34151 }
34152 if (getstate) {
34153 object_getstate = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate, 1);
34154 if (!object_getstate && PyErr_Occurred()) {
34155 goto __PYX_BAD;
34156 }
34157 if (object_getstate != getstate) {
34158 goto __PYX_GOOD;
34159 }
34160 }
34161 object_reduce_ex = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex, 0);
34162 if (unlikely(!object_reduce_ex)) goto __PYX_BAD;
34163 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
34164 if (reduce_ex == object_reduce_ex) {
34165 object_reduce = __Pyx_setup_reduce_get_reduce_attribute((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce, 0);
34166 if (!object_reduce) goto __PYX_BAD;
34167 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
34168 int try_to_replace_reduce = (reduce == object_reduce);
34169 if (!try_to_replace_reduce) {
34170 try_to_replace_reduce = __Pyx_setup_reduce_is_named(reduce, __pyx_mstate_global->__pyx_n_u_reduce_cython);
34171 if (unlikely(try_to_replace_reduce < 0)) {
34172 goto __PYX_BAD;
34173 }
34174 }
34175 if (try_to_replace_reduce) {
34176 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython);
34177 if (likely(reduce_cython)) {
34178 ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
34179 ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
34180 } else if (reduce == object_reduce || PyErr_Occurred()) {
34181 goto __PYX_BAD;
34182 }
34183 setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate);
34184 int try_to_replace_setstate;
34185 if (!setstate) {
34186 PyObject *exc = PyErr_Occurred();
34187 if (exc && !__Pyx_IgnoreGivenException(exc, PyExc_Exception)) {
34188 goto __PYX_BAD;
34189 }
34190 try_to_replace_setstate = 1;
34191 } else {
34192 try_to_replace_setstate = __Pyx_setup_reduce_is_named(setstate, __pyx_mstate_global->__pyx_n_u_setstate_cython);
34193 if (unlikely(try_to_replace_setstate < 0)) {
34194 goto __PYX_BAD;
34195 }
34196 }
34197 if (try_to_replace_setstate) {
34198 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython);
34199 if (likely(setstate_cython)) {
34200 ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
34201 ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
34202 } else if (!setstate || PyErr_Occurred()) {
34203 goto __PYX_BAD;
34204 }
34205 }
34206 PyType_Modified((PyTypeObject*)type_obj);
34207 }
34208 }
34209 goto __PYX_GOOD;
34210__PYX_BAD:
34211 if (!PyErr_Occurred()) {
34212 __Pyx_RaiseErrorWithType(
34213 PyExc_RuntimeError,
34214 "Unable to initialize pickling for " __Pyx_FMT_TYPENAME,
34215 (PyTypeObject*)type_obj);
34216 }
34217 ret = -1;
34218__PYX_GOOD:
34219#if !CYTHON_USE_PYTYPE_LOOKUP
34220 Py_XDECREF(object_reduce);
34221 Py_XDECREF(object_reduce_ex);
34222 Py_XDECREF(object_getstate);
34223 Py_XDECREF(getstate);
34224#endif
34225 Py_XDECREF(reduce);
34226 Py_XDECREF(reduce_ex);
34227 Py_XDECREF(reduce_cython);
34228 Py_XDECREF(setstate);
34229 Py_XDECREF(setstate_cython);
34230 return ret;
34231}
34232
34233/* TypeImport */
34234#ifndef __PYX_HAVE_RT_ImportType_3_3_0
34235#define __PYX_HAVE_RT_ImportType_3_3_0
34236static PyTypeObject *__Pyx_ImportType_3_3_0(PyObject *module, const char *module_name, const char *class_name,
34237 size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_3_0 check_size)
34238{
34239 PyObject *result = 0;
34240 Py_ssize_t basicsize;
34241 Py_ssize_t itemsize;
34242#if defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API)
34243 PyObject *py_basicsize;
34244 PyObject *py_itemsize;
34245#endif
34246 result = PyObject_GetAttrString(module, class_name);
34247 if (!result)
34248 goto bad;
34249 if (!PyType_Check(result)) {
34250 PyErr_Format(PyExc_TypeError,
34251 "%.200s.%.200s is not a type object",
34252 module_name, class_name);
34253 goto bad;
34254 }
34255#if !( defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API) )
34256 basicsize = ((PyTypeObject *)result)->tp_basicsize;
34257 itemsize = ((PyTypeObject *)result)->tp_itemsize;
34258#else
34259 if (size == 0) {
34260 return (PyTypeObject *)result;
34261 }
34262 py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
34263 if (!py_basicsize)
34264 goto bad;
34265 basicsize = PyLong_AsSsize_t(py_basicsize);
34266 Py_DECREF(py_basicsize);
34267 py_basicsize = 0;
34268 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
34269 goto bad;
34270 py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
34271 if (!py_itemsize)
34272 goto bad;
34273 itemsize = PyLong_AsSsize_t(py_itemsize);
34274 Py_DECREF(py_itemsize);
34275 py_itemsize = 0;
34276 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
34277 goto bad;
34278#endif
34279 if (itemsize) {
34280 if (size % alignment) {
34281 alignment = size % alignment;
34282 }
34283 if (itemsize < (Py_ssize_t)alignment)
34284 itemsize = (Py_ssize_t)alignment;
34285 }
34286 if ((size_t)(basicsize + itemsize) < size) {
34287 PyErr_Format(PyExc_ValueError,
34288 "%.200s.%.200s size changed, may indicate binary incompatibility. "
34289 "Expected %zd from C header, got %zd from PyObject",
34290 module_name, class_name, size, basicsize+itemsize);
34291 goto bad;
34292 }
34293 if (check_size == __Pyx_ImportType_CheckSize_Error_3_3_0 &&
34294 ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
34295 PyErr_Format(PyExc_ValueError,
34296 "%.200s.%.200s size changed, may indicate binary incompatibility. "
34297 "Expected %zd from C header, got %zd-%zd from PyObject",
34298 module_name, class_name, size, basicsize, basicsize+itemsize);
34299 goto bad;
34300 }
34301 else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_3_0 && (size_t)basicsize > size) {
34302 if (PyErr_WarnFormat(NULL, 0,
34303 "%.200s.%.200s size changed, may indicate binary incompatibility. "
34304 "Expected %zd from C header, got %zd from PyObject",
34305 module_name, class_name, size, basicsize) < 0) {
34306 goto bad;
34307 }
34308 }
34309 return (PyTypeObject *)result;
34310bad:
34311 Py_XDECREF(result);
34312 return NULL;
34313}
34314#endif
34315
34316/* ImportFrom */
34317static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
34318 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
34319 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
34320 const char* module_name_str = 0;
34321 PyObject* module_name = 0;
34322 PyObject* module_dot = 0;
34323 PyObject* full_name = 0;
34324 PyErr_Clear();
34325 module_name_str = PyModule_GetName(module);
34326 if (unlikely(!module_name_str)) { goto modbad; }
34327 module_name = PyUnicode_FromString(module_name_str);
34328 if (unlikely(!module_name)) { goto modbad; }
34329 module_dot = PyUnicode_Concat(module_name, __pyx_mstate_global->__pyx_kp_u__3);
34330 if (unlikely(!module_dot)) { goto modbad; }
34331 full_name = PyUnicode_Concat(module_dot, name);
34332 if (unlikely(!full_name)) { goto modbad; }
34333 #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\
34334 CYTHON_COMPILING_IN_GRAAL
34335 {
34336 PyObject *modules = PyImport_GetModuleDict();
34337 if (unlikely(!modules))
34338 goto modbad;
34339 value = PyObject_GetItem(modules, full_name);
34340 }
34341 #else
34342 value = PyImport_GetModule(full_name);
34343 #endif
34344 modbad:
34345 Py_XDECREF(full_name);
34346 Py_XDECREF(module_dot);
34347 Py_XDECREF(module_name);
34348 }
34349 if (unlikely(!value)) {
34350 PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
34351 }
34352 return value;
34353}
34354
34355/* dict_setdefault (used by FetchCommonType) */
34356static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
34357 PyObject* value;
34358#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
34359 PyDict_SetDefaultRef(d, key, default_value, &value);
34360#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
34361 PyObject *args[] = {d, key, default_value};
34362 value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
34363#elif CYTHON_COMPILING_IN_LIMITED_API
34364 value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
34365#else
34366 value = PyDict_SetDefault(d, key, default_value);
34367 if (unlikely(!value)) return NULL;
34368 Py_INCREF(value);
34369#endif
34370 return value;
34371}
34372
34373/* AddModuleRef (used by FetchSharedCythonModule) */
34374#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX < 0x030F00a3
34375 static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
34376 PyObject *module_dict = PyImport_GetModuleDict();
34377 PyObject *m;
34378 if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
34379 return NULL;
34380 }
34381 if (m != NULL && PyModule_Check(m)) {
34382 return m;
34383 }
34384 Py_XDECREF(m);
34385 m = PyModule_NewObject(name);
34386 if (m == NULL)
34387 return NULL;
34388 if (PyDict_CheckExact(module_dict)) {
34389 PyObject *new_m;
34390 (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
34391 Py_DECREF(m);
34392 return new_m;
34393 } else {
34394 if (PyObject_SetItem(module_dict, name, m) != 0) {
34395 Py_DECREF(m);
34396 return NULL;
34397 }
34398 return m;
34399 }
34400 }
34401 static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
34402 if ((PY_VERSION_HEX >= 0x030E0000) && Py_Version >= 0x030E0100) {
34403 return PyImport_AddModuleRef(name);
34404 }
34405 PyObject *py_name = PyUnicode_FromString(name);
34406 if (!py_name) return NULL;
34407 PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
34408 Py_DECREF(py_name);
34409 return module;
34410 }
34411#elif __PYX_LIMITED_VERSION_HEX < 0x030d0000
34412 static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
34413 PyObject *module = PyImport_AddModule(name);
34414 Py_XINCREF(module);
34415 return module;
34416 }
34417#endif
34418
34419/* FetchSharedCythonModule (used by FetchCommonType) */
34420static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
34421 return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
34422}
34423
34424/* VerifyCachedType (used by FetchCommonType) */
34425static int __Pyx_VerifyCachedType(PyObject *cached_type,
34426 const char *name,
34427 Py_ssize_t expected_basicsize) {
34428 Py_ssize_t basicsize;
34429 if (!PyType_Check(cached_type)) {
34430 PyErr_Format(PyExc_TypeError,
34431 "Shared Cython type %.200s is not a type object", name);
34432 return -1;
34433 }
34434 if (expected_basicsize == 0) {
34435 return 0; // size is inherited, nothing useful to check
34436 }
34437#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_OPAQUE_OBJECTS
34438 if (expected_basicsize < 0) {
34439 basicsize = PyType_GetTypeDataSize((PyTypeObject*)cached_type);
34440 } else
34441#endif
34442 {
34443 #if CYTHON_COMPILING_IN_LIMITED_API
34444 PyObject *py_basicsize;
34445 py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
34446 if (unlikely(!py_basicsize)) return -1;
34447 basicsize = PyLong_AsSsize_t(py_basicsize);
34448 Py_DECREF(py_basicsize);
34449 py_basicsize = NULL;
34450 if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1;
34451 #else
34452 basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
34453 #endif
34454 }
34455 if ((expected_basicsize >= 0) ?
34456 (basicsize != expected_basicsize) :
34457 (basicsize < -expected_basicsize)) {
34458 PyErr_Format(PyExc_TypeError,
34459 "Shared Cython type %.200s has the wrong size, try recompiling",
34460 name);
34461 return -1;
34462 }
34463 return 0;
34464}
34465
34466/* FetchCommonType (used by CommonTypesMetaclass) */
34467#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
34468static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
34469 PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
34470 if (result && metaclass) {
34471 PyObject *old_tp = (PyObject*)Py_TYPE(result);
34472 Py_INCREF((PyObject*)metaclass);
34473 Py_SET_TYPE(result, metaclass);
34474 Py_DECREF(old_tp);
34475 PyType_Modified((PyTypeObject*)result);
34476 }
34477 return result;
34478}
34479#else
34480#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
34481#endif
34482static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
34483 PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
34484 int get_item_ref_result;
34485 const char* object_name = strrchr(spec->name, '.');
34486 object_name = object_name ? object_name+1 : spec->name;
34487 py_object_name = PyUnicode_FromString(object_name);
34488 if (!py_object_name) return NULL;
34489 abi_module = __Pyx_FetchSharedCythonABIModule();
34490 if (!abi_module) goto done;
34491 abi_module_dict = PyModule_GetDict(abi_module);
34492 if (!abi_module_dict) goto done;
34493 get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
34494 if (get_item_ref_result == 1) {
34495 if (__Pyx_VerifyCachedType(
34496 cached_type,
34497 object_name,
34498 spec->basicsize) < 0) {
34499 goto bad;
34500 }
34501 goto done;
34502 } else if (unlikely(get_item_ref_result == -1)) {
34503 goto bad;
34504 }
34505 cached_type = __Pyx_PyType_FromMetaclass(
34506 metaclass,
34507 CYTHON_USE_MODULE_STATE ? module : abi_module,
34508 spec, bases);
34509 if (unlikely(!cached_type)) goto bad;
34510 new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type);
34511 if (unlikely(new_cached_type != cached_type)) {
34512 if (unlikely(!new_cached_type)) goto bad;
34513 Py_DECREF(cached_type);
34514 cached_type = new_cached_type;
34515 if (__Pyx_VerifyCachedType(
34516 cached_type,
34517 object_name,
34518 spec->basicsize) < 0) {
34519 goto bad;
34520 }
34521 goto done;
34522 } else {
34523 Py_DECREF(new_cached_type);
34524 }
34525done:
34526 Py_XDECREF(abi_module);
34527 Py_DECREF(py_object_name);
34528 assert(cached_type == NULL || PyType_Check(cached_type));
34529 return (PyTypeObject *) cached_type;
34530bad:
34531 Py_XDECREF(cached_type);
34532 cached_type = NULL;
34533 goto done;
34534}
34535
34536/* CommonTypesMetaclass (used by CythonFunctionShared) */
34537static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
34538 return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
34539}
34540#if __PYX_LIMITED_VERSION_HEX < 0x030A0000
34541static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) {
34542 PyErr_SetString(PyExc_TypeError, "Cannot instantiate Cython internal types");
34543 return NULL;
34544}
34545static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) {
34546 PyErr_SetString(PyExc_TypeError, "Cython internal types are immutable");
34547 return -1;
34548}
34549#endif
34550static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
34551 {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
34552 {0, 0, 0, 0, 0}
34553};
34554static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
34555 {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset},
34556 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
34557 {Py_tp_call, (void*)__pyx_CommonTypesMetaclass_call},
34558 {Py_tp_new, (void*)__pyx_CommonTypesMetaclass_call},
34559 {Py_tp_setattro, (void*)__pyx_CommonTypesMetaclass_setattr},
34560 #endif
34561 {0, 0}
34562};
34563static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
34564 __PYX_TYPE_MODULE_PREFIX "_common_types_metatype",
34565 0,
34566 0,
34567 Py_TPFLAGS_IMMUTABLETYPE |
34568 Py_TPFLAGS_DISALLOW_INSTANTIATION |
34569 Py_TPFLAGS_DEFAULT,
34570 __pyx_CommonTypesMetaclass_slots
34571};
34572static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
34573 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
34574 PyObject *bases = PyTuple_Pack(1, &PyType_Type);
34575 if (unlikely(!bases)) {
34576 return -1;
34577 }
34578 mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
34579 Py_DECREF(bases);
34580 if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
34581 return -1;
34582 }
34583 return 0;
34584}
34585
34586/* CythonFunctionPerModule (used by CythonFunctionShared) */
34587#if CYTHON_COMPILING_IN_LIMITED_API
34588static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) {
34589 if (__Pyx_CyFunction_Check(func)) {
34590 return __Pyx_as_CyFunctionObject(func)->func_methoddef->ml_meth == (PyCFunction) cfunc;
34591 } else if (PyCFunction_Check(func)) {
34592 return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
34593 }
34594 return 0;
34595}
34596static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
34597 if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
34598 int result;
34599 PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
34600 if (unlikely(!newFunc)) {
34601 PyErr_Clear(); // It's only an optimization, so don't throw an error
34602 return 0;
34603 }
34604 result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
34605 Py_DECREF(newFunc);
34606 return result;
34607 }
34608 return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
34609}
34610#else
34611static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
34612 if (PyMethod_Check(func)) {
34613 func = PyMethod_GET_FUNCTION(func);
34614 }
34615 return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
34616}
34617#endif
34618static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
34619#if CYTHON_COMPILING_IN_LIMITED_API
34620 __Pyx_Py_XDECREF_SET(
34621 __Pyx__CyFunction_GetClassObj(f),
34622 ((classobj) ? __Pyx_NewRef(classobj) : NULL));
34623#else
34624 __Pyx_Py_XDECREF_SET(
34625 ((PyCMethodObject *) (f))->mm_class,
34626 (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
34627#endif
34628}
34629static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
34630 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
34631 m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type);
34632 if (unlikely(!m->defaults))
34633 return NULL;
34634 return m->defaults;
34635}
34636static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
34637 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
34638 m->defaults_tuple = tuple;
34639 Py_INCREF(tuple);
34640}
34641static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
34642 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
34643 m->defaults_kwdict = dict;
34644 Py_INCREF(dict);
34645}
34646static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
34647 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
34648 m->func_annotations = dict;
34649 Py_INCREF(dict);
34650}
34651
34652/* PyMethodNew (used by CythonFunctionShared) */
34653#if CYTHON_COMPILING_IN_LIMITED_API
34654static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
34655 PyObject *result;
34656 CYTHON_UNUSED_VAR(typ);
34657 if (!self)
34658 return __Pyx_NewRef(func);
34659 #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
34660 {
34661 PyObject *args[] = {func, self};
34662 result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
34663 }
34664 #else
34665 result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
34666 #endif
34667 return result;
34668}
34669#else
34670static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
34671 CYTHON_UNUSED_VAR(typ);
34672 if (!self)
34673 return __Pyx_NewRef(func);
34674 return PyMethod_New(func, self);
34675}
34676#endif
34677
34678/* PyVectorcallFastCallDict (used by CythonFunctionShared) */
34679#if CYTHON_VECTORCALL
34680static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
34681{
34682 PyObject *res = NULL;
34683 PyObject *kwnames;
34684 PyObject **newargs;
34685 PyObject **kwvalues;
34686 Py_ssize_t i;
34687 #if CYTHON_AVOID_BORROWED_REFS
34688 PyObject *pos;
34689 #else
34690 Py_ssize_t pos;
34691 #endif
34692 size_t j;
34693 PyObject *key, *value;
34694 unsigned long keys_are_strings;
34695 #if !CYTHON_ASSUME_SAFE_SIZE
34696 Py_ssize_t nkw = PyDict_Size(kw);
34697 if (unlikely(nkw == -1)) return NULL;
34698 #else
34699 Py_ssize_t nkw = PyDict_GET_SIZE(kw);
34700 #endif
34701 newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
34702 if (unlikely(newargs == NULL)) {
34703 PyErr_NoMemory();
34704 return NULL;
34705 }
34706 for (j = 0; j < nargs; j++) newargs[j] = args[j];
34707 kwnames = PyTuple_New(nkw);
34708 if (unlikely(kwnames == NULL)) {
34709 PyMem_Free(newargs);
34710 return NULL;
34711 }
34712 kwvalues = newargs + nargs;
34713 pos = 0;
34714 i = 0;
34715 keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
34716 while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) {
34717 keys_are_strings &=
34718 #if CYTHON_COMPILING_IN_LIMITED_API
34719 PyType_GetFlags(Py_TYPE(key));
34720 #else
34721 Py_TYPE(key)->tp_flags;
34722 #endif
34723 #if !CYTHON_ASSUME_SAFE_MACROS
34724 if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup;
34725 #else
34726 PyTuple_SET_ITEM(kwnames, i, key);
34727 #endif
34728 kwvalues[i] = value;
34729 i++;
34730 }
34731 if (unlikely(!keys_are_strings)) {
34732 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
34733 goto cleanup;
34734 }
34735 res = vc(func, newargs, nargs, kwnames);
34736cleanup:
34737 #if CYTHON_AVOID_BORROWED_REFS
34738 Py_DECREF(pos);
34739 #endif
34740 Py_DECREF(kwnames);
34741 for (i = 0; i < nkw; i++)
34742 Py_DECREF(kwvalues[i]);
34743 PyMem_Free(newargs);
34744 return res;
34745}
34746static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
34747{
34748 Py_ssize_t kw_size =
34749 likely(kw == NULL) ?
34750 0 :
34751#if !CYTHON_ASSUME_SAFE_SIZE
34752 PyDict_Size(kw);
34753#else
34754 PyDict_GET_SIZE(kw);
34755#endif
34756 if (kw_size == 0) {
34757 return vc(func, args, nargs, NULL);
34758 }
34759#if !CYTHON_ASSUME_SAFE_SIZE
34760 else if (unlikely(kw_size == -1)) {
34761 return NULL;
34762 }
34763#endif
34764 return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
34765}
34766#endif
34767
34768/* CythonFunctionShared (used by CythonFunction) */
34769static PyObject *
34770__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
34771{
34772 if (unlikely(op->func_doc == NULL)) {
34773#if CYTHON_COMPILING_IN_LIMITED_API
34774 const char *doc = op->func_methoddef->ml_doc;
34775#else
34776 const char *doc = ((PyCFunctionObject*)op)->m_ml->ml_doc;
34777#endif
34778 if (doc) {
34779 op->func_doc = PyUnicode_FromString(doc);
34780 if (unlikely(op->func_doc == NULL))
34781 return NULL;
34782 } else {
34783 Py_INCREF(Py_None);
34784 return Py_None;
34785 }
34786 }
34787 Py_INCREF(op->func_doc);
34788 return op->func_doc;
34789}
34790static PyObject *
34791__Pyx_CyFunction_get_doc(PyObject *op_in, void *closure) {
34792 PyObject *result;
34793 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34794 CYTHON_UNUSED_VAR(closure);
34795 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34796 result = __Pyx_CyFunction_get_doc_locked(op);
34797 __Pyx_END_CRITICAL_SECTION();
34798 return result;
34799}
34800static int
34801__Pyx_CyFunction_set_doc(PyObject *op_in, PyObject *value, void *context)
34802{
34803 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34804 CYTHON_UNUSED_VAR(context);
34805 if (value == NULL) {
34806 value = Py_None;
34807 }
34808 Py_INCREF(value);
34809 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34810 __Pyx_Py_XDECREF_SET(op->func_doc, value);
34811 __Pyx_END_CRITICAL_SECTION();
34812 return 0;
34813}
34814static PyObject *
34815__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
34816{
34817 if (unlikely(op->func_name == NULL)) {
34818#if CYTHON_COMPILING_IN_LIMITED_API
34819 const char *name = op->func_methoddef->ml_name;
34820#else
34821 const char *name = ((PyCFunctionObject*)op)->m_ml->ml_name;
34822#endif
34823 op->func_name = PyUnicode_InternFromString(name);
34824 if (unlikely(op->func_name == NULL))
34825 return NULL;
34826 }
34827 Py_INCREF(op->func_name);
34828 return op->func_name;
34829}
34830static PyObject *
34831__Pyx_CyFunction_get_name(PyObject *op, void *context)
34832{
34833 PyObject *result = NULL;
34834 CYTHON_UNUSED_VAR(context);
34835 __Pyx_BEGIN_CRITICAL_SECTION(op);
34836 result = __Pyx_CyFunction_get_name_locked(__Pyx_as_CyFunctionObject(op));
34837 __Pyx_END_CRITICAL_SECTION();
34838 return result;
34839}
34840static int
34841__Pyx_CyFunction_set_name(PyObject *op_in, PyObject *value, void *context)
34842{
34843 CYTHON_UNUSED_VAR(context);
34844 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
34845 PyErr_SetString(PyExc_TypeError,
34846 "__name__ must be set to a string object");
34847 return -1;
34848 }
34849 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34850 Py_INCREF(value);
34851 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34852 __Pyx_Py_XDECREF_SET(op->func_name, value);
34853 __Pyx_END_CRITICAL_SECTION();
34854 return 0;
34855}
34856static PyObject *
34857__Pyx_CyFunction_get_qualname(PyObject *op_in, void *context)
34858{
34859 CYTHON_UNUSED_VAR(context);
34860 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34861 PyObject *result;
34862 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34863 Py_INCREF(op->func_qualname);
34864 result = op->func_qualname;
34865 __Pyx_END_CRITICAL_SECTION();
34866 return result;
34867}
34868static int
34869__Pyx_CyFunction_set_qualname(PyObject *op_in, PyObject *value, void *context)
34870{
34871 CYTHON_UNUSED_VAR(context);
34872 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
34873 PyErr_SetString(PyExc_TypeError,
34874 "__qualname__ must be set to a string object");
34875 return -1;
34876 }
34877 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34878 Py_INCREF(value);
34879 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34880 __Pyx_Py_XDECREF_SET(op->func_qualname, value);
34881 __Pyx_END_CRITICAL_SECTION();
34882 return 0;
34883}
34884#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
34885static PyObject *
34886__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
34887{
34888 CYTHON_UNUSED_VAR(context);
34889 if (unlikely(op->func_dict == NULL)) {
34890 op->func_dict = PyDict_New();
34891 if (unlikely(op->func_dict == NULL))
34892 return NULL;
34893 }
34894 Py_INCREF(op->func_dict);
34895 return op->func_dict;
34896}
34897#endif
34898static PyObject *
34899__Pyx_CyFunction_get_globals(PyObject *op_in, void *context)
34900{
34901 CYTHON_UNUSED_VAR(context);
34902 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34903 Py_INCREF(op->func_globals);
34904 return op->func_globals;
34905}
34906static PyObject *
34907__Pyx_CyFunction_get_closure(PyObject *op, void *context)
34908{
34909 CYTHON_UNUSED_VAR(op);
34910 CYTHON_UNUSED_VAR(context);
34911 Py_INCREF(Py_None);
34912 return Py_None;
34913}
34914static PyObject *
34915__Pyx_CyFunction_get_code(PyObject *op_in, void *context)
34916{
34917 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34918 PyObject* result = (op->func_code) ? op->func_code : Py_None;
34919 CYTHON_UNUSED_VAR(context);
34920 Py_INCREF(result);
34921 return result;
34922}
34923static int
34924__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op, PyObject *op_obj) {
34925 int result = 0;
34926 PyObject *res = op->defaults_getter(op_obj);
34927 if (unlikely(!res))
34928 return -1;
34929 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
34930 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
34931 Py_INCREF(op->defaults_tuple);
34932 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
34933 Py_INCREF(op->defaults_kwdict);
34934 #else
34935 op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
34936 if (unlikely(!op->defaults_tuple)) result = -1;
34937 else {
34938 op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
34939 if (unlikely(!op->defaults_kwdict)) result = -1;
34940 }
34941 #endif
34942 Py_DECREF(res);
34943 return result;
34944}
34945static int
34946__Pyx_CyFunction_set_defaults(PyObject *op_in, PyObject* value, void *context) {
34947 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34948 CYTHON_UNUSED_VAR(context);
34949 if (!value) {
34950 value = Py_None;
34951 } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
34952 PyErr_SetString(PyExc_TypeError,
34953 "__defaults__ must be set to a tuple object");
34954 return -1;
34955 }
34956 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
34957 "currently affect the values used in function calls", 1);
34958 Py_INCREF(value);
34959 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34960 __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
34961 __Pyx_END_CRITICAL_SECTION();
34962 return 0;
34963}
34964static PyObject *
34965__Pyx_CyFunction_get_defaults_locked(PyObject *op_in) {
34966 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34967 PyObject* result = op->defaults_tuple;
34968 if (unlikely(!result)) {
34969 if (op->defaults_getter) {
34970 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0)) return NULL;
34971 result = op->defaults_tuple;
34972 } else {
34973 result = Py_None;
34974 }
34975 }
34976 Py_INCREF(result);
34977 return result;
34978}
34979static PyObject *
34980__Pyx_CyFunction_get_defaults(PyObject *op, void *context) {
34981 PyObject* result = NULL;
34982 CYTHON_UNUSED_VAR(context);
34983 __Pyx_BEGIN_CRITICAL_SECTION(op);
34984 result = __Pyx_CyFunction_get_defaults_locked(op);
34985 __Pyx_END_CRITICAL_SECTION();
34986 return result;
34987}
34988static int
34989__Pyx_CyFunction_set_kwdefaults(PyObject *op_in, PyObject* value, void *context) {
34990 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34991 CYTHON_UNUSED_VAR(context);
34992 if (!value) {
34993 value = Py_None;
34994 } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
34995 PyErr_SetString(PyExc_TypeError,
34996 "__kwdefaults__ must be set to a dict object");
34997 return -1;
34998 }
34999 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
35000 "currently affect the values used in function calls", 1);
35001 Py_INCREF(value);
35002 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
35003 __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
35004 __Pyx_END_CRITICAL_SECTION();
35005 return 0;
35006}
35007static PyObject *
35008__Pyx_CyFunction_get_kwdefaults_locked(PyObject *op_in) {
35009 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
35010 PyObject* result = op->defaults_kwdict;
35011 if (unlikely(!result)) {
35012 if (op->defaults_getter) {
35013 if (unlikely(__Pyx_CyFunction_init_defaults(op, op_in) < 0)) return NULL;
35014 result = op->defaults_kwdict;
35015 } else {
35016 result = Py_None;
35017 }
35018 }
35019 Py_INCREF(result);
35020 return result;
35021}
35022static PyObject *
35023__Pyx_CyFunction_get_kwdefaults(PyObject *op, void *context) {
35024 PyObject* result;
35025 CYTHON_UNUSED_VAR(context);
35026 __Pyx_BEGIN_CRITICAL_SECTION(op);
35027 result = __Pyx_CyFunction_get_kwdefaults_locked(op);
35028 __Pyx_END_CRITICAL_SECTION();
35029 return result;
35030}
35031static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value);
35032static int
35033__Pyx_CyFunction_set_annotations(PyObject *op_in, PyObject* value, void *context) {
35034 CYTHON_UNUSED_VAR(context);
35035 if (!value || value == Py_None) {
35036 value = NULL;
35037 } else if (unlikely(!PyDict_Check(value))) {
35038 PyErr_SetString(PyExc_TypeError,
35039 "__annotations__ must be set to a dict object");
35040 return -1;
35041 }
35042 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
35043 Py_XINCREF(value);
35044 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
35045 __Pyx_Py_XDECREF_SET(op->func_annotations, value);
35046 __Pyx_END_CRITICAL_SECTION();
35047 if (unlikely(__Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, Py_None) < 0)) return -1;
35048 return 0;
35049}
35050static int
35051__Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) {
35052 /* Return 1 if the function dict exists, 0 otherwise. This cannot fail:
35053 * _PyObject_GetDictPtr() may clear errors internally, but never reports them. */
35054#if CYTHON_COMPILING_IN_PYPY
35055 *dict = PyObject_GenericGetDict(op_in, NULL);
35056#elif CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030C0000
35057 *dict = __Pyx_as_CyFunctionObject(op_in)->func_dict;
35058#else
35059 PyObject **dictptr = _PyObject_GetDictPtr(op_in);
35060 *dict = likely(dictptr) ? *dictptr : NULL;
35061#endif
35062 return *dict ? 1 : 0;
35063}
35064static int
35065__Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) {
35066 PyObject *dict;
35067 int dict_found;
35068 *annotate = NULL;
35069 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
35070 if (!dict_found) return 0;
35071 return __Pyx_PyDict_GetItemRef(dict, __pyx_mstate_global->__pyx_n_u_annotate, annotate);
35072}
35073static int
35074__Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) {
35075 PyObject *dict;
35076 int dict_found;
35077 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
35078 if (!dict_found) return 0;
35079 if (value) {
35080 return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
35081 } else {
35082#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
35083 return PyDict_Pop(dict, __pyx_mstate_global->__pyx_n_u_annotate, NULL);
35084#else
35085 int result = PyDict_Contains(dict, __pyx_mstate_global->__pyx_n_u_annotate);
35086 if (result == 1) {
35087 result = PyDict_DelItem(dict, __pyx_mstate_global->__pyx_n_u_annotate);
35088 }
35089 return result;
35090#endif
35091 }
35092}
35093static int
35094__Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) {
35095 PyObject *dict;
35096 int result;
35097#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
35098 dict = __Pyx_CyFunction_get_dict(__Pyx_as_CyFunctionObject(op_in), NULL);
35099#else
35100 dict = PyObject_GenericGetDict(op_in, NULL);
35101#endif
35102 if (unlikely(!dict)) return -1;
35103 result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
35104 Py_DECREF(dict);
35105 return result;
35106}
35107static PyObject *
35108__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) {
35109 PyObject* result = op->func_annotations;
35110 if (unlikely(!result)) {
35111 result = PyDict_New();
35112 if (unlikely(!result)) return NULL;
35113 op->func_annotations = result;
35114 }
35115 Py_INCREF(result);
35116 return result;
35117}
35118static PyObject *
35119__Pyx_CyFunction_get_annotations(PyObject *op_in, void *context) {
35120 PyObject *annotate = NULL;
35121 PyObject *result = NULL;
35122 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
35123 CYTHON_UNUSED_VAR(context);
35124 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
35125 result = __Pyx_XNewRef(op->func_annotations);
35126 __Pyx_END_CRITICAL_SECTION();
35127 if (result) return result;
35128 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL;
35129 if (!annotate || annotate == Py_None) {
35130 Py_XDECREF(annotate);
35131 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
35132 result = __Pyx_CyFunction_get_annotations_locked(op);
35133 __Pyx_END_CRITICAL_SECTION();
35134 return result;
35135 }
35136 PyObject *format = PyLong_FromLong(1L); // annotationlib.Format.VALUE
35137 if (likely(format)) {
35138 if (!Py_EnterRecursiveCall(" cyfunction __annotations__.__get__")) {
35139 result = __Pyx_PyObject_CallOneArg(annotate, format);
35140 Py_LeaveRecursiveCall();
35141 Py_DECREF(format);
35142 }
35143 }
35144 Py_DECREF(annotate);
35145 if (unlikely(!result)) return NULL;
35146 if (unlikely(!PyDict_Check(result))) {
35147 PyErr_SetString(PyExc_TypeError, "__annotate__ must return a dict");
35148 Py_DECREF(result);
35149 return NULL;
35150 }
35151 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
35152 __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result));
35153 __Pyx_END_CRITICAL_SECTION();
35154 return result;
35155}
35156static PyObject *__Pyx_CyFunction_annotate_impl(PyObject *self, PyObject *arg) {
35157 CYTHON_UNUSED_VAR(arg);
35158 if (unlikely(!self)) {
35159 PyErr_SetString(PyExc_SystemError, "cython __annotate__ called without 'self' argument");
35160 return NULL;
35161 }
35162 PyObject *result;
35163 if (Py_EnterRecursiveCall(" in cyfunction annotate")) {
35164 return NULL;
35165 }
35166 result = __Pyx_CyFunction_get_annotations(self, NULL);
35167 Py_LeaveRecursiveCall();
35168 return result;
35169}
35170static PyObject *
35171__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context);
35172static int
35173__Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value, void *context) {
35174 CYTHON_UNUSED_VAR(context);
35175 if (value == NULL) {
35176 PyErr_SetString(PyExc_TypeError, "__annotate__ cannot be deleted");
35177 return -1;
35178 }
35179 if (unlikely(value != Py_None && !PyCallable_Check(value))) {
35180 PyErr_SetString(PyExc_TypeError, "__annotate__ must be callable or None");
35181 return -1;
35182 }
35183 if (unlikely(__Pyx_TypeCheck(value, &PyCFunction_Type))) {
35184#if !CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_PYPY
35185 PyCFunction cfunction = PyCFunction_GetFunction(value);
35186 if (unlikely(!cfunction)) return -1;
35187 PyObject *value_self = PyCFunction_GetSelf(value);
35188 if (unlikely(!value_self && PyErr_Occurred())) return -1;
35189#else
35190 PyCFunction cfunction = PyCFunction_GET_FUNCTION(value);
35191 PyObject *value_self = PyCFunction_GET_SELF(value);
35192#endif
35193 if (cfunction == __Pyx_CyFunction_annotate_impl && value_self == op_in) {
35194 return __Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, NULL);
35195 }
35196 }
35197 if (value != Py_None) {
35198 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
35199 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
35200 Py_CLEAR(op->func_annotations);
35201 __Pyx_END_CRITICAL_SECTION();
35202 }
35203 return __Pyx_CyFunction_set_annotate_in_dict(op_in, value);
35204}
35205#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
35206static PyObject *
35207__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
35208 int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
35209 if (is_coroutine) {
35210 PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine;
35211 fromlist = PyList_New(1);
35212 if (unlikely(!fromlist)) return NULL;
35213 Py_INCREF(marker);
35214#if CYTHON_ASSUME_SAFE_MACROS
35215 PyList_SET_ITEM(fromlist, 0, marker);
35216#else
35217 if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
35218 Py_DECREF(fromlist);
35219 return NULL;
35220 }
35221#endif
35222 module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
35223 Py_DECREF(fromlist);
35224 if (unlikely(!module)) {
35225 goto ignore_or_error;
35226 }
35227 is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
35228 Py_DECREF(module);
35229 if (likely(is_coroutine_value)) {
35230 return is_coroutine_value;
35231 }
35232ignore_or_error:
35233 if (!__Pyx_IgnoreException(PyExc_Exception)) {
35234 return NULL;
35235 }
35236 }
35237 return __Pyx_PyBool_FromLong(is_coroutine);
35238}
35239static PyObject *
35240__Pyx_CyFunction_get_is_coroutine(PyObject *op_in, void *context) {
35241 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
35242 PyObject *result;
35243 CYTHON_UNUSED_VAR(context);
35244 if (op->func_is_coroutine) {
35245 return __Pyx_NewRef(op->func_is_coroutine);
35246 }
35247 result = __Pyx_CyFunction_get_is_coroutine_value(op);
35248 if (unlikely(!result))
35249 return NULL;
35250 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
35251 if (op->func_is_coroutine) {
35252 Py_DECREF(result);
35253 result = __Pyx_NewRef(op->func_is_coroutine);
35254 } else {
35255 op->func_is_coroutine = __Pyx_NewRef(result);
35256 }
35257 __Pyx_END_CRITICAL_SECTION();
35258 return result;
35259}
35260#endif
35261static void __Pyx_CyFunction_raise_argument_count_error(PyObject *func, const char* message, Py_ssize_t size) {
35262#if CYTHON_COMPILING_IN_LIMITED_API
35263 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
35264 if (!py_name) return;
35265 PyErr_Format(PyExc_TypeError,
35266 "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
35267 py_name, message, size);
35268 Py_DECREF(py_name);
35269#else
35270 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
35271 PyErr_Format(PyExc_TypeError,
35272 "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
35273 name, message, size);
35274#endif
35275}
35276static void __Pyx_CyFunction_raise_type_error(PyObject *func, const char* message) {
35277#if CYTHON_COMPILING_IN_LIMITED_API
35278 PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
35279 if (!py_name) return;
35280 PyErr_Format(PyExc_TypeError,
35281 "%.200S() %s",
35282 py_name, message);
35283 Py_DECREF(py_name);
35284#else
35285 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
35286 PyErr_Format(PyExc_TypeError,
35287 "%.200s() %s",
35288 name, message);
35289#endif
35290}
35291#if CYTHON_COMPILING_IN_LIMITED_API
35292static PyObject *
35293__Pyx_CyFunction_get_module(PyObject *op_in, void *context) {
35294 CYTHON_UNUSED_VAR(context);
35295 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
35296 Py_INCREF(op->func_module);
35297 return op->func_module;
35298}
35299static int
35300__Pyx_CyFunction_set_module(PyObject *op_in, PyObject* value, void *context) {
35301 CYTHON_UNUSED_VAR(context);
35302 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
35303 if (value == NULL) {
35304 value = Py_None;
35305 }
35306 Py_INCREF(value);
35307 PyObject *old = op->func_module;
35308 op->func_module = value;
35309 Py_DECREF(old);
35310 return 0;
35311}
35312#endif
35313static PyGetSetDef __pyx_CyFunction_getsets[] = {
35314 {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
35315 {"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
35316 {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
35317 {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
35318 {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
35319#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
35320 {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
35321 {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
35322#else
35323 {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
35324 {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
35325#endif
35326 {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
35327 {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
35328 {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
35329 {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
35330 {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
35331 {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
35332 {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
35333 {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
35334 {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
35335 {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
35336 {"__annotate__", (getter)__Pyx_CyFunction_get_annotate, (setter)__Pyx_CyFunction_set_annotate, 0, 0},
35337#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
35338 {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
35339#endif
35340#if CYTHON_COMPILING_IN_LIMITED_API
35341 {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
35342#endif
35343 {0, 0, 0, 0, 0}
35344};
35345static PyMemberDef __pyx_CyFunction_members[] = {
35346#if !CYTHON_COMPILING_IN_LIMITED_API
35347 {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
35348#endif
35349#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
35350 {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict),
35351 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
35352#endif
35353#if CYTHON_VECTORCALL
35354#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
35355 {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall),
35356 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
35357#else
35358 {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
35359#endif
35360#if CYTHON_COMPILING_IN_LIMITED_API
35361 {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist),
35362 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
35363#else
35364 {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
35365#endif
35366#endif
35367 {0, 0, 0, 0, 0}
35368};
35369static PyObject *
35370__Pyx_CyFunction_reduce(PyObject *m_in, PyObject *args)
35371{
35372 PyObject *result = NULL;
35373 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
35374 CYTHON_UNUSED_VAR(args);
35375 __Pyx_BEGIN_CRITICAL_SECTION(m_in);
35376 Py_INCREF(m->func_qualname);
35377 result = m->func_qualname;
35378 __Pyx_END_CRITICAL_SECTION();
35379 return result;
35380}
35381static PyMethodDef __pyx_CyFunction_methods[] = {
35382 {"__annotate_cython__", __Pyx_CyFunction_annotate_impl, METH_O,
35383 "Placeholder __annotate__ function to allow 'functools.wraps' to work "
35384 "on Cython functions."},
35385 {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_NOARGS, 0},
35386 {0, 0, 0, 0}
35387};
35388static PyObject *
35389__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context) {
35390 PyObject *annotate = NULL;
35391 CYTHON_UNUSED_VAR(context);
35392 if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL;
35393 if (annotate) return annotate;
35394 PyObject *method = PyCFunction_New(
35395 &__pyx_CyFunction_methods[0],
35396 op_in);
35397 return method;
35398}
35399#if CYTHON_COMPILING_IN_LIMITED_API
35400#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
35401#else
35402#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
35403#endif
35404static PyObject *__Pyx_CyFunction_Init(PyObject *op_in,
35405 PyMethodDef *ml, int flags, PyObject* qualname,
35406 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
35407 __pyx_CyFunctionObject* op = __Pyx_as_CyFunctionObject(op_in);
35408#if !CYTHON_COMPILING_IN_LIMITED_API
35409 PyCFunctionObject *cf = (PyCFunctionObject*) op;
35410#endif
35411 if (unlikely(op == NULL))
35412 return NULL;
35413#if CYTHON_COMPILING_IN_LIMITED_API
35414 op->func_methoddef = ml;
35415 Py_INCREF(module);
35416 op->func_module = module;
35417#endif
35418 op->flags = flags;
35419 __Pyx_CyFunction_weakreflist(op) = NULL;
35420#if !CYTHON_COMPILING_IN_LIMITED_API
35421 cf->m_ml = ml;
35422 cf->m_self = (PyObject *) op;
35423#endif
35424 Py_XINCREF(closure);
35425 op->func_closure = closure;
35426#if !CYTHON_COMPILING_IN_LIMITED_API
35427 Py_XINCREF(module);
35428 cf->m_module = module;
35429#endif
35430#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
35431 op->func_dict = NULL;
35432#endif
35433 op->func_name = NULL;
35434 Py_INCREF(qualname);
35435 op->func_qualname = qualname;
35436 op->func_doc = NULL;
35437#if CYTHON_COMPILING_IN_LIMITED_API
35438 op->func_classobj = NULL;
35439#else
35440 ((PyCMethodObject*)op)->mm_class = NULL;
35441#endif
35442 op->func_globals = globals;
35443 Py_INCREF(op->func_globals);
35444 Py_XINCREF(code);
35445 op->func_code = code;
35446 op->defaults = NULL;
35447 op->defaults_tuple = NULL;
35448 op->defaults_kwdict = NULL;
35449 op->defaults_getter = NULL;
35450 op->func_annotations = NULL;
35451#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
35452 op->func_is_coroutine = NULL;
35453#endif
35454#if CYTHON_VECTORCALL
35455 switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
35456 case METH_NOARGS:
35457 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
35458 break;
35459 case METH_O:
35460 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
35461 break;
35462 case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
35463 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
35464 break;
35465 case METH_FASTCALL | METH_KEYWORDS:
35466 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
35467 break;
35468 case METH_VARARGS | METH_KEYWORDS:
35469 __Pyx_CyFunction_func_vectorcall(op) = NULL;
35470 break;
35471 default:
35472 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
35473 Py_DECREF(op_in);
35474 return NULL;
35475 }
35476#endif
35477 return op_in;
35478}
35479static int __Pyx__CyFunction_clear(__pyx_CyFunctionObject *m)
35480{
35481 Py_CLEAR(m->func_closure);
35482#if CYTHON_COMPILING_IN_LIMITED_API
35483 Py_CLEAR(m->func_module);
35484#else
35485 Py_CLEAR(((PyCFunctionObject*)m)->m_module);
35486#endif
35487#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
35488 Py_CLEAR(m->func_dict);
35489#elif PY_VERSION_HEX < 0x030d0000
35490 _PyObject_ClearManagedDict((PyObject*)m);
35491#else
35492 PyObject_ClearManagedDict((PyObject*)m);
35493#endif
35494 Py_CLEAR(m->func_name);
35495 Py_CLEAR(m->func_qualname);
35496 Py_CLEAR(m->func_doc);
35497 Py_CLEAR(m->func_globals);
35498 Py_CLEAR(m->func_code);
35499#if CYTHON_COMPILING_IN_LIMITED_API
35500 Py_CLEAR(m->func_classobj);
35501#else
35502 {
35503 PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
35504 ((PyCMethodObject *) (m))->mm_class = NULL;
35505 Py_XDECREF(cls);
35506 }
35507#endif
35508 Py_CLEAR(m->defaults_tuple);
35509 Py_CLEAR(m->defaults_kwdict);
35510 Py_CLEAR(m->func_annotations);
35511#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
35512 Py_CLEAR(m->func_is_coroutine);
35513#endif
35514 Py_CLEAR(m->defaults);
35515 return 0;
35516}
35517static int
35518__Pyx_CyFunction_clear(PyObject *m)
35519{
35520 return __Pyx__CyFunction_clear(__Pyx_as_CyFunctionObject(m));
35521}
35522static void __Pyx__CyFunction_dealloc(PyObject *m)
35523{
35524 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(m);
35525 if (__Pyx_CyFunction_weakreflist(cyfunc) != NULL)
35526 PyObject_ClearWeakRefs(m);
35527 __Pyx__CyFunction_clear(cyfunc);
35528 __Pyx_PyHeapTypeObject_GC_Del(m);
35529}
35530static void __Pyx_CyFunction_dealloc(PyObject *m)
35531{
35532 PyObject_GC_UnTrack(m);
35533 __Pyx__CyFunction_dealloc(m);
35534}
35535static int __Pyx_CyFunction_traverse(PyObject *m_in, visitproc visit, void *arg)
35536{
35537 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
35538 {
35539 int e = __Pyx_call_type_traverse(m_in, 1, visit, arg);
35540 if (e) return e;
35541 }
35542 Py_VISIT(m->func_closure);
35543#if CYTHON_COMPILING_IN_LIMITED_API
35544 Py_VISIT(m->func_module);
35545#else
35546 Py_VISIT(((PyCFunctionObject*)m)->m_module);
35547#endif
35548#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
35549 Py_VISIT(m->func_dict);
35550#else
35551 {
35552 int e =
35553#if PY_VERSION_HEX < 0x030d0000
35554 _PyObject_VisitManagedDict
35555#else
35556 PyObject_VisitManagedDict
35557#endif
35558 ((PyObject*)m, visit, arg);
35559 if (e != 0) return e;
35560 }
35561#endif
35562 __Pyx_VISIT_CONST(m->func_name);
35563 __Pyx_VISIT_CONST(m->func_qualname);
35564 Py_VISIT(m->func_doc);
35565 Py_VISIT(m->func_globals);
35566 __Pyx_VISIT_CONST(m->func_code);
35567 Py_VISIT(__Pyx__CyFunction_GetClassObj(m));
35568 Py_VISIT(m->defaults_tuple);
35569 Py_VISIT(m->defaults_kwdict);
35570 Py_VISIT(m->func_annotations);
35571#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
35572 Py_VISIT(m->func_is_coroutine);
35573#endif
35574 Py_VISIT(m->defaults);
35575 return 0;
35576}
35577static PyObject*
35578__Pyx_CyFunction_repr(PyObject *op_in)
35579{
35580 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
35581 PyObject *repr;
35582 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
35583 repr = PyUnicode_FromFormat("<cyfunction %U at %p>",
35584 op->func_qualname, (void *)op);
35585 __Pyx_END_CRITICAL_SECTION();
35586 return repr;
35587}
35588static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
35589#if CYTHON_COMPILING_IN_LIMITED_API
35590 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35591 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35592 int flags = cyfunc->func_methoddef->ml_flags;
35593#else
35594 PyCFunctionObject* f = (PyCFunctionObject*)func;
35595 PyCFunction meth = f->m_ml->ml_meth;
35596 int flags = f->m_ml->ml_flags;
35597#endif
35598 Py_ssize_t size;
35599 switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
35600 case METH_VARARGS:
35601 if (likely(kw == NULL || PyDict_Size(kw) == 0))
35602 return (*meth)(self, arg);
35603 break;
35604 case METH_VARARGS | METH_KEYWORDS:
35605 return (*(PyCFunctionWithKeywords)(void(*)(void))meth)(self, arg, kw);
35606 case METH_NOARGS:
35607 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
35608#if CYTHON_ASSUME_SAFE_SIZE
35609 size = PyTuple_GET_SIZE(arg);
35610#else
35611 size = PyTuple_Size(arg);
35612 if (unlikely(size < 0)) return NULL;
35613#endif
35614 if (likely(size == 0))
35615 return (*meth)(self, NULL);
35616 __Pyx_CyFunction_raise_argument_count_error(
35617 func,
35618 "takes no arguments", size);
35619 return NULL;
35620 }
35621 break;
35622 case METH_O:
35623 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
35624#if CYTHON_ASSUME_SAFE_SIZE
35625 size = PyTuple_GET_SIZE(arg);
35626#else
35627 size = PyTuple_Size(arg);
35628 if (unlikely(size < 0)) return NULL;
35629#endif
35630 if (likely(size == 1)) {
35631 PyObject *result, *arg0;
35632 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
35633 arg0 = PyTuple_GET_ITEM(arg, 0);
35634 #else
35635 arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
35636 #endif
35637 result = (*meth)(self, arg0);
35638 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
35639 Py_DECREF(arg0);
35640 #endif
35641 return result;
35642 }
35643 __Pyx_CyFunction_raise_argument_count_error(
35644 func,
35645 "takes exactly one argument", size);
35646 return NULL;
35647 }
35648 break;
35649 default:
35650 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
35651 return NULL;
35652 }
35653 __Pyx_CyFunction_raise_type_error(
35654 func, "takes no keyword arguments");
35655 return NULL;
35656}
35657static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
35658 PyObject *result;
35659 result = __Pyx_CyFunction_CallMethod(func, func, arg, kw);
35660 return result;
35661}
35662static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
35663 PyObject *result;
35664 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35665#if CYTHON_VECTORCALL
35666 __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
35667 if (vc) {
35668#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
35669 return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
35670#else
35671 (void) &__Pyx_PyVectorcall_FastCallDict;
35672 return PyVectorcall_Call(func, args, kw);
35673#endif
35674 }
35675#endif
35676 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
35677 Py_ssize_t argc;
35678 PyObject *new_args;
35679 PyObject *self;
35680#if CYTHON_ASSUME_SAFE_SIZE
35681 argc = PyTuple_GET_SIZE(args);
35682#else
35683 argc = PyTuple_Size(args);
35684 if (unlikely(argc < 0)) return NULL;
35685#endif
35686 new_args = PyTuple_GetSlice(args, 1, argc);
35687 if (unlikely(!new_args))
35688 return NULL;
35689 self = PyTuple_GetItem(args, 0);
35690 if (unlikely(!self)) {
35691 Py_DECREF(new_args);
35692 PyErr_Format(PyExc_TypeError,
35693 "unbound method %.200S() needs an argument",
35694 cyfunc->func_qualname);
35695 return NULL;
35696 }
35697 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
35698 Py_DECREF(new_args);
35699 } else {
35700 result = __Pyx_CyFunction_Call(func, args, kw);
35701 }
35702 return result;
35703}
35704#if CYTHON_VECTORCALL
35705static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(PyObject *func, __pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
35706{
35707 int ret = 0;
35708 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
35709 if (unlikely(nargs < 1)) {
35710 __Pyx_CyFunction_raise_type_error(
35711 func, "needs an argument");
35712 return -1;
35713 }
35714 ret = 1;
35715 }
35716 if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
35717 __Pyx_CyFunction_raise_type_error(
35718 func, "takes no keyword arguments");
35719 return -1;
35720 }
35721 return ret;
35722}
35723static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
35724{
35725 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35726 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
35727 PyObject *self;
35728#if CYTHON_COMPILING_IN_LIMITED_API
35729 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35730 if (unlikely(!meth)) return NULL;
35731#else
35732 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
35733#endif
35734 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
35735 case 1:
35736 self = args[0];
35737 args += 1;
35738 nargs -= 1;
35739 break;
35740 case 0:
35741 self = func;
35742 break;
35743 default:
35744 return NULL;
35745 }
35746 if (unlikely(nargs != 0)) {
35747 __Pyx_CyFunction_raise_argument_count_error(
35748 func, "takes no arguments", nargs);
35749 return NULL;
35750 }
35751 return meth(self, NULL);
35752}
35753static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
35754{
35755 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35756 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
35757 PyObject *self;
35758#if CYTHON_COMPILING_IN_LIMITED_API
35759 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35760 if (unlikely(!meth)) return NULL;
35761#else
35762 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
35763#endif
35764 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
35765 case 1:
35766 self = args[0];
35767 args += 1;
35768 nargs -= 1;
35769 break;
35770 case 0:
35771 self = func;
35772 break;
35773 default:
35774 return NULL;
35775 }
35776 if (unlikely(nargs != 1)) {
35777 __Pyx_CyFunction_raise_argument_count_error(
35778 func, "takes exactly one argument", nargs);
35779 return NULL;
35780 }
35781 return meth(self, args[0]);
35782}
35783static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
35784{
35785 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35786 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
35787 PyObject *self;
35788#if CYTHON_COMPILING_IN_LIMITED_API
35789 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35790 if (unlikely(!meth)) return NULL;
35791#else
35792 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
35793#endif
35794 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
35795 case 1:
35796 self = args[0];
35797 args += 1;
35798 nargs -= 1;
35799 break;
35800 case 0:
35801 self = func;
35802 break;
35803 default:
35804 return NULL;
35805 }
35806 return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames);
35807}
35808static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
35809{
35810 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35811 PyTypeObject *cls = (PyTypeObject *) __Pyx__CyFunction_GetClassObj(cyfunc);
35812 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
35813 PyObject *self;
35814#if CYTHON_COMPILING_IN_LIMITED_API
35815 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35816 if (unlikely(!meth)) return NULL;
35817#else
35818 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
35819#endif
35820 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
35821 case 1:
35822 self = args[0];
35823 args += 1;
35824 nargs -= 1;
35825 break;
35826 case 0:
35827 self = func;
35828 break;
35829 default:
35830 return NULL;
35831 }
35832 #if PY_VERSION_HEX < 0x030e00A6
35833 size_t nargs_value = (size_t) nargs;
35834 #else
35835 Py_ssize_t nargs_value = nargs;
35836 #endif
35837 return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, kwnames);
35838}
35839#endif
35840static PyType_Slot __pyx_CyFunctionType_slots[] = {
35841 {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
35842 {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
35843 {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
35844 {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
35845 {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
35846 {Py_tp_methods, (void *)__pyx_CyFunction_methods},
35847 {Py_tp_members, (void *)__pyx_CyFunction_members},
35848 {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
35849 {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
35850 {0, 0},
35851};
35852static PyType_Spec __pyx_CyFunctionType_spec = {
35853 __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
35854 __PYX_SHARED_SIZEOF(__pyx_CyFunctionObject),
35855 0,
35856#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
35857 Py_TPFLAGS_METHOD_DESCRIPTOR |
35858#endif
35859#if CYTHON_VECTORCALL
35860#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
35861 Py_TPFLAGS_HAVE_VECTORCALL |
35862#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
35863 _Py_TPFLAGS_HAVE_VECTORCALL |
35864#endif
35865#endif // CYTHON_VECTORCALL
35866#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
35867 Py_TPFLAGS_MANAGED_DICT |
35868#endif
35869 Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
35870 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
35871 __pyx_CyFunctionType_slots
35872};
35873static int __pyx_CyFunction_init(PyObject *module) {
35874 __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
35875 mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
35876 mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
35877 if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
35878 return -1;
35879 }
35880 return 0;
35881}
35882
35883/* CythonFunction */
35884static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
35885 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
35886 (void)&__Pyx_Get_CyFunction_Type;
35887 PyObject *op = __Pyx_CyFunction_Init(
35888 PyObject_GC_New(PyObject, __pyx_mstate_global->__pyx_CyFunctionType),
35889 ml, flags, qualname, closure, module, globals, code
35890 );
35891 if (likely(op)) {
35892 PyObject_GC_Track(op);
35893 }
35894 return op;
35895}
35896static PyTypeObject *__Pyx_Get_CyFunction_Type(void) {
35897 PyTypeObject *tp = __pyx_mstate_global->__pyx_CyFunctionType;
35898 Py_INCREF((PyObject*)tp);
35899 return tp;
35900}
35901
35902/* CLineInTraceback (used by AddTraceback) */
35903#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
35904#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
35905#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
35906#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
35907#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
35908#else
35909PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
35910 PyObject **dict_ptr = _PyObject_GetDictPtr(o);
35911 return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
35912}
35913#endif
35914static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
35915 PyObject *use_cline = NULL;
35916 PyObject *ptype, *pvalue, *ptraceback;
35917 PyObject *cython_runtime_dict;
35918 CYTHON_MAYBE_UNUSED_VAR(tstate);
35919 if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
35920 return c_line;
35921 }
35922 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
35923 cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
35924 if (likely(cython_runtime_dict)) {
35925 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
35926 use_cline, cython_runtime_dict,
35927 __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
35928 }
35929 if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
35930 c_line = 0;
35931 }
35932 Py_XDECREF(use_cline);
35933 Py_XDECREF(cython_runtime_dict);
35934 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
35935 return c_line;
35936}
35937#endif
35938
35939/* CodeObjectCache (used by AddTraceback) */
35940static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
35941 int start = 0, mid = 0, end = count - 1;
35942 if (end >= 0 && code_line > entries[end].code_line) {
35943 return count;
35944 }
35945 while (start < end) {
35946 mid = start + (end - start) / 2;
35947 if (code_line < entries[mid].code_line) {
35948 end = mid;
35949 } else if (code_line > entries[mid].code_line) {
35950 start = mid + 1;
35951 } else {
35952 return mid;
35953 }
35954 }
35955 if (code_line <= entries[mid].code_line) {
35956 return mid;
35957 } else {
35958 return mid + 1;
35959 }
35960}
35961static __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) {
35962 __Pyx_CachedCodeObjectType* code_object;
35963 int pos;
35964 if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
35965 return NULL;
35966 }
35967 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
35968 if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
35969 return NULL;
35970 }
35971 code_object = code_cache->entries[pos].code_object;
35972 Py_INCREF(code_object);
35973 return code_object;
35974}
35975static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) {
35976#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
35977 (void)__pyx__find_code_object;
35978 return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss.
35979#else
35980 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
35981#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
35982 __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
35983 if (old_count < 0) {
35984 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
35985 return NULL;
35986 }
35987#endif
35988 __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
35989#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
35990 __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
35991#endif
35992 return result;
35993#endif
35994}
35995static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object)
35996{
35997 int pos, i;
35998 __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
35999 if (unlikely(!code_line)) {
36000 return;
36001 }
36002 if (unlikely(!entries)) {
36003 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
36004 if (likely(entries)) {
36005 code_cache->entries = entries;
36006 code_cache->max_count = 64;
36007 code_cache->count = 1;
36008 entries[0].code_line = code_line;
36009 entries[0].code_object = code_object;
36010 Py_INCREF(code_object);
36011 }
36012 return;
36013 }
36014 pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
36015 if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
36016 __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
36017 entries[pos].code_object = code_object;
36018 Py_INCREF(code_object);
36019 Py_DECREF(tmp);
36020 return;
36021 }
36022 if (code_cache->count == code_cache->max_count) {
36023 int new_max = code_cache->max_count + 64;
36024 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
36025 code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
36026 if (unlikely(!entries)) {
36027 return;
36028 }
36029 code_cache->entries = entries;
36030 code_cache->max_count = new_max;
36031 }
36032 for (i=code_cache->count; i>pos; i--) {
36033 entries[i] = entries[i-1];
36034 }
36035 entries[pos].code_line = code_line;
36036 entries[pos].code_object = code_object;
36037 code_cache->count++;
36038 Py_INCREF(code_object);
36039}
36040static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) {
36041#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
36042 (void)__pyx__insert_code_object;
36043 return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail.
36044#else
36045 struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
36046#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
36047 __pyx_nonatomic_int_type expected = 0;
36048 if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
36049 return;
36050 }
36051#endif
36052 __pyx__insert_code_object(code_cache, code_line, code_object);
36053#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
36054 __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
36055#endif
36056#endif
36057}
36058
36059/* AddTraceback */
36060#include "compile.h"
36061#include "frameobject.h"
36062#include "traceback.h"
36063#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
36064 #ifndef Py_BUILD_CORE
36065 #define Py_BUILD_CORE 1
36066 #endif
36067 #include "internal/pycore_frame.h"
36068#endif
36069#if CYTHON_COMPILING_IN_LIMITED_API
36070static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
36071 PyObject *firstlineno, PyObject *name) {
36072 PyObject *replace = NULL;
36073 if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
36074 if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
36075 replace = PyObject_GetAttrString(code, "replace");
36076 if (likely(replace)) {
36077 PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
36078 Py_DECREF(replace);
36079 return result;
36080 }
36081 return NULL;
36082}
36083static void __Pyx_AddTraceback(const char *funcname, int c_line,
36084 int py_line, const char *filename) {
36085 PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
36086 PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
36087 PyObject *exc_type, *exc_value, *exc_traceback;
36088 int success = 0;
36089 if (c_line) {
36090 c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
36091 }
36092 __Pyx_PyErr_FetchException(&exc_type, &exc_value, &exc_traceback);
36093 code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
36094 if (!code_object) {
36095 code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
36096 if (unlikely(!code_object)) goto bad;
36097 py_py_line = PyLong_FromLong(py_line);
36098 if (unlikely(!py_py_line)) goto bad;
36099 if (c_line) {
36100 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
36101 } else {
36102 py_funcname = PyUnicode_FromString(funcname);
36103 }
36104 if (unlikely(!py_funcname)) goto bad;
36105 dict = PyDict_New();
36106 if (unlikely(!dict)) goto bad;
36107 {
36108 PyObject *old_code_object = code_object;
36109 code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
36110 Py_DECREF(old_code_object);
36111 }
36112 if (unlikely(!code_object)) goto bad;
36113 __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
36114 } else {
36115 dict = PyDict_New();
36116 }
36117 getframe = PySys_GetObject("_getframe");
36118 if (unlikely(!getframe)) goto bad;
36119 if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
36120 frame = PyEval_EvalCode(code_object, dict, dict);
36121 if (unlikely(!frame) || frame == Py_None) goto bad;
36122 success = 1;
36123 bad:
36124 __Pyx_PyErr_RestoreException(exc_type, exc_value, exc_traceback);
36125 Py_XDECREF(code_object);
36126 Py_XDECREF(py_py_line);
36127 Py_XDECREF(py_funcname);
36128 Py_XDECREF(dict);
36129 Py_XDECREF(replace);
36130 if (success) {
36131 PyTraceBack_Here(
36132 (struct _frame*)frame);
36133 }
36134 Py_XDECREF(frame);
36135}
36136#else
36137static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
36138 const char *funcname, int c_line,
36139 int py_line, const char *filename) {
36140 PyCodeObject *py_code = NULL;
36141 PyObject *py_funcname = NULL;
36142 if (c_line) {
36143 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
36144 if (!py_funcname) goto bad;
36145 funcname = PyUnicode_AsUTF8(py_funcname);
36146 if (!funcname) goto bad;
36147 }
36148 py_code = PyCode_NewEmpty(filename, funcname, py_line);
36149 Py_XDECREF(py_funcname);
36150 return py_code;
36151bad:
36152 Py_XDECREF(py_funcname);
36153 return NULL;
36154}
36155static void __Pyx_AddTraceback(const char *funcname, int c_line,
36156 int py_line, const char *filename) {
36157 PyCodeObject *py_code = 0;
36158 PyFrameObject *py_frame = 0;
36159 PyThreadState *tstate = __Pyx_PyThreadState_Current;
36160 PyObject *ptype, *pvalue, *ptraceback;
36161 if (c_line) {
36162 c_line = __Pyx_CLineForTraceback(tstate, c_line);
36163 }
36164 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
36165 if (!py_code) {
36166 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
36167 py_code = __Pyx_CreateCodeObjectForTraceback(
36168 funcname, c_line, py_line, filename);
36169 if (!py_code) {
36170 /* If the code object creation fails, then we should clear the
36171 fetched exception references and propagate the new exception */
36172 Py_XDECREF(ptype);
36173 Py_XDECREF(pvalue);
36174 Py_XDECREF(ptraceback);
36175 goto bad;
36176 }
36177 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
36178 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
36179 }
36180 py_frame = PyFrame_New(
36181 tstate, /*PyThreadState *tstate,*/
36182 py_code, /*PyCodeObject *code,*/
36183 __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/
36184 0 /*PyObject *locals*/
36185 );
36186 if (!py_frame) goto bad;
36187 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
36188 PyTraceBack_Here(py_frame);
36189bad:
36190 Py_XDECREF(py_code);
36191 Py_XDECREF(py_frame);
36192}
36193#endif
36194
36195/* CIntFromPyVerify */
36196#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
36197 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
36198#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
36199 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
36200#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
36201 {\
36202 func_type value = func_value;\
36203 if (sizeof(target_type) < sizeof(func_type)) {\
36204 if (unlikely(value != (func_type) (target_type) value)) {\
36205 func_type zero = 0;\
36206 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
36207 return (target_type) -1;\
36208 if (is_unsigned && unlikely(value < zero))\
36209 goto raise_neg_overflow;\
36210 else\
36211 goto raise_overflow;\
36212 }\
36213 }\
36214 return (target_type) value;\
36215 }
36216
36217/* MemviewDtypeToObject */
36218static CYTHON_INLINE PyObject *__pyx_memview_get_int(const char *itemp) {
36219 return (PyObject *) __Pyx_PyLong_From_int(*(int const *) itemp);
36220}
36221static CYTHON_INLINE int __pyx_memview_set_int(char *itemp, PyObject *obj) {
36222 int value = __Pyx_PyLong_As_int(obj);
36223 if (unlikely((value == (int)-1) && PyErr_Occurred()))
36224 return 0;
36225 *(int *) itemp = value;
36226 return 1;
36227}
36228
36229/* Declarations */
36230#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
36231 #ifdef __cplusplus
36232 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
36233 return ::std::complex< float >(x, y);
36234 }
36235 #else
36236 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
36237 return x + y*(__pyx_t_float_complex)_Complex_I;
36238 }
36239 #endif
36240#else
36241 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
36242 __pyx_t_float_complex z;
36243 z.real = x;
36244 z.imag = y;
36245 return z;
36246 }
36247#endif
36248
36249/* Arithmetic */
36250#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
36251#else
36252 static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
36253 return (a.real == b.real) && (a.imag == b.imag);
36254 }
36255 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
36256 __pyx_t_float_complex z;
36257 z.real = a.real + b.real;
36258 z.imag = a.imag + b.imag;
36259 return z;
36260 }
36261 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
36262 __pyx_t_float_complex z;
36263 z.real = a.real - b.real;
36264 z.imag = a.imag - b.imag;
36265 return z;
36266 }
36267 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
36268 __pyx_t_float_complex z;
36269 z.real = a.real * b.real - a.imag * b.imag;
36270 z.imag = a.real * b.imag + a.imag * b.real;
36271 return z;
36272 }
36273 #if 1
36274 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
36275 if (b.imag == 0) {
36276 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
36277 } else if (fabsf(b.real) >= fabsf(b.imag)) {
36278 if (b.real == 0 && b.imag == 0) {
36279 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
36280 } else {
36281 float r = b.imag / b.real;
36282 float s = (float)(1.0) / (b.real + b.imag * r);
36283 return __pyx_t_float_complex_from_parts(
36284 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
36285 }
36286 } else {
36287 float r = b.real / b.imag;
36288 float s = (float)(1.0) / (b.imag + b.real * r);
36289 return __pyx_t_float_complex_from_parts(
36290 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
36291 }
36292 }
36293 #else
36294 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
36295 if (b.imag == 0) {
36296 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
36297 } else {
36298 float denom = b.real * b.real + b.imag * b.imag;
36299 return __pyx_t_float_complex_from_parts(
36300 (a.real * b.real + a.imag * b.imag) / denom,
36301 (a.imag * b.real - a.real * b.imag) / denom);
36302 }
36303 }
36304 #endif
36305 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
36306 __pyx_t_float_complex z;
36307 z.real = -a.real;
36308 z.imag = -a.imag;
36309 return z;
36310 }
36311 static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
36312 return (a.real == 0) && (a.imag == 0);
36313 }
36314 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
36315 __pyx_t_float_complex z;
36316 z.real = a.real;
36317 z.imag = -a.imag;
36318 return z;
36319 }
36320 #if 1
36321 static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
36322 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
36323 return sqrtf(z.real*z.real + z.imag*z.imag);
36324 #else
36325 return hypotf(z.real, z.imag);
36326 #endif
36327 }
36328 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
36329 __pyx_t_float_complex z;
36330 float r, lnr, theta, z_r, z_theta;
36331 if (b.imag == 0 && b.real == (int)b.real) {
36332 if (b.real < 0) {
36333 float denom = a.real * a.real + a.imag * a.imag;
36334 a.real = a.real / denom;
36335 a.imag = -a.imag / denom;
36336 b.real = -b.real;
36337 }
36338 switch ((int)b.real) {
36339 case 0:
36340 z.real = 1;
36341 z.imag = 0;
36342 return z;
36343 case 1:
36344 return a;
36345 case 2:
36346 return __Pyx_c_prod_float(a, a);
36347 case 3:
36348 z = __Pyx_c_prod_float(a, a);
36349 return __Pyx_c_prod_float(z, a);
36350 case 4:
36351 z = __Pyx_c_prod_float(a, a);
36352 return __Pyx_c_prod_float(z, z);
36353 }
36354 }
36355 if (a.imag == 0) {
36356 if (a.real == 0) {
36357 return a;
36358 } else if ((b.imag == 0) && (a.real >= 0)) {
36359 z.real = powf(a.real, b.real);
36360 z.imag = 0;
36361 return z;
36362 } else if (a.real > 0) {
36363 r = a.real;
36364 theta = 0;
36365 } else {
36366 r = -a.real;
36367 theta = atan2f(0.0, -1.0);
36368 }
36369 } else {
36370 r = __Pyx_c_abs_float(a);
36371 theta = atan2f(a.imag, a.real);
36372 }
36373 lnr = logf(r);
36374 z_r = expf(lnr * b.real - theta * b.imag);
36375 z_theta = theta * b.real + lnr * b.imag;
36376 z.real = z_r * cosf(z_theta);
36377 z.imag = z_r * sinf(z_theta);
36378 return z;
36379 }
36380 #endif
36381#endif
36382
36383/* Declarations */
36384#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
36385 #ifdef __cplusplus
36386 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
36387 return ::std::complex< double >(x, y);
36388 }
36389 #else
36390 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
36391 return x + y*(__pyx_t_double_complex)_Complex_I;
36392 }
36393 #endif
36394#else
36395 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
36396 __pyx_t_double_complex z;
36397 z.real = x;
36398 z.imag = y;
36399 return z;
36400 }
36401#endif
36402
36403/* Arithmetic */
36404#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
36405#else
36406 static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
36407 return (a.real == b.real) && (a.imag == b.imag);
36408 }
36409 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
36410 __pyx_t_double_complex z;
36411 z.real = a.real + b.real;
36412 z.imag = a.imag + b.imag;
36413 return z;
36414 }
36415 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
36416 __pyx_t_double_complex z;
36417 z.real = a.real - b.real;
36418 z.imag = a.imag - b.imag;
36419 return z;
36420 }
36421 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
36422 __pyx_t_double_complex z;
36423 z.real = a.real * b.real - a.imag * b.imag;
36424 z.imag = a.real * b.imag + a.imag * b.real;
36425 return z;
36426 }
36427 #if 1
36428 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
36429 if (b.imag == 0) {
36430 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
36431 } else if (fabs(b.real) >= fabs(b.imag)) {
36432 if (b.real == 0 && b.imag == 0) {
36433 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
36434 } else {
36435 double r = b.imag / b.real;
36436 double s = (double)(1.0) / (b.real + b.imag * r);
36437 return __pyx_t_double_complex_from_parts(
36438 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
36439 }
36440 } else {
36441 double r = b.real / b.imag;
36442 double s = (double)(1.0) / (b.imag + b.real * r);
36443 return __pyx_t_double_complex_from_parts(
36444 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
36445 }
36446 }
36447 #else
36448 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
36449 if (b.imag == 0) {
36450 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
36451 } else {
36452 double denom = b.real * b.real + b.imag * b.imag;
36453 return __pyx_t_double_complex_from_parts(
36454 (a.real * b.real + a.imag * b.imag) / denom,
36455 (a.imag * b.real - a.real * b.imag) / denom);
36456 }
36457 }
36458 #endif
36459 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
36460 __pyx_t_double_complex z;
36461 z.real = -a.real;
36462 z.imag = -a.imag;
36463 return z;
36464 }
36465 static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
36466 return (a.real == 0) && (a.imag == 0);
36467 }
36468 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
36469 __pyx_t_double_complex z;
36470 z.real = a.real;
36471 z.imag = -a.imag;
36472 return z;
36473 }
36474 #if 1
36475 static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
36476 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
36477 return sqrt(z.real*z.real + z.imag*z.imag);
36478 #else
36479 return hypot(z.real, z.imag);
36480 #endif
36481 }
36482 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
36483 __pyx_t_double_complex z;
36484 double r, lnr, theta, z_r, z_theta;
36485 if (b.imag == 0 && b.real == (int)b.real) {
36486 if (b.real < 0) {
36487 double denom = a.real * a.real + a.imag * a.imag;
36488 a.real = a.real / denom;
36489 a.imag = -a.imag / denom;
36490 b.real = -b.real;
36491 }
36492 switch ((int)b.real) {
36493 case 0:
36494 z.real = 1;
36495 z.imag = 0;
36496 return z;
36497 case 1:
36498 return a;
36499 case 2:
36500 return __Pyx_c_prod_double(a, a);
36501 case 3:
36502 z = __Pyx_c_prod_double(a, a);
36503 return __Pyx_c_prod_double(z, a);
36504 case 4:
36505 z = __Pyx_c_prod_double(a, a);
36506 return __Pyx_c_prod_double(z, z);
36507 }
36508 }
36509 if (a.imag == 0) {
36510 if (a.real == 0) {
36511 return a;
36512 } else if ((b.imag == 0) && (a.real >= 0)) {
36513 z.real = pow(a.real, b.real);
36514 z.imag = 0;
36515 return z;
36516 } else if (a.real > 0) {
36517 r = a.real;
36518 theta = 0;
36519 } else {
36520 r = -a.real;
36521 theta = atan2(0.0, -1.0);
36522 }
36523 } else {
36524 r = __Pyx_c_abs_double(a);
36525 theta = atan2(a.imag, a.real);
36526 }
36527 lnr = log(r);
36528 z_r = exp(lnr * b.real - theta * b.imag);
36529 z_theta = theta * b.real + lnr * b.imag;
36530 z.real = z_r * cos(z_theta);
36531 z.imag = z_r * sin(z_theta);
36532 return z;
36533 }
36534 #endif
36535#endif
36536
36537/* Declarations */
36538#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
36539 #ifdef __cplusplus
36540 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
36541 return ::std::complex< long double >(x, y);
36542 }
36543 #else
36544 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
36545 return x + y*(__pyx_t_long_double_complex)_Complex_I;
36546 }
36547 #endif
36548#else
36549 static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
36550 __pyx_t_long_double_complex z;
36551 z.real = x;
36552 z.imag = y;
36553 return z;
36554 }
36555#endif
36556
36557/* Arithmetic */
36558#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
36559#else
36560 static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
36561 return (a.real == b.real) && (a.imag == b.imag);
36562 }
36563 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) {
36564 __pyx_t_long_double_complex z;
36565 z.real = a.real + b.real;
36566 z.imag = a.imag + b.imag;
36567 return z;
36568 }
36569 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) {
36570 __pyx_t_long_double_complex z;
36571 z.real = a.real - b.real;
36572 z.imag = a.imag - b.imag;
36573 return z;
36574 }
36575 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) {
36576 __pyx_t_long_double_complex z;
36577 z.real = a.real * b.real - a.imag * b.imag;
36578 z.imag = a.real * b.imag + a.imag * b.real;
36579 return z;
36580 }
36581 #if 1
36582 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) {
36583 if (b.imag == 0) {
36584 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
36585 } else if (fabsl(b.real) >= fabsl(b.imag)) {
36586 if (b.real == 0 && b.imag == 0) {
36587 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
36588 } else {
36589 long double r = b.imag / b.real;
36590 long double s = (long double)(1.0) / (b.real + b.imag * r);
36591 return __pyx_t_long_double_complex_from_parts(
36592 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
36593 }
36594 } else {
36595 long double r = b.real / b.imag;
36596 long double s = (long double)(1.0) / (b.imag + b.real * r);
36597 return __pyx_t_long_double_complex_from_parts(
36598 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
36599 }
36600 }
36601 #else
36602 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) {
36603 if (b.imag == 0) {
36604 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
36605 } else {
36606 long double denom = b.real * b.real + b.imag * b.imag;
36607 return __pyx_t_long_double_complex_from_parts(
36608 (a.real * b.real + a.imag * b.imag) / denom,
36609 (a.imag * b.real - a.real * b.imag) / denom);
36610 }
36611 }
36612 #endif
36613 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) {
36614 __pyx_t_long_double_complex z;
36615 z.real = -a.real;
36616 z.imag = -a.imag;
36617 return z;
36618 }
36619 static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) {
36620 return (a.real == 0) && (a.imag == 0);
36621 }
36622 static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) {
36623 __pyx_t_long_double_complex z;
36624 z.real = a.real;
36625 z.imag = -a.imag;
36626 return z;
36627 }
36628 #if 1
36629 static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex z) {
36630 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
36631 return sqrtl(z.real*z.real + z.imag*z.imag);
36632 #else
36633 return hypotl(z.real, z.imag);
36634 #endif
36635 }
36636 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) {
36637 __pyx_t_long_double_complex z;
36638 long double r, lnr, theta, z_r, z_theta;
36639 if (b.imag == 0 && b.real == (int)b.real) {
36640 if (b.real < 0) {
36641 long double denom = a.real * a.real + a.imag * a.imag;
36642 a.real = a.real / denom;
36643 a.imag = -a.imag / denom;
36644 b.real = -b.real;
36645 }
36646 switch ((int)b.real) {
36647 case 0:
36648 z.real = 1;
36649 z.imag = 0;
36650 return z;
36651 case 1:
36652 return a;
36653 case 2:
36654 return __Pyx_c_prod_long__double(a, a);
36655 case 3:
36656 z = __Pyx_c_prod_long__double(a, a);
36657 return __Pyx_c_prod_long__double(z, a);
36658 case 4:
36659 z = __Pyx_c_prod_long__double(a, a);
36660 return __Pyx_c_prod_long__double(z, z);
36661 }
36662 }
36663 if (a.imag == 0) {
36664 if (a.real == 0) {
36665 return a;
36666 } else if ((b.imag == 0) && (a.real >= 0)) {
36667 z.real = powl(a.real, b.real);
36668 z.imag = 0;
36669 return z;
36670 } else if (a.real > 0) {
36671 r = a.real;
36672 theta = 0;
36673 } else {
36674 r = -a.real;
36675 theta = atan2l(0.0, -1.0);
36676 }
36677 } else {
36678 r = __Pyx_c_abs_long__double(a);
36679 theta = atan2l(a.imag, a.real);
36680 }
36681 lnr = logl(r);
36682 z_r = expl(lnr * b.real - theta * b.imag);
36683 z_theta = theta * b.real + lnr * b.imag;
36684 z.real = z_r * cosl(z_theta);
36685 z.imag = z_r * sinl(z_theta);
36686 return z;
36687 }
36688 #endif
36689#endif
36690
36691/* MemviewRefcount */
36692#include <stdio.h>
36693#ifndef _Py_NO_RETURN
36694#define _Py_NO_RETURN
36695#endif
36696_Py_NO_RETURN
36697static void __pyx_fatalerror(const char *fmt, ...) {
36698 va_list vargs;
36699 char msg[200];
36700#if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
36701 va_start(vargs, fmt);
36702#else
36703 va_start(vargs);
36704#endif
36705 vsnprintf(msg, 200, fmt, vargs);
36706 va_end(vargs);
36707 Py_FatalError(msg);
36708}
36709static CYTHON_INLINE int
36710__pyx_add_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
36711 PyThread_type_lock lock)
36712{
36713 int result;
36714 PyThread_acquire_lock(lock, 1);
36715 result = (*acquisition_count)++;
36716 PyThread_release_lock(lock);
36717 return result;
36718}
36719static CYTHON_INLINE int
36720__pyx_sub_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
36721 PyThread_type_lock lock)
36722{
36723 int result;
36724 PyThread_acquire_lock(lock, 1);
36725 result = (*acquisition_count)--;
36726 PyThread_release_lock(lock);
36727 return result;
36728}
36729static CYTHON_INLINE void
36730__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
36731{
36732 __pyx_nonatomic_int_type old_acquisition_count;
36733 struct __pyx_memoryview_obj *memview = memslice->memview;
36734 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
36735 return;
36736 }
36737 old_acquisition_count = __pyx_add_acquisition_count(memview);
36738 if (unlikely(old_acquisition_count <= 0)) {
36739 if (likely(old_acquisition_count == 0)) {
36740 if (have_gil) {
36741 Py_INCREF((PyObject *) memview);
36742 } else {
36743 PyGILState_STATE _gilstate = PyGILState_Ensure();
36744 Py_INCREF((PyObject *) memview);
36745 PyGILState_Release(_gilstate);
36746 }
36747 } else {
36748 __pyx_fatalerror("Acquisition count is %d (line %d)",
36749 old_acquisition_count+1, lineno);
36750 }
36751 }
36752}
36753static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice,
36754 int have_gil, int lineno) {
36755 __pyx_nonatomic_int_type old_acquisition_count;
36756 struct __pyx_memoryview_obj *memview = memslice->memview;
36757 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
36758 memslice->memview = NULL;
36759 return;
36760 }
36761 old_acquisition_count = __pyx_sub_acquisition_count(memview);
36762 memslice->data = NULL;
36763 if (likely(old_acquisition_count > 1)) {
36764 memslice->memview = NULL;
36765 } else if (likely(old_acquisition_count == 1)) {
36766 if (have_gil) {
36767 Py_CLEAR(memslice->memview);
36768 } else {
36769 PyGILState_STATE _gilstate = PyGILState_Ensure();
36770 Py_CLEAR(memslice->memview);
36771 PyGILState_Release(_gilstate);
36772 }
36773 } else {
36774 __pyx_fatalerror("Acquisition count is %d (line %d)",
36775 old_acquisition_count-1, lineno);
36776 }
36777}
36778
36779/* MemviewSliceIsContig */
36780static int
36781__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
36782{
36783 int i, index, step, start;
36784 Py_ssize_t itemsize = mvs.memview->view.itemsize;
36785 if (order == 'F') {
36786 step = 1;
36787 start = 0;
36788 } else {
36789 step = -1;
36790 start = ndim - 1;
36791 }
36792 for (i = 0; i < ndim; i++) {
36793 index = start + step * i;
36794 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
36795 return 0;
36796 itemsize *= mvs.shape[index];
36797 }
36798 return 1;
36799}
36800
36801/* OverlappingSlices */
36802static void
36803__pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
36804 void **out_start, void **out_end,
36805 int ndim, size_t itemsize)
36806{
36807 char *start, *end;
36808 int i;
36809 start = end = slice->data;
36810 for (i = 0; i < ndim; i++) {
36811 Py_ssize_t stride = slice->strides[i];
36812 Py_ssize_t extent = slice->shape[i];
36813 if (extent == 0) {
36814 *out_start = *out_end = start;
36815 return;
36816 } else {
36817 if (stride > 0)
36818 end += stride * (extent - 1);
36819 else
36820 start += stride * (extent - 1);
36821 }
36822 }
36823 *out_start = start;
36824 *out_end = end + itemsize;
36825}
36826static int
36827__pyx_slices_overlap(__Pyx_memviewslice *slice1,
36828 __Pyx_memviewslice *slice2,
36829 int ndim, size_t itemsize)
36830{
36831 void *start1, *end1, *start2, *end2;
36832 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
36833 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
36834 return (start1 < end2) && (start2 < end1);
36835}
36836
36837/* MemviewSliceInit */
36838static int
36839__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
36840 int ndim,
36841 __Pyx_memviewslice *memviewslice,
36842 int memview_is_new_reference)
36843{
36844 __Pyx_RefNannyDeclarations
36845 int i, retval=-1;
36846 Py_buffer *buf = &memview->view;
36847 __Pyx_RefNannySetupContext("init_memviewslice", 0);
36848 if (unlikely(memviewslice->memview || memviewslice->data)) {
36849 PyErr_SetString(PyExc_ValueError,
36850 "memviewslice is already initialized!");
36851 goto fail;
36852 }
36853 if (buf->strides) {
36854 for (i = 0; i < ndim; i++) {
36855 memviewslice->strides[i] = buf->strides[i];
36856 }
36857 } else {
36858 Py_ssize_t stride = buf->itemsize;
36859 for (i = ndim - 1; i >= 0; i--) {
36860 memviewslice->strides[i] = stride;
36861 stride *= buf->shape[i];
36862 }
36863 }
36864 for (i = 0; i < ndim; i++) {
36865 memviewslice->shape[i] = buf->shape[i];
36866 if (buf->suboffsets) {
36867 memviewslice->suboffsets[i] = buf->suboffsets[i];
36868 } else {
36869 memviewslice->suboffsets[i] = -1;
36870 }
36871 }
36872 memviewslice->memview = memview;
36873 memviewslice->data = (char *)buf->buf;
36874 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
36875 Py_INCREF((PyObject*)memview);
36876 }
36877 retval = 0;
36878 goto no_fail;
36879fail:
36880 memviewslice->memview = 0;
36881 memviewslice->data = 0;
36882 retval = -1;
36883no_fail:
36884 __Pyx_RefNannyFinishContext();
36885 return retval;
36886}
36887
36888/* SliceMemoryviewSlice */
36889static void __pyx_memoryview_slice_memviewslice_err_dim(PyObject *error, const char* msg, int dim) {
36890 PyGILState_STATE gilstate = PyGILState_Ensure();
36891 PyErr_Format(error, msg, dim);
36892 PyGILState_Release(gilstate);
36893}
36894static CYTHON_INLINE int __pyx_memoryview_slice_memviewslice(
36895 __Pyx_memviewslice *dst,
36896 Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
36897 int dim, int new_ndim, int *suboffset_dim,
36898 Py_ssize_t start, Py_ssize_t stop, Py_ssize_t step,
36899 int have_start, int have_stop, int have_step,
36900 int is_slice) {
36901 if (!is_slice) {
36902 if (start < 0) {
36903 start += shape;
36904 }
36905 if (unlikely(!(0 <= start && start < shape))) {
36906 __pyx_memoryview_slice_memviewslice_err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim);
36907 return -1;
36908 }
36909 } else {
36910 int negative_step;
36911 if (have_step) {
36912 negative_step = step < 0;
36913 if (unlikely(step == 0)) {
36914 __pyx_memoryview_slice_memviewslice_err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim);
36915 return -1;
36916 }
36917 } else {
36918 negative_step = 0;
36919 step = 1;
36920 }
36921 if (have_start) {
36922 if (start < 0) {
36923 start += shape;
36924 if (start < 0) {
36925 start = 0;
36926 }
36927 } else if (start >= shape) {
36928 start = negative_step ? (shape - 1) : shape;
36929 }
36930 } else {
36931 start = negative_step ? (shape - 1) : 0;
36932 }
36933 if (have_stop) {
36934 if (stop < 0) {
36935 stop += shape;
36936 if (stop < 0) {
36937 stop = 0;
36938 }
36939 } else if (stop > shape) {
36940 stop = shape;
36941 }
36942 } else {
36943 stop = negative_step ? -1 : shape;
36944 }
36945 Py_ssize_t new_shape = (stop - start) / step;
36946 if ((stop - start) - step * new_shape) {
36947 ++new_shape;
36948 }
36949 if (new_shape < 0) {
36950 new_shape = 0;
36951 }
36952 dst->strides[new_ndim] = stride * step;
36953 dst->shape[new_ndim] = new_shape;
36954 dst->suboffsets[new_ndim] = suboffset;
36955 }
36956 if (suboffset_dim[0] < 0) {
36957 dst->data += start * stride;
36958 } else {
36959 dst->suboffsets[suboffset_dim[0]] += start * stride;
36960 }
36961 if (suboffset >= 0) {
36962 if (!is_slice) {
36963 if (likely(new_ndim == 0)) {
36964 dst->data = ((char **)(dst->data))[0] + suboffset;
36965 } else {
36966 __pyx_memoryview_slice_memviewslice_err_dim(
36967 PyExc_IndexError,
36968 "All dimensions preceding dimension %d must be indexed and not sliced",
36969 dim);
36970 return -1;
36971 }
36972 } else {
36973 suboffset_dim[0] = new_ndim;
36974 }
36975 }
36976 return 0;
36977}
36978
36979/* CIntFromPy */
36980static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x);
36981static int __Pyx_raise_neg_overflow___Pyx_PyLong_As_int(void) {
36982 const char* type_name = "int";
36983 PyErr_Format(PyExc_OverflowError,
36984 "can't convert negative value to %.200s", type_name);
36985 return (int) -1;
36986}
36987static int __Pyx_raise_overflow___Pyx_PyLong_As_int(void) {
36988 const char* type_name = "int";
36989 PyErr_Format(PyExc_OverflowError,
36990 "value too large to convert to %.200s", type_name);
36991 return (int) -1;
36992}
36993static CYTHON_INLINE int __Pyx_PyULong___Pyx_PyLong_As_int(PyObject *x) {
36994 const int is_unsigned = 1;
36995#if CYTHON_USE_PYLONG_INTERNALS
36996 {
36997 const digit* digits = __Pyx_PyLong_Digits(x);
36998 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
36999 if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
37000 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
37001 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37002 } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
37003 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37004 }
37005 } else
37006 if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
37007 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
37008 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37009 } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
37010 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37011 }
37012 } else
37013 if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
37014 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
37015 __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])))
37016 } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
37017 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37018 }
37019 } else
37020 {}
37021 }
37022#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
37023 if (unlikely(Py_SIZE(x) < 0)) {
37024 goto raise_neg_overflow;
37025 }
37026#else
37027 {
37028 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
37029 if (unlikely(result < 0))
37030 return (int) -1;
37031 if (unlikely(result == 1))
37032 goto raise_neg_overflow;
37033 }
37034#endif
37035 if ((sizeof(int) <= sizeof(unsigned long))) {
37036 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
37037 } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
37038 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
37039 }
37040 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
37041raise_neg_overflow:
37042 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
37043raise_overflow:
37044 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
37045}
37046static CYTHON_INLINE int __Pyx_PySLong___Pyx_PyLong_As_int(PyObject *x) {
37047 const int is_unsigned = 0;
37048#if CYTHON_USE_PYLONG_INTERNALS
37049 if (__Pyx_PyLong_IsNeg(x)) {
37050 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
37051 const digit* digits = __Pyx_PyLong_Digits(x);
37052 if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
37053 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
37054 long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
37055 __PYX_VERIFY_RETURN_INT(int, long, ival)
37056 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
37057 return (int) (((int) -1) * (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
37058 }
37059 } else
37060 if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
37061 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
37062 long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
37063 __PYX_VERIFY_RETURN_INT(int, long, ival)
37064 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
37065 return (int) (((int) -1) * (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
37066 }
37067 } else
37068 if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
37069 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
37070 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]));
37071 __PYX_VERIFY_RETURN_INT(int, long, ival)
37072 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
37073 return (int) (((int) -1) * (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
37074 }
37075 } else
37076 {}
37077 } else {
37078 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
37079 const digit* digits = __Pyx_PyLong_Digits(x);
37080 if (size == 2 && (8 * sizeof(int) > 1 * PyLong_SHIFT)) {
37081 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
37082 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37083 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
37084 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37085 }
37086 } else
37087 if (size == 3 && (8 * sizeof(int) > 2 * PyLong_SHIFT)) {
37088 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
37089 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37090 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
37091 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37092 }
37093 } else
37094 if (size == 4 && (8 * sizeof(int) > 3 * PyLong_SHIFT)) {
37095 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
37096 __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])))
37097 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
37098 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
37099 }
37100 } else
37101 {}
37102 }
37103#endif
37104 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
37105 if ((sizeof(int) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
37106 __PYX_VERIFY_RETURN_INT_EXC(int, int, PyLong_AsInt(x))
37107 } else
37108 #endif
37109 if ((sizeof(int) <= sizeof(long))) {
37110 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
37111 } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
37112 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
37113 }
37114 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
37115raise_neg_overflow:
37116 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
37117raise_overflow:
37118 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
37119}
37120static int __Pyx_LargePyLong___Pyx_PyLong_As_int(PyObject *x) {
37121#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37122#pragma GCC diagnostic push
37123#pragma GCC diagnostic ignored "-Wconversion"
37124#endif
37125 const int neg_one = (int) -1, const_zero = (int) 0;
37126#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37127#pragma GCC diagnostic pop
37128#endif
37129 const int is_unsigned = neg_one > const_zero;
37130 int val;
37131 int ret = -1;
37132#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
37133 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
37134 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
37135 if (unlikely(bytes_copied == -1)) {
37136 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
37137 goto raise_overflow;
37138 } else {
37139 ret = 0;
37140 }
37141#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
37142 int one = 1; int is_little = (int)*(unsigned char *)&one;
37143 unsigned char *bytes = (unsigned char *)&val;
37144 ret = _PyLong_AsByteArray((PyLongObject *)x,
37145 bytes, sizeof(val),
37146 is_little, !is_unsigned);
37147 if ((0)) goto raise_overflow;
37148#else
37149 PyObject *v;
37150 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
37151 int bits, remaining_bits, is_negative = 0;
37152 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
37153 if (likely(PyLong_CheckExact(x))) {
37154 v = __Pyx_NewRef(x);
37155 } else {
37156 v = PyNumber_Long(x);
37157 if (unlikely(!v)) return (int) -1;
37158 assert(PyLong_CheckExact(v));
37159 }
37160 {
37161 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
37162 if (unlikely(result < 0)) {
37163 Py_DECREF(v);
37164 return (int) -1;
37165 }
37166 is_negative = result == 1;
37167 }
37168 if (is_unsigned && unlikely(is_negative)) {
37169 Py_DECREF(v);
37170 PyErr_SetString(PyExc_OverflowError,
37171 "can't convert negative value to int");
37172 return (int) -1;
37173 } else if (is_negative) {
37174 stepval = PyNumber_Invert(v);
37175 Py_DECREF(v);
37176 if (unlikely(!stepval))
37177 return (int) -1;
37178 } else {
37179 stepval = v;
37180 }
37181 v = NULL;
37182 val = (int) 0;
37183 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
37184 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
37185 for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
37186 PyObject *tmp, *digit;
37187 long idigit;
37188 digit = PyNumber_And(stepval, mask);
37189 if (unlikely(!digit)) goto done;
37190 idigit = PyLong_AsLong(digit);
37191 Py_DECREF(digit);
37192 if (unlikely(idigit < 0)) goto done;
37193 val |= ((int) idigit) << bits;
37194 tmp = PyNumber_Rshift(stepval, shift);
37195 if (unlikely(!tmp)) goto done;
37196 Py_DECREF(stepval); stepval = tmp;
37197 }
37198 Py_DECREF(shift); shift = NULL;
37199 Py_DECREF(mask); mask = NULL;
37200 {
37201 long idigit = PyLong_AsLong(stepval);
37202 if (unlikely(idigit < 0)) goto done;
37203 remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
37204 if (unlikely(idigit >= (1L << remaining_bits)))
37205 goto raise_overflow;
37206 val |= ((int) idigit) << bits;
37207 }
37208 if (!is_unsigned) {
37209 if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
37210 goto raise_overflow;
37211 if (is_negative)
37212 val = ~val;
37213 }
37214 ret = 0;
37215done:
37216 Py_XDECREF(shift);
37217 Py_XDECREF(mask);
37218 Py_XDECREF(stepval);
37219#endif
37220 if (unlikely(ret))
37221 return (int) -1;
37222 return val;
37223raise_overflow:
37224 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
37225}
37226static CYTHON_INLINE int __Pyx_PyLong___Pyx_PyLong_As_int(PyObject *x) {
37227#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37228#pragma GCC diagnostic push
37229#pragma GCC diagnostic ignored "-Wconversion"
37230#endif
37231 const int neg_one = (int) -1, const_zero = (int) 0;
37232#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37233#pragma GCC diagnostic pop
37234#endif
37235 const int is_unsigned = neg_one > const_zero;
37236 if (is_unsigned) {
37237 #if CYTHON_USE_PYLONG_INTERNALS
37238 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
37239 goto raise_neg_overflow;
37240 } else if (__Pyx_PyLong_IsCompact(x)) {
37241 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
37242 } else
37243 #endif
37244 {
37245 return __Pyx_PyULong___Pyx_PyLong_As_int(x);
37246 }
37247 } else {
37248 #if CYTHON_USE_PYLONG_INTERNALS
37249 if (__Pyx_PyLong_IsCompact(x)) {
37250 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
37251 } else
37252 #endif
37253 {
37254 return __Pyx_PySLong___Pyx_PyLong_As_int(x);
37255 }
37256 }
37257#if CYTHON_USE_PYLONG_INTERNALS
37258raise_neg_overflow:
37259 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
37260raise_overflow:
37261 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
37262#endif
37263}
37264static int __Pyx_NonPyLong___Pyx_PyLong_As_int(PyObject *x) {
37265 int val;
37266 PyObject *tmp = __Pyx_PyNumber_Long(x);
37267 if (!tmp) return (int) -1;
37268 val = __Pyx_PyLong_As_int(tmp);
37269 Py_DECREF(tmp);
37270 return val;
37271}
37272static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) {
37273 if (likely(PyLong_Check(x))) {
37274 return __Pyx_PyLong___Pyx_PyLong_As_int(x);
37275 } else {
37276 return __Pyx_NonPyLong___Pyx_PyLong_As_int(x);
37277 }
37278}
37279
37280/* PyObjectVectorcallKwds (used by PyObjectVectorcallMethodKwds) */
37281#if CYTHON_VECTORCALL
37282CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject *kwnames, Py_ssize_t i) {
37283 PyObject *key = __Pyx_PyTuple_GET_ITEM(kwnames, i);
37284#if !CYTHON_ASSUME_SAFE_MACROS
37285 if (unlikely(!key)) return -1;
37286#endif
37287 if (unlikely(!PyUnicode_Check(key))) {
37288 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
37289 return -1;
37290 }
37291 return 0;
37292}
37293#else
37294CYTHON_UNUSED static PyObject *__Pyx_MakeKwargDict(PyObject **keys, PyObject **values, Py_ssize_t n) {
37295 PyObject *out = PyDict_New();
37296 if (unlikely(!out)) return NULL;
37297 for (Py_ssize_t i=0; i<n; ++i) {
37298 if (unlikely(PyDict_SetItem(out, keys[i], values[i]) < 0)) {
37299 Py_DECREF(out);
37300 return NULL;
37301 }
37302 }
37303 return out;
37304}
37305CYTHON_UNUSED static int __Pyx_CheckVectorcallKwarg(PyObject **kwnames, Py_ssize_t i) {
37306 PyObject *key = kwnames[i];
37307 if (unlikely(!PyUnicode_Check(key))) {
37308 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
37309 return -1;
37310 }
37311 return 0;
37312}
37313#endif
37314
37315/* PyObjectVectorcallMethodKwds (used by CIntToPy) */
37316#if !CYTHON_VECTORCALL
37317static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
37318 PyObject *result;
37319 PyObject *obj = PyObject_GetAttr(args[0], name);
37320 if (unlikely(!obj))
37321 return NULL;
37322 result = __Pyx_Object_VectorcallKwds(obj, args+1, nargsf-1, kwnames);
37323 Py_DECREF(obj);
37324 return result;
37325}
37326#endif
37327
37328/* CIntToPy */
37329static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value) {
37330#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37331#pragma GCC diagnostic push
37332#pragma GCC diagnostic ignored "-Wconversion"
37333#endif
37334 const int neg_one = (int) -1, const_zero = (int) 0;
37335#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37336#pragma GCC diagnostic pop
37337#endif
37338 const int is_unsigned = neg_one > const_zero;
37339 if (is_unsigned) {
37340 if (sizeof(int) < sizeof(long)) {
37341 return PyLong_FromLong((long) value);
37342 } else if (sizeof(int) <= sizeof(unsigned long)) {
37343 return PyLong_FromUnsignedLong((unsigned long) value);
37344#if !CYTHON_COMPILING_IN_PYPY
37345 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
37346 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
37347#endif
37348 }
37349 } else {
37350 if (sizeof(int) <= sizeof(long)) {
37351 return PyLong_FromLong((long) value);
37352 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
37353 return PyLong_FromLongLong((PY_LONG_LONG) value);
37354 }
37355 }
37356 {
37357 unsigned char *bytes = (unsigned char *)&value;
37358#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
37359 if (is_unsigned) {
37360 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
37361 } else {
37362 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
37363 }
37364#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
37365 int one = 1; int little = (int)*(unsigned char *)&one;
37366 return _PyLong_FromByteArray(bytes, sizeof(int),
37367 little, !is_unsigned);
37368#else
37369 int one = 1; int little = (int)*(unsigned char *)&one;
37370 PyObject *result = NULL, *kwds = NULL;
37371 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
37372 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
37373 if (!py_bytes) goto limited_bad;
37374 from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
37375 if (!from_bytes_str) goto limited_bad;
37376 order_str = PyUnicode_FromString(little ? "little" : "big");
37377 if (!order_str) goto limited_bad;
37378 {
37379 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
37380 if (!is_unsigned) {
37381 PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
37382 if (!signed_str) goto limited_bad;
37383#if CYTHON_VECTORCALL
37384 kwds = PyTuple_Pack(1, signed_str);
37385#else
37386 {
37387 PyObject *keys[] = {signed_str};
37388 PyObject *values[] = {Py_True};
37389 kwds = __Pyx_MakeKwargDict(keys, values, 1);
37390 }
37391#endif
37392 Py_DECREF(signed_str);
37393 if (unlikely(!kwds)) goto limited_bad;
37394 }
37395 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
37396 }
37397 limited_bad:
37398 Py_XDECREF(kwds);
37399 Py_XDECREF(order_str);
37400 Py_XDECREF(py_bytes);
37401 Py_XDECREF(from_bytes_str);
37402 return result;
37403#endif
37404 }
37405}
37406
37407/* TypeInfoToFormat */
37408static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(const __Pyx_TypeInfo *type) {
37409 struct __pyx_typeinfo_string result = { {0} };
37410 char *buf = (char *) result.string;
37411 size_t size = type->size;
37412 switch (type->typegroup) {
37413 case 'H':
37414 *buf = 'c';
37415 break;
37416 case 'I':
37417 case 'U':
37418 if (size == 1)
37419 *buf = (type->is_unsigned) ? 'B' : 'b';
37420 else if (size == 2)
37421 *buf = (type->is_unsigned) ? 'H' : 'h';
37422 else if (size == 4)
37423 *buf = (type->is_unsigned) ? 'I' : 'i';
37424 else if (size == 8)
37425 *buf = (type->is_unsigned) ? 'Q' : 'q';
37426 break;
37427 case 'P':
37428 *buf = 'P';
37429 break;
37430 case 'C':
37431 {
37432 __Pyx_TypeInfo complex_type = *type;
37433 complex_type.typegroup = 'R';
37434 complex_type.size /= 2;
37435 *buf++ = 'Z';
37436 *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0];
37437 break;
37438 }
37439 case 'R':
37440 if (size == 4)
37441 *buf = 'f';
37442 else if (size == 8)
37443 *buf = 'd';
37444 else
37445 *buf = 'g';
37446 break;
37447 }
37448 return result;
37449}
37450
37451/* MemviewSliceCopy */
37452static __Pyx_memviewslice
37453__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
37454 const char *mode, int ndim,
37455 Py_ssize_t sizeof_dtype, int contig_flag,
37456 int dtype_is_object)
37457{
37458 __Pyx_RefNannyDeclarations
37459 int i;
37460 __Pyx_memviewslice new_mvs = __Pyx_MEMSLICE_INIT;
37461 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
37462 Py_buffer *buf = &from_memview->view;
37463 PyObject *shape_tuple = NULL;
37464 struct __pyx_array_obj *array_obj = NULL;
37465 struct __pyx_memoryview_obj *memview_obj = NULL;
37466 __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
37467 for (i = 0; i < ndim; i++) {
37468 if (unlikely(from_mvs->suboffsets[i] >= 0)) {
37469 PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
37470 "indirect dimensions (axis %d)", i);
37471 goto fail;
37472 }
37473 }
37474 shape_tuple = PyTuple_New(ndim);
37475 if (unlikely(!shape_tuple)) {
37476 goto fail;
37477 }
37478 __Pyx_GOTREF(shape_tuple);
37479 for(i = 0; i < ndim; i++) {
37480 PyObject *temp_int = PyLong_FromSsize_t(from_mvs->shape[i]);
37481 if(unlikely(!temp_int)) {
37482 goto fail;
37483 } else {
37484#if CYTHON_ASSUME_SAFE_MACROS
37485 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
37486#else
37487 if (PyTuple_SetItem(shape_tuple, i, temp_int) < 0) {
37488 goto fail;
37489 }
37490#endif
37491 }
37492 }
37493 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, mode, NULL);
37494 if (unlikely(!array_obj)) {
37495 goto fail;
37496 }
37497 __Pyx_GOTREF(array_obj);
37498 memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
37499 (PyObject *) array_obj, contig_flag,
37500 dtype_is_object,
37501 from_mvs->memview->typeinfo);
37502 if (unlikely(!memview_obj))
37503 goto fail;
37504 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
37505 goto fail;
37506 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
37507 dtype_is_object) < 0))
37508 goto fail;
37509 goto no_fail;
37510fail:
37511 __Pyx_XDECREF((PyObject *) new_mvs.memview);
37512 new_mvs.memview = NULL;
37513 new_mvs.data = NULL;
37514no_fail:
37515 __Pyx_XDECREF(shape_tuple);
37516 __Pyx_XDECREF((PyObject *) array_obj);
37517 __Pyx_RefNannyFinishContext();
37518 return new_mvs;
37519}
37520
37521/* UpdateUnpickledDict */
37522static int __Pyx__UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
37523 PyObject *state_dict = __Pyx_PySequence_ITEM(state, index);
37524 if (unlikely(!state_dict)) {
37525 return -1;
37526 }
37527 int non_empty = PyObject_IsTrue(state_dict);
37528 if (non_empty == 0) {
37529 Py_DECREF(state_dict);
37530 return 0;
37531 } else if (unlikely(non_empty == -1)) {
37532 return -1;
37533 }
37534 PyObject *dict;
37535 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
37536 dict = PyObject_GetAttrString(obj, "__dict__");
37537 #else
37538 dict = PyObject_GenericGetDict(obj, NULL);
37539 #endif
37540 if (unlikely(!dict)) {
37541 Py_DECREF(state_dict);
37542 return -1;
37543 }
37544 int result;
37545 if (likely(PyDict_CheckExact(dict))) {
37546 result = PyDict_Update(dict, state_dict);
37547 } else {
37548 PyObject *obj_result = __Pyx_PyObject_CallMethod1(dict, __pyx_mstate_global->__pyx_n_u_update, state_dict);
37549 if (likely(obj_result)) {
37550 Py_DECREF(obj_result);
37551 result = 0;
37552 } else {
37553 result = -1;
37554 }
37555 }
37556 Py_DECREF(state_dict);
37557 Py_DECREF(dict);
37558 return result;
37559}
37560static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
37561 Py_ssize_t state_size = __Pyx_PyTuple_GET_SIZE(state);
37562 #if !CYTHON_ASSUME_SAFE_SIZE
37563 if (unlikely(state_size == -1)) return -1;
37564 #endif
37565 if (state_size <= index) {
37566 return 0;
37567 }
37568 return __Pyx__UpdateUnpickledDict(obj, state, index);
37569}
37570
37571/* CheckUnpickleChecksumError (used by CheckUnpickleChecksum) */
37572static void __Pyx_RaiseUnpickleChecksumError(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
37573 PyObject *pickle_module = PyImport_ImportModule("pickle");
37574 if (unlikely(!pickle_module)) return;
37575 PyObject *pickle_error = PyObject_GetAttrString(pickle_module, "PickleError");
37576 Py_DECREF(pickle_module);
37577 if (unlikely(!pickle_error)) return;
37578 if (checksum2 == checksum1) {
37579 PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x) = (%s))",
37580 checksum, checksum1, members);
37581 } else if (checksum3 == checksum2) {
37582 PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x) = (%s))",
37583 checksum, checksum1, checksum2, members);
37584 } else {
37585 PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x, 0x%x) = (%s))",
37586 checksum, checksum1, checksum2, checksum3, members);
37587 }
37588 Py_DECREF(pickle_error);
37589}
37590
37591/* CheckUnpickleChecksum */
37592static int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
37593 int found = 0;
37594 found |= checksum1 == checksum;
37595 found |= checksum2 == checksum;
37596 found |= checksum3 == checksum;
37597 if (likely(found))
37598 return 0;
37599 __Pyx_RaiseUnpickleChecksumError(checksum, checksum1, checksum2, checksum3, members);
37600 return -1;
37601}
37602
37603/* CIntFromPy */
37604static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x);
37605static long __Pyx_raise_neg_overflow___Pyx_PyLong_As_long(void) {
37606 const char* type_name = "long";
37607 PyErr_Format(PyExc_OverflowError,
37608 "can't convert negative value to %.200s", type_name);
37609 return (long) -1;
37610}
37611static long __Pyx_raise_overflow___Pyx_PyLong_As_long(void) {
37612 const char* type_name = "long";
37613 PyErr_Format(PyExc_OverflowError,
37614 "value too large to convert to %.200s", type_name);
37615 return (long) -1;
37616}
37617static CYTHON_INLINE long __Pyx_PyULong___Pyx_PyLong_As_long(PyObject *x) {
37618 const int is_unsigned = 1;
37619#if CYTHON_USE_PYLONG_INTERNALS
37620 {
37621 const digit* digits = __Pyx_PyLong_Digits(x);
37622 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
37623 if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
37624 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
37625 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37626 } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
37627 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
37628 }
37629 } else
37630 if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
37631 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
37632 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37633 } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
37634 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
37635 }
37636 } else
37637 if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
37638 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
37639 __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])))
37640 } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
37641 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
37642 }
37643 } else
37644 {}
37645 }
37646#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
37647 if (unlikely(Py_SIZE(x) < 0)) {
37648 goto raise_neg_overflow;
37649 }
37650#else
37651 {
37652 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
37653 if (unlikely(result < 0))
37654 return (long) -1;
37655 if (unlikely(result == 1))
37656 goto raise_neg_overflow;
37657 }
37658#endif
37659 if ((sizeof(long) <= sizeof(unsigned long))) {
37660 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
37661 } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
37662 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
37663 }
37664 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
37665raise_neg_overflow:
37666 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
37667raise_overflow:
37668 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
37669}
37670static CYTHON_INLINE long __Pyx_PySLong___Pyx_PyLong_As_long(PyObject *x) {
37671 const int is_unsigned = 0;
37672#if CYTHON_USE_PYLONG_INTERNALS
37673 if (__Pyx_PyLong_IsNeg(x)) {
37674 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
37675 const digit* digits = __Pyx_PyLong_Digits(x);
37676 if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
37677 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
37678 long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
37679 __PYX_VERIFY_RETURN_INT(long, long, ival)
37680 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
37681 return (long) (((long) -1) * (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
37682 }
37683 } else
37684 if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
37685 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
37686 long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
37687 __PYX_VERIFY_RETURN_INT(long, long, ival)
37688 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
37689 return (long) (((long) -1) * (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
37690 }
37691 } else
37692 if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
37693 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
37694 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]));
37695 __PYX_VERIFY_RETURN_INT(long, long, ival)
37696 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
37697 return (long) (((long) -1) * (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
37698 }
37699 } else
37700 {}
37701 } else {
37702 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
37703 const digit* digits = __Pyx_PyLong_Digits(x);
37704 if (size == 2 && (8 * sizeof(long) > 1 * PyLong_SHIFT)) {
37705 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
37706 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37707 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
37708 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
37709 }
37710 } else
37711 if (size == 3 && (8 * sizeof(long) > 2 * PyLong_SHIFT)) {
37712 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
37713 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
37714 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
37715 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
37716 }
37717 } else
37718 if (size == 4 && (8 * sizeof(long) > 3 * PyLong_SHIFT)) {
37719 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
37720 __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])))
37721 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
37722 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
37723 }
37724 } else
37725 {}
37726 }
37727#endif
37728 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
37729 if ((sizeof(long) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
37730 __PYX_VERIFY_RETURN_INT_EXC(long, int, PyLong_AsInt(x))
37731 } else
37732 #endif
37733 if ((sizeof(long) <= sizeof(long))) {
37734 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
37735 } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
37736 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
37737 }
37738 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
37739raise_neg_overflow:
37740 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
37741raise_overflow:
37742 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
37743}
37744static long __Pyx_LargePyLong___Pyx_PyLong_As_long(PyObject *x) {
37745#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37746#pragma GCC diagnostic push
37747#pragma GCC diagnostic ignored "-Wconversion"
37748#endif
37749 const long neg_one = (long) -1, const_zero = (long) 0;
37750#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37751#pragma GCC diagnostic pop
37752#endif
37753 const int is_unsigned = neg_one > const_zero;
37754 long val;
37755 int ret = -1;
37756#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
37757 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
37758 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
37759 if (unlikely(bytes_copied == -1)) {
37760 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
37761 goto raise_overflow;
37762 } else {
37763 ret = 0;
37764 }
37765#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
37766 int one = 1; int is_little = (int)*(unsigned char *)&one;
37767 unsigned char *bytes = (unsigned char *)&val;
37768 ret = _PyLong_AsByteArray((PyLongObject *)x,
37769 bytes, sizeof(val),
37770 is_little, !is_unsigned);
37771 if ((0)) goto raise_overflow;
37772#else
37773 PyObject *v;
37774 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
37775 int bits, remaining_bits, is_negative = 0;
37776 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
37777 if (likely(PyLong_CheckExact(x))) {
37778 v = __Pyx_NewRef(x);
37779 } else {
37780 v = PyNumber_Long(x);
37781 if (unlikely(!v)) return (long) -1;
37782 assert(PyLong_CheckExact(v));
37783 }
37784 {
37785 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
37786 if (unlikely(result < 0)) {
37787 Py_DECREF(v);
37788 return (long) -1;
37789 }
37790 is_negative = result == 1;
37791 }
37792 if (is_unsigned && unlikely(is_negative)) {
37793 Py_DECREF(v);
37794 PyErr_SetString(PyExc_OverflowError,
37795 "can't convert negative value to long");
37796 return (long) -1;
37797 } else if (is_negative) {
37798 stepval = PyNumber_Invert(v);
37799 Py_DECREF(v);
37800 if (unlikely(!stepval))
37801 return (long) -1;
37802 } else {
37803 stepval = v;
37804 }
37805 v = NULL;
37806 val = (long) 0;
37807 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
37808 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
37809 for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
37810 PyObject *tmp, *digit;
37811 long idigit;
37812 digit = PyNumber_And(stepval, mask);
37813 if (unlikely(!digit)) goto done;
37814 idigit = PyLong_AsLong(digit);
37815 Py_DECREF(digit);
37816 if (unlikely(idigit < 0)) goto done;
37817 val |= ((long) idigit) << bits;
37818 tmp = PyNumber_Rshift(stepval, shift);
37819 if (unlikely(!tmp)) goto done;
37820 Py_DECREF(stepval); stepval = tmp;
37821 }
37822 Py_DECREF(shift); shift = NULL;
37823 Py_DECREF(mask); mask = NULL;
37824 {
37825 long idigit = PyLong_AsLong(stepval);
37826 if (unlikely(idigit < 0)) goto done;
37827 remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
37828 if (unlikely(idigit >= (1L << remaining_bits)))
37829 goto raise_overflow;
37830 val |= ((long) idigit) << bits;
37831 }
37832 if (!is_unsigned) {
37833 if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
37834 goto raise_overflow;
37835 if (is_negative)
37836 val = ~val;
37837 }
37838 ret = 0;
37839done:
37840 Py_XDECREF(shift);
37841 Py_XDECREF(mask);
37842 Py_XDECREF(stepval);
37843#endif
37844 if (unlikely(ret))
37845 return (long) -1;
37846 return val;
37847raise_overflow:
37848 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
37849}
37850static CYTHON_INLINE long __Pyx_PyLong___Pyx_PyLong_As_long(PyObject *x) {
37851#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37852#pragma GCC diagnostic push
37853#pragma GCC diagnostic ignored "-Wconversion"
37854#endif
37855 const long neg_one = (long) -1, const_zero = (long) 0;
37856#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37857#pragma GCC diagnostic pop
37858#endif
37859 const int is_unsigned = neg_one > const_zero;
37860 if (is_unsigned) {
37861 #if CYTHON_USE_PYLONG_INTERNALS
37862 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
37863 goto raise_neg_overflow;
37864 } else if (__Pyx_PyLong_IsCompact(x)) {
37865 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
37866 } else
37867 #endif
37868 {
37869 return __Pyx_PyULong___Pyx_PyLong_As_long(x);
37870 }
37871 } else {
37872 #if CYTHON_USE_PYLONG_INTERNALS
37873 if (__Pyx_PyLong_IsCompact(x)) {
37874 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
37875 } else
37876 #endif
37877 {
37878 return __Pyx_PySLong___Pyx_PyLong_As_long(x);
37879 }
37880 }
37881#if CYTHON_USE_PYLONG_INTERNALS
37882raise_neg_overflow:
37883 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
37884raise_overflow:
37885 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
37886#endif
37887}
37888static long __Pyx_NonPyLong___Pyx_PyLong_As_long(PyObject *x) {
37889 long val;
37890 PyObject *tmp = __Pyx_PyNumber_Long(x);
37891 if (!tmp) return (long) -1;
37892 val = __Pyx_PyLong_As_long(tmp);
37893 Py_DECREF(tmp);
37894 return val;
37895}
37896static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) {
37897 if (likely(PyLong_Check(x))) {
37898 return __Pyx_PyLong___Pyx_PyLong_As_long(x);
37899 } else {
37900 return __Pyx_NonPyLong___Pyx_PyLong_As_long(x);
37901 }
37902}
37903
37904/* CIntToPy */
37905static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) {
37906#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37907#pragma GCC diagnostic push
37908#pragma GCC diagnostic ignored "-Wconversion"
37909#endif
37910 const long neg_one = (long) -1, const_zero = (long) 0;
37911#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37912#pragma GCC diagnostic pop
37913#endif
37914 const int is_unsigned = neg_one > const_zero;
37915 if (is_unsigned) {
37916 if (sizeof(long) < sizeof(long)) {
37917 return PyLong_FromLong((long) value);
37918 } else if (sizeof(long) <= sizeof(unsigned long)) {
37919 return PyLong_FromUnsignedLong((unsigned long) value);
37920#if !CYTHON_COMPILING_IN_PYPY
37921 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
37922 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
37923#endif
37924 }
37925 } else {
37926 if (sizeof(long) <= sizeof(long)) {
37927 return PyLong_FromLong((long) value);
37928 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
37929 return PyLong_FromLongLong((PY_LONG_LONG) value);
37930 }
37931 }
37932 {
37933 unsigned char *bytes = (unsigned char *)&value;
37934#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
37935 if (is_unsigned) {
37936 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
37937 } else {
37938 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
37939 }
37940#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
37941 int one = 1; int little = (int)*(unsigned char *)&one;
37942 return _PyLong_FromByteArray(bytes, sizeof(long),
37943 little, !is_unsigned);
37944#else
37945 int one = 1; int little = (int)*(unsigned char *)&one;
37946 PyObject *result = NULL, *kwds = NULL;
37947 PyObject *py_bytes = NULL, *order_str = NULL, *from_bytes_str = NULL;;
37948 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
37949 if (!py_bytes) goto limited_bad;
37950 from_bytes_str = PyUnicode_FromStringAndSize("from_bytes", 10);
37951 if (!from_bytes_str) goto limited_bad;
37952 order_str = PyUnicode_FromString(little ? "little" : "big");
37953 if (!order_str) goto limited_bad;
37954 {
37955 PyObject *args[] = { (PyObject*)&PyLong_Type, py_bytes, order_str, Py_True };
37956 if (!is_unsigned) {
37957 PyObject *signed_str = PyUnicode_FromStringAndSize("signed", 6);
37958 if (!signed_str) goto limited_bad;
37959#if CYTHON_VECTORCALL
37960 kwds = PyTuple_Pack(1, signed_str);
37961#else
37962 {
37963 PyObject *keys[] = {signed_str};
37964 PyObject *values[] = {Py_True};
37965 kwds = __Pyx_MakeKwargDict(keys, values, 1);
37966 }
37967#endif
37968 Py_DECREF(signed_str);
37969 if (unlikely(!kwds)) goto limited_bad;
37970 }
37971 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
37972 }
37973 limited_bad:
37974 Py_XDECREF(kwds);
37975 Py_XDECREF(order_str);
37976 Py_XDECREF(py_bytes);
37977 Py_XDECREF(from_bytes_str);
37978 return result;
37979#endif
37980 }
37981}
37982
37983/* CIntFromPy */
37984static char __Pyx_LargePyLong___Pyx_PyLong_As_char(PyObject *x);
37985static char __Pyx_raise_neg_overflow___Pyx_PyLong_As_char(void) {
37986 const char* type_name = "char";
37987 PyErr_Format(PyExc_OverflowError,
37988 "can't convert negative value to %.200s", type_name);
37989 return (char) -1;
37990}
37991static char __Pyx_raise_overflow___Pyx_PyLong_As_char(void) {
37992 const char* type_name = "char";
37993 PyErr_Format(PyExc_OverflowError,
37994 "value too large to convert to %.200s", type_name);
37995 return (char) -1;
37996}
37997static CYTHON_INLINE char __Pyx_PyULong___Pyx_PyLong_As_char(PyObject *x) {
37998 const int is_unsigned = 1;
37999#if CYTHON_USE_PYLONG_INTERNALS
38000 {
38001 const digit* digits = __Pyx_PyLong_Digits(x);
38002 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
38003 if (size == 2 && (8 * sizeof(char) > 1 * PyLong_SHIFT)) {
38004 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
38005 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38006 } else if ((8 * sizeof(char) >= 2 * PyLong_SHIFT)) {
38007 return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
38008 }
38009 } else
38010 if (size == 3 && (8 * sizeof(char) > 2 * PyLong_SHIFT)) {
38011 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
38012 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38013 } else if ((8 * sizeof(char) >= 3 * PyLong_SHIFT)) {
38014 return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
38015 }
38016 } else
38017 if (size == 4 && (8 * sizeof(char) > 3 * PyLong_SHIFT)) {
38018 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
38019 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38020 } else if ((8 * sizeof(char) >= 4 * PyLong_SHIFT)) {
38021 return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
38022 }
38023 } else
38024 {}
38025 }
38026#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
38027 if (unlikely(Py_SIZE(x) < 0)) {
38028 goto raise_neg_overflow;
38029 }
38030#else
38031 {
38032 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
38033 if (unlikely(result < 0))
38034 return (char) -1;
38035 if (unlikely(result == 1))
38036 goto raise_neg_overflow;
38037 }
38038#endif
38039 if ((sizeof(char) <= sizeof(unsigned long))) {
38040 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
38041 } else if ((sizeof(char) <= sizeof(unsigned PY_LONG_LONG))) {
38042 __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
38043 }
38044 return __Pyx_LargePyLong___Pyx_PyLong_As_char(x);
38045raise_neg_overflow:
38046 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
38047raise_overflow:
38048 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
38049}
38050static CYTHON_INLINE char __Pyx_PySLong___Pyx_PyLong_As_char(PyObject *x) {
38051 const int is_unsigned = 0;
38052#if CYTHON_USE_PYLONG_INTERNALS
38053 if (__Pyx_PyLong_IsNeg(x)) {
38054 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
38055 const digit* digits = __Pyx_PyLong_Digits(x);
38056 if (size == 2 && (8 * sizeof(char) > 1 * PyLong_SHIFT)) {
38057 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
38058 long ival = - (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
38059 __PYX_VERIFY_RETURN_INT(char, long, ival)
38060 } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
38061 return (char) (((char) -1) * (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
38062 }
38063 } else
38064 if (size == 3 && (8 * sizeof(char) > 2 * PyLong_SHIFT)) {
38065 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
38066 long ival = - (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
38067 __PYX_VERIFY_RETURN_INT(char, long, ival)
38068 } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
38069 return (char) (((char) -1) * (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
38070 }
38071 } else
38072 if (size == 4 && (8 * sizeof(char) > 3 * PyLong_SHIFT)) {
38073 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
38074 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]));
38075 __PYX_VERIFY_RETURN_INT(char, long, ival)
38076 } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) {
38077 return (char) (((char) -1) * (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
38078 }
38079 } else
38080 {}
38081 } else {
38082 const Py_ssize_t size = __Pyx_PyLong_DigitCount(x);
38083 const digit* digits = __Pyx_PyLong_Digits(x);
38084 if (size == 2 && (8 * sizeof(char) > 1 * PyLong_SHIFT)) {
38085 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
38086 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38087 } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
38088 return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
38089 }
38090 } else
38091 if (size == 3 && (8 * sizeof(char) > 2 * PyLong_SHIFT)) {
38092 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
38093 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38094 } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
38095 return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
38096 }
38097 } else
38098 if (size == 4 && (8 * sizeof(char) > 3 * PyLong_SHIFT)) {
38099 if ((8 * sizeof(long) > 4 * PyLong_SHIFT)) {
38100 __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
38101 } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) {
38102 return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
38103 }
38104 } else
38105 {}
38106 }
38107#endif
38108 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
38109 if ((sizeof(char) <= sizeof(int)) && (sizeof(int) < sizeof(long))) {
38110 __PYX_VERIFY_RETURN_INT_EXC(char, int, PyLong_AsInt(x))
38111 } else
38112 #endif
38113 if ((sizeof(char) <= sizeof(long))) {
38114 __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
38115 } else if ((sizeof(char) <= sizeof(PY_LONG_LONG))) {
38116 __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
38117 }
38118 return __Pyx_LargePyLong___Pyx_PyLong_As_char(x);
38119raise_neg_overflow:
38120 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
38121raise_overflow:
38122 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
38123}
38124static char __Pyx_LargePyLong___Pyx_PyLong_As_char(PyObject *x) {
38125#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38126#pragma GCC diagnostic push
38127#pragma GCC diagnostic ignored "-Wconversion"
38128#endif
38129 const char neg_one = (char) -1, const_zero = (char) 0;
38130#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38131#pragma GCC diagnostic pop
38132#endif
38133 const int is_unsigned = neg_one > const_zero;
38134 char val;
38135 int ret = -1;
38136#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
38137 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
38138 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
38139 if (unlikely(bytes_copied == -1)) {
38140 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
38141 goto raise_overflow;
38142 } else {
38143 ret = 0;
38144 }
38145#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
38146 int one = 1; int is_little = (int)*(unsigned char *)&one;
38147 unsigned char *bytes = (unsigned char *)&val;
38148 ret = _PyLong_AsByteArray((PyLongObject *)x,
38149 bytes, sizeof(val),
38150 is_little, !is_unsigned);
38151 if ((0)) goto raise_overflow;
38152#else
38153 PyObject *v;
38154 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
38155 int bits, remaining_bits, is_negative = 0;
38156 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
38157 if (likely(PyLong_CheckExact(x))) {
38158 v = __Pyx_NewRef(x);
38159 } else {
38160 v = PyNumber_Long(x);
38161 if (unlikely(!v)) return (char) -1;
38162 assert(PyLong_CheckExact(v));
38163 }
38164 {
38165 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
38166 if (unlikely(result < 0)) {
38167 Py_DECREF(v);
38168 return (char) -1;
38169 }
38170 is_negative = result == 1;
38171 }
38172 if (is_unsigned && unlikely(is_negative)) {
38173 Py_DECREF(v);
38174 PyErr_SetString(PyExc_OverflowError,
38175 "can't convert negative value to char");
38176 return (char) -1;
38177 } else if (is_negative) {
38178 stepval = PyNumber_Invert(v);
38179 Py_DECREF(v);
38180 if (unlikely(!stepval))
38181 return (char) -1;
38182 } else {
38183 stepval = v;
38184 }
38185 v = NULL;
38186 val = (char) 0;
38187 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
38188 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
38189 for (bits = 0; bits < (int) sizeof(char) * 8 - chunk_size; bits += chunk_size) {
38190 PyObject *tmp, *digit;
38191 long idigit;
38192 digit = PyNumber_And(stepval, mask);
38193 if (unlikely(!digit)) goto done;
38194 idigit = PyLong_AsLong(digit);
38195 Py_DECREF(digit);
38196 if (unlikely(idigit < 0)) goto done;
38197 val |= ((char) idigit) << bits;
38198 tmp = PyNumber_Rshift(stepval, shift);
38199 if (unlikely(!tmp)) goto done;
38200 Py_DECREF(stepval); stepval = tmp;
38201 }
38202 Py_DECREF(shift); shift = NULL;
38203 Py_DECREF(mask); mask = NULL;
38204 {
38205 long idigit = PyLong_AsLong(stepval);
38206 if (unlikely(idigit < 0)) goto done;
38207 remaining_bits = ((int) sizeof(char) * 8) - bits - (is_unsigned ? 0 : 1);
38208 if (unlikely(idigit >= (1L << remaining_bits)))
38209 goto raise_overflow;
38210 val |= ((char) idigit) << bits;
38211 }
38212 if (!is_unsigned) {
38213 if (unlikely(val & (((char) 1) << (sizeof(char) * 8 - 1))))
38214 goto raise_overflow;
38215 if (is_negative)
38216 val = ~val;
38217 }
38218 ret = 0;
38219done:
38220 Py_XDECREF(shift);
38221 Py_XDECREF(mask);
38222 Py_XDECREF(stepval);
38223#endif
38224 if (unlikely(ret))
38225 return (char) -1;
38226 return val;
38227raise_overflow:
38228 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
38229}
38230static CYTHON_INLINE char __Pyx_PyLong___Pyx_PyLong_As_char(PyObject *x) {
38231#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38232#pragma GCC diagnostic push
38233#pragma GCC diagnostic ignored "-Wconversion"
38234#endif
38235 const char neg_one = (char) -1, const_zero = (char) 0;
38236#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38237#pragma GCC diagnostic pop
38238#endif
38239 const int is_unsigned = neg_one > const_zero;
38240 if (is_unsigned) {
38241 #if CYTHON_USE_PYLONG_INTERNALS
38242 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
38243 goto raise_neg_overflow;
38244 } else if (__Pyx_PyLong_IsCompact(x)) {
38245 __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
38246 } else
38247 #endif
38248 {
38249 return __Pyx_PyULong___Pyx_PyLong_As_char(x);
38250 }
38251 } else {
38252 #if CYTHON_USE_PYLONG_INTERNALS
38253 if (__Pyx_PyLong_IsCompact(x)) {
38254 __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
38255 } else
38256 #endif
38257 {
38258 return __Pyx_PySLong___Pyx_PyLong_As_char(x);
38259 }
38260 }
38261#if CYTHON_USE_PYLONG_INTERNALS
38262raise_neg_overflow:
38263 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
38264raise_overflow:
38265 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
38266#endif
38267}
38268static char __Pyx_NonPyLong___Pyx_PyLong_As_char(PyObject *x) {
38269 char val;
38270 PyObject *tmp = __Pyx_PyNumber_Long(x);
38271 if (!tmp) return (char) -1;
38272 val = __Pyx_PyLong_As_char(tmp);
38273 Py_DECREF(tmp);
38274 return val;
38275}
38276static CYTHON_INLINE char __Pyx_PyLong_As_char(PyObject *x) {
38277 if (likely(PyLong_Check(x))) {
38278 return __Pyx_PyLong___Pyx_PyLong_As_char(x);
38279 } else {
38280 return __Pyx_NonPyLong___Pyx_PyLong_As_char(x);
38281 }
38282}
38283
38284/* GetRuntimeVersion */
38285#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
38286void __Pyx_init_runtime_version(void) {
38287 if (__Pyx_cached_runtime_version == 0) {
38288 const char* rt_version = Py_GetVersion();
38289 unsigned long version = 0;
38290 unsigned long factor = 0x01000000UL;
38291 unsigned int digit = 0;
38292 int i = 0;
38293 while (factor) {
38294 while ('0' <= rt_version[i] && rt_version[i] <= '9') {
38295 digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
38296 ++i;
38297 }
38298 version += factor * digit;
38299 if (rt_version[i] != '.')
38300 break;
38301 digit = 0;
38302 factor >>= 8;
38303 ++i;
38304 }
38305 __Pyx_cached_runtime_version = version;
38306 }
38307}
38308#endif
38309static unsigned long __Pyx_get_runtime_version(void) {
38310#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
38311 return Py_Version & ~0xFFUL;
38312#else
38313 return __Pyx_cached_runtime_version;
38314#endif
38315}
38316
38317/* CheckBinaryVersion */
38318static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
38319 const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
38320 if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
38321 return 0;
38322 if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
38323 return 1;
38324 {
38325 char message[200];
38326 PyOS_snprintf(message, sizeof(message),
38327 "compile time Python version %d.%d "
38328 "of module '%.100s' "
38329 "%s "
38330 "runtime version %d.%d",
38331 (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
38332 __Pyx_MODULE_NAME,
38333 (allow_newer) ? "was newer than" : "does not match",
38334 (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
38335 );
38336 return PyErr_WarnEx(NULL, message, 1);
38337 }
38338}
38339
38340/* NewCodeObj */
38341#if CYTHON_COMPILING_IN_LIMITED_API
38342 static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
38343 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
38344 PyObject *fv, PyObject *cell, PyObject* fn,
38345 PyObject *name, int fline, PyObject *lnos) {
38346 PyObject *exception_table = NULL;
38347 PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
38348 #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
38349 PyObject *version_info;
38350 PyObject *py_minor_version = NULL;
38351 #endif
38352 long minor_version = 0;
38353 #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
38354 minor_version = 11;
38355 #else
38356 if (!(version_info = PySys_GetObject("version_info"))) goto end;
38357 if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
38358 minor_version = PyLong_AsLong(py_minor_version);
38359 Py_DECREF(py_minor_version);
38360 if (minor_version == -1 && PyErr_Occurred()) goto end;
38361 #endif
38362 if (!(types_module = PyImport_ImportModule("types"))) goto end;
38363 if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
38364 if (minor_version <= 10) {
38365 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOOO", a,p, k, l, s, f, code,
38366 c, n, v, fn, name, fline, lnos, fv, cell);
38367 } else {
38368 if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
38369 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOOOO", a,p, k, l, s, f, code,
38370 c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
38371 }
38372 end:
38373 Py_XDECREF(code_type);
38374 Py_XDECREF(exception_table);
38375 Py_XDECREF(types_module);
38376 if (!result) {
38377 PyObject *exc_type, *exc_value, *exc_tb;
38378 PyErr_Fetch(&exc_type, &exc_value, &exc_tb);
38379 if (PyErr_WarnFormat(
38380 PyExc_RuntimeWarning, 1,
38381 "Code object creation failed in Cython module: %S\nTry recompiling with a more recent version of Cython.",
38382 exc_value ? exc_value : exc_type) == 0) {
38383 result = Py_None;
38384 Py_INCREF(result);
38385 }
38386 Py_DECREF(exc_type);
38387 Py_XDECREF(exc_value);
38388 Py_XDECREF(exc_tb);
38389 }
38390 return result;
38391 }
38392#elif PY_VERSION_HEX >= 0x030B0000
38393 static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
38394 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
38395 PyObject *fv, PyObject *cell, PyObject* fn,
38396 PyObject *name, int fline, PyObject *lnos) {
38397 PyCodeObject *result;
38398 result =
38399 #if PY_VERSION_HEX >= 0x030C0000
38400 PyUnstable_Code_NewWithPosOnlyArgs
38401 #else
38402 PyCode_NewWithPosOnlyArgs
38403 #endif
38404 (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
38405 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
38406 if (likely(result))
38407 result->_co_firsttraceable = 0;
38408 #endif
38409 return result;
38410 }
38411#elif !CYTHON_COMPILING_IN_PYPY
38412 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
38413 PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
38414#else
38415 #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
38416 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
38417#endif
38418static PyObject* __Pyx_PyCode_New(
38419 const __Pyx_PyCode_New_function_description descr,
38420 PyObject * const *varnames,
38421 PyObject *filename,
38422 PyObject *funcname,
38423 PyObject *line_table,
38424 PyObject *tuple_dedup_map
38425) {
38426 PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL;
38427 Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
38428 PyObject *varnames_tuple = PyTuple_New(var_count);
38429 if (unlikely(!varnames_tuple)) return NULL;
38430 for (Py_ssize_t i=0; i < var_count; i++) {
38431 Py_INCREF(varnames[i]);
38432 if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done;
38433 }
38434 #if CYTHON_COMPILING_IN_LIMITED_API
38435 varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
38436 if (!varnames_tuple_dedup) {
38437 if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done;
38438 varnames_tuple_dedup = varnames_tuple;
38439 }
38440 #else
38441 varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
38442 if (unlikely(!varnames_tuple_dedup)) goto done;
38443 #endif
38444 #if CYTHON_AVOID_BORROWED_REFS
38445 Py_INCREF(varnames_tuple_dedup);
38446 #endif
38447 if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) {
38448 Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table);
38449 #if !CYTHON_ASSUME_SAFE_SIZE
38450 if (unlikely(line_table_length == -1)) goto done;
38451 #endif
38452 Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL;
38453 code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
38454 if (unlikely(!code_bytes)) goto done;
38455 char* c_code_bytes = PyBytes_AsString(code_bytes);
38456 if (unlikely(!c_code_bytes)) goto done;
38457 memset(c_code_bytes, 0, (size_t) code_len);
38458 }
38459 code_obj = (PyObject*) __Pyx__PyCode_New(
38460 (int) descr.argcount,
38461 (int) descr.num_posonly_args,
38462 (int) descr.num_kwonly_args,
38463 (int) descr.nlocals,
38464 0,
38465 (int) descr.flags,
38466 code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
38467 __pyx_mstate_global->__pyx_empty_tuple,
38468 __pyx_mstate_global->__pyx_empty_tuple,
38469 varnames_tuple_dedup,
38470 __pyx_mstate_global->__pyx_empty_tuple,
38471 __pyx_mstate_global->__pyx_empty_tuple,
38472 filename,
38473 funcname,
38474 (int) descr.first_line,
38475 (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
38476 );
38477done:
38478 Py_XDECREF(code_bytes);
38479 #if CYTHON_AVOID_BORROWED_REFS
38480 Py_XDECREF(varnames_tuple_dedup);
38481 #endif
38482 Py_DECREF(varnames_tuple);
38483 return code_obj;
38484}
38485
38486/* DecompressString */
38487CYTHON_UNUSED
38488static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) {
38489#ifdef __Pyx_DecompressString_UNUSED
38490 CYTHON_UNUSED_VAR(s);
38491 CYTHON_UNUSED_VAR(length);
38492 CYTHON_UNUSED_VAR(algo);
38493 return NULL;
38494#else
38495 PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
38496 const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib";
38497 PyObject *methodname = PyUnicode_FromString("decompress");
38498 if (unlikely(!methodname)) return NULL;
38499 #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
38500 if (algo == 3) {
38501 PyObject *fromlist = Py_BuildValue("[O]", methodname);
38502 if (unlikely(!fromlist)) goto bad;
38503 module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
38504 Py_DECREF(fromlist);
38505 } else
38506 #endif
38507 module = PyImport_ImportModule(module_name);
38508 if (unlikely(!module)) goto import_failed;
38509 decompress = PyObject_GetAttr(module, methodname);
38510 if (unlikely(!decompress)) goto import_failed;
38511 {
38512 #ifdef __cplusplus
38513 char *memview_bytes = const_cast<char*>(s);
38514 #else
38515 #if defined(__clang__)
38516 #pragma clang diagnostic push
38517 #pragma clang diagnostic ignored "-Wcast-qual"
38518 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
38519 #pragma GCC diagnostic push
38520 #pragma GCC diagnostic ignored "-Wcast-qual"
38521 #endif
38522 char *memview_bytes = (char*) s;
38523 #if defined(__clang__)
38524 #pragma clang diagnostic pop
38525 #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
38526 #pragma GCC diagnostic pop
38527 #endif
38528 #endif
38529 #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
38530 int memview_flags = 0x100;
38531 #else
38532 int memview_flags = PyBUF_READ;
38533 #endif
38534 compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
38535 }
38536 if (unlikely(!compressed_bytes)) {
38537 Py_DECREF(decompress);
38538 goto bad;
38539 }
38540 decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
38541 Py_DECREF(compressed_bytes);
38542 Py_DECREF(decompress);
38543 Py_DECREF(module);
38544 Py_DECREF(methodname);
38545 return decompressed;
38546import_failed:
38547 PyErr_Format(PyExc_ImportError,
38548 "Failed to import '%.20s.decompress' - cannot initialise module strings. "
38549 "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
38550 module_name, algo);
38551bad:
38552 Py_XDECREF(module);
38553 Py_DECREF(methodname);
38554 return NULL;
38555#endif
38556}
38557
38558/* DecompressString_LZSS */
38559#ifndef __Pyx_DecompressString_LZSS_UNUSED
38560CYTHON_UNUSED
38561static CYTHON_SMALL_CODE size_t __pyx_lzss_decompress(const uint8_t* src, uint8_t* dst, size_t dst_len) {
38562 size_t pos = 0, out_pos = 0;
38563 while (1) {
38564 uint32_t flags = src[pos++] | 0xFF00;
38565 while (flags & 0x100) {
38566 if (flags & 1) {
38567 dst[out_pos++] = src[pos++];
38568 } else {
38569 uint32_t lo = src[pos++], hi = src[pos++];
38570 uint32_t end_offset_of_last_occurrence, match_length;
38571 if (!(lo & 0x80)) {
38572 end_offset_of_last_occurrence = lo;
38573 match_length = hi;
38574 } else if (!(hi & 0x80)) {
38575 end_offset_of_last_occurrence = 0x80 + (((hi << 2) & 0x180) | (lo & 0x7F));
38576 match_length = hi & 0x1F;
38577 } else {
38578 end_offset_of_last_occurrence = 0x80 + ((hi & 0x7F) << 7 | (lo & 0x7F));
38579 match_length = src[pos++];
38580 }
38581 match_length += 3;
38582 size_t ref_pos = out_pos - end_offset_of_last_occurrence - match_length;
38583 memcpy(dst + out_pos, dst + ref_pos, match_length);
38584 out_pos += match_length;
38585 }
38586 if (out_pos >= dst_len) return pos;
38587 flags >>= 1;
38588 }
38589 }
38590}
38591#endif
38592static CYTHON_SMALL_CODE PyObject *__Pyx_DecompressString_LZSS(const char *s, size_t compressed_length, size_t uncompressed_length) {
38593#ifdef __Pyx_DecompressString_LZSS_UNUSED
38594 CYTHON_UNUSED_VAR(s);
38595 CYTHON_UNUSED_VAR(compressed_length);
38596 CYTHON_UNUSED_VAR(uncompressed_length);
38597 return NULL;
38598#else
38599 PyObject *result;
38600 unsigned char *result_data;
38601 size_t src_length;
38602 result = PyBytes_FromStringAndSize(NULL, (Py_ssize_t) uncompressed_length);
38603 if (unlikely(!result)) return NULL;
38604 result_data = __Pyx_PyBytes_AsWritableUString(result);
38605 if (unlikely(!result_data)) goto bad;
38606 src_length = __pyx_lzss_decompress((const uint8_t*) s, result_data, uncompressed_length);
38607 if (unlikely(src_length != compressed_length)) goto decompression_failed;
38608 return result;
38609decompression_failed:
38610 PyErr_SetString(PyExc_RuntimeError, "LZSS string data decompression failed");
38611bad:
38612 Py_DECREF(result);
38613 return NULL;
38614#endif
38615}
38616
38617#include <string.h>
38618static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
38619 size_t len = strlen(s);
38620 if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
38621 PyErr_SetString(PyExc_OverflowError, "byte string is too long");
38622 return -1;
38623 }
38624 return (Py_ssize_t) len;
38625}
38626static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
38627 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
38628 if (unlikely(len < 0)) return NULL;
38629 return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
38630}
38631static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
38632 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
38633 if (unlikely(len < 0)) return NULL;
38634 return PyByteArray_FromStringAndSize(c_str, len);
38635}
38636static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
38637 Py_ssize_t ignore;
38638 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
38639}
38640#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
38641static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
38642 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
38643#if CYTHON_COMPILING_IN_LIMITED_API
38644 {
38645 const char* result;
38646 Py_ssize_t unicode_length;
38647 CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
38648 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
38649 if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL;
38650 #else
38651 result = PyUnicode_AsUTF8AndSize(o, length);
38652 #endif
38653 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
38654 unicode_length = PyUnicode_GetLength(o);
38655 if (unlikely(unicode_length < 0)) return NULL;
38656 if (unlikely(unicode_length != *length)) {
38657 PyUnicode_AsASCIIString(o);
38658 return NULL;
38659 }
38660 #endif
38661 return result;
38662 }
38663#else
38664#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
38665 if (likely(PyUnicode_IS_ASCII(o))) {
38666 *length = PyUnicode_GET_LENGTH(o);
38667 return PyUnicode_AsUTF8(o);
38668 } else {
38669 PyUnicode_AsASCIIString(o);
38670 return NULL;
38671 }
38672#else
38673 return PyUnicode_AsUTF8AndSize(o, length);
38674#endif
38675#endif
38676}
38677#endif
38678static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
38679#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
38680 if (PyUnicode_Check(o)) {
38681 return __Pyx_PyUnicode_AsStringAndSize(o, length);
38682 } else
38683#endif
38684 if (PyByteArray_Check(o)) {
38685#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
38686 *length = PyByteArray_GET_SIZE(o);
38687 return PyByteArray_AS_STRING(o);
38688#else
38689 *length = PyByteArray_Size(o);
38690 if (*length == -1) return NULL;
38691 return PyByteArray_AsString(o);
38692#endif
38693 } else
38694 {
38695 char* result;
38696 int r = PyBytes_AsStringAndSize(o, &result, length);
38697 if (unlikely(r < 0)) {
38698 return NULL;
38699 } else {
38700 return result;
38701 }
38702 }
38703}
38704static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
38705 int is_true = x == Py_True;
38706 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
38707 else return PyObject_IsTrue(x);
38708}
38709static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
38710 int retval;
38711 if (unlikely(!x)) return -1;
38712 retval = __Pyx_PyObject_IsTrue(x);
38713 Py_DECREF(x);
38714 return retval;
38715}
38716static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) {
38717 __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
38718 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
38719 if (unlikely(!result_type_name)) goto bad;
38720 #endif
38721 if (PyLong_Check(result)) {
38722 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
38723 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). "
38724 "The ability to return an instance of a strict subclass of int is deprecated, "
38725 "and may be removed in a future version of Python.",
38726 result_type_name)) {
38727 __Pyx_DECREF_TypeName(result_type_name);
38728 goto bad;
38729 }
38730 __Pyx_DECREF_TypeName(result_type_name);
38731 return result;
38732 }
38733 PyErr_Format(PyExc_TypeError,
38734 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")",
38735 result_type_name);
38736 __Pyx_DECREF_TypeName(result_type_name);
38737bad:
38738 Py_DECREF(result);
38739 return NULL;
38740}
38741static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
38742#if CYTHON_USE_TYPE_SLOTS
38743 PyNumberMethods *m;
38744#endif
38745 PyObject *res = NULL;
38746 if (likely(PyLong_Check(x)))
38747 return __Pyx_NewRef(x);
38748#if CYTHON_USE_TYPE_SLOTS
38749 m = Py_TYPE(x)->tp_as_number;
38750 if (likely(m && m->nb_int)) {
38751 res = m->nb_int(x);
38752 }
38753#else
38754 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
38755 res = PyNumber_Long(x);
38756 }
38757#endif
38758 if (likely(res)) {
38759 if (unlikely(!PyLong_CheckExact(res))) {
38760 return __Pyx_PyNumber_LongWrongResultType(res);
38761 }
38762 }
38763 else if (!PyErr_Occurred()) {
38764 PyErr_SetString(PyExc_TypeError,
38765 "an integer is required");
38766 }
38767 return res;
38768}
38769static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_AsSsize_t(PyObject* b) {
38770 #if CYTHON_USE_PYLONG_INTERNALS
38771 Py_ssize_t ival;
38772 const Py_ssize_t size = __Pyx_PyLong_DigitCount(b);
38773 const int is_neg = __Pyx_PyLong_IsNeg(b);
38774 const digit* digits = __Pyx_PyLong_Digits(b);
38775 if (size == 0) return 0;
38776 #if SIZEOF_SIZE_T * 8 > 1 * PyLong_SHIFT
38777 if (size == 1) {
38778 ival = (Py_ssize_t) (((size_t)digits[0]));
38779 } else
38780 #endif
38781 #if SIZEOF_SIZE_T * 8 > 2 * PyLong_SHIFT
38782 if (size == 2) {
38783 ival = (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
38784 } else
38785 #endif
38786 #if SIZEOF_SIZE_T * 8 > 3 * PyLong_SHIFT
38787 if (size == 3) {
38788 ival = (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
38789 } else
38790 #endif
38791 #if SIZEOF_SIZE_T * 8 > 4 * PyLong_SHIFT
38792 if (size == 4) {
38793 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]));
38794 } else
38795 #endif
38796 return PyLong_AsSsize_t(b);
38797 return is_neg ? -ival : ival;
38798 #else
38799 return PyLong_AsSsize_t(b);
38800 #endif
38801}
38802static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
38803 if (likely(PyLong_Check(b))) {
38804 return __Pyx_PyLong_AsSsize_t(b);
38805 } else {
38806 Py_ssize_t ival;
38807 PyObject *x = PyNumber_Index(b);
38808 if (unlikely(!x)) return -1;
38809 ival = __Pyx_PyLong_AsSsize_t(x);
38810 Py_DECREF(x);
38811 return ival;
38812 }
38813}
38814static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
38815 if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
38816 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
38817 } else {
38818 Py_ssize_t ival;
38819 PyObject *x;
38820 x = PyNumber_Index(o);
38821 if (!x) return -1;
38822 ival = PyLong_AsLong(x);
38823 Py_DECREF(x);
38824 return ival;
38825 }
38826}
38827static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) {
38828 CYTHON_UNUSED_VAR(b);
38829 return __Pyx_NewRef(Py_None);
38830}
38831static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
38832 return __Pyx_NewRef(b ? Py_True: Py_False);
38833}
38834static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) {
38835 return PyLong_FromSize_t(ival);
38836}
38837
38838
38839/* MultiPhaseInitModuleState */
38840#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
38841#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
38842#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
38843 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
38844#else
38845 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
38846#endif
38847#endif
38848#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
38849#error "Module state with PEP489 requires atomics. Currently that's one of\
38850 C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
38851#endif
38852#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
38853#define __Pyx_ModuleStateLookup_Lock()
38854#define __Pyx_ModuleStateLookup_Unlock()
38855#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
38856static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
38857#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
38858#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
38859#elif defined(__cplusplus) && __cplusplus >= 201103L
38860#include <mutex>
38861static std::mutex __Pyx_ModuleStateLookup_mutex;
38862#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
38863#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
38864#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
38865#include <threads.h>
38866static mtx_t __Pyx_ModuleStateLookup_mutex;
38867static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
38868static void __Pyx_ModuleStateLookup_initialize_mutex(void) {
38869 mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
38870}
38871#define __Pyx_ModuleStateLookup_Lock()\
38872 call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
38873 mtx_lock(&__Pyx_ModuleStateLookup_mutex)
38874#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
38875#elif defined(HAVE_PTHREAD_H)
38876#include <pthread.h>
38877static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
38878#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
38879#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
38880#elif defined(_WIN32)
38881#include <Windows.h> // synchapi.h on its own doesn't work
38882static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
38883#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
38884#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
38885#else
38886#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
38887 Requires C standard >= C11, or C++ standard >= C++11,\
38888 or pthreads, or the Windows 32 API, or Python >= 3.13."
38889#endif
38890typedef struct {
38891 int64_t id;
38892 PyObject *module;
38893} __Pyx_InterpreterIdAndModule;
38894typedef struct {
38895 char interpreter_id_as_index;
38896 Py_ssize_t count;
38897 Py_ssize_t allocated;
38898 __Pyx_InterpreterIdAndModule table[1];
38899} __Pyx_ModuleStateLookupData;
38900#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
38901#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
38902static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
38903#endif
38904#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
38905static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
38906#else
38907static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
38908#endif
38909static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
38910 __Pyx_InterpreterIdAndModule* table,
38911 Py_ssize_t count,
38912 int64_t interpreterId) {
38913 __Pyx_InterpreterIdAndModule* begin = table;
38914 __Pyx_InterpreterIdAndModule* end = begin + count;
38915 if (begin->id == interpreterId) {
38916 return begin;
38917 }
38918 while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
38919 __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
38920 if (halfway->id == interpreterId) {
38921 return halfway;
38922 }
38923 if (halfway->id < interpreterId) {
38924 begin = halfway;
38925 } else {
38926 end = halfway;
38927 }
38928 }
38929 for (; begin < end; ++begin) {
38930 if (begin->id >= interpreterId) return begin;
38931 }
38932 return begin;
38933}
38934static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) {
38935 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
38936 if (interpreter_id == -1) return NULL;
38937#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
38938 __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
38939 {
38940 __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
38941 if (likely(data)) {
38942 __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
38943 if (likely(data == new_data)) {
38944 goto read_finished;
38945 }
38946 }
38947 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
38948 __Pyx_ModuleStateLookup_Lock();
38949 __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
38950 data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
38951 __Pyx_ModuleStateLookup_Unlock();
38952 }
38953 read_finished:;
38954#else
38955 __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
38956#endif
38957 __Pyx_InterpreterIdAndModule* found = NULL;
38958 if (unlikely(!data)) goto end;
38959 if (data->interpreter_id_as_index) {
38960 if (interpreter_id < data->count) {
38961 found = data->table+interpreter_id;
38962 }
38963 } else {
38964 found = __Pyx_State_FindModuleStateLookupTableLowerBound(
38965 data->table, data->count, interpreter_id);
38966 }
38967 end:
38968 {
38969 PyObject *result=NULL;
38970 if (found && found->id == interpreter_id) {
38971 result = found->module;
38972 }
38973#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
38974 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
38975#endif
38976 return result;
38977 }
38978}
38979#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
38980static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) {
38981 while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
38982}
38983#else
38984#define __Pyx_ModuleStateLookup_wait_until_no_readers()
38985#endif
38986static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
38987 Py_ssize_t to_allocate = (*old_data)->allocated;
38988 while (to_allocate <= interpreter_id) {
38989 if (to_allocate == 0) to_allocate = 1;
38990 else to_allocate *= 2;
38991 }
38992 __Pyx_ModuleStateLookupData *new_data = *old_data;
38993 if (to_allocate != (*old_data)->allocated) {
38994 new_data = (__Pyx_ModuleStateLookupData *)realloc(
38995 *old_data,
38996 sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
38997 if (!new_data) {
38998 PyErr_NoMemory();
38999 return -1;
39000 }
39001 for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
39002 new_data->table[i].id = i;
39003 new_data->table[i].module = NULL;
39004 }
39005 new_data->allocated = to_allocate;
39006 }
39007 new_data->table[interpreter_id].module = module;
39008 if (new_data->count < interpreter_id+1) {
39009 new_data->count = interpreter_id+1;
39010 }
39011 *old_data = new_data;
39012 return 0;
39013}
39014static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
39015 __Pyx_InterpreterIdAndModule *read = data->table;
39016 __Pyx_InterpreterIdAndModule *write = data->table;
39017 __Pyx_InterpreterIdAndModule *end = read + data->count;
39018 for (; read<end; ++read) {
39019 if (read->module) {
39020 write->id = read->id;
39021 write->module = read->module;
39022 ++write;
39023 }
39024 }
39025 data->count = write - data->table;
39026 for (; write<end; ++write) {
39027 write->id = 0;
39028 write->module = NULL;
39029 }
39030 data->interpreter_id_as_index = 0;
39031}
39032static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) {
39033 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
39034 if (interpreter_id == -1) return -1;
39035 int result = 0;
39036 __Pyx_ModuleStateLookup_Lock();
39037#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39038 __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
39039 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
39040#else
39041 __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
39042#endif
39043 __Pyx_ModuleStateLookupData *new_data = old_data;
39044 if (!new_data) {
39045 new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData));
39046 if (!new_data) {
39047 result = -1;
39048 PyErr_NoMemory();
39049 goto end;
39050 }
39051 new_data->allocated = 1;
39052 new_data->interpreter_id_as_index = 1;
39053 }
39054 __Pyx_ModuleStateLookup_wait_until_no_readers();
39055 if (new_data->interpreter_id_as_index) {
39056 if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
39057 result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
39058 goto end;
39059 }
39060 __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
39061 }
39062 {
39063 Py_ssize_t insert_at = 0;
39064 {
39065 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
39066 new_data->table, new_data->count, interpreter_id);
39067 assert(lower_bound);
39068 insert_at = lower_bound - new_data->table;
39069 if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
39070 lower_bound->module = module;
39071 goto end; // already in table, nothing more to do
39072 }
39073 }
39074 if (new_data->count+1 >= new_data->allocated) {
39075 Py_ssize_t to_allocate = (new_data->count+1)*2;
39076 new_data =
39077 (__Pyx_ModuleStateLookupData*)realloc(
39078 new_data,
39079 sizeof(__Pyx_ModuleStateLookupData) +
39080 (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
39081 if (!new_data) {
39082 result = -1;
39083 new_data = old_data;
39084 PyErr_NoMemory();
39085 goto end;
39086 }
39087 new_data->allocated = to_allocate;
39088 }
39089 ++new_data->count;
39090 int64_t last_id = interpreter_id;
39091 PyObject *last_module = module;
39092 for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
39093 int64_t current_id = new_data->table[i].id;
39094 new_data->table[i].id = last_id;
39095 last_id = current_id;
39096 PyObject *current_module = new_data->table[i].module;
39097 new_data->table[i].module = last_module;
39098 last_module = current_module;
39099 }
39100 }
39101 end:
39102#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39103 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
39104#else
39105 __Pyx_ModuleStateLookup_data = new_data;
39106#endif
39107 __Pyx_ModuleStateLookup_Unlock();
39108 return result;
39109}
39110static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) {
39111 int64_t interpreter_id = PyInterpreterState_GetID(PyInterpreterState_Get());
39112 if (interpreter_id == -1) return -1;
39113 __Pyx_ModuleStateLookup_Lock();
39114#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39115 __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
39116 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
39117#else
39118 __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
39119#endif
39120 if (data->interpreter_id_as_index) {
39121 if (interpreter_id < data->count) {
39122 data->table[interpreter_id].module = NULL;
39123 }
39124 goto done;
39125 }
39126 {
39127 __Pyx_ModuleStateLookup_wait_until_no_readers();
39128 __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
39129 data->table, data->count, interpreter_id);
39130 if (!lower_bound) goto done;
39131 if (lower_bound->id != interpreter_id) goto done;
39132 __Pyx_InterpreterIdAndModule *end = data->table+data->count;
39133 for (;lower_bound<end-1; ++lower_bound) {
39134 lower_bound->id = (lower_bound+1)->id;
39135 lower_bound->module = (lower_bound+1)->module;
39136 }
39137 }
39138 --data->count;
39139 if (data->count == 0) {
39140 free(data);
39141 data = NULL;
39142 }
39143 done:
39144#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39145 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
39146#else
39147 __Pyx_ModuleStateLookup_data = data;
39148#endif
39149 __Pyx_ModuleStateLookup_Unlock();
39150 return 0;
39151}
39152#endif
39153
39154/* #### Code section: utility_code_pragmas_end ### */
39155#ifdef _MSC_VER
39156#pragma warning( pop )
39157#endif
39158
39159
39160
39161/* #### Code section: end ### */
39162#endif /* Py_PYTHON_H */
Int n
Definition Headers.h:28
Double q
Definition Headers.h:81
Double T
Definition Headers.h:87
Double L
Definition Headers.h:72
Double r
Definition Headers.h:83
Double U
Definition Headers.h:88
Double f
Definition Headers.h:64
Double s
Definition Headers.h:84
Double * z
Definition Headers.h:49
Double v
Definition Headers.h:95
#define sign(x, y)
Definition jf.h:44
#define c(i)
Definition jf.h:21
int partitionNodesFromTetgenFiles(const MPI_Comm &PROTEUS_COMM_WORLD, const char *filebase, int indexBase, Mesh &newMesh, int nNodes_overlap, double memHardLimit)
int buildQuadraticSubdomain2GlobalMappings_1d(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *elementOffsets_subdomain_owned, const int *nodeOffsets_subdomain_owned, const int *elementNumbering_subdomain2global, const int *nodeNumbering_subdomain2global, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global, double *lagrangeNodesArray)
int buildQuadraticCubeSubdomain2GlobalMappings_3d(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *edgeOffsets_subdomain_owned, const int *nodeOffsets_subdomain_owned, const int *edgeNumbering_subdomain2global, const int *nodeNumbering_subdomain2global, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global, double *lagrangeNodesArray)
int partitionNodesFromTriangleFiles(const MPI_Comm &PROTEUS_COMM_WORLD, const char *filebase, int indexBase, Mesh &newMesh, int nNodes_overlap)
int buildDiscontinuousGalerkinSubdomain2GlobalMappings(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *elementOffsets_subdomain_owned, const int *elementNumbering_subdomain2global, int nDOF_element, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global)
int buildQuadraticSubdomain2GlobalMappings_3d(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *edgeOffsets_subdomain_owned, const int *nodeOffsets_subdomain_owned, const int *edgeNumbering_subdomain2global, const int *nodeNumbering_subdomain2global, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global, double *lagrangeNodesArray)
int partitionElements(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, int nElements_overlap)
int partitionNodes(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, int nNodes_overlap)
int buildQuadraticSubdomain2GlobalMappings_2d(const MPI_Comm &PROTEUS_COMM_WORLD, Mesh &mesh, const int *elementBoundaryOffsets_subdomain_owned, const int *nodeOffsets_subdomain_owned, const int *elementBoundaryNumbering_subdomain2global, const int *nodeNumbering_subdomain2global, int &nDOF_all_processes, int &nDOF_subdomain, int &max_dof_neighbors, int *offsets_subdomain_owned, int *subdomain_l2g, int *subdomain2global, double *lagrangeNodesArray)