99#ifndef PY_SSIZE_T_CLEAN
100#define PY_SSIZE_T_CLEAN
103#if defined(Py_LIMITED_API)
104 #if !defined(CYTHON_LIMITED_API)
105 #define CYTHON_LIMITED_API 1
107#elif defined(CYTHON_LIMITED_API)
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.")
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.
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.
123#define __PYX_ABI_VERSION "3_3_0"
124#define CYTHON_HEX_VERSION 0x030300F0
125#define CYTHON_FUTURE_DIVISION 1
129 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
131#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
143 #define __Pyx_has_cbuiltin(name) __has_builtin(name)
145 #define __Pyx_has_cbuiltin(name) (0)
148 #define DL_IMPORT(t) t
151 #define DL_EXPORT(t) t
155 #define PY_LONG_LONG LONG_LONG
158 #define Py_HUGE_VAL HUGE_VAL
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."
169 #if defined(GRAALVM_PYTHON) || defined(PYPY_VERSION)
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.")
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."
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
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
201 #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
202 #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
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)
219 #ifndef CYTHON_PEP487_INIT_SUBCLASS
220 #define CYTHON_PEP487_INIT_SUBCLASS 1
222 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
223 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
225 #ifndef CYTHON_USE_MODULE_STATE
226 #define CYTHON_USE_MODULE_STATE 0
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)
233 #ifndef CYTHON_USE_AM_SEND
234 #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
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
243 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
244 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
246 #ifndef CYTHON_USE_FREELISTS
247 #define CYTHON_USE_FREELISTS 1
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)
257#elif defined(GRAALVM_PYTHON)
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
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
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
303 #ifndef CYTHON_PEP487_INIT_SUBCLASS
304 #define CYTHON_PEP487_INIT_SUBCLASS 1
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
323 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
324 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
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
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
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
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)
377 #ifndef CYTHON_PEP487_INIT_SUBCLASS
378 #define CYTHON_PEP487_INIT_SUBCLASS 1
380 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
381 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
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)
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)
399 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
400 #define CYTHON_USE_OWN_PREP_RERAISE_STAR 1
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
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
416 #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
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
424 #ifndef CYTHON_USE_TYPE_SPECS
425 #define CYTHON_USE_TYPE_SPECS 0
427 #ifndef CYTHON_USE_PYTYPE_LOOKUP
428 #define CYTHON_USE_PYTYPE_LOOKUP 1
430 #ifndef CYTHON_USE_PYLONG_INTERNALS
431 #define CYTHON_USE_PYLONG_INTERNALS 1
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
439 #ifndef CYTHON_USE_UNICODE_INTERNALS
440 #define CYTHON_USE_UNICODE_INTERNALS 1
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
448 #ifndef CYTHON_AVOID_BORROWED_REFS
449 #define CYTHON_AVOID_BORROWED_REFS 0
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
457 #ifndef CYTHON_ASSUME_SAFE_MACROS
458 #define CYTHON_ASSUME_SAFE_MACROS 1
460 #ifndef CYTHON_ASSUME_SAFE_SIZE
461 #define CYTHON_ASSUME_SAFE_SIZE 1
463 #ifndef CYTHON_UNPACK_METHODS
464 #define CYTHON_UNPACK_METHODS 1
466 #ifndef CYTHON_FAST_THREAD_STATE
467 #define CYTHON_FAST_THREAD_STATE 1
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)
475 #ifndef CYTHON_VECTORCALL
476 #define CYTHON_VECTORCALL 1
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
484 #ifndef CYTHON_PEP487_INIT_SUBCLASS
485 #define CYTHON_PEP487_INIT_SUBCLASS 1
487 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
488 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
490 #ifndef CYTHON_USE_MODULE_STATE
491 #define CYTHON_USE_MODULE_STATE 0
493 #ifndef CYTHON_USE_SYS_MONITORING
494 #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
496 #ifndef CYTHON_USE_TP_FINALIZE
497 #define CYTHON_USE_TP_FINALIZE 1
499 #ifndef CYTHON_USE_AM_SEND
500 #define CYTHON_USE_AM_SEND 1
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)
508 #ifndef CYTHON_USE_EXC_INFO_STACK
509 #define CYTHON_USE_EXC_INFO_STACK 1
511 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
512 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
514 #ifndef CYTHON_USE_OWN_PREP_RERAISE_STAR
515 #define CYTHON_USE_OWN_PREP_RERAISE_STAR (PY_VERSION_HEX < 0x030C00B2)
517 #ifndef CYTHON_USE_FREELISTS
518 #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
520 #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
521 #undef CYTHON_IMMORTAL_CONSTANTS
522 #define CYTHON_IMMORTAL_CONSTANTS 0
523 #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
524 #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
526 #ifndef CYTHON_OPAQUE_OBJECTS
527 #define CYTHON_OPAQUE_OBJECTS 0
530#if CYTHON_USE_PYLONG_INTERNALS
535 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
538#ifndef __has_attribute
539 #define __has_attribute(x) 0
541#ifndef __has_cpp_attribute
542 #define __has_cpp_attribute(x) 0
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
552 #define CYTHON_RESTRICT
556 #if defined(__cplusplus)
559 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
560 #if __has_cpp_attribute(maybe_unused)
561 #define CYTHON_UNUSED [[maybe_unused]]
564 #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
565 #define CYTHON_UNUSED [[maybe_unused]]
569# if defined(__GNUC__)
570# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
571# define CYTHON_UNUSED __attribute__ ((__unused__))
573# define CYTHON_UNUSED
575# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
576# define CYTHON_UNUSED __attribute__ ((__unused__))
578# define CYTHON_UNUSED
581#ifndef CYTHON_UNUSED_VAR
582# if defined(__cplusplus)
583 template<
class T>
void CYTHON_UNUSED_VAR(
const T& ) { }
585# define CYTHON_UNUSED_VAR(x) (void)(x)
588#ifndef CYTHON_MAYBE_UNUSED_VAR
589 #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
591#ifndef CYTHON_NCP_UNUSED
592# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
593# define CYTHON_NCP_UNUSED
595# define CYTHON_NCP_UNUSED CYTHON_UNUSED
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
603 #define CYTHON_USE_CPP_STD_MOVE 0
606#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
608typedef uintptr_t __pyx_uintptr_t;
609#ifndef CYTHON_FALLTHROUGH
610 #if defined(__cplusplus)
613 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
614 #if __has_cpp_attribute(fallthrough)
615 #define CYTHON_FALLTHROUGH [[fallthrough]]
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]]
626 #ifndef CYTHON_FALLTHROUGH
627 #if __has_attribute(fallthrough)
628 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
630 #define CYTHON_FALLTHROUGH
633 #if defined(__clang__) && defined(__apple_build_version__)
634 #if __apple_build_version__ < 7000000
635 #undef CYTHON_FALLTHROUGH
636 #define CYTHON_FALLTHROUGH
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)
649 #define __Pyx_UNREACHABLE() Py_FatalError("Unreachable C code path reached")
651#ifndef Py_UNREACHABLE
652 #define Py_UNREACHABLE() __Pyx_UNREACHABLE()
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)
659 #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
661#if CYTHON_COMPILING_IN_PYPY == 1
662 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x030A0000)
664 #define __PYX_NEED_TP_PRINT_SLOT 0
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)
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)
677 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
680 #if defined(__clang__)
681 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
683 #define CYTHON_INLINE inline
687void __Pyx_call_destructor(
T& x) {
691class __Pyx_FakeReference {
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; }
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
713 static int CO_OPTIMIZED;
716 static int CO_NEWLOCALS;
719 static int CO_VARARGS;
721 #ifndef CO_VARKEYWORDS
722 static int CO_VARKEYWORDS;
724 #ifndef CO_ASYNC_GENERATOR
725 static int CO_ASYNC_GENERATOR;
728 static int CO_GENERATOR;
731 static int CO_COROUTINE;
735 #define CO_COROUTINE 0x80
737 #ifndef CO_ASYNC_GENERATOR
738 #define CO_ASYNC_GENERATOR 0x200
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)
745 #define __Pyx_Py_Is(x, y) ((x) == (y))
747#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
748 #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
750 #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
752#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
753 #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
755 #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
757#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
758 #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
760 #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
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)
766 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
768#if CYTHON_COMPILING_IN_LIMITED_API
769static unsigned long __Pyx_Runtime_TPFLAGS_SEQUENCE;
770static unsigned long __Pyx_Runtime_TPFLAGS_MAPPING;
772#define __Pyx_Runtime_TPFLAGS_SEQUENCE Py_TPFLAGS_SEQUENCE
773#define __Pyx_Runtime_TPFLAGS_MAPPING Py_TPFLAGS_MAPPING
775static int __Pyx_init_tpflags_variables(
void);
776#ifndef Py_TPFLAGS_HAVE_FINALIZE
777 #define Py_TPFLAGS_HAVE_FINALIZE 0
779#ifndef Py_TPFLAGS_SEQUENCE
780 #define Py_TPFLAGS_SEQUENCE (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 5)
782#ifndef Py_TPFLAGS_MAPPING
783 #define Py_TPFLAGS_MAPPING (CYTHON_COMPILING_IN_LIMITED_API ? 0 : 1 << 6)
785#ifndef Py_TPFLAGS_IMMUTABLETYPE
786 #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
788#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
789 #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
791#ifndef METH_STACKLESS
792 #define METH_STACKLESS 0
794#if !defined(METH_FASTCALL) || CYTHON_COMPILING_IN_PYPY
795 #ifndef METH_FASTCALL
796 #define METH_FASTCALL 0x80
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);
802 #if PY_VERSION_HEX >= 0x030d00A4
803 # define __Pyx_PyCFunctionFast PyCFunctionFast
804 # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
806 # define __Pyx_PyCFunctionFast _PyCFunctionFast
807 # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
811 #define __Pyx_METH_FASTCALL METH_FASTCALL
812 #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
813 #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
815 #define __Pyx_METH_FASTCALL METH_VARARGS
816 #define __Pyx_PyCFunction_FastCall PyCFunction
817 #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
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))
824 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
825 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
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)
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;
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;
844 return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
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))
851 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
853#if CYTHON_COMPILING_IN_PYPY
854 typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *
const *, size_t, PyObject *);
856 #define __Pyx_PyCMethod PyCMethod
859 #define METH_METHOD 0x200
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)
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))
875 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
876 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
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()
885 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
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
892 #define __PYX_SHARED_SIZEOF(T) sizeof(T)
893 #define __PYX_SHARED_RELATIVE_OFFSET 0
894 #define CYTHON_OPAQUE_SHARED_TYPES 0
896#if CYTHON_USE_MODULE_STATE
897static CYTHON_INLINE
void *__Pyx__PyModule_GetState(PyObject *op)
900 result = PyModule_GetState(op);
902 Py_FatalError(
"Couldn't find the module state");
905#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
907#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
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)
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)
927#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
928#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
930#define __Pyx_PyDict_NewPresized(n) PyDict_New()
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);
943#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
944#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
945#define __Pyx_PyDict_GetItemStr PyDict_GetItem
947static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
948#if CYTHON_COMPILING_IN_PYPY
949 return PyDict_GetItem(dict, name);
952 PyDictObject *mp = (PyDictObject*) dict;
953 long hash = ((PyStringObject *) name)->ob_shash;
955 ep = (mp->ma_lookup)(mp, name, hash);
962#define __Pyx_PyDict_GetItemStr PyDict_GetItem
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)
968 #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
969 #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
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);\
980#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
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))
992 #if PY_VERSION_HEX >= 0x030C0000
993 #define __Pyx_PyUnicode_READY(op) (0)
995 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
996 0 : _PyUnicode_Ready((PyObject *)(op)))
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))
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))
1010 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
1013 static CYTHON_INLINE
int __Pyx_PyUnicode_KIND_04(PyObject *o) {
1014 return __Pyx_PyUnicode_KIND(o) - (int) !!PyUnicode_IS_ASCII(o);
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)
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))
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)
1029 #if !defined(PyUnicode_Contains)
1030 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
1032 #if !defined(PyByteArray_Check)
1033 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
1035 #if !defined(PyObject_Format)
1036 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
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))
1047 #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
1049#ifndef PySet_CheckExact
1050 #define PySet_CheckExact(obj) Py_IS_TYPE(obj, &PySet_Type)
1052enum __Pyx_ReferenceSharing {
1053 __Pyx_ReferenceSharing_DefinitelyUnique,
1054 __Pyx_ReferenceSharing_OwnStrongReference,
1055 __Pyx_ReferenceSharing_FunctionArgument,
1056 __Pyx_ReferenceSharing_SharedReference,
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)
1066#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
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))
1074 #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
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))
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))
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))
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))
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)))
1099 #define __Pyx_PyList_GET_ITEM_REF(o, i, unsafe_shared) ((void)(unsafe_shared),\
1100 __Pyx_XNewRef(PyList_GetItem(o, i)))
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)) {
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;
1126#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
1127 #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj)
1129 #define __Pyx_VISIT_CONST(obj)
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)
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)
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)
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)
1163#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
1164 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
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
1175 } __Pyx_PySendResult;
1177#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
1178 typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
1180 #define __Pyx_pyiter_sendfunc sendfunc
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
1187#define __PYX_HAS_PY_AM_SEND 2
1189#if __PYX_HAS_PY_AM_SEND < 2
1190 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1196 __Pyx_pyiter_sendfunc am_send;
1197 } __Pyx_PyAsyncMethodsStruct;
1198 #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
1200#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
1201 #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
1203 #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
1205#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
1209PyAPI_FUNC(
void *) PyMem_Calloc(
size_t nelem,
size_t elsize);
1211#if CYTHON_COMPILING_IN_LIMITED_API
1212static int __Pyx_init_co_variable(PyObject *inspect,
const char* name,
int *write_to) {
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);
1219 return value != -1 || !PyErr_Occurred();
1221static int __Pyx_init_co_variables(
void) {
1224 inspect = PyImport_ImportModule(
"inspect");
1226#if !defined(CO_OPTIMIZED)
1227 __Pyx_init_co_variable(inspect,
"CO_OPTIMIZED", &CO_OPTIMIZED) &&
1229#if !defined(CO_NEWLOCALS)
1230 __Pyx_init_co_variable(inspect,
"CO_NEWLOCALS", &CO_NEWLOCALS) &&
1232#if !defined(CO_VARARGS)
1233 __Pyx_init_co_variable(inspect,
"CO_VARARGS", &CO_VARARGS) &&
1235#if !defined(CO_VARKEYWORDS)
1236 __Pyx_init_co_variable(inspect,
"CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
1238#if !defined(CO_ASYNC_GENERATOR)
1239 __Pyx_init_co_variable(inspect,
"CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
1241#if !defined(CO_GENERATOR)
1242 __Pyx_init_co_variable(inspect,
"CO_GENERATOR", &CO_GENERATOR) &&
1244#if !defined(CO_COROUTINE)
1245 __Pyx_init_co_variable(inspect,
"CO_COROUTINE", &CO_COROUTINE) &&
1249 return result ? 0 : -1;
1251static int __Pyx_init_tpflags_bitcount(
unsigned long flag) {
1254 count += (int) (flag & 1);
1259static int __Pyx_init_tpflags_variables(
void) {
1260 if (__Pyx_Runtime_TPFLAGS_SEQUENCE != 0 && __Pyx_Runtime_TPFLAGS_MAPPING != 0) {
1263 PyObject *collections_abc = PyImport_ImportModule(
"collections.abc");
1264 if (!collections_abc)
return -1;
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;
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;
1276 if (!PyType_Check(sequence) || !PyType_Check(mapping))
goto fail;
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;
1286 if (__Pyx_Runtime_TPFLAGS_MAPPING == 0 && __Pyx_init_tpflags_bitcount(mapping_flags) == 1) {
1287 __Pyx_Runtime_TPFLAGS_MAPPING = mapping_flags;
1291 Py_XDECREF(mapping);
1292 Py_XDECREF(sequence);
1293 Py_DECREF(collections_abc);
1295#if __PYX_LIMITED_VERSION_HEX < 0x030D0000
1297 if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
1302 result = PyErr_Occurred() ? -1 : 0;
1306static int __Pyx_init_co_variables(
void) {
1309static int __Pyx_init_tpflags_variables(
void) {
1315#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1316 #ifndef _USE_MATH_DEFINES
1317 #define _USE_MATH_DEFINES
1321#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1322#define __Pyx_truncl trunc
1324#define __Pyx_truncl truncl
1327#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
1328#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 1
1330#ifndef CYTHON_CLINE_IN_TRACEBACK
1331#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
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; }
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; }
1338#define __PYX_ERR(f_index, lineno, Ln_error) \
1339 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1341#ifdef CYTHON_EXTERN_C
1342 #undef __PYX_EXTERN_C
1343 #define __PYX_EXTERN_C CYTHON_EXTERN_C
1344#elif defined(__PYX_EXTERN_C)
1346 #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1348 #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1351 #define __PYX_EXTERN_C extern "C++"
1354#define __PYX_HAVE__cpartitioning
1355#define __PYX_HAVE_API__cpartitioning
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"
1370 #if (MPI_VERSION < 3) && !defined(PyMPI_HAVE_MPI_Message)
1371 typedef void *PyMPI_MPI_Message;
1372 #define MPI_Message PyMPI_MPI_Message
1375 #if (MPI_VERSION < 4) && !defined(PyMPI_HAVE_MPI_Session)
1376 typedef void *PyMPI_MPI_Session;
1377 #define MPI_Session PyMPI_MPI_Session
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
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
1397#include "partitioning.h"
1398#include "pythread.h"
1400 typedef int (*__pyx_memoryview_to_dtype_func_type)(char*, PyObject*);
1407#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1408#define CYTHON_WITHOUT_ASSERTIONS
1411#ifdef CYTHON_FREETHREADING_COMPATIBLE
1412#if CYTHON_FREETHREADING_COMPATIBLE
1413#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
1415#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
1418#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
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;
1440#if defined (__cplusplus) && __cplusplus >= 201103L
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)
1454 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
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)
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)
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);
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);
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)
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)
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
1535 #ifndef _PyLong_NON_SIZE_BITS
1536 #define _PyLong_NON_SIZE_BITS 3
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)
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])
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);
1567 typedef Py_ssize_t __Pyx_compact_pylong;
1568 typedef size_t __Pyx_compact_upylong;
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;
1585 #if PY_VERSION_HEX >= 0x030C00A5
1586 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1588 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1590 #define __Pyx_PyLong_IsNonZero(x) (!__Pyx_PyLong_IsZero(x))
1592 #define __Pyx_PyLong_IsNonZero(x) PyObject_IsTrue(x)
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)
1599 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
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 */
1613#if __cplusplus > 201103L
1614#include <type_traits>
1616template <typename T>
1617static void __Pyx_pretend_to_initialize(T* ptr) {
1618#if __cplusplus > 201103L
1619 if ((std::is_trivially_default_constructible<T>::value))
1625static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1629#if !CYTHON_USE_MODULE_STATE
1630static PyObject *__pyx_m = NULL;
1632static const char * const __pyx_cfilenm = __FILE__;
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
1641 #define CYTHON_CCOMPLEX 0
1648 #include <complex.h>
1651#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1653 #define _Complex_I 1.0fj
1656/* #### Code section: filename_table ### */
1658static const char* const __pyx_f[] = {
1659 "proteus/cpartitioning.pyx",
1661 "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd",
1664 "proteus/cmeshTools.pxd",
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
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)))
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"
1709#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1710 (__cplusplus >= 201103L) ||\
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"
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;
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;
1760 #ifdef __PYX_DEBUG_ATOMICS
1761 #warning "Using GNU atomics"
1763#elif CYTHON_ATOMICS && defined(_MSC_VER)
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;
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;
1793 #ifdef __PYX_DEBUG_ATOMICS
1794 #pragma message ("Using MSVC atomics")
1797 #undef CYTHON_ATOMICS
1798 #define CYTHON_ATOMICS 0
1799 #ifdef __PYX_DEBUG_ATOMICS
1800 #warning "Not using atomics"
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)
1811#define __Pyx_PyCriticalSection PyCriticalSection
1812#define __Pyx_PyCriticalSection2 PyCriticalSection2
1813#define __Pyx_PyCriticalSection_End PyCriticalSection_End
1814#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
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)
1822#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
1823#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
1825#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
1826#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
1827#define __Pyx_END_CRITICAL_SECTION() }
1829#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
1830#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
1833/* ForceInitThreads.proto */
1834#ifndef __PYX_FORCE_INIT_THREADS
1835 #define __PYX_FORCE_INIT_THREADS 0
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()
1845/* IncludeStructmemberH.proto (used by CythonFunctionShared) */
1846#include <structmember.h>
1848/* BufferFormatStructs.proto */
1849struct __Pyx_StructField_;
1850#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1853 const struct __Pyx_StructField_* fields;
1855 size_t arraysize[8];
1861typedef struct __Pyx_StructField_ {
1862 const __Pyx_TypeInfo* type;
1867 const __Pyx_StructField* field;
1868 size_t parent_offset;
1869} __Pyx_BufFmt_StackElem;
1871 __Pyx_StructField root;
1872 __Pyx_BufFmt_StackElem* head;
1874 size_t new_count, enc_count;
1875 size_t struct_alignment;
1880 char is_valid_array;
1881} __Pyx_BufFmt_Context;
1883/* MemviewSliceStruct.proto */
1884struct __pyx_memoryview_obj;
1886 struct __pyx_memoryview_obj *memview;
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 } }
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))
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)
1914/* #### Code section: numeric_typedefs ### */
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.
1919 * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1920 * ctypedef npy_int16 int16_t
1921 * ctypedef npy_int32 int32_t
1923typedef npy_int8 __pyx_t_5numpy_int8_t;
1925/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":762
1927 * ctypedef npy_int8 int8_t
1928 * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1929 * ctypedef npy_int32 int32_t
1930 * ctypedef npy_int64 int64_t
1932typedef npy_int16 __pyx_t_5numpy_int16_t;
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
1941typedef npy_int32 __pyx_t_5numpy_int32_t;
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 # <<<<<<<<<<<<<<
1948 * ctypedef npy_uint8 uint8_t
1950typedef npy_int64 __pyx_t_5numpy_int64_t;
1952/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":766
1953 * ctypedef npy_int64 int64_t
1955 * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1956 * ctypedef npy_uint16 uint16_t
1957 * ctypedef npy_uint32 uint32_t
1959typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1961/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":767
1963 * ctypedef npy_uint8 uint8_t
1964 * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1965 * ctypedef npy_uint32 uint32_t
1966 * ctypedef npy_uint64 uint64_t
1968typedef npy_uint16 __pyx_t_5numpy_uint16_t;
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
1977typedef npy_uint32 __pyx_t_5numpy_uint32_t;
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 # <<<<<<<<<<<<<<
1984 * ctypedef npy_float32 float32_t
1986typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1988/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":771
1989 * ctypedef npy_uint64 uint64_t
1991 * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1992 * ctypedef npy_float64 float64_t
1993 * #ctypedef npy_float80 float80_t
1995typedef npy_float32 __pyx_t_5numpy_float32_t;
1997/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":772
1999 * ctypedef npy_float32 float32_t
2000 * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
2001 * #ctypedef npy_float80 float80_t
2002 * #ctypedef npy_float128 float128_t
2004typedef npy_float64 __pyx_t_5numpy_float64_t;
2006/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":779
2007 * ctypedef double complex complex128_t
2009 * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
2010 * ctypedef npy_ulonglong ulonglong_t
2013typedef npy_longlong __pyx_t_5numpy_longlong_t;
2015/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":780
2017 * ctypedef npy_longlong longlong_t
2018 * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
2020 * ctypedef npy_intp intp_t
2022typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
2024/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":782
2025 * ctypedef npy_ulonglong ulonglong_t
2027 * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
2028 * ctypedef npy_uintp uintp_t
2031typedef npy_intp __pyx_t_5numpy_intp_t;
2033/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":783
2035 * ctypedef npy_intp intp_t
2036 * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
2038 * ctypedef npy_double float_t
2040typedef npy_uintp __pyx_t_5numpy_uintp_t;
2042/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":785
2043 * ctypedef npy_uintp uintp_t
2045 * ctypedef npy_double float_t # <<<<<<<<<<<<<<
2046 * ctypedef npy_double double_t
2047 * ctypedef npy_longdouble longdouble_t
2049typedef npy_double __pyx_t_5numpy_float_t;
2051/* "../miniforge3/envs/proteus-jupyterhub/lib/python3.14/site-packages/numpy/__init__.cython-30.pxd":786
2053 * ctypedef npy_double float_t
2054 * ctypedef npy_double double_t # <<<<<<<<<<<<<<
2055 * ctypedef npy_longdouble longdouble_t
2058typedef npy_double __pyx_t_5numpy_double_t;
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 # <<<<<<<<<<<<<<
2065 * ctypedef float complex cfloat_t
2067typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
2068/* #### Code section: complex_type_declarations ### */
2069/* Declarations.proto */
2070#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2072 typedef ::std::complex< float > __pyx_t_float_complex;
2074 typedef float _Complex __pyx_t_float_complex;
2077 typedef struct { float real, imag; } __pyx_t_float_complex;
2079static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
2081/* Declarations.proto */
2082#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2084 typedef ::std::complex< double > __pyx_t_double_complex;
2086 typedef double _Complex __pyx_t_double_complex;
2089 typedef struct { double real, imag; } __pyx_t_double_complex;
2091static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
2093/* Declarations.proto */
2094#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2096 typedef ::std::complex< long double > __pyx_t_long_double_complex;
2098 typedef long double _Complex __pyx_t_long_double_complex;
2101 typedef struct { long double real, imag; } __pyx_t_long_double_complex;
2103static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double);
2105/* #### Code section: type_declarations ### */
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;
2134/* "mpi4py/MPI.pxd":44
2135 * ctypedef MPI_Count Count "MPI_Count"
2137 * ctypedef api class Datatype [ # <<<<<<<<<<<<<<
2138 * type PyMPIDatatype_Type,
2139 * object PyMPIDatatypeObject,
2141struct PyMPIDatatypeObject {
2143 MPI_Datatype ob_mpi;
2145 PyObject *__weakref__;
2147typedef struct PyMPIDatatypeObject PyMPIDatatypeObject;
2150/* "mpi4py/MPI.pxd":52
2151 * cdef object __weakref__
2153 * ctypedef api class Status [ # <<<<<<<<<<<<<<
2154 * type PyMPIStatus_Type,
2155 * object PyMPIStatusObject,
2157struct PyMPIStatusObject {
2161 PyObject *__weakref__;
2163typedef struct PyMPIStatusObject PyMPIStatusObject;
2166/* "mpi4py/MPI.pxd":60
2167 * cdef object __weakref__
2169 * ctypedef api class Request [ # <<<<<<<<<<<<<<
2170 * type PyMPIRequest_Type,
2171 * object PyMPIRequestObject,
2173struct PyMPIRequestObject {
2177 PyObject *__weakref__;
2180typedef struct PyMPIRequestObject PyMPIRequestObject;
2183/* "mpi4py/MPI.pxd":69
2184 * cdef object ob_buf
2186 * ctypedef api class Prequest(Request) [ # <<<<<<<<<<<<<<
2187 * type PyMPIPrequest_Type,
2188 * object PyMPIPrequestObject,
2190struct PyMPIPrequestObject {
2191 struct PyMPIRequestObject __pyx_base;
2193typedef struct PyMPIPrequestObject PyMPIPrequestObject;
2196/* "mpi4py/MPI.pxd":75
2199 * ctypedef api class Grequest(Request) [ # <<<<<<<<<<<<<<
2200 * type PyMPIGrequest_Type,
2201 * object PyMPIGrequestObject,
2203struct PyMPIGrequestObject {
2204 struct PyMPIRequestObject __pyx_base;
2205 MPI_Request ob_grequest;
2207typedef struct PyMPIGrequestObject PyMPIGrequestObject;
2210/* "mpi4py/MPI.pxd":81
2211 * cdef MPI_Request ob_grequest
2213 * ctypedef api class Message [ # <<<<<<<<<<<<<<
2214 * type PyMPIMessage_Type,
2215 * object PyMPIMessageObject,
2217struct PyMPIMessageObject {
2221 PyObject *__weakref__;
2224typedef struct PyMPIMessageObject PyMPIMessageObject;
2227/* "mpi4py/MPI.pxd":90
2228 * cdef object ob_buf
2230 * ctypedef api class Op [ # <<<<<<<<<<<<<<
2231 * type PyMPIOp_Type,
2232 * object PyMPIOpObject,
2234struct PyMPIOpObject {
2238 PyObject *__weakref__;
2240typedef struct PyMPIOpObject PyMPIOpObject;
2243/* "mpi4py/MPI.pxd":98
2244 * cdef object __weakref__
2246 * ctypedef api class Group [ # <<<<<<<<<<<<<<
2247 * type PyMPIGroup_Type,
2248 * object PyMPIGroupObject,
2250struct PyMPIGroupObject {
2254 PyObject *__weakref__;
2256typedef struct PyMPIGroupObject PyMPIGroupObject;
2259/* "mpi4py/MPI.pxd":106
2260 * cdef object __weakref__
2262 * ctypedef api class Info [ # <<<<<<<<<<<<<<
2263 * type PyMPIInfo_Type,
2264 * object PyMPIInfoObject,
2266struct PyMPIInfoObject {
2270 PyObject *__weakref__;
2272typedef struct PyMPIInfoObject PyMPIInfoObject;
2275/* "mpi4py/MPI.pxd":114
2276 * cdef object __weakref__
2278 * ctypedef api class Errhandler [ # <<<<<<<<<<<<<<
2279 * type PyMPIErrhandler_Type,
2280 * object PyMPIErrhandlerObject,
2282struct PyMPIErrhandlerObject {
2284 MPI_Errhandler ob_mpi;
2286 PyObject *__weakref__;
2288typedef struct PyMPIErrhandlerObject PyMPIErrhandlerObject;
2291/* "mpi4py/MPI.pxd":122
2292 * cdef object __weakref__
2294 * ctypedef api class Session [ # <<<<<<<<<<<<<<
2295 * type PyMPISession_Type,
2296 * object PyMPISessionObject,
2298struct PyMPISessionObject {
2302 PyObject *__weakref__;
2304typedef struct PyMPISessionObject PyMPISessionObject;
2307/* "mpi4py/MPI.pxd":130
2308 * cdef object __weakref__
2310 * ctypedef api class Comm [ # <<<<<<<<<<<<<<
2311 * type PyMPIComm_Type,
2312 * object PyMPICommObject,
2314struct PyMPICommObject {
2318 PyObject *__weakref__;
2320typedef struct PyMPICommObject PyMPICommObject;
2323/* "mpi4py/MPI.pxd":138
2324 * cdef object __weakref__
2326 * ctypedef api class Intracomm(Comm) [ # <<<<<<<<<<<<<<
2327 * type PyMPIIntracomm_Type,
2328 * object PyMPIIntracommObject,
2330struct PyMPIIntracommObject {
2331 struct PyMPICommObject __pyx_base;
2333typedef struct PyMPIIntracommObject PyMPIIntracommObject;
2336/* "mpi4py/MPI.pxd":144
2339 * ctypedef api class Topocomm(Intracomm) [ # <<<<<<<<<<<<<<
2340 * type PyMPITopocomm_Type,
2341 * object PyMPITopocommObject,
2343struct PyMPITopocommObject {
2344 struct PyMPIIntracommObject __pyx_base;
2346typedef struct PyMPITopocommObject PyMPITopocommObject;
2349/* "mpi4py/MPI.pxd":150
2352 * ctypedef api class Cartcomm(Topocomm) [ # <<<<<<<<<<<<<<
2353 * type PyMPICartcomm_Type,
2354 * object PyMPICartcommObject,
2356struct PyMPICartcommObject {
2357 struct PyMPITopocommObject __pyx_base;
2359typedef struct PyMPICartcommObject PyMPICartcommObject;
2362/* "mpi4py/MPI.pxd":156
2365 * ctypedef api class Graphcomm(Topocomm) [ # <<<<<<<<<<<<<<
2366 * type PyMPIGraphcomm_Type,
2367 * object PyMPIGraphcommObject,
2369struct PyMPIGraphcommObject {
2370 struct PyMPITopocommObject __pyx_base;
2372typedef struct PyMPIGraphcommObject PyMPIGraphcommObject;
2375/* "mpi4py/MPI.pxd":162
2378 * ctypedef api class Distgraphcomm(Topocomm) [ # <<<<<<<<<<<<<<
2379 * type PyMPIDistgraphcomm_Type,
2380 * object PyMPIDistgraphcommObject,
2382struct PyMPIDistgraphcommObject {
2383 struct PyMPITopocommObject __pyx_base;
2385typedef struct PyMPIDistgraphcommObject PyMPIDistgraphcommObject;
2388/* "mpi4py/MPI.pxd":168
2391 * ctypedef api class Intercomm(Comm) [ # <<<<<<<<<<<<<<
2392 * type PyMPIIntercomm_Type,
2393 * object PyMPIIntercommObject,
2395struct PyMPIIntercommObject {
2396 struct PyMPICommObject __pyx_base;
2398typedef struct PyMPIIntercommObject PyMPIIntercommObject;
2401/* "mpi4py/MPI.pxd":174
2404 * ctypedef api class Win [ # <<<<<<<<<<<<<<
2405 * type PyMPIWin_Type,
2406 * object PyMPIWinObject,
2408struct PyMPIWinObject {
2412 PyObject *__weakref__;
2415typedef struct PyMPIWinObject PyMPIWinObject;
2418/* "mpi4py/MPI.pxd":183
2419 * cdef object ob_mem
2421 * ctypedef api class File [ # <<<<<<<<<<<<<<
2422 * type PyMPIFile_Type,
2423 * object PyMPIFileObject,
2425struct PyMPIFileObject {
2429 PyObject *__weakref__;
2431typedef struct PyMPIFileObject PyMPIFileObject;
2434/* "cmeshTools.pxd":6
2435 * cimport mesh as cppm
2437 * cdef class CMesh: # <<<<<<<<<<<<<<
2438 * cdef cppm.Mesh mesh
2441struct __pyx_obj_7proteus_10cmeshTools_CMesh {
2444 int nElements_global;
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;
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;
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;
2497/* "View.MemoryView":128
2500 * @cython.collection_type("sequence") # <<<<<<<<<<<<<<
2501 * @cname("__pyx_array")
2504struct __pyx_array_obj {
2506 struct __pyx_vtabstruct_array *__pyx_vtab;
2512 Py_ssize_t *_strides;
2513 Py_ssize_t itemsize;
2516 void (*callback_free_data)(void *);
2518 int dtype_is_object;
2522/* "View.MemoryView":318
2525 * @cname('__pyx_MemviewEnum') # <<<<<<<<<<<<<<
2526 * cdef class Enum(object):
2529struct __pyx_MemviewEnum_obj {
2535/* "View.MemoryView":353
2538 * @cname('__pyx_memoryview') # <<<<<<<<<<<<<<
2539 * cdef class memoryview:
2542struct __pyx_memoryview_obj {
2544 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
2548 PyThread_type_lock lock;
2549 __pyx_atomic_int_type acquisition_count;
2552 int dtype_is_object;
2553 __Pyx_TypeInfo const *typeinfo;
2557/* "View.MemoryView":947
2560 * @cython.collection_type("sequence") # <<<<<<<<<<<<<<
2561 * @cname('__pyx_memoryviewslice')
2562 * cdef class _memoryviewslice(memoryview):
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;
2574/* "View.MemoryView":128
2577 * @cython.collection_type("sequence") # <<<<<<<<<<<<<<
2578 * @cname("__pyx_array")
2582struct __pyx_vtabstruct_array {
2583 PyObject *(*get_memview)(struct __pyx_array_obj *);
2585static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
2588/* "View.MemoryView":353
2591 * @cname('__pyx_memoryview') # <<<<<<<<<<<<<<
2592 * cdef class memoryview:
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 *);
2607static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
2610/* "View.MemoryView":947
2613 * @cython.collection_type("sequence") # <<<<<<<<<<<<<<
2614 * @cname('__pyx_memoryviewslice')
2615 * cdef class _memoryviewslice(memoryview):
2618struct __pyx_vtabstruct__memoryviewslice {
2619 struct __pyx_vtabstruct_memoryview __pyx_base;
2621static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
2622/* #### Code section: utility_code_proto ### */
2624/* --- Runtime support code (head) --- */
2626#ifndef CYTHON_REFNANNY
2627 #define CYTHON_REFNANNY 0
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)\
2643 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2644 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2645 PyGILState_Release(__pyx_gilstate_save);\
2647 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2649 #define __Pyx_RefNannyFinishContextNogil() {\
2650 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2651 __Pyx_RefNannyFinishContext();\
2652 PyGILState_Release(__pyx_gilstate_save);\
2654 #define __Pyx_RefNannyFinishContextNogil() {\
2655 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2656 __Pyx_RefNannyFinishContext();\
2657 PyGILState_Release(__pyx_gilstate_save);\
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)
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)
2683#define __Pyx_Py_XDECREF_SET(r, v) do {\
2684 PyObject *tmp = (PyObject *) r;\
2685 r = v; Py_XDECREF(tmp);\
2687#define __Pyx_XDECREF_SET(r, v) do {\
2688 PyObject *tmp = (PyObject *) r;\
2689 r = v; __Pyx_XDECREF(tmp);\
2691#define __Pyx_DECREF_SET(r, v) do {\
2692 PyObject *tmp = (PyObject *) r;\
2693 r = v; __Pyx_DECREF(tmp);\
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)
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);
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))
2707CYTHON_UNUSED static PyObject *
2708__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
2711/* TupleFromArray.proto (used by fastcall) */
2714/* IncludeStringH.proto (used by PyObjectCompare) */
2717/* PyObjectCompare.proto (used by UnicodeEquals) */
2718static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_str_str(PyObject *op1, PyObject *op2, int pyop);
2720/* UnicodeEquals.proto (used by fastcall) */
2721#define __Pyx_PyUnicode_Equals(s1, s2) __Pyx_PyObject_CompareBoolEq_str_str(s1, s2, Py_EQ)
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))
2729 #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
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);
2743 #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
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
2752#if CYTHON_VECTORCALL_TPNEW
2753 #if !CYTHON_VECTORCALL
2754 #error Enabling CYTHON_VECTORCALL_TPNEW without CYTHON_VECTORCALL is not supported
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
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
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)
2772#define __Pyx_ArgsSlice_FASTCALL __Pyx_ArgsSlice_VARARGS
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);
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)
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);
2795#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2798/* PyObjectCallMethO.proto (used by PyObjectFastCall) */
2799#if CYTHON_COMPILING_IN_CPYTHON
2800static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
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);
2807/* PyObjectCallOneArg.proto (used by CallUnboundCMethod0) */
2808static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2810/* UnpackUnboundCMethod_decl.proto (used by UnpackUnboundCMethod) */
2813 PyObject **method_name;
2817#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
2818 __pyx_atomic_int_type initialized;
2820} __Pyx_CachedCFunction;
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)
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)
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)
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);
2843#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2846/* UnpackUnboundCMethod_impl.export */
2847static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target);
2849/* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */
2850#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
2851static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
2855 __pyx_nonatomic_int_type expected = 0;
2856 if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
2862static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
2864 __pyx_atomic_store(&cfunc->initialized, 2);
2868#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
2869#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
2872/* CallUnboundCMethod0.proto */
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);
2878#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
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);
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);
2892static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
2895/* RaiseDoubleKeywords.proto (used by ParseKeywordsImpl) */
2896static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
2898/* ParseKeywordsImpl.export */
2899static int __Pyx_ParseKeywordsTuple(
2901 PyObject * const *kwvalues,
2902 PyObject ** const argnames[],
2905 Py_ssize_t num_pos_args,
2906 Py_ssize_t num_kwargs,
2907 const char* function_name,
2908 int ignore_unknown_kwargs
2910static int __Pyx_ParseKeywordDictToDict(
2912 PyObject ** const argnames[],
2915 Py_ssize_t num_pos_args,
2916 const char* function_name
2918static int __Pyx_ParseKeywordDict(
2920 PyObject ** const argnames[],
2922 Py_ssize_t num_pos_args,
2923 Py_ssize_t num_kwargs,
2924 const char* function_name,
2925 int ignore_unknown_kwargs
2928/* CallUnboundCMethod2.proto */
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);
2934#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
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
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);
2950/* ArgTypeTestError.export */
2951static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2953/* ArgTypeTest.proto */
2954static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, const char *name, int exact);
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)
2964#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
2965#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
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()
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))
2986#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
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)
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);
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);
3009#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
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);
3016#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
3019/* PyObjectGetAttrStrNoError.proto (used by GetBuiltinName) */
3020static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
3022/* GetBuiltinName.proto */
3023static PyObject *__Pyx_GetBuiltinName(PyObject *name);
3025/* PyObjectFastCallMethod.proto */
3026#if CYTHON_VECTORCALL
3027#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL)
3029static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf);
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)
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))
3054static void __Pyx_RaiseErrorWithType1(PyObject* exc_type, const char* message, const char *arg, PyTypeObject *type_obj);
3056/* RaiseUnexpectedTypeError.proto */
3058static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);
3060/* PyMemoryError_Check.proto */
3061#define __Pyx_PyExc_MemoryError_Check(obj) __Pyx_TypeCheck(obj, PyExc_MemoryError)
3063/* RaiseException.export */
3064static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
3066/* PyValueError_Check.proto */
3067#define __Pyx_PyExc_ValueError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ValueError)
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);
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);
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
3082/* IncludeStdlibH.proto (used by CIntToPyUnicode) */
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)\
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);
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)\
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);
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)
3107/* JoinPyUnicode.export */
3108static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, int kind);
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)\
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)\
3125static CYTHON_INLINE int __Pyx__PyUnicode_EqualsUCS4(PyObject* s1, Py_UCS4 ch2, int equals);
3128/* UnicodeEquals_uchar.proto */
3129#define __Pyx_PyObject_Equals_obj_ch99(s1, s2, equals) __Pyx_PyObject_Equals_uchar(s1, s2, 99, equals, 0)
3131/* PyObjectCompare.proto */
3132static CYTHON_INLINE int __Pyx_PyObject_CompareBoolEq_object_str(PyObject *op1, PyObject *op2, int pyop);
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))
3146 #define __Pyx_PyObject_FormatSimple(s, f) (\
3147 likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
3148 PyObject_Format(s, f))
3151/* PyObjectCompare.proto */
3152static CYTHON_INLINE PyObject* __Pyx_PyObject_CompareEq_object_bytes(PyObject *op1, PyObject *op2, int pyop);
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)
3158static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
3160static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
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);
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);
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)
3188#define __Pyx_PyFrozenDict_TypePtr (&PyDict_Type)
3189static CYTHON_INLINE PyObject* __Pyx_PyFrozenDict_New(PyObject* it) {
3191 return PyDict_New();
3192 } else if (PyDict_Check(it)) {
3193 return PyDict_Copy(it);
3195 PyObject *dict = PyDict_New();
3196 if (!dict) return NULL;
3197 PyObject *result = PyNumber_InPlaceOr(dict, it);
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)
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);
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))
3234static void __Pyx_RaiseErrorWithType(PyObject* exc_type, const char* message, PyTypeObject *type_obj);
3236/* ObjectGetItem.proto */
3237#if CYTHON_USE_TYPE_SLOTS
3238static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
3240#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
3243/* RejectKeywords.export */
3244static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds);
3246/* PyTypeError_Check.proto */
3247#define __Pyx_PyExc_TypeError_Check(obj) __Pyx_TypeCheck(obj, PyExc_TypeError)
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);
3252/* UnaryNegOverflows.proto */
3253#define __Pyx_UNARY_NEG_WOULD_OVERFLOW(x)\
3254 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
3257static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
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);\
3272 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
3273 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
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);
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);
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);\
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);\
3299static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
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);
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")))
3313 static int __Pyx_init_assertions_enabled(void) {
3314 PyObject *builtins, *debug, *debug_str;
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);
3325 if (flag == -1) goto bad;
3326 __pyx_assertions_enabled_flag = flag;
3329 __pyx_assertions_enabled_flag = 1;
3333 #define __Pyx_init_assertions_enabled() (0)
3334 #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
3337/* PyAssertionError_Check.proto */
3338#define __Pyx_PyExc_AssertionError_Check(obj) __Pyx_TypeCheck(obj, PyExc_AssertionError)
3340/* RaiseTooManyValuesToUnpack.proto */
3341static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
3343/* RaiseNeedMoreValuesToUnpack.proto */
3344static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
3346/* RaiseNoneIterError.proto */
3347static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
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);
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);
3361#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
3362#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
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)
3370static void __Pyx_RaiseErrorWithTypes1(PyObject* exc_type, const char *message, const char *arg, PyTypeObject *type_obj1, PyTypeObject *type_obj2);
3372/* ExtTypeTest.proto */
3373static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
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);
3380static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
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);
3388static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
3391/* HasAttr.proto (used by ImportImpl) */
3392#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
3393#define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n)
3395static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
3398/* TupleOrListFromArrayImpl.proto (used by ListFromArray) */
3399CYTHON_UNUSED static PyObject *
3400__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
3402/* ListFromArray.proto (used by ImportImpl) */
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);
3409static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level);
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);
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
3420static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul);
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)
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);
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);
3437/* PyObjectFormat.proto */
3438#if CYTHON_USE_UNICODE_WRITER
3439static PyObject* __Pyx_PyObject_Format(PyObject* s, PyObject* f);
3441#define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f)
3444/* PyObject_Unicode.proto */
3445#define __Pyx_PyObject_Unicode(obj)\
3446 (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
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);
3457/* RaiseUnboundLocalError.proto */
3458static void __Pyx_RaiseUnboundLocalError(const char *varname);
3460/* DivInt[long].proto */
3461static CYTHON_INLINE long __Pyx_div_long(long, long, int b_is_constant);
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);
3467#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
3470/* PyObjectCallMethod1.proto (used by StringJoin) */
3471static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
3473/* StringJoin.proto */
3474static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
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)\
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);
3485/* PyException_Check.proto */
3486#define __Pyx_PyExc_Exception_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
3488/* PyImportError_Check.proto */
3489#define __Pyx_PyExc_ImportError_Check(obj) __Pyx_TypeCheck(obj, PyExc_ImportError)
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);
3495#define __Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
3496 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
3499/* AllocateExtensionType.proto */
3500static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final);
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);
3508/* CallNewInitFromVectorcall.proto */
3509#if CYTHON_VECTORCALL_TPNEW
3510static PyObject *__Pyx_CallNewInitFromVectorcall(PyTypeObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames);
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);\
3520#define __Pyx_DeallocKeepAliveEnd(o)\
3521 _Py_atomic_store_uint32_relaxed(&(o)->ob_ref_local, 0)
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)
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);
3533/* CallTypeTraverse.proto */
3534#if !CYTHON_USE_TYPE_SPECS
3535#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
3537static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg);
3540/* DefaultPlacementNew.proto */
3543void __Pyx_default_placement_construct(T* x) {
3544 new (static_cast<void*>(x)) T();
3547/* ApplySequenceOrMappingFlag.proto */
3548#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
3549int __Pyx_ApplySequenceOrMappingFlag(PyTypeObject *tp, int is_sequence);
3551#define __Pyx_ApplySequenceOrMappingFlag(tp, is_sequence) (0)
3554/* PyObjectCallMethod0.proto (used by PyType_Ready) */
3555static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
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);
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);
3567/* PyType_Ready.export */
3568CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);
3570/* GetVTable.proto (used by MergeVTables) */
3571static int __Pyx_GetVtable(PyTypeObject *type, void** table);
3573/* MergeVTables.proto (used by SetVTable) */
3574static int __Pyx_MergeVtables(PyTypeObject *type);
3576/* SetVTable.export */
3577static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);
3579/* LimitedApiGetTypeTypeDict.proto (used by DelItemOnTypeDict) */
3580#if CYTHON_COMPILING_IN_LIMITED_API
3581static PyObject *__Pyx_GetTypeTypeDict(PyTypeObject *tp);
3584/* DelItemOnTypeDict.proto (used by SetupReduce) */
3585#define __Pyx_DelItemOnTypeDict(tp, k) __Pyx__DelItemOnTypeDict((PyTypeObject*)tp, k)
3587/* DelItemOnTypeDict.export */
3588static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k);
3590/* SetItemOnTypeDict.proto (used by SetupReduce) */
3591#define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)
3593/* SetItemOnTypeDict.export */
3594static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v);
3596/* SetupReduce.export */
3597static int __Pyx_setup_reduce(PyObject* type_obj);
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>
3605#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
3606#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) alignof(s)
3608#define __PYX_GET_STRUCT_ALIGNMENT_3_3_0(s) sizeof(void*)
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
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);
3618/* ImportFrom.export */
3619static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
3621/* dict_setdefault.proto (used by FetchCommonType) */
3622static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);
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);
3629 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
3632/* FetchSharedCythonModule.proto (used by FetchCommonType) */
3633static PyObject *__Pyx_FetchSharedCythonABIModule(void);
3635/* VerifyCachedType.proto (used by FetchCommonType) */
3636static int __Pyx_VerifyCachedType(PyObject *cached_type,
3638 Py_ssize_t expected_basicsize);
3640/* FetchCommonType.proto (used by CommonTypesMetaclass) */
3641static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);
3643/* CommonTypesMetaclass.proto (used by CythonFunctionShared) */
3644static int __pyx_CommonTypesMetaclass_init(PyObject *module);
3645#define __Pyx_CommonTypesMetaclass_USED
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))
3652#define __Pyx_as_CyFunctionObject(o) ((__pyx_CyFunctionObject *)o)
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)
3664 #define __Pyx__CyFunction_GetClassObj(f)\
3665 ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
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)
3676#if CYTHON_COMPILING_IN_LIMITED_API
3677#if !CYTHON_OPAQUE_OBJECTS
3680 PyMethodDef *func_methoddef;
3681 PyObject *func_module;
3683 PyCMethodObject func;
3685#if (CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY) && CYTHON_VECTORCALL
3686 __pyx_vectorcallfunc func_vectorcall;
3688#if CYTHON_COMPILING_IN_LIMITED_API
3689 PyObject *func_weakreflist;
3691#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
3692 PyObject *func_dict;
3694 PyObject *func_name;
3695 PyObject *func_qualname;
3697 PyObject *func_globals;
3698 PyObject *func_code;
3699 PyObject *func_closure;
3700#if CYTHON_COMPILING_IN_LIMITED_API
3701 PyObject *func_classobj;
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;
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,
3725static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
3727static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
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)
3734#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
3738/* PyMethodNew.proto (used by CythonFunctionShared) */
3739static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);
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);
3746/* CythonFunctionShared.proto (used by CythonFunction) */
3747static PyObject *__Pyx_CyFunction_Init(PyObject *op_in, PyMethodDef *ml,
3748 int flags, PyObject* qualname,
3750 PyObject *module, PyObject *globals,
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);
3759/* CythonFunction.export */
3760static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
3761 int flags, PyObject* qualname,
3763 PyObject *module, PyObject *globals,
3765static PyTypeObject *__Pyx_Get_CyFunction_Type(void);
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);
3771#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
3774/* CodeObjectCache.proto (used by AddTraceback) */
3775#if CYTHON_COMPILING_IN_LIMITED_API
3776typedef PyObject __Pyx_CachedCodeObjectType;
3778typedef PyCodeObject __Pyx_CachedCodeObjectType;
3781 __Pyx_CachedCodeObjectType* code_object;
3783} __Pyx_CodeObjectCacheEntry;
3784struct __Pyx_CodeObjectCache {
3787 __Pyx_CodeObjectCacheEntry* entries;
3788 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
3789 __pyx_atomic_int_type accessor_count;
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);
3796/* AddTraceback.proto */
3797static void __Pyx_AddTraceback(const char *funcname, int c_line,
3798 int py_line, const char *filename);
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);
3807 #define __Pyx_CREAL(z) ((z).real())
3808 #define __Pyx_CIMAG(z) ((z).imag())
3810 #define __Pyx_CREAL(z) (__real__(z))
3811 #define __Pyx_CIMAG(z) (__imag__(z))
3814 #define __Pyx_CREAL(z) ((z).real)
3815 #define __Pyx_CIMAG(z) ((z).imag)
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))
3822 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
3823 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
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))
3835 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
3836 #define __Pyx_c_conj_float(z) (::std::conj(z))
3838 #define __Pyx_c_abs_float(z) (::std::abs(z))
3839 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
3842 #define __Pyx_c_is_zero_float(z) ((z)==0)
3843 #define __Pyx_c_conj_float(z) (conjf(z))
3845 #define __Pyx_c_abs_float(z) (cabsf(z))
3846 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
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);
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);
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))
3873 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
3874 #define __Pyx_c_conj_double(z) (::std::conj(z))
3876 #define __Pyx_c_abs_double(z) (::std::abs(z))
3877 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
3880 #define __Pyx_c_is_zero_double(z) ((z)==0)
3881 #define __Pyx_c_conj_double(z) (conj(z))
3883 #define __Pyx_c_abs_double(z) (cabs(z))
3884 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
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);
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);
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))
3911 #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
3912 #define __Pyx_c_conj_long__double(z) (::std::conj(z))
3914 #define __Pyx_c_abs_long__double(z) (::std::abs(z))
3915 #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b))
3918 #define __Pyx_c_is_zero_long__double(z) ((z)==0)
3919 #define __Pyx_c_conj_long__double(z) (conjl(z))
3921 #define __Pyx_c_abs_long__double(z) (cabsl(z))
3922 #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b))
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);
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);
3940/* BufferStructDeclare.proto */
3942 Py_ssize_t shape, strides, suboffsets;
3949 __Pyx_Buffer *rcbuffer;
3951 __Pyx_Buf_DimInfo diminfo[8];
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);
3965/* MemviewSliceIsContig.proto */
3966static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
3968/* OverlappingSlices.proto */
3969static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
3970 __Pyx_memviewslice *slice2,
3971 int ndim, size_t itemsize);
3973/* MemviewSliceInit.proto */
3974static int __Pyx_init_memviewslice(
3975 struct __pyx_memoryview_obj *memview,
3977 __Pyx_memviewslice *memviewslice,
3978 int memview_is_new_reference);
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,
3989/* CIntFromPy.proto */
3990static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *);
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);
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);
4002/* PyObjectVectorcallMethodKwds.proto (used by CIntToPy) */
4003#if CYTHON_VECTORCALL
4004#define __Pyx_Object_VectorcallMethodKwds PyObject_VectorcallMethod
4006static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames);
4010static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value);
4012/* TypeInfoToFormat.proto */
4013struct __pyx_typeinfo_string {
4016static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(const __Pyx_TypeInfo *type);
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);
4025/* UpdateUnpickledDict.export */
4026static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index);
4028/* CheckUnpickleChecksumError.export */
4029static void __Pyx_RaiseUnpickleChecksumError(long checksum, long checksum1, long checksum2, long checksum3, const char *members);
4031/* CheckUnpickleChecksum.proto */
4032static CYTHON_INLINE int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members);
4034/* CIntFromPy.proto */
4035static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *);
4038static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value);
4040/* CIntFromPy.proto */
4041static CYTHON_INLINE char __Pyx_PyLong_As_char(PyObject *);
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);
4048#define __Pyx_init_runtime_version()
4050static unsigned long __Pyx_get_runtime_version(void);
4052/* CheckBinaryVersion.proto */
4053static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
4055/* DecompressString.proto */
4056static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo);
4058/* DecompressString_LZSS.proto */
4059static PyObject *__Pyx_DecompressString_LZSS(const char *s, size_t compressed_length, size_t uncompressed_length);
4061/* MultiPhaseInitModuleState.proto */
4062#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
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
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"
4079 #define __PYX_VECTORCALL_ABI_SUFFIX
4081 #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_VECTORCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
4083 #define __PYX_LIMITED_ABI_SUFFIX
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"
4090 #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
4092#ifndef __PYX_MONITORING_ABI_SUFFIX
4093 #define __PYX_MONITORING_ABI_SUFFIX
4095#if CYTHON_USE_TP_FINALIZE
4096 #define __PYX_TP_FINALIZE_ABI_SUFFIX
4098 #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
4100#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
4101 #define __PYX_FREELISTS_ABI_SUFFIX
4103 #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
4105#if CYTHON_OPAQUE_OBJECTS && CYTHON_COMPILING_IN_LIMITED_API
4106 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX "opaque"
4108 #define __PYX_OPAQUE_OBJECTS_ABI_SUFFIX
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 "."
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*/
4163/* Module declarations from "libc.string" */
4165/* Module declarations from "libc.stdio" */
4167/* Module declarations from "__builtin__" */
4169/* Module declarations from "cpython.type" */
4171/* Module declarations from "cpython" */
4173/* Module declarations from "cpython.object" */
4175/* Module declarations from "cpython.ref" */
4177/* Module declarations from "numpy" */
4179/* Module declarations from "numpy" */
4181/* Module declarations from "mpi4py.libmpi" */
4183/* Module declarations from "mpi4py.MPI" */
4185/* Module declarations from "libcpp" */
4187/* Module declarations from "mesh" */
4189/* Module declarations from "proteus" */
4191/* Module declarations from "proteus.cmeshTools" */
4193/* Module declarations from "proteus.partitioning" */
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;
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
4325 PyObject *a, PyObject *k
4328static PyObject *__pyx_tp_new_vectorcall_array(PyTypeObject *t,
4329#if CYTHON_VECTORCALL_TPNEW
4330 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4332 PyObject *a, PyObject *k
4335#if CYTHON_VECTORCALL_TPNEW
4336static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4338#if !CYTHON_VECTORCALL_TPNEW
4339#define __pyx_tp_new_array __pyx_tp_new_vectorcall_array
4341#if CYTHON_VECTORCALL_TPNEW
4342static PyObject *__pyx_tp_vectorcall_array(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
4344static PyObject *__pyx_tp_new__initialisation_Enum(PyObject *o,
4345#if CYTHON_VECTORCALL_TPNEW
4346 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4348 PyObject *a, PyObject *k
4351static PyObject *__pyx_tp_new_vectorcall_Enum(PyTypeObject *t,
4352#if CYTHON_VECTORCALL_TPNEW
4353 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4355 PyObject *a, PyObject *k
4358#if CYTHON_VECTORCALL_TPNEW
4359static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4361#if !CYTHON_VECTORCALL_TPNEW
4362#define __pyx_tp_new_Enum __pyx_tp_new_vectorcall_Enum
4364#if CYTHON_VECTORCALL_TPNEW
4365static PyObject *__pyx_tp_vectorcall_Enum(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
4367#if CYTHON_VECTORCALL_TPNEW
4368static int __pyx_tp_init_Enum(PyObject *o, PyObject *args, PyObject *kwds); /*proto*/
4370#if !CYTHON_VECTORCALL_TPNEW
4371#define __pyx_tp_init_Enum __pyx_MemviewEnum___init__
4373static PyObject *__pyx_tp_new__initialisation_memoryview(PyObject *o,
4374#if CYTHON_VECTORCALL_TPNEW
4375 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4377 PyObject *a, PyObject *k
4380static PyObject *__pyx_tp_new_vectorcall_memoryview(PyTypeObject *t,
4381#if CYTHON_VECTORCALL_TPNEW
4382 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4384 PyObject *a, PyObject *k
4387#if CYTHON_VECTORCALL_TPNEW
4388static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4390#if !CYTHON_VECTORCALL_TPNEW
4391#define __pyx_tp_new_memoryview __pyx_tp_new_vectorcall_memoryview
4393#if CYTHON_VECTORCALL_TPNEW
4394static PyObject *__pyx_tp_vectorcall_memoryview(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
4396static PyObject *__pyx_tp_new__initialisation__memoryviewslice(PyObject *o,
4397#if CYTHON_VECTORCALL_TPNEW
4398 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4400 PyObject *a, PyObject *k
4403static PyObject *__pyx_tp_new_vectorcall__memoryviewslice(PyTypeObject *t,
4404#if CYTHON_VECTORCALL_TPNEW
4405 PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames
4407 PyObject *a, PyObject *k
4410#if CYTHON_VECTORCALL_TPNEW
4411static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
4413#if !CYTHON_VECTORCALL_TPNEW
4414#define __pyx_tp_new__memoryviewslice __pyx_tp_new_vectorcall__memoryviewslice
4416#if CYTHON_VECTORCALL_TPNEW
4417static PyObject *__pyx_tp_vectorcall__memoryviewslice(PyObject *t, PyObject *const *args, size_t nargsf, PyObject *kwnames); /*proto*/
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))
4428 #define CYTHON_SMALL_CODE
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;
4521/* CommonTypesMetaclass.module_state_decls */
4522PyTypeObject *__pyx_CommonTypesMetaclassType;
4524/* CachedMethodType.module_state_decls */
4525#if CYTHON_COMPILING_IN_LIMITED_API
4526PyObject *__Pyx_CachedMethodType;
4529/* CythonFunctionPerModule.module_state_decls */
4530PyTypeObject *__pyx_CyFunctionType;
4532/* CodeObjectCache.module_state_decls */
4533struct __Pyx_CodeObjectCache __pyx_code_cache;
4535/* #### Code section: module_state_end ### */
4538} /* anonymous namespace */
4541#if CYTHON_USE_MODULE_STATE
4544extern struct PyModuleDef __pyx_moduledef;
4545} /* anonymous namespace */
4547static struct PyModuleDef __pyx_moduledef;
4550#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))
4552#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
4554static __pyx_mstatetype __pyx_mstate_global_static =
4560static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static;
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);
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);
4815/* CythonFunctionPerModule.module_state_clear */
4816Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
4818/* #### Code section: module_state_clear_end ### */
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);
4910/* CythonFunctionPerModule.module_state_traverse */
4911Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
4913/* #### Code section: module_state_traverse_end ### */
4917/* #### Code section: module_code ### */
4919/* "View.MemoryView":147
4920 * cdef bint dtype_is_object
4922 * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
4923 * mode="c", bint allocate_buffer=True):
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
4932PyObject *__pyx_args, PyObject *__pyx_kwds
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
4939PyObject *__pyx_args, PyObject *__pyx_kwds
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;
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;
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);
4962 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
4965 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
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) {
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)
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)
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)
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)
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)
4993 default: goto __pyx_L5_argtuple_error;
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) }
5002 switch (__pyx_nargs) {
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)
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)
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)
5019 default: goto __pyx_L5_argtuple_error;
5021 if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_c));
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];
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)
5031 /* "View.MemoryView":148
5033 * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
5034 * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
5038 __pyx_v_allocate_buffer = ((int)1);
5042 __pyx_L5_argtuple_error:;
5043 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, __pyx_nargs); __PYX_ERR(1, 147, __pyx_L3_error)
5045 goto __pyx_L4_argument_unpacking_done;
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]);
5050 __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5051 __Pyx_RefNannyFinishContext();
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)
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);
5060 /* "View.MemoryView":147
5061 * cdef bint dtype_is_object
5063 * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
5064 * mode="c", bint allocate_buffer=True):
5068 /* function exit code */
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]);
5075 goto __pyx_L7_cleaned_up;
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]);
5080 __pyx_L7_cleaned_up:;
5083 __Pyx_RefNannyFinishContext();
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) {
5089 Py_ssize_t __pyx_v_dim;
5092 __Pyx_RefNannyDeclarations
5093 Py_ssize_t __pyx_t_1;
5097 PyObject *__pyx_t_5 = NULL;
5098 PyObject *__pyx_t_6 = NULL;
5101 Py_ssize_t __pyx_t_9;
5102 PyObject *__pyx_t_10 = NULL;
5103 PyObject *__pyx_t_11[5];
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);
5112 /* "View.MemoryView":153
5113 * cdef Py_ssize_t dim
5115 * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
5116 * self.itemsize = itemsize
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)
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);
5127 /* "View.MemoryView":154
5129 * self.ndim = <int> len(shape)
5130 * self.itemsize = itemsize # <<<<<<<<<<<<<<
5132 * if cython.unlikely(not self.ndim):
5134 __pyx_v_self->itemsize = __pyx_v_itemsize;
5136 /* "View.MemoryView":156
5137 * self.itemsize = itemsize
5139 * if cython.unlikely(not self.ndim): # <<<<<<<<<<<<<<
5140 * _err_ValueError("Empty shape tuple for cython.array")
5143 __pyx_t_2 = (!(__pyx_v_self->ndim != 0));
5145 if (unlikely(__pyx_t_2)) {
5148 /* "View.MemoryView":157
5150 * if cython.unlikely(not self.ndim):
5151 * _err_ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
5153 * if cython.unlikely(itemsize <= 0):
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)
5158 /* "View.MemoryView":156
5159 * self.itemsize = itemsize
5161 * if cython.unlikely(not self.ndim): # <<<<<<<<<<<<<<
5162 * _err_ValueError("Empty shape tuple for cython.array")
5167 /* "View.MemoryView":159
5168 * _err_ValueError("Empty shape tuple for cython.array")
5170 * if cython.unlikely(itemsize <= 0): # <<<<<<<<<<<<<<
5171 * _err_ValueError("itemsize <= 0 for cython.array")
5174 __pyx_t_2 = (__pyx_v_itemsize <= 0);
5176 if (unlikely(__pyx_t_2)) {
5179 /* "View.MemoryView":160
5181 * if cython.unlikely(itemsize <= 0):
5182 * _err_ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
5184 * if not isinstance(format, bytes):
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)
5189 /* "View.MemoryView":159
5190 * _err_ValueError("Empty shape tuple for cython.array")
5192 * if cython.unlikely(itemsize <= 0): # <<<<<<<<<<<<<<
5193 * _err_ValueError("itemsize <= 0 for cython.array")
5198 /* "View.MemoryView":162
5199 * _err_ValueError("itemsize <= 0 for cython.array")
5201 * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
5202 * format = format.encode('ASCII')
5203 * self._format = format # keep a reference to the byte string
5205 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
5206 __pyx_t_4 = (!__pyx_t_2);
5212 /* "View.MemoryView":163
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
5219 __pyx_t_6 = __pyx_v_format;
5220 __Pyx_INCREF(__pyx_t_6);
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);
5229 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
5232 /* "View.MemoryView":162
5233 * _err_ValueError("itemsize <= 0 for cython.array")
5235 * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
5236 * format = format.encode('ASCII')
5237 * self._format = format # keep a reference to the byte string
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
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);
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 # <<<<<<<<<<<<<<
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)
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;
5271 /* "View.MemoryView":168
5274 * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t> self.ndim) # <<<<<<<<<<<<<<
5275 * self._strides = self._shape + self.ndim
5278 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_self->ndim))));
5280 /* "View.MemoryView":169
5282 * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t> self.ndim)
5283 * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
5285 * if not self._shape:
5287 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
5289 /* "View.MemoryView":171
5290 * self._strides = self._shape + self.ndim
5292 * if not self._shape: # <<<<<<<<<<<<<<
5293 * raise MemoryError, "unable to allocate shape and strides."
5296 __pyx_t_4 = (!(__pyx_v_self->_shape != 0));
5298 if (unlikely(__pyx_t_4)) {
5301 /* "View.MemoryView":172
5303 * if not self._shape:
5304 * raise MemoryError, "unable to allocate shape and strides." # <<<<<<<<<<<<<<
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)
5311 /* "View.MemoryView":171
5312 * self._strides = self._shape + self.ndim
5314 * if not self._shape: # <<<<<<<<<<<<<<
5315 * raise MemoryError, "unable to allocate shape and strides."
5320 /* "View.MemoryView":175
5323 * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
5325 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5329 __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5);
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)
5337 if (__pyx_t_1 >= __pyx_temp) break;
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));
5342 __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_5, __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);
5353 /* "View.MemoryView":176
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
5360 __pyx_t_4 = (__pyx_v_dim <= 0);
5362 if (unlikely(__pyx_t_4)) {
5365 /* "View.MemoryView":177
5366 * for idx, dim in enumerate(shape):
5368 * raise ValueError, f"Invalid shape in axis {idx}: {dim}." # <<<<<<<<<<<<<<
5369 * self._shape[idx] = dim
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;
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]);
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)
5395 /* "View.MemoryView":176
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
5404 /* "View.MemoryView":178
5406 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5407 * self._shape[idx] = dim # <<<<<<<<<<<<<<
5411 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
5413 /* "View.MemoryView":175
5416 * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
5418 * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5421 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5423 /* "View.MemoryView":181
5426 * if mode == 'c': # <<<<<<<<<<<<<<
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)
5434 /* "View.MemoryView":182
5437 * order = b'C' # <<<<<<<<<<<<<<
5439 * elif mode == 'fortran':
5441 __pyx_v_order = 'C';
5443 /* "View.MemoryView":183
5446 * self.mode = u'c' # <<<<<<<<<<<<<<
5447 * elif mode == 'fortran':
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;
5456 /* "View.MemoryView":181
5459 * if mode == 'c': # <<<<<<<<<<<<<<
5466 /* "View.MemoryView":184
5469 * elif mode == 'fortran': # <<<<<<<<<<<<<<
5471 * self.mode = u'fortran'
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)) {
5477 /* "View.MemoryView":185
5479 * elif mode == 'fortran':
5480 * order = b'F' # <<<<<<<<<<<<<<
5481 * self.mode = u'fortran'
5484 __pyx_v_order = 'F';
5486 /* "View.MemoryView":186
5487 * elif mode == 'fortran':
5489 * self.mode = u'fortran' # <<<<<<<<<<<<<<
5491 * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
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;
5499 /* "View.MemoryView":184
5502 * elif mode == 'fortran': # <<<<<<<<<<<<<<
5504 * self.mode = u'fortran'
5509 /* "View.MemoryView":188
5510 * self.mode = u'fortran'
5512 * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}" # <<<<<<<<<<<<<<
5514 * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
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)
5528 /* "View.MemoryView":190
5529 * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
5531 * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order) # <<<<<<<<<<<<<<
5533 * self.free_data = allocate_buffer
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);
5537 /* "View.MemoryView":192
5538 * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
5540 * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
5541 * self.dtype_is_object = format == b'O'
5544 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
5546 /* "View.MemoryView":193
5548 * self.free_data = allocate_buffer
5549 * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
5551 * if allocate_buffer:
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;
5558 /* "View.MemoryView":195
5559 * self.dtype_is_object = format == b'O'
5561 * if allocate_buffer: # <<<<<<<<<<<<<<
5562 * _allocate_buffer(self)
5565 if (__pyx_v_allocate_buffer) {
5567 /* "View.MemoryView":196
5569 * if allocate_buffer:
5570 * _allocate_buffer(self) # <<<<<<<<<<<<<<
5572 * @cname('getbuffer')
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)
5577 /* "View.MemoryView":195
5578 * self.dtype_is_object = format == b'O'
5580 * if allocate_buffer: # <<<<<<<<<<<<<<
5581 * _allocate_buffer(self)
5586 /* "View.MemoryView":147
5587 * cdef bint dtype_is_object
5589 * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
5590 * mode="c", bint allocate_buffer=True):
5594 /* function exit code */
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);
5608 __Pyx_XDECREF(__pyx_v_format);
5610 __Pyx_RefNannyFinishContext();
5614/* "View.MemoryView":198
5615 * _allocate_buffer(self)
5617 * @cname('getbuffer') # <<<<<<<<<<<<<<
5618 * def __getbuffer__(self, Py_buffer *info, int flags):
5619 * cdef int bufmode = -1
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;
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));
5632 /* function exit code */
5635 __Pyx_RefNannyFinishContext();
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;
5642 __Pyx_RefNannyDeclarations
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");
5655 __Pyx_RefNannySetupContext("__getbuffer__", 0);
5656 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
5657 __Pyx_GIVEREF(__pyx_v_info->obj);
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":
5666 __pyx_v_bufmode = -1;
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
5675 __pyx_t_1 = ((__pyx_v_flags & ((PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS) | PyBUF_ANY_CONTIGUOUS)) != 0);
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":
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)
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
5698 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
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":
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)):
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)
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.")
5728 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
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)):
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
5747 __pyx_t_1 = (!((__pyx_v_flags & __pyx_v_bufmode) != 0));
5749 if (unlikely(__pyx_t_1)) {
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
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)
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
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
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
5787 __pyx_t_3 = __pyx_v_self->data;
5789 __pyx_v_info->buf = __pyx_t_3;
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 # <<<<<<<<<<<<<<
5796 * if flags & PyBUF_STRIDES:
5798 __pyx_t_4 = __pyx_v_self->len;
5800 __pyx_v_info->len = __pyx_t_4;
5802 /* "View.MemoryView":211
5803 * info.len = self.len
5805 * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
5806 * info.ndim = self.ndim
5807 * info.shape = self._shape
5809 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
5814 /* "View.MemoryView":212
5816 * if flags & PyBUF_STRIDES:
5817 * info.ndim = self.ndim # <<<<<<<<<<<<<<
5818 * info.shape = self._shape
5819 * info.strides = self._strides
5821 __pyx_t_2 = __pyx_v_self->ndim;
5823 __pyx_v_info->ndim = __pyx_t_2;
5825 /* "View.MemoryView":213
5826 * if flags & PyBUF_STRIDES:
5827 * info.ndim = self.ndim
5828 * info.shape = self._shape # <<<<<<<<<<<<<<
5829 * info.strides = self._strides
5832 __pyx_t_5 = __pyx_v_self->_shape;
5834 __pyx_v_info->shape = __pyx_t_5;
5836 /* "View.MemoryView":214
5837 * info.ndim = self.ndim
5838 * info.shape = self._shape
5839 * info.strides = self._strides # <<<<<<<<<<<<<<
5843 __pyx_t_5 = __pyx_v_self->_strides;
5845 __pyx_v_info->strides = __pyx_t_5;
5847 /* "View.MemoryView":211
5848 * info.len = self.len
5850 * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
5851 * info.ndim = self.ndim
5852 * info.shape = self._shape
5857 /* "View.MemoryView":216
5858 * info.strides = self._strides
5860 * info.ndim = 1 # <<<<<<<<<<<<<<
5861 * info.shape = &self.len if flags & PyBUF_ND else NULL
5862 * info.strides = NULL
5865 __pyx_v_info->ndim = 1;
5867 /* "View.MemoryView":217
5870 * info.shape = &self.len if flags & PyBUF_ND else NULL # <<<<<<<<<<<<<<
5871 * info.strides = NULL
5874 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
5878 __pyx_t_5 = (&__pyx_v_self->len);
5884 __pyx_v_info->shape = __pyx_t_5;
5886 /* "View.MemoryView":218
5888 * info.shape = &self.len if flags & PyBUF_ND else NULL
5889 * info.strides = NULL # <<<<<<<<<<<<<<
5891 * info.suboffsets = NULL
5893 __pyx_v_info->strides = NULL;
5897 /* "View.MemoryView":220
5898 * info.strides = NULL
5900 * info.suboffsets = NULL # <<<<<<<<<<<<<<
5901 * info.itemsize = self.itemsize
5904 __pyx_v_info->suboffsets = NULL;
5906 /* "View.MemoryView":221
5908 * info.suboffsets = NULL
5909 * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
5911 * info.format = self.format if flags & PyBUF_FORMAT else NULL
5913 __pyx_t_4 = __pyx_v_self->itemsize;
5915 __pyx_v_info->itemsize = __pyx_t_4;
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
5924 __pyx_v_info->readonly = 0;
5926 /* "View.MemoryView":223
5927 * info.itemsize = self.itemsize
5929 * info.format = self.format if flags & PyBUF_FORMAT else NULL # <<<<<<<<<<<<<<
5933 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
5937 __pyx_t_3 = __pyx_v_self->format;
5943 __pyx_v_info->format = __pyx_t_3;
5945 /* "View.MemoryView":224
5947 * info.format = self.format if flags & PyBUF_FORMAT else NULL
5948 * info.obj = self # <<<<<<<<<<<<<<
5950 * def __dealloc__(array self):
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);
5958 /* "View.MemoryView":198
5959 * _allocate_buffer(self)
5961 * @cname('getbuffer') # <<<<<<<<<<<<<<
5962 * def __getbuffer__(self, Py_buffer *info, int flags):
5963 * cdef int bufmode = -1
5966 /* function exit code */
5970 __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
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;
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;
5985 __Pyx_RefNannyFinishContext();
5989/* "View.MemoryView":226
5992 * def __dealloc__(array self): # <<<<<<<<<<<<<<
5993 * if self.callback_free_data != NULL:
5994 * self.callback_free_data(self.data)
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));
6006 /* function exit code */
6007 __Pyx_RefNannyFinishContext();
6010static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
6014 /* "View.MemoryView":227
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:
6021 __pyx_t_1 = (__pyx_v_self->callback_free_data != NULL);
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:
6033 __pyx_v_self->callback_free_data(__pyx_v_self->data);
6035 /* "View.MemoryView":227
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:
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)
6052 if (__pyx_v_self->free_data) {
6055 __pyx_t_1 = __pyx_v_self->free_data;
6056 goto __pyx_L4_bool_binop_done;
6058 __pyx_t_2 = (__pyx_v_self->data != NULL);
6061 __pyx_t_1 = __pyx_t_2;
6063 __pyx_L4_bool_binop_done:;
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)
6074 if (__pyx_v_self->dtype_is_object) {
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) # <<<<<<<<<<<<<<
6081 * PyObject_Free(self._shape)
6083 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
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)
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)
6101 free(__pyx_v_self->data);
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)
6113 /* "View.MemoryView":233
6114 * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6116 * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
6120 PyObject_Free(__pyx_v_self->_shape);
6122 /* "View.MemoryView":226
6125 * def __dealloc__(array self): # <<<<<<<<<<<<<<
6126 * if self.callback_free_data != NULL:
6127 * self.callback_free_data(self.data)
6130 /* function exit code */
6134/* "View.MemoryView":235
6135 * PyObject_Free(self._shape)
6137 * @property # <<<<<<<<<<<<<<
6138 * def memview(self):
6139 * return array.get_memview(self)
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));
6152 /* function exit code */
6153 __Pyx_RefNannyFinishContext();
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);
6166 /* "View.MemoryView":237
6168 * def memview(self):
6169 * return array.get_memview(self) # <<<<<<<<<<<<<<
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);
6176 PyObject *__pyx_temp;
6178 __pyx_temp = __pyx_r;
6179 __pyx_r = __pyx_t_1;
6181 __Pyx_XDECREF(__pyx_temp);
6186 /* "View.MemoryView":235
6187 * PyObject_Free(self._shape)
6189 * @property # <<<<<<<<<<<<<<
6190 * def memview(self):
6191 * return array.get_memview(self)
6194 /* function exit code */
6196 __Pyx_XDECREF(__pyx_t_1);
6197 __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6200 __Pyx_XGIVEREF(__pyx_r);
6201 __Pyx_RefNannyFinishContext();
6205/* "View.MemoryView":240
6208 * @cname('get_memview') # <<<<<<<<<<<<<<
6209 * cdef get_memview(self):
6210 * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
6213static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
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;
6222 int __pyx_lineno = 0;
6223 const char *__pyx_filename = NULL;
6224 int __pyx_clineno = 0;
6225 __Pyx_RefNannySetupContext("get_memview", 0);
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)
6234 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
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) # <<<<<<<<<<<<<<
6241 * def __len__(self):
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);
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);
6259 PyObject *__pyx_temp;
6261 __pyx_temp = __pyx_r;
6262 __pyx_r = ((PyObject *)__pyx_t_1);
6264 __Pyx_XDECREF(__pyx_temp);
6269 /* "View.MemoryView":240
6272 * @cname('get_memview') # <<<<<<<<<<<<<<
6273 * cdef get_memview(self):
6274 * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
6277 /* function exit code */
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);
6287 __Pyx_XGIVEREF(__pyx_r);
6288 __Pyx_RefNannyFinishContext();
6292/* "View.MemoryView":245
6293 * return memoryview(self, flags, self.dtype_is_object)
6295 * def __len__(self): # <<<<<<<<<<<<<<
6296 * return self._shape[0]
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;
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));
6310 /* function exit code */
6311 __Pyx_RefNannyFinishContext();
6315static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
6318 /* "View.MemoryView":246
6320 * def __len__(self):
6321 * return self._shape[0] # <<<<<<<<<<<<<<
6323 * def __getattr__(self, attr):
6327 __pyx_r = (__pyx_v_self->_shape[0]);
6331 /* "View.MemoryView":245
6332 * return memoryview(self, flags, self.dtype_is_object)
6334 * def __len__(self): # <<<<<<<<<<<<<<
6335 * return self._shape[0]
6339 /* function exit code */
6345/* "View.MemoryView":248
6346 * return self._shape[0]
6348 * def __getattr__(self, attr): # <<<<<<<<<<<<<<
6349 * return getattr(self.memview, attr)
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));
6363 /* function exit code */
6364 __Pyx_RefNannyFinishContext();
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);
6378 /* "View.MemoryView":249
6380 * def __getattr__(self, attr):
6381 * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
6383 * def __getitem__(self, item):
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;
6391 PyObject *__pyx_temp;
6393 __pyx_temp = __pyx_r;
6394 __pyx_r = __pyx_t_2;
6396 __Pyx_XDECREF(__pyx_temp);
6401 /* "View.MemoryView":248
6402 * return self._shape[0]
6404 * def __getattr__(self, attr): # <<<<<<<<<<<<<<
6405 * return getattr(self.memview, attr)
6409 /* function exit code */
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);
6416 __Pyx_XGIVEREF(__pyx_r);
6417 __Pyx_RefNannyFinishContext();
6421/* "View.MemoryView":251
6422 * return getattr(self.memview, attr)
6424 * def __getitem__(self, item): # <<<<<<<<<<<<<<
6425 * return self.memview[item]
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));
6439 /* function exit code */
6440 __Pyx_RefNannyFinishContext();
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);
6454 /* "View.MemoryView":252
6456 * def __getitem__(self, item):
6457 * return self.memview[item] # <<<<<<<<<<<<<<
6459 * def __setitem__(self, item, value):
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;
6467 PyObject *__pyx_temp;
6469 __pyx_temp = __pyx_r;
6470 __pyx_r = __pyx_t_2;
6472 __Pyx_XDECREF(__pyx_temp);
6477 /* "View.MemoryView":251
6478 * return getattr(self.memview, attr)
6480 * def __getitem__(self, item): # <<<<<<<<<<<<<<
6481 * return self.memview[item]
6485 /* function exit code */
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);
6492 __Pyx_XGIVEREF(__pyx_r);
6493 __Pyx_RefNannyFinishContext();
6497/* "View.MemoryView":254
6498 * return self.memview[item]
6500 * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
6501 * self.memview[item] = value
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;
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));
6515 /* function exit code */
6516 __Pyx_RefNannyFinishContext();
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) {
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);
6529 /* "View.MemoryView":255
6531 * def __setitem__(self, item, value):
6532 * self.memview[item] = value # <<<<<<<<<<<<<<
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;
6541 /* "View.MemoryView":254
6542 * return self.memview[item]
6544 * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
6545 * self.memview[item] = value
6549 /* function exit code */
6553 __Pyx_XDECREF(__pyx_t_1);
6554 __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6558 __Pyx_RefNannyFinishContext();
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):
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
6573PyObject *__pyx_args, PyObject *__pyx_kwds
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
6580PyObject *__pyx_args, PyObject *__pyx_kwds
6583 #if !CYTHON_VECTORCALL
6584 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
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);
6594 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
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));
6604 /* function exit code */
6605 __Pyx_RefNannyFinishContext();
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);
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__"
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)
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):
6632 /* function exit code */
6634 __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6636 __Pyx_XGIVEREF(__pyx_r);
6637 __Pyx_RefNannyFinishContext();
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__"
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
6653PyObject *__pyx_args, PyObject *__pyx_kwds
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
6660PyObject *__pyx_args, PyObject *__pyx_kwds
6663 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
6664 #if !CYTHON_VECTORCALL
6665 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
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);
6679 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6682 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
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) {
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)
6694 default: goto __pyx_L5_argtuple_error;
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) }
6701 } else if (unlikely(__pyx_nargs != 1)) {
6702 goto __pyx_L5_argtuple_error;
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)
6707 __pyx_v___pyx_state = values[0];
6710 __pyx_L5_argtuple_error:;
6711 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
6713 goto __pyx_L4_argument_unpacking_done;
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]);
6718 __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6719 __Pyx_RefNannyFinishContext();
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);
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]);
6728 __Pyx_RefNannyFinishContext();
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);
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__" # <<<<<<<<<<<<<<
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)
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__"
6755 /* function exit code */
6757 __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6759 __Pyx_XGIVEREF(__pyx_r);
6760 __Pyx_RefNannyFinishContext();
6764/* "View.MemoryView":264
6767 * @cname("__pyx_array_allocate_buffer") # <<<<<<<<<<<<<<
6768 * cdef int _allocate_buffer(array self) except -1:
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;
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;
6784 /* "View.MemoryView":271
6787 * self.free_data = True # <<<<<<<<<<<<<<
6788 * self.data = <char *>malloc(<size_t> self.len)
6791 __pyx_v_self->free_data = 1;
6793 /* "View.MemoryView":272
6795 * self.free_data = True
6796 * self.data = <char *>malloc(<size_t> self.len) # <<<<<<<<<<<<<<
6798 * raise MemoryError, "unable to allocate array data."
6800 __pyx_v_self->data = ((char *)malloc(((size_t)__pyx_v_self->len)));
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."
6809 __pyx_t_1 = (!(__pyx_v_self->data != 0));
6811 if (unlikely(__pyx_t_1)) {
6814 /* "View.MemoryView":274
6815 * self.data = <char *>malloc(<size_t> self.len)
6817 * raise MemoryError, "unable to allocate array data." # <<<<<<<<<<<<<<
6819 * if self.dtype_is_object:
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)
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."
6833 /* "View.MemoryView":276
6834 * raise MemoryError, "unable to allocate array data."
6836 * if self.dtype_is_object: # <<<<<<<<<<<<<<
6837 * p = <PyObject **> self.data
6838 * for i in range(self.len // self.itemsize):
6840 if (__pyx_v_self->dtype_is_object) {
6842 /* "View.MemoryView":277
6844 * if self.dtype_is_object:
6845 * p = <PyObject **> self.data # <<<<<<<<<<<<<<
6846 * for i in range(self.len // self.itemsize):
6849 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
6851 /* "View.MemoryView":278
6852 * if self.dtype_is_object:
6853 * p = <PyObject **> self.data
6854 * for i in range(self.len // self.itemsize): # <<<<<<<<<<<<<<
6856 * Py_INCREF(Py_None)
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)
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)
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;
6870 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
6871 __pyx_v_i = __pyx_t_4;
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)
6880 (__pyx_v_p[__pyx_v_i]) = Py_None;
6882 /* "View.MemoryView":280
6883 * for i in range(self.len // self.itemsize):
6885 * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
6893 /* "View.MemoryView":276
6894 * raise MemoryError, "unable to allocate array data."
6896 * if self.dtype_is_object: # <<<<<<<<<<<<<<
6897 * p = <PyObject **> self.data
6898 * for i in range(self.len // self.itemsize):
6902 /* "View.MemoryView":281
6904 * Py_INCREF(Py_None)
6905 * return 0 # <<<<<<<<<<<<<<
6915 /* "View.MemoryView":264
6918 * @cname("__pyx_array_allocate_buffer") # <<<<<<<<<<<<<<
6919 * cdef int _allocate_buffer(array self) except -1:
6923 /* function exit code */
6925 __Pyx_AddTraceback("View.MemoryView._allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
6934/* "View.MemoryView":284
6937 * @cname("__pyx_array_new") # <<<<<<<<<<<<<<
6938 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
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;
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);
6956 /* "View.MemoryView":287
6957 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
6959 * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string. # <<<<<<<<<<<<<<
6963 __pyx_t_2 = ((__pyx_v_c_mode[0]) == 'f');
6966 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_fortran);
6967 __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_fortran;
6969 __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_c);
6970 __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_c;
6973 __pyx_v_mode = ((PyObject*)__pyx_t_1);
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.
6979 * if buf is NULL: # <<<<<<<<<<<<<<
6980 * result = array.__new__(array, shape, itemsize, format, mode)
6983 __pyx_t_2 = (__pyx_v_buf == NULL);
6988 /* "View.MemoryView":290
6991 * result = array.__new__(array, shape, itemsize, format, mode) # <<<<<<<<<<<<<<
6993 * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
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);
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);
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.
7022 * if buf is NULL: # <<<<<<<<<<<<<<
7023 * result = array.__new__(array, shape, itemsize, format, mode)
7029 /* "View.MemoryView":292
7030 * result = array.__new__(array, shape, itemsize, format, mode)
7032 * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False) # <<<<<<<<<<<<<<
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);
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);
7065 /* "View.MemoryView":293
7067 * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
7068 * result.data = buf # <<<<<<<<<<<<<<
7072 __pyx_v_result->data = __pyx_v_buf;
7076 /* "View.MemoryView":295
7079 * return result # <<<<<<<<<<<<<<
7084 struct __pyx_array_obj *__pyx_temp;
7086 __pyx_temp = __pyx_r;
7087 __Pyx_INCREF((PyObject *)__pyx_v_result);
7088 __pyx_r = __pyx_v_result;
7090 __Pyx_XDECREF((PyObject *)__pyx_temp);
7094 /* "View.MemoryView":284
7097 * @cname("__pyx_array_new") # <<<<<<<<<<<<<<
7098 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
7102 /* function exit code */
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);
7110 __Pyx_XDECREF((PyObject *)__pyx_v_result);
7111 __Pyx_XDECREF(__pyx_v_mode);
7112 __Pyx_XGIVEREF((PyObject *)__pyx_r);
7113 __Pyx_RefNannyFinishContext();
7117/* "View.MemoryView":321
7118 * cdef class Enum(object):
7120 * def __init__(self, name): # <<<<<<<<<<<<<<
7122 * def __repr__(self):
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
7130PyObject *__pyx_args, PyObject *__pyx_kwds
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
7137PyObject *__pyx_args, PyObject *__pyx_kwds
7140 PyObject *__pyx_v_name = 0;
7141 #if !CYTHON_VECTORCALL_TPNEW
7142 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
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;
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);
7156 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
7159 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
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) {
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)
7171 default: goto __pyx_L5_argtuple_error;
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) }
7178 } else if (unlikely(__pyx_nargs != 1)) {
7179 goto __pyx_L5_argtuple_error;
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)
7184 __pyx_v_name = values[0];
7187 __pyx_L5_argtuple_error:;
7188 __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 321, __pyx_L3_error)
7190 goto __pyx_L4_argument_unpacking_done;
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]);
7195 __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7196 __Pyx_RefNannyFinishContext();
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);
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]);
7205 __Pyx_RefNannyFinishContext();
7209static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
7211 __Pyx_RefNannyDeclarations
7212 __Pyx_RefNannySetupContext("__init__", 0);
7214 /* "View.MemoryView":322
7216 * def __init__(self, name):
7217 * self.name = name # <<<<<<<<<<<<<<
7218 * def __repr__(self):
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;
7227 /* "View.MemoryView":321
7228 * cdef class Enum(object):
7230 * def __init__(self, name): # <<<<<<<<<<<<<<
7232 * def __repr__(self):
7235 /* function exit code */
7238 __Pyx_RefNannyFinishContext();
7242/* "View.MemoryView":323
7243 * def __init__(self, name):
7245 * def __repr__(self): # <<<<<<<<<<<<<<
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));
7260 /* function exit code */
7261 __Pyx_RefNannyFinishContext();
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);
7270 /* "View.MemoryView":324
7272 * def __repr__(self):
7273 * return self.name # <<<<<<<<<<<<<<
7275 * cdef generic = Enum("<strided and direct or indirect>")
7278 PyObject *__pyx_temp;
7280 __pyx_temp = __pyx_r;
7281 __Pyx_INCREF(__pyx_v_self->name);
7282 __pyx_r = __pyx_v_self->name;
7284 __Pyx_XDECREF(__pyx_temp);
7288 /* "View.MemoryView":323
7289 * def __init__(self, name):
7291 * def __repr__(self): # <<<<<<<<<<<<<<
7296 /* function exit code */
7298 __Pyx_XGIVEREF(__pyx_r);
7299 __Pyx_RefNannyFinishContext();
7303/* "(tree fragment)":1
7304 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
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
7314PyObject *__pyx_args, PyObject *__pyx_kwds
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
7321PyObject *__pyx_args, PyObject *__pyx_kwds
7324 #if !CYTHON_VECTORCALL
7325 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
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);
7335 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
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));
7345 /* function exit code */
7346 __Pyx_RefNannyFinishContext();
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;
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);
7366 /* "(tree fragment)":5
7368 * cdef bint use_setstate
7369 * with CRITICAL_SECTION(self): # <<<<<<<<<<<<<<
7370 * state = (self.name,)
7371 * _dict = getattr(self, '__dict__', None)
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);
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:
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);
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:
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;
7408 /* "(tree fragment)":5
7410 * cdef bint use_setstate
7411 * with CRITICAL_SECTION(self): # <<<<<<<<<<<<<<
7412 * state = (self.name,)
7413 * _dict = getattr(self, '__dict__', None)
7417 __Pyx_PyCriticalSection_End(&__pyx_cs);
7421 __Pyx_PyCriticalSection_End(&__pyx_cs);
7422 goto __pyx_L1_error;
7426 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7429 /* "(tree fragment)":8
7430 * state = (self.name,)
7431 * _dict = getattr(self, '__dict__', None)
7432 * if _dict is not None and _dict: # <<<<<<<<<<<<<<
7434 * use_setstate = True
7436 __pyx_t_4 = (__pyx_v__dict != Py_None);
7441 __pyx_t_3 = __pyx_t_4;
7443 goto __pyx_L7_bool_binop_done;
7445 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v__dict); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 8, __pyx_L1_error)
7447 __pyx_t_3 = __pyx_t_4;
7449 __pyx_L7_bool_binop_done:;
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
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));
7471 /* "(tree fragment)":10
7472 * if _dict is not None and _dict:
7474 * use_setstate = True # <<<<<<<<<<<<<<
7476 * use_setstate = self.name is not None
7478 __pyx_v_use_setstate = 1;
7480 /* "(tree fragment)":8
7481 * state = (self.name,)
7482 * _dict = getattr(self, '__dict__', None)
7483 * if _dict is not None and _dict: # <<<<<<<<<<<<<<
7485 * use_setstate = True
7490 /* "(tree fragment)":12
7491 * use_setstate = True
7493 * use_setstate = self.name is not None # <<<<<<<<<<<<<<
7495 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7498 __pyx_t_3 = (__pyx_v_self->name != Py_None);
7499 __pyx_v_use_setstate = __pyx_t_3;
7503 /* "(tree fragment)":13
7505 * use_setstate = self.name is not None
7506 * if use_setstate: # <<<<<<<<<<<<<<
7507 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7510 if (__pyx_v_use_setstate) {
7512 /* "(tree fragment)":14
7513 * use_setstate = self.name is not None
7515 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state # <<<<<<<<<<<<<<
7517 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
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);
7544 PyObject *__pyx_temp;
7546 __pyx_temp = __pyx_r;
7547 __pyx_r = __pyx_t_5;
7549 __Pyx_XDECREF(__pyx_temp);
7554 /* "(tree fragment)":13
7556 * use_setstate = self.name is not None
7557 * if use_setstate: # <<<<<<<<<<<<<<
7558 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7563 /* "(tree fragment)":16
7564 * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
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)
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);
7593 PyObject *__pyx_temp;
7595 __pyx_temp = __pyx_r;
7596 __pyx_r = __pyx_t_2;
7598 __Pyx_XDECREF(__pyx_temp);
7604 /* "(tree fragment)":1
7605 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7610 /* function exit code */
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);
7618 __Pyx_XDECREF(__pyx_v_state);
7619 __Pyx_XDECREF(__pyx_v__dict);
7621 __Pyx_XGIVEREF(__pyx_r);
7622 __Pyx_RefNannyFinishContext();
7626/* "(tree fragment)":17
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)
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
7638PyObject *__pyx_args, PyObject *__pyx_kwds
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
7645PyObject *__pyx_args, PyObject *__pyx_kwds
7648 PyObject *__pyx_v___pyx_state = 0;
7649 #if !CYTHON_VECTORCALL
7650 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
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);
7664 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7667 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
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) {
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)
7679 default: goto __pyx_L5_argtuple_error;
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) }
7686 } else if (unlikely(__pyx_nargs != 1)) {
7687 goto __pyx_L5_argtuple_error;
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)
7692 __pyx_v___pyx_state = values[0];
7695 __pyx_L5_argtuple_error:;
7696 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 17, __pyx_L3_error)
7698 goto __pyx_L4_argument_unpacking_done;
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]);
7703 __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7704 __Pyx_RefNannyFinishContext();
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);
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]);
7713 __Pyx_RefNannyFinishContext();
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);
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) # <<<<<<<<<<<<<<
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)
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;
7744 /* "(tree fragment)":17
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)
7751 /* function exit code */
7752 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
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);
7760 __Pyx_XGIVEREF(__pyx_r);
7761 __Pyx_RefNannyFinishContext();
7765/* "View.MemoryView":367
7766 * cdef const __Pyx_TypeInfo *typeinfo
7768 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
7770 * self.flags = flags
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
7778PyObject *__pyx_args, PyObject *__pyx_kwds
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
7785PyObject *__pyx_args, PyObject *__pyx_kwds
7788 PyObject *__pyx_v_obj = 0;
7790 int __pyx_v_dtype_is_object;
7791 #if !CYTHON_VECTORCALL_TPNEW
7792 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
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;
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);
7806 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
7809 __pyx_kwvalues = __Pyx_KwValues_FASTCALL_TPNEW(__pyx_args, __pyx_nargs);
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) {
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)
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)
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)
7829 default: goto __pyx_L5_argtuple_error;
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) }
7837 switch (__pyx_nargs) {
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)
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)
7848 default: goto __pyx_L5_argtuple_error;
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)
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)
7856 __pyx_v_dtype_is_object = ((int)0);
7860 __pyx_L5_argtuple_error:;
7861 __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, __pyx_nargs); __PYX_ERR(1, 367, __pyx_L3_error)
7863 goto __pyx_L4_argument_unpacking_done;
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]);
7868 __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7869 __Pyx_RefNannyFinishContext();
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);
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]);
7880 __Pyx_RefNannyFinishContext();
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) {
7886 __Pyx_RefNannyDeclarations
7890 int __pyx_lineno = 0;
7891 const char *__pyx_filename = NULL;
7892 int __pyx_clineno = 0;
7893 __Pyx_RefNannySetupContext("__cinit__", 0);
7895 /* "View.MemoryView":368
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:
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;
7908 /* "View.MemoryView":369
7909 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
7911 * self.flags = flags # <<<<<<<<<<<<<<
7912 * if type(self) is memoryview or obj is not None:
7913 * PyObject_GetBuffer(obj, &self.view, flags)
7915 __pyx_v_self->flags = __pyx_v_flags;
7917 /* "View.MemoryView":370
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:
7924 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_mstate_global->__pyx_memoryview_type));
7929 __pyx_t_1 = __pyx_t_2;
7931 goto __pyx_L4_bool_binop_done;
7933 __pyx_t_2 = (__pyx_v_obj != Py_None);
7935 __pyx_t_1 = __pyx_t_2;
7937 __pyx_L4_bool_binop_done:;
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
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)
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)
7958 __pyx_t_1 = (((PyObject *)__pyx_v_self->view.obj) == NULL);
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)
7970 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
7972 /* "View.MemoryView":374
7973 * if <PyObject *> self.view.obj == NULL:
7974 * (<__pyx_buffer *> &self.view).obj = Py_None
7975 * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
7977 * if not __PYX_CYTHON_ATOMICS_ENABLED():
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)
7990 /* "View.MemoryView":370
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:
7999 /* "View.MemoryView":376
8000 * Py_INCREF(Py_None)
8002 * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
8003 * global __pyx_memoryview_thread_locks_used
8004 * if (__pyx_memoryview_thread_locks_used < 8 and
8006 __pyx_t_1 = (!__PYX_CYTHON_ATOMICS_ENABLED());
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 # <<<<<<<<<<<<<<
8016 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
8018 __pyx_t_2 = (__pyx_memoryview_thread_locks_used < 8);
8024 __pyx_t_1 = __pyx_t_2;
8026 goto __pyx_L9_bool_binop_done;
8029 /* "View.MemoryView":380
8030 * if (__pyx_memoryview_thread_locks_used < 8 and
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
8036 __pyx_t_2 = (!__PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING());
8039 __pyx_t_1 = __pyx_t_2;
8041 __pyx_L9_bool_binop_done:;
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 # <<<<<<<<<<<<<<
8048 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
8053 /* "View.MemoryView":381
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:
8060 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
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()
8069 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
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 # <<<<<<<<<<<<<<
8076 * not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
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:
8087 __pyx_t_1 = (__pyx_v_self->lock == NULL);
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:
8099 __pyx_v_self->lock = PyThread_allocate_lock();
8101 /* "View.MemoryView":385
8102 * if self.lock is NULL:
8103 * self.lock = PyThread_allocate_lock()
8104 * if self.lock is NULL: # <<<<<<<<<<<<<<
8108 __pyx_t_1 = (__pyx_v_self->lock == NULL);
8110 if (unlikely(__pyx_t_1)) {
8113 /* "View.MemoryView":386
8114 * self.lock = PyThread_allocate_lock()
8115 * if self.lock is NULL:
8116 * raise MemoryError # <<<<<<<<<<<<<<
8118 * if flags & PyBUF_FORMAT:
8120 PyErr_NoMemory(); __PYX_ERR(1, 386, __pyx_L1_error)
8122 /* "View.MemoryView":385
8123 * if self.lock is NULL:
8124 * self.lock = PyThread_allocate_lock()
8125 * if self.lock is NULL: # <<<<<<<<<<<<<<
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:
8140 /* "View.MemoryView":376
8141 * Py_INCREF(Py_None)
8143 * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
8144 * global __pyx_memoryview_thread_locks_used
8145 * if (__pyx_memoryview_thread_locks_used < 8 and
8149 /* "View.MemoryView":388
8152 * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8153 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8156 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
8161 /* "View.MemoryView":389
8163 * if flags & PyBUF_FORMAT:
8164 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
8166 * self.dtype_is_object = dtype_is_object
8168 __pyx_t_2 = ((__pyx_v_self->view.format[0]) == 'O');
8174 __pyx_t_1 = __pyx_t_2;
8176 goto __pyx_L14_bool_binop_done;
8178 __pyx_t_2 = ((__pyx_v_self->view.format[1]) == '\x00');
8181 __pyx_t_1 = __pyx_t_2;
8183 __pyx_L14_bool_binop_done:;
8184 __pyx_v_self->dtype_is_object = __pyx_t_1;
8186 /* "View.MemoryView":388
8189 * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8190 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8196 /* "View.MemoryView":391
8197 * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8199 * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
8201 * with cython.cdivision(True):
8204 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
8208 /* "View.MemoryView":394
8210 * with cython.cdivision(True):
8211 * assert <uintptr_t>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0 # <<<<<<<<<<<<<<
8212 * self.typeinfo = NULL
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);
8219 if (unlikely(!__pyx_t_1)) {
8220 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
8221 __PYX_ERR(1, 394, __pyx_L1_error)
8226 if ((1)); else __PYX_ERR(1, 394, __pyx_L1_error)
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 # <<<<<<<<<<<<<<
8234 * def __dealloc__(memoryview self):
8236 __pyx_v_self->typeinfo = NULL;
8238 /* "View.MemoryView":367
8239 * cdef const __Pyx_TypeInfo *typeinfo
8241 * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
8243 * self.flags = flags
8246 /* function exit code */
8250 __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8254 __Pyx_RefNannyFinishContext();
8258/* "View.MemoryView":397
8259 * self.typeinfo = NULL
8261 * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
8262 * if self.obj is not None:
8263 * PyBuffer_Release(&self.view)
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));
8275 /* function exit code */
8276 __Pyx_RefNannyFinishContext();
8279static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
8282 Py_ssize_t __pyx_t_2;
8283 Py_ssize_t __pyx_t_3;
8285 PyThread_type_lock __pyx_t_5;
8286 PyThread_type_lock __pyx_t_6;
8288 /* "View.MemoryView":398
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:
8295 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
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:
8306 PyBuffer_Release((&__pyx_v_self->view));
8308 /* "View.MemoryView":398
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:
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: # <<<<<<<<<<<<<<
8323 * (<__pyx_buffer *> &self.view).obj = NULL
8325 __pyx_t_1 = (((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None);
8330 /* "View.MemoryView":402
8331 * elif (<__pyx_buffer *> &self.view).obj == Py_None:
8333 * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
8334 * Py_DECREF(Py_None)
8337 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
8339 /* "View.MemoryView":403
8341 * (<__pyx_buffer *> &self.view).obj = NULL
8342 * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
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: # <<<<<<<<<<<<<<
8353 * (<__pyx_buffer *> &self.view).obj = NULL
8358 /* "View.MemoryView":407
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:
8365 __pyx_t_1 = (__pyx_v_self->lock != NULL);
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
8377 __pyx_t_1 = __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING();
8384 __pyx_t_2 = __pyx_memoryview_thread_locks_used;
8387 __pyx_t_3 = __pyx_t_2;
8389 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
8390 __pyx_v_i = __pyx_t_4;
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:
8399 __pyx_t_1 = ((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock);
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] = (
8411 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
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])
8420 __pyx_t_1 = (__pyx_v_i != __pyx_memoryview_thread_locks_used);
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]) # <<<<<<<<<<<<<<
8432 __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
8434 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
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])
8444 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
8446 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
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])
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 # <<<<<<<<<<<<<<
8463 * PyThread_free_lock(self.lock)
8465 goto __pyx_L6_break;
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:
8478 /* "View.MemoryView":416
8481 * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
8485 PyThread_free_lock(__pyx_v_self->lock);
8491 /* "View.MemoryView":407
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:
8500 /* "View.MemoryView":397
8501 * self.typeinfo = NULL
8503 * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
8504 * if self.obj is not None:
8505 * PyBuffer_Release(&self.view)
8508 /* function exit code */
8513/* "View.MemoryView":419
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
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;
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;
8533 int __pyx_lineno = 0;
8534 const char *__pyx_filename = NULL;
8535 int __pyx_clineno = 0;
8536 __Pyx_RefNannySetupContext("get_item_pointer", 0);
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 # <<<<<<<<<<<<<<
8543 * for dim, idx in enumerate(index):
8545 __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
8547 /* "View.MemoryView":423
8548 * cdef char *itemp = <char *> self.view.buf
8550 * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
8551 * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8556 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2);
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)
8564 if (__pyx_t_3 >= __pyx_temp) break;
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));
8569 __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __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);
8576 __pyx_v_dim = __pyx_t_1;
8577 __pyx_t_1 = (__pyx_t_1 + 1);
8579 /* "View.MemoryView":424
8581 * for dim, idx in enumerate(index):
8582 * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
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;
8591 /* "View.MemoryView":423
8592 * cdef char *itemp = <char *> self.view.buf
8594 * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
8595 * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8599 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8601 /* "View.MemoryView":426
8602 * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8604 * return itemp # <<<<<<<<<<<<<<
8610 __pyx_r = __pyx_v_itemp;
8614 /* "View.MemoryView":419
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
8622 /* function exit code */
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);
8631 __Pyx_XDECREF(__pyx_v_idx);
8633 __Pyx_RefNannyFinishContext();
8637/* "View.MemoryView":429
8640 * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
8642 * if self.view.ndim == 1 and isinstance(index, int):
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));
8655 /* function exit code */
8656 __Pyx_RefNannyFinishContext();
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
8669 Py_ssize_t __pyx_t_3;
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);
8679 /* "View.MemoryView":431
8680 * def __getitem__(memoryview self, object index):
8682 * if self.view.ndim == 1 and isinstance(index, int): # <<<<<<<<<<<<<<
8683 * buffer = <char *> self.view.buf
8684 * return self.convert_item_to_object(
8686 __pyx_t_2 = (__pyx_v_self->view.ndim == 1);
8692 __pyx_t_1 = __pyx_t_2;
8694 goto __pyx_L4_bool_binop_done;
8696 __pyx_t_2 = PyLong_Check(__pyx_v_index);
8698 __pyx_t_1 = __pyx_t_2;
8700 __pyx_L4_bool_binop_done:;
8704 /* "View.MemoryView":432
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))
8711 __pyx_v_buffer = ((char *)__pyx_v_self->view.buf);
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)) # <<<<<<<<<<<<<<
8718 * if index is Ellipsis:
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)
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))
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);
8735 PyObject *__pyx_temp;
8737 __pyx_temp = __pyx_r;
8738 __pyx_r = __pyx_t_5;
8740 __Pyx_XDECREF(__pyx_temp);
8745 /* "View.MemoryView":431
8746 * def __getitem__(memoryview self, object index):
8748 * if self.view.ndim == 1 and isinstance(index, int): # <<<<<<<<<<<<<<
8749 * buffer = <char *> self.view.buf
8750 * return self.convert_item_to_object(
8754 /* "View.MemoryView":436
8755 * pybuffer_index(&self.view, buffer, index, 0))
8757 * if index is Ellipsis: # <<<<<<<<<<<<<<
8761 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
8765 /* "View.MemoryView":437
8767 * if index is Ellipsis:
8768 * return self # <<<<<<<<<<<<<<
8770 * have_slices, indices = _unellipsify(index, self.view.ndim)
8773 PyObject *__pyx_temp;
8775 __pyx_temp = __pyx_r;
8776 __Pyx_INCREF((PyObject *)__pyx_v_self);
8777 __pyx_r = ((PyObject *)__pyx_v_self);
8779 __Pyx_XDECREF(__pyx_temp);
8783 /* "View.MemoryView":436
8784 * pybuffer_index(&self.view, buffer, index, 0))
8786 * if index is Ellipsis: # <<<<<<<<<<<<<<
8792 /* "View.MemoryView":439
8795 * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
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)
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);
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);
8820 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8822 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 439, __pyx_L1_error)
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);
8831 /* "View.MemoryView":442
8834 * if have_slices: # <<<<<<<<<<<<<<
8835 * return memview_slice(self, indices)
8838 if (__pyx_v_have_slices) {
8840 /* "View.MemoryView":443
8843 * return memview_slice(self, indices) # <<<<<<<<<<<<<<
8845 * itemp = memoryview.get_item_pointer(self, <tuple> indices)
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);
8850 PyObject *__pyx_temp;
8852 __pyx_temp = __pyx_r;
8853 __pyx_r = __pyx_t_5;
8855 __Pyx_XDECREF(__pyx_temp);
8860 /* "View.MemoryView":442
8863 * if have_slices: # <<<<<<<<<<<<<<
8864 * return memview_slice(self, indices)
8869 /* "View.MemoryView":445
8870 * return memview_slice(self, indices)
8872 * itemp = memoryview.get_item_pointer(self, <tuple> indices) # <<<<<<<<<<<<<<
8873 * return self.convert_item_to_object(itemp)
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)
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;
8884 /* "View.MemoryView":446
8886 * itemp = memoryview.get_item_pointer(self, <tuple> indices)
8887 * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
8889 * def __setitem__(memoryview self, object index, object value):
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);
8894 PyObject *__pyx_temp;
8896 __pyx_temp = __pyx_r;
8897 __pyx_r = __pyx_t_5;
8899 __Pyx_XDECREF(__pyx_temp);
8905 /* "View.MemoryView":429
8908 * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
8910 * if self.view.ndim == 1 and isinstance(index, int):
8913 /* function exit code */
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);
8923 __Pyx_XDECREF(__pyx_v_indices);
8925 __Pyx_XGIVEREF(__pyx_r);
8926 __Pyx_RefNannyFinishContext();
8930/* "View.MemoryView":448
8931 * return self.convert_item_to_object(itemp)
8933 * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
8934 * if self.view.readonly:
8935 * raise TypeError, "Cannot assign to read-only memoryview"
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;
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));
8948 /* function exit code */
8949 __Pyx_RefNannyFinishContext();
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;
8959 __Pyx_RefNannyDeclarations
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);
8970 /* "View.MemoryView":449
8972 * def __setitem__(memoryview self, object index, object value):
8973 * if self.view.readonly: # <<<<<<<<<<<<<<
8974 * raise TypeError, "Cannot assign to read-only memoryview"
8977 if (unlikely(__pyx_v_self->view.readonly)) {
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" # <<<<<<<<<<<<<<
8984 * if self.view.ndim == 1 and isinstance(index, int):
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)
8989 /* "View.MemoryView":449
8991 * def __setitem__(memoryview self, object index, object value):
8992 * if self.view.readonly: # <<<<<<<<<<<<<<
8993 * raise TypeError, "Cannot assign to read-only memoryview"
8998 /* "View.MemoryView":452
8999 * raise TypeError, "Cannot assign to read-only memoryview"
9001 * if self.view.ndim == 1 and isinstance(index, int): # <<<<<<<<<<<<<<
9002 * memoryview.setitem_indexed1(self, index, value)
9005 __pyx_t_2 = (__pyx_v_self->view.ndim == 1);
9011 __pyx_t_1 = __pyx_t_2;
9013 goto __pyx_L5_bool_binop_done;
9015 __pyx_t_2 = PyLong_Check(__pyx_v_index);
9017 __pyx_t_1 = __pyx_t_2;
9019 __pyx_L5_bool_binop_done:;
9023 /* "View.MemoryView":453
9025 * if self.view.ndim == 1 and isinstance(index, int):
9026 * memoryview.setitem_indexed1(self, index, value) # <<<<<<<<<<<<<<
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;
9034 /* "View.MemoryView":454
9035 * if self.view.ndim == 1 and isinstance(index, int):
9036 * memoryview.setitem_indexed1(self, index, value)
9037 * return # <<<<<<<<<<<<<<
9039 * have_slices, indices = _unellipsify(index, self.view.ndim)
9046 /* "View.MemoryView":452
9047 * raise TypeError, "Cannot assign to read-only memoryview"
9049 * if self.view.ndim == 1 and isinstance(index, int): # <<<<<<<<<<<<<<
9050 * memoryview.setitem_indexed1(self, index, value)
9055 /* "View.MemoryView":456
9058 * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
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)
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);
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);
9083 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9085 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 456, __pyx_L1_error)
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);
9094 /* "View.MemoryView":458
9095 * have_slices, indices = _unellipsify(index, self.view.ndim)
9097 * if have_slices: # <<<<<<<<<<<<<<
9098 * obj = memoryview.is_slice(self, value)
9099 * target_slice = memview_slice(self, indices)
9101 if (__pyx_v_have_slices) {
9103 /* "View.MemoryView":459
9106 * obj = memoryview.is_slice(self, value) # <<<<<<<<<<<<<<
9107 * target_slice = memview_slice(self, indices)
9108 * if obj is not None:
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;
9115 /* "View.MemoryView":460
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)
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);
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)
9134 __pyx_t_1 = (__pyx_v_obj != Py_None);
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) # <<<<<<<<<<<<<<
9143 * memoryview.setitem_slice_assign_scalar(self, target_slice, value)
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;
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)
9159 /* "View.MemoryView":464
9160 * memoryview.setitem_slice_assignment(self, target_slice, obj)
9162 * memoryview.setitem_slice_assign_scalar(self, target_slice, value) # <<<<<<<<<<<<<<
9164 * memoryview.setitem_indexed(self, <tuple> indices, value)
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;
9173 /* "View.MemoryView":458
9174 * have_slices, indices = _unellipsify(index, self.view.ndim)
9176 * if have_slices: # <<<<<<<<<<<<<<
9177 * obj = memoryview.is_slice(self, value)
9178 * target_slice = memview_slice(self, indices)
9183 /* "View.MemoryView":466
9184 * memoryview.setitem_slice_assign_scalar(self, target_slice, value)
9186 * memoryview.setitem_indexed(self, <tuple> indices, value) # <<<<<<<<<<<<<<
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)
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;
9201 /* "View.MemoryView":448
9202 * return self.convert_item_to_object(itemp)
9204 * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
9205 * if self.view.readonly:
9206 * raise TypeError, "Cannot assign to read-only memoryview"
9209 /* function exit code */
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);
9220 __Pyx_XDECREF(__pyx_v_indices);
9221 __Pyx_XDECREF(__pyx_v_obj);
9222 __Pyx_XDECREF((PyObject *)__pyx_v_target_slice);
9224 __Pyx_RefNannyFinishContext();
9228/* "View.MemoryView":469
9231 * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
9232 * if not isinstance(obj, memoryview):
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
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;
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);
9256 /* "View.MemoryView":470
9258 * cdef is_slice(self, obj):
9259 * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
9261 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9263 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_mstate_global->__pyx_memoryview_type);
9264 __pyx_t_2 = (!__pyx_t_1);
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)
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);
9286 /* "View.MemoryView":472
9287 * if not isinstance(obj, memoryview):
9289 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
9290 * self.dtype_is_object)
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);
9297 /* "View.MemoryView":473
9299 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9300 * self.dtype_is_object) # <<<<<<<<<<<<<<
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);
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);
9316 __Pyx_DECREF_SET(__pyx_v_obj, ((PyObject *)__pyx_t_6));
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)
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;
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;
9337 /* "View.MemoryView":474
9338 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9339 * self.dtype_is_object)
9340 * except TypeError: # <<<<<<<<<<<<<<
9344 __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_TypeError))));
9346 __Pyx_ErrRestore(0,0,0);
9348 /* "View.MemoryView":475
9349 * self.dtype_is_object)
9351 * return None # <<<<<<<<<<<<<<
9356 PyObject *__pyx_temp;
9358 __pyx_temp = __pyx_r;
9359 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9361 __Pyx_XDECREF(__pyx_temp);
9363 goto __pyx_L7_except_return;
9365 goto __pyx_L6_except_error;
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)
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);
9389 /* "View.MemoryView":470
9391 * cdef is_slice(self, obj):
9392 * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
9394 * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9398 /* "View.MemoryView":477
9401 * return obj # <<<<<<<<<<<<<<
9406 PyObject *__pyx_temp;
9408 __pyx_temp = __pyx_r;
9409 __Pyx_INCREF(__pyx_v_obj);
9410 __pyx_r = __pyx_v_obj;
9412 __Pyx_XDECREF(__pyx_temp);
9416 /* "View.MemoryView":469
9419 * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
9420 * if not isinstance(obj, memoryview):
9424 /* function exit code */
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);
9433 __Pyx_XDECREF(__pyx_v_obj);
9434 __Pyx_XGIVEREF(__pyx_r);
9435 __Pyx_RefNannyFinishContext();
9439/* "View.MemoryView":480
9442 * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
9443 * cdef __Pyx_memviewslice dst_slice
9444 * cdef __Pyx_memviewslice src_slice
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;
9459 int __pyx_lineno = 0;
9460 const char *__pyx_filename = NULL;
9461 int __pyx_clineno = 0;
9462 __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
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]
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]);
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] # <<<<<<<<<<<<<<
9481 * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
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]);
9488 /* "View.MemoryView":486
9489 * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
9491 * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
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)
9508 /* "View.MemoryView":480
9511 * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
9512 * cdef __Pyx_memviewslice dst_slice
9513 * cdef __Pyx_memviewslice src_slice
9516 /* function exit code */
9517 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9520 __Pyx_XDECREF(__pyx_t_2);
9521 __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
9528 __Pyx_XGIVEREF(__pyx_r);
9529 __Pyx_RefNannyFinishContext();
9533/* "View.MemoryView":489
9536 * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
9537 * cdef int array[128]
9538 * cdef void *tmp = NULL
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];
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;
9551 PyObject *__pyx_t_3 = NULL;
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);
9566 /* "View.MemoryView":491
9567 * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
9568 * cdef int array[128]
9569 * cdef void *tmp = NULL # <<<<<<<<<<<<<<
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) # <<<<<<<<<<<<<<
9580 * if <size_t>self.view.itemsize > sizeof(array):
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;
9585 /* "View.MemoryView":498
9586 * dst_slice = get_slice_from_memview(dst, &tmp_slice)
9588 * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
9589 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9592 __pyx_t_2 = (((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array)));
9597 /* "View.MemoryView":499
9599 * if <size_t>self.view.itemsize > sizeof(array):
9600 * tmp = PyMem_Malloc(<size_t> self.view.itemsize) # <<<<<<<<<<<<<<
9604 __pyx_v_tmp = PyMem_Malloc(((size_t)__pyx_v_self->view.itemsize));
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: # <<<<<<<<<<<<<<
9613 __pyx_t_2 = (__pyx_v_tmp == NULL);
9615 if (unlikely(__pyx_t_2)) {
9618 /* "View.MemoryView":501
9619 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9621 * raise MemoryError # <<<<<<<<<<<<<<
9625 PyErr_NoMemory(); __PYX_ERR(1, 501, __pyx_L1_error)
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: # <<<<<<<<<<<<<<
9636 /* "View.MemoryView":502
9639 * item = tmp # <<<<<<<<<<<<<<
9641 * item = <void *> array
9643 __pyx_v_item = __pyx_v_tmp;
9645 /* "View.MemoryView":498
9646 * dst_slice = get_slice_from_memview(dst, &tmp_slice)
9648 * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
9649 * tmp = PyMem_Malloc(<size_t> self.view.itemsize)
9655 /* "View.MemoryView":504
9658 * item = <void *> array # <<<<<<<<<<<<<<
9663 __pyx_v_item = ((void *)__pyx_v_array);
9667 /* "View.MemoryView":506
9668 * item = <void *> array
9670 * try: # <<<<<<<<<<<<<<
9671 * if self.dtype_is_object:
9672 * (<PyObject **> item)[0] = <PyObject *> value
9676 /* "View.MemoryView":507
9679 * if self.dtype_is_object: # <<<<<<<<<<<<<<
9680 * (<PyObject **> item)[0] = <PyObject *> value
9683 if (__pyx_v_self->dtype_is_object) {
9685 /* "View.MemoryView":508
9687 * if self.dtype_is_object:
9688 * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
9690 * self.assign_item_from_object(<char *> item, value)
9692 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
9694 /* "View.MemoryView":507
9697 * if self.dtype_is_object: # <<<<<<<<<<<<<<
9698 * (<PyObject **> item)[0] = <PyObject *> value
9704 /* "View.MemoryView":510
9705 * (<PyObject **> item)[0] = <PyObject *> value
9707 * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
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;
9718 /* "View.MemoryView":514
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,
9725 __pyx_t_2 = (__pyx_v_self->view.suboffsets != NULL);
9730 /* "View.MemoryView":515
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)
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)
9740 /* "View.MemoryView":514
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,
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)
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);
9759 /* "View.MemoryView":519
9760 * item, self.dtype_is_object)
9762 * PyMem_Free(tmp) # <<<<<<<<<<<<<<
9768 PyMem_Free(__pyx_v_tmp);
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;
9787 PyMem_Free(__pyx_v_tmp);
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;
9804 /* "View.MemoryView":489
9807 * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
9808 * cdef int array[128]
9809 * cdef void *tmp = NULL
9812 /* function exit code */
9813 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9816 __Pyx_XDECREF(__pyx_t_3);
9817 __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
9825 __Pyx_XGIVEREF(__pyx_r);
9826 __Pyx_RefNannyFinishContext();
9830/* "View.MemoryView":522
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)
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
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);
9849 /* "View.MemoryView":523
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)
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;
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) # <<<<<<<<<<<<<<
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;
9870 /* "View.MemoryView":522
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)
9878 /* function exit code */
9879 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9882 __Pyx_XDECREF(__pyx_t_2);
9883 __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
9887 __Pyx_XGIVEREF(__pyx_r);
9888 __Pyx_RefNannyFinishContext();
9892/* "View.MemoryView":527
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)
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;
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);
9913 /* "View.MemoryView":528
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)
9920 __pyx_v_buffer = ((char *)__pyx_v_self->view.buf);
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)
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;
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) # <<<<<<<<<<<<<<
9939 * cdef convert_item_to_object(self, char *itemp):
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;
9945 /* "View.MemoryView":527
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)
9953 /* function exit code */
9954 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9957 __Pyx_XDECREF(__pyx_t_3);
9958 __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed1", __pyx_clineno, __pyx_lineno, __pyx_filename);
9963 __Pyx_XGIVEREF(__pyx_r);
9964 __Pyx_RefNannyFinishContext();
9968/* "View.MemoryView":532
9969 * self.assign_item_from_object(itemp, value)
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
"""
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;
9989 Py_ssize_t __pyx_t_8;
9991 PyObject *__pyx_t_10 = NULL;
9993 int __pyx_lineno = 0;
9994 const char *__pyx_filename = NULL;
9995 int __pyx_clineno = 0;
9996 __Pyx_RefNannySetupContext("convert_item_to_object
", 0);
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
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;
10011 /* "View.MemoryView":538
10012 * cdef bytes bytesitem
10014 * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
10016 * result = struct.unpack(self.view.format, bytesitem)
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);
10023 /* "View.MemoryView":539
10025 * bytesitem = itemp[:self.view.itemsize]
10026 * try: # <<<<<<<<<<<<<<
10027 * result = struct.unpack(self.view.format, bytesitem)
10028 * except struct.error:
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);
10039 /* "View.MemoryView":540
10040 * bytesitem = itemp[:self.view.itemsize]
10042 * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
10043 * except struct.error:
10044 * _err_ValueError("Unable to convert item to object")
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);
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);
10059 __pyx_v_result = __pyx_t_1;
10062 /* "View.MemoryView":539
10064 * bytesitem = itemp[:self.view.itemsize]
10065 * try: # <<<<<<<<<<<<<<
10066 * result = struct.unpack(self.view.format, bytesitem)
10067 * except struct.error:
10071 /* "View.MemoryView":544
10072 * _err_ValueError("Unable to convert item to object")
10074 * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
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);
10086 /* "View.MemoryView":545
10088 * if len(self.view.format) == 1:
10089 * return result[0] # <<<<<<<<<<<<<<
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);
10096 PyObject *__pyx_temp;
10098 __pyx_temp = __pyx_r;
10099 __pyx_r = __pyx_t_1;
10101 __Pyx_XDECREF(__pyx_temp);
10104 goto __pyx_L6_except_return;
10106 /* "View.MemoryView":544
10107 * _err_ValueError("Unable to convert item to object")
10109 * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
10115 /* "View.MemoryView":546
10116 * if len(self.view.format) == 1:
10118 * return result # <<<<<<<<<<<<<<
10120 * cdef assign_item_from_object(self, char *itemp, object value):
10123 PyObject *__pyx_temp;
10125 __pyx_temp = __pyx_r;
10126 __Pyx_INCREF(__pyx_v_result);
10127 __pyx_r = __pyx_v_result;
10129 __Pyx_XDECREF(__pyx_temp);
10131 goto __pyx_L6_except_return;
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;
10138 /* "View.MemoryView":541
10140 * result = struct.unpack(self.view.format, bytesitem)
10141 * except struct.error: # <<<<<<<<<<<<<<
10142 * _err_ValueError("Unable to convert item to object")
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;
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);
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") # <<<<<<<<<<<<<<
10164 * if len(self.view.format) == 1:
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)
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;
10173 goto __pyx_L5_except_error;
10175 /* "View.MemoryView":539
10177 * bytesitem = itemp[:self.view.itemsize]
10178 * try: # <<<<<<<<<<<<<<
10179 * result = struct.unpack(self.view.format, bytesitem)
10180 * except struct.error:
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);
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);
10201 /* "View.MemoryView":532
10202 * self.assign_item_from_object(itemp, value)
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
"""
10209 /* function exit code */
10210 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
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);
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();
10228/* "View.MemoryView
":548
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"""
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;
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;
10246 PyObject *__pyx_t_4 = NULL;
10247 PyObject *__pyx_t_5 = NULL;
10248 PyObject *__pyx_t_6 = NULL;
10250 Py_ssize_t __pyx_t_8;
10251 PyObject *__pyx_t_9 = NULL;
10254 Py_ssize_t __pyx_t_12;
10257 int __pyx_lineno = 0;
10258 const char *__pyx_filename = NULL;
10259 int __pyx_clineno = 0;
10260 __Pyx_RefNannySetupContext("assign_item_from_object", 0);
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 # <<<<<<<<<<<<<<
10267 * cdef bytes bytesvalue
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;
10275 /* "View.MemoryView
":556
10276 * cdef Py_ssize_t i
10278 * if isinstance(value, tuple): # <<<<<<<<<<<<<<
10279 * bytesvalue = struct.pack(self.view.format, *value)
10282 __pyx_t_3 = PyTuple_Check(__pyx_v_value);
10286 /* "View.MemoryView
":557
10288 * if isinstance(value, tuple):
10289 * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
10291 * bytesvalue = struct.pack(self.view.format, value)
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);
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);
10316 /* "View.MemoryView
":556
10317 * cdef Py_ssize_t i
10319 * if isinstance(value, tuple): # <<<<<<<<<<<<<<
10320 * bytesvalue = struct.pack(self.view.format, *value)
10326 /* "View.MemoryView
":559
10327 * bytesvalue = struct.pack(self.view.format, *value)
10329 * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
10331 * for i, c in enumerate(bytesvalue):
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);
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);
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);
10353 /* "View.MemoryView
":561
10354 * bytesvalue = struct.pack(self.view.format, value)
10356 * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
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)
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);
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]);
10376 /* "View.MemoryView
":562
10378 * for i, c in enumerate(bytesvalue):
10379 * itemp[i] = c # <<<<<<<<<<<<<<
10381 * @cname('getbuffer')
10383 __pyx_v_i = __pyx_t_8;
10385 /* "View.MemoryView
":561
10386 * bytesvalue = struct.pack(self.view.format, value)
10388 * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
10392 __pyx_t_8 = (__pyx_t_8 + 1);
10394 /* "View.MemoryView
":562
10396 * for i, c in enumerate(bytesvalue):
10397 * itemp[i] = c # <<<<<<<<<<<<<<
10399 * @cname('getbuffer')
10401 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
10406 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10408 /* "View.MemoryView
":548
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"""
10416 /* function exit code */
10417 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
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);
10428 __Pyx_XDECREF(__pyx_v_struct);
10430 __Pyx_XDECREF(__pyx_v_bytesvalue);
10432 __Pyx_XGIVEREF(__pyx_r);
10433 __Pyx_RefNannyFinishContext();
10437/* "View.MemoryView":564
10440 * @cname('getbuffer
') # <<<<<<<<<<<<<<
10441 * def __getbuffer__(self, Py_buffer *info, int flags):
10442 * if cython.unlikely(flags & PyBUF_WRITABLE and self.view.readonly):
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;
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));
10455 /* function exit code */
10458 __Pyx_RefNannyFinishContext();
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) {
10464 __Pyx_RefNannyDeclarations
10468 Py_ssize_t *__pyx_t_4;
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");
10479 __Pyx_RefNannySetupContext("__getbuffer__", 0);
10480 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
10481 __Pyx_GIVEREF(__pyx_v_info->obj);
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")
10490 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
10496 __pyx_t_1 = __pyx_t_2;
10498 goto __pyx_L4_bool_binop_done;
10501 __pyx_t_1 = __pyx_v_self->view.readonly;
10502 __pyx_L4_bool_binop_done:;
10503 if (unlikely(__pyx_t_1)) {
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") # <<<<<<<<<<<<<<
10511 * if flags & PyBUF_ND:
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)
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")
10525 /* "View.MemoryView":569
10526 * _err_ValueError("Cannot create writable memory view from read-only memoryview")
10528 * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
10529 * info.shape = self.view.shape
10532 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
10537 /* "View.MemoryView":570
10539 * if flags & PyBUF_ND:
10540 * info.shape = self.view.shape # <<<<<<<<<<<<<<
10542 * info.shape = NULL
10544 __pyx_t_4 = __pyx_v_self->view.shape;
10546 __pyx_v_info->shape = __pyx_t_4;
10548 /* "View.MemoryView":569
10549 * _err_ValueError("Cannot create writable memory view from read-only memoryview")
10551 * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
10552 * info.shape = self.view.shape
10558 /* "View.MemoryView":572
10559 * info.shape = self.view.shape
10561 * info.shape = NULL # <<<<<<<<<<<<<<
10563 * if flags & PyBUF_STRIDES:
10566 __pyx_v_info->shape = NULL;
10570 /* "View.MemoryView":574
10571 * info.shape = NULL
10573 * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
10574 * info.strides = self.view.strides
10577 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
10582 /* "View.MemoryView":575
10584 * if flags & PyBUF_STRIDES:
10585 * info.strides = self.view.strides # <<<<<<<<<<<<<<
10587 * info.strides = NULL
10589 __pyx_t_4 = __pyx_v_self->view.strides;
10591 __pyx_v_info->strides = __pyx_t_4;
10593 /* "View.MemoryView":574
10594 * info.shape = NULL
10596 * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
10597 * info.strides = self.view.strides
10603 /* "View.MemoryView":577
10604 * info.strides = self.view.strides
10606 * info.strides = NULL # <<<<<<<<<<<<<<
10608 * if flags & PyBUF_INDIRECT:
10611 __pyx_v_info->strides = NULL;
10615 /* "View.MemoryView":579
10616 * info.strides = NULL
10618 * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
10619 * info.suboffsets = self.view.suboffsets
10622 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
10627 /* "View.MemoryView":580
10629 * if flags & PyBUF_INDIRECT:
10630 * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
10632 * info.suboffsets = NULL
10634 __pyx_t_4 = __pyx_v_self->view.suboffsets;
10636 __pyx_v_info->suboffsets = __pyx_t_4;
10638 /* "View.MemoryView":579
10639 * info.strides = NULL
10641 * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
10642 * info.suboffsets = self.view.suboffsets
10648 /* "View.MemoryView":582
10649 * info.suboffsets = self.view.suboffsets
10651 * info.suboffsets = NULL # <<<<<<<<<<<<<<
10653 * if flags & PyBUF_FORMAT:
10656 __pyx_v_info->suboffsets = NULL;
10660 /* "View.MemoryView":584
10661 * info.suboffsets = NULL
10663 * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10664 * info.format = self.view.format
10667 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10672 /* "View.MemoryView":585
10674 * if flags & PyBUF_FORMAT:
10675 * info.format = self.view.format # <<<<<<<<<<<<<<
10677 * info.format = NULL
10679 __pyx_t_5 = __pyx_v_self->view.format;
10681 __pyx_v_info->format = __pyx_t_5;
10683 /* "View.MemoryView":584
10684 * info.suboffsets = NULL
10686 * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10687 * info.format = self.view.format
10693 /* "View.MemoryView":587
10694 * info.format = self.view.format
10696 * info.format = NULL # <<<<<<<<<<<<<<
10698 * info.buf = self.view.buf
10701 __pyx_v_info->format = NULL;
10705 /* "View.MemoryView":589
10706 * info.format = NULL
10708 * info.buf = self.view.buf # <<<<<<<<<<<<<<
10709 * info.ndim = self.view.ndim
10710 * info.itemsize = self.view.itemsize
10712 __pyx_t_6 = __pyx_v_self->view.buf;
10714 __pyx_v_info->buf = __pyx_t_6;
10716 /* "View.MemoryView":590
10718 * info.buf = self.view.buf
10719 * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
10720 * info.itemsize = self.view.itemsize
10721 * info.len = self.view.len
10723 __pyx_t_3 = __pyx_v_self->view.ndim;
10725 __pyx_v_info->ndim = __pyx_t_3;
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
10734 __pyx_t_7 = __pyx_v_self->view.itemsize;
10736 __pyx_v_info->itemsize = __pyx_t_7;
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
10745 __pyx_t_7 = __pyx_v_self->view.len;
10747 __pyx_v_info->len = __pyx_t_7;
10749 /* "View.MemoryView":593
10750 * info.itemsize = self.view.itemsize
10751 * info.len = self.view.len
10752 * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
10756 __pyx_t_1 = __pyx_v_self->view.readonly;
10758 __pyx_v_info->readonly = __pyx_t_1;
10760 /* "View.MemoryView":594
10761 * info.len = self.view.len
10762 * info.readonly = self.view.readonly
10763 * info.obj = self # <<<<<<<<<<<<<<
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);
10773 /* "View.MemoryView":564
10776 * @cname('getbuffer
') # <<<<<<<<<<<<<<
10777 * def __getbuffer__(self, Py_buffer *info, int flags):
10778 * if cython.unlikely(flags & PyBUF_WRITABLE and self.view.readonly):
10781 /* function exit code */
10785 __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
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;
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;
10799 __Pyx_RefNannyFinishContext();
10803/* "View.MemoryView":597
10806 * @property # <<<<<<<<<<<<<<
10808 * cdef _memoryviewslice result = memoryview_copy(self)
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));
10821 /* function exit code */
10822 __Pyx_RefNannyFinishContext();
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;
10832 int __pyx_lineno = 0;
10833 const char *__pyx_filename = NULL;
10834 int __pyx_clineno = 0;
10835 __Pyx_RefNannySetupContext("__get__", 0);
10837 /* "View.MemoryView":599
10840 * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
10841 * transpose_memslice(&result.from_slice)
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);
10850 /* "View.MemoryView":600
10852 * cdef _memoryviewslice result = memoryview_copy(self)
10853 * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
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)
10860 /* "View.MemoryView":601
10861 * cdef _memoryviewslice result = memoryview_copy(self)
10862 * transpose_memslice(&result.from_slice)
10863 * return result # <<<<<<<<<<<<<<
10868 PyObject *__pyx_temp;
10870 __pyx_temp = __pyx_r;
10871 __Pyx_INCREF((PyObject *)__pyx_v_result);
10872 __pyx_r = ((PyObject *)__pyx_v_result);
10874 __Pyx_XDECREF(__pyx_temp);
10878 /* "View.MemoryView":597
10881 * @property # <<<<<<<<<<<<<<
10883 * cdef _memoryviewslice result = memoryview_copy(self)
10886 /* function exit code */
10888 __Pyx_XDECREF(__pyx_t_1);
10889 __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10892 __Pyx_XDECREF((PyObject *)__pyx_v_result);
10893 __Pyx_XGIVEREF(__pyx_r);
10894 __Pyx_RefNannyFinishContext();
10898/* "View.MemoryView":603
10901 * @property # <<<<<<<<<<<<<<
10903 * return self._get_base()
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));
10916 /* function exit code */
10917 __Pyx_RefNannyFinishContext();
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);
10930 /* "View.MemoryView":605
10933 * return self._get_base() # <<<<<<<<<<<<<<
10935 * cdef _get_base(self):
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);
10940 PyObject *__pyx_temp;
10942 __pyx_temp = __pyx_r;
10943 __pyx_r = __pyx_t_1;
10945 __Pyx_XDECREF(__pyx_temp);
10950 /* "View.MemoryView":603
10953 * @property # <<<<<<<<<<<<<<
10955 * return self._get_base()
10958 /* function exit code */
10960 __Pyx_XDECREF(__pyx_t_1);
10961 __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10964 __Pyx_XGIVEREF(__pyx_r);
10965 __Pyx_RefNannyFinishContext();
10969/* "View.MemoryView":607
10970 * return self._get_base()
10972 * cdef _get_base(self): # <<<<<<<<<<<<<<
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);
10982 /* "View.MemoryView":608
10984 * cdef _get_base(self):
10985 * return self.obj # <<<<<<<<<<<<<<
10990 PyObject *__pyx_temp;
10992 __pyx_temp = __pyx_r;
10993 __Pyx_INCREF(__pyx_v_self->obj);
10994 __pyx_r = __pyx_v_self->obj;
10996 __Pyx_XDECREF(__pyx_temp);
11000 /* "View.MemoryView":607
11001 * return self._get_base()
11003 * cdef _get_base(self): # <<<<<<<<<<<<<<
11008 /* function exit code */
11010 __Pyx_XGIVEREF(__pyx_r);
11011 __Pyx_RefNannyFinishContext();
11015/* "View.MemoryView":610
11018 * @property # <<<<<<<<<<<<<<
11020 * return tuple([length for length in self.view.shape[:self.view.ndim]])
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));
11033 /* function exit code */
11034 __Pyx_RefNannyFinishContext();
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);
11052 /* "View.MemoryView":612
11055 * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
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);
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)
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;
11079 PyObject *__pyx_temp;
11081 __pyx_temp = __pyx_r;
11082 __pyx_r = __pyx_t_5;
11084 __Pyx_XDECREF(__pyx_temp);
11089 /* "View.MemoryView":610
11092 * @property # <<<<<<<<<<<<<<
11094 * return tuple([length for length in self.view.shape[:self.view.ndim]])
11097 /* function exit code */
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);
11105 __Pyx_XGIVEREF(__pyx_r);
11106 __Pyx_RefNannyFinishContext();
11110/* "View.MemoryView":614
11111 * return tuple([length for length in self.view.shape[:self.view.ndim]])
11113 * @property # <<<<<<<<<<<<<<
11114 * def strides(self):
11115 * if cython.unlikely(self.view.strides == NULL):
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));
11128 /* function exit code */
11129 __Pyx_RefNannyFinishContext();
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
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);
11149 /* "View.MemoryView":616
11151 * def strides(self):
11152 * if cython.unlikely(self.view.strides == NULL): # <<<<<<<<<<<<<<
11154 * _err_ValueError("Buffer view does not expose strides")
11156 __pyx_t_1 = (__pyx_v_self->view.strides == NULL);
11158 if (unlikely(__pyx_t_1)) {
11161 /* "View.MemoryView":618
11162 * if cython.unlikely(self.view.strides == NULL):
11164 * _err_ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
11166 * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
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)
11171 /* "View.MemoryView":616
11173 * def strides(self):
11174 * if cython.unlikely(self.view.strides == NULL): # <<<<<<<<<<<<<<
11176 * _err_ValueError("Buffer view does not expose strides")
11180 /* "View.MemoryView":620
11181 * _err_ValueError("Buffer view does not expose strides")
11183 * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
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);
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)
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;
11207 PyObject *__pyx_temp;
11209 __pyx_temp = __pyx_r;
11210 __pyx_r = __pyx_t_7;
11212 __Pyx_XDECREF(__pyx_temp);
11217 /* "View.MemoryView":614
11218 * return tuple([length for length in self.view.shape[:self.view.ndim]])
11220 * @property # <<<<<<<<<<<<<<
11221 * def strides(self):
11222 * if cython.unlikely(self.view.strides == NULL):
11225 /* function exit code */
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);
11233 __Pyx_XGIVEREF(__pyx_r);
11234 __Pyx_RefNannyFinishContext();
11238/* "View.MemoryView":622
11239 * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
11241 * @property # <<<<<<<<<<<<<<
11242 * def suboffsets(self):
11243 * if self.view.suboffsets == NULL:
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));
11256 /* function exit code */
11257 __Pyx_RefNannyFinishContext();
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
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);
11276 /* "View.MemoryView":624
11278 * def suboffsets(self):
11279 * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
11280 * return (-1,) * self.view.ndim
11283 __pyx_t_1 = (__pyx_v_self->view.suboffsets == NULL);
11288 /* "View.MemoryView":625
11289 * def suboffsets(self):
11290 * if self.view.suboffsets == NULL:
11291 * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
11293 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
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);
11298 PyObject *__pyx_temp;
11300 __pyx_temp = __pyx_r;
11301 __pyx_r = __pyx_t_2;
11303 __Pyx_XDECREF(__pyx_temp);
11308 /* "View.MemoryView":624
11310 * def suboffsets(self):
11311 * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
11312 * return (-1,) * self.view.ndim
11317 /* "View.MemoryView":627
11318 * return (-1,) * self.view.ndim
11320 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
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);
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)
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;
11344 PyObject *__pyx_temp;
11346 __pyx_temp = __pyx_r;
11347 __pyx_r = __pyx_t_6;
11349 __Pyx_XDECREF(__pyx_temp);
11354 /* "View.MemoryView":622
11355 * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
11357 * @property # <<<<<<<<<<<<<<
11358 * def suboffsets(self):
11359 * if self.view.suboffsets == NULL:
11362 /* function exit code */
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);
11370 __Pyx_XGIVEREF(__pyx_r);
11371 __Pyx_RefNannyFinishContext();
11375/* "View.MemoryView":629
11376 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
11378 * @property # <<<<<<<<<<<<<<
11380 * return self.view.ndim
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));
11393 /* function exit code */
11394 __Pyx_RefNannyFinishContext();
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);
11407 /* "View.MemoryView":631
11410 * return self.view.ndim # <<<<<<<<<<<<<<
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);
11417 PyObject *__pyx_temp;
11419 __pyx_temp = __pyx_r;
11420 __pyx_r = __pyx_t_1;
11422 __Pyx_XDECREF(__pyx_temp);
11427 /* "View.MemoryView":629
11428 * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
11430 * @property # <<<<<<<<<<<<<<
11432 * return self.view.ndim
11435 /* function exit code */
11437 __Pyx_XDECREF(__pyx_t_1);
11438 __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11441 __Pyx_XGIVEREF(__pyx_r);
11442 __Pyx_RefNannyFinishContext();
11446/* "View.MemoryView":633
11447 * return self.view.ndim
11449 * @property # <<<<<<<<<<<<<<
11450 * def itemsize(self):
11451 * return self.view.itemsize
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));
11464 /* function exit code */
11465 __Pyx_RefNannyFinishContext();
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);
11478 /* "View.MemoryView":635
11480 * def itemsize(self):
11481 * return self.view.itemsize # <<<<<<<<<<<<<<
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);
11488 PyObject *__pyx_temp;
11490 __pyx_temp = __pyx_r;
11491 __pyx_r = __pyx_t_1;
11493 __Pyx_XDECREF(__pyx_temp);
11498 /* "View.MemoryView":633
11499 * return self.view.ndim
11501 * @property # <<<<<<<<<<<<<<
11502 * def itemsize(self):
11503 * return self.view.itemsize
11506 /* function exit code */
11508 __Pyx_XDECREF(__pyx_t_1);
11509 __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11512 __Pyx_XGIVEREF(__pyx_r);
11513 __Pyx_RefNannyFinishContext();
11517/* "View.MemoryView":637
11518 * return self.view.itemsize
11520 * @property # <<<<<<<<<<<<<<
11521 * def nbytes(self):
11522 * return self.size * self.view.itemsize
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));
11535 /* function exit code */
11536 __Pyx_RefNannyFinishContext();
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);
11551 /* "View.MemoryView":639
11553 * def nbytes(self):
11554 * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
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;
11567 PyObject *__pyx_temp;
11569 __pyx_temp = __pyx_r;
11570 __pyx_r = __pyx_t_3;
11572 __Pyx_XDECREF(__pyx_temp);
11577 /* "View.MemoryView":637
11578 * return self.view.itemsize
11580 * @property # <<<<<<<<<<<<<<
11581 * def nbytes(self):
11582 * return self.size * self.view.itemsize
11585 /* function exit code */
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);
11593 __Pyx_XGIVEREF(__pyx_r);
11594 __Pyx_RefNannyFinishContext();
11598/* "View.MemoryView":641
11599 * return self.size * self.view.itemsize
11601 * @property # <<<<<<<<<<<<<<
11603 * cdef size_t result
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));
11616 /* function exit code */
11617 __Pyx_RefNannyFinishContext();
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
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);
11636 /* "View.MemoryView":644
11638 * cdef size_t result
11639 * if self._size is None: # <<<<<<<<<<<<<<
11643 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
11647 /* "View.MemoryView":645
11648 * cdef size_t result
11649 * if self._size is None:
11650 * result = 1 # <<<<<<<<<<<<<<
11652 * for length in self.view.shape[:self.view.ndim]:
11654 __pyx_v_result = 1;
11656 /* "View.MemoryView":647
11659 * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
11660 * result *= <size_t> length
11663 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
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]);
11669 /* "View.MemoryView":648
11671 * for length in self.view.shape[:self.view.ndim]:
11672 * result *= <size_t> length # <<<<<<<<<<<<<<
11674 * self._size = result
11676 __pyx_v_result = (__pyx_v_result * ((size_t)__pyx_v_length));
11680 /* "View.MemoryView":650
11681 * result *= <size_t> length
11683 * self._size = result # <<<<<<<<<<<<<<
11685 * return self._size
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;
11695 /* "View.MemoryView":644
11697 * cdef size_t result
11698 * if self._size is None: # <<<<<<<<<<<<<<
11704 /* "View.MemoryView":652
11705 * self._size = result
11707 * return self._size # <<<<<<<<<<<<<<
11709 * def __len__(self):
11712 PyObject *__pyx_temp;
11714 __pyx_temp = __pyx_r;
11715 __Pyx_INCREF(__pyx_v_self->_size);
11716 __pyx_r = __pyx_v_self->_size;
11718 __Pyx_XDECREF(__pyx_temp);
11722 /* "View.MemoryView":641
11723 * return self.size * self.view.itemsize
11725 * @property # <<<<<<<<<<<<<<
11727 * cdef size_t result
11730 /* function exit code */
11732 __Pyx_XDECREF(__pyx_t_5);
11733 __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11738 __Pyx_XGIVEREF(__pyx_r);
11739 __Pyx_RefNannyFinishContext();
11743/* "View.MemoryView":654
11744 * return self._size
11746 * def __len__(self): # <<<<<<<<<<<<<<
11747 * if self.view.ndim >= 1:
11748 * return self.view.shape[0]
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));
11761 /* function exit code */
11762 __Pyx_RefNannyFinishContext();
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;
11770 /* "View.MemoryView":655
11772 * def __len__(self):
11773 * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
11774 * return self.view.shape[0]
11777 __pyx_t_1 = (__pyx_v_self->view.ndim >= 1);
11782 /* "View.MemoryView":656
11783 * def __len__(self):
11784 * if self.view.ndim >= 1:
11785 * return self.view.shape[0] # <<<<<<<<<<<<<<
11791 __pyx_r = (__pyx_v_self->view.shape[0]);
11795 /* "View.MemoryView":655
11797 * def __len__(self):
11798 * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
11799 * return self.view.shape[0]
11804 /* "View.MemoryView":658
11805 * return self.view.shape[0]
11807 * return 0 # <<<<<<<<<<<<<<
11809 * def __repr__(self):
11817 /* "View.MemoryView":654
11818 * return self._size
11820 * def __len__(self): # <<<<<<<<<<<<<<
11821 * if self.view.ndim >= 1:
11822 * return self.view.shape[0]
11825 /* function exit code */
11831/* "View.MemoryView":660
11834 * def __repr__(self): # <<<<<<<<<<<<<<
11835 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
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));
11849 /* function exit code */
11850 __Pyx_RefNannyFinishContext();
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;
11863 int __pyx_lineno = 0;
11864 const char *__pyx_filename = NULL;
11865 int __pyx_clineno = 0;
11866 __Pyx_RefNannySetupContext("__repr__", 0);
11868 /* "View.MemoryView":661
11870 * def __repr__(self):
11871 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
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;
11887 /* "View.MemoryView":662
11888 * def __repr__(self):
11889 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11890 * id(self)) # <<<<<<<<<<<<<<
11892 * def __str__(self):
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;
11905 /* "View.MemoryView":661
11907 * def __repr__(self):
11908 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
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]);
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]);
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;
11926 PyObject *__pyx_temp;
11928 __pyx_temp = __pyx_r;
11929 __pyx_r = __pyx_t_1;
11931 __Pyx_XDECREF(__pyx_temp);
11936 /* "View.MemoryView":660
11939 * def __repr__(self): # <<<<<<<<<<<<<<
11940 * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11944 /* function exit code */
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);
11952 __Pyx_XGIVEREF(__pyx_r);
11953 __Pyx_RefNannyFinishContext();
11957/* "View.MemoryView":664
11960 * def __str__(self): # <<<<<<<<<<<<<<
11961 * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
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));
11975 /* function exit code */
11976 __Pyx_RefNannyFinishContext();
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;
11988 int __pyx_lineno = 0;
11989 const char *__pyx_filename = NULL;
11990 int __pyx_clineno = 0;
11991 __Pyx_RefNannySetupContext("__str__", 0);
11993 /* "View.MemoryView":665
11995 * def __str__(self):
11996 * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
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;
12015 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
12016 __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3[1]);
12019 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
12020 __pyx_t_5 |= __Pyx_PyUnicode_KIND_04(__pyx_t_3[1]);
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;
12027 PyObject *__pyx_temp;
12029 __pyx_temp = __pyx_r;
12030 __pyx_r = __pyx_t_1;
12032 __Pyx_XDECREF(__pyx_temp);
12037 /* "View.MemoryView":664
12040 * def __str__(self): # <<<<<<<<<<<<<<
12041 * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
12045 /* function exit code */
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);
12052 __Pyx_XGIVEREF(__pyx_r);
12053 __Pyx_RefNannyFinishContext();
12057/* "View.MemoryView":668
12060 * def is_c_contig(self): # <<<<<<<<<<<<<<
12061 * cdef __Pyx_memviewslice *mslice
12062 * cdef __Pyx_memviewslice tmp
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
12070PyObject *__pyx_args, PyObject *__pyx_kwds
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
12077PyObject *__pyx_args, PyObject *__pyx_kwds
12080 #if !CYTHON_VECTORCALL
12081 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
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);
12091 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
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));
12101 /* function exit code */
12102 __Pyx_RefNannyFinishContext();
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);
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)
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;
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) # <<<<<<<<<<<<<<
12133 * def is_f_contig(self):
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);
12138 PyObject *__pyx_temp;
12140 __pyx_temp = __pyx_r;
12141 __pyx_r = __pyx_t_2;
12143 __Pyx_XDECREF(__pyx_temp);
12148 /* "View.MemoryView":668
12151 * def is_c_contig(self): # <<<<<<<<<<<<<<
12152 * cdef __Pyx_memviewslice *mslice
12153 * cdef __Pyx_memviewslice tmp
12156 /* function exit code */
12158 __Pyx_XDECREF(__pyx_t_2);
12159 __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
12164 __Pyx_XGIVEREF(__pyx_r);
12165 __Pyx_RefNannyFinishContext();
12169/* "View.MemoryView":674
12170 * return slice_is_contig(mslice[0], 'C
', self.view.ndim)
12172 * def is_f_contig(self): # <<<<<<<<<<<<<<
12173 * cdef __Pyx_memviewslice *mslice
12174 * cdef __Pyx_memviewslice tmp
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
12182PyObject *__pyx_args, PyObject *__pyx_kwds
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
12189PyObject *__pyx_args, PyObject *__pyx_kwds
12192 #if !CYTHON_VECTORCALL
12193 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
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);
12203 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
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));
12213 /* function exit code */
12214 __Pyx_RefNannyFinishContext();
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);
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)
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;
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) # <<<<<<<<<<<<<<
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);
12250 PyObject *__pyx_temp;
12252 __pyx_temp = __pyx_r;
12253 __pyx_r = __pyx_t_2;
12255 __Pyx_XDECREF(__pyx_temp);
12260 /* "View.MemoryView":674
12261 * return slice_is_contig(mslice[0], 'C
', self.view.ndim)
12263 * def is_f_contig(self): # <<<<<<<<<<<<<<
12264 * cdef __Pyx_memviewslice *mslice
12265 * cdef __Pyx_memviewslice tmp
12268 /* function exit code */
12270 __Pyx_XDECREF(__pyx_t_2);
12271 __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
12276 __Pyx_XGIVEREF(__pyx_r);
12277 __Pyx_RefNannyFinishContext();
12281/* "View.MemoryView":680
12282 * return slice_is_contig(mslice[0], 'F
', self.view.ndim)
12284 * def copy(self): # <<<<<<<<<<<<<<
12285 * cdef __Pyx_memviewslice mslice
12286 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
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
12294PyObject *__pyx_args, PyObject *__pyx_kwds
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
12301PyObject *__pyx_args, PyObject *__pyx_kwds
12304 #if !CYTHON_VECTORCALL
12305 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
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);
12315 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
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));
12325 /* function exit code */
12326 __Pyx_RefNannyFinishContext();
12330static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
12331 __Pyx_memviewslice __pyx_v_mslice;
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);
12342 /* "View.MemoryView":682
12344 * cdef __Pyx_memviewslice mslice
12345 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
12347 * slice_copy(self, &mslice)
12349 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
12351 /* "View.MemoryView":684
12352 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12354 * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
12355 * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
12356 * self.view.itemsize,
12358 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
12360 /* "View.MemoryView":685
12362 * slice_copy(self, &mslice)
12363 * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
12364 * self.view.itemsize,
12365 * flags|PyBUF_C_CONTIGUOUS,
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;
12370 /* "View.MemoryView":690
12371 * self.dtype_is_object)
12373 * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
12375 * def copy_fortran(self):
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);
12380 PyObject *__pyx_temp;
12382 __pyx_temp = __pyx_r;
12383 __pyx_r = __pyx_t_2;
12385 __Pyx_XDECREF(__pyx_temp);
12390 /* "View.MemoryView":680
12391 * return slice_is_contig(mslice[0], 'F
', self.view.ndim)
12393 * def copy(self): # <<<<<<<<<<<<<<
12394 * cdef __Pyx_memviewslice mslice
12395 * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12398 /* function exit code */
12400 __Pyx_XDECREF(__pyx_t_2);
12401 __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
12406 __Pyx_XGIVEREF(__pyx_r);
12407 __Pyx_RefNannyFinishContext();
12411/* "View.MemoryView":692
12412 * return memoryview_copy_from_slice(self, &mslice)
12414 * def copy_fortran(self): # <<<<<<<<<<<<<<
12415 * cdef __Pyx_memviewslice src, dst
12416 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
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
12424PyObject *__pyx_args, PyObject *__pyx_kwds
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
12431PyObject *__pyx_args, PyObject *__pyx_kwds
12434 #if !CYTHON_VECTORCALL
12435 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
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);
12445 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
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));
12455 /* function exit code */
12456 __Pyx_RefNannyFinishContext();
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;
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);
12473 /* "View.MemoryView":694
12474 * def copy_fortran(self):
12475 * cdef __Pyx_memviewslice src, dst
12476 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
12478 * slice_copy(self, &src)
12480 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
12482 /* "View.MemoryView":696
12483 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12485 * slice_copy(self, &src) # <<<<<<<<<<<<<<
12486 * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
12487 * self.view.itemsize,
12489 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
12491 /* "View.MemoryView":697
12493 * slice_copy(self, &src)
12494 * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
12495 * self.view.itemsize,
12496 * flags|PyBUF_F_CONTIGUOUS,
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;
12501 /* "View.MemoryView":702
12502 * self.dtype_is_object)
12504 * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
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);
12511 PyObject *__pyx_temp;
12513 __pyx_temp = __pyx_r;
12514 __pyx_r = __pyx_t_2;
12516 __Pyx_XDECREF(__pyx_temp);
12521 /* "View.MemoryView":692
12522 * return memoryview_copy_from_slice(self, &mslice)
12524 * def copy_fortran(self): # <<<<<<<<<<<<<<
12525 * cdef __Pyx_memviewslice src, dst
12526 * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12529 /* function exit code */
12531 __Pyx_XDECREF(__pyx_t_2);
12532 __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
12538 __Pyx_XGIVEREF(__pyx_r);
12539 __Pyx_RefNannyFinishContext();
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):
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
12554PyObject *__pyx_args, PyObject *__pyx_kwds
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
12561PyObject *__pyx_args, PyObject *__pyx_kwds
12564 #if !CYTHON_VECTORCALL
12565 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
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);
12575 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
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));
12585 /* function exit code */
12586 __Pyx_RefNannyFinishContext();
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);
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__"
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)
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):
12613 /* function exit code */
12615 __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12617 __Pyx_XGIVEREF(__pyx_r);
12618 __Pyx_RefNannyFinishContext();
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__"
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
12634PyObject *__pyx_args, PyObject *__pyx_kwds
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
12641PyObject *__pyx_args, PyObject *__pyx_kwds
12644 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
12645 #if !CYTHON_VECTORCALL
12646 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
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);
12660 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12663 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
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) {
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;
12675 default: goto __pyx_L5_argtuple_error;
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) }
12682 } else if (unlikely(__pyx_nargs != 1)) {
12683 goto __pyx_L5_argtuple_error;
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)
12688 __pyx_v___pyx_state = values[0];
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)
12694 goto __pyx_L4_argument_unpacking_done;
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]);
12699 __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12700 __Pyx_RefNannyFinishContext();
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);
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]);
12709 __Pyx_RefNannyFinishContext();
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);
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__" # <<<<<<<<<<<<<<
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)
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__"
12736 /* function exit code */
12738 __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12740 __Pyx_XGIVEREF(__pyx_r);
12741 __Pyx_RefNannyFinishContext();
12745/* "View.MemoryView":705
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)
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;
12762 int __pyx_lineno = 0;
12763 const char *__pyx_filename = NULL;
12764 int __pyx_clineno = 0;
12765 __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
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
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);
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);
12789 __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_1);
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 # <<<<<<<<<<<<<<
12799 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
12801 /* "View.MemoryView":709
12802 * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12803 * result.typeinfo = typeinfo
12804 * return result # <<<<<<<<<<<<<<
12806 * @cname('__pyx_memoryview_check
')
12809 PyObject *__pyx_temp;
12811 __pyx_temp = __pyx_r;
12812 __Pyx_INCREF((PyObject *)__pyx_v_result);
12813 __pyx_r = ((PyObject *)__pyx_v_result);
12815 __Pyx_XDECREF(__pyx_temp);
12819 /* "View.MemoryView":705
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)
12827 /* function exit code */
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);
12836 __Pyx_XDECREF((PyObject *)__pyx_v_result);
12837 __Pyx_XGIVEREF(__pyx_r);
12838 __Pyx_RefNannyFinishContext();
12842/* "View.MemoryView":711
12845 * @cname('__pyx_memoryview_check
') # <<<<<<<<<<<<<<
12846 * cdef inline bint memoryview_check(object o) noexcept:
12847 * return isinstance(o, memoryview)
12850static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
12854 /* "View.MemoryView":713
12855 * @cname('__pyx_memoryview_check
')
12856 * cdef inline bint memoryview_check(object o) noexcept:
12857 * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
12861 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_mstate_global->__pyx_memoryview_type);
12863 __pyx_r = __pyx_t_1;
12867 /* "View.MemoryView":711
12870 * @cname('__pyx_memoryview_check
') # <<<<<<<<<<<<<<
12871 * cdef inline bint memoryview_check(object o) noexcept:
12872 * return isinstance(o, memoryview)
12875 /* function exit code */
12881/* "View.MemoryView":716
12884 * @cname('__pyx_memoryview_err_invalid_index
') # <<<<<<<<<<<<<<
12885 * cdef int _err_invalid_index(item) except -1:
12886 * type_name = str(type(item))
12889static int __pyx_memoryview_err_invalid_index(PyObject *__pyx_v_item) {
12890 PyObject *__pyx_v_type_name = NULL;
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);
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 '%.200
U'", <PyObject*> type_name)
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);
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 '%.200
U'", <PyObject*> type_name) # <<<<<<<<<<<<<<
12918 (void)(PyErr_Format(PyExc_TypeError, __pyx_k_Cannot_index_with_type_200U, ((PyObject *)__pyx_v_type_name)));
12920 /* "View.MemoryView":720
12921 * type_name = str(type(item))
12922 * PyErr_Format(PyExc_TypeError, "Cannot index with type '%.200
U'", <PyObject*> type_name)
12923 * return -1 # <<<<<<<<<<<<<<
12933 /* "View.MemoryView":716
12936 * @cname('__pyx_memoryview_err_invalid_index
') # <<<<<<<<<<<<<<
12937 * cdef int _err_invalid_index(item) except -1:
12938 * type_name = str(type(item))
12941 /* function exit code */
12943 __Pyx_XDECREF(__pyx_t_1);
12944 __Pyx_AddTraceback("View.MemoryView._err_invalid_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
12947 __Pyx_XDECREF(__pyx_v_type_name);
12949 __Pyx_RefNannyFinishContext();
12953/* "View.MemoryView":723
12956 * cdef tuple[bint, tuple] _unellipsify_index_tuple(index_tuple: tuple, int ndim): # <<<<<<<<<<<<<<
12958 * Replace all ellipses with full slices and fill incomplete indices with full slices.
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;
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);
12985 /* "View.MemoryView":727
12986 * Replace all ellipses with full slices and fill incomplete indices with full slices.
12988 * cdef Py_ssize_t first_ellipsis_index = -1 # <<<<<<<<<<<<<<
12989 * cdef Py_ssize_t idx, ellipsis_end, indices_from_ellipsis
12992 __pyx_v_first_ellipsis_index = -1L;
12994 /* "View.MemoryView":730
12995 * cdef Py_ssize_t idx, ellipsis_end, indices_from_ellipsis
12997 * have_slices = False # <<<<<<<<<<<<<<
13001 __pyx_v_have_slices = 0;
13003 /* "View.MemoryView":732
13004 * have_slices = False
13006 * idx = 0 # <<<<<<<<<<<<<<
13007 * for item in index_tuple:
13008 * if item is Ellipsis:
13012 /* "View.MemoryView":733
13015 * for item in index_tuple: # <<<<<<<<<<<<<<
13016 * if item is Ellipsis:
13017 * have_slices = True
13019 __pyx_t_1 = __pyx_v_index_tuple; __Pyx_INCREF(__pyx_t_1);
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)
13027 if (__pyx_t_2 >= __pyx_temp) break;
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));
13032 __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __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);
13040 /* "View.MemoryView":734
13042 * for item in index_tuple:
13043 * if item is Ellipsis: # <<<<<<<<<<<<<<
13044 * have_slices = True
13045 * if first_ellipsis_index == -1:
13047 __pyx_t_4 = (__pyx_v_item == __pyx_builtin_Ellipsis);
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
13058 __pyx_v_have_slices = 1;
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):
13067 __pyx_t_4 = (__pyx_v_first_ellipsis_index == -1L);
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
13079 __pyx_v_first_ellipsis_index = __pyx_v_idx;
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):
13090 /* "View.MemoryView":734
13092 * for item in index_tuple:
13093 * if item is Ellipsis: # <<<<<<<<<<<<<<
13094 * have_slices = True
13095 * if first_ellipsis_index == -1:
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)):
13107 __pyx_t_4 = PySlice_Check(__pyx_v_item);
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)
13118 __pyx_v_have_slices = 1;
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)):
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)
13137 __pyx_t_4 = (!(PyIndex_Check(__pyx_v_item) != 0));
13139 if (unlikely(__pyx_t_4)) {
13142 /* "View.MemoryView":741
13143 * have_slices = True
13144 * elif cython.unlikely(not PyIndex_Check(item)):
13145 * _err_invalid_index(item) # <<<<<<<<<<<<<<
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)
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)
13162 /* "View.MemoryView":742
13163 * elif cython.unlikely(not PyIndex_Check(item)):
13164 * _err_invalid_index(item)
13165 * idx += 1 # <<<<<<<<<<<<<<
13167 * if first_ellipsis_index >= 0:
13169 __pyx_v_idx = (__pyx_v_idx + 1);
13171 /* "View.MemoryView":733
13174 * for item in index_tuple: # <<<<<<<<<<<<<<
13175 * if item is Ellipsis:
13176 * have_slices = True
13179 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13181 /* "View.MemoryView":744
13184 * if first_ellipsis_index >= 0: # <<<<<<<<<<<<<<
13185 * result = [slice(None)] * ndim
13188 __pyx_t_4 = (__pyx_v_first_ellipsis_index >= 0);
13193 /* "View.MemoryView":745
13195 * if first_ellipsis_index >= 0:
13196 * result = [slice(None)] * ndim # <<<<<<<<<<<<<<
13198 * for idx in range(first_ellipsis_index):
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);
13209 __pyx_v_result = ((PyObject*)__pyx_t_1);
13212 /* "View.MemoryView":747
13213 * result = [slice(None)] * ndim
13215 * for idx in range(first_ellipsis_index): # <<<<<<<<<<<<<<
13216 * result[idx] = index_tuple[idx]
13220 __pyx_t_2 = __pyx_v_first_ellipsis_index;
13221 __pyx_t_6 = __pyx_t_2;
13223 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
13224 __pyx_v_idx = __pyx_t_7;
13226 /* "View.MemoryView":748
13228 * for idx in range(first_ellipsis_index):
13229 * result[idx] = index_tuple[idx] # <<<<<<<<<<<<<<
13231 * indices_from_ellipsis = len(index_tuple) - first_ellipsis_index
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;
13240 /* "View.MemoryView":750
13241 * result[idx] = index_tuple[idx]
13243 * indices_from_ellipsis = len(index_tuple) - first_ellipsis_index # <<<<<<<<<<<<<<
13244 * ellipsis_end = ndim - indices_from_ellipsis
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);
13251 /* "View.MemoryView":751
13253 * indices_from_ellipsis = len(index_tuple) - first_ellipsis_index
13254 * ellipsis_end = ndim - indices_from_ellipsis # <<<<<<<<<<<<<<
13256 * for idx in range(1, indices_from_ellipsis):
13258 __pyx_v_ellipsis_end = (__pyx_v_ndim - __pyx_v_indices_from_ellipsis);
13260 /* "View.MemoryView":753
13261 * ellipsis_end = ndim - indices_from_ellipsis
13263 * for idx in range(1, indices_from_ellipsis): # <<<<<<<<<<<<<<
13264 * item = index_tuple[first_ellipsis_index + idx]
13265 * if item is not Ellipsis:
13268 __pyx_t_2 = __pyx_v_indices_from_ellipsis;
13269 __pyx_t_6 = __pyx_t_2;
13271 for (__pyx_t_7 = 1; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
13272 __pyx_v_idx = __pyx_t_7;
13274 /* "View.MemoryView":754
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
13281 __pyx_t_8 = (__pyx_v_first_ellipsis_index + __pyx_v_idx);
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);
13286 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1);
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
13296 __pyx_t_4 = (__pyx_v_item != __pyx_builtin_Ellipsis);
13300 /* "View.MemoryView":756
13301 * item = index_tuple[first_ellipsis_index + idx]
13302 * if item is not Ellipsis:
13303 * result[ellipsis_end + idx] = item # <<<<<<<<<<<<<<
13305 * index_tuple = tuple(result)
13307 __pyx_t_8 = (__pyx_v_ellipsis_end + __pyx_v_idx);
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)
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
13323 /* "View.MemoryView":758
13324 * result[ellipsis_end + idx] = item
13326 * index_tuple = tuple(result) # <<<<<<<<<<<<<<
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));
13335 /* "View.MemoryView":744
13338 * if first_ellipsis_index >= 0: # <<<<<<<<<<<<<<
13339 * result = [slice(None)] * ndim
13345 /* "View.MemoryView":760
13346 * index_tuple = tuple(result)
13348 * elif ndim > idx: # <<<<<<<<<<<<<<
13350 * have_slices = True
13352 __pyx_t_4 = (__pyx_v_ndim > __pyx_v_idx);
13357 /* "View.MemoryView":762
13360 * have_slices = True # <<<<<<<<<<<<<<
13361 * index_tuple += (slice(None),) * (ndim - idx)
13364 __pyx_v_have_slices = 1;
13366 /* "View.MemoryView":763
13368 * have_slices = True
13369 * index_tuple += (slice(None),) * (ndim - idx) # <<<<<<<<<<<<<<
13371 * return have_slices, index_tuple
13373 __pyx_t_2 = (__pyx_v_ndim - __pyx_v_idx);
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);
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));
13384 /* "View.MemoryView":760
13385 * index_tuple = tuple(result)
13387 * elif ndim > idx: # <<<<<<<<<<<<<<
13389 * have_slices = True
13394 /* "View.MemoryView":765
13395 * index_tuple += (slice(None),) * (ndim - idx)
13397 * return have_slices, index_tuple # <<<<<<<<<<<<<<
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);
13412 PyObject *__pyx_temp;
13414 __pyx_temp = __pyx_r;
13415 __pyx_r = ((PyObject*)__pyx_t_1);
13417 __Pyx_XDECREF(__pyx_temp);
13422 /* "View.MemoryView":723
13425 * cdef tuple[bint, tuple] _unellipsify_index_tuple(index_tuple: tuple, int ndim): # <<<<<<<<<<<<<<
13427 * Replace all ellipses with full slices and fill incomplete indices with full slices.
13430 /* function exit code */
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);
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();
13450/* "View.MemoryView":768
13453 * cdef tuple[bint, tuple] _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
13455 * Replace all ellipses with full slices and fill incomplete indices with full slices.
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
13464 PyObject *__pyx_t_2 = NULL;
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);
13474 /* "View.MemoryView":773
13477 * have_slices = False # <<<<<<<<<<<<<<
13479 * if index is Ellipsis:
13481 __pyx_v_have_slices = 0;
13483 /* "View.MemoryView":775
13484 * have_slices = False
13486 * if index is Ellipsis: # <<<<<<<<<<<<<<
13487 * have_slices = True
13488 * result = (slice(None),) * ndim
13490 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
13494 /* "View.MemoryView":776
13496 * if index is Ellipsis:
13497 * have_slices = True # <<<<<<<<<<<<<<
13498 * result = (slice(None),) * ndim
13501 __pyx_v_have_slices = 1;
13503 /* "View.MemoryView":777
13504 * if index is Ellipsis:
13505 * have_slices = True
13506 * result = (slice(None),) * ndim # <<<<<<<<<<<<<<
13508 * elif isinstance(index, tuple):
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);
13515 /* "View.MemoryView":775
13516 * have_slices = False
13518 * if index is Ellipsis: # <<<<<<<<<<<<<<
13519 * have_slices = True
13520 * result = (slice(None),) * ndim
13525 /* "View.MemoryView":779
13526 * result = (slice(None),) * ndim
13528 * elif isinstance(index, tuple): # <<<<<<<<<<<<<<
13529 * return _unellipsify_index_tuple(<tuple> index, ndim)
13532 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
13536 /* "View.MemoryView":780
13538 * elif isinstance(index, tuple):
13539 * return _unellipsify_index_tuple(<tuple> index, ndim) # <<<<<<<<<<<<<<
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)
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);
13550 PyObject *__pyx_temp;
13552 __pyx_temp = __pyx_r;
13553 __pyx_r = ((PyObject*)__pyx_t_2);
13555 __Pyx_XDECREF(__pyx_temp);
13560 /* "View.MemoryView":779
13561 * result = (slice(None),) * ndim
13563 * elif isinstance(index, tuple): # <<<<<<<<<<<<<<
13564 * return _unellipsify_index_tuple(<tuple> index, ndim)
13569 /* "View.MemoryView":783
13572 * if isinstance(index, slice): # <<<<<<<<<<<<<<
13573 * have_slices = True
13574 * elif cython.unlikely(not PyIndex_Check(index)):
13577 __pyx_t_1 = PySlice_Check(__pyx_v_index);
13581 /* "View.MemoryView":784
13583 * if isinstance(index, slice):
13584 * have_slices = True # <<<<<<<<<<<<<<
13585 * elif cython.unlikely(not PyIndex_Check(index)):
13586 * _err_invalid_index(index)
13588 __pyx_v_have_slices = 1;
13590 /* "View.MemoryView":783
13593 * if isinstance(index, slice): # <<<<<<<<<<<<<<
13594 * have_slices = True
13595 * elif cython.unlikely(not PyIndex_Check(index)):
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)
13607 __pyx_t_1 = (!(PyIndex_Check(__pyx_v_index) != 0));
13609 if (unlikely(__pyx_t_1)) {
13612 /* "View.MemoryView":786
13613 * have_slices = True
13614 * elif cython.unlikely(not PyIndex_Check(index)):
13615 * _err_invalid_index(index) # <<<<<<<<<<<<<<
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)
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)
13632 /* "View.MemoryView":789
13635 * if ndim == 1: # <<<<<<<<<<<<<<
13636 * result = (index,)
13639 switch (__pyx_v_ndim) {
13642 /* "View.MemoryView":790
13645 * result = (index,) # <<<<<<<<<<<<<<
13647 * have_slices = True
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);
13657 /* "View.MemoryView":789
13660 * if ndim == 1: # <<<<<<<<<<<<<<
13661 * result = (index,)
13667 /* "View.MemoryView":792
13668 * result = (index,)
13670 * have_slices = True # <<<<<<<<<<<<<<
13671 * result = (index, slice(None))
13674 __pyx_v_have_slices = 1;
13676 /* "View.MemoryView":793
13678 * have_slices = True
13679 * result = (index, slice(None)) # <<<<<<<<<<<<<<
13681 * have_slices = True
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);
13694 /* "View.MemoryView":791
13696 * result = (index,)
13697 * elif ndim == 2: # <<<<<<<<<<<<<<
13698 * have_slices = True
13699 * result = (index, slice(None))
13704 /* "View.MemoryView":795
13705 * result = (index, slice(None))
13707 * have_slices = True # <<<<<<<<<<<<<<
13708 * result = (index,) + (slice(None),) * (ndim - 1)
13711 __pyx_v_have_slices = 1;
13713 /* "View.MemoryView":796
13715 * have_slices = True
13716 * result = (index,) + (slice(None),) * (ndim - 1) # <<<<<<<<<<<<<<
13718 * return have_slices, result
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);
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);
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);
13741 /* "View.MemoryView":798
13742 * result = (index,) + (slice(None),) * (ndim - 1)
13744 * return have_slices, result # <<<<<<<<<<<<<<
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);
13759 PyObject *__pyx_temp;
13761 __pyx_temp = __pyx_r;
13762 __pyx_r = ((PyObject*)__pyx_t_5);
13764 __Pyx_XDECREF(__pyx_temp);
13769 /* "View.MemoryView":768
13772 * cdef tuple[bint, tuple] _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
13774 * Replace all ellipses with full slices and fill incomplete indices with full slices.
13777 /* function exit code */
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);
13785 __Pyx_XDECREF(__pyx_v_result);
13787 __Pyx_XGIVEREF(__pyx_r);
13788 __Pyx_RefNannyFinishContext();
13792/* "View.MemoryView":801
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):
13800static int assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
13801 Py_ssize_t __pyx_v_suboffset;
13803 Py_ssize_t *__pyx_t_1;
13804 Py_ssize_t *__pyx_t_2;
13805 Py_ssize_t *__pyx_t_3;
13808 int __pyx_lineno = 0;
13809 const char *__pyx_filename = NULL;
13810 int __pyx_clineno = 0;
13812 /* "View.MemoryView":802
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")
13819 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
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]);
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
13832 __pyx_t_4 = (__pyx_v_suboffset >= 0);
13834 if (unlikely(__pyx_t_4)) {
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
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)
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
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 # <<<<<<<<<<<<<<
13871 /* "View.MemoryView":801
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):
13879 /* function exit code */
13881 __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
13889/* "View.MemoryView":811
13892 * @cname('__pyx_memview_slice
') # <<<<<<<<<<<<<<
13893 * cdef memoryview memview_slice(memoryview memview, tuple indices):
13894 * cdef int new_ndim = 0, suboffset_dim = -1, dim
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;
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
13918 PyObject *__pyx_t_2 = NULL;
13919 struct __pyx_memoryview_obj *__pyx_t_3;
13922 Py_ssize_t __pyx_t_6;
13923 PyObject *__pyx_t_7 = NULL;
13924 Py_ssize_t __pyx_t_8;
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);
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
13939 __pyx_v_new_ndim = 0;
13940 __pyx_v_suboffset_dim = -1;
13942 /* "View.MemoryView":820
13945 * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
13947 * cdef _memoryviewslice memviewsliceobj
13949 (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
13951 /* "View.MemoryView":824
13952 * cdef _memoryviewslice memviewsliceobj
13954 * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
13956 * if isinstance(memview, _memoryviewslice):
13958 #ifndef CYTHON_WITHOUT_ASSERTIONS
13959 if (unlikely(__pyx_assertions_enabled())) {
13960 __pyx_t_1 = (__pyx_v_memview->view.ndim > 0);
13962 if (unlikely(!__pyx_t_1)) {
13963 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
13964 __PYX_ERR(1, 824, __pyx_L1_error)
13969 if ((1)); else __PYX_ERR(1, 824, __pyx_L1_error)
13972 /* "View.MemoryView":826
13973 * assert memview.view.ndim > 0
13975 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13976 * memviewsliceobj = memview
13977 * p_src = &memviewsliceobj.from_slice
13979 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
13983 /* "View.MemoryView":827
13985 * if isinstance(memview, _memoryviewslice):
13986 * memviewsliceobj = memview # <<<<<<<<<<<<<<
13987 * p_src = &memviewsliceobj.from_slice
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);
13996 /* "View.MemoryView":828
13997 * if isinstance(memview, _memoryviewslice):
13998 * memviewsliceobj = memview
13999 * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
14001 * slice_copy(memview, &src)
14003 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
14005 /* "View.MemoryView":826
14006 * assert memview.view.ndim > 0
14008 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14009 * memviewsliceobj = memview
14010 * p_src = &memviewsliceobj.from_slice
14015 /* "View.MemoryView":830
14016 * p_src = &memviewsliceobj.from_slice
14018 * slice_copy(memview, &src) # <<<<<<<<<<<<<<
14023 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
14025 /* "View.MemoryView":831
14027 * slice_copy(memview, &src)
14028 * p_src = &src # <<<<<<<<<<<<<<
14032 __pyx_v_p_src = (&__pyx_v_src);
14036 /* "View.MemoryView":837
14039 * dst.memview = p_src.memview # <<<<<<<<<<<<<<
14040 * dst.data = p_src.data
14043 __pyx_t_3 = __pyx_v_p_src->memview;
14045 __pyx_v_dst.memview = __pyx_t_3;
14047 /* "View.MemoryView":838
14049 * dst.memview = p_src.memview
14050 * dst.data = p_src.data # <<<<<<<<<<<<<<
14054 __pyx_t_4 = __pyx_v_p_src->data;
14056 __pyx_v_dst.data = __pyx_t_4;
14058 /* "View.MemoryView":843
14061 * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
14062 * cdef int *p_suboffset_dim = &suboffset_dim
14063 * cdef Py_ssize_t start, stop, step, cindex
14065 __pyx_v_p_dst = (&__pyx_v_dst);
14067 /* "View.MemoryView":844
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
14074 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
14076 /* "View.MemoryView":848
14077 * cdef bint have_start, have_stop, have_step
14079 * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
14080 * if PyIndex_Check(index):
14085 __pyx_t_2 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_2);
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)
14093 if (__pyx_t_6 >= __pyx_temp) break;
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));
14098 __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_2, __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);
14105 __pyx_v_dim = __pyx_t_5;
14106 __pyx_t_5 = (__pyx_t_5 + 1);
14108 /* "View.MemoryView":849
14110 * for dim, index in enumerate(indices):
14111 * if PyIndex_Check(index): # <<<<<<<<<<<<<<
14113 * slice_memviewslice(
14115 __pyx_t_1 = (PyIndex_Check(__pyx_v_index) != 0);
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],
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;
14130 /* "View.MemoryView":851
14131 * if PyIndex_Check(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,
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)
14140 /* "View.MemoryView":849
14142 * for dim, index in enumerate(indices):
14143 * if PyIndex_Check(index): # <<<<<<<<<<<<<<
14145 * slice_memviewslice(
14150 /* "View.MemoryView":857
14151 * 0, 0, 0, # have_{start,stop,step}
14153 * elif index is None: # <<<<<<<<<<<<<<
14154 * p_dst.shape[new_ndim] = 1
14155 * p_dst.strides[new_ndim] = 0
14157 __pyx_t_1 = (__pyx_v_index == Py_None);
14161 /* "View.MemoryView":858
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
14168 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
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
14177 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
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 # <<<<<<<<<<<<<<
14186 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
14188 /* "View.MemoryView":861
14189 * p_dst.strides[new_ndim] = 0
14190 * p_dst.suboffsets[new_ndim] = -1
14191 * new_ndim += 1 # <<<<<<<<<<<<<<
14193 * start = index.start or 0
14195 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
14197 /* "View.MemoryView":857
14198 * 0, 0, 0, # have_{start,stop,step}
14200 * elif index is None: # <<<<<<<<<<<<<<
14201 * p_dst.shape[new_ndim] = 1
14202 * p_dst.strides[new_ndim] = 0
14207 /* "View.MemoryView":863
14210 * start = index.start or 0 # <<<<<<<<<<<<<<
14211 * stop = index.stop or 0
14212 * step = index.step or 0
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)
14219 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
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;
14228 __pyx_L7_bool_binop_done:;
14229 __pyx_v_start = __pyx_t_8;
14231 /* "View.MemoryView":864
14233 * start = index.start or 0
14234 * stop = index.stop or 0 # <<<<<<<<<<<<<<
14235 * step = index.step or 0
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)
14242 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
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;
14251 __pyx_L9_bool_binop_done:;
14252 __pyx_v_stop = __pyx_t_8;
14254 /* "View.MemoryView":865
14255 * start = index.start or 0
14256 * stop = index.stop or 0
14257 * step = index.step or 0 # <<<<<<<<<<<<<<
14259 * have_start = index.start is not None
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)
14265 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
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;
14274 __pyx_L11_bool_binop_done:;
14275 __pyx_v_step = __pyx_t_8;
14277 /* "View.MemoryView":867
14278 * step = index.step or 0
14280 * have_start = index.start is not None # <<<<<<<<<<<<<<
14281 * have_stop = index.stop is not None
14282 * have_step = index.step is not None
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;
14290 /* "View.MemoryView":868
14292 * have_start = index.start is not None
14293 * have_stop = index.stop is not None # <<<<<<<<<<<<<<
14294 * have_step = index.step is not None
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;
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 # <<<<<<<<<<<<<<
14308 * slice_memviewslice(
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;
14316 /* "View.MemoryView":871
14317 * have_step = index.step is not None
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,
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)
14326 /* "View.MemoryView":877
14327 * have_start, have_stop, have_step,
14329 * new_ndim += 1 # <<<<<<<<<<<<<<
14331 * if isinstance(memview, _memoryviewslice):
14333 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
14337 /* "View.MemoryView":848
14338 * cdef bint have_start, have_stop, have_step
14340 * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
14341 * if PyIndex_Check(index):
14345 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14347 /* "View.MemoryView":879
14350 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14351 * return memoryview_fromslice(dst, new_ndim,
14352 * memviewsliceobj.to_object_func,
14354 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
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)
14365 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 881, __pyx_L1_error) }
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)
14374 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 882, __pyx_L1_error) }
14376 /* "View.MemoryView":880
14378 * if isinstance(memview, _memoryviewslice):
14379 * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
14380 * memviewsliceobj.to_object_func,
14381 * memviewsliceobj.to_dtype_func,
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)
14387 struct __pyx_memoryview_obj *__pyx_temp;
14389 __pyx_temp = __pyx_r;
14390 __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
14392 __Pyx_XDECREF((PyObject *)__pyx_temp);
14397 /* "View.MemoryView":879
14400 * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14401 * return memoryview_fromslice(dst, new_ndim,
14402 * memviewsliceobj.to_object_func,
14406 /* "View.MemoryView":885
14407 * memview.dtype_is_object)
14409 * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
14410 * memview.dtype_is_object)
14415 /* "View.MemoryView":886
14417 * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
14418 * memview.dtype_is_object) # <<<<<<<<<<<<<<
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);
14425 /* "View.MemoryView":885
14426 * memview.dtype_is_object)
14428 * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
14429 * memview.dtype_is_object)
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)
14434 struct __pyx_memoryview_obj *__pyx_temp;
14436 __pyx_temp = __pyx_r;
14437 __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
14439 __Pyx_XDECREF((PyObject *)__pyx_temp);
14445 /* "View.MemoryView":811
14448 * @cname('__pyx_memview_slice
') # <<<<<<<<<<<<<<
14449 * cdef memoryview memview_slice(memoryview memview, tuple indices):
14450 * cdef int new_ndim = 0, suboffset_dim = -1, dim
14453 /* function exit code */
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);
14466 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
14476 __Pyx_XDECREF(__pyx_v_index);
14477 __Pyx_XGIVEREF((PyObject *)__pyx_r);
14478 __Pyx_RefNannyFinishContext();
14482/* "View.MemoryView":892
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:
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;
14497 Py_ssize_t __pyx_t_1;
14500 int __pyx_lineno = 0;
14501 const char *__pyx_filename = NULL;
14502 int __pyx_clineno = 0;
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
14512 __pyx_v_suboffset = -1L;
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
14521 __pyx_t_1 = __pyx_v_view->itemsize;
14523 __pyx_v_itemsize = __pyx_t_1;
14525 /* "View.MemoryView":899
14526 * cdef char *resultp
14528 * if view.ndim == 0: # <<<<<<<<<<<<<<
14529 * shape = view.len // itemsize
14530 * stride = itemsize
14532 __pyx_t_2 = (__pyx_v_view->ndim == 0);
14537 /* "View.MemoryView":900
14539 * if view.ndim == 0:
14540 * shape = view.len // itemsize # <<<<<<<<<<<<<<
14541 * stride = itemsize
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)
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)
14552 __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize, 0);
14554 /* "View.MemoryView":901
14555 * if view.ndim == 0:
14556 * shape = view.len // itemsize
14557 * stride = itemsize # <<<<<<<<<<<<<<
14559 * shape = view.shape[dim]
14561 __pyx_v_stride = __pyx_v_itemsize;
14563 /* "View.MemoryView":899
14564 * cdef char *resultp
14566 * if view.ndim == 0: # <<<<<<<<<<<<<<
14567 * shape = view.len // itemsize
14568 * stride = itemsize
14573 /* "View.MemoryView":903
14574 * stride = itemsize
14576 * shape = view.shape[dim] # <<<<<<<<<<<<<<
14577 * stride = view.strides[dim]
14578 * if view.suboffsets != NULL:
14581 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
14583 /* "View.MemoryView":904
14585 * shape = view.shape[dim]
14586 * stride = view.strides[dim] # <<<<<<<<<<<<<<
14587 * if view.suboffsets != NULL:
14588 * suboffset = view.suboffsets[dim]
14590 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
14592 /* "View.MemoryView":905
14593 * shape = view.shape[dim]
14594 * stride = view.strides[dim]
14595 * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
14596 * suboffset = view.suboffsets[dim]
14599 __pyx_t_2 = (__pyx_v_view->suboffsets != NULL);
14604 /* "View.MemoryView":906
14605 * stride = view.strides[dim]
14606 * if view.suboffsets != NULL:
14607 * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
14611 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
14613 /* "View.MemoryView":905
14614 * shape = view.shape[dim]
14615 * stride = view.strides[dim]
14616 * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
14617 * suboffset = view.suboffsets[dim]
14624 /* "View.MemoryView":908
14625 * suboffset = view.suboffsets[dim]
14627 * if index < 0: # <<<<<<<<<<<<<<
14628 * index += view.shape[dim]
14629 * if cython.unlikely(index < 0):
14631 __pyx_t_2 = (__pyx_v_index < 0);
14636 /* "View.MemoryView":909
14639 * index += view.shape[dim] # <<<<<<<<<<<<<<
14640 * if cython.unlikely(index < 0):
14641 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14643 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
14645 /* "View.MemoryView":910
14647 * index += view.shape[dim]
14648 * if cython.unlikely(index < 0): # <<<<<<<<<<<<<<
14649 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14652 __pyx_t_2 = (__pyx_v_index < 0);
14654 if (unlikely(__pyx_t_2)) {
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) # <<<<<<<<<<<<<<
14662 * if cython.unlikely(index >= shape):
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)
14667 /* "View.MemoryView":910
14669 * index += view.shape[dim]
14670 * if cython.unlikely(index < 0): # <<<<<<<<<<<<<<
14671 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14676 /* "View.MemoryView":908
14677 * suboffset = view.suboffsets[dim]
14679 * if index < 0: # <<<<<<<<<<<<<<
14680 * index += view.shape[dim]
14681 * if cython.unlikely(index < 0):
14685 /* "View.MemoryView":913
14686 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14688 * if cython.unlikely(index >= shape): # <<<<<<<<<<<<<<
14689 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14692 __pyx_t_2 = (__pyx_v_index >= __pyx_v_shape);
14694 if (unlikely(__pyx_t_2)) {
14697 /* "View.MemoryView":914
14699 * if cython.unlikely(index >= shape):
14700 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim) # <<<<<<<<<<<<<<
14702 * resultp = bufp + index * stride
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)
14707 /* "View.MemoryView":913
14708 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14710 * if cython.unlikely(index >= shape): # <<<<<<<<<<<<<<
14711 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14716 /* "View.MemoryView":916
14717 * _err_IndexError("Out of bounds on buffer access (axis %zd)", dim)
14719 * resultp = bufp + index * stride # <<<<<<<<<<<<<<
14720 * if suboffset >= 0:
14721 * resultp = (<char **> resultp)[0] + suboffset
14723 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
14725 /* "View.MemoryView":917
14727 * resultp = bufp + index * stride
14728 * if suboffset >= 0: # <<<<<<<<<<<<<<
14729 * resultp = (<char **> resultp)[0] + suboffset
14732 __pyx_t_2 = (__pyx_v_suboffset >= 0);
14737 /* "View.MemoryView":918
14738 * resultp = bufp + index * stride
14739 * if suboffset >= 0:
14740 * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
14744 __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
14746 /* "View.MemoryView":917
14748 * resultp = bufp + index * stride
14749 * if suboffset >= 0: # <<<<<<<<<<<<<<
14750 * resultp = (<char **> resultp)[0] + suboffset
14755 /* "View.MemoryView":920
14756 * resultp = (<char **> resultp)[0] + suboffset
14758 * return resultp # <<<<<<<<<<<<<<
14764 __pyx_r = __pyx_v_resultp;
14768 /* "View.MemoryView":892
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:
14776 /* function exit code */
14778 __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
14791/* "View.MemoryView":925
14794 * @cname('__pyx_memslice_transpose
') # <<<<<<<<<<<<<<
14795 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
14796 * cdef int ndim = memslice.memview.view.ndim
14799static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
14801 Py_ssize_t *__pyx_v_shape;
14802 Py_ssize_t *__pyx_v_strides;
14807 Py_ssize_t *__pyx_t_2;
14810 Py_ssize_t __pyx_t_5;
14811 Py_ssize_t __pyx_t_6;
14815 int __pyx_lineno = 0;
14816 const char *__pyx_filename = NULL;
14817 int __pyx_clineno = 0;
14818 PyGILState_STATE __pyx_gilstate_save;
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 # <<<<<<<<<<<<<<
14825 * cdef Py_ssize_t *shape = memslice.shape
14827 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
14829 __pyx_v_ndim = __pyx_t_1;
14831 /* "View.MemoryView":929
14832 * cdef int ndim = memslice.memview.view.ndim
14834 * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
14835 * cdef Py_ssize_t *strides = memslice.strides
14838 __pyx_t_2 = __pyx_v_memslice->shape;
14840 __pyx_v_shape = __pyx_t_2;
14842 /* "View.MemoryView":930
14844 * cdef Py_ssize_t *shape = memslice.shape
14845 * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
14849 __pyx_t_2 = __pyx_v_memslice->strides;
14851 __pyx_v_strides = __pyx_t_2;
14853 /* "View.MemoryView":934
14856 * for i in range(ndim // 2): # <<<<<<<<<<<<<<
14858 * strides[i], strides[j] = strides[j], strides[i]
14861 __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2, 1);
14862 __pyx_t_4 = __pyx_t_3;
14864 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
14865 __pyx_v_i = __pyx_t_1;
14867 /* "View.MemoryView":935
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]
14874 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
14876 /* "View.MemoryView":936
14877 * for i in range(ndim // 2):
14879 * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
14880 * shape[i], shape[j] = shape[j], shape[i]
14883 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
14885 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
14887 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
14889 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
14892 /* "View.MemoryView":937
14894 * strides[i], strides[j] = strides[j], strides[i]
14895 * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
14897 * if cython.unlikely(memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0):
14899 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
14901 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
14903 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
14905 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
14908 /* "View.MemoryView":939
14909 * shape[i], shape[j] = shape[j], shape[i]
14911 * if cython.unlikely(memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0): # <<<<<<<<<<<<<<
14912 * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14915 __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0);
14921 __pyx_t_7 = __pyx_t_8;
14923 goto __pyx_L6_bool_binop_done;
14925 __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0);
14928 __pyx_t_7 = __pyx_t_8;
14930 __pyx_L6_bool_binop_done:;
14931 if (unlikely(__pyx_t_7)) {
14934 /* "View.MemoryView":940
14936 * if cython.unlikely(memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0):
14937 * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
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)
14944 /* "View.MemoryView":939
14945 * shape[i], shape[j] = shape[j], shape[i]
14947 * if cython.unlikely(memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0): # <<<<<<<<<<<<<<
14948 * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14955 /* "View.MemoryView":942
14956 * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14958 * return 0 # <<<<<<<<<<<<<<
14968 /* "View.MemoryView":925
14971 * @cname('__pyx_memslice_transpose
') # <<<<<<<<<<<<<<
14972 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
14973 * cdef int ndim = memslice.memview.view.ndim
14976 /* function exit code */
14978 __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
14979 __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14981 __Pyx_PyGILState_Release(__pyx_gilstate_save);
14991/* "View.MemoryView":960
14992 * cdef to_dtype_func_type to_dtype_func
14994 * def __dealloc__(self): # <<<<<<<<<<<<<<
14995 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
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));
15008 /* function exit code */
15009 __Pyx_RefNannyFinishContext();
15012static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
15014 /* "View.MemoryView":961
15016 * def __dealloc__(self):
15017 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
15019 * cdef convert_item_to_object(self, char *itemp):
15021 __PYX_XCLEAR_MEMVIEW((&__pyx_v_self->from_slice), 1);
15023 /* "View.MemoryView":960
15024 * cdef to_dtype_func_type to_dtype_func
15026 * def __dealloc__(self): # <<<<<<<<<<<<<<
15027 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
15031 /* function exit code */
15035/* "View.MemoryView":963
15036 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
15038 * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
15039 * if self.to_object_func != NULL:
15040 * return self.to_object_func(itemp)
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
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);
15053 /* "View.MemoryView":964
15055 * cdef convert_item_to_object(self, char *itemp):
15056 * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
15057 * return self.to_object_func(itemp)
15060 __pyx_t_1 = (__pyx_v_self->to_object_func != NULL);
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) # <<<<<<<<<<<<<<
15070 * return memoryview.convert_item_to_object(self, itemp)
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);
15075 PyObject *__pyx_temp;
15077 __pyx_temp = __pyx_r;
15078 __pyx_r = __pyx_t_2;
15080 __Pyx_XDECREF(__pyx_temp);
15085 /* "View.MemoryView":964
15087 * cdef convert_item_to_object(self, char *itemp):
15088 * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
15089 * return self.to_object_func(itemp)
15094 /* "View.MemoryView":967
15095 * return self.to_object_func(itemp)
15097 * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
15099 * cdef assign_item_from_object(self, char *itemp, object value):
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);
15105 PyObject *__pyx_temp;
15107 __pyx_temp = __pyx_r;
15108 __pyx_r = __pyx_t_2;
15110 __Pyx_XDECREF(__pyx_temp);
15116 /* "View.MemoryView":963
15117 * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
15119 * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
15120 * if self.to_object_func != NULL:
15121 * return self.to_object_func(itemp)
15124 /* function exit code */
15126 __Pyx_XDECREF(__pyx_t_2);
15127 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
15130 __Pyx_XGIVEREF(__pyx_r);
15131 __Pyx_RefNannyFinishContext();
15135/* "View.MemoryView":969
15136 * return memoryview.convert_item_to_object(self, itemp)
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)
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
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);
15154 /* "View.MemoryView":970
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)
15161 __pyx_t_1 = (__pyx_v_self->to_dtype_func != NULL);
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) # <<<<<<<<<<<<<<
15171 * memoryview.assign_item_from_object(self, itemp, value)
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)
15176 /* "View.MemoryView":970
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)
15186 /* "View.MemoryView":973
15187 * self.to_dtype_func(itemp, value)
15189 * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
15191 * cdef _get_base(self):
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;
15200 /* "View.MemoryView":969
15201 * return memoryview.convert_item_to_object(self, itemp)
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)
15208 /* function exit code */
15209 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15212 __Pyx_XDECREF(__pyx_t_3);
15213 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
15216 __Pyx_XGIVEREF(__pyx_r);
15217 __Pyx_RefNannyFinishContext();
15221/* "View.MemoryView":975
15222 * memoryview.assign_item_from_object(self, itemp, value)
15224 * cdef _get_base(self): # <<<<<<<<<<<<<<
15225 * return self.from_object
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);
15234 /* "View.MemoryView":976
15236 * cdef _get_base(self):
15237 * return self.from_object # <<<<<<<<<<<<<<
15242 PyObject *__pyx_temp;
15244 __pyx_temp = __pyx_r;
15245 __Pyx_INCREF(__pyx_v_self->from_object);
15246 __pyx_r = __pyx_v_self->from_object;
15248 __Pyx_XDECREF(__pyx_temp);
15252 /* "View.MemoryView":975
15253 * memoryview.assign_item_from_object(self, itemp, value)
15255 * cdef _get_base(self): # <<<<<<<<<<<<<<
15256 * return self.from_object
15260 /* function exit code */
15262 __Pyx_XGIVEREF(__pyx_r);
15263 __Pyx_RefNannyFinishContext();
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):
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
15278PyObject *__pyx_args, PyObject *__pyx_kwds
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
15285PyObject *__pyx_args, PyObject *__pyx_kwds
15288 #if !CYTHON_VECTORCALL
15289 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
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);
15299 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
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));
15309 /* function exit code */
15310 __Pyx_RefNannyFinishContext();
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);
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__"
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)
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):
15337 /* function exit code */
15339 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15341 __Pyx_XGIVEREF(__pyx_r);
15342 __Pyx_RefNannyFinishContext();
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__"
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
15358PyObject *__pyx_args, PyObject *__pyx_kwds
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
15365PyObject *__pyx_args, PyObject *__pyx_kwds
15368 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
15369 #if !CYTHON_VECTORCALL
15370 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
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);
15384 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
15387 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
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) {
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;
15399 default: goto __pyx_L5_argtuple_error;
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) }
15406 } else if (unlikely(__pyx_nargs != 1)) {
15407 goto __pyx_L5_argtuple_error;
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)
15412 __pyx_v___pyx_state = values[0];
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)
15418 goto __pyx_L4_argument_unpacking_done;
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]);
15423 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15424 __Pyx_RefNannyFinishContext();
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);
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]);
15433 __Pyx_RefNannyFinishContext();
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);
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__" # <<<<<<<<<<<<<<
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)
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__"
15460 /* function exit code */
15462 __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15464 __Pyx_XGIVEREF(__pyx_r);
15465 __Pyx_RefNannyFinishContext();
15469/* "View.MemoryView":995
15470 * pass # ignore failure, it's a minor issue
15472 * @cname(
'__pyx_memoryview_fromslice')
# <<<<<<<<<<<<<<
15473 * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,
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
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);
15504 __pyx_t_1 = (((PyObject *)__pyx_v_memviewslice.memview) == Py_None);
15517 PyObject *__pyx_temp;
15519 __pyx_temp = __pyx_r;
15520 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15522 __Pyx_XDECREF(__pyx_temp);
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);
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);
15568 __pyx_v_result->from_slice = __pyx_v_memviewslice;
15577 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
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;
15601 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
15603 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
15612 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
15614 __pyx_v_result->__pyx_base.view = __pyx_t_5;
15623 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
15632 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
15641 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
15650 Py_INCREF(Py_None);
15659 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
15671 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
15691 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
15702 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
15711 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
15720 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
15729 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
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]);
15742 __pyx_t_1 = (__pyx_v_suboffset >= 0);
15754 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
15763 goto __pyx_L6_break;
15784 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
15786 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
15795 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
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]);
15808 __pyx_v_result->__pyx_base.view.len = (__pyx_v_result->__pyx_base.view.len * __pyx_v_length);
15819 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
15828 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
15838 PyObject *__pyx_temp;
15840 __pyx_temp = __pyx_r;
15841 __Pyx_INCREF((PyObject *)__pyx_v_result);
15842 __pyx_r = ((PyObject *)__pyx_v_result);
15844 __Pyx_XDECREF(__pyx_temp);
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);
15863 __Pyx_XDECREF((PyObject *)__pyx_v_result);
15866 __Pyx_XGIVEREF(__pyx_r);
15867 __Pyx_RefNannyFinishContext();
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
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);
15897 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
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);
15923 __pyx_r = (&__pyx_v_obj->from_slice);
15944 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
15955 __pyx_r = __pyx_v_mslice;
15970 __Pyx_XDECREF(__pyx_t_2);
15971 __Pyx_AddTraceback(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
15974 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
15976 __Pyx_RefNannyFinishContext();
15988static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
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;
15997 Py_ssize_t __pyx_t_5;
16007 __pyx_t_1 = __pyx_v_memview->view.shape;
16009 __pyx_v_shape = __pyx_t_1;
16018 __pyx_t_1 = __pyx_v_memview->view.strides;
16020 __pyx_v_strides = __pyx_t_1;
16029 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
16031 __pyx_v_suboffsets = __pyx_t_1;
16040 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
16049 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
16059 __pyx_t_2 = __pyx_v_memview->view.ndim;
16060 __pyx_t_3 = __pyx_t_2;
16062 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16063 __pyx_v_dim = __pyx_t_4;
16072 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
16081 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
16090 __pyx_t_6 = (__pyx_v_suboffsets != 0);
16094 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
16100 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
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);
16146 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
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);
16158 PyObject *__pyx_temp;
16160 __pyx_temp = __pyx_r;
16161 __pyx_r = __pyx_t_1;
16163 __Pyx_XDECREF(__pyx_temp);
16178 __Pyx_XDECREF(__pyx_t_1);
16179 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
16183 __Pyx_XGIVEREF(__pyx_r);
16184 __Pyx_RefNannyFinishContext();
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
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);
16217 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_mstate_global->__pyx_memoryviewslice_type);
16228 __pyx_t_2 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
16230 __pyx_v_to_object_func = __pyx_t_2;
16239 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
16241 __pyx_v_to_dtype_func = __pyx_t_3;
16261 __pyx_v_to_object_func = NULL;
16270 __pyx_v_to_dtype_func = NULL;
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);
16284 PyObject *__pyx_temp;
16286 __pyx_temp = __pyx_r;
16287 __pyx_r = __pyx_t_4;
16289 __Pyx_XDECREF(__pyx_temp);
16304 __Pyx_XDECREF(__pyx_t_4);
16305 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16310 __Pyx_XGIVEREF(__pyx_r);
16311 __Pyx_RefNannyFinishContext();
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;
16335 __pyx_t_2 = (__pyx_v_arg < 0);
16339 __pyx_t_1 = (-__pyx_v_arg);
16342 __pyx_t_1 = __pyx_v_arg;
16346 __pyx_r = __pyx_t_1;
16371static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
16373 Py_ssize_t __pyx_v_c_stride;
16374 Py_ssize_t __pyx_v_f_stride;
16388 __pyx_v_c_stride = 0;
16397 __pyx_v_f_stride = 0;
16406 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
16407 __pyx_v_i = __pyx_t_1;
16416 __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
16428 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
16437 goto __pyx_L4_break;
16458 __pyx_t_1 = __pyx_v_ndim;
16459 __pyx_t_3 = __pyx_t_1;
16461 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16462 __pyx_v_i = __pyx_t_4;
16471 __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
16483 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
16492 goto __pyx_L7_break;
16513 __pyx_t_2 = (abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride));
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;
16587 Py_ssize_t __pyx_t_3;
16588 Py_ssize_t __pyx_t_4;
16589 Py_ssize_t __pyx_t_5;
16600 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
16609 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
16618 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
16627 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
16636 __pyx_t_1 = (__pyx_v_ndim == 1);
16648 __pyx_t_2 = (__pyx_v_src_stride > 0);
16654 __pyx_t_1 = __pyx_t_2;
16656 goto __pyx_L5_bool_binop_done;
16658 __pyx_t_2 = (__pyx_v_dst_stride > 0);
16664 __pyx_t_1 = __pyx_t_2;
16666 goto __pyx_L5_bool_binop_done;
16676 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
16678 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
16681 __pyx_t_1 = __pyx_t_2;
16683 __pyx_L5_bool_binop_done:;
16702 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * ((
size_t)__pyx_v_dst_extent))));
16723 __pyx_t_3 = __pyx_v_dst_extent;
16724 __pyx_t_4 = __pyx_t_3;
16726 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16727 __pyx_v_i = __pyx_t_5;
16736 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
16745 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16754 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16779 __pyx_t_3 = __pyx_v_dst_extent;
16780 __pyx_t_4 = __pyx_t_3;
16782 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16783 __pyx_v_i = __pyx_t_5;
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);
16801 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16810 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
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) {
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);
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;
16876 Py_ssize_t *__pyx_t_1;
16877 Py_ssize_t *__pyx_t_2;
16878 Py_ssize_t *__pyx_t_3;
16887 __pyx_v_size = ((size_t)__pyx_v_src->memview->view.itemsize);
16896 __pyx_t_2 = (__pyx_v_src->shape + __pyx_v_ndim);
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]);
16909 __pyx_v_size = (__pyx_v_size * ((size_t)__pyx_v_shape));
16922 __pyx_r = __pyx_v_size;
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) {
16951 Py_ssize_t __pyx_r;
16965 __pyx_t_1 = (__pyx_v_order ==
'F');
16978 __pyx_t_2 = __pyx_v_ndim;
16979 __pyx_t_3 = __pyx_t_2;
16981 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16982 __pyx_v_idx = __pyx_t_4;
16991 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
17000 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
17022 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
17023 __pyx_v_idx = __pyx_t_2;
17032 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
17041 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
17055 __pyx_r = __pyx_v_stride;
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) {
17084 void *__pyx_v_result;
17085 size_t __pyx_v_itemsize;
17086 size_t __pyx_v_size;
17090 struct __pyx_memoryview_obj *__pyx_t_3;
17093 int __pyx_lineno = 0;
17094 const char *__pyx_filename = NULL;
17095 int __pyx_clineno = 0;
17096 PyGILState_STATE __pyx_gilstate_save;
17105 __pyx_v_itemsize = ((size_t)__pyx_v_src->memview->view.itemsize);
17114 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
17123 __pyx_v_result = malloc(__pyx_v_size);
17132 __pyx_t_1 = (!(__pyx_v_result != 0));
17134 if (unlikely(__pyx_t_1)) {
17144 __pyx_t_2 = __pyx_memoryview_err_no_memory();
if (unlikely(__pyx_t_2 == ((
int)-1))) __PYX_ERR(1, 1220, __pyx_L1_error)
17163 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
17172 __pyx_t_3 = __pyx_v_src->memview;
17174 __pyx_v_tmpslice->memview = __pyx_t_3;
17184 __pyx_t_2 = __pyx_v_ndim;
17185 __pyx_t_4 = __pyx_t_2;
17187 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
17188 __pyx_v_i = __pyx_t_5;
17197 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
17206 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
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));
17227 __pyx_t_2 = __pyx_v_ndim;
17228 __pyx_t_4 = __pyx_t_2;
17230 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
17231 __pyx_v_i = __pyx_t_5;
17240 __pyx_t_1 = ((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1);
17252 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
17272 __pyx_t_1 = __pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim);
17284 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
17304 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
17317 __pyx_r = __pyx_v_result;
17331 __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17332 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
17334 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17351static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
17353 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17365 (void)(PyErr_Format(PyExc_ValueError, __pyx_k_got_differing_extents_in_dimensi, __pyx_v_i, __pyx_v_extent1, __pyx_v_extent2));
17394 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17406static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char const *__pyx_v_msg,
int __pyx_v_dim) {
17408 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17420 (void)(PyErr_Format(__pyx_v_error, __pyx_v_msg, __pyx_v_dim));
17449 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17461static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char const *__pyx_v_msg) {
17463 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17474 (void)(PyErr_SetString(__pyx_v_error, __pyx_v_msg));
17502 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17514static int __pyx_memoryview_err_no_memory(
void) {
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();
17528 PyErr_NoMemory(); __PYX_ERR(1, 1267, __pyx_L1_error)
17540 __Pyx_AddTraceback(
"View.MemoryView._err_no_memory", __pyx_clineno, __pyx_lineno, __pyx_filename);
17543 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17555static int __pyx_memoryview_err_ValueError(
char const *__pyx_v_msg) {
17565 (void)(PyErr_SetString(PyExc_ValueError, __pyx_v_msg));
17602static int __pyx_memoryview_err_IndexError(
char const *__pyx_v_msg, Py_ssize_t __pyx_v_index) {
17612 (void)(PyErr_Format(PyExc_IndexError, __pyx_v_msg, __pyx_v_index));
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;
17653 char __pyx_v_order;
17654 int __pyx_v_broadcasting;
17655 int __pyx_v_direct_copy;
17656 __Pyx_memviewslice __pyx_v_tmp;
17665 int __pyx_lineno = 0;
17666 const char *__pyx_filename = NULL;
17667 int __pyx_clineno = 0;
17668 PyGILState_STATE __pyx_gilstate_save;
17678 __pyx_v_tmpdata = NULL;
17687 __pyx_v_itemsize = ((size_t)__pyx_v_src.memview->view.itemsize);
17696 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
17705 __pyx_v_broadcasting = 0;
17714 __pyx_v_direct_copy = 0;
17723 __pyx_t_1 = (__pyx_v_src_ndim < __pyx_v_dst_ndim);
17735 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
17754 __pyx_t_1 = (__pyx_v_dst_ndim < __pyx_v_src_ndim);
17766 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
17786 __pyx_t_2 = __pyx_v_dst_ndim;
17788 __pyx_t_3 = __pyx_v_src_ndim;
17789 __pyx_t_1 = (__pyx_t_2 > __pyx_t_3);
17793 __pyx_t_4 = __pyx_t_2;
17796 __pyx_t_4 = __pyx_t_3;
17799 __pyx_v_ndim = __pyx_t_4;
17810 __pyx_t_4 = __pyx_v_ndim;
17811 __pyx_t_2 = __pyx_t_4;
17813 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17814 __pyx_v_i = __pyx_t_3;
17823 __pyx_t_1 = ((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i]));
17835 __pyx_t_1 = ((__pyx_v_src.shape[__pyx_v_i]) == 1);
17837 if (likely(__pyx_t_1)) {
17847 __pyx_v_broadcasting = 1;
17856 (__pyx_v_src.strides[__pyx_v_i]) = 0;
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)
17897 __pyx_t_1 = ((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0);
17899 if (unlikely(__pyx_t_1)) {
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)
17930 __pyx_t_1 = __pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
17942 __pyx_t_1 = (!__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim));
17954 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
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;
17982 __pyx_v_src = __pyx_v_tmp;
18000 __pyx_t_1 = (!__pyx_v_broadcasting);
18012 __pyx_t_1 = __pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim);
18024 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
18043 __pyx_t_1 = __pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim);
18055 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
18074 if (__pyx_v_direct_copy) {
18083 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18092 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
18101 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18110 free(__pyx_v_tmpdata);
18150 __pyx_t_1 = (__pyx_v_order ==
'F');
18152 __pyx_t_1 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
18164 __pyx_t_4 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1344, __pyx_L1_error)
18174 __pyx_t_4 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 1345, __pyx_L1_error)
18193 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18202 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
18211 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18220 free(__pyx_v_tmpdata);
18245 __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18246 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
18248 __Pyx_PyGILState_Release(__pyx_gilstate_save);
18270static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
18272 int __pyx_v_offset;
18284 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
18293 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18294 __pyx_v_i = __pyx_t_1;
18303 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
18312 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
18321 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
18332 __pyx_t_1 = __pyx_v_offset;
18333 __pyx_t_2 = __pyx_t_1;
18335 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
18336 __pyx_v_i = __pyx_t_3;
18345 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
18354 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
18363 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
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) {
18397 if (__pyx_v_dtype_is_object) {
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);
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();
18451 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
18468 __Pyx_PyGILState_Release(__pyx_gilstate_save);
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;
18495 __pyx_v_stride = (__pyx_v_strides[0]);
18505 __pyx_t_1 = (__pyx_v_shape[0]);
18506 __pyx_t_2 = __pyx_t_1;
18508 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
18509 __pyx_v_i = __pyx_t_3;
18518 __pyx_t_4 = (__pyx_v_ndim == 1);
18539 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
18559 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
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);
18592 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
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) {
18628 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
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);
18646 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
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;
18672 Py_ssize_t __pyx_t_2;
18673 Py_ssize_t __pyx_t_3;
18674 Py_ssize_t __pyx_t_4;
18684 __pyx_v_stride = (__pyx_v_strides[0]);
18693 __pyx_v_extent = (__pyx_v_shape[0]);
18702 __pyx_t_1 = (__pyx_v_ndim == 1);
18715 __pyx_t_2 = __pyx_v_extent;
18716 __pyx_t_3 = __pyx_t_2;
18718 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18719 __pyx_v_i = __pyx_t_4;
18728 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
18737 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18760 __pyx_t_2 = __pyx_v_extent;
18761 __pyx_t_3 = __pyx_t_2;
18763 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18764 __pyx_v_i = __pyx_t_4;
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);
18781 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
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
18815PyObject *__pyx_args, PyObject *__pyx_kwds
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
18823PyObject *__pyx_args, PyObject *__pyx_kwds
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;
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);
18844 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
18847 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
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) {
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;
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;
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;
18867 default:
goto __pyx_L5_argtuple_error;
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) }
18874 }
else if (unlikely(__pyx_nargs != 3)) {
18875 goto __pyx_L5_argtuple_error;
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)
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]);
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)
18892 goto __pyx_L4_argument_unpacking_done;
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]);
18897 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18898 __Pyx_RefNannyFinishContext();
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);
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]);
18911 goto __pyx_L7_cleaned_up;
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]);
18916 __pyx_L7_cleaned_up:;
18918 __Pyx_RefNannyFinishContext();
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
18927 PyObject *__pyx_t_2 = NULL;
18928 PyObject *__pyx_t_3 = NULL;
18931 int __pyx_lineno = 0;
18932 const char *__pyx_filename = NULL;
18933 int __pyx_clineno = 0;
18934 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
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)
18953 __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_MemviewEnum_type);
18954 __Pyx_INCREF(__pyx_t_3);
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);
18963 __pyx_v___pyx_result = __pyx_t_2;
18973 __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
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)
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;
19009 PyObject *__pyx_temp;
19011 __pyx_temp = __pyx_r;
19012 __Pyx_INCREF(__pyx_v___pyx_result);
19013 __pyx_r = __pyx_v___pyx_result;
19015 __Pyx_XDECREF(__pyx_temp);
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);
19034 __Pyx_XDECREF(__pyx_v___pyx_result);
19035 __Pyx_XGIVEREF(__pyx_r);
19036 __Pyx_RefNannyFinishContext();
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;
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);
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;
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)
19089 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19092 __Pyx_XDECREF(__pyx_t_1);
19093 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
19096 __Pyx_XGIVEREF(__pyx_r);
19097 __Pyx_RefNannyFinishContext();
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
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;
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);
19142 __pyx_t_1 = (__pyx_v_type->typegroup ==
'S');
19154 #ifndef CYTHON_WITHOUT_ASSERTIONS
19155 if (unlikely(__pyx_assertions_enabled())) {
19156 __pyx_t_1 = (__pyx_v_type->fields != NULL);
19158 if (unlikely(!__pyx_t_1)) {
19159 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
19160 __PYX_ERR(1, 1475, __pyx_L1_error)
19165 if ((1));
else __PYX_ERR(1, 1475, __pyx_L1_error)
19175 #ifndef CYTHON_WITHOUT_ASSERTIONS
19176 if (unlikely(__pyx_assertions_enabled())) {
19177 __pyx_t_1 = (__pyx_v_type->fields->type != NULL);
19179 if (unlikely(!__pyx_t_1)) {
19180 __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
19181 __PYX_ERR(1, 1476, __pyx_L1_error)
19186 if ((1));
else __PYX_ERR(1, 1476, __pyx_L1_error)
19196 __pyx_t_1 = ((__pyx_v_type->flags & __PYX_BUF_FLAGS_PACKED_STRUCT) != 0);
19208 __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__5);
19209 __pyx_v_alignment = __pyx_mstate_global->__pyx_kp_b__5;
19229 __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__6);
19230 __pyx_v_alignment = __pyx_mstate_global->__pyx_kp_b__6;
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);
19256 __pyx_t_3 = __pyx_v_type->fields;
19258 __pyx_v_field = __pyx_t_3;
19268 __pyx_t_1 = (__pyx_v_field->type != 0);
19271 if (!__pyx_t_1)
break;
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));
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;
19314 __pyx_v_field = (__pyx_v_field + 1);
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);
19350 __pyx_v_fmt = __Pyx_TypeInfoToFormat(__pyx_v_type);
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);
19371 __pyx_t_1 = ((__pyx_v_type->arraysize[0]) != 0);
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);
19387 __pyx_t_7 = __pyx_v_type->ndim;
19388 __pyx_t_8 = __pyx_t_7;
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)
19400 __pyx_v_extents = ((PyObject*)__pyx_t_5);
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;
19416 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
19417 __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10[1]);
19420 #if __Pyx_PyUnicode_Join_CAN_USE_KIND_AND_LENGTH
19421 __pyx_t_7 |= __Pyx_PyUnicode_KIND_04(__pyx_t_10[1]);
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));
19453 PyObject *__pyx_temp;
19455 __pyx_temp = __pyx_r;
19456 __Pyx_INCREF(__pyx_v_result);
19457 __pyx_r = __pyx_v_result;
19459 __Pyx_XDECREF(__pyx_temp);
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);
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);
19487 __Pyx_XGIVEREF(__pyx_r);
19488 __Pyx_RefNannyFinishContext();
19500static CYTHON_INLINE PyTypeObject *__pyx_f_5numpy_5dtype_7typeobj___get__(PyArray_Descr *__pyx_v_self) {
19501 PyTypeObject *__pyx_r;
19512 __pyx_r = PyDataType_TYPEOBJ(__pyx_v_self);
19537static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4kind___get__(PyArray_Descr *__pyx_v_self) {
19549 __pyx_r = PyDataType_KIND(__pyx_v_self);
19574static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_4type___get__(PyArray_Descr *__pyx_v_self) {
19586 __pyx_r = PyDataType_TYPE(__pyx_v_self);
19611static CYTHON_INLINE
char __pyx_f_5numpy_5dtype_9byteorder___get__(PyArray_Descr *__pyx_v_self) {
19623 __pyx_r = PyDataType_BYTEORDER(__pyx_v_self);
19648static CYTHON_INLINE
int __pyx_f_5numpy_5dtype_8type_num___get__(PyArray_Descr *__pyx_v_self) {
19660 __pyx_r = PyDataType_TYPENUM(__pyx_v_self);
19685static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize___get__(PyArray_Descr *__pyx_v_self) {
19697 __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
19722static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment___get__(PyArray_Descr *__pyx_v_self) {
19734 __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
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);
19772 __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
19775 PyObject *__pyx_temp;
19777 __pyx_temp = __pyx_r;
19778 __Pyx_INCREF(((PyObject *)__pyx_t_1));
19779 __pyx_r = ((PyObject *)__pyx_t_1);
19781 __Pyx_XDECREF(__pyx_temp);
19796 __Pyx_XGIVEREF(__pyx_r);
19797 __Pyx_RefNannyFinishContext();
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);
19822 __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
19825 PyObject *__pyx_temp;
19827 __pyx_temp = __pyx_r;
19828 __Pyx_INCREF(((PyObject*)__pyx_t_1));
19829 __pyx_r = ((PyObject*)__pyx_t_1);
19831 __Pyx_XDECREF(__pyx_temp);
19846 __Pyx_XGIVEREF(__pyx_r);
19847 __Pyx_RefNannyFinishContext();
19859static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray___get__(PyArray_Descr *__pyx_v_self) {
19860 PyArray_ArrayDescr *__pyx_r;
19871 __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
19896static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags___get__(PyArray_Descr *__pyx_v_self) {
19897 npy_uint64 __pyx_r;
19908 __pyx_r = PyDataType_FLAGS(__pyx_v_self);
19933static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_7numiter___get__(PyArrayMultiIterObject *__pyx_v_self) {
19945 __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
19970static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size___get__(PyArrayMultiIterObject *__pyx_v_self) {
19982 __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
20007static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index___get__(PyArrayMultiIterObject *__pyx_v_self) {
20019 __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
20044static CYTHON_INLINE
int __pyx_f_5numpy_9broadcast_2nd___get__(PyArrayMultiIterObject *__pyx_v_self) {
20056 __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
20081static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions___get__(PyArrayMultiIterObject *__pyx_v_self) {
20093 __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
20118static CYTHON_INLINE
void **__pyx_f_5numpy_9broadcast_5iters___get__(PyArrayMultiIterObject *__pyx_v_self) {
20130 __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
20155static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base___get__(PyArrayObject *__pyx_v_self) {
20167 __pyx_r = PyArray_BASE(__pyx_v_self);
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);
20205 __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
20208 PyArray_Descr *__pyx_temp;
20210 __pyx_temp = __pyx_r;
20211 __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
20212 __pyx_r = ((PyArray_Descr *)__pyx_t_1);
20214 __Pyx_XDECREF((PyObject *)__pyx_temp);
20229 __Pyx_XGIVEREF((PyObject *)__pyx_r);
20230 __Pyx_RefNannyFinishContext();
20242static CYTHON_INLINE
int __pyx_f_5numpy_7ndarray_4ndim___get__(PyArrayObject *__pyx_v_self) {
20254 __pyx_r = PyArray_NDIM(__pyx_v_self);
20279static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape___get__(PyArrayObject *__pyx_v_self) {
20291 __pyx_r = PyArray_DIMS(__pyx_v_self);
20316static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides___get__(PyArrayObject *__pyx_v_self) {
20328 __pyx_r = PyArray_STRIDES(__pyx_v_self);
20353static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size___get__(PyArrayObject *__pyx_v_self) {
20365 __pyx_r = PyArray_SIZE(__pyx_v_self);
20390static CYTHON_INLINE
char *__pyx_f_5numpy_7ndarray_4data___get__(PyArrayObject *__pyx_v_self) {
20402 __pyx_r = PyArray_BYTES(__pyx_v_self);
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);
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);
20446 PyObject *__pyx_temp;
20448 __pyx_temp = __pyx_r;
20449 __pyx_r = __pyx_t_1;
20451 __Pyx_XDECREF(__pyx_temp);
20466 __Pyx_XDECREF(__pyx_t_1);
20467 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
20470 __Pyx_XGIVEREF(__pyx_r);
20471 __Pyx_RefNannyFinishContext();
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);
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);
20502 PyObject *__pyx_temp;
20504 __pyx_temp = __pyx_r;
20505 __pyx_r = __pyx_t_1;
20507 __Pyx_XDECREF(__pyx_temp);
20522 __Pyx_XDECREF(__pyx_t_1);
20523 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
20526 __Pyx_XGIVEREF(__pyx_r);
20527 __Pyx_RefNannyFinishContext();
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);
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);
20558 PyObject *__pyx_temp;
20560 __pyx_temp = __pyx_r;
20561 __pyx_r = __pyx_t_1;
20563 __Pyx_XDECREF(__pyx_temp);
20578 __Pyx_XDECREF(__pyx_t_1);
20579 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
20582 __Pyx_XGIVEREF(__pyx_r);
20583 __Pyx_RefNannyFinishContext();
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);
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);
20614 PyObject *__pyx_temp;
20616 __pyx_temp = __pyx_r;
20617 __pyx_r = __pyx_t_1;
20619 __Pyx_XDECREF(__pyx_temp);
20634 __Pyx_XDECREF(__pyx_t_1);
20635 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
20638 __Pyx_XGIVEREF(__pyx_r);
20639 __Pyx_RefNannyFinishContext();
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);
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);
20670 PyObject *__pyx_temp;
20672 __pyx_temp = __pyx_r;
20673 __pyx_r = __pyx_t_1;
20675 __Pyx_XDECREF(__pyx_temp);
20690 __Pyx_XDECREF(__pyx_t_1);
20691 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
20694 __Pyx_XGIVEREF(__pyx_r);
20695 __Pyx_RefNannyFinishContext();
20707static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
20708 PyObject *__pyx_r = NULL;
20709 __Pyx_RefNannyDeclarations
20711 PyObject *__pyx_t_2;
20712 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
20721 __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
20733 __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray___get__(__pyx_v_d)->shape;
20736 PyObject *__pyx_temp;
20738 __pyx_temp = __pyx_r;
20739 __Pyx_INCREF(((PyObject*)__pyx_t_2));
20740 __pyx_r = ((PyObject*)__pyx_t_2);
20742 __Pyx_XDECREF(__pyx_temp);
20765 PyObject *__pyx_temp;
20767 __pyx_temp = __pyx_r;
20768 __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
20769 __pyx_r = __pyx_mstate_global->__pyx_empty_tuple;
20771 __Pyx_XDECREF(__pyx_temp);
20786 __Pyx_XGIVEREF(__pyx_r);
20787 __Pyx_RefNannyFinishContext();
20799static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_3nin___get__(PyUFuncObject *__pyx_v_self) {
20811 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nin;
20836static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_4nout___get__(PyUFuncObject *__pyx_v_self) {
20848 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nout;
20873static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_5nargs___get__(PyUFuncObject *__pyx_v_self) {
20885 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->nargs;
20910static CYTHON_INLINE PyUFuncGenericFunction *__pyx_f_5numpy_5ufunc_9functions___get__(PyUFuncObject *__pyx_v_self) {
20911 PyUFuncGenericFunction *__pyx_r;
20922 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->functions;
20947static CYTHON_INLINE
void **__pyx_f_5numpy_5ufunc_4data___get__(PyUFuncObject *__pyx_v_self) {
20959 __pyx_r = ((
void **)_PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->data);
20984static CYTHON_INLINE
int __pyx_f_5numpy_5ufunc_6ntypes___get__(PyUFuncObject *__pyx_v_self) {
20996 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ntypes;
21021static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_4name___get__(PyUFuncObject *__pyx_v_self) {
21022 char const *__pyx_r;
21033 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->name;
21058static CYTHON_INLINE
char const *__pyx_f_5numpy_5ufunc_3doc___get__(PyUFuncObject *__pyx_v_self) {
21059 char const *__pyx_r;
21070 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->doc;
21095static CYTHON_INLINE
void *__pyx_f_5numpy_5ufunc_3ptr___get__(PyUFuncObject *__pyx_v_self) {
21107 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->ptr;
21132static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_3obj___get__(PyUFuncObject *__pyx_v_self) {
21144 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->obj;
21169static CYTHON_INLINE PyObject *__pyx_f_5numpy_5ufunc_9userloops___get__(PyUFuncObject *__pyx_v_self) {
21181 __pyx_r = _PyUFuncObject_GET_ITEM_DATA(__pyx_v_self)->userloops;
21206static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
21208 int __pyx_lineno = 0;
21209 const char *__pyx_filename = NULL;
21210 int __pyx_clineno = 0;
21219 Py_INCREF(__pyx_v_base);
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)
21242 __Pyx_AddTraceback(
"numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
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
21260 __Pyx_RefNannySetupContext(
"get_array_base", 0);
21269 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
21278 __pyx_t_1 = (__pyx_v_base == NULL);
21291 PyObject *__pyx_temp;
21293 __pyx_temp = __pyx_r;
21294 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21296 __Pyx_XDECREF(__pyx_temp);
21317 PyObject *__pyx_temp;
21319 __pyx_temp = __pyx_r;
21320 __Pyx_INCREF(((PyObject *)__pyx_v_base));
21321 __pyx_r = ((PyObject *)__pyx_v_base);
21323 __Pyx_XDECREF(__pyx_temp);
21338 __Pyx_XGIVEREF(__pyx_r);
21339 __Pyx_RefNannyFinishContext();
21351static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
21353 __Pyx_RefNannyDeclarations
21354 PyObject *__pyx_t_1 = NULL;
21355 PyObject *__pyx_t_2 = NULL;
21356 PyObject *__pyx_t_3 = NULL;
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;
21364 int __pyx_lineno = 0;
21365 const char *__pyx_filename = NULL;
21366 int __pyx_clineno = 0;
21367 __Pyx_RefNannySetupContext(
"import_array", 0);
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);
21392 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 1079, __pyx_L3_error)
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;
21416 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
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);
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);
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)
21444 goto __pyx_L5_except_error;
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;
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);
21483 __Pyx_RefNannyFinishContext();
21495static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
21497 __Pyx_RefNannyDeclarations
21498 PyObject *__pyx_t_1 = NULL;
21499 PyObject *__pyx_t_2 = NULL;
21500 PyObject *__pyx_t_3 = NULL;
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;
21508 int __pyx_lineno = 0;
21509 const char *__pyx_filename = NULL;
21510 int __pyx_clineno = 0;
21511 __Pyx_RefNannySetupContext(
"import_umath", 0);
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);
21536 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 1085, __pyx_L3_error)
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;
21560 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
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);
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);
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)
21588 goto __pyx_L5_except_error;
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;
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);
21627 __Pyx_RefNannyFinishContext();
21639static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
21641 __Pyx_RefNannyDeclarations
21642 PyObject *__pyx_t_1 = NULL;
21643 PyObject *__pyx_t_2 = NULL;
21644 PyObject *__pyx_t_3 = NULL;
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;
21652 int __pyx_lineno = 0;
21653 const char *__pyx_filename = NULL;
21654 int __pyx_clineno = 0;
21655 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
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);
21680 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 1091, __pyx_L3_error)
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;
21704 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
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);
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);
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)
21732 goto __pyx_L5_except_error;
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;
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);
21771 __Pyx_RefNannyFinishContext();
21783static CYTHON_INLINE
int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
21795 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
21821static CYTHON_INLINE
int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
21833 __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
21859static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
21860 npy_datetime __pyx_r;
21871 __pyx_r = _PyDatetimeScalarObject_GetValue(__pyx_v_obj);
21896static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
21897 npy_timedelta __pyx_r;
21908 __pyx_r = _PyTimedeltaScalarObject_GetValue(__pyx_v_obj);
21933static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
21934 NPY_DATETIMEUNIT __pyx_r;
21945 __pyx_r = _PyDatetimeScalarObject_GetMetadata(__pyx_v_obj).base;
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
21975PyObject *__pyx_args, PyObject *__pyx_kwds
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
21983PyObject *__pyx_args, PyObject *__pyx_kwds
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;
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);
22005 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
22008 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
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) {
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;
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;
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;
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;
22032 default:
goto __pyx_L5_argtuple_error;
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) }
22039 }
else if (unlikely(__pyx_nargs != 4)) {
22040 goto __pyx_L5_argtuple_error;
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)
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]);
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)
22060 goto __pyx_L4_argument_unpacking_done;
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]);
22065 __Pyx_AddTraceback(
"cpartitioning.partitionElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
22066 __Pyx_RefNannyFinishContext();
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);
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]);
22081 goto __pyx_L7_cleaned_up;
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]);
22086 __pyx_L7_cleaned_up:;
22088 __Pyx_RefNannyFinishContext();
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;
22100 PyObject *__pyx_t_6 = NULL;
22101 Py_ssize_t __pyx_t_7;
22102 struct __pyx_array_obj *__pyx_t_8 = NULL;
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);
22124 __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
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;
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;
22158 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
22159 __PYX_ERR(0, 42, __pyx_L1_error)
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)
22168 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_3);
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;
22177 #if CYTHON_UNPACK_METHODS
22178 if (unlikely(PyMethod_Check(__pyx_t_4))) {
22179 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
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);
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);
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;
22214 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
22215 __PYX_ERR(0, 43, __pyx_L1_error)
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)
22224 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_11);
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;
22232 #if CYTHON_UNPACK_METHODS
22233 if (unlikely(PyMethod_Check(__pyx_t_6))) {
22234 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
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);
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);
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;
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;
22276 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
22277 __PYX_ERR(0, 44, __pyx_L1_error)
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)
22286 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_11);
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;
22295 #if CYTHON_UNPACK_METHODS
22296 if (unlikely(PyMethod_Check(__pyx_t_3))) {
22297 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
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);
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);
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;
22332 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
22333 __PYX_ERR(0, 45, __pyx_L1_error)
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)
22342 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_13);
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;
22350 #if CYTHON_UNPACK_METHODS
22351 if (unlikely(PyMethod_Check(__pyx_t_12))) {
22352 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_12);
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);
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);
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;
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;
22394 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
22395 __PYX_ERR(0, 46, __pyx_L1_error)
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)
22404 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_13);
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;
22413 #if CYTHON_UNPACK_METHODS
22414 if (unlikely(PyMethod_Check(__pyx_t_11))) {
22415 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11);
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);
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);
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;
22450 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
22451 __PYX_ERR(0, 47, __pyx_L1_error)
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)
22460 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_15);
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;
22468 #if CYTHON_UNPACK_METHODS
22469 if (unlikely(PyMethod_Check(__pyx_t_14))) {
22470 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_14);
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);
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);
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;
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;
22512 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
22513 __PYX_ERR(0, 48, __pyx_L1_error)
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)
22522 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_15);
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;
22531 #if CYTHON_UNPACK_METHODS
22532 if (unlikely(PyMethod_Check(__pyx_t_13))) {
22533 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_13);
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);
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);
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;
22568 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
22569 __PYX_ERR(0, 49, __pyx_L1_error)
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)
22578 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_17);
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;
22586 #if CYTHON_UNPACK_METHODS
22587 if (unlikely(PyMethod_Check(__pyx_t_16))) {
22588 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_16);
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);
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);
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);
22641 PyObject *__pyx_temp;
22643 __pyx_temp = __pyx_r;
22644 __pyx_r = __pyx_t_16;
22646 __Pyx_XDECREF(__pyx_temp);
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);
22677 __Pyx_XGIVEREF(__pyx_r);
22678 __Pyx_RefNannyFinishContext();
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
22695PyObject *__pyx_args, PyObject *__pyx_kwds
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
22703PyObject *__pyx_args, PyObject *__pyx_kwds
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;
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);
22725 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
22728 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
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) {
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;
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;
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;
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;
22752 default:
goto __pyx_L5_argtuple_error;
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) }
22759 }
else if (unlikely(__pyx_nargs != 4)) {
22760 goto __pyx_L5_argtuple_error;
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)
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]);
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)
22780 goto __pyx_L4_argument_unpacking_done;
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]);
22785 __Pyx_AddTraceback(
"cpartitioning.partitionNodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
22786 __Pyx_RefNannyFinishContext();
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);
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]);
22801 goto __pyx_L7_cleaned_up;
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]);
22806 __pyx_L7_cleaned_up:;
22808 __Pyx_RefNannyFinishContext();
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;
22820 PyObject *__pyx_t_6 = NULL;
22821 Py_ssize_t __pyx_t_7;
22822 struct __pyx_array_obj *__pyx_t_8 = NULL;
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);
22844 __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
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;
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;
22878 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
22879 __PYX_ERR(0, 58, __pyx_L1_error)
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)
22888 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_3);
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;
22897 #if CYTHON_UNPACK_METHODS
22898 if (unlikely(PyMethod_Check(__pyx_t_4))) {
22899 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
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);
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);
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;
22934 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
22935 __PYX_ERR(0, 59, __pyx_L1_error)
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)
22944 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_11);
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;
22952 #if CYTHON_UNPACK_METHODS
22953 if (unlikely(PyMethod_Check(__pyx_t_6))) {
22954 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
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);
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);
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;
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;
22996 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
22997 __PYX_ERR(0, 60, __pyx_L1_error)
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)
23006 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_11);
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;
23015 #if CYTHON_UNPACK_METHODS
23016 if (unlikely(PyMethod_Check(__pyx_t_3))) {
23017 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
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);
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);
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;
23052 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
23053 __PYX_ERR(0, 61, __pyx_L1_error)
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)
23062 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_13);
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;
23070 #if CYTHON_UNPACK_METHODS
23071 if (unlikely(PyMethod_Check(__pyx_t_12))) {
23072 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_12);
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);
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);
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;
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;
23114 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
23115 __PYX_ERR(0, 62, __pyx_L1_error)
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)
23124 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_13);
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;
23133 #if CYTHON_UNPACK_METHODS
23134 if (unlikely(PyMethod_Check(__pyx_t_11))) {
23135 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11);
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);
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);
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;
23170 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
23171 __PYX_ERR(0, 63, __pyx_L1_error)
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)
23180 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_15);
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;
23188 #if CYTHON_UNPACK_METHODS
23189 if (unlikely(PyMethod_Check(__pyx_t_14))) {
23190 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_14);
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);
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);
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;
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;
23232 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
23233 __PYX_ERR(0, 64, __pyx_L1_error)
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)
23242 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_15);
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;
23251 #if CYTHON_UNPACK_METHODS
23252 if (unlikely(PyMethod_Check(__pyx_t_13))) {
23253 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_13);
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);
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);
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;
23288 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
23289 __PYX_ERR(0, 65, __pyx_L1_error)
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)
23298 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_17);
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;
23306 #if CYTHON_UNPACK_METHODS
23307 if (unlikely(PyMethod_Check(__pyx_t_16))) {
23308 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_16);
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);
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);
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);
23361 PyObject *__pyx_temp;
23363 __pyx_temp = __pyx_r;
23364 __pyx_r = __pyx_t_16;
23366 __Pyx_XDECREF(__pyx_temp);
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);
23397 __Pyx_XGIVEREF(__pyx_r);
23398 __Pyx_RefNannyFinishContext();
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
23415PyObject *__pyx_args, PyObject *__pyx_kwds
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
23423PyObject *__pyx_args, PyObject *__pyx_kwds
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;
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);
23444 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
23447 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
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) {
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;
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;
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;
23467 default:
goto __pyx_L5_argtuple_error;
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) }
23474 }
else if (unlikely(__pyx_nargs != 3)) {
23475 goto __pyx_L5_argtuple_error;
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)
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]);
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)
23492 goto __pyx_L4_argument_unpacking_done;
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]);
23497 __Pyx_AddTraceback(
"cpartitioning.convertPUMIPartitionToPython", __pyx_clineno, __pyx_lineno, __pyx_filename);
23498 __Pyx_RefNannyFinishContext();
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);
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]);
23513 goto __pyx_L7_cleaned_up;
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]);
23518 __pyx_L7_cleaned_up:;
23519 __Pyx_RefNannyFinishContext();
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;
23531 PyObject *__pyx_t_6 = NULL;
23532 Py_ssize_t __pyx_t_7;
23533 struct __pyx_array_obj *__pyx_t_8 = NULL;
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);
23555 __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
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;
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;
23580 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
23581 __PYX_ERR(0, 72, __pyx_L1_error)
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)
23590 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_3);
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;
23599 #if CYTHON_UNPACK_METHODS
23600 if (unlikely(PyMethod_Check(__pyx_t_4))) {
23601 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
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);
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);
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;
23636 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
23637 __PYX_ERR(0, 73, __pyx_L1_error)
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)
23646 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_11);
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;
23654 #if CYTHON_UNPACK_METHODS
23655 if (unlikely(PyMethod_Check(__pyx_t_6))) {
23656 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
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);
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);
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;
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;
23698 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
23699 __PYX_ERR(0, 74, __pyx_L1_error)
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)
23708 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_11);
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;
23717 #if CYTHON_UNPACK_METHODS
23718 if (unlikely(PyMethod_Check(__pyx_t_3))) {
23719 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
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);
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);
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;
23754 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
23755 __PYX_ERR(0, 75, __pyx_L1_error)
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)
23764 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_13);
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;
23772 #if CYTHON_UNPACK_METHODS
23773 if (unlikely(PyMethod_Check(__pyx_t_12))) {
23774 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_12);
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);
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);
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;
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;
23816 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
23817 __PYX_ERR(0, 76, __pyx_L1_error)
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)
23826 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_13);
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;
23835 #if CYTHON_UNPACK_METHODS
23836 if (unlikely(PyMethod_Check(__pyx_t_11))) {
23837 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11);
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);
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);
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;
23872 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
23873 __PYX_ERR(0, 77, __pyx_L1_error)
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)
23882 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_15);
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;
23890 #if CYTHON_UNPACK_METHODS
23891 if (unlikely(PyMethod_Check(__pyx_t_14))) {
23892 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_14);
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);
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);
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;
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;
23934 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
23935 __PYX_ERR(0, 78, __pyx_L1_error)
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)
23944 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_15);
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;
23953 #if CYTHON_UNPACK_METHODS
23954 if (unlikely(PyMethod_Check(__pyx_t_13))) {
23955 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_13);
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);
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);
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;
23990 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
23991 __PYX_ERR(0, 79, __pyx_L1_error)
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)
24000 __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_17);
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;
24008 #if CYTHON_UNPACK_METHODS
24009 if (unlikely(PyMethod_Check(__pyx_t_16))) {
24010 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_16);
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);
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);
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);
24063 PyObject *__pyx_temp;
24065 __pyx_temp = __pyx_r;
24066 __pyx_r = __pyx_t_16;
24068 __Pyx_XDECREF(__pyx_temp);
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);
24099 __Pyx_XGIVEREF(__pyx_r);
24100 __Pyx_RefNannyFinishContext();
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
24117PyObject *__pyx_args, PyObject *__pyx_kwds
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
24125PyObject *__pyx_args, PyObject *__pyx_kwds
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;
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);
24150 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
24153 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
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) {
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;
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;
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;
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;
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;
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;
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;
24189 default:
goto __pyx_L5_argtuple_error;
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) }
24196 }
else if (unlikely(__pyx_nargs != 7)) {
24197 goto __pyx_L5_argtuple_error;
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)
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)
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)
24226 goto __pyx_L4_argument_unpacking_done;
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]);
24231 __Pyx_AddTraceback(
"cpartitioning.partitionNodesFromTetgenFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
24232 __Pyx_RefNannyFinishContext();
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);
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]);
24247 goto __pyx_L7_cleaned_up;
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]);
24252 __pyx_L7_cleaned_up:;
24256 __Pyx_RefNannyFinishContext();
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
24265 PyObject *__pyx_t_3 = NULL;
24266 PyObject *__pyx_t_4 = NULL;
24269 PyObject *__pyx_t_7 = NULL;
24270 PyObject *__pyx_t_8 = NULL;
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);
24295 __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
24304 __pyx_t_1 = PyBytes_Check(__pyx_v_filebase);
24305 __pyx_t_2 = (!__pyx_t_1);
24318 __pyx_t_4 = __pyx_v_filebase;
24319 __Pyx_INCREF(__pyx_t_4);
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);
24328 __Pyx_DECREF_SET(__pyx_v_filebase, __pyx_t_3);
24347 __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_filebase);
if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L1_error)
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));
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;
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;
24382 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
24383 __PYX_ERR(0, 93, __pyx_L1_error)
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)
24392 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_7);
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;
24401 #if CYTHON_UNPACK_METHODS
24402 if (unlikely(PyMethod_Check(__pyx_t_8))) {
24403 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
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);
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);
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;
24438 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
24439 __PYX_ERR(0, 94, __pyx_L1_error)
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)
24448 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_13);
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;
24456 #if CYTHON_UNPACK_METHODS
24457 if (unlikely(PyMethod_Check(__pyx_t_10))) {
24458 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
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);
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);
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;
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;
24500 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
24501 __PYX_ERR(0, 95, __pyx_L1_error)
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)
24510 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_13);
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;
24519 #if CYTHON_UNPACK_METHODS
24520 if (unlikely(PyMethod_Check(__pyx_t_7))) {
24521 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
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);
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);
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;
24556 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
24557 __PYX_ERR(0, 96, __pyx_L1_error)
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)
24566 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_15);
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;
24574 #if CYTHON_UNPACK_METHODS
24575 if (unlikely(PyMethod_Check(__pyx_t_14))) {
24576 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_14);
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);
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);
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;
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;
24618 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
24619 __PYX_ERR(0, 97, __pyx_L1_error)
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)
24628 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_15);
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;
24637 #if CYTHON_UNPACK_METHODS
24638 if (unlikely(PyMethod_Check(__pyx_t_13))) {
24639 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
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);
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);
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;
24674 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
24675 __PYX_ERR(0, 98, __pyx_L1_error)
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)
24684 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_17);
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;
24692 #if CYTHON_UNPACK_METHODS
24693 if (unlikely(PyMethod_Check(__pyx_t_16))) {
24694 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_16);
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);
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);
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;
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;
24736 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
24737 __PYX_ERR(0, 99, __pyx_L1_error)
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)
24746 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_17);
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;
24755 #if CYTHON_UNPACK_METHODS
24756 if (unlikely(PyMethod_Check(__pyx_t_15))) {
24757 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_15);
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);
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);
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;
24792 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
24793 __PYX_ERR(0, 100, __pyx_L1_error)
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)
24802 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_19);
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;
24810 #if CYTHON_UNPACK_METHODS
24811 if (unlikely(PyMethod_Check(__pyx_t_18))) {
24812 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_18);
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);
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);
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);
24865 PyObject *__pyx_temp;
24867 __pyx_temp = __pyx_r;
24868 __pyx_r = __pyx_t_18;
24870 __Pyx_XDECREF(__pyx_temp);
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);
24901 __Pyx_XDECREF(__pyx_v_filebase);
24902 __Pyx_XGIVEREF(__pyx_r);
24903 __Pyx_RefNannyFinishContext();
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
24920PyObject *__pyx_args, PyObject *__pyx_kwds
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
24928PyObject *__pyx_args, PyObject *__pyx_kwds
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;
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);
24952 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
24955 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
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) {
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;
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;
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;
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;
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;
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;
24987 default:
goto __pyx_L5_argtuple_error;
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) }
24994 }
else if (unlikely(__pyx_nargs != 6)) {
24995 goto __pyx_L5_argtuple_error;
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)
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]);
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)
25021 goto __pyx_L4_argument_unpacking_done;
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]);
25026 __Pyx_AddTraceback(
"cpartitioning.partitionNodesFromTriangleFiles", __pyx_clineno, __pyx_lineno, __pyx_filename);
25027 __Pyx_RefNannyFinishContext();
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);
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]);
25042 goto __pyx_L7_cleaned_up;
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]);
25047 __pyx_L7_cleaned_up:;
25050 __Pyx_RefNannyFinishContext();
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
25059 PyObject *__pyx_t_3 = NULL;
25060 PyObject *__pyx_t_4 = NULL;
25063 PyObject *__pyx_t_7 = NULL;
25064 PyObject *__pyx_t_8 = NULL;
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);
25089 __pyx_v_cmesh->mesh.subdomainp = (&__pyx_v_subdomain_cmesh->mesh);
25098 __pyx_t_1 = PyBytes_Check(__pyx_v_filebase);
25099 __pyx_t_2 = (!__pyx_t_1);
25112 __pyx_t_4 = __pyx_v_filebase;
25113 __Pyx_INCREF(__pyx_t_4);
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);
25122 __Pyx_DECREF_SET(__pyx_v_filebase, __pyx_t_3);
25141 __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_filebase);
if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error)
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;
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;
25176 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
25177 __PYX_ERR(0, 113, __pyx_L1_error)
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)
25186 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_7);
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;
25195 #if CYTHON_UNPACK_METHODS
25196 if (unlikely(PyMethod_Check(__pyx_t_8))) {
25197 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
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);
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);
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;
25232 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
25233 __PYX_ERR(0, 114, __pyx_L1_error)
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)
25242 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_13);
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;
25250 #if CYTHON_UNPACK_METHODS
25251 if (unlikely(PyMethod_Check(__pyx_t_10))) {
25252 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
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);
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);
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;
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;
25294 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
25295 __PYX_ERR(0, 115, __pyx_L1_error)
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)
25304 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_13);
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;
25313 #if CYTHON_UNPACK_METHODS
25314 if (unlikely(PyMethod_Check(__pyx_t_7))) {
25315 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
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);
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);
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;
25350 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
25351 __PYX_ERR(0, 116, __pyx_L1_error)
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)
25360 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_15);
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;
25368 #if CYTHON_UNPACK_METHODS
25369 if (unlikely(PyMethod_Check(__pyx_t_14))) {
25370 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_14);
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);
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);
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;
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;
25412 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
25413 __PYX_ERR(0, 117, __pyx_L1_error)
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)
25422 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_15);
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;
25431 #if CYTHON_UNPACK_METHODS
25432 if (unlikely(PyMethod_Check(__pyx_t_13))) {
25433 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
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);
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);
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;
25468 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
25469 __PYX_ERR(0, 118, __pyx_L1_error)
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)
25478 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_17);
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;
25486 #if CYTHON_UNPACK_METHODS
25487 if (unlikely(PyMethod_Check(__pyx_t_16))) {
25488 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_16);
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);
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);
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;
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;
25530 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
25531 __PYX_ERR(0, 119, __pyx_L1_error)
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)
25540 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_17);
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;
25549 #if CYTHON_UNPACK_METHODS
25550 if (unlikely(PyMethod_Check(__pyx_t_15))) {
25551 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_15);
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);
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);
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;
25586 PyErr_SetString(PyExc_ValueError,
"Cannot create cython.array from NULL pointer");
25587 __PYX_ERR(0, 120, __pyx_L1_error)
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)
25596 __pyx_t_6 = PyBytes_AS_STRING(__pyx_t_19);
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;
25604 #if CYTHON_UNPACK_METHODS
25605 if (unlikely(PyMethod_Check(__pyx_t_18))) {
25606 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_18);
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);
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);
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);
25659 PyObject *__pyx_temp;
25661 __pyx_temp = __pyx_r;
25662 __pyx_r = __pyx_t_18;
25664 __Pyx_XDECREF(__pyx_temp);
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);
25695 __Pyx_XDECREF(__pyx_v_filebase);
25696 __Pyx_XGIVEREF(__pyx_r);
25697 __Pyx_RefNannyFinishContext();
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
25714PyObject *__pyx_args, PyObject *__pyx_kwds
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
25722PyObject *__pyx_args, PyObject *__pyx_kwds
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;
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);
25756 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
25759 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
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) {
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
25831 default:
goto __pyx_L5_argtuple_error;
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) }
25838 }
else if (unlikely(__pyx_nargs != 16)) {
25839 goto __pyx_L5_argtuple_error;
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)
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]);
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)
25895 goto __pyx_L4_argument_unpacking_done;
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]);
25900 __Pyx_AddTraceback(
"cpartitioning.buildQuadraticLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
25901 __Pyx_RefNannyFinishContext();
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);
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]);
25928 goto __pyx_L7_cleaned_up;
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]);
25933 __pyx_L7_cleaned_up:;
25935 __Pyx_RefNannyFinishContext();
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);
25961 __pyx_v_nDOF_all_processes = 0;
25970 __pyx_v_nDOF_subdomain = 0;
25979 __pyx_v_max_dof_neighbors = 0;
25988 switch (__pyx_v_nSpace) {
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))));
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))));
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))));
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);
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);
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);
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);
26089 PyObject *__pyx_temp;
26091 __pyx_temp = __pyx_r;
26092 __pyx_r = __pyx_t_4;
26094 __Pyx_XDECREF(__pyx_temp);
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);
26119 __Pyx_XGIVEREF(__pyx_r);
26120 __Pyx_RefNannyFinishContext();
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
26137PyObject *__pyx_args, PyObject *__pyx_kwds
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
26145PyObject *__pyx_args, PyObject *__pyx_kwds
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;
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);
26179 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
26182 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
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) {
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
26254 default:
goto __pyx_L5_argtuple_error;
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) }
26261 }
else if (unlikely(__pyx_nargs != 16)) {
26262 goto __pyx_L5_argtuple_error;
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)
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]);
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)
26318 goto __pyx_L4_argument_unpacking_done;
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]);
26323 __Pyx_AddTraceback(
"cpartitioning.buildQuadraticCubeLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
26324 __Pyx_RefNannyFinishContext();
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);
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]);
26351 goto __pyx_L7_cleaned_up;
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]);
26356 __pyx_L7_cleaned_up:;
26358 __Pyx_RefNannyFinishContext();
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);
26384 __pyx_v_nDOF_all_processes = 0;
26393 __pyx_v_nDOF_subdomain = 0;
26402 __pyx_v_max_dof_neighbors = 0;
26411 switch (__pyx_v_nSpace) {
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)
26427 if ((1));
else __PYX_ERR(0, 208, __pyx_L1_error)
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)
26453 if ((1));
else __PYX_ERR(0, 210, __pyx_L1_error)
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))));
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);
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);
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);
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);
26526 PyObject *__pyx_temp;
26528 __pyx_temp = __pyx_r;
26529 __pyx_r = __pyx_t_4;
26531 __Pyx_XDECREF(__pyx_temp);
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);
26556 __Pyx_XGIVEREF(__pyx_r);
26557 __Pyx_RefNannyFinishContext();
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
26574PyObject *__pyx_args, PyObject *__pyx_kwds
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
26582PyObject *__pyx_args, PyObject *__pyx_kwds
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;
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);
26609 __pyx_nargs = PyTuple_Size(__pyx_args);
if (unlikely(__pyx_nargs < 0))
return NULL;
26612 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
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) {
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;
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;
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;
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;
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;
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;
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;
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;
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;
26656 default:
goto __pyx_L5_argtuple_error;
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) }
26663 }
else if (unlikely(__pyx_nargs != 9)) {
26664 goto __pyx_L5_argtuple_error;
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)
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]);
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)
26699 goto __pyx_L4_argument_unpacking_done;
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]);
26704 __Pyx_AddTraceback(
"cpartitioning.buildDiscontinuousGalerkinLocal2GlobalMappings", __pyx_clineno, __pyx_lineno, __pyx_filename);
26705 __Pyx_RefNannyFinishContext();
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);
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]);
26725 goto __pyx_L7_cleaned_up;
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]);
26730 __pyx_L7_cleaned_up:;
26732 __Pyx_RefNannyFinishContext();
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);
26758 __pyx_v_nDOF_all_processes = 0;
26767 __pyx_v_nDOF_subdomain = 0;
26776 __pyx_v_max_dof_neighbors = 0;
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))));
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);
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);
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);
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);
26833 PyObject *__pyx_temp;
26835 __pyx_temp = __pyx_r;
26836 __pyx_r = __pyx_t_4;
26838 __Pyx_XDECREF(__pyx_temp);
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);
26863 __Pyx_XGIVEREF(__pyx_r);
26864 __Pyx_RefNannyFinishContext();
26868static struct __pyx_vtabstruct_array __pyx_vtable_array;
26870static PyObject *__pyx_tp_new__initialisation_array(PyObject *o,
26871#
if CYTHON_VECTORCALL_TPNEW
26872 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
26874 PyObject *a, PyObject *k
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);
26882 int cinit_result = __pyx_array___cinit__(o,
26883#
if CYTHON_VECTORCALL_TPNEW
26884 args, nargs, kwnames
26889 if (unlikely(cinit_result))
goto bad;
26893 Py_DECREF(o); o = 0;
26897static PyObject *__pyx_tp_new_vectorcall_array(PyTypeObject *t,
26898#
if CYTHON_VECTORCALL_TPNEW
26899 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
26901 PyObject *a, PyObject *k
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
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);
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);
26927 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
26928 PyObject *o = __pyx_tp_new_vectorcall_array((PyTypeObject*)t, args, nargs, kwnames);
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;
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);
26951 Py_CLEAR(p->_format);
26952 PyTypeObject *tp = Py_TYPE(o);
26953 #if CYTHON_USE_TYPE_SLOTS
26957 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
26958 if (tp_free) tp_free(o);
26961 #if CYTHON_USE_TYPE_SPECS
26966static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
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;
26972 binaryfunc
f = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript));
26979static PyObject *__pyx_mp_subscript_array(PyObject *o, PyObject *i) {
26980 return __pyx_array___getitem__(o, i);
26983static int __pyx_sq_ass_item_array(PyObject *o, Py_ssize_t i, PyObject *
v) {
26985 PyObject *x = PyLong_FromSsize_t(i);
if (unlikely(!x))
return -1;
26986 int r = __pyx_array___setitem__(o, x,
v);
26990 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError,
"Subscript %.10s not supported by " __Pyx_FMT_TYPENAME,
"deletion", o);
26995static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *
v) {
26997 return __pyx_array___setitem__(o, i,
v);
26999 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError,
"Subscript %.10s not supported by " __Pyx_FMT_TYPENAME,
"deletion", o);
27004static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *
n) {
27005 PyObject *
v = PyObject_GenericGetAttr(o,
n);
27006 if (!
v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
27008 v = __pyx_array___getattr__(o,
n);
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);
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},
27024static struct PyGetSetDef __pyx_getsets_array[] = {
27025 {
"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
27028#if CYTHON_USE_TYPE_SPECS
27029#if !CYTHON_COMPILING_IN_LIMITED_API
27031static PyBufferProcs __pyx_tp_as_buffer_array = {
27032 __pyx_array_getbuffer,
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},
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},
27058static PyType_Spec __pyx_type___pyx_array_spec = {
27059 "cpartitioning.array",
27060 sizeof(
struct __pyx_array_obj),
27062 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE,
27063 __pyx_type___pyx_array_slots,
27067static PySequenceMethods __pyx_tp_as_sequence_array = {
27068 __pyx_array___len__,
27071 __pyx_sq_item_array,
27073 __pyx_sq_ass_item_array,
27080static PyMappingMethods __pyx_tp_as_mapping_array = {
27081 __pyx_array___len__,
27082 __pyx_mp_subscript_array,
27083 __pyx_mp_ass_subscript_array,
27086static PyBufferProcs __pyx_tp_as_buffer_array = {
27087 __pyx_array_getbuffer,
27091static PyTypeObject __pyx_type___pyx_array = {
27092 PyVarObject_HEAD_INIT(0, 0)
27093 "cpartitioning.""array",
27094 sizeof(
struct __pyx_array_obj),
27096 __pyx_tp_dealloc_array,
27103 &__pyx_tp_as_sequence_array,
27104 &__pyx_tp_as_mapping_array,
27108 __pyx_tp_getattro_array,
27110 &__pyx_tp_as_buffer_array,
27111 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE,
27119 __pyx_methods_array,
27121 __pyx_getsets_array,
27126 #if !CYTHON_USE_TYPE_SPECS
27131 __pyx_tp_new_array,
27141 #if CYTHON_USE_TP_FINALIZE
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,
27153 #if __PYX_NEED_TP_PRINT_SLOT == 1
27156 #if PY_VERSION_HEX >= 0x030C0000
27159 #if PY_VERSION_HEX >= 0x030d00A4
27162 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
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
27172 CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
27175 struct __pyx_MemviewEnum_obj *p = ((
struct __pyx_MemviewEnum_obj *)o);
27176 p->name = Py_None; Py_INCREF(Py_None);
27180static PyObject *__pyx_tp_new_vectorcall_Enum(PyTypeObject *t,
27181#
if CYTHON_VECTORCALL_TPNEW
27182 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
27184 PyObject *a, PyObject *k
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
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);
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);
27210 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
27211 PyObject *o = __pyx_tp_new_vectorcall_Enum((PyTypeObject*)t, args, nargs, kwnames);
27213 assert(Py_TYPE(o) == (PyTypeObject*)t);
27214 if (unlikely(__pyx_MemviewEnum___init__(o, args, nargs, kwnames) < 0)) {
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);
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;
27237 PyObject_GC_UnTrack(o);
27239 PyTypeObject *tp = Py_TYPE(o);
27240 #if CYTHON_USE_TYPE_SLOTS
27244 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
27245 if (tp_free) tp_free(o);
27248 #if CYTHON_USE_TYPE_SPECS
27253static int __pyx_tp_traverse_Enum(PyObject *o, visitproc
v,
void *a) {
27255 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
27257 e = __Pyx_call_type_traverse(o, 1,
v, a);
27261 e = (*v)(p->name, a);
if (e)
return e;
27266static int __pyx_tp_clear_Enum(PyObject *o) {
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);
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},
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},
27296static PyType_Spec __pyx_type___pyx_MemviewEnum_spec = {
27297 "cpartitioning.Enum",
27298 sizeof(
struct __pyx_MemviewEnum_obj),
27300 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
27301 __pyx_type___pyx_MemviewEnum_slots,
27305static PyTypeObject __pyx_type___pyx_MemviewEnum = {
27306 PyVarObject_HEAD_INIT(0, 0)
27307 "cpartitioning.""Enum",
27308 sizeof(
struct __pyx_MemviewEnum_obj),
27310 __pyx_tp_dealloc_Enum,
27315 __pyx_MemviewEnum___repr__,
27325 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
27327 __pyx_tp_traverse_Enum,
27328 __pyx_tp_clear_Enum,
27333 __pyx_methods_Enum,
27340 #if !CYTHON_USE_TYPE_SPECS
27343 __pyx_tp_init_Enum,
27355 #if CYTHON_USE_TP_FINALIZE
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,
27367 #if __PYX_NEED_TP_PRINT_SLOT == 1
27370 #if PY_VERSION_HEX >= 0x030C0000
27373 #if PY_VERSION_HEX >= 0x030d00A4
27376 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
27381static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
27383static PyObject *__pyx_tp_new__initialisation_memoryview(PyObject *o,
27384#
if CYTHON_VECTORCALL_TPNEW
27385 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
27387 PyObject *a, PyObject *k
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;
27396 int cinit_result = __pyx_memoryview___cinit__(o,
27397#
if CYTHON_VECTORCALL_TPNEW
27398 args, nargs, kwnames
27403 if (unlikely(cinit_result))
goto bad;
27407 Py_DECREF(o); o = 0;
27411static PyObject *__pyx_tp_new_vectorcall_memoryview(PyTypeObject *t,
27412#
if CYTHON_VECTORCALL_TPNEW
27413 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
27415 PyObject *a, PyObject *k
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
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);
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);
27441 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
27442 PyObject *o = __pyx_tp_new_vectorcall_memoryview((PyTypeObject*)t, args, nargs, kwnames);
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;
27456 PyObject_GC_UnTrack(o);
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);
27466 Py_CLEAR(p->_size);
27467 PyTypeObject *tp = Py_TYPE(o);
27468 #if CYTHON_USE_TYPE_SLOTS
27472 freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
27473 if (tp_free) tp_free(o);
27476 #if CYTHON_USE_TYPE_SPECS
27481static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc
v,
void *a) {
27483 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
27485 e = __Pyx_call_type_traverse(o, 1,
v, a);
27489 e = (*v)(p->obj, a);
if (e)
return e;
27492 e = (*v)(p->_size, a);
if (e)
return e;
27495 e = (*v)(p->view.obj, a);
if (e)
return e;
27500static int __pyx_tp_clear_memoryview(PyObject *o) {
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);
27506 tmp = ((PyObject*)p->_size);
27507 p->_size = Py_None; Py_INCREF(Py_None);
27509 Py_CLEAR(p->view.obj);
27513static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
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;
27519 binaryfunc
f = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript));
27526static PyObject *__pyx_mp_subscript_memoryview(PyObject *o, PyObject *i) {
27527 return __pyx_memoryview___getitem__(o, i);
27530static int __pyx_sq_ass_item_memoryview(PyObject *o, Py_ssize_t i, PyObject *
v) {
27532 PyObject *x = PyLong_FromSsize_t(i);
if (unlikely(!x))
return -1;
27533 int r = __pyx_memoryview___setitem__(o, x,
v);
27537 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError,
"Subscript %.10s not supported by " __Pyx_FMT_TYPENAME,
"deletion", o);
27542static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *
v) {
27544 return __pyx_memoryview___setitem__(o, i,
v);
27546 __Pyx_RaiseErrorWithObjectType1(PyExc_NotImplementedError,
"Subscript %.10s not supported by " __Pyx_FMT_TYPENAME,
"deletion", o);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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},
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},
27609#if CYTHON_USE_TYPE_SPECS
27610#if !CYTHON_COMPILING_IN_LIMITED_API
27612static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
27613 __pyx_memoryview_getbuffer,
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},
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},
27642static PyType_Spec __pyx_type___pyx_memoryview_spec = {
27643 "cpartitioning.memoryview",
27644 sizeof(
struct __pyx_memoryview_obj),
27646 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
27647 __pyx_type___pyx_memoryview_slots,
27651static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
27652 __pyx_memoryview___len__,
27655 __pyx_sq_item_memoryview,
27657 __pyx_sq_ass_item_memoryview,
27664static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
27665 __pyx_memoryview___len__,
27666 __pyx_mp_subscript_memoryview,
27667 __pyx_mp_ass_subscript_memoryview,
27670static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
27671 __pyx_memoryview_getbuffer,
27675static PyTypeObject __pyx_type___pyx_memoryview = {
27676 PyVarObject_HEAD_INIT(0, 0)
27677 "cpartitioning.""memoryview",
27678 sizeof(
struct __pyx_memoryview_obj),
27680 __pyx_tp_dealloc_memoryview,
27685 __pyx_memoryview___repr__,
27687 &__pyx_tp_as_sequence_memoryview,
27688 &__pyx_tp_as_mapping_memoryview,
27691 __pyx_memoryview___str__,
27694 &__pyx_tp_as_buffer_memoryview,
27695 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
27697 __pyx_tp_traverse_memoryview,
27698 __pyx_tp_clear_memoryview,
27703 __pyx_methods_memoryview,
27705 __pyx_getsets_memoryview,
27710 #if !CYTHON_USE_TYPE_SPECS
27715 __pyx_tp_new_memoryview,
27725 #if CYTHON_USE_TP_FINALIZE
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,
27737 #if __PYX_NEED_TP_PRINT_SLOT == 1
27740 #if PY_VERSION_HEX >= 0x030C0000
27743 #if PY_VERSION_HEX >= 0x030d00A4
27746 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
27751static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
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
27757 CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k
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;
27768static PyObject *__pyx_tp_new_vectorcall__memoryviewslice(PyTypeObject *t,
27769#
if CYTHON_VECTORCALL_TPNEW
27770 PyObject *
const *args, Py_ssize_t nargs, PyObject *kwnames
27772 PyObject *a, PyObject *k
27776 o = __pyx_tp_new_vectorcall_memoryview(t,
27777#
if CYTHON_VECTORCALL_TPNEW
27778 args, nargs, kwnames
27783 if (unlikely(!o))
return 0;
27784 return __pyx_tp_new__initialisation__memoryviewslice(o,
27785#
if CYTHON_VECTORCALL_TPNEW
27786 args, nargs, kwnames
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);
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);
27804 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
27805 PyObject *o = __pyx_tp_new_vectorcall__memoryviewslice((PyTypeObject*)t, args, nargs, kwnames);
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;
27819 PyObject_GC_UnTrack(o);
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);
27828 __Pyx_call_destructor(p->from_slice);
27829 Py_CLEAR(p->from_object);
27830 PyObject_GC_Track(o);
27831 __pyx_tp_dealloc_memoryview(o);
27834static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc
v,
void *a) {
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;
27844static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
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);
27851 __PYX_XCLEAR_MEMVIEW(&p->from_slice, 1);
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},
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},
27875static PyType_Spec __pyx_type___pyx_memoryviewslice_spec = {
27876 "cpartitioning._memoryviewslice",
27877 sizeof(
struct __pyx_memoryviewslice_obj),
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,
27884static PyTypeObject __pyx_type___pyx_memoryviewslice = {
27885 PyVarObject_HEAD_INIT(0, 0)
27886 "cpartitioning.""_memoryviewslice",
27887 sizeof(
struct __pyx_memoryviewslice_obj),
27889 __pyx_tp_dealloc__memoryviewslice,
27894 #if CYTHON_COMPILING_IN_PYPY || 0
27895 __pyx_memoryview___repr__,
27904 #if CYTHON_COMPILING_IN_PYPY || 0
27905 __pyx_memoryview___str__,
27912 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE,
27913 PyDoc_STR(
"Internal class for passing memoryview slices to Python"),
27914 __pyx_tp_traverse__memoryviewslice,
27915 __pyx_tp_clear__memoryviewslice,
27920 __pyx_methods__memoryviewslice,
27927 #if !CYTHON_USE_TYPE_SPECS
27932 __pyx_tp_new__memoryviewslice,
27942 #if CYTHON_USE_TP_FINALIZE
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,
27954 #if __PYX_NEED_TP_PRINT_SLOT == 1
27957 #if PY_VERSION_HEX >= 0x030C0000
27960 #if PY_VERSION_HEX >= 0x030d00A4
27963 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x030a0000
27969static PyMethodDef __pyx_methods[] = {
27973static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate);
27974static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate);
27975static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void);
27976static CYTHON_SMALL_CODE
int __Pyx_InitAfterSharedUtility(
void);
27977static CYTHON_SMALL_CODE
int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate);
27978static CYTHON_SMALL_CODE
int __Pyx_modinit_Global_init_code(__pyx_mstatetype *__pyx_mstate);
27979static CYTHON_SMALL_CODE
int __Pyx_modinit_Variable_export_code(__pyx_mstatetype *__pyx_mstate);
27980static CYTHON_SMALL_CODE
int __Pyx_modinit_Function_export_code(__pyx_mstatetype *__pyx_mstate);
27981static CYTHON_SMALL_CODE
int __Pyx_modinit_Exttype___pyx_array_obj(__pyx_mstatetype *__pyx_mstate);
27982static CYTHON_SMALL_CODE
int __Pyx_modinit_Exttype___pyx_MemviewEnum_obj(__pyx_mstatetype *__pyx_mstate);
27983static CYTHON_SMALL_CODE
int __Pyx_modinit_Exttype___pyx_memoryview_obj(__pyx_mstatetype *__pyx_mstate);
27984static CYTHON_SMALL_CODE
int __Pyx_modinit_Exttype___pyx_memoryviewslice_obj(__pyx_mstatetype *__pyx_mstate);
27985static CYTHON_SMALL_CODE
int __Pyx_modinit_Type_import_code(__pyx_mstatetype *__pyx_mstate);
27986static CYTHON_SMALL_CODE
int __Pyx_modinit_Variable_import_code(__pyx_mstatetype *__pyx_mstate);
27987static CYTHON_SMALL_CODE
int __Pyx_modinit_Function_import_code(__pyx_mstatetype *__pyx_mstate);
27988static CYTHON_SMALL_CODE
int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate);
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);
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();
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);
28011 __Pyx_RefNannyFinishContext();
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);
28020 __Pyx_RefNannyFinishContext();
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);
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;
28041 #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
28043 #elif defined(_MSC_VER)
28044 #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
28046 #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
28049 __pyx_mstate->__pyx_array_type = &__pyx_type___pyx_array;
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
28054 #if !CYTHON_USE_TYPE_SPECS
28055 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_array_type) < (0)) __PYX_ERR(1, 128, __pyx_L1_error)
28057 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28058 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_array_type);
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();
28065 __Pyx_RefNannyFinishContext();
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);
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)
28080 __pyx_mstate->__pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
28082 #if !CYTHON_COMPILING_IN_LIMITED_API
28084 #if !CYTHON_USE_TYPE_SPECS
28085 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_MemviewEnum_type) < (0)) __PYX_ERR(1, 318, __pyx_L1_error)
28087 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28088 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_MemviewEnum_type);
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;
28095 if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_MemviewEnum_type) < (0)) __PYX_ERR(1, 318, __pyx_L1_error)
28096 __Pyx_RefNannyFinishContext();
28099 __Pyx_RefNannyFinishContext();
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);
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;
28128 #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
28130 #elif defined(_MSC_VER)
28131 #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
28133 #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
28136 __pyx_mstate->__pyx_memoryview_type = &__pyx_type___pyx_memoryview;
28138 #if !CYTHON_COMPILING_IN_LIMITED_API
28140 #if !CYTHON_USE_TYPE_SPECS
28141 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_memoryview_type) < (0)) __PYX_ERR(1, 353, __pyx_L1_error)
28143 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28144 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_memoryview_type);
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;
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();
28156 __Pyx_RefNannyFinishContext();
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);
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)
28181 __pyx_mstate->__pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
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;
28187 #if !CYTHON_USE_TYPE_SPECS
28188 if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_memoryviewslice_type) < (0)) __PYX_ERR(1, 947, __pyx_L1_error)
28190 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
28191 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_memoryviewslice_type);
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;
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();
28203 __Pyx_XDECREF(__pyx_t_1);
28204 __Pyx_RefNannyFinishContext();
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);
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
28225 sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyHeapTypeObject),
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),
28237 sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArray_Descr),
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),
28246 sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayIterObject),
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),
28255 sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayMultiIterObject),
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),
28264 sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyArrayObject),
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),
28273 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
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),
28282 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
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),
28291 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
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),
28300 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
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),
28309 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
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),
28318 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
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),
28327 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
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),
28336 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
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),
28345 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
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),
28354 sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyObject),
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),
28363 sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(PyUFuncObject),
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),
28375 sizeof(
struct PyMPIDatatypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(
struct PyMPIDatatypeObject),
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),
28384 sizeof(
struct PyMPIStatusObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(
struct PyMPIStatusObject),
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),
28393 sizeof(
struct PyMPIRequestObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(
struct PyMPIRequestObject),
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),
28402 sizeof(
struct PyMPIPrequestObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(
struct PyMPIPrequestObject),
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),
28411 sizeof(
struct PyMPIGrequestObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(
struct PyMPIGrequestObject),
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),
28420 sizeof(
struct PyMPIMessageObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(
struct PyMPIMessageObject),
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),
28429 sizeof(
struct PyMPIOpObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(
struct PyMPIOpObject),
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),
28438 sizeof(
struct PyMPIGroupObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(
struct PyMPIGroupObject),
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),
28447 sizeof(
struct PyMPIInfoObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(
struct PyMPIInfoObject),
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),
28456 sizeof(
struct PyMPIErrhandlerObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(
struct PyMPIErrhandlerObject),
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),
28465 sizeof(
struct PyMPISessionObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(
struct PyMPISessionObject),
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),
28474 sizeof(
struct PyMPICommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(
struct PyMPICommObject),
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),
28483 sizeof(
struct PyMPIIntracommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(
struct PyMPIIntracommObject),
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),
28492 sizeof(
struct PyMPITopocommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(
struct PyMPITopocommObject),
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),
28501 sizeof(
struct PyMPICartcommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(
struct PyMPICartcommObject),
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),
28510 sizeof(
struct PyMPIGraphcommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(
struct PyMPIGraphcommObject),
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),
28519 sizeof(
struct PyMPIDistgraphcommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(
struct PyMPIDistgraphcommObject),
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),
28528 sizeof(
struct PyMPIIntercommObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(
struct PyMPIIntercommObject),
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),
28537 sizeof(
struct PyMPIWinObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(
struct PyMPIWinObject),
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),
28546 sizeof(
struct PyMPIFileObject), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(
struct PyMPIFileObject),
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),
28558 sizeof(
struct __pyx_obj_7proteus_10cmeshTools_CMesh), __PYX_GET_STRUCT_ALIGNMENT_3_3_0(
struct __pyx_obj_7proteus_10cmeshTools_CMesh),
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();
28565 __Pyx_XDECREF(__pyx_t_1);
28566 __Pyx_RefNannyFinishContext();
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);
28575 __Pyx_RefNannyFinishContext();
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);
28584 __Pyx_RefNannyFinishContext();
28588#if CYTHON_PEP489_MULTI_PHASE_INIT
28589static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
28590static int __pyx_pymod_exec_cpartitioning(PyObject* module);
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},
28597 #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
28598 {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
28606 struct PyModuleDef __pyx_moduledef =
28608 static struct PyModuleDef __pyx_moduledef =
28611 PyModuleDef_HEAD_INIT,
28614 #if CYTHON_USE_MODULE_STATE
28615 sizeof(__pyx_mstatetype),
28617 (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1,
28620 #if CYTHON_PEP489_MULTI_PHASE_INIT
28621 __pyx_moduledef_slots,
28625 #if CYTHON_USE_MODULE_STATE
28640#ifndef CYTHON_NO_PYINIT_EXPORT
28641 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
28644 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
28646 #define __Pyx_PyMODINIT_FUNC PyObject *
28650__Pyx_PyMODINIT_FUNC PyInit_cpartitioning(
void) CYTHON_SMALL_CODE;
28651__Pyx_PyMODINIT_FUNC PyInit_cpartitioning(
void)
28652#if CYTHON_PEP489_MULTI_PHASE_INIT
28654 return PyModuleDef_Init(&__pyx_moduledef);
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) {
28661 PyObject *module = PyImport_ImportModule(
"_interpreters");
28663 if (!PyErr_ExceptionMatches(PyExc_Exception)) {
28667 module = PyImport_ImportModule("_xxsubinterpreters");
28668 if (!module)
goto bad;
28670 PyObject *current = PyObject_CallMethod(module,
"get_current", NULL);
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;
28679 long long as_c_int = PyLong_AsLongLong(current);
28680 Py_DECREF(current);
28684 PySys_WriteStderr(
"__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
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());
28701 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
28703 if (unlikely(current_id == -1)) {
28706 if (main_interpreter_id == -1) {
28707 main_interpreter_id = current_id;
28709 }
else if (unlikely(main_interpreter_id != current_id)) {
28712 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
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)
28720 PyObject *value = PyObject_GetAttrString(spec, from_name);
28722 if (likely(value)) {
28723 if (allow_none || value != Py_None) {
28724 result = PyDict_SetItemString(moddict, to_name, value);
28727 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
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())
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;
28756 Py_XDECREF(module);
28761static CYTHON_SMALL_CODE
int __pyx_pymod_exec_cpartitioning(PyObject *__pyx_pyinit_module)
28764 int stringtab_initialized = 0;
28765 #if CYTHON_USE_MODULE_STATE
28766 int pystate_addmodule_run = 0;
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;
28775 static PyThread_type_lock __pyx_t_7[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
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.");
28789 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
28792 #if CYTHON_PEP489_MULTI_PHASE_INIT
28793 __pyx_t_1 = __pyx_pyinit_module;
28794 Py_INCREF(__pyx_t_1);
28796 __pyx_t_1 = PyModule_Create(&__pyx_moduledef);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
28798 #if CYTHON_USE_MODULE_STATE
28800 int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
28802 if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
28803 pystate_addmodule_run = 1;
28806 __pyx_m = __pyx_t_1;
28808 #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
28809 PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
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)
28819 #if CYTHON_REFNANNY
28820 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
28821 if (!__Pyx_RefNanny) {
28822 if (PyErr_ExceptionMatches(PyExc_Exception)) {
28824 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
28826 if (!__Pyx_RefNanny)
28827 Py_FatalError(
"failed to import 'refnanny' module");
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)
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)
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)
28852 if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
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)
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);
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)
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);
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);
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);
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;
28927 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
28928 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28938 __Pyx_ErrRestore(0,0,0);
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;
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);
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);
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;
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;
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;
29014 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
29015 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
29025 __Pyx_ErrRestore(0,0,0);
29026 goto __pyx_L11_exception_handled;
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:;
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);
29052 __Pyx_XGOTREF(generic);
29053 __Pyx_DECREF_SET(generic, ((PyObject *)__pyx_t_4));
29054 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
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);
29073 __Pyx_XGOTREF(strided);
29074 __Pyx_DECREF_SET(strided, ((PyObject *)__pyx_t_4));
29075 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
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);
29094 __Pyx_XGOTREF(indirect);
29095 __Pyx_DECREF_SET(indirect, ((PyObject *)__pyx_t_4));
29096 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
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);
29115 __Pyx_XGOTREF(contiguous);
29116 __Pyx_DECREF_SET(contiguous, ((PyObject *)__pyx_t_4));
29117 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
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);
29136 __Pyx_XGOTREF(indirect_contiguous);
29137 __Pyx_DECREF_SET(indirect_contiguous, ((PyObject *)__pyx_t_4));
29138 __Pyx_GIVEREF((PyObject *)__pyx_t_4);
29148 __pyx_memoryview_thread_locks_used = 0;
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));
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);
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;
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;
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;
29220 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
29221 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
29231 __Pyx_ErrRestore(0,0,0);
29232 goto __pyx_L19_exception_handled;
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:;
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);
29265 __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_collections_abc_Sequence);
if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(1, 986, __pyx_L26_error)
29276 __pyx_t_5 = __pyx_collections_abc_Sequence;
29277 __Pyx_INCREF(__pyx_t_5);
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);
29286 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29295 __pyx_t_5 = __pyx_collections_abc_Sequence;
29296 __Pyx_INCREF(__pyx_t_5);
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);
29305 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
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;
29329 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
29330 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
29340 __Pyx_ErrRestore(0,0,0);
29341 goto __pyx_L27_exception_handled;
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:;
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;
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)
29374 __pyx_t_4 = __pyx_t_1;
29375 __Pyx_GOTREF(__pyx_t_4);
29377 PyObject*
const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_Comm};
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) {
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)
29387 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
29390 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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;
29539 __Pyx_XDECREF(__pyx_t_4);
29540 __Pyx_XDECREF(__pyx_t_5);
29542 if (__pyx_mstate->__pyx_d && stringtab_initialized) {
29543 __Pyx_AddTraceback(
"init cpartitioning", __pyx_clineno, __pyx_lineno, __pyx_filename);
29545 #if !CYTHON_USE_MODULE_STATE
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);
29556 }
else if (!PyErr_Occurred()) {
29557 PyErr_SetString(PyExc_ImportError,
"init cpartitioning");
29560 __Pyx_RefNannyFinishContext();
29561 #if CYTHON_PEP489_MULTI_PHASE_INIT
29562 return (__pyx_m != NULL) ? 0 : -1;
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)
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;
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);
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]);
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]);
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
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)
29650 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
29653 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
29656 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT))
break;
29657 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
29662 #if CYTHON_IMMORTAL_CONSTANTS
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)
29673 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
29676 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
29679 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT))
break;
29680 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
29685 __Pyx_RefNannyFinishContext();
29688 __Pyx_RefNannyFinishContext();
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);
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
29704 #if (CYTHON_COMPRESS_STRINGS) == 1
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) }
29713 #elif (CYTHON_COMPRESS_STRINGS) > 0 && (CYTHON_COMPRESS_STRINGS) <= 90
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) }
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
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)) {
29736 __PYX_ERR(0, 1, __pyx_L1_error)
29738 stringtab[i] = string;
29739 pos += bytes_length;
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)) {
29748 __PYX_ERR(0, 1, __pyx_L1_error)
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)
29757 #if CYTHON_IMMORTAL_CONSTANTS
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)
29768 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
29771 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
29774 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT))
break;
29775 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
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)
29790 #if CYTHON_IMMORTAL_CONSTANTS
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)
29801 if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
29804 Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
29807 if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT))
break;
29808 Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
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;
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
29843static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
29844 PyObject* tuple_dedup_map = PyDict_New();
29845 if (unlikely(!tuple_dedup_map))
return -1;
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;
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;
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;
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;
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;
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;
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;
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;
29886 Py_DECREF(tuple_dedup_map);
29889 Py_DECREF(tuple_dedup_map);
29894static int __Pyx_InitGlobals(
void) {
29895 int __pyx_lineno = 0;
29896 const char *__pyx_filename = NULL;
29897 int __pyx_clineno = 0;
29899 if (likely(__Pyx_init_co_variables() == 0 && __Pyx_init_tpflags_variables() == 0));
else
29901 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
29904 #if CYTHON_COMPILING_IN_LIMITED_API
29906 PyObject *builtins = PyEval_GetBuiltins();
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)) {
29914 frozendict_type = (PyObject*) &PyDict_Type;
29915 Py_INCREF(frozendict_type);
29917 __pyx_mstate_global->__Pyx_PyFrozenDictType = frozendict_type;
29923 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
29926 if (likely(__Pyx_init_assertions_enabled() == 0));
else
29928 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
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).");
29947 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
29950 if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0));
else
29952 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
29955 #if CYTHON_COMPILING_IN_LIMITED_API
29957 PyObject *typesModule=NULL;
29958 typesModule = PyImport_ImportModule(
"types");
29960 __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule,
"MethodType");
29961 Py_DECREF(typesModule);
29966 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
29974static int __Pyx_InitAfterSharedUtility(
void) {
29975 int __pyx_lineno = 0;
29976 const char *__pyx_filename = NULL;
29977 int __pyx_clineno = 0;
29979 if (likely(__pyx_CyFunction_init(__pyx_m) == 0));
else
29981 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
29992#pragma warning( push )
29997#pragma warning( disable : 4127 )
30007static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
30008 PyObject *m = NULL, *p = NULL;
30010 m = PyImport_ImportModule(modname);
30012 p = PyObject_GetAttrString(m,
"RefNannyAPI");
30014 r = PyLong_AsVoidPtr(p);
30018 return (__Pyx_RefNannyAPIStruct *)
r;
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) {
30027 for (i = 0; i < length; i++) {
30028 v = dest[i] = src[i];
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) {
30039 return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
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);
30047 for (i = 0; i <
n; i++) {
30049 if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
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;
30068 if (result == 0)
goto __pyx_return_false;
else goto __pyx_return_true;
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;
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;
30085 if (unlikely(op2 == Py_None)) {
30086 if (op1 == Py_None)
goto __pyx_return_true;
else goto __pyx_return_false;
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);
30094 goto __pyx_richcmp;
30097 if ((0))
goto __pyx_richcmp;
30098 if ((0))
goto __pyx_return_true;
30099 if ((0))
goto __pyx_return_false;
30101 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
30109#if CYTHON_VECTORCALL
30110static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *
const *kwvalues, PyObject *
s)
30112 Py_ssize_t i,
n = __Pyx_PyTuple_GET_SIZE(kwnames);
30113 #if !CYTHON_ASSUME_SAFE_SIZE
30114 if (unlikely(
n == -1))
return NULL;
30116 for (i = 0; i <
n; i++)
30118 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
30119 #if !CYTHON_ASSUME_SAFE_MACROS
30120 if (unlikely(!namei))
return NULL;
30122 if (
s == namei)
return kwvalues[i];
30124 for (i = 0; i <
n; i++)
30126 PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
30127 #if !CYTHON_ASSUME_SAFE_MACROS
30128 if (unlikely(!namei))
return NULL;
30130 int eq = __Pyx_PyUnicode_Equals(
s, namei);
30131 if (unlikely(eq != 0)) {
30132 if (unlikely(eq < 0))
return NULL;
30133 return kwvalues[i];
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;
30142#if !CYTHON_ASSUME_SAFE_SIZE
30143 nkwargs = PyTuple_Size(kwnames);
30144 if (unlikely(nkwargs < 0))
return NULL;
30146 nkwargs = PyTuple_GET_SIZE(kwnames);
30148 dict = PyDict_New();
30149 if (unlikely(!dict))
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;
30156 PyObject *key = PyTuple_GET_ITEM(kwnames, i);
30158 if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
30170#if CYTHON_COMPILING_IN_CPYTHON
30171static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
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")))
30178 result = (*call)(func, arg, kw);
30179 Py_LeaveRecursiveCall();
30180 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
30183 "NULL result without error in PyObject_Call");
30190#if CYTHON_COMPILING_IN_CPYTHON
30191static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
30192 PyObject *self, *result;
30194 cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
30195 self = __Pyx_CyOrPyCFunction_GET_SELF(func);
30196 if (unlikely(Py_EnterRecursiveCall(
" while calling a Python object")))
30198 result = cfunc(self, arg);
30199 Py_LeaveRecursiveCall();
30200 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
30203 "NULL result without error in PyObject_Call");
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;
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;
30221 result = __Pyx_PyObject_Call(func, argstuple, kwargs);
30223 Py_DECREF(argstuple);
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);
30236 if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
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));
30247 #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
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);
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]);
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);
30267 vectorcallfunc
f = __Pyx_PyVectorcall_Function(func);
30269 return f(func, args, nargsf, NULL);
30275 return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
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);
30282 return PyObject_VectorcallDict(func, args, nargsf, kwargs);
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);
30293static CYTHON_INLINE
int __Pyx_IgnoreGivenException(PyObject *given_exception, PyObject *ignorable_exception) {
30294 if (PyErr_GivenExceptionMatches(given_exception ? given_exception : PyErr_Occurred(), ignorable_exception)) {
30302#if CYTHON_COMPILING_IN_CPYTHON
30303static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
30305 a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
30309 return b == &PyBaseObject_Type;
30311static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
30313 if (a == b)
return 1;
30317 n = PyTuple_GET_SIZE(mro);
30318 for (i = 0; i <
n; i++) {
30319 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
30324 return __Pyx_InBases(a, b);
30326static CYTHON_INLINE
int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
30328 if (cls == a || cls == b)
return 1;
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)
30340 return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
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);
30355#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
30356static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
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);
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);
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,
30375 METH_FASTCALL | METH_KEYWORDS,
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))
30385#if CYTHON_COMPILING_IN_CPYTHON
30386 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
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);
30393#if CYTHON_COMPILING_IN_PYPY
30395 if (PyCFunction_Check(method))
30400#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
30401 self = PyObject_GetAttrString(method,
"__self__");
30402 if (!self && !__Pyx_IgnoreException(PyExc_AttributeError)) {
30406 self = PyCFunction_GET_SELF(method);
30408 self_found = (self && self != Py_None);
30409#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
30413 PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
30414 if (unlikely(!unbound_method))
return -1;
30416 result = unbound_method;
30419#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
30420 if (unlikely(target->method)) {
30424 target->method = result;
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);
30445#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
30446 else if (unlikely(was_initialized == 1)) {
30447 __Pyx_CachedCFunction tmp_cfunc = {
30452 tmp_cfunc.type = cfunc->type;
30453 tmp_cfunc.method_name = cfunc->method_name;
30454 return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
30457 PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
30458 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
30462static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
30464 if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0))
return NULL;
30465 result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
30470static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
30471 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
30475static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
30476 return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
30480#if CYTHON_AVOID_BORROWED_REFS
30481static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
30482 PyObject *next = NULL;
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);
30490 *ppos = PyObject_GetIter(p);
30492 if (unlikely(!*ppos))
goto bad;
30494 next = PyIter_Next(*ppos);
30496 if (PyErr_Occurred())
goto bad;
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;
30514#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
30515 PyErr_FormatUnraisable(
"Exception ignored in __Pyx_PyDict_NextRef");
30517 PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
30519 if (pkey) *pkey = NULL;
30520 if (pvalue) *pvalue = NULL;
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);
30535static void __Pyx_RaiseDoubleKeywordsError(
30536 const char* func_name,
30539 PyErr_Format(PyExc_TypeError,
30540 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
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);
30552 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
30553 return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
30555#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
30556 else if (unlikely(was_initialized == 1)) {
30557 __Pyx_CachedCFunction tmp_cfunc = {
30562 tmp_cfunc.type = cfunc->type;
30563 tmp_cfunc.method_name = cfunc->method_name;
30564 return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
30567 PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
30568 __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
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;
30580 PyTuple_SET_ITEM(args, 0, arg1);
30582 PyTuple_SET_ITEM(args, 1, arg2);
30583 if (cfunc->flag & METH_KEYWORDS)
30584 result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
30586 result = __Pyx_CallCFunction(cfunc, self, args);
30592 PyObject *args[4] = {NULL, self, arg1, arg2};
30593 return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
30598static int __Pyx_ValidateDuplicatePosArgs(
30600 PyObject **
const argnames[],
30601 PyObject **
const *first_kw_arg,
30602 const char* function_name)
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);
30618#if CYTHON_USE_UNICODE_INTERNALS
30619static CYTHON_INLINE
int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
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);
30630static int __Pyx_MatchKeywordArg_str(
30632 PyObject **
const argnames[],
30633 PyObject **
const *first_kw_arg,
30634 size_t *index_found,
30635 const char *function_name)
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))
30646 name = first_kw_arg;
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);
30655 #if CYTHON_ASSUME_SAFE_SIZE
30656 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
30659 int cmp = PyUnicode_Compare(name_str, key);
30660 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
30662 *index_found = (size_t) (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;
30678 #if CYTHON_ASSUME_SAFE_SIZE
30679 if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
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;
30692 __Pyx_RaiseDoubleKeywordsError(function_name, key);
30697static int __Pyx_MatchKeywordArg_nostr(
30699 PyObject **
const argnames[],
30700 PyObject **
const *first_kw_arg,
30701 size_t *index_found,
30702 const char *function_name)
30704 PyObject **
const *name;
30705 if (unlikely(!PyUnicode_Check(key)))
goto invalid_keyword_type;
30706 name = first_kw_arg;
30708 int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
30710 *index_found = (size_t) (name - argnames);
30713 if (unlikely(cmp == -1))
goto bad;
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;
30727 __Pyx_RaiseDoubleKeywordsError(function_name, key);
30729invalid_keyword_type:
30730 PyErr_Format(PyExc_TypeError,
30731 "%.200s() keywords must be strings", function_name);
30736static CYTHON_INLINE
int __Pyx_MatchKeywordArg(
30738 PyObject **
const argnames[],
30739 PyObject **
const *first_kw_arg,
30740 size_t *index_found,
30741 const char *function_name)
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);
30747static void __Pyx_RejectUnknownKeyword(
30749 PyObject **
const argnames[],
30750 PyObject **
const *first_kw_arg,
30751 const char *function_name)
30753 #if CYTHON_AVOID_BORROWED_REFS
30754 PyObject *pos = NULL;
30756 Py_ssize_t pos = 0;
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))
30763 (void) __Pyx_PyDict_NextRef;
30764 while (PyDict_Next(kwds, &pos, &key, NULL))
30767 PyObject**
const *name = first_kw_arg;
30768 while (*name && (**name != key)) name++;
30770 size_t index_found = 0;
30771 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
30774 PyErr_Format(PyExc_TypeError,
30775 "%s() got an unexpected keyword argument '%U'",
30776 function_name, key);
30778 #if CYTHON_AVOID_BORROWED_REFS
30784 #if CYTHON_AVOID_BORROWED_REFS
30788 __Pyx_END_CRITICAL_SECTION();
30789 #if CYTHON_AVOID_BORROWED_REFS
30792 assert(PyErr_Occurred());
30794static int __Pyx_ParseKeywordDict(
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)
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;
30809 name = first_kw_arg;
30810 while (*name && num_kwargs > extracted) {
30811 PyObject * key = **name;
30814 #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
30815 found = PyDict_GetItemRef(kwds, key, &value);
30817 value = PyDict_GetItemWithError(kwds, key);
30822 if (unlikely(PyErr_Occurred()))
goto bad;
30826 if (unlikely(found < 0))
goto bad;
30827 values[name-argnames] = value;
30832 if (num_kwargs > extracted) {
30833 if (ignore_unknown_kwargs) {
30834 if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
30837 __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
30845static int __Pyx_ParseKeywordDictToDict(
30847 PyObject **
const argnames[],
30849 PyObject *values[],
30850 Py_ssize_t num_pos_args,
30851 const char* function_name)
30853 PyObject**
const *name;
30854 PyObject**
const *first_kw_arg = argnames + num_pos_args;
30856#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
30857 if (unlikely(!PyArg_ValidateKeywordArguments(kwds)))
return -1;
30859 if (PyDict_Update(kwds2, kwds) < 0)
goto bad;
30860 name = first_kw_arg;
30862 PyObject *key = **name;
30864#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
30865 int found = PyDict_Pop(kwds2, key, &value);
30867 if (unlikely(found < 0))
goto bad;
30868 values[name-argnames] = value;
30870#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
30871 int found = PyDict_GetItemRef(kwds2, key, &value);
30873 if (unlikely(found < 0))
goto bad;
30874 values[name-argnames] = value;
30875 if (unlikely(PyDict_DelItem(kwds2, key) < 0))
goto bad;
30878 #if CYTHON_COMPILING_IN_CPYTHON
30879 value = _PyDict_Pop(kwds2, key, kwds2);
30881 value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
30883 if (value == kwds2) {
30886 if (unlikely(!value))
goto bad;
30887 values[name-argnames] = value;
30892 len = PyDict_Size(kwds2);
30894 return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
30895 }
else if (unlikely(len == -1)) {
30902static int __Pyx_ParseKeywordsTuple(
30904 PyObject *
const *kwvalues,
30905 PyObject **
const argnames[],
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)
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);
30920 key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
30922#if !CYTHON_ASSUME_SAFE_MACROS
30923 if (unlikely(!key))
goto bad;
30925 name = first_kw_arg;
30926 while (*name && (**name != key)) name++;
30928 PyObject *value = kwvalues[pos];
30929 values[name-argnames] = __Pyx_NewRef(value);
30931 size_t index_found = 0;
30932 int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
30934 PyObject *value = kwvalues[pos];
30935 values[index_found] = __Pyx_NewRef(value);
30937 if (unlikely(cmp == -1))
goto bad;
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;
30946 #if CYTHON_AVOID_BORROWED_REFS
30953 PyErr_Format(PyExc_TypeError,
30954 "%s() got an unexpected keyword argument '%U'",
30955 function_name, key);
30958 #if CYTHON_AVOID_BORROWED_REFS
30965static int __Pyx_ParseKeywords(
30967 PyObject *
const *kwvalues,
30968 PyObject **
const argnames[],
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)
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);
30979 return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
30981 return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
30985static void __Pyx_RaiseArgtupleInvalid(
30986 const char* func_name,
30988 Py_ssize_t num_min,
30989 Py_ssize_t num_max,
30990 Py_ssize_t num_found)
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";
30998 num_expected = num_max;
30999 more_or_less =
"at most";
31002 more_or_less =
"exactly";
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);
31011static void __Pyx_ArgTypeError(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
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");
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;
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;
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;
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
31039 , name, type_name, obj_type_name
31040#
if __PYX_LIMITED_VERSION_HEX < 0x030C0000
31041 , (from_annotation_subclass ?
". " :
""), extra_info
31044#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
31045 if (exact == 2 && from_annotation_subclass) {
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);
31052 PyErr_SetRaisedException(vargs[0]);
31055 __Pyx_DECREF_TypeName(obj_type_name);
31056#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
31057obj_type_name_failed:
31059 __Pyx_DECREF_TypeName(type_name);
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))))
31067 if (!exact && likely(type) && likely(__Pyx_TypeCheck(obj, type)))
31069 __Pyx_ArgTypeError(obj, type, name, exact);
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)));
31080 #if CYTHON_COMPILING_IN_CPYTHON
31081 if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
31083 PyException_SetTraceback(value, tb);
31085 tmp_value = tstate->current_exception;
31086 tstate->current_exception = value;
31087 Py_XDECREF(tmp_value);
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);
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;
31112 *type = (PyObject*) Py_TYPE(exc_value);
31114 #if CYTHON_COMPILING_IN_CPYTHON
31115 *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
31118 *tb = PyException_GetTraceback(exc_value);
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;
31133#if CYTHON_COMPILING_IN_CPYTHON
31134static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
31136 return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
31138 return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
31141static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
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;
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;
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);
31167 return PyErr_GivenExceptionMatches(err, exc_type);
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);
31176 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
31181#if CYTHON_FAST_THREAD_STATE
31182static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
31184 n = PyTuple_GET_SIZE(tuple);
31185 for (i=0; i<
n; i++) {
31186 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
31188 for (i=0; i<
n; i++) {
31189 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
31193static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
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;
31202 exc_type = tstate->curexc_type;
31203 if (exc_type == err)
return 1;
31204 if (unlikely(!exc_type))
return 0;
31206 #if CYTHON_AVOID_BORROWED_REFS
31207 Py_INCREF(exc_type);
31209 if (unlikely(PyTuple_Check(err))) {
31210 result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
31212 result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
31214 #if CYTHON_AVOID_BORROWED_REFS
31215 Py_DECREF(exc_type);
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();
31230static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
31232#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
31233 (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
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);
31242 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
31243 if (unlikely(!result)) {
31244 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
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);
31261#if !CYTHON_VECTORCALL
31262static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *
const *args,
size_t nargsf) {
31264 switch (__Pyx_PyVectorcall_NARGS(nargsf)) {
31266 return PyObject_CallMethodObjArgs(args[0], name, NULL);
31268 return PyObject_CallMethodObjArgs(args[0], name, args[1], NULL);
31270 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], NULL);
31272 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], NULL);
31274 return PyObject_CallMethodObjArgs(args[0], name, args[1], args[2], args[3], args[4], NULL);
31276 PyObject *attr = PyObject_GetAttr(args[0], name);
31277 if (unlikely(!attr))
31279 result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1);
31286#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
31287static __Pyx_TypeName
31288__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
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);
31295 name = PyType_GetQualName(tp);
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) {
31306 result = PyUnicode_FromFormat(
"%U.%U", module, name);
31307 if (unlikely(result == NULL))
goto bad;
31310 Py_XDECREF(module);
31318 result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u_);
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;
31330 PyErr_Format(exc_type, message, arg, type_name);
31331 __Pyx_DECREF_TypeName(type_name);
31335static int __Pyx_RaiseUnexpectedTypeError(
const char *expected, PyObject *obj) {
31336 __Pyx_RaiseTypeErrorWithObjectType1(
31337 "Expected %.42s, got " __Pyx_FMT_TYPENAME,
31343static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
31344 PyObject* owned_instance = NULL;
31345 if (tb == Py_None) {
31347 }
else if (tb && !PyTraceBack_Check(tb)) {
31348 PyErr_SetString(PyExc_TypeError,
31349 "raise: arg 3 must be a traceback or None");
31352 if (value == Py_None)
31354 if (PyExceptionInstance_Check(type)) {
31356 PyErr_SetString(PyExc_TypeError,
31357 "instance exception may not have a separate value");
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)) {
31373 type = instance_class;
31377 if (!instance_class) {
31380 args = PyTuple_New(0);
31381 else if (PyTuple_Check(value)) {
31385 args = PyTuple_Pack(1, value);
31388 owned_instance = PyObject_Call(type, args, NULL);
31390 if (!owned_instance)
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));
31402 PyErr_SetString(PyExc_TypeError,
31403 "raise: exception class must be a subclass of BaseException");
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)
31414 }
else if (PyExceptionInstance_Check(cause)) {
31415 fixed_cause = cause;
31416 Py_INCREF(fixed_cause);
31418 PyErr_SetString(PyExc_TypeError,
31419 "exception causes must derive from "
31423 PyException_SetCause(value, fixed_cause);
31425 PyErr_SetObject(type, value);
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) {
31434 tstate->curexc_traceback = tb;
31435 Py_XDECREF(tmp_tb);
31438 PyObject *tmp_type, *tmp_value, *tmp_tb;
31439 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
31441 PyErr_Restore(tmp_type, tmp_value, tb);
31442 Py_XDECREF(tmp_tb);
31446 Py_XDECREF(owned_instance);
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"
31463static const char DIGIT_PAIRS_8[2*8*8+1] = {
31473static const char DIGITS_HEX[2*16+1] = {
31479static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength,
const char* chars,
int clength,
31480 int prepend_sign,
char padding_char) {
31482 Py_ssize_t uoffset = ulength - clength;
31483#if CYTHON_USE_UNICODE_INTERNALS
31486 uval = PyUnicode_New(ulength, 127);
31487 if (unlikely(!uval))
return NULL;
31488 udata = PyUnicode_DATA(uval);
31491 if (prepend_sign) {
31492 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0,
'-');
31495 for (; i < uoffset; i++) {
31496 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
31499 for (i=0; i < clength; i++) {
31500 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
31504 PyObject *
sign = NULL, *padding = NULL;
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);
31515 if (unlikely(!padding))
goto done_or_error;
31517 if (prepend_sign) {
31518 sign = PyUnicode_FromOrdinal(
'-');
31519 if (unlikely(!
sign))
goto done_or_error;
31522 uval = PyUnicode_DecodeASCII(chars, clength, NULL);
31523 if (likely(uval) && padding) {
31524 PyObject *tmp = PyUnicode_Concat(padding, uval);
31528 if (likely(uval) &&
sign) {
31529 PyObject *tmp = PyUnicode_Concat(
sign, uval);
31534 Py_XDECREF(padding);
31542static CYTHON_INLINE
int __Pyx_CheckUnicodeValue(
int value) {
31543 return value <= 1114111;
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))) {
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);
31554 char *cpos = chars +
sizeof(chars);
31555 if (value < 0x800) {
31556 *--cpos = (char) (0x80 | (value & 0x3f));
31558 *--cpos = (char) (0xc0 | (value & 0x1f));
31559 }
else if (value < 0x10000) {
31560 *--cpos = (char) (0x80 | (value & 0x3f));
31562 *--cpos = (char) (0x80 | (value & 0x3f));
31564 *--cpos = (char) (0xe0 | (value & 0x0f));
31566 *--cpos = (char) (0x80 | (value & 0x3f));
31568 *--cpos = (char) (0x80 | (value & 0x3f));
31570 *--cpos = (char) (0x80 | (value & 0x3f));
31572 *--cpos = (char) (0xf0 | (value & 0x07));
31574 cpos -= padding_length;
31575 memset(cpos, padding_char, (
size_t) padding_length);
31576 return PyUnicode_DecodeUTF8(cpos, chars +
sizeof(chars) - cpos, NULL);
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);
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);
31594 result = PyUnicode_Concat(padding, uchar);
31595 Py_DECREF(padding);
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"
31607 const int neg_one = (int) -1, const_zero = (
int) 0;
31608#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31609#pragma GCC diagnostic pop
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)");
31618 return PyUnicode_FromOrdinal((
int) value);
31620 return __Pyx_PyUnicode_FromOrdinal_Padded((
int) value, width, padding_char);
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;
31629#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31630#pragma GCC diagnostic push
31631#pragma GCC diagnostic ignored "-Wconversion"
31633 const int neg_one = (int) -1, const_zero = (
int) 0;
31634#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31635#pragma GCC diagnostic pop
31637 const int is_unsigned = neg_one > const_zero;
31638 if (format_char ==
'X') {
31647 switch (format_char) {
31649 digit_pos = abs((
int)(remaining % (8*8)));
31650 remaining = (int) (remaining / (8*8));
31652 memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
31653 last_one_off = (digit_pos < 8);
31656 digit_pos = abs((
int)(remaining % (10*10)));
31657 remaining = (int) (remaining / (10*10));
31659 memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
31660 last_one_off = (digit_pos < 10);
31663 *(--dpos) = hex_digits[abs((
int)(remaining % 16))];
31664 remaining = (int) (remaining / 16);
31670 }
while (unlikely(remaining != 0));
31671 assert(!last_one_off || *dpos ==
'0');
31672 dpos += last_one_off;
31673 length = end - dpos;
31676 if (!is_unsigned && value <= neg_one) {
31677 if (padding_char ==
' ' || width <= length + 1) {
31685 if (width > ulength) {
31688 if (ulength == 1) {
31689 return PyUnicode_FromOrdinal(*dpos);
31691 return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (
int) length, prepend_sign, padding_char);
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"
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
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)");
31711 return PyUnicode_FromOrdinal((
int) value);
31713 return __Pyx_PyUnicode_FromOrdinal_Padded((
int) value, width, padding_char);
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"
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
31730 const int is_unsigned = neg_one > const_zero;
31731 if (format_char ==
'X') {
31740 switch (format_char) {
31742 digit_pos = abs((
int)(remaining % (8*8)));
31743 remaining = (Py_ssize_t) (remaining / (8*8));
31745 memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
31746 last_one_off = (digit_pos < 8);
31749 digit_pos = abs((
int)(remaining % (10*10)));
31750 remaining = (Py_ssize_t) (remaining / (10*10));
31752 memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
31753 last_one_off = (digit_pos < 10);
31756 *(--dpos) = hex_digits[abs((
int)(remaining % 16))];
31757 remaining = (Py_ssize_t) (remaining / 16);
31763 }
while (unlikely(remaining != 0));
31764 assert(!last_one_off || *dpos ==
'0');
31765 dpos += last_one_off;
31766 length = end - dpos;
31769 if (!is_unsigned && value <= neg_one) {
31770 if (padding_char ==
' ' || width <= length + 1) {
31778 if (width > ulength) {
31781 if (ulength == 1) {
31782 return PyUnicode_FromOrdinal(*dpos);
31784 return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (
int) length, prepend_sign, padding_char);
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;
31800 result_ukind = 1 << kind_shift;
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))
31806 for (i=0; i < value_count; i++) {
31808 Py_ssize_t ulength;
31810 PyObject *uval = values[i];
31811 if (__Pyx_PyUnicode_READY(uval) == (-1))
31813 ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
31814 #if !CYTHON_ASSUME_SAFE_SIZE
31815 if (unlikely(ulength < 0))
goto bad;
31817 if (unlikely(!ulength))
31819 if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
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));
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);
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);
31838 char_pos += ulength;
31840 return result_uval;
31842 PyErr_SetString(PyExc_OverflowError,
"join() result is too long for a Python string");
31844 Py_DECREF(result_uval);
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;
31857 result = PyUnicode_Join(__pyx_mstate_global->__pyx_empty_unicode, value_tuple);
31859 Py_DECREF(value_tuple);
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) {
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;
31875 if (length != 1)
goto return_ne;
31876 kind = PyUnicode_KIND(s1);
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];
31883 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
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];
31894 if (kind == PyUnicode_4BYTE_KIND){
31895 ch1 = PyUnicode_4BYTE_DATA(s1)[0];
31906 return (equals == Py_EQ);
31908 return (equals == Py_NE);
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;
31923 if (result == 0)
goto __pyx_return_false;
else goto __pyx_return_true;
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;
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;
31940 if (PyFloat_CheckExact(op1)) {
31941 goto __pyx_richcmp;
31943 if (PyLong_CheckExact(op1)) {
31944 if (op1 == op2)
goto __pyx_return_true;
31945 goto __pyx_richcmp;
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);
31953 goto __pyx_richcmp;
31956 if ((0))
goto __pyx_richcmp;
31957 if ((0))
goto __pyx_return_true;
31958 if ((0))
goto __pyx_return_false;
31960 return __Pyx_PyObject_RichCompareBool(op1, op2, Py_EQ);
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);
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;
31985 if (ps1[0] != ps2[0])
goto __pyx_return_false;
31986 if (length == 1)
goto __pyx_return_true;
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;
31994 cmp = memcmp(ps1, ps2, (
size_t)length);
31995 if (cmp == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
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);
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;
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;
32027 cmp = memcmp(ps1, ps2, (
size_t)length);
32028 if (cmp == 0)
goto __pyx_return_true;
else goto __pyx_return_false;
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;
32042 if (PyFloat_CheckExact(op1)) {
32043 goto __pyx_richcmp;
32045 if (PyLong_CheckExact(op1)) {
32046 if (op1 == op2)
goto __pyx_return_true;
32047 goto __pyx_richcmp;
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);
32055 goto __pyx_richcmp;
32058 if ((0))
goto __pyx_richcmp;
32059 if ((0))
goto __pyx_return_true;
32060 if ((0))
goto __pyx_return_false;
32062 return PyObject_RichCompare(op1, op2, Py_EQ);
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);
32075 return PyObject_GetAttr(o,
n);
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);
32086#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
32087static int __Pyx_GetItemInt_wraparound(PyObject *o, PySequenceMethods *sm, Py_ssize_t *i) {
32089 if (likely(sm->sq_length)) {
32090 Py_ssize_t l = sm->sq_length(o);
32091 if (likely(l >= 0)) {
32094 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
32104static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
32106 if (unlikely(!j))
return NULL;
32107 r = PyObject_GetItem(o, j);
32111static PyObject *__Pyx_GetItemInt_Generic_size(PyObject *o, Py_ssize_t i) {
32112 return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
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;
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)) {
32134 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
32135 return __Pyx_PyList_GET_ITEM_REF(o, wrapped_i, unsafe_shared);
32137 return __Pyx_GetItemInt_Generic_size(o, i);
32141 return PySequence_GetItem(o, i);
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;
32157 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_COMPILING_IN_LIMITED_API
32158 return PySequence_ITEM(o, wrapped_i);
32160 if (unlikely(wrapped_i < 0)) {
32161 PyErr_SetString(PyExc_IndexError,
"tuple index out of range");
32164 return PySequence_GetItem(o, wrapped_i);
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)) {
32172 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, size))) {
32173 return __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(o, wrapped_i));
32175 return __Pyx_GetItemInt_Generic_size(o, i);
32179 return PySequence_GetItem(o, i);
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);
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);
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);
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);
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);
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);
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))
32228 return sm->sq_item(o, i);
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);
32237 if (!PyMapping_Check(o)) {
32238 return PySequence_GetItem(o, i);
32243 return __Pyx_GetItemInt_Generic_size(o, i);
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;
32252 PyErr_Format(exc_type, message, type_name);
32253 __Pyx_DECREF_TypeName(type_name);
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);
32265 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
32267 __Pyx_RaiseErrorWithObjectType(
32269 "cannot fit '" __Pyx_FMT_TYPENAME
"' into an index-sized integer",
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);
32279 PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_mstate_global->__pyx_n_u_class_getitem);
32281 if (PyErr_Occurred()) {
32285 PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
32290 __Pyx_RaiseTypeErrorWithObjectType(
32291 "'" __Pyx_FMT_TYPENAME
"' object is not subscriptable", obj);
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);
32301 if (likely(sm && sm->sq_item)) {
32302 return __Pyx_PyObject_GetIndex(obj, key);
32304 return __Pyx_PyObject_GetItem_Slow(obj, key);
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);
32314#if CYTHON_AVOID_BORROWED_REFS
32315 PyObject *pos = NULL;
32317 Py_ssize_t pos = 0;
32319#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
32320 if (unlikely(!PyArg_ValidateKeywordArguments(kwds)))
return;
32322 __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL);
32323#if CYTHON_AVOID_BORROWED_REFS
32328 PyErr_Format(PyExc_TypeError,
32329 "%s() got an unexpected keyword argument '%U'",
32330 function_name, key);
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))
32343 return q - adapt_python;
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)))
32353 __Pyx_PyErr_Clear();
32358static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *
n, PyObject *d) {
32360#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
32361 int res = PyObject_GetOptionalAttr(o,
n, &
r);
32362 return (res != 0) ?
r : __Pyx_NewRef(d);
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);
32373 r = PyObject_GetAttr(o,
n);
32374 return (likely(
r)) ?
r : __Pyx_GetAttr3Default(d);
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;
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;
32388#if CYTHON_COMPILING_IN_CPYTHON
32389 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
32391 dictptr = _PyObject_GetDictPtr(obj);
32394 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
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)))
32400 return obj_dict_version == __Pyx_get_object_dict_version(obj);
32405#if CYTHON_USE_DICT_VERSIONS
32406static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
32408static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
32412#if CYTHON_COMPILING_IN_LIMITED_API
32413 if (unlikely(!__pyx_m)) {
32414 if (!PyErr_Occurred())
32415 PyErr_SetNone(PyExc_NameError);
32418 result = PyObject_GetAttr(__pyx_m, name);
32419 if (likely(result)) {
32422 if (!__Pyx_IgnoreException(PyExc_Exception)) {
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)) {
32431 __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
32432 if (likely(result)) {
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);
32441 PyObject *exc = PyErr_Occurred();
32442 if (unlikely(exc) && !__Pyx_IgnoreGivenException(exc, PyExc_Exception)) {
32446 return __Pyx_GetBuiltinName(name);
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);
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");
32463static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
32464 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
32468#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
32469static _PyErr_StackItem *
32470__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
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)
32476 exc_info = exc_info->previous_item;
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) {
32493 *value = exc_value;
32495 *type = (PyObject*) Py_TYPE(exc_value);
32497 *tb = PyException_GetTraceback(exc_value);
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;
32505 Py_XINCREF(*value);
32508 *type = tstate->exc_type;
32509 *value = tstate->exc_value;
32510 *tb = tstate->exc_traceback;
32512 Py_XINCREF(*value);
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);
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;
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;
32542 Py_XDECREF(tmp_type);
32543 Py_XDECREF(tmp_value);
32544 Py_XDECREF(tmp_tb);
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;
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;
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
32564 __Pyx_DECREF_TypeName(type_name1);
32568static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
32569 if (unlikely(!type)) {
32570 PyErr_SetString(PyExc_SystemError,
"Missing type object");
32573 if (likely(__Pyx_TypeCheck(obj, type)))
32575 __Pyx_RaiseTypeErrorWithTypes(
32576 "Cannot convert " __Pyx_FMT_TYPENAME
" to " __Pyx_FMT_TYPENAME,
32577 Py_TYPE(obj), type);
32582#if CYTHON_FAST_THREAD_STATE
32583static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
32585static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
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;
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;
32602#elif __PYX_LIMITED_VERSION_HEX >= 0x030C0000
32603 local_value = PyErr_GetRaisedException();
32605 PyErr_Fetch(&local_type, &local_value, &local_tb);
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);
32614 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
32615#if CYTHON_FAST_THREAD_STATE
32616 if (unlikely(tstate->curexc_type))
32618 if (unlikely(PyErr_Occurred()))
32622 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
32626 Py_XINCREF(local_tb);
32627 Py_XINCREF(local_type);
32628 Py_XINCREF(local_value);
32629 *type = local_type;
32630 *value = local_value;
32632#if CYTHON_FAST_THREAD_STATE
32633 #if CYTHON_USE_EXC_INFO_STACK
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;
32641 Py_XDECREF(local_type);
32642 Py_XDECREF(local_tb);
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;
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;
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);
32669 PyErr_SetExcInfo(local_type, local_value, local_tb);
32672#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
32677 Py_XDECREF(local_type);
32678 Py_XDECREF(local_value);
32679 Py_XDECREF(local_tb);
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);
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);
32704 tmp_tb = PyException_GetTraceback(tmp_value);
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;
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;
32724 *value = tmp_value;
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);
32733 *value = tmp_value;
32739#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
32740static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *
n) {
32742 if (unlikely(!PyUnicode_Check(
n))) {
32743 PyErr_SetString(PyExc_TypeError,
32744 "hasattr(): attribute name must be string");
32747 r = __Pyx_PyObject_GetAttrStrNoError(o,
n);
32749 return (unlikely(PyErr_Occurred())) ? -1 : 0;
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);
32766 for (i = 0; i <
n; i++) {
32768 if (unlikely(__Pyx_PyList_SET_ITEM(res, i, src[i]) < (0))) {
32778static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
32779 PyObject *imported_module = PyImport_GetModule(qualname);
32780 if (unlikely(!imported_module)) {
32782 if (PyErr_Occurred()) {
32787 *
module = imported_module;
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;
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)) {
32799 return module_found;
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);
32807 int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
32808 if (unlikely(has_imported_attribute == -1))
goto error;
32810 if (!has_imported_attribute) {
32814 *
module = imported_module;
32817 dot_index = PyUnicode_FindChar(qualname,
'.', 0, PY_SSIZE_T_MAX, 1);
32818 if (dot_index == -1) {
32819 *
module = imported_module;
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);
32830 Py_DECREF(imported_module);
32834 Py_DECREF(imported_module);
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;
32846 module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
32847 if (likely(module_found == 1)) {
32849 }
else if (unlikely(module_found == -1)) {
32852 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030f00a6
32853 empty_dict = PyFrozenDict_New(NULL);
32855 empty_dict = PyDict_New();
32857 if (unlikely(!empty_dict))
32859 if (imported_names) {
32860 from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
32861 if (unlikely(!from_list))
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)))
32878 module = PyImport_ImportModuleLevelObject(
32879 name, moddict, empty_dict, from_list, level);
32882 Py_XDECREF(from_list);
32883 Py_XDECREF(empty_dict);
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);
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);
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);
32909 int result = PyList_Append(list, x);
32914static CYTHON_INLINE
int __Pyx_ListComp_AppendAndDecref(PyObject* list, PyObject* x) {
32915 int result = PyList_Append(list, x);
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))
32927 result = PyNumber_Multiply(seq, pymul);
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);
32936 return __Pyx_PySequence_Multiply_Generic(seq, mul);
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};
32949 opname[op[1] ? 2 : 1] =
'=';
32951 __Pyx_RaiseErrorWithObjectTypes1(
32953 "unsupported operand type(s) for %.3s: '" __Pyx_FMT_TYPENAME
"' and '" __Pyx_FMT_TYPENAME
"'",
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)) {
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;
32970 int_op2 = PyLong_AsDouble(op2);
32971 if (unlikely((int_op2 == -1.) && PyErr_Occurred()))
return NULL;
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;
32977 if (float_op1 == 0.)
return __Pyx_NewRef(op1);
32978 return PyFloat_FromDouble(float_op1 * int_op2);
32980 #if CYTHON_USE_TYPE_SLOTS || __PYX_LIMITED_VERSION_HEX >= 0x030A0000
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)) {
32991 __Pyx_BinopTypeError(op1, op2,
"*", inplace);
32995 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
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
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)) {
33013 ssizeargfunc repeat_func = __Pyx_PyType_GetSubSlot(type_op2, tp_as_sequence, sq_repeat, ssizeargfunc);
33014 if (likely(repeat_func)) {
33016 #if CYTHON_USE_PYLONG_INTERNALS
33017 if (__Pyx_PyLong_IsCompact(op1)) {
33018 count = __Pyx_PyLong_CompactValue(op1);
33022 count = PyLong_AsSsize_t(op1);
33023 if (unlikely((count == -1) && PyErr_Occurred()))
return NULL;
33025 return repeat_func(op2, count);
33027 __Pyx_BinopTypeError(op1, op2,
"*", inplace);
33031 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
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);
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);
33051 else if (__Pyx_PyLong_IsZero(op2))
return __Pyx_NewRef(op2);
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);
33058 return __Pyx_PyNumber_Multiply_xint_int(op1, op2, inplace);
33060 return (inplace) ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2);
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);
33070static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject*
s, PyObject*
f) {
33072 if (unlikely(!
s))
return NULL;
33073 result = PyObject_Format(
s,
f);
33079#if CYTHON_USE_UNICODE_WRITER
33080static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) {
33082 _PyUnicodeWriter writer;
33083 if (likely(PyFloat_CheckExact(obj))) {
33084 _PyUnicodeWriter_Init(&writer);
33085 ret = _PyFloat_FormatAdvancedWriter(
33088 format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
33089 }
else if (likely(PyLong_CheckExact(obj))) {
33090 _PyUnicodeWriter_Init(&writer);
33091 ret = _PyLong_FormatAdvancedWriter(
33094 format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
33096 return PyObject_Format(obj, format_spec);
33098 if (unlikely(ret == -1)) {
33099 _PyUnicodeWriter_Dealloc(&writer);
33102 return _PyUnicodeWriter_Finish(&writer);
33107static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *
v) {
33109 if (unlikely(!j))
return -1;
33110 r = PyObject_SetItem(o, j,
v);
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);
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))) {
33131 return PyList_SetItem(o,
n,
v);
33132 }
else if ((!boundscheck) || likely(__Pyx_is_valid_index(
n, PyList_GET_SIZE(o)))) {
33135 old = PyList_GET_ITEM(o,
n);
33136 PyList_SET_ITEM(o,
n,
v);
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);
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);
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))
33158 return sm->sq_ass_item(o, i,
v);
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);
33167 if (!PyMapping_Check(o)) {
33168 return PySequence_SetItem(o, i,
v);
33173 return __Pyx_SetItemInt_Generic(o, PyLong_FromSsize_t(i),
v);
33177static void __Pyx_RaiseUnboundLocalError(
const char *varname) {
33178 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
33182static CYTHON_INLINE
long __Pyx_div_long(
long a,
long b,
int b_is_constant) {
33185 long adapt_python = (b_is_constant ?
33186 ((
r != 0) & ((
r < 0) ^ (b < 0))) :
33187 ((
r != 0) & ((
r ^ b) < 0))
33189 return q - adapt_python;
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))) {
33199 __Pyx__ListComp_AppendAndDecref(list, len, x);
33202 return PyList_Append(list, x);
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);
33214 return PyObject_CallMethodOneArg(obj, method_name, arg);
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);
33226 return __Pyx_PyObject_CallMethod1(sep, __pyx_mstate_global->__pyx_n_u_join, values);
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"
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
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)");
33247 return PyUnicode_FromOrdinal((
int) value);
33249 return __Pyx_PyUnicode_FromOrdinal_Padded((
int) value, width, padding_char);
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;
33258#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33259#pragma GCC diagnostic push
33260#pragma GCC diagnostic ignored "-Wconversion"
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
33266 const int is_unsigned = neg_one > const_zero;
33267 if (format_char ==
'X') {
33276 switch (format_char) {
33278 digit_pos = abs((
int)(remaining % (8*8)));
33279 remaining = (size_t) (remaining / (8*8));
33281 memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
33282 last_one_off = (digit_pos < 8);
33285 digit_pos = abs((
int)(remaining % (10*10)));
33286 remaining = (size_t) (remaining / (10*10));
33288 memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
33289 last_one_off = (digit_pos < 10);
33292 *(--dpos) = hex_digits[abs((
int)(remaining % 16))];
33293 remaining = (size_t) (remaining / 16);
33299 }
while (unlikely(remaining != 0));
33300 assert(!last_one_off || *dpos ==
'0');
33301 dpos += last_one_off;
33302 length = end - dpos;
33305 if (!is_unsigned && value <= neg_one) {
33306 if (padding_char ==
' ' || width <= length + 1) {
33314 if (width > ulength) {
33317 if (ulength == 1) {
33318 return PyUnicode_FromOrdinal(*dpos);
33320 return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (
int) length, prepend_sign, padding_char);
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);
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;
33334 const PY_LONG_LONG llb = intval;
33336 if (unlikely(__Pyx_PyLong_IsZero(op1))) {
33337 return __Pyx_NewRef(op2);
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;
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;
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;
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;
33374 return PyLong_Type.tp_as_number->nb_add(op1, op2);
33380 return PyLong_FromLong(x);
33382 calculate_long_long:
33386 return PyLong_FromLongLong(llx);
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);
33397 result = ((double)a) + (
double)b;
33398 return PyFloat_FromDouble(result);
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);
33408 if (PyFloat_CheckExact(op1)) {
33409 return __Pyx_Float___Pyx_PyLong_AddObjC(op1, intval, zerodivision_check);
33411 return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace);
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);
33421 newfunc tp_new = __Pyx_PyType_TryGetSlot(&PyBaseObject_Type, tp_new, newfunc);
33422 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
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);
33433 return tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
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)) {
33443 args[args_size+i] = value;
33445 if (unlikely(__Pyx_PyTuple_SET_ITEM(kwnames, i, key) == -1)) {
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;
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;
33464#if CYTHON_ASSUME_SAFE_MACROS
33466 return f(o, &PyTuple_GET_ITEM(a, 0), a_size, NULL);
33469 if (k_size == 0 && a_size == 0) {
33470 return f(o, NULL, 0, NULL);
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) {
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)) {
33488 PyObject * result = NULL;
33489 PyObject *kwnames = NULL;
33490 int unpack_dict_result;
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;
33498#if !CYTHON_ASSUME_SAFE_MACROS
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;
33509 result =
f(o, args, a_size, kwnames);
33511 Py_XDECREF(kwnames);
33512 for (i=a_size; i<total_size; ++i) {
33513 Py_XDECREF(args[i]);
33515 if (args != stack_args) {
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);
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)) {
33539 kwds_dict = __Pyx_PyDict_NewPresized(kw_size);
33540 if (unlikely(!kwds_dict)) {
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)) {
33551 if (unlikely(PyDict_SetItem(kwds_dict, k,
v) < 0)) {
33557 args_tuple = __Pyx_PyTuple_FromArray(args, nargs);
33558 if (unlikely(!args_tuple)) {
33562 args_tuple = __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
33564 result = tp_new(t, args_tuple, kwds_dict);
33565 if (unlikely(!result)) {
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)) {
33575 Py_XDECREF(args_tuple);
33576 Py_XDECREF(kwds_dict);
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;
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;
33592#if CYTHON_ASSUME_SAFE_MACROS
33594 return f(o, &PyTuple_GET_ITEM(a, 0), a_size, NULL);
33597 if (k_size == 0 && a_size == 0) {
33598 return f(o, NULL, 0, NULL);
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) {
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)) {
33617 PyObject *kwnames = NULL;
33618 int unpack_dict_result;
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;
33626#if !CYTHON_ASSUME_SAFE_MACROS
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;
33637 result =
f(o, args, a_size, kwnames);
33639 Py_XDECREF(kwnames);
33640 for (i=a_size; i<total_size; ++i) {
33641 Py_XDECREF(args[i]);
33643 if (args != stack_args) {
33651#if !CYTHON_USE_TYPE_SPECS
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) {
33661 Py_VISIT((PyObject*)Py_TYPE(o));
33667#if CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_PYPY && CYTHON_USE_TYPE_SPECS)
33668int __Pyx_ApplySequenceOrMappingFlag(PyTypeObject *tp,
int is_sequence) {
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);
33677 if (unlikely(!register_result))
return -1;
33678 Py_DECREF(register_result);
33681#elif CYTHON_COMPILING_IN_PYPY
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",
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);
33700 return PyObject_CallMethodNoArgs(obj, method_name);
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)) {
33716 "'type' doesn't have a dictoffset");
33718 }
else if (unlikely(require_cython_valid_result && tp_dictoffset < 0)) {
33721 "'type' has an unexpected negative dictoffset. "
33722 "Please report this as Cython bug");
33725 return tp_dictoffset;
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) {
33733#if CYTHON_ASSUME_SAFE_SIZE
33734 n = PyTuple_GET_SIZE(bases);
33736 n = PyTuple_Size(bases);
33737 if (unlikely(
n < 0))
return -1;
33739 if (!has_dictoffset) {
33741#if CYTHON_AVOID_BORROWED_REFS
33742 b = PySequence_GetItem(bases, 0);
33744#elif CYTHON_ASSUME_SAFE_MACROS
33745 b = PyTuple_GET_ITEM(bases, 0);
33747 b = PyTuple_GetItem(bases, 0);
33750#if CYTHON_USE_TYPE_SLOTS
33751 has_dictoffset = ((PyTypeObject*)b)->tp_dictoffset != 0;
33753 Py_ssize_t dictoffset = __Pyx_GetTypeDictOffset(b, 0);
33754 has_dictoffset = dictoffset != 0;
33756#if CYTHON_AVOID_BORROWED_REFS
33759#if !CYTHON_USE_TYPE_SLOTS
33760 if (dictoffset == -1 && PyErr_Occurred())
return -1;
33763 for (i = 1; i <
n; i++)
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);
33772 PyObject *b0 = PyTuple_GetItem(bases, i);
33773 if (!b0)
return -1;
33775 b = (PyTypeObject*) b0;
33776 if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
33778 __Pyx_RaiseErrorWithType(
33779 PyExc_TypeError,
"base class '" __Pyx_FMT_TYPENAME
"' is not a heap type", b);
33780#if CYTHON_AVOID_BORROWED_REFS
33785 if (!has_dictoffset)
33787 Py_ssize_t b_dictoffset = 0;
33788#if CYTHON_USE_TYPE_SLOTS
33789 b_dictoffset = b->tp_dictoffset;
33791 b_dictoffset = __Pyx_GetTypeDictOffset((PyObject*)b, 0);
33792 if (b_dictoffset == -1 && PyErr_Occurred())
goto dictoffset_return;
33794 if (b_dictoffset) {
33795 __Pyx_RaiseErrorWithType1(
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",
33802#if !CYTHON_USE_TYPE_SLOTS
33805#if CYTHON_AVOID_BORROWED_REFS
33811#if CYTHON_AVOID_BORROWED_REFS
33820CYTHON_UNUSED
static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) {
33822 PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
33826 t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*);
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;
33836 return PyType_Ready(t);
33839 if (!__Pyx_PyType_HasMultipleInheritance(t)) {
33840 return PyType_Ready(t);
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))
33846 int gc_was_enabled;
33847 #if PY_VERSION_HEX >= 0x030A00b1
33848 gc_was_enabled = PyGC_Disable();
33849 (void)__Pyx_PyObject_CallMethod0;
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);
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)) {
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)) {
33873 }
else if (unlikely(gc_was_enabled == -1)) {
33878 t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
33879#if PY_VERSION_HEX >= 0x030A0000
33880 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
33882 r = PyType_Ready(t);
33883 t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
33884 #if PY_VERSION_HEX >= 0x030A00b1
33885 if (gc_was_enabled)
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)) {
33894 PyErr_Restore(tp,
v, tb);
33910static int __Pyx_GetVtable(PyTypeObject *type,
void** table) {
33913#if CYTHON_COMPILING_IN_LIMITED_API
33914 PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
33916 PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
33920 ptr = PyCapsule_GetPointer(ob, 0);
33921 if (!ptr && !PyErr_Occurred())
33922 PyErr_SetString(PyExc_RuntimeError,
"invalid vtable found for imported type");
33927 if (PyErr_ExceptionMatches(CYTHON_COMPILING_IN_LIMITED_API ? PyExc_AttributeError : PyExc_KeyError)) {
33935static int __Pyx_MergeVtables(PyTypeObject *type) {
33938 void** base_vtables;
33939 void* unknown = (
void*)-1;
33940 PyObject* bases = __Pyx_PyType_GetSlot(type, tp_bases, PyObject*);
33941 int base_depth = 0;
33943 PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
33946 base = __Pyx_PyType_TryGetSlot(base, tp_base, PyTypeObject*);
33949 base_vtables = (
void**) PyMem_Malloc(
sizeof(
void*) * (
size_t)(base_depth + 1));
33950 if (unlikely(!base_vtables)) {
33954 base_vtables[0] = unknown;
33955#if CYTHON_COMPILING_IN_LIMITED_API
33956 size = PyTuple_Size(bases);
33957 if (size < 0)
goto other_failure;
33959 size = PyTuple_GET_SIZE(bases);
33961 for (i = 1; i < size; i++) {
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;
33971 basei = PyTuple_GET_ITEM(bases, i);
33973 int get_vtable_result = __Pyx_GetVtable((PyTypeObject*)basei, &base_vtable);
33974#if CYTHON_AVOID_BORROWED_REFS
33977 if (get_vtable_result != 1) {
33978 if (get_vtable_result == -1) {
33979 goto other_failure;
33983 assert(base_vtable != NULL);
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;
33989 for (j = 0; j < base_depth; j++) {
33990 if (base_vtables[j] == unknown) {
33991 switch (__Pyx_GetVtable(base, &base_vtables[j])) {
33993 assert(base_vtables[j] == NULL);
33999 goto other_failure;
34001 base_vtables[j + 1] = unknown;
34003 if (base_vtables[j] == base_vtable) {
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;
34013 PyMem_Free(base_vtables);
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;
34026 basei = (PyTypeObject*)PyTuple_GET_ITEM(bases, i);
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
34035 PyMem_Free(base_vtables);
34040static int __Pyx_SetVtable(PyTypeObject *type,
void *vtable) {
34041 PyObject *ob = PyCapsule_New(vtable, 0, 0);
34044#if CYTHON_COMPILING_IN_LIMITED_API
34045 if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
34047 if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
34051 return __Pyx_MergeVtables(type);
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())) {
34068 return *(PyObject**)((
char*)tp + tp_dictoffset);
34073static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k) {
34076#if CYTHON_COMPILING_IN_LIMITED_API
34077 tp_dict = __Pyx_GetTypeTypeDict(tp);
34078 if (unlikely(!tp_dict))
return -1;
34080 tp_dict = tp->tp_dict;
34082 result = PyDict_DelItem(tp_dict, k);
34083 if (likely(!result)) PyType_Modified(tp);
34088static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *
v) {
34091#if CYTHON_COMPILING_IN_LIMITED_API
34092 tp_dict = __Pyx_GetTypeTypeDict(tp);
34093 if (unlikely(!tp_dict))
return -1;
34095 tp_dict = tp->tp_dict;
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);
34110static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
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);
34119 if (unlikely(ret < 0) && __Pyx_IgnoreException(PyExc_Exception)) {
34122 Py_XDECREF(name_attr);
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);
34130 if (allow_not_present) {
34131 return __Pyx_PyObject_GetAttrStrNoError(type_obj, name);
34133 return __Pyx_PyObject_GetAttrStr(type_obj, name);
34137static int __Pyx_setup_reduce(PyObject* type_obj) {
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()) {
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()) {
34157 if (object_getstate != getstate) {
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)) {
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()) {
34183 setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate);
34184 int try_to_replace_setstate;
34186 PyObject *exc = PyErr_Occurred();
34187 if (exc && !__Pyx_IgnoreGivenException(exc, PyExc_Exception)) {
34190 try_to_replace_setstate = 1;
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)) {
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()) {
34206 PyType_Modified((PyTypeObject*)type_obj);
34211 if (!PyErr_Occurred()) {
34212 __Pyx_RaiseErrorWithType(
34213 PyExc_RuntimeError,
34214 "Unable to initialize pickling for " __Pyx_FMT_TYPENAME,
34215 (PyTypeObject*)type_obj);
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);
34225 Py_XDECREF(reduce);
34226 Py_XDECREF(reduce_ex);
34227 Py_XDECREF(reduce_cython);
34228 Py_XDECREF(setstate);
34229 Py_XDECREF(setstate_cython);
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)
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;
34246 result = PyObject_GetAttrString(module, class_name);
34249 if (!PyType_Check(result)) {
34250 PyErr_Format(PyExc_TypeError,
34251 "%.200s.%.200s is not a type object",
34252 module_name, class_name);
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;
34260 return (PyTypeObject *)result;
34262 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
34265 basicsize = PyLong_AsSsize_t(py_basicsize);
34266 Py_DECREF(py_basicsize);
34268 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
34270 py_itemsize = PyObject_GetAttrString(result,
"__itemsize__");
34273 itemsize = PyLong_AsSsize_t(py_itemsize);
34274 Py_DECREF(py_itemsize);
34276 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
34280 if (size % alignment) {
34281 alignment = size % alignment;
34283 if (itemsize < (Py_ssize_t)alignment)
34284 itemsize = (Py_ssize_t)alignment;
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);
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);
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) {
34309 return (PyTypeObject *)result;
34311 Py_XDECREF(result);
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;
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
34336 PyObject *modules = PyImport_GetModuleDict();
34337 if (unlikely(!modules))
34339 value = PyObject_GetItem(modules, full_name);
34342 value = PyImport_GetModule(full_name);
34345 Py_XDECREF(full_name);
34346 Py_XDECREF(module_dot);
34347 Py_XDECREF(module_name);
34349 if (unlikely(!value)) {
34350 PyErr_Format(PyExc_ImportError,
"cannot import name %S", name);
34356static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_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);
34366 value = PyDict_SetDefault(d, key, default_value);
34367 if (unlikely(!value))
return NULL;
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();
34378 if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
34381 if (m != NULL && PyModule_Check(m)) {
34385 m = PyModule_NewObject(name);
34388 if (PyDict_CheckExact(module_dict)) {
34390 (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
34394 if (PyObject_SetItem(module_dict, name, m) != 0) {
34401 static PyObject *__Pyx_PyImport_AddModuleRef(
const char *name) {
34402 if ((PY_VERSION_HEX >= 0x030E0000) && Py_Version >= 0x030E0100) {
34403 return PyImport_AddModuleRef(name);
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);
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);
34420static PyObject *__Pyx_FetchSharedCythonABIModule(
void) {
34421 return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
34425static int __Pyx_VerifyCachedType(PyObject *cached_type,
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);
34434 if (expected_basicsize == 0) {
34437#if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_OPAQUE_OBJECTS
34438 if (expected_basicsize < 0) {
34439 basicsize = PyType_GetTypeDataSize((PyTypeObject*)cached_type);
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;
34452 basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
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",
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);
34475 PyType_Modified((PyTypeObject*)result);
34480#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
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(
34498 spec->basicsize) < 0) {
34502 }
else if (unlikely(get_item_ref_result == -1)) {
34505 cached_type = __Pyx_PyType_FromMetaclass(
34507 CYTHON_USE_MODULE_STATE ? module : abi_module,
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(
34518 spec->basicsize) < 0) {
34523 Py_DECREF(new_cached_type);
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;
34531 Py_XDECREF(cached_type);
34532 cached_type = NULL;
34537static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED
void* context) {
34538 return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
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");
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");
34550static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
34551 {
"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
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},
34563static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
34564 __PYX_TYPE_MODULE_PREFIX
"_common_types_metatype",
34567 Py_TPFLAGS_IMMUTABLETYPE |
34568 Py_TPFLAGS_DISALLOW_INSTANTIATION |
34569 Py_TPFLAGS_DEFAULT,
34570 __pyx_CommonTypesMetaclass_slots
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)) {
34578 mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
34580 if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
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;
34596static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunction(PyObject *func,
void (*cfunc)(
void)) {
34597 if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
34599 PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
34600 if (unlikely(!newFunc)) {
34604 result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
34605 Py_DECREF(newFunc);
34608 return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
34611static CYTHON_INLINE
int __Pyx__IsSameCyOrCFunction(PyObject *func,
void (*cfunc)(
void)) {
34612 if (PyMethod_Check(func)) {
34613 func = PyMethod_GET_FUNCTION(func);
34615 return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
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));
34624 __Pyx_Py_XDECREF_SET(
34625 ((PyCMethodObject *) (
f))->mm_class,
34626 (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
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);
34632 if (unlikely(!m->defaults))
34634 return m->defaults;
34636static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
34637 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
34638 m->defaults_tuple = tuple;
34641static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
34642 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
34643 m->defaults_kwdict = dict;
34646static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
34647 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(func);
34648 m->func_annotations = dict;
34653#if CYTHON_COMPILING_IN_LIMITED_API
34654static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
34656 CYTHON_UNUSED_VAR(typ);
34658 return __Pyx_NewRef(func);
34659 #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
34661 PyObject *args[] = {func, self};
34662 result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
34665 result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
34670static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
34671 CYTHON_UNUSED_VAR(typ);
34673 return __Pyx_NewRef(func);
34674 return PyMethod_New(func, self);
34679#if CYTHON_VECTORCALL
34680static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *
const *args,
size_t nargs, PyObject *kw)
34682 PyObject *res = NULL;
34684 PyObject **newargs;
34685 PyObject **kwvalues;
34687 #if CYTHON_AVOID_BORROWED_REFS
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;
34699 Py_ssize_t nkw = PyDict_GET_SIZE(kw);
34701 newargs = (PyObject **)PyMem_Malloc((nargs + (
size_t)nkw) *
sizeof(args[0]));
34702 if (unlikely(newargs == NULL)) {
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);
34712 kwvalues = newargs + nargs;
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));
34721 Py_TYPE(key)->tp_flags;
34723 #if !CYTHON_ASSUME_SAFE_MACROS
34724 if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0))
goto cleanup;
34726 PyTuple_SET_ITEM(kwnames, i, key);
34728 kwvalues[i] = value;
34731 if (unlikely(!keys_are_strings)) {
34732 PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
34735 res = vc(func, newargs, nargs, kwnames);
34737 #if CYTHON_AVOID_BORROWED_REFS
34740 Py_DECREF(kwnames);
34741 for (i = 0; i < nkw; i++)
34742 Py_DECREF(kwvalues[i]);
34743 PyMem_Free(newargs);
34746static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *
const *args,
size_t nargs, PyObject *kw)
34748 Py_ssize_t kw_size =
34749 likely(kw == NULL) ?
34751#if !CYTHON_ASSUME_SAFE_SIZE
34754 PyDict_GET_SIZE(kw);
34756 if (kw_size == 0) {
34757 return vc(func, args, nargs, NULL);
34759#if !CYTHON_ASSUME_SAFE_SIZE
34760 else if (unlikely(kw_size == -1)) {
34764 return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
34770__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
34772 if (unlikely(op->func_doc == NULL)) {
34773#if CYTHON_COMPILING_IN_LIMITED_API
34774 const char *doc = op->func_methoddef->ml_doc;
34776 const char *doc = ((PyCFunctionObject*)op)->m_ml->ml_doc;
34779 op->func_doc = PyUnicode_FromString(doc);
34780 if (unlikely(op->func_doc == NULL))
34783 Py_INCREF(Py_None);
34787 Py_INCREF(op->func_doc);
34788 return op->func_doc;
34791__Pyx_CyFunction_get_doc(PyObject *op_in,
void *closure) {
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();
34801__Pyx_CyFunction_set_doc(PyObject *op_in, PyObject *value,
void *context)
34803 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34804 CYTHON_UNUSED_VAR(context);
34805 if (value == NULL) {
34809 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34810 __Pyx_Py_XDECREF_SET(op->func_doc, value);
34811 __Pyx_END_CRITICAL_SECTION();
34815__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
34817 if (unlikely(op->func_name == NULL)) {
34818#if CYTHON_COMPILING_IN_LIMITED_API
34819 const char *name = op->func_methoddef->ml_name;
34821 const char *name = ((PyCFunctionObject*)op)->m_ml->ml_name;
34823 op->func_name = PyUnicode_InternFromString(name);
34824 if (unlikely(op->func_name == NULL))
34827 Py_INCREF(op->func_name);
34828 return op->func_name;
34831__Pyx_CyFunction_get_name(PyObject *op,
void *context)
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();
34841__Pyx_CyFunction_set_name(PyObject *op_in, PyObject *value,
void *context)
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");
34849 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34851 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34852 __Pyx_Py_XDECREF_SET(op->func_name, value);
34853 __Pyx_END_CRITICAL_SECTION();
34857__Pyx_CyFunction_get_qualname(PyObject *op_in,
void *context)
34859 CYTHON_UNUSED_VAR(context);
34860 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34862 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34863 Py_INCREF(op->func_qualname);
34864 result = op->func_qualname;
34865 __Pyx_END_CRITICAL_SECTION();
34869__Pyx_CyFunction_set_qualname(PyObject *op_in, PyObject *value,
void *context)
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");
34877 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
34879 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34880 __Pyx_Py_XDECREF_SET(op->func_qualname, value);
34881 __Pyx_END_CRITICAL_SECTION();
34884#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
34886__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op,
void *context)
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))
34894 Py_INCREF(op->func_dict);
34895 return op->func_dict;
34899__Pyx_CyFunction_get_globals(PyObject *op_in,
void *context)
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;
34907__Pyx_CyFunction_get_closure(PyObject *op,
void *context)
34909 CYTHON_UNUSED_VAR(op);
34910 CYTHON_UNUSED_VAR(context);
34911 Py_INCREF(Py_None);
34915__Pyx_CyFunction_get_code(PyObject *op_in,
void *context)
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);
34924__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op, PyObject *op_obj) {
34926 PyObject *res = op->defaults_getter(op_obj);
34927 if (unlikely(!res))
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);
34935 op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
34936 if (unlikely(!op->defaults_tuple)) result = -1;
34938 op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
34939 if (unlikely(!op->defaults_kwdict)) result = -1;
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);
34951 }
else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
34952 PyErr_SetString(PyExc_TypeError,
34953 "__defaults__ must be set to a tuple object");
34956 PyErr_WarnEx(PyExc_RuntimeWarning,
"changes to cyfunction.__defaults__ will not "
34957 "currently affect the values used in function calls", 1);
34959 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
34960 __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
34961 __Pyx_END_CRITICAL_SECTION();
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;
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();
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);
34994 }
else if (unlikely(value != Py_None && !PyDict_Check(value))) {
34995 PyErr_SetString(PyExc_TypeError,
34996 "__kwdefaults__ must be set to a dict object");
34999 PyErr_WarnEx(PyExc_RuntimeWarning,
"changes to cyfunction.__kwdefaults__ will not "
35000 "currently affect the values used in function calls", 1);
35002 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
35003 __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
35004 __Pyx_END_CRITICAL_SECTION();
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;
35023__Pyx_CyFunction_get_kwdefaults(PyObject *op,
void *context) {
35025 CYTHON_UNUSED_VAR(context);
35026 __Pyx_BEGIN_CRITICAL_SECTION(op);
35027 result = __Pyx_CyFunction_get_kwdefaults_locked(op);
35028 __Pyx_END_CRITICAL_SECTION();
35031static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value);
35033__Pyx_CyFunction_set_annotations(PyObject *op_in, PyObject* value,
void *context) {
35034 CYTHON_UNUSED_VAR(context);
35035 if (!value || value == Py_None) {
35037 }
else if (unlikely(!PyDict_Check(value))) {
35038 PyErr_SetString(PyExc_TypeError,
35039 "__annotations__ must be set to a dict object");
35042 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
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;
35051__Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) {
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;
35059 PyObject **dictptr = _PyObject_GetDictPtr(op_in);
35060 *dict = likely(dictptr) ? *dictptr : NULL;
35062 return *dict ? 1 : 0;
35065__Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) {
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);
35074__Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) {
35077 dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
35078 if (!dict_found)
return 0;
35080 return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
35082#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
35083 return PyDict_Pop(dict, __pyx_mstate_global->__pyx_n_u_annotate, NULL);
35085 int result = PyDict_Contains(dict, __pyx_mstate_global->__pyx_n_u_annotate);
35087 result = PyDict_DelItem(dict, __pyx_mstate_global->__pyx_n_u_annotate);
35094__Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) {
35097#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
35098 dict = __Pyx_CyFunction_get_dict(__Pyx_as_CyFunctionObject(op_in), NULL);
35100 dict = PyObject_GenericGetDict(op_in, NULL);
35102 if (unlikely(!dict))
return -1;
35103 result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
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;
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();
35136 PyObject *format = PyLong_FromLong(1L);
35137 if (likely(format)) {
35138 if (!Py_EnterRecursiveCall(
" cyfunction __annotations__.__get__")) {
35139 result = __Pyx_PyObject_CallOneArg(annotate, format);
35140 Py_LeaveRecursiveCall();
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");
35151 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
35152 __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result));
35153 __Pyx_END_CRITICAL_SECTION();
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");
35163 if (Py_EnterRecursiveCall(
" in cyfunction annotate")) {
35166 result = __Pyx_CyFunction_get_annotations(self, NULL);
35167 Py_LeaveRecursiveCall();
35171__Pyx_CyFunction_get_annotate(PyObject *op_in,
void *context);
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");
35179 if (unlikely(value != Py_None && !PyCallable_Check(value))) {
35180 PyErr_SetString(PyExc_TypeError,
"__annotate__ must be callable or None");
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;
35190 PyCFunction cfunction = PyCFunction_GET_FUNCTION(value);
35191 PyObject *value_self = PyCFunction_GET_SELF(value);
35193 if (cfunction == __Pyx_CyFunction_annotate_impl && value_self == op_in) {
35194 return __Pyx_CyFunction_set_annotate_in_dict_if_exists(op_in, NULL);
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();
35203 return __Pyx_CyFunction_set_annotate_in_dict(op_in, value);
35205#if __PYX_LIMITED_VERSION_HEX < 0x030B0000
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;
35214#if CYTHON_ASSUME_SAFE_MACROS
35215 PyList_SET_ITEM(fromlist, 0, marker);
35217 if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
35218 Py_DECREF(fromlist);
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;
35227 is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
35229 if (likely(is_coroutine_value)) {
35230 return is_coroutine_value;
35233 if (!__Pyx_IgnoreException(PyExc_Exception)) {
35237 return __Pyx_PyBool_FromLong(is_coroutine);
35240__Pyx_CyFunction_get_is_coroutine(PyObject *op_in,
void *context) {
35241 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
35243 CYTHON_UNUSED_VAR(context);
35244 if (op->func_is_coroutine) {
35245 return __Pyx_NewRef(op->func_is_coroutine);
35247 result = __Pyx_CyFunction_get_is_coroutine_value(op);
35248 if (unlikely(!result))
35250 __Pyx_BEGIN_CRITICAL_SECTION(op_in);
35251 if (op->func_is_coroutine) {
35253 result = __Pyx_NewRef(op->func_is_coroutine);
35255 op->func_is_coroutine = __Pyx_NewRef(result);
35257 __Pyx_END_CRITICAL_SECTION();
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);
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);
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,
35283 Py_DECREF(py_name);
35285 const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
35286 PyErr_Format(PyExc_TypeError,
35291#if CYTHON_COMPILING_IN_LIMITED_API
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;
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) {
35307 PyObject *old = op->func_module;
35308 op->func_module = value;
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},
35323 {
"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
35324 {
"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
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},
35340#if CYTHON_COMPILING_IN_LIMITED_API
35341 {
"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
35345static PyMemberDef __pyx_CyFunction_members[] = {
35346#if !CYTHON_COMPILING_IN_LIMITED_API
35347 {
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
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},
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},
35358 {
"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
35360#if CYTHON_COMPILING_IN_LIMITED_API
35361 {
"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist),
35362 __PYX_SHARED_RELATIVE_OFFSET | READONLY, 0},
35364 {
"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
35370__Pyx_CyFunction_reduce(PyObject *m_in, PyObject *args)
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();
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},
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],
35399#if CYTHON_COMPILING_IN_LIMITED_API
35400#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
35402#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
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;
35411 if (unlikely(op == NULL))
35413#if CYTHON_COMPILING_IN_LIMITED_API
35414 op->func_methoddef = ml;
35416 op->func_module =
module;
35419 __Pyx_CyFunction_weakreflist(op) = NULL;
35420#if !CYTHON_COMPILING_IN_LIMITED_API
35422 cf->m_self = (PyObject *) op;
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;
35430#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
35431 op->func_dict = NULL;
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;
35440 ((PyCMethodObject*)op)->mm_class = NULL;
35442 op->func_globals = globals;
35443 Py_INCREF(op->func_globals);
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;
35454#if CYTHON_VECTORCALL
35455 switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
35457 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
35460 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
35462 case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
35463 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
35465 case METH_FASTCALL | METH_KEYWORDS:
35466 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
35468 case METH_VARARGS | METH_KEYWORDS:
35469 __Pyx_CyFunction_func_vectorcall(op) = NULL;
35472 PyErr_SetString(PyExc_SystemError,
"Bad call flags for CyFunction");
35479static int __Pyx__CyFunction_clear(__pyx_CyFunctionObject *m)
35481 Py_CLEAR(m->func_closure);
35482#if CYTHON_COMPILING_IN_LIMITED_API
35483 Py_CLEAR(m->func_module);
35485 Py_CLEAR(((PyCFunctionObject*)m)->m_module);
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);
35492 PyObject_ClearManagedDict((PyObject*)m);
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);
35503 PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
35504 ((PyCMethodObject *) (m))->mm_class = NULL;
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);
35514 Py_CLEAR(m->defaults);
35518__Pyx_CyFunction_clear(PyObject *m)
35520 return __Pyx__CyFunction_clear(__Pyx_as_CyFunctionObject(m));
35522static void __Pyx__CyFunction_dealloc(PyObject *m)
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);
35530static void __Pyx_CyFunction_dealloc(PyObject *m)
35532 PyObject_GC_UnTrack(m);
35533 __Pyx__CyFunction_dealloc(m);
35535static int __Pyx_CyFunction_traverse(PyObject *m_in, visitproc visit,
void *arg)
35537 __pyx_CyFunctionObject *m = __Pyx_as_CyFunctionObject(m_in);
35539 int e = __Pyx_call_type_traverse(m_in, 1, visit, arg);
35542 Py_VISIT(m->func_closure);
35543#if CYTHON_COMPILING_IN_LIMITED_API
35544 Py_VISIT(m->func_module);
35546 Py_VISIT(((PyCFunctionObject*)m)->m_module);
35548#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
35549 Py_VISIT(m->func_dict);
35553#if PY_VERSION_HEX < 0x030d0000
35554 _PyObject_VisitManagedDict
35556 PyObject_VisitManagedDict
35558 ((PyObject*)m, visit, arg);
35559 if (e != 0)
return e;
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);
35574 Py_VISIT(m->defaults);
35578__Pyx_CyFunction_repr(PyObject *op_in)
35580 __pyx_CyFunctionObject *op = __Pyx_as_CyFunctionObject(op_in);
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();
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;
35594 PyCFunctionObject*
f = (PyCFunctionObject*)func;
35595 PyCFunction meth =
f->m_ml->ml_meth;
35596 int flags =
f->m_ml->ml_flags;
35599 switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
35601 if (likely(kw == NULL || PyDict_Size(kw) == 0))
35602 return (*meth)(self, arg);
35604 case METH_VARARGS | METH_KEYWORDS:
35605 return (*(PyCFunctionWithKeywords)(
void(*)(
void))meth)(self, arg, kw);
35607 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
35608#if CYTHON_ASSUME_SAFE_SIZE
35609 size = PyTuple_GET_SIZE(arg);
35611 size = PyTuple_Size(arg);
35612 if (unlikely(size < 0))
return NULL;
35614 if (likely(size == 0))
35615 return (*meth)(self, NULL);
35616 __Pyx_CyFunction_raise_argument_count_error(
35618 "takes no arguments", size);
35623 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
35624#if CYTHON_ASSUME_SAFE_SIZE
35625 size = PyTuple_GET_SIZE(arg);
35627 size = PyTuple_Size(arg);
35628 if (unlikely(size < 0))
return NULL;
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);
35635 arg0 = __Pyx_PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
35637 result = (*meth)(self, arg0);
35638 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
35643 __Pyx_CyFunction_raise_argument_count_error(
35645 "takes exactly one argument", size);
35650 PyErr_SetString(PyExc_SystemError,
"Bad call flags for CyFunction");
35653 __Pyx_CyFunction_raise_type_error(
35654 func,
"takes no keyword arguments");
35657static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
35659 result = __Pyx_CyFunction_CallMethod(func, func, arg, kw);
35662static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
35664 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35665#if CYTHON_VECTORCALL
35666 __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
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);
35671 (void) &__Pyx_PyVectorcall_FastCallDict;
35672 return PyVectorcall_Call(func, args, kw);
35676 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
35678 PyObject *new_args;
35680#if CYTHON_ASSUME_SAFE_SIZE
35681 argc = PyTuple_GET_SIZE(args);
35683 argc = PyTuple_Size(args);
35684 if (unlikely(argc < 0))
return NULL;
35686 new_args = PyTuple_GetSlice(args, 1, argc);
35687 if (unlikely(!new_args))
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);
35697 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
35698 Py_DECREF(new_args);
35700 result = __Pyx_CyFunction_Call(func, args, kw);
35704#if CYTHON_VECTORCALL
35705static CYTHON_INLINE
int __Pyx_CyFunction_Vectorcall_CheckArgs(PyObject *func, __pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
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");
35716 if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
35717 __Pyx_CyFunction_raise_type_error(
35718 func,
"takes no keyword arguments");
35723static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
35725 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35726 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
35728#if CYTHON_COMPILING_IN_LIMITED_API
35729 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35730 if (unlikely(!meth))
return NULL;
35732 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
35734 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
35746 if (unlikely(nargs != 0)) {
35747 __Pyx_CyFunction_raise_argument_count_error(
35748 func,
"takes no arguments", nargs);
35751 return meth(self, NULL);
35753static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
35755 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35756 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
35758#if CYTHON_COMPILING_IN_LIMITED_API
35759 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35760 if (unlikely(!meth))
return NULL;
35762 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
35764 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, kwnames)) {
35776 if (unlikely(nargs != 1)) {
35777 __Pyx_CyFunction_raise_argument_count_error(
35778 func,
"takes exactly one argument", nargs);
35781 return meth(self, args[0]);
35783static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
35785 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35786 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
35788#if CYTHON_COMPILING_IN_LIMITED_API
35789 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35790 if (unlikely(!meth))
return NULL;
35792 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
35794 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
35806 return ((__Pyx_PyCFunctionFastWithKeywords)(
void(*)(
void))meth)(self, args, nargs, kwnames);
35808static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *
const *args,
size_t nargsf, PyObject *kwnames)
35810 __pyx_CyFunctionObject *cyfunc = __Pyx_as_CyFunctionObject(func);
35811 PyTypeObject *cls = (PyTypeObject *) __Pyx__CyFunction_GetClassObj(cyfunc);
35812 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
35814#if CYTHON_COMPILING_IN_LIMITED_API
35815 PyCFunction meth = cyfunc->func_methoddef->ml_meth;
35816 if (unlikely(!meth))
return NULL;
35818 PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
35820 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(func, cyfunc, nargs, NULL)) {
35832 #if PY_VERSION_HEX < 0x030e00A6
35833 size_t nargs_value = (size_t) nargs;
35835 Py_ssize_t nargs_value = nargs;
35837 return ((__Pyx_PyCMethod)(
void(*)(
void))meth)(self, cls, args, nargs_value, kwnames);
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},
35852static PyType_Spec __pyx_CyFunctionType_spec = {
35853 __PYX_TYPE_MODULE_PREFIX
"cython_function_or_method",
35854 __PYX_SHARED_SIZEOF(__pyx_CyFunctionObject),
35856#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
35857 Py_TPFLAGS_METHOD_DESCRIPTOR |
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 |
35866#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
35867 Py_TPFLAGS_MANAGED_DICT |
35869 Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
35870 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
35871 __pyx_CyFunctionType_slots
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)) {
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
35892 PyObject_GC_Track(op);
35896static PyTypeObject *__Pyx_Get_CyFunction_Type(
void) {
35897 PyTypeObject *tp = __pyx_mstate_global->__pyx_CyFunctionType;
35898 Py_INCREF((PyObject*)tp);
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);
35909PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
35910 PyObject **dict_ptr = _PyObject_GetDictPtr(o);
35911 return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
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)) {
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))
35929 if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
35932 Py_XDECREF(use_cline);
35933 Py_XDECREF(cython_runtime_dict);
35934 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
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) {
35945 while (start < end) {
35946 mid = start + (end - start) / 2;
35947 if (code_line < entries[mid].code_line) {
35949 }
else if (code_line > entries[mid].code_line) {
35955 if (code_line <= entries[mid].code_line) {
35961static __Pyx_CachedCodeObjectType *__pyx__find_code_object(
struct __Pyx_CodeObjectCache *code_cache,
int code_line) {
35962 __Pyx_CachedCodeObjectType* code_object;
35964 if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
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)) {
35971 code_object = code_cache->entries[pos].code_object;
35972 Py_INCREF(code_object);
35973 return code_object;
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;
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);
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);
35995static void __pyx__insert_code_object(
struct __Pyx_CodeObjectCache *code_cache,
int code_line, __Pyx_CachedCodeObjectType* code_object)
35998 __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
35999 if (unlikely(!code_line)) {
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);
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);
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)) {
36029 code_cache->entries = entries;
36030 code_cache->max_count = new_max;
36032 for (i=code_cache->count; i>pos; i--) {
36033 entries[i] = entries[i-1];
36035 entries[pos].code_line = code_line;
36036 entries[pos].code_object = code_object;
36037 code_cache->count++;
36038 Py_INCREF(code_object);
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;
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)) {
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);
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
36067 #include "internal/pycore_frame.h"
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);
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;
36090 c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
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;
36100 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
36102 py_funcname = PyUnicode_FromString(funcname);
36104 if (unlikely(!py_funcname))
goto bad;
36105 dict = PyDict_New();
36106 if (unlikely(!dict))
goto bad;
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);
36112 if (unlikely(!code_object))
goto bad;
36113 __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
36115 dict = PyDict_New();
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;
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);
36129 Py_XDECREF(replace);
36132 (
struct _frame*)frame);
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;
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;
36148 py_code = PyCode_NewEmpty(filename, funcname, py_line);
36149 Py_XDECREF(py_funcname);
36152 Py_XDECREF(py_funcname);
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;
36162 c_line = __Pyx_CLineForTraceback(tstate, c_line);
36164 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
36166 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
36167 py_code = __Pyx_CreateCodeObjectForTraceback(
36168 funcname, c_line, py_line, filename);
36173 Py_XDECREF(pvalue);
36174 Py_XDECREF(ptraceback);
36177 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
36178 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
36180 py_frame = PyFrame_New(
36183 __pyx_mstate_global->__pyx_d,
36186 if (!py_frame)
goto bad;
36187 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
36188 PyTraceBack_Here(py_frame);
36190 Py_XDECREF(py_code);
36191 Py_XDECREF(py_frame);
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)\
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;\
36211 goto raise_overflow;\
36214 return (target_type) value;\
36218static CYTHON_INLINE PyObject *__pyx_memview_get_int(
const char *itemp) {
36219 return (PyObject *) __Pyx_PyLong_From_int(*(
int const *) itemp);
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()))
36225 *(
int *) itemp = value;
36230#if CYTHON_CCOMPLEX && (1) && (!0 || __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);
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;
36241 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
36242 __pyx_t_float_complex
z;
36250#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
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);
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;
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;
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;
36274 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
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);
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);
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);
36294 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
36296 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
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);
36305 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
36306 __pyx_t_float_complex
z;
36311 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
36312 return (a.real == 0) && (a.imag == 0);
36314 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
36315 __pyx_t_float_complex
z;
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);
36325 return hypotf(
z.real,
z.imag);
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) {
36333 float denom = a.real * a.real + a.imag * a.imag;
36334 a.real = a.real / denom;
36335 a.imag = -a.imag / denom;
36338 switch ((
int)b.real) {
36346 return __Pyx_c_prod_float(a, a);
36348 z = __Pyx_c_prod_float(a, a);
36349 return __Pyx_c_prod_float(
z, a);
36351 z = __Pyx_c_prod_float(a, a);
36352 return __Pyx_c_prod_float(
z,
z);
36358 }
else if ((b.imag == 0) && (a.real >= 0)) {
36359 z.real = powf(a.real, b.real);
36362 }
else if (a.real > 0) {
36367 theta = atan2f(0.0, -1.0);
36370 r = __Pyx_c_abs_float(a);
36371 theta = atan2f(a.imag, a.real);
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);
36384#if CYTHON_CCOMPLEX && (1) && (!0 || __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);
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;
36395 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
36396 __pyx_t_double_complex
z;
36404#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
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);
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;
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;
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;
36428 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
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);
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);
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);
36448 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
36450 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
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);
36459 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
36460 __pyx_t_double_complex
z;
36465 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
36466 return (a.real == 0) && (a.imag == 0);
36468 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
36469 __pyx_t_double_complex
z;
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);
36479 return hypot(
z.real,
z.imag);
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) {
36487 double denom = a.real * a.real + a.imag * a.imag;
36488 a.real = a.real / denom;
36489 a.imag = -a.imag / denom;
36492 switch ((
int)b.real) {
36500 return __Pyx_c_prod_double(a, a);
36502 z = __Pyx_c_prod_double(a, a);
36503 return __Pyx_c_prod_double(
z, a);
36505 z = __Pyx_c_prod_double(a, a);
36506 return __Pyx_c_prod_double(
z,
z);
36512 }
else if ((b.imag == 0) && (a.real >= 0)) {
36513 z.real = pow(a.real, b.real);
36516 }
else if (a.real > 0) {
36521 theta = atan2(0.0, -1.0);
36524 r = __Pyx_c_abs_double(a);
36525 theta = atan2(a.imag, a.real);
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);
36538#if CYTHON_CCOMPLEX && (1) && (!0 || __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);
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;
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;
36558#if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
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);
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;
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;
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;
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) {
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);
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);
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);
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) {
36604 return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
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);
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;
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);
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;
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);
36633 return hypotl(
z.real,
z.imag);
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) {
36641 long double denom = a.real * a.real + a.imag * a.imag;
36642 a.real = a.real / denom;
36643 a.imag = -a.imag / denom;
36646 switch ((
int)b.real) {
36654 return __Pyx_c_prod_long__double(a, a);
36656 z = __Pyx_c_prod_long__double(a, a);
36657 return __Pyx_c_prod_long__double(
z, a);
36659 z = __Pyx_c_prod_long__double(a, a);
36660 return __Pyx_c_prod_long__double(
z,
z);
36666 }
else if ((b.imag == 0) && (a.real >= 0)) {
36667 z.real = powl(a.real, b.real);
36670 }
else if (a.real > 0) {
36675 theta = atan2l(0.0, -1.0);
36678 r = __Pyx_c_abs_long__double(a);
36679 theta = atan2l(a.imag, a.real);
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);
36693#ifndef _Py_NO_RETURN
36694#define _Py_NO_RETURN
36697static void __pyx_fatalerror(
const char *fmt, ...) {
36700#if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
36701 va_start(vargs, fmt);
36705 vsnprintf(msg, 200, fmt, vargs);
36707 Py_FatalError(msg);
36709static CYTHON_INLINE
int
36710__pyx_add_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
36711 PyThread_type_lock lock)
36714 PyThread_acquire_lock(lock, 1);
36715 result = (*acquisition_count)++;
36716 PyThread_release_lock(lock);
36719static CYTHON_INLINE
int
36720__pyx_sub_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
36721 PyThread_type_lock lock)
36724 PyThread_acquire_lock(lock, 1);
36725 result = (*acquisition_count)--;
36726 PyThread_release_lock(lock);
36729static CYTHON_INLINE
void
36730__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
36732 __pyx_nonatomic_int_type old_acquisition_count;
36733 struct __pyx_memoryview_obj *memview = memslice->memview;
36734 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
36737 old_acquisition_count = __pyx_add_acquisition_count(memview);
36738 if (unlikely(old_acquisition_count <= 0)) {
36739 if (likely(old_acquisition_count == 0)) {
36741 Py_INCREF((PyObject *) memview);
36743 PyGILState_STATE _gilstate = PyGILState_Ensure();
36744 Py_INCREF((PyObject *) memview);
36745 PyGILState_Release(_gilstate);
36748 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
36749 old_acquisition_count+1, lineno);
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;
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)) {
36767 Py_CLEAR(memslice->memview);
36769 PyGILState_STATE _gilstate = PyGILState_Ensure();
36770 Py_CLEAR(memslice->memview);
36771 PyGILState_Release(_gilstate);
36774 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
36775 old_acquisition_count-1, lineno);
36781__pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
36783 int i, index, step, start;
36784 Py_ssize_t itemsize = mvs.memview->view.itemsize;
36785 if (order ==
'F') {
36792 for (i = 0; i < ndim; i++) {
36793 index = start + step * i;
36794 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
36796 itemsize *= mvs.shape[index];
36803__pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
36804 void **out_start,
void **out_end,
36805 int ndim,
size_t itemsize)
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];
36814 *out_start = *out_end = start;
36818 end += stride * (extent - 1);
36820 start += stride * (extent - 1);
36823 *out_start = start;
36824 *out_end = end + itemsize;
36827__pyx_slices_overlap(__Pyx_memviewslice *slice1,
36828 __Pyx_memviewslice *slice2,
36829 int ndim,
size_t itemsize)
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);
36839__Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
36841 __Pyx_memviewslice *memviewslice,
36842 int memview_is_new_reference)
36844 __Pyx_RefNannyDeclarations
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!");
36853 if (buf->strides) {
36854 for (i = 0; i < ndim; i++) {
36855 memviewslice->strides[i] = buf->strides[i];
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];
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];
36869 memviewslice->suboffsets[i] = -1;
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);
36880 memviewslice->memview = 0;
36881 memviewslice->data = 0;
36884 __Pyx_RefNannyFinishContext();
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);
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,
36905 if (unlikely(!(0 <= start && start < shape))) {
36906 __pyx_memoryview_slice_memviewslice_err_dim(PyExc_IndexError,
"Index out of bounds (axis %d)", dim);
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);
36927 }
else if (start >= shape) {
36928 start = negative_step ? (shape - 1) : shape;
36931 start = negative_step ? (shape - 1) : 0;
36939 }
else if (stop > shape) {
36943 stop = negative_step ? -1 : shape;
36945 Py_ssize_t new_shape = (stop - start) / step;
36946 if ((stop - start) - step * new_shape) {
36949 if (new_shape < 0) {
36952 dst->strides[new_ndim] = stride * step;
36953 dst->shape[new_ndim] = new_shape;
36954 dst->suboffsets[new_ndim] = suboffset;
36956 if (suboffset_dim[0] < 0) {
36957 dst->data += start * stride;
36959 dst->suboffsets[suboffset_dim[0]] += start * stride;
36961 if (suboffset >= 0) {
36963 if (likely(new_ndim == 0)) {
36964 dst->data = ((
char **)(dst->data))[0] + suboffset;
36966 __pyx_memoryview_slice_memviewslice_err_dim(
36968 "All dimensions preceding dimension %d must be indexed and not sliced",
36973 suboffset_dim[0] = new_ndim;
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);
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);
36993static CYTHON_INLINE
int __Pyx_PyULong___Pyx_PyLong_As_int(PyObject *x) {
36994 const int is_unsigned = 1;
36995#if CYTHON_USE_PYLONG_INTERNALS
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]));
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]));
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]));
37022#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
37023 if (unlikely(Py_SIZE(x) < 0)) {
37024 goto raise_neg_overflow;
37028 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
37029 if (unlikely(result < 0))
37031 if (unlikely(result == 1))
37032 goto raise_neg_overflow;
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))
37040 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
37042 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
37044 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
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])));
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])));
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])));
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]));
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]));
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]));
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))
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))
37114 return __Pyx_LargePyLong___Pyx_PyLong_As_int(x);
37116 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
37118 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
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"
37125 const int neg_one = (int) -1, const_zero = (
int) 0;
37126#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37127#pragma GCC diagnostic pop
37129 const int is_unsigned = neg_one > const_zero;
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;
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;
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);
37156 v = PyNumber_Long(x);
37157 if (unlikely(!
v))
return (
int) -1;
37158 assert(PyLong_CheckExact(
v));
37161 int result = PyObject_RichCompareBool(
v, Py_False, Py_LT);
37162 if (unlikely(result < 0)) {
37166 is_negative = result == 1;
37168 if (is_unsigned && unlikely(is_negative)) {
37170 PyErr_SetString(PyExc_OverflowError,
37171 "can't convert negative value to int");
37173 }
else if (is_negative) {
37174 stepval = PyNumber_Invert(
v);
37176 if (unlikely(!stepval))
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;
37188 digit = PyNumber_And(stepval, mask);
37189 if (unlikely(!digit))
goto done;
37190 idigit = PyLong_AsLong(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;
37198 Py_DECREF(shift); shift = NULL;
37199 Py_DECREF(mask); mask = NULL;
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;
37208 if (!is_unsigned) {
37209 if (unlikely(val & (((
int) 1) << (
sizeof(
int) * 8 - 1))))
37210 goto raise_overflow;
37218 Py_XDECREF(stepval);
37224 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
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"
37231 const int neg_one = (int) -1, const_zero = (
int) 0;
37232#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37233#pragma GCC diagnostic pop
37235 const int is_unsigned = neg_one > const_zero;
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))
37245 return __Pyx_PyULong___Pyx_PyLong_As_int(x);
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))
37254 return __Pyx_PySLong___Pyx_PyLong_As_int(x);
37257#if CYTHON_USE_PYLONG_INTERNALS
37259 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_int();
37261 return __Pyx_raise_overflow___Pyx_PyLong_As_int();
37264static int __Pyx_NonPyLong___Pyx_PyLong_As_int(PyObject *x) {
37266 PyObject *tmp = __Pyx_PyNumber_Long(x);
37267 if (!tmp)
return (
int) -1;
37268 val = __Pyx_PyLong_As_int(tmp);
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);
37276 return __Pyx_NonPyLong___Pyx_PyLong_As_int(x);
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;
37287 if (unlikely(!PyUnicode_Check(key))) {
37288 PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
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)) {
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");
37316#if !CYTHON_VECTORCALL
37317static PyObject *__Pyx_Object_VectorcallMethodKwds(PyObject *name, PyObject *
const *args,
size_t nargsf, PyObject *kwnames) {
37319 PyObject *obj = PyObject_GetAttr(args[0], name);
37320 if (unlikely(!obj))
37322 result = __Pyx_Object_VectorcallKwds(obj, args+1, nargsf-1, kwnames);
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"
37334 const int neg_one = (int) -1, const_zero = (
int) 0;
37335#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37336#pragma GCC diagnostic pop
37338 const int is_unsigned = neg_one > const_zero;
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);
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);
37357 unsigned char *bytes = (
unsigned char *)&value;
37358#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
37360 return PyLong_FromUnsignedNativeBytes(bytes,
sizeof(value), -1);
37362 return PyLong_FromNativeBytes(bytes,
sizeof(value), -1);
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);
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;
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);
37387 PyObject *keys[] = {signed_str};
37388 PyObject *values[] = {Py_True};
37389 kwds = __Pyx_MakeKwargDict(keys, values, 1);
37392 Py_DECREF(signed_str);
37393 if (unlikely(!kwds))
goto limited_bad;
37395 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
37399 Py_XDECREF(order_str);
37400 Py_XDECREF(py_bytes);
37401 Py_XDECREF(from_bytes_str);
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) {
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';
37432 __Pyx_TypeInfo complex_type = *type;
37433 complex_type.typegroup =
'R';
37434 complex_type.size /= 2;
37436 *buf = __Pyx_TypeInfoToFormat(&complex_type).string[0];
37442 else if (size == 8)
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)
37458 __Pyx_RefNannyDeclarations
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);
37474 shape_tuple = PyTuple_New(ndim);
37475 if (unlikely(!shape_tuple)) {
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)) {
37484#if CYTHON_ASSUME_SAFE_MACROS
37485 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
37487 if (PyTuple_SetItem(shape_tuple, i, temp_int) < 0) {
37493 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, mode, NULL);
37494 if (unlikely(!array_obj)) {
37497 __Pyx_GOTREF(array_obj);
37498 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
37499 (PyObject *) array_obj, contig_flag,
37501 from_mvs->memview->typeinfo);
37502 if (unlikely(!memview_obj))
37504 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
37506 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
37507 dtype_is_object) < 0))
37511 __Pyx_XDECREF((PyObject *) new_mvs.memview);
37512 new_mvs.memview = NULL;
37513 new_mvs.data = NULL;
37515 __Pyx_XDECREF(shape_tuple);
37516 __Pyx_XDECREF((PyObject *) array_obj);
37517 __Pyx_RefNannyFinishContext();
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)) {
37527 int non_empty = PyObject_IsTrue(state_dict);
37528 if (non_empty == 0) {
37529 Py_DECREF(state_dict);
37531 }
else if (unlikely(non_empty == -1)) {
37535 #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
37536 dict = PyObject_GetAttrString(obj,
"__dict__");
37538 dict = PyObject_GenericGetDict(obj, NULL);
37540 if (unlikely(!dict)) {
37541 Py_DECREF(state_dict);
37545 if (likely(PyDict_CheckExact(dict))) {
37546 result = PyDict_Update(dict, state_dict);
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);
37556 Py_DECREF(state_dict);
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;
37565 if (state_size <= index) {
37568 return __Pyx__UpdateUnpickledDict(obj, state, index);
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);
37585 PyErr_Format(pickle_error,
"Incompatible checksums (0x%x vs (0x%x, 0x%x, 0x%x) = (%s))",
37586 checksum, checksum1, checksum2, checksum3, members);
37588 Py_DECREF(pickle_error);
37592static int __Pyx_CheckUnpickleChecksum(
long checksum,
long checksum1,
long checksum2,
long checksum3,
const char *members) {
37594 found |= checksum1 == checksum;
37595 found |= checksum2 == checksum;
37596 found |= checksum3 == checksum;
37599 __Pyx_RaiseUnpickleChecksumError(checksum, checksum1, checksum2, checksum3, members);
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);
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);
37617static CYTHON_INLINE
long __Pyx_PyULong___Pyx_PyLong_As_long(PyObject *x) {
37618 const int is_unsigned = 1;
37619#if CYTHON_USE_PYLONG_INTERNALS
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]));
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]));
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]));
37646#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
37647 if (unlikely(Py_SIZE(x) < 0)) {
37648 goto raise_neg_overflow;
37652 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
37653 if (unlikely(result < 0))
37655 if (unlikely(result == 1))
37656 goto raise_neg_overflow;
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))
37664 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
37666 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
37668 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
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])));
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])));
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])));
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]));
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]));
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]));
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))
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))
37738 return __Pyx_LargePyLong___Pyx_PyLong_As_long(x);
37740 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
37742 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
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"
37749 const long neg_one = (long) -1, const_zero = (
long) 0;
37750#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37751#pragma GCC diagnostic pop
37753 const int is_unsigned = neg_one > const_zero;
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;
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;
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);
37780 v = PyNumber_Long(x);
37781 if (unlikely(!
v))
return (
long) -1;
37782 assert(PyLong_CheckExact(
v));
37785 int result = PyObject_RichCompareBool(
v, Py_False, Py_LT);
37786 if (unlikely(result < 0)) {
37790 is_negative = result == 1;
37792 if (is_unsigned && unlikely(is_negative)) {
37794 PyErr_SetString(PyExc_OverflowError,
37795 "can't convert negative value to long");
37797 }
else if (is_negative) {
37798 stepval = PyNumber_Invert(
v);
37800 if (unlikely(!stepval))
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;
37812 digit = PyNumber_And(stepval, mask);
37813 if (unlikely(!digit))
goto done;
37814 idigit = PyLong_AsLong(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;
37822 Py_DECREF(shift); shift = NULL;
37823 Py_DECREF(mask); mask = NULL;
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;
37832 if (!is_unsigned) {
37833 if (unlikely(val & (((
long) 1) << (
sizeof(
long) * 8 - 1))))
37834 goto raise_overflow;
37842 Py_XDECREF(stepval);
37848 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
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"
37855 const long neg_one = (long) -1, const_zero = (
long) 0;
37856#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37857#pragma GCC diagnostic pop
37859 const int is_unsigned = neg_one > const_zero;
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))
37869 return __Pyx_PyULong___Pyx_PyLong_As_long(x);
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))
37878 return __Pyx_PySLong___Pyx_PyLong_As_long(x);
37881#if CYTHON_USE_PYLONG_INTERNALS
37883 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_long();
37885 return __Pyx_raise_overflow___Pyx_PyLong_As_long();
37888static long __Pyx_NonPyLong___Pyx_PyLong_As_long(PyObject *x) {
37890 PyObject *tmp = __Pyx_PyNumber_Long(x);
37891 if (!tmp)
return (
long) -1;
37892 val = __Pyx_PyLong_As_long(tmp);
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);
37900 return __Pyx_NonPyLong___Pyx_PyLong_As_long(x);
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"
37910 const long neg_one = (long) -1, const_zero = (
long) 0;
37911#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
37912#pragma GCC diagnostic pop
37914 const int is_unsigned = neg_one > const_zero;
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);
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);
37933 unsigned char *bytes = (
unsigned char *)&value;
37934#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
37936 return PyLong_FromUnsignedNativeBytes(bytes,
sizeof(value), -1);
37938 return PyLong_FromNativeBytes(bytes,
sizeof(value), -1);
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);
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;
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);
37963 PyObject *keys[] = {signed_str};
37964 PyObject *values[] = {Py_True};
37965 kwds = __Pyx_MakeKwargDict(keys, values, 1);
37968 Py_DECREF(signed_str);
37969 if (unlikely(!kwds))
goto limited_bad;
37971 result = __Pyx_Object_VectorcallMethodKwds(from_bytes_str, args, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
37975 Py_XDECREF(order_str);
37976 Py_XDECREF(py_bytes);
37977 Py_XDECREF(from_bytes_str);
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);
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);
37997static CYTHON_INLINE
char __Pyx_PyULong___Pyx_PyLong_As_char(PyObject *x) {
37998 const int is_unsigned = 1;
37999#if CYTHON_USE_PYLONG_INTERNALS
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]));
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]));
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]));
38026#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
38027 if (unlikely(Py_SIZE(x) < 0)) {
38028 goto raise_neg_overflow;
38032 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
38033 if (unlikely(result < 0))
38035 if (unlikely(result == 1))
38036 goto raise_neg_overflow;
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))
38044 return __Pyx_LargePyLong___Pyx_PyLong_As_char(x);
38046 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
38048 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
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])));
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])));
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])));
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]));
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]));
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]));
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))
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))
38118 return __Pyx_LargePyLong___Pyx_PyLong_As_char(x);
38120 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
38122 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
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"
38129 const char neg_one = (char) -1, const_zero = (
char) 0;
38130#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38131#pragma GCC diagnostic pop
38133 const int is_unsigned = neg_one > const_zero;
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;
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;
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);
38160 v = PyNumber_Long(x);
38161 if (unlikely(!
v))
return (
char) -1;
38162 assert(PyLong_CheckExact(
v));
38165 int result = PyObject_RichCompareBool(
v, Py_False, Py_LT);
38166 if (unlikely(result < 0)) {
38170 is_negative = result == 1;
38172 if (is_unsigned && unlikely(is_negative)) {
38174 PyErr_SetString(PyExc_OverflowError,
38175 "can't convert negative value to char");
38177 }
else if (is_negative) {
38178 stepval = PyNumber_Invert(
v);
38180 if (unlikely(!stepval))
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;
38192 digit = PyNumber_And(stepval, mask);
38193 if (unlikely(!digit))
goto done;
38194 idigit = PyLong_AsLong(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;
38202 Py_DECREF(shift); shift = NULL;
38203 Py_DECREF(mask); mask = NULL;
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;
38212 if (!is_unsigned) {
38213 if (unlikely(val & (((
char) 1) << (
sizeof(
char) * 8 - 1))))
38214 goto raise_overflow;
38222 Py_XDECREF(stepval);
38228 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
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"
38235 const char neg_one = (char) -1, const_zero = (
char) 0;
38236#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
38237#pragma GCC diagnostic pop
38239 const int is_unsigned = neg_one > const_zero;
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))
38249 return __Pyx_PyULong___Pyx_PyLong_As_char(x);
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))
38258 return __Pyx_PySLong___Pyx_PyLong_As_char(x);
38261#if CYTHON_USE_PYLONG_INTERNALS
38263 return __Pyx_raise_neg_overflow___Pyx_PyLong_As_char();
38265 return __Pyx_raise_overflow___Pyx_PyLong_As_char();
38268static char __Pyx_NonPyLong___Pyx_PyLong_As_char(PyObject *x) {
38270 PyObject *tmp = __Pyx_PyNumber_Long(x);
38271 if (!tmp)
return (
char) -1;
38272 val = __Pyx_PyLong_As_char(tmp);
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);
38280 return __Pyx_NonPyLong___Pyx_PyLong_As_char(x);
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;
38294 while (
'0' <= rt_version[i] && rt_version[i] <=
'9') {
38295 digit = digit * 10 + (
unsigned int) (rt_version[i] -
'0');
38298 version += factor * digit;
38299 if (rt_version[i] !=
'.')
38305 __Pyx_cached_runtime_version = version;
38309static unsigned long __Pyx_get_runtime_version(
void) {
38310#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
38311 return Py_Version & ~0xFFUL;
38313 return __Pyx_cached_runtime_version;
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))
38322 if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
38326 PyOS_snprintf(message,
sizeof(message),
38327 "compile time Python version %d.%d "
38328 "of module '%.100s' "
38330 "runtime version %d.%d",
38331 (
int) (ct_version >> 24), (
int) ((ct_version >> 16) & 0xFF),
38333 (allow_newer) ?
"was newer than" :
"does not match",
38334 (
int) (rt_version >> 24), (
int) ((rt_version >> 16) & 0xFF)
38336 return PyErr_WarnEx(NULL, message, 1);
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;
38352 long minor_version = 0;
38353 #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
38354 minor_version = 11;
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;
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);
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);
38373 Py_XDECREF(code_type);
38374 Py_XDECREF(exception_table);
38375 Py_XDECREF(types_module);
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) {
38386 Py_DECREF(exc_type);
38387 Py_XDECREF(exc_value);
38388 Py_XDECREF(exc_tb);
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;
38399 #if PY_VERSION_HEX >= 0x030C0000
38400 PyUnstable_Code_NewWithPosOnlyArgs
38402 PyCode_NewWithPosOnlyArgs
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;
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)
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)
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
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;
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;
38441 varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
38442 if (unlikely(!varnames_tuple_dedup))
goto done;
38444 #if CYTHON_AVOID_BORROWED_REFS
38445 Py_INCREF(varnames_tuple_dedup);
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;
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);
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,
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,
38474 (
int) descr.first_line,
38475 (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
38478 Py_XDECREF(code_bytes);
38479 #if CYTHON_AVOID_BORROWED_REFS
38480 Py_XDECREF(varnames_tuple_dedup);
38482 Py_DECREF(varnames_tuple);
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);
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
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);
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;
38513 char *memview_bytes =
const_cast<char*
>(
s);
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"
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
38529 #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
38530 int memview_flags = 0x100;
38532 int memview_flags = PyBUF_READ;
38534 compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
38536 if (unlikely(!compressed_bytes)) {
38537 Py_DECREF(decompress);
38540 decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
38541 Py_DECREF(compressed_bytes);
38542 Py_DECREF(decompress);
38544 Py_DECREF(methodname);
38545 return decompressed;
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);
38552 Py_XDECREF(module);
38553 Py_DECREF(methodname);
38559#ifndef __Pyx_DecompressString_LZSS_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;
38564 uint32_t flags = src[pos++] | 0xFF00;
38565 while (flags & 0x100) {
38567 dst[out_pos++] = src[pos++];
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;
38574 }
else if (!(hi & 0x80)) {
38575 end_offset_of_last_occurrence = 0x80 + (((hi << 2) & 0x180) | (lo & 0x7F));
38576 match_length = hi & 0x1F;
38578 end_offset_of_last_occurrence = 0x80 + ((hi & 0x7F) << 7 | (lo & 0x7F));
38579 match_length = src[pos++];
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;
38586 if (out_pos >= dst_len)
return pos;
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);
38600 unsigned char *result_data;
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;
38609decompression_failed:
38610 PyErr_SetString(PyExc_RuntimeError,
"LZSS string data decompression failed");
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");
38624 return (Py_ssize_t) len;
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);
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);
38636static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
38638 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
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
38645 const char* result;
38646 Py_ssize_t unicode_length;
38647 CYTHON_MAYBE_UNUSED_VAR(unicode_length);
38648 #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
38649 if (unlikely(PyArg_Parse(o,
"s#", &result, length) < 0))
return NULL;
38651 result = PyUnicode_AsUTF8AndSize(o, length);
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);
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);
38669 PyUnicode_AsASCIIString(o);
38673 return PyUnicode_AsUTF8AndSize(o, length);
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);
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);
38689 *length = PyByteArray_Size(o);
38690 if (*length == -1)
return NULL;
38691 return PyByteArray_AsString(o);
38696 int r = PyBytes_AsStringAndSize(o, &result, length);
38697 if (unlikely(
r < 0)) {
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);
38709static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
38711 if (unlikely(!x))
return -1;
38712 retval = __Pyx_PyObject_IsTrue(x);
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;
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);
38730 __Pyx_DECREF_TypeName(result_type_name);
38733 PyErr_Format(PyExc_TypeError,
38734 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME
")",
38736 __Pyx_DECREF_TypeName(result_type_name);
38741static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
38742#if CYTHON_USE_TYPE_SLOTS
38743 PyNumberMethods *m;
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);
38754 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
38755 res = PyNumber_Long(x);
38759 if (unlikely(!PyLong_CheckExact(res))) {
38760 return __Pyx_PyNumber_LongWrongResultType(res);
38763 else if (!PyErr_Occurred()) {
38764 PyErr_SetString(PyExc_TypeError,
38765 "an integer is required");
38769static CYTHON_INLINE Py_ssize_t __Pyx_PyLong_AsSsize_t(PyObject* b) {
38770 #if CYTHON_USE_PYLONG_INTERNALS
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
38778 ival = (Py_ssize_t) (((
size_t)digits[0]));
38781 #if SIZEOF_SIZE_T * 8 > 2 * PyLong_SHIFT
38783 ival = (Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
38786 #if SIZEOF_SIZE_T * 8 > 3 * PyLong_SHIFT
38788 ival = (Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
38791 #if SIZEOF_SIZE_T * 8 > 4 * PyLong_SHIFT
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]));
38796 return PyLong_AsSsize_t(b);
38797 return is_neg ? -ival : ival;
38799 return PyLong_AsSsize_t(b);
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);
38807 PyObject *x = PyNumber_Index(b);
38808 if (unlikely(!x))
return -1;
38809 ival = __Pyx_PyLong_AsSsize_t(x);
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);
38820 x = PyNumber_Index(o);
38822 ival = PyLong_AsLong(x);
38827static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(
int b) {
38828 CYTHON_UNUSED_VAR(b);
38829 return __Pyx_NewRef(Py_None);
38831static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
38832 return __Pyx_NewRef(b ? Py_True: Py_False);
38834static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(
size_t ival) {
38835 return PyLong_FromSize_t(ival);
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
38845 #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
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"
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
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);
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>
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)
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."
38893} __Pyx_InterpreterIdAndModule;
38895 char interpreter_id_as_index;
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;
38904#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
38905static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
38907static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
38909static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
38910 __Pyx_InterpreterIdAndModule* table,
38912 int64_t interpreterId) {
38913 __Pyx_InterpreterIdAndModule* begin = table;
38914 __Pyx_InterpreterIdAndModule* end = begin + count;
38915 if (begin->id == interpreterId) {
38918 while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
38919 __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
38920 if (halfway->id == interpreterId) {
38923 if (halfway->id < interpreterId) {
38929 for (; begin < end; ++begin) {
38930 if (begin->id >= interpreterId)
return begin;
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);
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;
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();
38955 __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
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;
38964 found = __Pyx_State_FindModuleStateLookupTableLowerBound(
38965 data->table, data->count, interpreter_id);
38969 PyObject *result=NULL;
38970 if (found && found->id == interpreter_id) {
38971 result = found->module;
38973#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
38974 __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
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);
38984#define __Pyx_ModuleStateLookup_wait_until_no_readers()
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;
38992 __Pyx_ModuleStateLookupData *new_data = *old_data;
38993 if (to_allocate != (*old_data)->allocated) {
38994 new_data = (__Pyx_ModuleStateLookupData *)realloc(
38996 sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*
sizeof(__Pyx_InterpreterIdAndModule));
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;
39005 new_data->allocated = to_allocate;
39007 new_data->table[interpreter_id].module =
module;
39008 if (new_data->count < interpreter_id+1) {
39009 new_data->count = interpreter_id+1;
39011 *old_data = new_data;
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;
39025 data->count = write - data->table;
39026 for (; write<end; ++write) {
39028 write->module = NULL;
39030 data->interpreter_id_as_index = 0;
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;
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);
39041 __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
39043 __Pyx_ModuleStateLookupData *new_data = old_data;
39045 new_data = (__Pyx_ModuleStateLookupData *)calloc(1,
sizeof(__Pyx_ModuleStateLookupData));
39051 new_data->allocated = 1;
39052 new_data->interpreter_id_as_index = 1;
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);
39060 __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
39063 Py_ssize_t insert_at = 0;
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;
39074 if (new_data->count+1 >= new_data->allocated) {
39075 Py_ssize_t to_allocate = (new_data->count+1)*2;
39077 (__Pyx_ModuleStateLookupData*)realloc(
39079 sizeof(__Pyx_ModuleStateLookupData) +
39080 (to_allocate-1)*
sizeof(__Pyx_InterpreterIdAndModule));
39083 new_data = old_data;
39087 new_data->allocated = to_allocate;
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;
39102#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39103 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
39105 __Pyx_ModuleStateLookup_data = new_data;
39107 __Pyx_ModuleStateLookup_Unlock();
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);
39118 __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
39120 if (data->interpreter_id_as_index) {
39121 if (interpreter_id < data->count) {
39122 data->table[interpreter_id].module = NULL;
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;
39139 if (data->count == 0) {
39144#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
39145 __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
39147 __Pyx_ModuleStateLookup_data = data;
39149 __Pyx_ModuleStateLookup_Unlock();
39156#pragma warning( pop )
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)