3 #define PY_SSIZE_T_CLEAN 6 #error Python headers needed to compile C extensions, please install development version of Python. 7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) 8 #error Cython requires Python 2.6+ or Python 3.3+. 10 #define CYTHON_ABI "0_29_13" 11 #define CYTHON_HEX_VERSION 0x001D0DF0 12 #define CYTHON_FUTURE_DIVISION 1 15 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) 17 #if !defined(WIN32) && !defined(MS_WINDOWS) 29 #define DL_IMPORT(t) t 32 #define DL_EXPORT(t) t 35 #ifndef HAVE_LONG_LONG 36 #if PY_VERSION_HEX >= 0x02070000 37 #define HAVE_LONG_LONG 41 #define PY_LONG_LONG LONG_LONG 44 #define Py_HUGE_VAL HUGE_VAL 47 #define CYTHON_COMPILING_IN_PYPY 1 48 #define CYTHON_COMPILING_IN_PYSTON 0 49 #define CYTHON_COMPILING_IN_CPYTHON 0 50 #undef CYTHON_USE_TYPE_SLOTS 51 #define CYTHON_USE_TYPE_SLOTS 0 52 #undef CYTHON_USE_PYTYPE_LOOKUP 53 #define CYTHON_USE_PYTYPE_LOOKUP 0 54 #if PY_VERSION_HEX < 0x03050000 55 #undef CYTHON_USE_ASYNC_SLOTS 56 #define CYTHON_USE_ASYNC_SLOTS 0 57 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 58 #define CYTHON_USE_ASYNC_SLOTS 1 60 #undef CYTHON_USE_PYLIST_INTERNALS 61 #define CYTHON_USE_PYLIST_INTERNALS 0 62 #undef CYTHON_USE_UNICODE_INTERNALS 63 #define CYTHON_USE_UNICODE_INTERNALS 0 64 #undef CYTHON_USE_UNICODE_WRITER 65 #define CYTHON_USE_UNICODE_WRITER 0 66 #undef CYTHON_USE_PYLONG_INTERNALS 67 #define CYTHON_USE_PYLONG_INTERNALS 0 68 #undef CYTHON_AVOID_BORROWED_REFS 69 #define CYTHON_AVOID_BORROWED_REFS 1 70 #undef CYTHON_ASSUME_SAFE_MACROS 71 #define CYTHON_ASSUME_SAFE_MACROS 0 72 #undef CYTHON_UNPACK_METHODS 73 #define CYTHON_UNPACK_METHODS 0 74 #undef CYTHON_FAST_THREAD_STATE 75 #define CYTHON_FAST_THREAD_STATE 0 76 #undef CYTHON_FAST_PYCALL 77 #define CYTHON_FAST_PYCALL 0 78 #undef CYTHON_PEP489_MULTI_PHASE_INIT 79 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 80 #undef CYTHON_USE_TP_FINALIZE 81 #define CYTHON_USE_TP_FINALIZE 0 82 #undef CYTHON_USE_DICT_VERSIONS 83 #define CYTHON_USE_DICT_VERSIONS 0 84 #undef CYTHON_USE_EXC_INFO_STACK 85 #define CYTHON_USE_EXC_INFO_STACK 0 86 #elif defined(PYSTON_VERSION) 87 #define CYTHON_COMPILING_IN_PYPY 0 88 #define CYTHON_COMPILING_IN_PYSTON 1 89 #define CYTHON_COMPILING_IN_CPYTHON 0 90 #ifndef CYTHON_USE_TYPE_SLOTS 91 #define CYTHON_USE_TYPE_SLOTS 1 93 #undef CYTHON_USE_PYTYPE_LOOKUP 94 #define CYTHON_USE_PYTYPE_LOOKUP 0 95 #undef CYTHON_USE_ASYNC_SLOTS 96 #define CYTHON_USE_ASYNC_SLOTS 0 97 #undef CYTHON_USE_PYLIST_INTERNALS 98 #define CYTHON_USE_PYLIST_INTERNALS 0 99 #ifndef CYTHON_USE_UNICODE_INTERNALS 100 #define CYTHON_USE_UNICODE_INTERNALS 1 102 #undef CYTHON_USE_UNICODE_WRITER 103 #define CYTHON_USE_UNICODE_WRITER 0 104 #undef CYTHON_USE_PYLONG_INTERNALS 105 #define CYTHON_USE_PYLONG_INTERNALS 0 106 #ifndef CYTHON_AVOID_BORROWED_REFS 107 #define CYTHON_AVOID_BORROWED_REFS 0 109 #ifndef CYTHON_ASSUME_SAFE_MACROS 110 #define CYTHON_ASSUME_SAFE_MACROS 1 112 #ifndef CYTHON_UNPACK_METHODS 113 #define CYTHON_UNPACK_METHODS 1 115 #undef CYTHON_FAST_THREAD_STATE 116 #define CYTHON_FAST_THREAD_STATE 0 117 #undef CYTHON_FAST_PYCALL 118 #define CYTHON_FAST_PYCALL 0 119 #undef CYTHON_PEP489_MULTI_PHASE_INIT 120 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 121 #undef CYTHON_USE_TP_FINALIZE 122 #define CYTHON_USE_TP_FINALIZE 0 123 #undef CYTHON_USE_DICT_VERSIONS 124 #define CYTHON_USE_DICT_VERSIONS 0 125 #undef CYTHON_USE_EXC_INFO_STACK 126 #define CYTHON_USE_EXC_INFO_STACK 0 128 #define CYTHON_COMPILING_IN_PYPY 0 129 #define CYTHON_COMPILING_IN_PYSTON 0 130 #define CYTHON_COMPILING_IN_CPYTHON 1 131 #ifndef CYTHON_USE_TYPE_SLOTS 132 #define CYTHON_USE_TYPE_SLOTS 1 134 #if PY_VERSION_HEX < 0x02070000 135 #undef CYTHON_USE_PYTYPE_LOOKUP 136 #define CYTHON_USE_PYTYPE_LOOKUP 0 137 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) 138 #define CYTHON_USE_PYTYPE_LOOKUP 1 140 #if PY_MAJOR_VERSION < 3 141 #undef CYTHON_USE_ASYNC_SLOTS 142 #define CYTHON_USE_ASYNC_SLOTS 0 143 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 144 #define CYTHON_USE_ASYNC_SLOTS 1 146 #if PY_VERSION_HEX < 0x02070000 147 #undef CYTHON_USE_PYLONG_INTERNALS 148 #define CYTHON_USE_PYLONG_INTERNALS 0 149 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) 150 #define CYTHON_USE_PYLONG_INTERNALS 1 152 #ifndef CYTHON_USE_PYLIST_INTERNALS 153 #define CYTHON_USE_PYLIST_INTERNALS 1 155 #ifndef CYTHON_USE_UNICODE_INTERNALS 156 #define CYTHON_USE_UNICODE_INTERNALS 1 158 #if PY_VERSION_HEX < 0x030300F0 159 #undef CYTHON_USE_UNICODE_WRITER 160 #define CYTHON_USE_UNICODE_WRITER 0 161 #elif !defined(CYTHON_USE_UNICODE_WRITER) 162 #define CYTHON_USE_UNICODE_WRITER 1 164 #ifndef CYTHON_AVOID_BORROWED_REFS 165 #define CYTHON_AVOID_BORROWED_REFS 0 167 #ifndef CYTHON_ASSUME_SAFE_MACROS 168 #define CYTHON_ASSUME_SAFE_MACROS 1 170 #ifndef CYTHON_UNPACK_METHODS 171 #define CYTHON_UNPACK_METHODS 1 173 #ifndef CYTHON_FAST_THREAD_STATE 174 #define CYTHON_FAST_THREAD_STATE 1 176 #ifndef CYTHON_FAST_PYCALL 177 #define CYTHON_FAST_PYCALL 1 179 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT 180 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) 182 #ifndef CYTHON_USE_TP_FINALIZE 183 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) 185 #ifndef CYTHON_USE_DICT_VERSIONS 186 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) 188 #ifndef CYTHON_USE_EXC_INFO_STACK 189 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) 192 #if !defined(CYTHON_FAST_PYCCALL) 193 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) 195 #if CYTHON_USE_PYLONG_INTERNALS 196 #include "longintrepr.h" 201 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
204 #ifndef __has_attribute 205 #define __has_attribute(x) 0 207 #ifndef __has_cpp_attribute 208 #define __has_cpp_attribute(x) 0 210 #ifndef CYTHON_RESTRICT 211 #if defined(__GNUC__) 212 #define CYTHON_RESTRICT __restrict__ 213 #elif defined(_MSC_VER) && _MSC_VER >= 1400 214 #define CYTHON_RESTRICT __restrict 215 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 216 #define CYTHON_RESTRICT restrict 218 #define CYTHON_RESTRICT 221 #ifndef CYTHON_UNUSED 222 # if defined(__GNUC__) 223 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) 224 # define CYTHON_UNUSED __attribute__ ((__unused__)) 226 # define CYTHON_UNUSED 228 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) 229 # define CYTHON_UNUSED __attribute__ ((__unused__)) 231 # define CYTHON_UNUSED 234 #ifndef CYTHON_MAYBE_UNUSED_VAR 235 # if defined(__cplusplus) 236 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
238 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) 241 #ifndef CYTHON_NCP_UNUSED 242 # if CYTHON_COMPILING_IN_CPYTHON 243 # define CYTHON_NCP_UNUSED 245 # define CYTHON_NCP_UNUSED CYTHON_UNUSED 248 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) 250 #ifndef _MSC_STDINT_H_ 252 typedef unsigned char uint8_t;
253 typedef unsigned int uint32_t;
255 typedef unsigned __int8 uint8_t;
256 typedef unsigned __int32 uint32_t;
262 #ifndef CYTHON_FALLTHROUGH 263 #if defined(__cplusplus) && __cplusplus >= 201103L 264 #if __has_cpp_attribute(fallthrough) 265 #define CYTHON_FALLTHROUGH [[fallthrough]] 266 #elif __has_cpp_attribute(clang::fallthrough) 267 #define CYTHON_FALLTHROUGH [[clang::fallthrough]] 268 #elif __has_cpp_attribute(gnu::fallthrough) 269 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] 272 #ifndef CYTHON_FALLTHROUGH 273 #if __has_attribute(fallthrough) 274 #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) 276 #define CYTHON_FALLTHROUGH 279 #if defined(__clang__ ) && defined(__apple_build_version__) 280 #if __apple_build_version__ < 7000000 281 #undef CYTHON_FALLTHROUGH 282 #define CYTHON_FALLTHROUGH 288 #error "Cython files generated with the C++ option must be compiled with a C++ compiler." 290 #ifndef CYTHON_INLINE 291 #if defined(__clang__) 292 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) 294 #define CYTHON_INLINE inline 298 void __Pyx_call_destructor(T& x) {
302 class __Pyx_FakeReference {
304 __Pyx_FakeReference() : ptr(NULL) { }
305 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<T*>(&ref)) { }
306 T *operator->() {
return ptr; }
307 T *operator&() {
return ptr; }
308 operator T&() {
return *ptr; }
309 template<
typename U>
bool operator ==(U other) {
return *ptr == other; }
310 template<
typename U>
bool operator !=(U other) {
return *ptr != other; }
315 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) 316 #define Py_OptimizeFlag 0 318 #define __PYX_BUILD_PY_SSIZE_T "n" 319 #define CYTHON_FORMAT_SSIZE_T "z" 320 #if PY_MAJOR_VERSION < 3 321 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" 322 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 323 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 324 #define __Pyx_DefaultClassType PyClass_Type 326 #define __Pyx_BUILTIN_MODULE_NAME "builtins" 327 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2 328 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 329 PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 331 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 332 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 334 #define __Pyx_DefaultClassType PyType_Type 336 #ifndef Py_TPFLAGS_CHECKTYPES 337 #define Py_TPFLAGS_CHECKTYPES 0 339 #ifndef Py_TPFLAGS_HAVE_INDEX 340 #define Py_TPFLAGS_HAVE_INDEX 0 342 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER 343 #define Py_TPFLAGS_HAVE_NEWBUFFER 0 345 #ifndef Py_TPFLAGS_HAVE_FINALIZE 346 #define Py_TPFLAGS_HAVE_FINALIZE 0 348 #ifndef METH_STACKLESS 349 #define METH_STACKLESS 0 351 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) 352 #ifndef METH_FASTCALL 353 #define METH_FASTCALL 0x80 355 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
356 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
357 Py_ssize_t nargs, PyObject *kwnames);
359 #define __Pyx_PyCFunctionFast _PyCFunctionFast 360 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords 362 #if CYTHON_FAST_PYCCALL 363 #define __Pyx_PyFastCFunction_Check(func)\ 364 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) 366 #define __Pyx_PyFastCFunction_Check(func) 0 368 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) 369 #define PyObject_Malloc(s) PyMem_Malloc(s) 370 #define PyObject_Free(p) PyMem_Free(p) 371 #define PyObject_Realloc(p) PyMem_Realloc(p) 373 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 374 #define PyMem_RawMalloc(n) PyMem_Malloc(n) 375 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) 376 #define PyMem_RawFree(p) PyMem_Free(p) 378 #if CYTHON_COMPILING_IN_PYSTON 379 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) 380 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) 382 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) 383 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) 385 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 386 #define __Pyx_PyThreadState_Current PyThreadState_GET() 387 #elif PY_VERSION_HEX >= 0x03060000 388 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() 389 #elif PY_VERSION_HEX >= 0x03000000 390 #define __Pyx_PyThreadState_Current PyThreadState_GET() 392 #define __Pyx_PyThreadState_Current _PyThreadState_Current 394 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) 395 #include "pythread.h" 396 #define Py_tss_NEEDS_INIT 0 397 typedef int Py_tss_t;
398 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
399 *key = PyThread_create_key();
402 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
403 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
404 *key = Py_tss_NEEDS_INIT;
407 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
410 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
411 return *key != Py_tss_NEEDS_INIT;
413 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
414 PyThread_delete_key(*key);
415 *key = Py_tss_NEEDS_INIT;
417 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
418 return PyThread_set_key_value(*key, value);
420 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
421 return PyThread_get_key_value(*key);
424 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) 425 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) 427 #define __Pyx_PyDict_NewPresized(n) PyDict_New() 429 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION 430 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) 431 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) 433 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) 434 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) 436 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS 437 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) 439 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) 441 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) 442 #define CYTHON_PEP393_ENABLED 1 443 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 444 0 : _PyUnicode_Ready((PyObject *)(op))) 445 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) 446 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) 447 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) 448 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) 449 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) 450 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) 451 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) 452 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) 454 #define CYTHON_PEP393_ENABLED 0 455 #define PyUnicode_1BYTE_KIND 1 456 #define PyUnicode_2BYTE_KIND 2 457 #define PyUnicode_4BYTE_KIND 4 458 #define __Pyx_PyUnicode_READY(op) (0) 459 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) 460 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) 461 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) 462 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) 463 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) 464 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) 465 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) 466 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) 468 #if CYTHON_COMPILING_IN_PYPY 469 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) 470 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) 472 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) 473 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ 474 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) 476 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) 477 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) 479 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) 480 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) 482 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) 483 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) 485 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) 486 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) 487 #if PY_MAJOR_VERSION >= 3 488 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) 490 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) 492 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) 493 #define PyObject_ASCII(o) PyObject_Repr(o) 495 #if PY_MAJOR_VERSION >= 3 496 #define PyBaseString_Type PyUnicode_Type 497 #define PyStringObject PyUnicodeObject 498 #define PyString_Type PyUnicode_Type 499 #define PyString_Check PyUnicode_Check 500 #define PyString_CheckExact PyUnicode_CheckExact 501 #define PyObject_Unicode PyObject_Str 503 #if PY_MAJOR_VERSION >= 3 504 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) 505 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) 507 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) 508 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) 510 #ifndef PySet_CheckExact 511 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) 513 #if CYTHON_ASSUME_SAFE_MACROS 514 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) 516 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) 518 #if PY_MAJOR_VERSION >= 3 519 #define PyIntObject PyLongObject 520 #define PyInt_Type PyLong_Type 521 #define PyInt_Check(op) PyLong_Check(op) 522 #define PyInt_CheckExact(op) PyLong_CheckExact(op) 523 #define PyInt_FromString PyLong_FromString 524 #define PyInt_FromUnicode PyLong_FromUnicode 525 #define PyInt_FromLong PyLong_FromLong 526 #define PyInt_FromSize_t PyLong_FromSize_t 527 #define PyInt_FromSsize_t PyLong_FromSsize_t 528 #define PyInt_AsLong PyLong_AsLong 529 #define PyInt_AS_LONG PyLong_AS_LONG 530 #define PyInt_AsSsize_t PyLong_AsSsize_t 531 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask 532 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask 533 #define PyNumber_Int PyNumber_Long 535 #if PY_MAJOR_VERSION >= 3 536 #define PyBoolObject PyLongObject 538 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY 539 #ifndef PyUnicode_InternFromString 540 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) 543 #if PY_VERSION_HEX < 0x030200A4 544 typedef long Py_hash_t;
545 #define __Pyx_PyInt_FromHash_t PyInt_FromLong 546 #define __Pyx_PyInt_AsHash_t PyInt_AsLong 548 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t 549 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t 551 #if PY_MAJOR_VERSION >= 3 552 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) 554 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) 556 #if CYTHON_USE_ASYNC_SLOTS 557 #if PY_VERSION_HEX >= 0x030500B1 558 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods 559 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) 561 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) 564 #define __Pyx_PyType_AsAsync(obj) NULL 566 #ifndef __Pyx_PyAsyncMethodsStruct 571 } __Pyx_PyAsyncMethodsStruct;
574 #if defined(WIN32) || defined(MS_WINDOWS) 575 #define _USE_MATH_DEFINES 579 #define __PYX_NAN() ((float) NAN) 581 static CYTHON_INLINE
float __PYX_NAN() {
583 memset(&value, 0xFF,
sizeof(value));
587 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) 588 #define __Pyx_truncl trunc 590 #define __Pyx_truncl truncl 594 #define __PYX_ERR(f_index, lineno, Ln_error) \ 596 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ 599 #ifndef __PYX_EXTERN_C 601 #define __PYX_EXTERN_C extern "C" 603 #define __PYX_EXTERN_C extern 607 #define __PYX_HAVE__pynastran_io 608 #define __PYX_HAVE_API__pynastran_io 622 #include "numpy/arrayobject.h" 623 #include "numpy/ufuncobject.h" 628 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) 629 #define CYTHON_WITHOUT_ASSERTIONS 632 typedef struct {PyObject **p;
const char *s;
const Py_ssize_t n;
const char* encoding;
633 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
635 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 636 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 637 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) 638 #define __PYX_DEFAULT_STRING_ENCODING "" 639 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString 640 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 641 #define __Pyx_uchar_cast(c) ((unsigned char)c) 642 #define __Pyx_long_cast(x) ((long)x) 643 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ 644 (sizeof(type) < sizeof(Py_ssize_t)) ||\ 645 (sizeof(type) > sizeof(Py_ssize_t) &&\ 646 likely(v < (type)PY_SSIZE_T_MAX ||\ 647 v == (type)PY_SSIZE_T_MAX) &&\ 648 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ 649 v == (type)PY_SSIZE_T_MIN))) ||\ 650 (sizeof(type) == sizeof(Py_ssize_t) &&\ 651 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ 652 v == (type)PY_SSIZE_T_MAX))) ) 653 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
654 return (
size_t) i < (size_t) limit;
656 #if defined (__cplusplus) && __cplusplus >= 201103L 658 #define __Pyx_sst_abs(value) std::abs(value) 659 #elif SIZEOF_INT >= SIZEOF_SIZE_T 660 #define __Pyx_sst_abs(value) abs(value) 661 #elif SIZEOF_LONG >= SIZEOF_SIZE_T 662 #define __Pyx_sst_abs(value) labs(value) 663 #elif defined (_MSC_VER) 664 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) 665 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 666 #define __Pyx_sst_abs(value) llabs(value) 667 #elif defined (__GNUC__) 668 #define __Pyx_sst_abs(value) __builtin_llabs(value) 670 #define __Pyx_sst_abs(value) ((value<0) ? -value : value) 672 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
673 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
674 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) 675 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) 676 #define __Pyx_PyBytes_FromString PyBytes_FromString 677 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize 678 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
679 #if PY_MAJOR_VERSION < 3 680 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString 681 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 683 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString 684 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize 686 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) 687 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) 688 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) 689 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) 690 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) 691 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) 692 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) 693 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) 694 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) 695 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) 696 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) 697 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) 698 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) 699 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) 700 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) 701 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) 702 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *u) {
703 const Py_UNICODE *u_end = u;
705 return (
size_t)(u_end - u - 1);
707 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) 708 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode 709 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode 710 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) 711 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) 712 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
713 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
714 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
715 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
716 #define __Pyx_PySequence_Tuple(obj)\ 717 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) 718 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
719 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
720 #if CYTHON_ASSUME_SAFE_MACROS 721 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) 723 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) 725 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) 726 #if PY_MAJOR_VERSION >= 3 727 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) 729 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) 731 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) 732 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 733 static int __Pyx_sys_getdefaultencoding_not_ascii;
734 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
736 PyObject* default_encoding = NULL;
737 PyObject* ascii_chars_u = NULL;
738 PyObject* ascii_chars_b = NULL;
739 const char* default_encoding_c;
740 sys = PyImport_ImportModule(
"sys");
742 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
744 if (!default_encoding)
goto bad;
745 default_encoding_c = PyBytes_AsString(default_encoding);
746 if (!default_encoding_c)
goto bad;
747 if (strcmp(default_encoding_c,
"ascii") == 0) {
748 __Pyx_sys_getdefaultencoding_not_ascii = 0;
750 char ascii_chars[128];
752 for (c = 0; c < 128; c++) {
755 __Pyx_sys_getdefaultencoding_not_ascii = 1;
756 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
757 if (!ascii_chars_u)
goto bad;
758 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
759 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
762 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
766 Py_DECREF(ascii_chars_u);
767 Py_DECREF(ascii_chars_b);
769 Py_DECREF(default_encoding);
772 Py_XDECREF(default_encoding);
773 Py_XDECREF(ascii_chars_u);
774 Py_XDECREF(ascii_chars_b);
778 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 779 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) 781 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) 782 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 783 static char* __PYX_DEFAULT_STRING_ENCODING;
784 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
786 PyObject* default_encoding = NULL;
787 char* default_encoding_c;
788 sys = PyImport_ImportModule(
"sys");
790 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
792 if (!default_encoding)
goto bad;
793 default_encoding_c = PyBytes_AsString(default_encoding);
794 if (!default_encoding_c)
goto bad;
795 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
796 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
797 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
798 Py_DECREF(default_encoding);
801 Py_XDECREF(default_encoding);
809 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) 810 #define likely(x) __builtin_expect(!!(x), 1) 811 #define unlikely(x) __builtin_expect(!!(x), 0) 813 #define likely(x) (x) 814 #define unlikely(x) (x) 816 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
818 static PyObject *__pyx_m = NULL;
819 static PyObject *__pyx_d;
820 static PyObject *__pyx_b;
821 static PyObject *__pyx_cython_runtime = NULL;
822 static PyObject *__pyx_empty_tuple;
823 static PyObject *__pyx_empty_bytes;
824 static PyObject *__pyx_empty_unicode;
825 static int __pyx_lineno;
826 static int __pyx_clineno = 0;
827 static const char * __pyx_cfilenm= __FILE__;
828 static const char *__pyx_filename;
831 #if !defined(CYTHON_CCOMPLEX) 832 #if defined(__cplusplus) 833 #define CYTHON_CCOMPLEX 1 834 #elif defined(_Complex_I) 835 #define CYTHON_CCOMPLEX 1 837 #define CYTHON_CCOMPLEX 0 847 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) 849 #define _Complex_I 1.0fj 853 static const char *__pyx_f[] = {
867 typedef npy_int8 __pyx_t_5numpy_int8_t;
876 typedef npy_int16 __pyx_t_5numpy_int16_t;
885 typedef npy_int32 __pyx_t_5numpy_int32_t;
894 typedef npy_int64 __pyx_t_5numpy_int64_t;
903 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
912 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
921 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
930 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
939 typedef npy_float32 __pyx_t_5numpy_float32_t;
948 typedef npy_float64 __pyx_t_5numpy_float64_t;
957 typedef npy_long __pyx_t_5numpy_int_t;
966 typedef npy_longlong __pyx_t_5numpy_long_t;
975 typedef npy_longlong __pyx_t_5numpy_longlong_t;
984 typedef npy_ulong __pyx_t_5numpy_uint_t;
993 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1002 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1011 typedef npy_intp __pyx_t_5numpy_intp_t;
1020 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1029 typedef npy_double __pyx_t_5numpy_float_t;
1038 typedef npy_double __pyx_t_5numpy_double_t;
1047 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1056 typedef __pyx_t_5numpy_float_t __pyx_t_12pynastran_io_DTYPE_t;
1060 typedef ::std::complex< float > __pyx_t_float_complex;
1062 typedef float _Complex __pyx_t_float_complex;
1065 typedef struct {
float real, imag; } __pyx_t_float_complex;
1067 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1072 typedef ::std::complex< double > __pyx_t_double_complex;
1074 typedef double _Complex __pyx_t_double_complex;
1077 typedef struct {
double real, imag; } __pyx_t_double_complex;
1079 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1092 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1101 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1110 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1119 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1130 std::string bdfPath;
1136 std::map<std::string,int> nElemTypes;
1144 #ifndef CYTHON_REFNANNY 1145 #define CYTHON_REFNANNY 0 1149 void (*INCREF)(
void*, PyObject*, int);
1150 void (*DECREF)(
void*, PyObject*, int);
1151 void (*GOTREF)(
void*, PyObject*, int);
1152 void (*GIVEREF)(
void*, PyObject*, int);
1153 void* (*SetupContext)(
const char*, int,
const char*);
1154 void (*FinishContext)(
void**);
1155 } __Pyx_RefNannyAPIStruct;
1156 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1157 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1158 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; 1160 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 1162 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ 1163 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 1164 PyGILState_Release(__pyx_gilstate_save);\ 1166 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 1169 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 1170 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) 1172 #define __Pyx_RefNannyFinishContext()\ 1173 __Pyx_RefNanny->FinishContext(&__pyx_refnanny) 1174 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1175 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1176 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1177 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1178 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) 1179 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) 1180 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) 1181 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) 1183 #define __Pyx_RefNannyDeclarations 1184 #define __Pyx_RefNannySetupContext(name, acquire_gil) 1185 #define __Pyx_RefNannyFinishContext() 1186 #define __Pyx_INCREF(r) Py_INCREF(r) 1187 #define __Pyx_DECREF(r) Py_DECREF(r) 1188 #define __Pyx_GOTREF(r) 1189 #define __Pyx_GIVEREF(r) 1190 #define __Pyx_XINCREF(r) Py_XINCREF(r) 1191 #define __Pyx_XDECREF(r) Py_XDECREF(r) 1192 #define __Pyx_XGOTREF(r) 1193 #define __Pyx_XGIVEREF(r) 1195 #define __Pyx_XDECREF_SET(r, v) do {\ 1196 PyObject *tmp = (PyObject *) r;\ 1197 r = v; __Pyx_XDECREF(tmp);\ 1199 #define __Pyx_DECREF_SET(r, v) do {\ 1200 PyObject *tmp = (PyObject *) r;\ 1201 r = v; __Pyx_DECREF(tmp);\ 1203 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) 1204 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) 1207 #if CYTHON_USE_TYPE_SLOTS 1208 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1210 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) 1214 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1217 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1220 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1221 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1222 const char* function_name);
1225 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1226 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1229 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS 1230 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) 1231 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) 1232 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ 1233 (version_var) = __PYX_GET_DICT_VERSION(dict);\ 1234 (cache_var) = (value); 1235 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ 1236 static PY_UINT64_T __pyx_dict_version = 0;\ 1237 static PyObject *__pyx_dict_cached_value = NULL;\ 1238 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ 1239 (VAR) = __pyx_dict_cached_value;\ 1241 (VAR) = __pyx_dict_cached_value = (LOOKUP);\ 1242 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ 1245 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1246 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1247 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1249 #define __PYX_GET_DICT_VERSION(dict) (0) 1250 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) 1251 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); 1255 #if CYTHON_USE_DICT_VERSIONS 1256 #define __Pyx_GetModuleGlobalName(var, name) {\ 1257 static PY_UINT64_T __pyx_dict_version = 0;\ 1258 static PyObject *__pyx_dict_cached_value = NULL;\ 1259 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ 1260 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ 1261 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ 1263 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\ 1264 PY_UINT64_T __pyx_dict_version;\ 1265 PyObject *__pyx_dict_cached_value;\ 1266 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ 1268 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1270 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) 1271 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) 1272 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1276 #if CYTHON_FAST_PYCALL 1277 #define __Pyx_PyFunction_FastCall(func, args, nargs)\ 1278 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) 1279 #if 1 || PY_VERSION_HEX < 0x030600B1 1280 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1282 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) 1284 #define __Pyx_BUILD_ASSERT_EXPR(cond)\ 1285 (sizeof(char [1 - 2*!(cond)]) - 1) 1286 #ifndef Py_MEMBER_SIZE 1287 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) 1289 static size_t __pyx_pyframe_localsplus_offset = 0;
1290 #include "frameobject.h" 1291 #define __Pxy_PyFrame_Initialize_Offsets()\ 1292 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ 1293 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) 1294 #define __Pyx_PyFrame_GetLocalsplus(frame)\ 1295 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) 1299 #if CYTHON_COMPILING_IN_CPYTHON 1300 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1302 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) 1306 #if CYTHON_COMPILING_IN_CPYTHON 1307 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1311 #if CYTHON_COMPILING_IN_CPYTHON 1312 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1314 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) 1318 #if CYTHON_FAST_PYCCALL 1319 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1321 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) 1325 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1331 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *s, Py_ssize_t size,
const char *errors) {
1333 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1335 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *s, Py_ssize_t size,
const char *errors) {
1337 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1339 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *s, Py_ssize_t size,
const char *errors) {
1341 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1345 static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
1346 const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
1347 const char* encoding,
const char* errors,
1348 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors));
1351 static CYTHON_INLINE PyObject* __Pyx_decode_cpp_string(
1352 std::string cppstring, Py_ssize_t start, Py_ssize_t stop,
1353 const char* encoding,
const char* errors,
1354 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors)) {
1355 return __Pyx_decode_c_bytes(
1356 cppstring.data(), cppstring.size(), start, stop, encoding, errors, decode_func);
1360 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1363 #if CYTHON_FAST_THREAD_STATE 1364 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; 1365 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; 1366 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type 1368 #define __Pyx_PyThreadState_declare 1369 #define __Pyx_PyThreadState_assign 1370 #define __Pyx_PyErr_Occurred() PyErr_Occurred() 1374 #if CYTHON_FAST_THREAD_STATE 1375 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) 1376 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) 1377 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) 1378 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) 1379 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) 1380 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1381 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1382 #if CYTHON_COMPILING_IN_CPYTHON 1383 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) 1385 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 1388 #define __Pyx_PyErr_Clear() PyErr_Clear() 1389 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 1390 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) 1391 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) 1392 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) 1393 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) 1394 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) 1395 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) 1399 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1402 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1403 int lineno,
const char *filename,
1404 int full_traceback,
int nogil);
1407 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ 1408 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ 1409 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ 1410 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ 1411 __Pyx_GetItemInt_Generic(o, to_py_func(i)))) 1412 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ 1413 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ 1414 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ 1415 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) 1416 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1417 int wraparound,
int boundscheck);
1418 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ 1419 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ 1420 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ 1421 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) 1422 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1423 int wraparound,
int boundscheck);
1424 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1425 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1426 int is_list,
int wraparound,
int boundscheck);
1429 #if CYTHON_USE_TYPE_SLOTS 1430 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1432 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) 1436 #if !CYTHON_COMPILING_IN_PYPY 1437 static PyObject* __Pyx_PyFloat_NeObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace,
int zerodivision_check);
1439 #define __Pyx_PyFloat_NeObjC(op1, op2, floatval, inplace, zerodivision_check)\ 1440 (PyObject_RichCompare(op1, op2, Py_NE)) 1444 static CYTHON_INLINE
int __Pyx_IterFinish(
void);
1447 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
1450 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
1453 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1456 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1459 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
1462 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
1465 static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);
1468 #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\ 1469 (likely(is_tuple || PyTuple_Check(tuple)) ?\ 1470 (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\ 1471 __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\ 1472 (__Pyx_UnpackTupleError(tuple, 2), -1)) :\ 1473 __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple)) 1474 static CYTHON_INLINE
int __Pyx_unpack_tuple2_exact(
1475 PyObject* tuple, PyObject** value1, PyObject** value2,
int decref_tuple);
1476 static int __Pyx_unpack_tuple2_generic(
1477 PyObject* tuple, PyObject** value1, PyObject** value2,
int has_known_size,
int decref_tuple);
1480 static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict,
int is_dict, PyObject* method_name,
1481 Py_ssize_t* p_orig_length,
int* p_is_dict);
1482 static CYTHON_INLINE
int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
1483 PyObject** pkey, PyObject** pvalue, PyObject** pitem,
int is_dict);
1486 static CYTHON_INLINE
int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq,
int eq) {
1487 int result = PySequence_Contains(seq, item);
1488 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1492 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2,
long intval,
long inplace);
1495 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS 1496 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1497 PyListObject* L = (PyListObject*) list;
1498 Py_ssize_t len = Py_SIZE(list);
1499 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1501 PyList_SET_ITEM(list, len, x);
1502 Py_SIZE(list) = len+1;
1505 return PyList_Append(list, x);
1508 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) 1512 #if !CYTHON_COMPILING_IN_PYPY 1513 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
1515 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ 1516 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) 1520 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY 1521 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1522 #define __Pyx_PyObject_Dict_GetItem(obj, name)\ 1523 (likely(PyDict_CheckExact(obj)) ?\ 1524 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) 1526 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) 1527 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) 1531 #if CYTHON_USE_PYLONG_INTERNALS 1532 static PyObject *__Pyx_PyLong_AbsNeg(PyObject *num);
1533 #define __Pyx_PyNumber_Absolute(x)\ 1534 ((likely(PyLong_CheckExact(x))) ?\ 1535 (likely(Py_SIZE(x) >= 0) ? (Py_INCREF(x), (x)) : __Pyx_PyLong_AbsNeg(x)) :\ 1536 PyNumber_Absolute(x)) 1538 #define __Pyx_PyNumber_Absolute(x) PyNumber_Absolute(x) 1542 #if CYTHON_USE_TYPE_SLOTS 1543 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) 1544 static CYTHON_INLINE
int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1546 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) 1547 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) 1551 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1554 #if CYTHON_USE_EXC_INFO_STACK 1555 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1559 #if CYTHON_FAST_THREAD_STATE 1560 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) 1561 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1562 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) 1563 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1565 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) 1566 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) 1570 #if CYTHON_FAST_THREAD_STATE 1571 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) 1572 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1574 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) 1578 #if CYTHON_FAST_THREAD_STATE 1579 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) 1580 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1582 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1586 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 1587 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1589 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr 1593 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 1594 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1596 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr 1600 static int __Pyx_setup_reduce(PyObject* type_obj);
1603 #ifndef __PYX_HAVE_RT_ImportType_proto 1604 #define __PYX_HAVE_RT_ImportType_proto 1605 enum __Pyx_ImportType_CheckSize {
1606 __Pyx_ImportType_CheckSize_Error = 0,
1607 __Pyx_ImportType_CheckSize_Warn = 1,
1608 __Pyx_ImportType_CheckSize_Ignore = 2
1610 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
1614 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1617 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1620 #ifdef CYTHON_CLINE_IN_TRACEBACK 1621 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) 1623 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1628 PyCodeObject* code_object;
1630 } __Pyx_CodeObjectCacheEntry;
1631 struct __Pyx_CodeObjectCache {
1634 __Pyx_CodeObjectCacheEntry* entries;
1636 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1637 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1638 static PyCodeObject *__pyx_find_code_object(
int code_line);
1639 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1642 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1643 int py_line,
const char *filename);
1649 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
1652 #ifndef __Pyx_CppExn2PyErr 1655 #include <stdexcept> 1657 static void __Pyx_CppExn2PyErr() {
1659 if (PyErr_Occurred())
1663 }
catch (
const std::bad_alloc& exn) {
1664 PyErr_SetString(PyExc_MemoryError, exn.what());
1665 }
catch (
const std::bad_cast& exn) {
1666 PyErr_SetString(PyExc_TypeError, exn.what());
1667 }
catch (
const std::bad_typeid& exn) {
1668 PyErr_SetString(PyExc_TypeError, exn.what());
1669 }
catch (
const std::domain_error& exn) {
1670 PyErr_SetString(PyExc_ValueError, exn.what());
1671 }
catch (
const std::invalid_argument& exn) {
1672 PyErr_SetString(PyExc_ValueError, exn.what());
1673 }
catch (
const std::ios_base::failure& exn) {
1674 PyErr_SetString(PyExc_IOError, exn.what());
1675 }
catch (
const std::out_of_range& exn) {
1676 PyErr_SetString(PyExc_IndexError, exn.what());
1677 }
catch (
const std::overflow_error& exn) {
1678 PyErr_SetString(PyExc_OverflowError, exn.what());
1679 }
catch (
const std::range_error& exn) {
1680 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1681 }
catch (
const std::underflow_error& exn) {
1682 PyErr_SetString(PyExc_ArithmeticError, exn.what());
1683 }
catch (
const std::exception& exn) {
1684 PyErr_SetString(PyExc_RuntimeError, exn.what());
1688 PyErr_SetString(PyExc_RuntimeError,
"Unknown exception");
1694 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1699 #define __Pyx_CREAL(z) ((z).real()) 1700 #define __Pyx_CIMAG(z) ((z).imag()) 1702 #define __Pyx_CREAL(z) (__real__(z)) 1703 #define __Pyx_CIMAG(z) (__imag__(z)) 1706 #define __Pyx_CREAL(z) ((z).real) 1707 #define __Pyx_CIMAG(z) ((z).imag) 1709 #if defined(__cplusplus) && CYTHON_CCOMPLEX\ 1710 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) 1711 #define __Pyx_SET_CREAL(z,x) ((z).real(x)) 1712 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) 1714 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) 1715 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) 1720 #define __Pyx_c_eq_float(a, b) ((a)==(b)) 1721 #define __Pyx_c_sum_float(a, b) ((a)+(b)) 1722 #define __Pyx_c_diff_float(a, b) ((a)-(b)) 1723 #define __Pyx_c_prod_float(a, b) ((a)*(b)) 1724 #define __Pyx_c_quot_float(a, b) ((a)/(b)) 1725 #define __Pyx_c_neg_float(a) (-(a)) 1727 #define __Pyx_c_is_zero_float(z) ((z)==(float)0) 1728 #define __Pyx_c_conj_float(z) (::std::conj(z)) 1730 #define __Pyx_c_abs_float(z) (::std::abs(z)) 1731 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b)) 1734 #define __Pyx_c_is_zero_float(z) ((z)==0) 1735 #define __Pyx_c_conj_float(z) (conjf(z)) 1737 #define __Pyx_c_abs_float(z) (cabsf(z)) 1738 #define __Pyx_c_pow_float(a, b) (cpowf(a, b)) 1742 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
1743 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
1744 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
1745 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
1746 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
1747 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
1748 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
1749 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
1751 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
1752 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
1758 #define __Pyx_c_eq_double(a, b) ((a)==(b)) 1759 #define __Pyx_c_sum_double(a, b) ((a)+(b)) 1760 #define __Pyx_c_diff_double(a, b) ((a)-(b)) 1761 #define __Pyx_c_prod_double(a, b) ((a)*(b)) 1762 #define __Pyx_c_quot_double(a, b) ((a)/(b)) 1763 #define __Pyx_c_neg_double(a) (-(a)) 1765 #define __Pyx_c_is_zero_double(z) ((z)==(double)0) 1766 #define __Pyx_c_conj_double(z) (::std::conj(z)) 1768 #define __Pyx_c_abs_double(z) (::std::abs(z)) 1769 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b)) 1772 #define __Pyx_c_is_zero_double(z) ((z)==0) 1773 #define __Pyx_c_conj_double(z) (conj(z)) 1775 #define __Pyx_c_abs_double(z) (cabs(z)) 1776 #define __Pyx_c_pow_double(a, b) (cpow(a, b)) 1780 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
1781 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
1782 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
1783 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
1784 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
1785 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
1786 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
1787 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
1789 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
1790 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
1795 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value);
1798 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
1801 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
1804 #if CYTHON_COMPILING_IN_CPYTHON 1805 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) 1806 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1807 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1808 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1810 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) 1811 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) 1812 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) 1814 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) 1817 static int __Pyx_check_binary_version(
void);
1820 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1846 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
1859 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
1860 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
1861 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
1862 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
1863 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
1864 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *,
char *,
char *,
int *);
1867 static PyTypeObject *__pyx_ptype_12pynastran_io_BDFModel = 0;
1874 static PyObject *__pyx_f_12pynastran_io_perturbZeroLengthBushings(
struct BDFModel *);
1875 static std::string __pyx_convert_string_from_py_std__in_string(PyObject *);
1876 static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string
const &);
1877 static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string
const &);
1878 static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string
const &);
1879 static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string
const &);
1880 static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string
const &);
1881 static PyObject *__pyx_convert_map_to_py_std_3a__3a_string____int(std::map<std::string,int>
const &);
1882 static std::vector<int> __pyx_convert_vector_from_py_int(PyObject *);
1883 #define __Pyx_MODULE_NAME "pynastran_io" 1884 extern int __pyx_module_is_main_pynastran_io;
1885 int __pyx_module_is_main_pynastran_io = 0;
1888 static PyObject *__pyx_builtin_TypeError;
1889 static PyObject *__pyx_builtin_print;
1890 static PyObject *__pyx_builtin_NotImplementedError;
1891 static PyObject *__pyx_builtin_range;
1892 static PyObject *__pyx_builtin_ValueError;
1893 static PyObject *__pyx_builtin_RuntimeError;
1894 static PyObject *__pyx_builtin_ImportError;
1895 static const char __pyx_k_i[] =
"_%i";
1896 static const char __pyx_k_j[] =
"j";
1897 static const char __pyx_k_x[] =
"x";
1898 static const char __pyx_k__3[] =
"_";
1899 static const char __pyx_k__4[] =
"'";
1900 static const char __pyx_k_np[] =
"np";
1901 static const char __pyx_k_BDF[] =
"BDF";
1902 static const char __pyx_k_eid[] =
"eid";
1903 static const char __pyx_k_i_2[] =
"i";
1904 static const char __pyx_k_min[] =
"min";
1905 static const char __pyx_k_nid[] =
"nid";
1906 static const char __pyx_k_pid[] =
"pid";
1907 static const char __pyx_k_xyz[] =
"xyz";
1908 static const char __pyx_k_keys[] =
"keys";
1909 static const char __pyx_k_main[] =
"__main__";
1910 static const char __pyx_k_name[] =
"__name__";
1911 static const char __pyx_k_norm[] =
"norm";
1912 static const char __pyx_k_spcs[] =
"spcs";
1913 static const char __pyx_k_test[] =
"__test__";
1914 static const char __pyx_k_type[] =
"type";
1915 static const char __pyx_k_warn[] =
"warn";
1916 static const char __pyx_k_CBUSH[] =
"CBUSH";
1917 static const char __pyx_k_DTYPE[] =
"DTYPE";
1918 static const char __pyx_k_float[] =
"float";
1919 static const char __pyx_k_items[] =
"items";
1920 static const char __pyx_k_nodes[] =
"nodes";
1921 static const char __pyx_k_numpy[] =
"numpy";
1922 static const char __pyx_k_print[] =
"print";
1923 static const char __pyx_k_range[] =
"range";
1924 static const char __pyx_k_strip[] =
"strip";
1925 static const char __pyx_k_utf_8[] =
"utf-8";
1926 static const char __pyx_k_encode[] =
"encode";
1927 static const char __pyx_k_import[] =
"__import__";
1928 static const char __pyx_k_linalg[] =
"linalg";
1929 static const char __pyx_k_nnodes[] =
"nnodes";
1930 static const char __pyx_k_offset[] =
"offset";
1931 static const char __pyx_k_reduce[] =
"__reduce__";
1932 static const char __pyx_k_tolist[] =
"tolist";
1933 static const char __pyx_k_CBUSH1D[] =
"CBUSH1D";
1934 static const char __pyx_k_CBUSH2D[] =
"CBUSH2D";
1935 static const char __pyx_k_cid_ref[] =
"cid_ref";
1936 static const char __pyx_k_zoffset[] =
"zoffset";
1937 static const char __pyx_k_BDFModel[] =
"BDFModel";
1938 static const char __pyx_k_bdf_path[] =
"bdf_path";
1939 static const char __pyx_k_elements[] =
"elements";
1940 static const char __pyx_k_getstate[] =
"__getstate__";
1941 static const char __pyx_k_read_bdf[] =
"read_bdf";
1942 static const char __pyx_k_setstate[] =
"__setstate__";
1943 static const char __pyx_k_warnings[] =
"warnings";
1944 static const char __pyx_k_TypeError[] =
"TypeError";
1945 static const char __pyx_k_nelements[] =
"nelements";
1946 static const char __pyx_k_nodes_ref[] =
"nodes_ref";
1947 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
1948 static const char __pyx_k_ValueError[] =
"ValueError";
1949 static const char __pyx_k_card_count[] =
"card_count";
1950 static const char __pyx_k_nmaterials[] =
"nmaterials";
1951 static const char __pyx_k_ImportError[] =
"ImportError";
1952 static const char __pyx_k_nproperties[] =
"nproperties";
1953 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
1954 static const char __pyx_k_card_count_s[] =
"card_count = %s\n";
1955 static const char __pyx_k_reject_count[] =
"reject_count";
1956 static const char __pyx_k_get_bdf_stats[] =
"get_bdf_stats";
1957 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
1958 static const char __pyx_k_reject_count_s[] =
"reject_count = %s\n";
1959 static const char __pyx_k_Subcase_i__s__i[] =
"Subcase-%i_%s_%i";
1960 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
1961 static const char __pyx_k_object_attributes[] =
"object_attributes";
1962 static const char __pyx_k_pyNastran_bdf_bdf[] =
"pyNastran.bdf.bdf";
1963 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
1964 static const char __pyx_k_NotImplementedError[] =
"NotImplementedError";
1965 static const char __pyx_k_ndarray_is_not_C_contiguous[] =
"ndarray is not C contiguous";
1966 static const char __pyx_k_Support_of_non_zero_offsets_not[] =
"Support of non-zero offsets not yet implemented!";
1967 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
1968 static const char __pyx_k_pyNASTRAN_Notes_Dependencies_cp[] =
"\npyNASTRAN Notes\n---------------\nDependencies: cpylog, scipy, numpy\n";
1969 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] =
"unknown dtype code in numpy.pxd (%d)";
1970 static const char __pyx_k_Format_string_allocated_too_shor[] =
"Format string allocated too short, see comment in numpy.pxd";
1971 static const char __pyx_k_Non_native_byte_order_not_suppor[] =
"Non-native byte order not supported";
1972 static const char __pyx_k_Perturbing_GRID_i_by_s_to_define[] =
"Perturbing GRID %i by %s to define x-axis of zero-length element.";
1973 static const char __pyx_k_Support_of_non_zero_offets_not_y[] =
"Support of non-zero offets not yet implemented!";
1974 static const char __pyx_k_get_elements_properties_nodes_by[] =
"get_elements_properties_nodes_by_element_type";
1975 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] =
"ndarray is not Fortran contiguous";
1976 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
1977 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
1978 static const char __pyx_k_Format_string_allocated_too_shor_2[] =
"Format string allocated too short.";
1979 static PyObject *__pyx_n_s_BDF;
1980 static PyObject *__pyx_n_s_BDFModel;
1981 static PyObject *__pyx_n_u_CBUSH;
1982 static PyObject *__pyx_n_u_CBUSH1D;
1983 static PyObject *__pyx_n_u_CBUSH2D;
1984 static PyObject *__pyx_n_s_DTYPE;
1985 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
1986 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
1987 static PyObject *__pyx_n_s_ImportError;
1988 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
1989 static PyObject *__pyx_n_s_NotImplementedError;
1990 static PyObject *__pyx_kp_u_Perturbing_GRID_i_by_s_to_define;
1991 static PyObject *__pyx_n_s_RuntimeError;
1992 static PyObject *__pyx_kp_u_Subcase_i__s__i;
1993 static PyObject *__pyx_kp_u_Support_of_non_zero_offets_not_y;
1994 static PyObject *__pyx_kp_u_Support_of_non_zero_offsets_not;
1995 static PyObject *__pyx_n_s_TypeError;
1996 static PyObject *__pyx_n_s_ValueError;
1997 static PyObject *__pyx_n_u__3;
1998 static PyObject *__pyx_kp_u__4;
1999 static PyObject *__pyx_n_s_bdf_path;
2000 static PyObject *__pyx_n_s_card_count;
2001 static PyObject *__pyx_kp_u_card_count_s;
2002 static PyObject *__pyx_n_s_cid_ref;
2003 static PyObject *__pyx_n_s_cline_in_traceback;
2004 static PyObject *__pyx_n_s_eid;
2005 static PyObject *__pyx_n_s_elements;
2006 static PyObject *__pyx_n_s_encode;
2007 static PyObject *__pyx_n_s_float;
2008 static PyObject *__pyx_n_s_get_bdf_stats;
2009 static PyObject *__pyx_n_s_get_elements_properties_nodes_by;
2010 static PyObject *__pyx_n_s_getstate;
2011 static PyObject *__pyx_kp_u_i;
2012 static PyObject *__pyx_n_s_i_2;
2013 static PyObject *__pyx_n_s_import;
2014 static PyObject *__pyx_n_s_items;
2015 static PyObject *__pyx_n_s_j;
2016 static PyObject *__pyx_n_s_keys;
2017 static PyObject *__pyx_n_s_linalg;
2018 static PyObject *__pyx_n_s_main;
2019 static PyObject *__pyx_n_s_min;
2020 static PyObject *__pyx_n_s_name;
2021 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
2022 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
2023 static PyObject *__pyx_n_s_nelements;
2024 static PyObject *__pyx_n_s_nid;
2025 static PyObject *__pyx_n_s_nmaterials;
2026 static PyObject *__pyx_n_s_nnodes;
2027 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2028 static PyObject *__pyx_n_s_nodes;
2029 static PyObject *__pyx_n_s_nodes_ref;
2030 static PyObject *__pyx_n_s_norm;
2031 static PyObject *__pyx_n_s_np;
2032 static PyObject *__pyx_n_s_nproperties;
2033 static PyObject *__pyx_n_s_numpy;
2034 static PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to;
2035 static PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor;
2036 static PyObject *__pyx_n_s_object_attributes;
2037 static PyObject *__pyx_n_s_offset;
2038 static PyObject *__pyx_n_u_offset;
2039 static PyObject *__pyx_n_s_pid;
2040 static PyObject *__pyx_n_s_print;
2041 static PyObject *__pyx_n_s_pyNastran_bdf_bdf;
2042 static PyObject *__pyx_n_s_range;
2043 static PyObject *__pyx_n_s_read_bdf;
2044 static PyObject *__pyx_n_s_reduce;
2045 static PyObject *__pyx_n_s_reduce_cython;
2046 static PyObject *__pyx_n_s_reduce_ex;
2047 static PyObject *__pyx_n_s_reject_count;
2048 static PyObject *__pyx_kp_u_reject_count_s;
2049 static PyObject *__pyx_n_s_setstate;
2050 static PyObject *__pyx_n_s_setstate_cython;
2051 static PyObject *__pyx_n_s_spcs;
2052 static PyObject *__pyx_n_s_strip;
2053 static PyObject *__pyx_n_s_test;
2054 static PyObject *__pyx_n_s_tolist;
2055 static PyObject *__pyx_n_s_type;
2056 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2057 static PyObject *__pyx_kp_u_utf_8;
2058 static PyObject *__pyx_n_s_warn;
2059 static PyObject *__pyx_n_s_warnings;
2060 static PyObject *__pyx_n_s_x;
2061 static PyObject *__pyx_n_s_xyz;
2062 static PyObject *__pyx_n_s_zoffset;
2063 static PyObject *__pyx_n_u_zoffset;
2064 static int __pyx_pf_12pynastran_io_8BDFModel___cinit__(
struct BDFModel *__pyx_v_self, std::string __pyx_v_bdf_path);
2065 static PyObject *__pyx_pf_12pynastran_io_8BDFModel_5nDims___get__(
struct BDFModel *__pyx_v_self);
2066 static PyObject *__pyx_pf_12pynastran_io_8BDFModel_6nNodes___get__(
struct BDFModel *__pyx_v_self);
2067 static PyObject *__pyx_pf_12pynastran_io_8BDFModel_6nElems___get__(
struct BDFModel *__pyx_v_self);
2068 static PyObject *__pyx_pf_12pynastran_io_8BDFModel_10nMaterials___get__(
struct BDFModel *__pyx_v_self);
2069 static PyObject *__pyx_pf_12pynastran_io_8BDFModel_11nProperties___get__(
struct BDFModel *__pyx_v_self);
2070 static PyObject *__pyx_pf_12pynastran_io_8BDFModel_10nElemTypes___get__(
struct BDFModel *__pyx_v_self);
2071 static PyObject *__pyx_pf_12pynastran_io_8BDFModel_2__reduce_cython__(CYTHON_UNUSED
struct BDFModel *__pyx_v_self);
2072 static PyObject *__pyx_pf_12pynastran_io_8BDFModel_4__setstate_cython__(CYTHON_UNUSED
struct BDFModel *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2073 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2074 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info);
2075 static PyObject *__pyx_tp_new_12pynastran_io_BDFModel(PyTypeObject *t, PyObject *a, PyObject *k);
2076 static PyObject *__pyx_float_0_0;
2077 static PyObject *__pyx_int_0;
2078 static PyObject *__pyx_int_1;
2079 static PyObject *__pyx_tuple_;
2080 static PyObject *__pyx_tuple__2;
2081 static PyObject *__pyx_tuple__5;
2082 static PyObject *__pyx_tuple__6;
2083 static PyObject *__pyx_tuple__7;
2084 static PyObject *__pyx_tuple__8;
2085 static PyObject *__pyx_tuple__9;
2086 static PyObject *__pyx_tuple__10;
2087 static PyObject *__pyx_tuple__11;
2088 static PyObject *__pyx_tuple__12;
2089 static PyObject *__pyx_tuple__13;
2101 static int __pyx_pw_12pynastran_io_8BDFModel_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2102 static int __pyx_pw_12pynastran_io_8BDFModel_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2103 std::string __pyx_v_bdf_path;
2105 __Pyx_RefNannyDeclarations
2106 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
2108 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bdf_path,0};
2109 PyObject* values[1] = {0};
2110 if (unlikely(__pyx_kwds)) {
2112 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2114 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2117 default:
goto __pyx_L5_argtuple_error;
2119 kw_args = PyDict_Size(__pyx_kwds);
2122 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bdf_path)) != 0)) kw_args--;
2123 else goto __pyx_L5_argtuple_error;
2125 if (unlikely(kw_args > 0)) {
2126 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 50, __pyx_L3_error)
2128 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
2129 goto __pyx_L5_argtuple_error;
2131 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2133 __pyx_v_bdf_path = __pyx_convert_string_from_py_std__in_string(values[0]);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 50, __pyx_L3_error)
2135 goto __pyx_L4_argument_unpacking_done;
2136 __pyx_L5_argtuple_error:;
2137 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 50, __pyx_L3_error)
2139 __Pyx_AddTraceback(
"pynastran_io.BDFModel.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2140 __Pyx_RefNannyFinishContext();
2142 __pyx_L4_argument_unpacking_done:;
2143 __pyx_r = __pyx_pf_12pynastran_io_8BDFModel___cinit__(((
struct BDFModel *)__pyx_v_self), __pyx_v_bdf_path);
2146 __Pyx_RefNannyFinishContext();
2150 static int __pyx_pf_12pynastran_io_8BDFModel___cinit__(
struct BDFModel *__pyx_v_self, std::string __pyx_v_bdf_path) {
2151 PyObject *__pyx_v_nm = NULL;
2153 __Pyx_RefNannyDeclarations
2154 PyObject *__pyx_t_1 = NULL;
2155 PyObject *__pyx_t_2 = NULL;
2156 PyObject *__pyx_t_3 = NULL;
2158 __Pyx_RefNannySetupContext(
"__cinit__", 0);
2167 __pyx_v_self->
bdfPath = __pyx_v_bdf_path;
2176 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BDF);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 52, __pyx_L1_error)
2177 __Pyx_GOTREF(__pyx_t_2);
2179 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
2180 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
2181 if (likely(__pyx_t_3)) {
2182 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
2183 __Pyx_INCREF(__pyx_t_3);
2184 __Pyx_INCREF(
function);
2185 __Pyx_DECREF_SET(__pyx_t_2,
function);
2188 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
2189 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
2190 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 52, __pyx_L1_error)
2191 __Pyx_GOTREF(__pyx_t_1);
2192 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2193 __Pyx_GIVEREF(__pyx_t_1);
2194 __Pyx_GOTREF(__pyx_v_self->
myBDF);
2195 __Pyx_DECREF(__pyx_v_self->
myBDF);
2196 __pyx_v_self->
myBDF = __pyx_t_1;
2206 __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_bdf_path, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 53, __pyx_L1_error)
2207 __Pyx_GOTREF(__pyx_t_1);
2208 __pyx_v_nm = __pyx_t_1;
2218 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->
myBDF, __pyx_n_s_read_bdf);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 54, __pyx_L1_error)
2219 __Pyx_GOTREF(__pyx_t_2);
2221 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
2222 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
2223 if (likely(__pyx_t_3)) {
2224 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
2225 __Pyx_INCREF(__pyx_t_3);
2226 __Pyx_INCREF(
function);
2227 __Pyx_DECREF_SET(__pyx_t_2,
function);
2230 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_nm) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_nm);
2231 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
2232 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 54, __pyx_L1_error)
2233 __Pyx_GOTREF(__pyx_t_1);
2234 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2235 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2244 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->
myBDF, __pyx_n_s_nnodes);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 55, __pyx_L1_error)
2245 __Pyx_GOTREF(__pyx_t_1);
2246 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 55, __pyx_L1_error)
2247 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2248 __pyx_v_self->
nNodes = __pyx_t_4;
2257 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->
myBDF, __pyx_n_s_nelements);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 56, __pyx_L1_error)
2258 __Pyx_GOTREF(__pyx_t_1);
2259 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 56, __pyx_L1_error)
2260 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2261 __pyx_v_self->
nElems = __pyx_t_4;
2270 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->
myBDF, __pyx_n_s_nmaterials);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 57, __pyx_L1_error)
2271 __Pyx_GOTREF(__pyx_t_1);
2272 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 57, __pyx_L1_error)
2273 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2283 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->
myBDF, __pyx_n_s_nproperties);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 58, __pyx_L1_error)
2284 __Pyx_GOTREF(__pyx_t_1);
2285 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 58, __pyx_L1_error)
2286 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2296 __pyx_t_1 = __pyx_f_12pynastran_io_perturbZeroLengthBushings(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 63, __pyx_L1_error)
2297 __Pyx_GOTREF(__pyx_t_1);
2298 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2312 __Pyx_XDECREF(__pyx_t_1);
2313 __Pyx_XDECREF(__pyx_t_2);
2314 __Pyx_XDECREF(__pyx_t_3);
2315 __Pyx_AddTraceback(
"pynastran_io.BDFModel.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2318 __Pyx_XDECREF(__pyx_v_nm);
2319 __Pyx_RefNannyFinishContext();
2332 static PyObject *__pyx_pw_12pynastran_io_8BDFModel_5nDims_1__get__(PyObject *__pyx_v_self);
2333 static PyObject *__pyx_pw_12pynastran_io_8BDFModel_5nDims_1__get__(PyObject *__pyx_v_self) {
2334 PyObject *__pyx_r = 0;
2335 __Pyx_RefNannyDeclarations
2336 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
2337 __pyx_r = __pyx_pf_12pynastran_io_8BDFModel_5nDims___get__(((
struct BDFModel *)__pyx_v_self));
2340 __Pyx_RefNannyFinishContext();
2344 static PyObject *__pyx_pf_12pynastran_io_8BDFModel_5nDims___get__(
struct BDFModel *__pyx_v_self) {
2345 PyObject *__pyx_r = NULL;
2346 __Pyx_RefNannyDeclarations
2347 PyObject *__pyx_t_1 = NULL;
2348 __Pyx_RefNannySetupContext(
"__get__", 0);
2349 __Pyx_XDECREF(__pyx_r);
2350 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->
nDims);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 39, __pyx_L1_error)
2351 __Pyx_GOTREF(__pyx_t_1);
2352 __pyx_r = __pyx_t_1;
2358 __Pyx_XDECREF(__pyx_t_1);
2359 __Pyx_AddTraceback(
"pynastran_io.BDFModel.nDims.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2362 __Pyx_XGIVEREF(__pyx_r);
2363 __Pyx_RefNannyFinishContext();
2376 static PyObject *__pyx_pw_12pynastran_io_8BDFModel_6nNodes_1__get__(PyObject *__pyx_v_self);
2377 static PyObject *__pyx_pw_12pynastran_io_8BDFModel_6nNodes_1__get__(PyObject *__pyx_v_self) {
2378 PyObject *__pyx_r = 0;
2379 __Pyx_RefNannyDeclarations
2380 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
2381 __pyx_r = __pyx_pf_12pynastran_io_8BDFModel_6nNodes___get__(((
struct BDFModel *)__pyx_v_self));
2384 __Pyx_RefNannyFinishContext();
2388 static PyObject *__pyx_pf_12pynastran_io_8BDFModel_6nNodes___get__(
struct BDFModel *__pyx_v_self) {
2389 PyObject *__pyx_r = NULL;
2390 __Pyx_RefNannyDeclarations
2391 PyObject *__pyx_t_1 = NULL;
2392 __Pyx_RefNannySetupContext(
"__get__", 0);
2393 __Pyx_XDECREF(__pyx_r);
2394 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->
nNodes);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 40, __pyx_L1_error)
2395 __Pyx_GOTREF(__pyx_t_1);
2396 __pyx_r = __pyx_t_1;
2402 __Pyx_XDECREF(__pyx_t_1);
2403 __Pyx_AddTraceback(
"pynastran_io.BDFModel.nNodes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2406 __Pyx_XGIVEREF(__pyx_r);
2407 __Pyx_RefNannyFinishContext();
2420 static PyObject *__pyx_pw_12pynastran_io_8BDFModel_6nElems_1__get__(PyObject *__pyx_v_self);
2421 static PyObject *__pyx_pw_12pynastran_io_8BDFModel_6nElems_1__get__(PyObject *__pyx_v_self) {
2422 PyObject *__pyx_r = 0;
2423 __Pyx_RefNannyDeclarations
2424 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
2425 __pyx_r = __pyx_pf_12pynastran_io_8BDFModel_6nElems___get__(((
struct BDFModel *)__pyx_v_self));
2428 __Pyx_RefNannyFinishContext();
2432 static PyObject *__pyx_pf_12pynastran_io_8BDFModel_6nElems___get__(
struct BDFModel *__pyx_v_self) {
2433 PyObject *__pyx_r = NULL;
2434 __Pyx_RefNannyDeclarations
2435 PyObject *__pyx_t_1 = NULL;
2436 __Pyx_RefNannySetupContext(
"__get__", 0);
2437 __Pyx_XDECREF(__pyx_r);
2438 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->
nElems);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 41, __pyx_L1_error)
2439 __Pyx_GOTREF(__pyx_t_1);
2440 __pyx_r = __pyx_t_1;
2446 __Pyx_XDECREF(__pyx_t_1);
2447 __Pyx_AddTraceback(
"pynastran_io.BDFModel.nElems.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2450 __Pyx_XGIVEREF(__pyx_r);
2451 __Pyx_RefNannyFinishContext();
2464 static PyObject *__pyx_pw_12pynastran_io_8BDFModel_10nMaterials_1__get__(PyObject *__pyx_v_self);
2465 static PyObject *__pyx_pw_12pynastran_io_8BDFModel_10nMaterials_1__get__(PyObject *__pyx_v_self) {
2466 PyObject *__pyx_r = 0;
2467 __Pyx_RefNannyDeclarations
2468 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
2469 __pyx_r = __pyx_pf_12pynastran_io_8BDFModel_10nMaterials___get__(((
struct BDFModel *)__pyx_v_self));
2472 __Pyx_RefNannyFinishContext();
2476 static PyObject *__pyx_pf_12pynastran_io_8BDFModel_10nMaterials___get__(
struct BDFModel *__pyx_v_self) {
2477 PyObject *__pyx_r = NULL;
2478 __Pyx_RefNannyDeclarations
2479 PyObject *__pyx_t_1 = NULL;
2480 __Pyx_RefNannySetupContext(
"__get__", 0);
2481 __Pyx_XDECREF(__pyx_r);
2482 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->
nMaterials);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 42, __pyx_L1_error)
2483 __Pyx_GOTREF(__pyx_t_1);
2484 __pyx_r = __pyx_t_1;
2490 __Pyx_XDECREF(__pyx_t_1);
2491 __Pyx_AddTraceback(
"pynastran_io.BDFModel.nMaterials.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2494 __Pyx_XGIVEREF(__pyx_r);
2495 __Pyx_RefNannyFinishContext();
2508 static PyObject *__pyx_pw_12pynastran_io_8BDFModel_11nProperties_1__get__(PyObject *__pyx_v_self);
2509 static PyObject *__pyx_pw_12pynastran_io_8BDFModel_11nProperties_1__get__(PyObject *__pyx_v_self) {
2510 PyObject *__pyx_r = 0;
2511 __Pyx_RefNannyDeclarations
2512 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
2513 __pyx_r = __pyx_pf_12pynastran_io_8BDFModel_11nProperties___get__(((
struct BDFModel *)__pyx_v_self));
2516 __Pyx_RefNannyFinishContext();
2520 static PyObject *__pyx_pf_12pynastran_io_8BDFModel_11nProperties___get__(
struct BDFModel *__pyx_v_self) {
2521 PyObject *__pyx_r = NULL;
2522 __Pyx_RefNannyDeclarations
2523 PyObject *__pyx_t_1 = NULL;
2524 __Pyx_RefNannySetupContext(
"__get__", 0);
2525 __Pyx_XDECREF(__pyx_r);
2526 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->
nProperties);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 43, __pyx_L1_error)
2527 __Pyx_GOTREF(__pyx_t_1);
2528 __pyx_r = __pyx_t_1;
2534 __Pyx_XDECREF(__pyx_t_1);
2535 __Pyx_AddTraceback(
"pynastran_io.BDFModel.nProperties.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2538 __Pyx_XGIVEREF(__pyx_r);
2539 __Pyx_RefNannyFinishContext();
2552 static PyObject *__pyx_pw_12pynastran_io_8BDFModel_10nElemTypes_1__get__(PyObject *__pyx_v_self);
2553 static PyObject *__pyx_pw_12pynastran_io_8BDFModel_10nElemTypes_1__get__(PyObject *__pyx_v_self) {
2554 PyObject *__pyx_r = 0;
2555 __Pyx_RefNannyDeclarations
2556 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
2557 __pyx_r = __pyx_pf_12pynastran_io_8BDFModel_10nElemTypes___get__(((
struct BDFModel *)__pyx_v_self));
2560 __Pyx_RefNannyFinishContext();
2564 static PyObject *__pyx_pf_12pynastran_io_8BDFModel_10nElemTypes___get__(
struct BDFModel *__pyx_v_self) {
2565 PyObject *__pyx_r = NULL;
2566 __Pyx_RefNannyDeclarations
2567 PyObject *__pyx_t_1 = NULL;
2568 __Pyx_RefNannySetupContext(
"__get__", 0);
2569 __Pyx_XDECREF(__pyx_r);
2570 __pyx_t_1 = __pyx_convert_map_to_py_std_3a__3a_string____int(__pyx_v_self->
nElemTypes);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 44, __pyx_L1_error)
2571 __Pyx_GOTREF(__pyx_t_1);
2572 __pyx_r = __pyx_t_1;
2578 __Pyx_XDECREF(__pyx_t_1);
2579 __Pyx_AddTraceback(
"pynastran_io.BDFModel.nElemTypes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2582 __Pyx_XGIVEREF(__pyx_r);
2583 __Pyx_RefNannyFinishContext();
2594 static PyObject *__pyx_pw_12pynastran_io_8BDFModel_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
2595 static PyObject *__pyx_pw_12pynastran_io_8BDFModel_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2596 PyObject *__pyx_r = 0;
2597 __Pyx_RefNannyDeclarations
2598 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
2599 __pyx_r = __pyx_pf_12pynastran_io_8BDFModel_2__reduce_cython__(((
struct BDFModel *)__pyx_v_self));
2602 __Pyx_RefNannyFinishContext();
2606 static PyObject *__pyx_pf_12pynastran_io_8BDFModel_2__reduce_cython__(CYTHON_UNUSED
struct BDFModel *__pyx_v_self) {
2607 PyObject *__pyx_r = NULL;
2608 __Pyx_RefNannyDeclarations
2609 PyObject *__pyx_t_1 = NULL;
2610 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
2618 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
2619 __Pyx_GOTREF(__pyx_t_1);
2620 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
2621 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2622 __PYX_ERR(0, 2, __pyx_L1_error)
2632 __Pyx_XDECREF(__pyx_t_1);
2633 __Pyx_AddTraceback(
"pynastran_io.BDFModel.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2635 __Pyx_XGIVEREF(__pyx_r);
2636 __Pyx_RefNannyFinishContext();
2648 static PyObject *__pyx_pw_12pynastran_io_8BDFModel_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
2649 static PyObject *__pyx_pw_12pynastran_io_8BDFModel_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
2650 PyObject *__pyx_r = 0;
2651 __Pyx_RefNannyDeclarations
2652 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
2653 __pyx_r = __pyx_pf_12pynastran_io_8BDFModel_4__setstate_cython__(((
struct BDFModel *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
2656 __Pyx_RefNannyFinishContext();
2660 static PyObject *__pyx_pf_12pynastran_io_8BDFModel_4__setstate_cython__(CYTHON_UNUSED
struct BDFModel *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
2661 PyObject *__pyx_r = NULL;
2662 __Pyx_RefNannyDeclarations
2663 PyObject *__pyx_t_1 = NULL;
2664 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
2671 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
2672 __Pyx_GOTREF(__pyx_t_1);
2673 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
2674 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2675 __PYX_ERR(0, 4, __pyx_L1_error)
2686 __Pyx_XDECREF(__pyx_t_1);
2687 __Pyx_AddTraceback(
"pynastran_io.BDFModel.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2689 __Pyx_XGIVEREF(__pyx_r);
2690 __Pyx_RefNannyFinishContext();
2704 __Pyx_RefNannyDeclarations
2705 PyObject *__pyx_t_1 = NULL;
2706 PyObject *__pyx_t_2 = NULL;
2707 __Pyx_RefNannySetupContext(
"buildBDFModel", 0);
2716 __Pyx_XDECREF(((PyObject *)__pyx_r));
2717 __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_bdf_path);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 70, __pyx_L1_error)
2718 __Pyx_GOTREF(__pyx_t_1);
2719 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_12pynastran_io_BDFModel), __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 70, __pyx_L1_error)
2720 __Pyx_GOTREF(__pyx_t_2);
2721 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2722 __pyx_r = ((
struct BDFModel *)__pyx_t_2);
2736 __Pyx_XDECREF(__pyx_t_1);
2737 __Pyx_XDECREF(__pyx_t_2);
2738 __Pyx_AddTraceback(
"pynastran_io.buildBDFModel", __pyx_clineno, __pyx_lineno, __pyx_filename);
2741 __Pyx_XGIVEREF((PyObject *)__pyx_r);
2742 __Pyx_RefNannyFinishContext();
2755 __Pyx_RefNannyDeclarations
2756 PyObject *__pyx_t_1 = NULL;
2757 PyObject *__pyx_t_2 = NULL;
2758 PyObject *__pyx_t_3 = NULL;
2759 __Pyx_RefNannySetupContext(
"printBDFStats", 0);
2768 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_model->
myBDF, __pyx_n_s_get_bdf_stats);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 74, __pyx_L1_error)
2769 __Pyx_GOTREF(__pyx_t_2);
2771 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
2772 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
2773 if (likely(__pyx_t_3)) {
2774 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
2775 __Pyx_INCREF(__pyx_t_3);
2776 __Pyx_INCREF(
function);
2777 __Pyx_DECREF_SET(__pyx_t_2,
function);
2780 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
2781 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
2782 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 74, __pyx_L1_error)
2783 __Pyx_GOTREF(__pyx_t_1);
2784 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2785 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 74, __pyx_L1_error)
2786 __Pyx_GOTREF(__pyx_t_2);
2787 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2788 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2797 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_model->
myBDF, __pyx_n_s_card_count);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 75, __pyx_L1_error)
2798 __Pyx_GOTREF(__pyx_t_2);
2799 __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_card_count_s, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 75, __pyx_L1_error)
2800 __Pyx_GOTREF(__pyx_t_1);
2801 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2802 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 75, __pyx_L1_error)
2803 __Pyx_GOTREF(__pyx_t_2);
2804 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2805 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2814 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_model->
myBDF, __pyx_n_s_reject_count);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 76, __pyx_L1_error)
2815 __Pyx_GOTREF(__pyx_t_2);
2816 __pyx_t_1 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_reject_count_s, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 76, __pyx_L1_error)
2817 __Pyx_GOTREF(__pyx_t_1);
2818 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2819 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 76, __pyx_L1_error)
2820 __Pyx_GOTREF(__pyx_t_2);
2821 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2822 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2835 __Pyx_XDECREF(__pyx_t_1);
2836 __Pyx_XDECREF(__pyx_t_2);
2837 __Pyx_XDECREF(__pyx_t_3);
2838 __Pyx_WriteUnraisable(
"pynastran_io.printBDFStats", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
2840 __Pyx_RefNannyFinishContext();
2851 std::vector<std::vector<double> >
getNodes(
struct BDFModel *__pyx_v_model) {
2854 std::vector<double> __pyx_v_node_vec;
2855 std::vector<std::vector<double> > __pyx_v_nodes;
2860 PyObject *__pyx_v_key = NULL;
2861 PyObject *__pyx_v_node = NULL;
2862 std::vector<std::vector<double> > __pyx_r;
2863 __Pyx_RefNannyDeclarations
2865 std::vector<double> __pyx_t_2;
2866 std::vector<std::vector<double> > __pyx_t_3;
2867 PyObject *__pyx_t_4 = NULL;
2868 PyObject *__pyx_t_5 = NULL;
2869 Py_ssize_t __pyx_t_6;
2870 PyObject *(*__pyx_t_7)(PyObject *);
2871 PyObject *__pyx_t_8 = NULL;
2874 __Pyx_RefNannySetupContext(
"getNodes", 0);
2883 __pyx_t_1 = __pyx_v_model->
nNodes;
2884 __pyx_v_n = __pyx_t_1;
2903 __pyx_t_2 = std::vector<double> (__pyx_v_m);
2905 __Pyx_CppExn2PyErr();
2906 __PYX_ERR(1, 101, __pyx_L1_error)
2908 __pyx_v_node_vec = __pyx_t_2;
2918 __pyx_t_3 = std::vector<std::vector<double> > (__pyx_v_n, __pyx_v_node_vec);
2920 __Pyx_CppExn2PyErr();
2921 __PYX_ERR(1, 102, __pyx_L1_error)
2923 __pyx_v_nodes = __pyx_t_3;
2968 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_model->
myBDF, __pyx_n_s_nodes);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 109, __pyx_L1_error)
2969 __Pyx_GOTREF(__pyx_t_4);
2970 if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
2971 __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
2974 __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 109, __pyx_L1_error)
2975 __Pyx_GOTREF(__pyx_t_5);
2976 __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 109, __pyx_L1_error)
2978 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2980 if (likely(!__pyx_t_7)) {
2981 if (likely(PyList_CheckExact(__pyx_t_5))) {
2982 if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5))
break;
2983 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 2984 __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++;
if (unlikely(0 < 0)) __PYX_ERR(1, 109, __pyx_L1_error)
2986 __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++;
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 109, __pyx_L1_error)
2987 __Pyx_GOTREF(__pyx_t_4);
2990 if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5))
break;
2991 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 2992 __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++;
if (unlikely(0 < 0)) __PYX_ERR(1, 109, __pyx_L1_error)
2994 __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++;
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 109, __pyx_L1_error)
2995 __Pyx_GOTREF(__pyx_t_4);
2999 __pyx_t_4 = __pyx_t_7(__pyx_t_5);
3000 if (unlikely(!__pyx_t_4)) {
3001 PyObject* exc_type = PyErr_Occurred();
3003 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3004 else __PYX_ERR(1, 109, __pyx_L1_error)
3008 __Pyx_GOTREF(__pyx_t_4);
3010 __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_4);
3020 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_model->
myBDF, __pyx_n_s_nodes);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 110, __pyx_L1_error)
3021 __Pyx_GOTREF(__pyx_t_4);
3022 __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_key);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 110, __pyx_L1_error)
3023 __Pyx_GOTREF(__pyx_t_8);
3024 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3025 __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_8);
3035 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_node, __pyx_n_s_nid);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 111, __pyx_L1_error)
3036 __Pyx_GOTREF(__pyx_t_8);
3037 __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_8);
if (unlikely((__pyx_t_9 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(1, 111, __pyx_L1_error)
3038 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3039 ((__pyx_v_nodes[__pyx_v_i])[0]) = __pyx_t_9;
3048 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_node, __pyx_n_s_xyz);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 112, __pyx_L1_error)
3049 __Pyx_GOTREF(__pyx_t_8);
3050 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_8, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 112, __pyx_L1_error)
3051 __Pyx_GOTREF(__pyx_t_4);
3052 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3053 __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4);
if (unlikely((__pyx_t_9 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(1, 112, __pyx_L1_error)
3054 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3055 ((__pyx_v_nodes[__pyx_v_i])[1]) = __pyx_t_9;
3064 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_node, __pyx_n_s_xyz);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 113, __pyx_L1_error)
3065 __Pyx_GOTREF(__pyx_t_4);
3066 __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 113, __pyx_L1_error)
3067 __Pyx_GOTREF(__pyx_t_8);
3068 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3069 __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_8);
if (unlikely((__pyx_t_9 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(1, 113, __pyx_L1_error)
3070 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3071 ((__pyx_v_nodes[__pyx_v_i])[2]) = __pyx_t_9;
3080 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_node, __pyx_n_s_xyz);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 114, __pyx_L1_error)
3081 __Pyx_GOTREF(__pyx_t_8);
3082 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_8, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 114, __pyx_L1_error)
3083 __Pyx_GOTREF(__pyx_t_4);
3084 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3085 __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4);
if (unlikely((__pyx_t_9 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(1, 114, __pyx_L1_error)
3086 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3087 ((__pyx_v_nodes[__pyx_v_i])[3]) = __pyx_t_9;
3096 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_node, __pyx_n_s_xyz);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 115, __pyx_L1_error)
3097 __Pyx_GOTREF(__pyx_t_4);
3098 __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 115, __pyx_L1_error)
3099 __Pyx_GOTREF(__pyx_t_8);
3100 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3101 __pyx_t_4 = __Pyx_PyFloat_NeObjC(__pyx_t_8, __pyx_float_0_0, 0.0, 0, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 115, __pyx_L1_error)
3102 __Pyx_GOTREF(__pyx_t_4);
3103 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3104 __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(1, 115, __pyx_L1_error)
3105 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3133 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_node, __pyx_n_s_xyz);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 117, __pyx_L1_error)
3134 __Pyx_GOTREF(__pyx_t_4);
3135 __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 117, __pyx_L1_error)
3136 __Pyx_GOTREF(__pyx_t_8);
3137 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3138 __pyx_t_4 = __Pyx_PyFloat_NeObjC(__pyx_t_8, __pyx_float_0_0, 0.0, 0, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 117, __pyx_L1_error)
3139 __Pyx_GOTREF(__pyx_t_4);
3140 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3141 __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(1, 117, __pyx_L1_error)
3142 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3170 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_node, __pyx_n_s_xyz);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 119, __pyx_L1_error)
3171 __Pyx_GOTREF(__pyx_t_4);
3172 __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 119, __pyx_L1_error)
3173 __Pyx_GOTREF(__pyx_t_8);
3174 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3175 __pyx_t_4 = __Pyx_PyFloat_NeObjC(__pyx_t_8, __pyx_float_0_0, 0.0, 0, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 119, __pyx_L1_error)
3176 __Pyx_GOTREF(__pyx_t_4);
3177 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3178 __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(1, 119, __pyx_L1_error)
3179 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3207 __pyx_v_i = (__pyx_v_i + 1);
3217 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3226 __pyx_t_10 = (__pyx_v_anyZ != 0);
3236 __pyx_v_model->
nDims = 3;
3255 __pyx_t_10 = (__pyx_v_anyY != 0);
3265 __pyx_v_model->
nDims = 2;
3284 __pyx_t_10 = (__pyx_v_anyX != 0);
3294 __pyx_v_model->
nDims = 1;
3314 __pyx_v_model->
nDims = 0;
3325 __pyx_r = __pyx_v_nodes;
3338 __Pyx_XDECREF(__pyx_t_4);
3339 __Pyx_XDECREF(__pyx_t_5);
3340 __Pyx_XDECREF(__pyx_t_8);
3341 __Pyx_WriteUnraisable(
"pynastran_io.getNodes", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
3342 __Pyx_pretend_to_initialize(&__pyx_r);
3344 __Pyx_XDECREF(__pyx_v_key);
3345 __Pyx_XDECREF(__pyx_v_node);
3346 __Pyx_RefNannyFinishContext();
3358 std::map<std::string,std::vector<std::vector<int> > >
getElements(
struct BDFModel *__pyx_v_model) {
3359 CYTHON_UNUSED
int __pyx_v_n;
3360 std::map<std::string,std::vector<std::vector<int> > > __pyx_v_elementMap;
3361 std::map<std::string,int> __pyx_v_elemTypes;
3362 std::map<std::string,int> __pyx_v_i_counter;
3363 std::map<std::string,int> ::iterator __pyx_v_it;
3364 std::vector<int> __pyx_v_elem_vec;
3366 int __pyx_v_nElemNodes;
3367 PyObject *__pyx_v_elemType = NULL;
3368 int __pyx_v_nElemTypes;
3369 CYTHON_UNUSED PyObject *__pyx_v_mapKeys = NULL;
3372 CYTHON_UNUSED PyObject *__pyx_v_key = NULL;
3373 PyObject *__pyx_v_element = NULL;
3374 std::map<std::string,std::vector<std::vector<int> > > __pyx_r;
3375 __Pyx_RefNannyDeclarations
3378 PyObject *__pyx_t_3 = NULL;
3379 PyObject *__pyx_t_4 = NULL;
3380 PyObject *__pyx_t_5 = NULL;
3381 std::vector<int> __pyx_t_6;
3382 std::vector<std::vector<int> > __pyx_t_7;
3383 std::string __pyx_t_8;
3384 Py_ssize_t __pyx_t_9;
3385 Py_ssize_t __pyx_t_10;
3387 PyObject *__pyx_t_12 = NULL;
3389 Py_ssize_t __pyx_t_14;
3390 PyObject *__pyx_t_15 = NULL;
3394 std::string __pyx_t_19;
3395 __Pyx_RefNannySetupContext(
"getElements", 0);
3404 __pyx_t_1 = __pyx_v_model->
nElems;
3405 __pyx_v_n = __pyx_t_1;
3423 __pyx_v_it = __pyx_v_elemTypes.begin();
3433 __pyx_t_2 = ((__pyx_v_it != __pyx_v_elemTypes.end()) != 0);
3434 if (!__pyx_t_2)
break;
3443 __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string((*__pyx_v_it).first);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 154, __pyx_L1_error)
3444 __Pyx_GOTREF(__pyx_t_3);
3445 __Pyx_XDECREF_SET(__pyx_v_elemType, __pyx_t_3);
3455 __pyx_t_1 = (*__pyx_v_it).second;
3456 __pyx_v_nElemTypes = __pyx_t_1;
3465 __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_elemType);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 156, __pyx_L1_error)
3466 __Pyx_GOTREF(__pyx_t_4);
3467 __pyx_t_5 = PyUnicode_Split(((PyObject*)__pyx_t_4), __pyx_n_u__3, -1L);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 156, __pyx_L1_error)
3468 __Pyx_GOTREF(__pyx_t_5);
3469 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3470 __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_t_5, -1L,
long, 1, __Pyx_PyInt_From_long, 1, 1, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 156, __pyx_L1_error)
3471 __Pyx_GOTREF(__pyx_t_4);
3472 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3473 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strip);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 156, __pyx_L1_error)
3474 __Pyx_GOTREF(__pyx_t_5);
3475 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3477 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
3478 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
3479 if (likely(__pyx_t_4)) {
3480 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
3481 __Pyx_INCREF(__pyx_t_4);
3482 __Pyx_INCREF(
function);
3483 __Pyx_DECREF_SET(__pyx_t_5,
function);
3486 __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_kp_u__4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_u__4);
3487 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3488 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 156, __pyx_L1_error)
3489 __Pyx_GOTREF(__pyx_t_3);
3490 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3491 __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 156, __pyx_L1_error)
3492 __Pyx_GOTREF(__pyx_t_5);
3493 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3494 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_t_5);
if (unlikely((__pyx_t_1 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 156, __pyx_L1_error)
3495 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3496 __pyx_v_nElemNodes = __pyx_t_1;
3505 __pyx_v_m = (__pyx_v_nElemNodes + 2);
3515 __pyx_t_6 = std::vector<int> (__pyx_v_m);
3517 __Pyx_CppExn2PyErr();
3518 __PYX_ERR(1, 159, __pyx_L1_error)
3520 __pyx_v_elem_vec = __pyx_t_6;
3530 __pyx_t_7 = std::vector<std::vector<int> > (__pyx_v_nElemTypes, __pyx_v_elem_vec);
3532 __Pyx_CppExn2PyErr();
3533 __PYX_ERR(1, 160, __pyx_L1_error)
3535 __pyx_t_8 = __pyx_convert_string_from_py_std__in_string(__pyx_v_elemType);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 160, __pyx_L1_error)
3536 (__pyx_v_elementMap[__pyx_t_8]) = __pyx_t_7;
3545 __pyx_t_8 = __pyx_convert_string_from_py_std__in_string(__pyx_v_elemType);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 162, __pyx_L1_error)
3546 (__pyx_v_i_counter[__pyx_t_8]) = 0;
3555 (void)((__pyx_v_it++));
3565 __pyx_t_5 = PyList_New(0);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 165, __pyx_L1_error)
3566 __Pyx_GOTREF(__pyx_t_5);
3567 __pyx_v_mapKeys = ((PyObject*)__pyx_t_5);
3578 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_model->
myBDF, __pyx_n_s_elements);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 170, __pyx_L1_error)
3579 __Pyx_GOTREF(__pyx_t_3);
3580 if (unlikely(__pyx_t_3 == Py_None)) {
3581 PyErr_Format(PyExc_AttributeError,
"'NoneType' object has no attribute '%.30s'",
"items");
3582 __PYX_ERR(1, 170, __pyx_L1_error)
3584 __pyx_t_4 = __Pyx_dict_iterator(__pyx_t_3, 0, __pyx_n_s_items, (&__pyx_t_10), (&__pyx_t_1));
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 170, __pyx_L1_error)
3585 __Pyx_GOTREF(__pyx_t_4);
3586 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3587 __Pyx_XDECREF(__pyx_t_5);
3588 __pyx_t_5 = __pyx_t_4;
3591 __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_10, &__pyx_t_9, &__pyx_t_4, &__pyx_t_3, NULL, __pyx_t_1);
3592 if (unlikely(__pyx_t_11 == 0))
break;
3593 if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(1, 170, __pyx_L1_error)
3594 __Pyx_GOTREF(__pyx_t_4);
3595 __Pyx_GOTREF(__pyx_t_3);
3596 __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_4);
3598 __Pyx_XDECREF_SET(__pyx_v_element, __pyx_t_3);
3608 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_element, __pyx_n_s_object_attributes);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 171, __pyx_L1_error)
3609 __Pyx_GOTREF(__pyx_t_4);
3611 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
3612 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_4);
3613 if (likely(__pyx_t_12)) {
3614 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
3615 __Pyx_INCREF(__pyx_t_12);
3616 __Pyx_INCREF(
function);
3617 __Pyx_DECREF_SET(__pyx_t_4,
function);
3620 __pyx_t_3 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
3621 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
3622 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 171, __pyx_L1_error)
3623 __Pyx_GOTREF(__pyx_t_3);
3624 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3625 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_offset, __pyx_t_3, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 171, __pyx_L1_error)
3626 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3627 __pyx_t_13 = (__pyx_t_2 != 0);
3637 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_element, __pyx_n_s_offset);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 172, __pyx_L1_error)
3638 __Pyx_GOTREF(__pyx_t_3);
3639 __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_3, __pyx_int_0, 0, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 172, __pyx_L1_error)
3640 __Pyx_GOTREF(__pyx_t_4);
3641 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3642 __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(1, 172, __pyx_L1_error)
3643 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3644 if (unlikely(__pyx_t_13)) {
3653 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 173, __pyx_L1_error)
3654 __Pyx_GOTREF(__pyx_t_4);
3655 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3656 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3657 __PYX_ERR(1, 173, __pyx_L1_error)
3684 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_element, __pyx_n_s_object_attributes);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 174, __pyx_L1_error)
3685 __Pyx_GOTREF(__pyx_t_3);
3687 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3688 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3);
3689 if (likely(__pyx_t_12)) {
3690 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3691 __Pyx_INCREF(__pyx_t_12);
3692 __Pyx_INCREF(
function);
3693 __Pyx_DECREF_SET(__pyx_t_3,
function);
3696 __pyx_t_4 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3697 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
3698 if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 174, __pyx_L1_error)
3699 __Pyx_GOTREF(__pyx_t_4);
3700 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3701 __pyx_t_13 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_zoffset, __pyx_t_4, Py_EQ));
if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(1, 174, __pyx_L1_error)
3702 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3703 __pyx_t_2 = (__pyx_t_13 != 0);
3713 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_element, __pyx_n_s_zoffset);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 175, __pyx_L1_error)
3714 __Pyx_GOTREF(__pyx_t_4);
3715 __pyx_t_3 = __Pyx_PyInt_NeObjC(__pyx_t_4, __pyx_int_0, 0, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 175, __pyx_L1_error)
3716 __Pyx_GOTREF(__pyx_t_3);
3717 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3718 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 175, __pyx_L1_error)
3719 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3720 if (unlikely(__pyx_t_2)) {
3729 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__6, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 176, __pyx_L1_error)
3730 __Pyx_GOTREF(__pyx_t_3);
3731 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
3732 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3733 __PYX_ERR(1, 176, __pyx_L1_error)
3760 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_element, __pyx_n_s_nodes);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 177, __pyx_L1_error)
3761 __Pyx_GOTREF(__pyx_t_3);
3762 __pyx_t_14 = PyObject_Length(__pyx_t_3);
if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(1, 177, __pyx_L1_error)
3763 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3764 __pyx_v_nElemNodes = __pyx_t_14;
3773 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_element, __pyx_n_s_type);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 178, __pyx_L1_error)
3774 __Pyx_GOTREF(__pyx_t_4);
3775 __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_nElemNodes);
if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 178, __pyx_L1_error)
3776 __Pyx_GOTREF(__pyx_t_12);
3777 __pyx_t_15 = PyUnicode_Format(__pyx_kp_u_i, __pyx_t_12);
if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 178, __pyx_L1_error)
3778 __Pyx_GOTREF(__pyx_t_15);
3779 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3780 __pyx_t_12 = PyNumber_Add(__pyx_t_4, __pyx_t_15);
if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 178, __pyx_L1_error)
3781 __Pyx_GOTREF(__pyx_t_12);
3782 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3783 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3784 __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_encode);
if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 178, __pyx_L1_error)
3785 __Pyx_GOTREF(__pyx_t_15);
3786 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
3788 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_15))) {
3789 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_15);
3790 if (likely(__pyx_t_12)) {
3791 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_15);
3792 __Pyx_INCREF(__pyx_t_12);
3793 __Pyx_INCREF(
function);
3794 __Pyx_DECREF_SET(__pyx_t_15,
function);
3797 __pyx_t_3 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_15, __pyx_t_12, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_kp_u_utf_8);
3798 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
3799 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 178, __pyx_L1_error)
3800 __Pyx_GOTREF(__pyx_t_3);
3801 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3802 __Pyx_XDECREF_SET(__pyx_v_elemType, __pyx_t_3);
3812 __pyx_t_8 = __pyx_convert_string_from_py_std__in_string(__pyx_v_elemType);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 179, __pyx_L1_error)
3813 __pyx_v_i = (__pyx_v_i_counter[__pyx_t_8]);
3822 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_element, __pyx_n_s_eid);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 180, __pyx_L1_error)
3823 __Pyx_GOTREF(__pyx_t_3);
3824 __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_11 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 180, __pyx_L1_error)
3825 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3826 __pyx_t_8 = __pyx_convert_string_from_py_std__in_string(__pyx_v_elemType);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 180, __pyx_L1_error)
3827 (((__pyx_v_elementMap[__pyx_t_8])[__pyx_v_i])[0]) = __pyx_t_11;
3836 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_element, __pyx_n_s_pid);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 181, __pyx_L1_error)
3837 __Pyx_GOTREF(__pyx_t_3);
3838 __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_11 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 181, __pyx_L1_error)
3839 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3840 __pyx_t_8 = __pyx_convert_string_from_py_std__in_string(__pyx_v_elemType);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 181, __pyx_L1_error)
3841 (((__pyx_v_elementMap[__pyx_t_8])[__pyx_v_i])[1]) = __pyx_t_11;
3850 __pyx_t_11 = __pyx_v_nElemNodes;
3851 __pyx_t_16 = __pyx_t_11;
3852 for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
3853 __pyx_v_j = __pyx_t_17;
3862 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_element, __pyx_n_s_nodes);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 183, __pyx_L1_error)
3863 __Pyx_GOTREF(__pyx_t_3);
3864 __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_j,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 183, __pyx_L1_error)
3865 __Pyx_GOTREF(__pyx_t_15);
3866 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3867 __pyx_t_18 = __Pyx_PyInt_As_int(__pyx_t_15);
if (unlikely((__pyx_t_18 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 183, __pyx_L1_error)
3868 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3869 __pyx_t_8 = __pyx_convert_string_from_py_std__in_string(__pyx_v_elemType);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 183, __pyx_L1_error)
3870 (((__pyx_v_elementMap[__pyx_t_8])[__pyx_v_i])[(__pyx_v_j + 2)]) = __pyx_t_18;
3880 __pyx_t_8 = __pyx_convert_string_from_py_std__in_string(__pyx_v_elemType);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 184, __pyx_L1_error)
3881 __pyx_t_19 = __pyx_convert_string_from_py_std__in_string(__pyx_v_elemType);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 184, __pyx_L1_error)
3882 (__pyx_v_i_counter[__pyx_t_19]) = ((__pyx_v_i_counter[__pyx_t_8]) + 1);
3884 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3893 __pyx_r = __pyx_v_elementMap;
3906 __Pyx_XDECREF(__pyx_t_3);
3907 __Pyx_XDECREF(__pyx_t_4);
3908 __Pyx_XDECREF(__pyx_t_5);
3909 __Pyx_XDECREF(__pyx_t_12);
3910 __Pyx_XDECREF(__pyx_t_15);
3911 __Pyx_WriteUnraisable(
"pynastran_io.getElements", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
3912 __Pyx_pretend_to_initialize(&__pyx_r);
3914 __Pyx_XDECREF(__pyx_v_elemType);
3915 __Pyx_XDECREF(__pyx_v_mapKeys);
3916 __Pyx_XDECREF(__pyx_v_key);
3917 __Pyx_XDECREF(__pyx_v_element);
3918 __Pyx_RefNannyFinishContext();
3931 std::map<std::string,int> __pyx_v_elementTypes;
3932 PyObject *__pyx_v_elemTypeList = NULL;
3933 CYTHON_UNUSED PyObject *__pyx_v_key = NULL;
3934 PyObject *__pyx_v_element = NULL;
3935 PyObject *__pyx_v_elemType = NULL;
3936 std::map<std::string,int> __pyx_r;
3937 __Pyx_RefNannyDeclarations
3938 PyObject *__pyx_t_1 = NULL;
3939 Py_ssize_t __pyx_t_2;
3940 Py_ssize_t __pyx_t_3;
3942 PyObject *__pyx_t_5 = NULL;
3943 PyObject *__pyx_t_6 = NULL;
3945 PyObject *__pyx_t_8 = NULL;
3946 Py_ssize_t __pyx_t_9;
3947 PyObject *__pyx_t_10 = NULL;
3951 std::string __pyx_t_14;
3952 __Pyx_RefNannySetupContext(
"getNumberOfElementTypes", 0);
3961 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 195, __pyx_L1_error)
3962 __Pyx_GOTREF(__pyx_t_1);
3963 __pyx_v_elemTypeList = ((PyObject*)__pyx_t_1);
3974 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_model->
myBDF, __pyx_n_s_elements);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 196, __pyx_L1_error)
3975 __Pyx_GOTREF(__pyx_t_5);
3976 if (unlikely(__pyx_t_5 == Py_None)) {
3977 PyErr_Format(PyExc_AttributeError,
"'NoneType' object has no attribute '%.30s'",
"items");
3978 __PYX_ERR(1, 196, __pyx_L1_error)
3980 __pyx_t_6 = __Pyx_dict_iterator(__pyx_t_5, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 196, __pyx_L1_error)
3981 __Pyx_GOTREF(__pyx_t_6);
3982 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3983 __Pyx_XDECREF(__pyx_t_1);
3984 __pyx_t_1 = __pyx_t_6;
3987 __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_6, &__pyx_t_5, NULL, __pyx_t_4);
3988 if (unlikely(__pyx_t_7 == 0))
break;
3989 if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(1, 196, __pyx_L1_error)
3990 __Pyx_GOTREF(__pyx_t_6);
3991 __Pyx_GOTREF(__pyx_t_5);
3992 __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_6);
3994 __Pyx_XDECREF_SET(__pyx_v_element, __pyx_t_5);
4004 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_element, __pyx_n_s_type);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 197, __pyx_L1_error)
4005 __Pyx_GOTREF(__pyx_t_6);
4006 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_element, __pyx_n_s_nodes);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 197, __pyx_L1_error)
4007 __Pyx_GOTREF(__pyx_t_8);
4008 __pyx_t_9 = PyObject_Length(__pyx_t_8);
if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(1, 197, __pyx_L1_error)
4009 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4010 __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_9);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 197, __pyx_L1_error)
4011 __Pyx_GOTREF(__pyx_t_8);
4012 __pyx_t_10 = PyUnicode_Format(__pyx_kp_u_i, __pyx_t_8);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 197, __pyx_L1_error)
4013 __Pyx_GOTREF(__pyx_t_10);
4014 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4015 __pyx_t_8 = PyNumber_Add(__pyx_t_6, __pyx_t_10);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 197, __pyx_L1_error)
4016 __Pyx_GOTREF(__pyx_t_8);
4017 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4018 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4019 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_encode);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 197, __pyx_L1_error)
4020 __Pyx_GOTREF(__pyx_t_10);
4021 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4023 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
4024 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10);
4025 if (likely(__pyx_t_8)) {
4026 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_10);
4027 __Pyx_INCREF(__pyx_t_8);
4028 __Pyx_INCREF(
function);
4029 __Pyx_DECREF_SET(__pyx_t_10,
function);
4032 __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_8, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_kp_u_utf_8);
4033 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
4034 if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 197, __pyx_L1_error)
4035 __Pyx_GOTREF(__pyx_t_5);
4036 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4037 __Pyx_XDECREF_SET(__pyx_v_elemType, __pyx_t_5);
4047 __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_v_elemType, __pyx_v_elemTypeList, Py_NE));
if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(1, 198, __pyx_L1_error)
4048 __pyx_t_12 = (__pyx_t_11 != 0);
4058 __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_elemTypeList, __pyx_v_elemType);
if (unlikely(__pyx_t_13 == ((
int)-1))) __PYX_ERR(1, 199, __pyx_L1_error)
4067 __pyx_t_14 = __pyx_convert_string_from_py_std__in_string(__pyx_v_elemType);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 200, __pyx_L1_error)
4068 (__pyx_v_elementTypes[__pyx_t_14]) = 1;
4088 __pyx_t_14 = __pyx_convert_string_from_py_std__in_string(__pyx_v_elemType);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 202, __pyx_L1_error)
4089 (__pyx_v_elementTypes[__pyx_t_14]) = ((__pyx_v_elementTypes[__pyx_t_14]) + 1);
4093 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4102 __pyx_v_model->
nElemTypes = __pyx_v_elementTypes;
4111 __pyx_r = __pyx_v_elementTypes;
4124 __Pyx_XDECREF(__pyx_t_1);
4125 __Pyx_XDECREF(__pyx_t_5);
4126 __Pyx_XDECREF(__pyx_t_6);
4127 __Pyx_XDECREF(__pyx_t_8);
4128 __Pyx_XDECREF(__pyx_t_10);
4129 __Pyx_WriteUnraisable(
"pynastran_io.getNumberOfElementTypes", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4130 __Pyx_pretend_to_initialize(&__pyx_r);
4132 __Pyx_XDECREF(__pyx_v_elemTypeList);
4133 __Pyx_XDECREF(__pyx_v_key);
4134 __Pyx_XDECREF(__pyx_v_element);
4135 __Pyx_XDECREF(__pyx_v_elemType);
4136 __Pyx_RefNannyFinishContext();
4148 std::map<std::string,std::vector<int> >
getSPCs(
struct BDFModel *__pyx_v_model) {
4149 std::map<std::string,std::vector<int> > __pyx_v_SPCs;
4150 PyObject *__pyx_v_subcase_num = NULL;
4151 PyObject *__pyx_v_spcs = NULL;
4152 PyObject *__pyx_v_i = NULL;
4153 PyObject *__pyx_v_spc = NULL;
4154 PyObject *__pyx_v_name = NULL;
4155 std::map<std::string,std::vector<int> > __pyx_r;
4156 __Pyx_RefNannyDeclarations
4157 PyObject *__pyx_t_1 = NULL;
4158 Py_ssize_t __pyx_t_2;
4159 Py_ssize_t __pyx_t_3;
4161 PyObject *__pyx_t_5 = NULL;
4162 PyObject *__pyx_t_6 = NULL;
4164 Py_ssize_t __pyx_t_8;
4165 PyObject *(*__pyx_t_9)(PyObject *);
4166 PyObject *__pyx_t_10 = NULL;
4167 std::vector<int> __pyx_t_11;
4168 std::string __pyx_t_12;
4169 __Pyx_RefNannySetupContext(
"getSPCs", 0);
4179 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_model->
myBDF, __pyx_n_s_spcs);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 214, __pyx_L1_error)
4180 __Pyx_GOTREF(__pyx_t_5);
4181 if (unlikely(__pyx_t_5 == Py_None)) {
4182 PyErr_Format(PyExc_AttributeError,
"'NoneType' object has no attribute '%.30s'",
"items");
4183 __PYX_ERR(1, 214, __pyx_L1_error)
4185 __pyx_t_6 = __Pyx_dict_iterator(__pyx_t_5, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 214, __pyx_L1_error)
4186 __Pyx_GOTREF(__pyx_t_6);
4187 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4188 __Pyx_XDECREF(__pyx_t_1);
4189 __pyx_t_1 = __pyx_t_6;
4192 __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_6, &__pyx_t_5, NULL, __pyx_t_4);
4193 if (unlikely(__pyx_t_7 == 0))
break;
4194 if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(1, 214, __pyx_L1_error)
4195 __Pyx_GOTREF(__pyx_t_6);
4196 __Pyx_GOTREF(__pyx_t_5);
4197 __Pyx_XDECREF_SET(__pyx_v_subcase_num, __pyx_t_6);
4199 __Pyx_XDECREF_SET(__pyx_v_spcs, __pyx_t_5);
4209 __Pyx_INCREF(__pyx_int_1);
4210 __Pyx_XDECREF_SET(__pyx_v_i, __pyx_int_1);
4219 if (likely(PyList_CheckExact(__pyx_v_spcs)) || PyTuple_CheckExact(__pyx_v_spcs)) {
4220 __pyx_t_5 = __pyx_v_spcs; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
4223 __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_spcs);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 216, __pyx_L1_error)
4224 __Pyx_GOTREF(__pyx_t_5);
4225 __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 216, __pyx_L1_error)
4228 if (likely(!__pyx_t_9)) {
4229 if (likely(PyList_CheckExact(__pyx_t_5))) {
4230 if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5))
break;
4231 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 4232 __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++;
if (unlikely(0 < 0)) __PYX_ERR(1, 216, __pyx_L1_error)
4234 __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++;
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 216, __pyx_L1_error)
4235 __Pyx_GOTREF(__pyx_t_6);
4238 if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5))
break;
4239 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 4240 __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++;
if (unlikely(0 < 0)) __PYX_ERR(1, 216, __pyx_L1_error)
4242 __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++;
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 216, __pyx_L1_error)
4243 __Pyx_GOTREF(__pyx_t_6);
4247 __pyx_t_6 = __pyx_t_9(__pyx_t_5);
4248 if (unlikely(!__pyx_t_6)) {
4249 PyObject* exc_type = PyErr_Occurred();
4251 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
4252 else __PYX_ERR(1, 216, __pyx_L1_error)
4256 __Pyx_GOTREF(__pyx_t_6);
4258 __Pyx_XDECREF_SET(__pyx_v_spc, __pyx_t_6);
4268 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_spc, __pyx_n_s_type);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 217, __pyx_L1_error)
4269 __Pyx_GOTREF(__pyx_t_6);
4270 __pyx_t_10 = PyTuple_New(3);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 217, __pyx_L1_error)
4271 __Pyx_GOTREF(__pyx_t_10);
4272 __Pyx_INCREF(__pyx_v_subcase_num);
4273 __Pyx_GIVEREF(__pyx_v_subcase_num);
4274 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_subcase_num);
4275 __Pyx_GIVEREF(__pyx_t_6);
4276 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
4277 __Pyx_INCREF(__pyx_v_i);
4278 __Pyx_GIVEREF(__pyx_v_i);
4279 PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_i);
4281 __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_Subcase_i__s__i, __pyx_t_10);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 217, __pyx_L1_error)
4282 __Pyx_GOTREF(__pyx_t_6);
4283 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4284 __Pyx_XDECREF_SET(__pyx_v_name, ((PyObject*)__pyx_t_6));
4294 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_spc, __pyx_n_s_nodes);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 218, __pyx_L1_error)
4295 __Pyx_GOTREF(__pyx_t_6);
4296 __pyx_t_11 = __pyx_convert_vector_from_py_int(__pyx_t_6);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 218, __pyx_L1_error)
4297 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4298 __pyx_t_6 = PyUnicode_AsUTF8String(__pyx_v_name);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 218, __pyx_L1_error)
4299 __Pyx_GOTREF(__pyx_t_6);
4300 __pyx_t_12 = __pyx_convert_string_from_py_std__in_string(__pyx_t_6);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 218, __pyx_L1_error)
4301 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4302 (__pyx_v_SPCs[__pyx_t_12]) = __pyx_t_11;
4311 __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 1, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 219, __pyx_L1_error)
4312 __Pyx_GOTREF(__pyx_t_6);
4313 __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_6);
4324 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4326 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4335 __pyx_r = __pyx_v_SPCs;
4348 __Pyx_XDECREF(__pyx_t_1);
4349 __Pyx_XDECREF(__pyx_t_5);
4350 __Pyx_XDECREF(__pyx_t_6);
4351 __Pyx_XDECREF(__pyx_t_10);
4352 __Pyx_WriteUnraisable(
"pynastran_io.getSPCs", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4353 __Pyx_pretend_to_initialize(&__pyx_r);
4355 __Pyx_XDECREF(__pyx_v_subcase_num);
4356 __Pyx_XDECREF(__pyx_v_spcs);
4357 __Pyx_XDECREF(__pyx_v_i);
4358 __Pyx_XDECREF(__pyx_v_spc);
4359 __Pyx_XDECREF(__pyx_v_name);
4360 __Pyx_RefNannyFinishContext();
4372 static PyObject *__pyx_f_12pynastran_io_perturbZeroLengthBushings(
struct BDFModel *__pyx_v_model) {
4375 double __pyx_v_nzero;
4377 PyObject *__pyx_v_data = NULL;
4378 PyObject *__pyx_v_eids = NULL;
4379 PyObject *__pyx_v_eid = NULL;
4380 PyObject *__pyx_v_bushing = NULL;
4381 PyObject *__pyx_v_i = NULL;
4382 PyObject *__pyx_v_di = NULL;
4383 PyObject *__pyx_v_absmindi = NULL;
4384 PyObject *__pyx_r = NULL;
4385 __Pyx_RefNannyDeclarations
4386 PyObject *__pyx_t_1 = NULL;
4387 PyObject *__pyx_t_2 = NULL;
4388 PyObject *__pyx_t_3 = NULL;
4391 Py_ssize_t __pyx_t_6;
4392 Py_ssize_t __pyx_t_7;
4394 PyObject *__pyx_t_9 = NULL;
4395 PyObject *__pyx_t_10 = NULL;
4397 __Pyx_RefNannySetupContext(
"perturbZeroLengthBushings", 0);
4406 __pyx_v_eps = 1.4901161193847656e-08;
4415 __pyx_v_nzero = 1e-08;
4424 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_model->
myBDF, __pyx_n_s_get_elements_properties_nodes_by);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 239, __pyx_L1_error)
4425 __Pyx_GOTREF(__pyx_t_2);
4427 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4428 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4429 if (likely(__pyx_t_3)) {
4430 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4431 __Pyx_INCREF(__pyx_t_3);
4432 __Pyx_INCREF(
function);
4433 __Pyx_DECREF_SET(__pyx_t_2,
function);
4436 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
4437 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4438 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 239, __pyx_L1_error)
4439 __Pyx_GOTREF(__pyx_t_1);
4440 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4441 __pyx_v_data = __pyx_t_1;
4451 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
4452 __Pyx_GOTREF(__pyx_t_1);
4453 __pyx_v_eids = __pyx_t_1;
4463 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_keys);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 241, __pyx_L1_error)
4464 __Pyx_GOTREF(__pyx_t_2);
4466 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4467 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4468 if (likely(__pyx_t_3)) {
4469 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4470 __Pyx_INCREF(__pyx_t_3);
4471 __Pyx_INCREF(
function);
4472 __Pyx_DECREF_SET(__pyx_t_2,
function);
4475 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
4476 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4477 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 241, __pyx_L1_error)
4478 __Pyx_GOTREF(__pyx_t_1);
4479 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4480 __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_CBUSH, __pyx_t_1, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 241, __pyx_L1_error)
4481 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4482 __pyx_t_5 = (__pyx_t_4 != 0);
4492 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_CBUSH);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 242, __pyx_L1_error)
4493 __Pyx_GOTREF(__pyx_t_2);
4494 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 242, __pyx_L1_error)
4495 __Pyx_GOTREF(__pyx_t_3);
4496 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4497 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tolist);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 242, __pyx_L1_error)
4498 __Pyx_GOTREF(__pyx_t_2);
4499 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4501 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4502 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4503 if (likely(__pyx_t_3)) {
4504 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4505 __Pyx_INCREF(__pyx_t_3);
4506 __Pyx_INCREF(
function);
4507 __Pyx_DECREF_SET(__pyx_t_2,
function);
4510 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
4511 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4512 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 242, __pyx_L1_error)
4513 __Pyx_GOTREF(__pyx_t_1);
4514 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4515 __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_eids, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 242, __pyx_L1_error)
4516 __Pyx_GOTREF(__pyx_t_2);
4517 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4518 __Pyx_DECREF_SET(__pyx_v_eids, __pyx_t_2);
4537 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_keys);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 243, __pyx_L1_error)
4538 __Pyx_GOTREF(__pyx_t_1);
4540 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
4541 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
4542 if (likely(__pyx_t_3)) {
4543 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
4544 __Pyx_INCREF(__pyx_t_3);
4545 __Pyx_INCREF(
function);
4546 __Pyx_DECREF_SET(__pyx_t_1,
function);
4549 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
4550 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4551 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 243, __pyx_L1_error)
4552 __Pyx_GOTREF(__pyx_t_2);
4553 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4554 __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_CBUSH1D, __pyx_t_2, Py_EQ));
if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 243, __pyx_L1_error)
4555 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4556 __pyx_t_4 = (__pyx_t_5 != 0);
4566 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_CBUSH1D);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 244, __pyx_L1_error)
4567 __Pyx_GOTREF(__pyx_t_1);
4568 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 244, __pyx_L1_error)
4569 __Pyx_GOTREF(__pyx_t_3);
4570 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4571 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tolist);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 244, __pyx_L1_error)
4572 __Pyx_GOTREF(__pyx_t_1);
4573 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4575 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
4576 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
4577 if (likely(__pyx_t_3)) {
4578 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
4579 __Pyx_INCREF(__pyx_t_3);
4580 __Pyx_INCREF(
function);
4581 __Pyx_DECREF_SET(__pyx_t_1,
function);
4584 __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
4585 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4586 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 244, __pyx_L1_error)
4587 __Pyx_GOTREF(__pyx_t_2);
4588 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4589 __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_eids, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 244, __pyx_L1_error)
4590 __Pyx_GOTREF(__pyx_t_1);
4591 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4592 __Pyx_DECREF_SET(__pyx_v_eids, __pyx_t_1);
4611 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_keys);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 245, __pyx_L1_error)
4612 __Pyx_GOTREF(__pyx_t_2);
4614 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4615 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4616 if (likely(__pyx_t_3)) {
4617 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4618 __Pyx_INCREF(__pyx_t_3);
4619 __Pyx_INCREF(
function);
4620 __Pyx_DECREF_SET(__pyx_t_2,
function);
4623 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
4624 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4625 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 245, __pyx_L1_error)
4626 __Pyx_GOTREF(__pyx_t_1);
4627 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4628 __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_CBUSH2D, __pyx_t_1, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 245, __pyx_L1_error)
4629 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4630 __pyx_t_5 = (__pyx_t_4 != 0);
4640 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_data, __pyx_n_u_CBUSH2D);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 246, __pyx_L1_error)
4641 __Pyx_GOTREF(__pyx_t_2);
4642 __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 246, __pyx_L1_error)
4643 __Pyx_GOTREF(__pyx_t_3);
4644 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4645 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tolist);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 246, __pyx_L1_error)
4646 __Pyx_GOTREF(__pyx_t_2);
4647 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4649 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4650 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4651 if (likely(__pyx_t_3)) {
4652 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4653 __Pyx_INCREF(__pyx_t_3);
4654 __Pyx_INCREF(
function);
4655 __Pyx_DECREF_SET(__pyx_t_2,
function);
4658 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
4659 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4660 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 246, __pyx_L1_error)
4661 __Pyx_GOTREF(__pyx_t_1);
4662 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4663 __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_eids, __pyx_t_1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 246, __pyx_L1_error)
4664 __Pyx_GOTREF(__pyx_t_2);
4665 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4666 __Pyx_DECREF_SET(__pyx_v_eids, __pyx_t_2);
4685 __pyx_t_6 = PyObject_Length(__pyx_v_eids);
if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(1, 249, __pyx_L1_error)
4686 __pyx_t_7 = __pyx_t_6;
4687 for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
4688 __pyx_v_k = __pyx_t_8;
4697 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_eids, __pyx_v_k,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 250, __pyx_L1_error)
4698 __Pyx_GOTREF(__pyx_t_2);
4699 __Pyx_XDECREF_SET(__pyx_v_eid, __pyx_t_2);
4709 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_model->
myBDF, __pyx_n_s_elements);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
4710 __Pyx_GOTREF(__pyx_t_2);
4711 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_eid);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 251, __pyx_L1_error)
4712 __Pyx_GOTREF(__pyx_t_1);
4713 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4714 __Pyx_XDECREF_SET(__pyx_v_bushing, __pyx_t_1);
4724 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 252, __pyx_L1_error)
4725 __Pyx_GOTREF(__pyx_t_2);
4726 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_linalg);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
4727 __Pyx_GOTREF(__pyx_t_3);
4728 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4729 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_norm);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 252, __pyx_L1_error)
4730 __Pyx_GOTREF(__pyx_t_2);
4731 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4732 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_bushing, __pyx_n_s_nodes_ref);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
4733 __Pyx_GOTREF(__pyx_t_3);
4734 __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_3, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 252, __pyx_L1_error)
4735 __Pyx_GOTREF(__pyx_t_9);
4736 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4737 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_xyz);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
4738 __Pyx_GOTREF(__pyx_t_3);
4739 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4740 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_bushing, __pyx_n_s_nodes_ref);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 252, __pyx_L1_error)
4741 __Pyx_GOTREF(__pyx_t_9);
4742 __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_9, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 252, __pyx_L1_error)
4743 __Pyx_GOTREF(__pyx_t_10);
4744 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4745 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_xyz);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 252, __pyx_L1_error)
4746 __Pyx_GOTREF(__pyx_t_9);
4747 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4748 __pyx_t_10 = PyNumber_Subtract(__pyx_t_3, __pyx_t_9);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 252, __pyx_L1_error)
4749 __Pyx_GOTREF(__pyx_t_10);
4750 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4751 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4753 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
4754 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
4755 if (likely(__pyx_t_9)) {
4756 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
4757 __Pyx_INCREF(__pyx_t_9);
4758 __Pyx_INCREF(
function);
4759 __Pyx_DECREF_SET(__pyx_t_2,
function);
4762 __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_9, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_10);
4763 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
4764 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4765 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 252, __pyx_L1_error)
4766 __Pyx_GOTREF(__pyx_t_1);
4767 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4768 __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_1);
if (unlikely((__pyx_t_11 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(1, 252, __pyx_L1_error)
4769 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4770 __pyx_v_L = __pyx_t_11;
4779 __pyx_t_5 = ((fabs(__pyx_v_L) < __pyx_v_nzero) != 0);
4789 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_bushing, __pyx_n_s_cid_ref);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 255, __pyx_L1_error)
4790 __Pyx_GOTREF(__pyx_t_1);
4791 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_i_2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 255, __pyx_L1_error)
4792 __Pyx_GOTREF(__pyx_t_2);
4793 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4794 __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
4804 __pyx_t_2 = PyFloat_FromDouble(__pyx_v_eps);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 256, __pyx_L1_error)
4805 __Pyx_GOTREF(__pyx_t_2);
4806 __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 256, __pyx_L1_error)
4807 __Pyx_GOTREF(__pyx_t_1);
4808 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4809 __Pyx_XDECREF_SET(__pyx_v_di, __pyx_t_1);
4819 __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_v_di);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 257, __pyx_L1_error)
4820 __Pyx_GOTREF(__pyx_t_2);
4821 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_min);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 257, __pyx_L1_error)
4822 __Pyx_GOTREF(__pyx_t_10);
4823 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4825 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
4826 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_10);
4827 if (likely(__pyx_t_2)) {
4828 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_10);
4829 __Pyx_INCREF(__pyx_t_2);
4830 __Pyx_INCREF(
function);
4831 __Pyx_DECREF_SET(__pyx_t_10,
function);
4834 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_10);
4835 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4836 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 257, __pyx_L1_error)
4837 __Pyx_GOTREF(__pyx_t_1);
4838 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4839 __Pyx_XDECREF_SET(__pyx_v_absmindi, __pyx_t_1);
4849 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_eps);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 258, __pyx_L1_error)
4850 __Pyx_GOTREF(__pyx_t_1);
4851 __pyx_t_10 = PyObject_RichCompare(__pyx_v_absmindi, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_10);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 258, __pyx_L1_error)
4852 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4853 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10);
if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 258, __pyx_L1_error)
4854 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4864 __pyx_t_10 = PyFloat_FromDouble(__pyx_v_eps);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 259, __pyx_L1_error)
4865 __Pyx_GOTREF(__pyx_t_10);
4866 __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_10, __pyx_v_absmindi);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 259, __pyx_L1_error)
4867 __Pyx_GOTREF(__pyx_t_1);
4868 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4869 __pyx_t_10 = PyNumber_InPlaceMultiply(__pyx_v_di, __pyx_t_1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 259, __pyx_L1_error)
4870 __Pyx_GOTREF(__pyx_t_10);
4871 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4872 __Pyx_DECREF_SET(__pyx_v_di, __pyx_t_10);
4891 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_model->
myBDF, __pyx_n_s_nodes);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 260, __pyx_L1_error)
4892 __Pyx_GOTREF(__pyx_t_10);
4893 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_bushing, __pyx_n_s_nodes);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 260, __pyx_L1_error)
4894 __Pyx_GOTREF(__pyx_t_1);
4895 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 260, __pyx_L1_error)
4896 __Pyx_GOTREF(__pyx_t_2);
4897 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4898 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_10, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 260, __pyx_L1_error)
4899 __Pyx_GOTREF(__pyx_t_1);
4900 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4901 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4902 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_xyz);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 260, __pyx_L1_error)
4903 __Pyx_GOTREF(__pyx_t_2);
4904 __pyx_t_10 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_v_di);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 260, __pyx_L1_error)
4905 __Pyx_GOTREF(__pyx_t_10);
4906 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4907 if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_xyz, __pyx_t_10) < 0) __PYX_ERR(1, 260, __pyx_L1_error)
4908 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4909 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4918 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_bushing, __pyx_n_s_nodes);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 261, __pyx_L1_error)
4919 __Pyx_GOTREF(__pyx_t_1);
4920 __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_1, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 261, __pyx_L1_error)
4921 __Pyx_GOTREF(__pyx_t_10);
4922 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4923 __pyx_t_1 = PyTuple_New(2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 261, __pyx_L1_error)
4924 __Pyx_GOTREF(__pyx_t_1);
4925 __Pyx_GIVEREF(__pyx_t_10);
4926 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10);
4927 __Pyx_INCREF(__pyx_v_di);
4928 __Pyx_GIVEREF(__pyx_v_di);
4929 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_di);
4931 __pyx_t_10 = PyUnicode_Format(__pyx_kp_u_Perturbing_GRID_i_by_s_to_define, __pyx_t_1);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 261, __pyx_L1_error)
4932 __Pyx_GOTREF(__pyx_t_10);
4933 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4934 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_10);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 261, __pyx_L1_error)
4935 __Pyx_GOTREF(__pyx_t_1);
4936 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4937 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4944 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_bushing, __pyx_n_s_cid_ref);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 264, __pyx_L1_error)
4945 __Pyx_GOTREF(__pyx_t_10);
4946 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_j);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 264, __pyx_L1_error)
4947 __Pyx_GOTREF(__pyx_t_2);
4948 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4949 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_tolist);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 264, __pyx_L1_error)
4950 __Pyx_GOTREF(__pyx_t_10);
4951 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4953 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
4954 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_10);
4955 if (likely(__pyx_t_2)) {
4956 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_10);
4957 __Pyx_INCREF(__pyx_t_2);
4958 __Pyx_INCREF(
function);
4959 __Pyx_DECREF_SET(__pyx_t_10,
function);
4962 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_10);
4963 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4964 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 264, __pyx_L1_error)
4965 __Pyx_GOTREF(__pyx_t_1);
4966 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4967 if (__Pyx_PyObject_SetAttrStr(__pyx_v_bushing, __pyx_n_s_x, __pyx_t_1) < 0) __PYX_ERR(1, 264, __pyx_L1_error)
4968 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4989 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4992 __Pyx_XDECREF(__pyx_t_1);
4993 __Pyx_XDECREF(__pyx_t_2);
4994 __Pyx_XDECREF(__pyx_t_3);
4995 __Pyx_XDECREF(__pyx_t_9);
4996 __Pyx_XDECREF(__pyx_t_10);
4997 __Pyx_AddTraceback(
"pynastran_io.perturbZeroLengthBushings", __pyx_clineno, __pyx_lineno, __pyx_filename);
5000 __Pyx_XDECREF(__pyx_v_data);
5001 __Pyx_XDECREF(__pyx_v_eids);
5002 __Pyx_XDECREF(__pyx_v_eid);
5003 __Pyx_XDECREF(__pyx_v_bushing);
5004 __Pyx_XDECREF(__pyx_v_i);
5005 __Pyx_XDECREF(__pyx_v_di);
5006 __Pyx_XDECREF(__pyx_v_absmindi);
5007 __Pyx_XGIVEREF(__pyx_r);
5008 __Pyx_RefNannyFinishContext();
5021 static CYTHON_UNUSED
int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
5022 static CYTHON_UNUSED
int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
5024 __Pyx_RefNannyDeclarations
5025 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
5026 __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
5029 __Pyx_RefNannyFinishContext();
5033 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
5036 int __pyx_v_endian_detector;
5037 int __pyx_v_little_endian;
5040 PyArray_Descr *__pyx_v_descr = 0;
5043 __Pyx_RefNannyDeclarations
5046 PyObject *__pyx_t_3 = NULL;
5050 PyArray_Descr *__pyx_t_7;
5051 PyObject *__pyx_t_8 = NULL;
5053 if (__pyx_v_info == NULL) {
5054 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
5057 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
5058 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
5059 __Pyx_GIVEREF(__pyx_v_info->obj);
5068 __pyx_v_endian_detector = 1;
5077 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
5086 __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
5095 __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
5098 __pyx_t_1 = __pyx_t_2;
5099 goto __pyx_L4_bool_binop_done;
5109 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
5110 __pyx_t_1 = __pyx_t_2;
5111 __pyx_L4_bool_binop_done:;
5120 if (unlikely(__pyx_t_1)) {
5129 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 272, __pyx_L1_error)
5130 __Pyx_GOTREF(__pyx_t_3);
5131 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5132 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5133 __PYX_ERR(2, 272, __pyx_L1_error)
5151 __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
5154 __pyx_t_1 = __pyx_t_2;
5155 goto __pyx_L7_bool_binop_done;
5165 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
5166 __pyx_t_1 = __pyx_t_2;
5167 __pyx_L7_bool_binop_done:;
5176 if (unlikely(__pyx_t_1)) {
5185 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 276, __pyx_L1_error)
5186 __Pyx_GOTREF(__pyx_t_3);
5187 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5188 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5189 __PYX_ERR(2, 276, __pyx_L1_error)
5207 __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
5216 __pyx_v_info->ndim = __pyx_v_ndim;
5225 __pyx_t_1 = (((
sizeof(npy_intp)) != (
sizeof(Py_ssize_t))) != 0);
5235 __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
5244 __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
5253 __pyx_t_4 = __pyx_v_ndim;
5254 __pyx_t_5 = __pyx_t_4;
5255 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
5256 __pyx_v_i = __pyx_t_6;
5265 (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
5274 (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
5295 __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
5304 __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
5315 __pyx_v_info->suboffsets = NULL;
5324 __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
5333 __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
5351 __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
5352 __pyx_t_3 = ((PyObject *)__pyx_t_7);
5353 __Pyx_INCREF(__pyx_t_3);
5354 __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
5364 __Pyx_INCREF(((PyObject *)__pyx_v_self));
5365 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
5366 __Pyx_GOTREF(__pyx_v_info->obj);
5367 __Pyx_DECREF(__pyx_v_info->obj);
5368 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
5377 __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
5387 __pyx_t_4 = __pyx_v_descr->type_num;
5388 __pyx_v_t = __pyx_t_4;
5397 __pyx_t_2 = ((__pyx_v_descr->byteorder ==
'>') != 0);
5399 goto __pyx_L15_next_or;
5402 __pyx_t_2 = (__pyx_v_little_endian != 0);
5405 __pyx_t_1 = __pyx_t_2;
5406 goto __pyx_L14_bool_binop_done;
5417 __pyx_t_2 = ((__pyx_v_descr->byteorder ==
'<') != 0);
5420 __pyx_t_1 = __pyx_t_2;
5421 goto __pyx_L14_bool_binop_done;
5423 __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
5424 __pyx_t_1 = __pyx_t_2;
5425 __pyx_L14_bool_binop_done:;
5434 if (unlikely(__pyx_t_1)) {
5443 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 306, __pyx_L1_error)
5444 __Pyx_GOTREF(__pyx_t_3);
5445 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5446 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5447 __PYX_ERR(2, 306, __pyx_L1_error)
5465 switch (__pyx_v_t) {
5467 __pyx_v_f = ((
char *)
"b");
5478 __pyx_v_f = ((
char *)
"B");
5489 __pyx_v_f = ((
char *)
"h");
5500 __pyx_v_f = ((
char *)
"H");
5511 __pyx_v_f = ((
char *)
"i");
5522 __pyx_v_f = ((
char *)
"I");
5533 __pyx_v_f = ((
char *)
"l");
5544 __pyx_v_f = ((
char *)
"L");
5555 __pyx_v_f = ((
char *)
"q");
5566 __pyx_v_f = ((
char *)
"Q");
5577 __pyx_v_f = ((
char *)
"f");
5588 __pyx_v_f = ((
char *)
"d");
5590 case NPY_LONGDOUBLE:
5599 __pyx_v_f = ((
char *)
"g");
5610 __pyx_v_f = ((
char *)
"Zf");
5621 __pyx_v_f = ((
char *)
"Zd");
5623 case NPY_CLONGDOUBLE:
5632 __pyx_v_f = ((
char *)
"Zg");
5643 __pyx_v_f = ((
char *)
"O");
5654 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 325, __pyx_L1_error)
5655 __Pyx_GOTREF(__pyx_t_3);
5656 __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 325, __pyx_L1_error)
5657 __Pyx_GOTREF(__pyx_t_8);
5658 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5659 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 325, __pyx_L1_error)
5660 __Pyx_GOTREF(__pyx_t_3);
5661 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5662 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5663 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5664 __PYX_ERR(2, 325, __pyx_L1_error)
5675 __pyx_v_info->format = __pyx_v_f;
5704 __pyx_v_info->format = ((
char *)PyObject_Malloc(0xFF));
5713 (__pyx_v_info->format[0]) =
'^';
5731 __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset));
if (unlikely(__pyx_t_9 == ((
char *)NULL))) __PYX_ERR(2, 332, __pyx_L1_error)
5732 __pyx_v_f = __pyx_t_9;
5741 (__pyx_v_f[0]) =
'\x00';
5756 __Pyx_XDECREF(__pyx_t_3);
5757 __Pyx_XDECREF(__pyx_t_8);
5758 __Pyx_AddTraceback(
"numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5760 if (__pyx_v_info->obj != NULL) {
5761 __Pyx_GOTREF(__pyx_v_info->obj);
5762 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5766 if (__pyx_v_info->obj == Py_None) {
5767 __Pyx_GOTREF(__pyx_v_info->obj);
5768 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5771 __Pyx_XDECREF((PyObject *)__pyx_v_descr);
5772 __Pyx_RefNannyFinishContext();
5785 static CYTHON_UNUSED
void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info);
5786 static CYTHON_UNUSED
void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
5787 __Pyx_RefNannyDeclarations
5788 __Pyx_RefNannySetupContext(
"__releasebuffer__ (wrapper)", 0);
5789 __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
5792 __Pyx_RefNannyFinishContext();
5795 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
5796 __Pyx_RefNannyDeclarations
5798 __Pyx_RefNannySetupContext(
"__releasebuffer__", 0);
5807 __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
5817 PyObject_Free(__pyx_v_info->format);
5835 __pyx_t_1 = (((
sizeof(npy_intp)) != (
sizeof(Py_ssize_t))) != 0);
5845 PyObject_Free(__pyx_v_info->strides);
5865 __Pyx_RefNannyFinishContext();
5876 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
5877 PyObject *__pyx_r = NULL;
5878 __Pyx_RefNannyDeclarations
5879 PyObject *__pyx_t_1 = NULL;
5880 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
5889 __Pyx_XDECREF(__pyx_r);
5890 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 822, __pyx_L1_error)
5891 __Pyx_GOTREF(__pyx_t_1);
5892 __pyx_r = __pyx_t_1;
5906 __Pyx_XDECREF(__pyx_t_1);
5907 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
5910 __Pyx_XGIVEREF(__pyx_r);
5911 __Pyx_RefNannyFinishContext();
5923 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
5924 PyObject *__pyx_r = NULL;
5925 __Pyx_RefNannyDeclarations
5926 PyObject *__pyx_t_1 = NULL;
5927 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
5936 __Pyx_XDECREF(__pyx_r);
5937 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 825, __pyx_L1_error)
5938 __Pyx_GOTREF(__pyx_t_1);
5939 __pyx_r = __pyx_t_1;
5953 __Pyx_XDECREF(__pyx_t_1);
5954 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
5957 __Pyx_XGIVEREF(__pyx_r);
5958 __Pyx_RefNannyFinishContext();
5970 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
5971 PyObject *__pyx_r = NULL;
5972 __Pyx_RefNannyDeclarations
5973 PyObject *__pyx_t_1 = NULL;
5974 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
5983 __Pyx_XDECREF(__pyx_r);
5984 __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, 828, __pyx_L1_error)
5985 __Pyx_GOTREF(__pyx_t_1);
5986 __pyx_r = __pyx_t_1;
6000 __Pyx_XDECREF(__pyx_t_1);
6001 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
6004 __Pyx_XGIVEREF(__pyx_r);
6005 __Pyx_RefNannyFinishContext();
6017 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
6018 PyObject *__pyx_r = NULL;
6019 __Pyx_RefNannyDeclarations
6020 PyObject *__pyx_t_1 = NULL;
6021 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
6030 __Pyx_XDECREF(__pyx_r);
6031 __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, 831, __pyx_L1_error)
6032 __Pyx_GOTREF(__pyx_t_1);
6033 __pyx_r = __pyx_t_1;
6047 __Pyx_XDECREF(__pyx_t_1);
6048 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
6051 __Pyx_XGIVEREF(__pyx_r);
6052 __Pyx_RefNannyFinishContext();
6064 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
6065 PyObject *__pyx_r = NULL;
6066 __Pyx_RefNannyDeclarations
6067 PyObject *__pyx_t_1 = NULL;
6068 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
6077 __Pyx_XDECREF(__pyx_r);
6078 __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, 834, __pyx_L1_error)
6079 __Pyx_GOTREF(__pyx_t_1);
6080 __pyx_r = __pyx_t_1;
6094 __Pyx_XDECREF(__pyx_t_1);
6095 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
6098 __Pyx_XGIVEREF(__pyx_r);
6099 __Pyx_RefNannyFinishContext();
6111 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
6112 PyObject *__pyx_r = NULL;
6113 __Pyx_RefNannyDeclarations
6115 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
6124 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
6134 __Pyx_XDECREF(__pyx_r);
6135 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
6136 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
6156 __Pyx_XDECREF(__pyx_r);
6157 __Pyx_INCREF(__pyx_empty_tuple);
6158 __pyx_r = __pyx_empty_tuple;
6172 __Pyx_XGIVEREF(__pyx_r);
6173 __Pyx_RefNannyFinishContext();
6185 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr,
char *__pyx_v_f,
char *__pyx_v_end,
int *__pyx_v_offset) {
6186 PyArray_Descr *__pyx_v_child = 0;
6187 int __pyx_v_endian_detector;
6188 int __pyx_v_little_endian;
6189 PyObject *__pyx_v_fields = 0;
6190 PyObject *__pyx_v_childname = NULL;
6191 PyObject *__pyx_v_new_offset = NULL;
6192 PyObject *__pyx_v_t = NULL;
6194 __Pyx_RefNannyDeclarations
6195 PyObject *__pyx_t_1 = NULL;
6196 Py_ssize_t __pyx_t_2;
6197 PyObject *__pyx_t_3 = NULL;
6198 PyObject *__pyx_t_4 = NULL;
6204 __Pyx_RefNannySetupContext(
"_util_dtypestring", 0);
6213 __pyx_v_endian_detector = 1;
6222 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
6231 if (unlikely(__pyx_v_descr->names == Py_None)) {
6232 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
6233 __PYX_ERR(2, 851, __pyx_L1_error)
6235 __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
6237 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
6238 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 6239 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++;
if (unlikely(0 < 0)) __PYX_ERR(2, 851, __pyx_L1_error)
6241 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 851, __pyx_L1_error)
6242 __Pyx_GOTREF(__pyx_t_3);
6244 __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
6254 if (unlikely(__pyx_v_descr->fields == Py_None)) {
6255 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6256 __PYX_ERR(2, 852, __pyx_L1_error)
6258 __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 852, __pyx_L1_error)
6259 __Pyx_GOTREF(__pyx_t_3);
6260 if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 852, __pyx_L1_error)
6261 __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
6271 if (likely(__pyx_v_fields != Py_None)) {
6272 PyObject* sequence = __pyx_v_fields;
6273 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
6274 if (unlikely(size != 2)) {
6275 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
6276 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
6277 __PYX_ERR(2, 853, __pyx_L1_error)
6279 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 6280 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
6281 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
6282 __Pyx_INCREF(__pyx_t_3);
6283 __Pyx_INCREF(__pyx_t_4);
6285 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 853, __pyx_L1_error)
6286 __Pyx_GOTREF(__pyx_t_3);
6287 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 853, __pyx_L1_error)
6288 __Pyx_GOTREF(__pyx_t_4);
6291 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 853, __pyx_L1_error)
6293 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 853, __pyx_L1_error)
6294 __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
6296 __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
6306 __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 855, __pyx_L1_error)
6307 __Pyx_GOTREF(__pyx_t_4);
6308 __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 855, __pyx_L1_error)
6309 __Pyx_GOTREF(__pyx_t_3);
6310 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6311 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(2, 855, __pyx_L1_error)
6312 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6313 __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((
int)__pyx_t_5)) < 15) != 0);
6314 if (unlikely(__pyx_t_6)) {
6323 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__10, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 856, __pyx_L1_error)
6324 __Pyx_GOTREF(__pyx_t_3);
6325 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6326 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6327 __PYX_ERR(2, 856, __pyx_L1_error)
6345 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'>') != 0);
6347 goto __pyx_L8_next_or;
6350 __pyx_t_7 = (__pyx_v_little_endian != 0);
6353 __pyx_t_6 = __pyx_t_7;
6354 goto __pyx_L7_bool_binop_done;
6365 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'<') != 0);
6368 __pyx_t_6 = __pyx_t_7;
6369 goto __pyx_L7_bool_binop_done;
6371 __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
6372 __pyx_t_6 = __pyx_t_7;
6373 __pyx_L7_bool_binop_done:;
6382 if (unlikely(__pyx_t_6)) {
6391 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 860, __pyx_L1_error)
6392 __Pyx_GOTREF(__pyx_t_3);
6393 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6394 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6395 __PYX_ERR(2, 860, __pyx_L1_error)
6414 __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 870, __pyx_L1_error)
6415 __Pyx_GOTREF(__pyx_t_3);
6416 __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 870, __pyx_L1_error)
6417 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6418 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 870, __pyx_L1_error)
6419 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6420 if (!__pyx_t_6)
break;
6429 (__pyx_v_f[0]) = 0x78;
6438 __pyx_v_f = (__pyx_v_f + 1);
6448 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
6459 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
6468 __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
6478 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 878, __pyx_L1_error)
6479 __Pyx_GOTREF(__pyx_t_4);
6480 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
6490 __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
6491 if (unlikely(__pyx_t_6)) {
6500 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 880, __pyx_L1_error)
6501 __Pyx_GOTREF(__pyx_t_4);
6502 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
6503 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6504 __PYX_ERR(2, 880, __pyx_L1_error)
6522 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 883, __pyx_L1_error)
6523 __Pyx_GOTREF(__pyx_t_4);
6524 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 883, __pyx_L1_error)
6525 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6526 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 883, __pyx_L1_error)
6527 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6529 (__pyx_v_f[0]) = 98;
6540 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 884, __pyx_L1_error)
6541 __Pyx_GOTREF(__pyx_t_3);
6542 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 884, __pyx_L1_error)
6543 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6544 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 884, __pyx_L1_error)
6545 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6547 (__pyx_v_f[0]) = 66;
6558 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 885, __pyx_L1_error)
6559 __Pyx_GOTREF(__pyx_t_4);
6560 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 885, __pyx_L1_error)
6561 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6562 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 885, __pyx_L1_error)
6563 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6565 (__pyx_v_f[0]) = 0x68;
6576 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 886, __pyx_L1_error)
6577 __Pyx_GOTREF(__pyx_t_3);
6578 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 886, __pyx_L1_error)
6579 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6580 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 886, __pyx_L1_error)
6581 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6583 (__pyx_v_f[0]) = 72;
6594 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 887, __pyx_L1_error)
6595 __Pyx_GOTREF(__pyx_t_4);
6596 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 887, __pyx_L1_error)
6597 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6598 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 887, __pyx_L1_error)
6599 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6601 (__pyx_v_f[0]) = 0x69;
6612 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 888, __pyx_L1_error)
6613 __Pyx_GOTREF(__pyx_t_3);
6614 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 888, __pyx_L1_error)
6615 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6616 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 888, __pyx_L1_error)
6617 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6619 (__pyx_v_f[0]) = 73;
6630 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 889, __pyx_L1_error)
6631 __Pyx_GOTREF(__pyx_t_4);
6632 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 889, __pyx_L1_error)
6633 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6634 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 889, __pyx_L1_error)
6635 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6637 (__pyx_v_f[0]) = 0x6C;
6648 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 890, __pyx_L1_error)
6649 __Pyx_GOTREF(__pyx_t_3);
6650 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 890, __pyx_L1_error)
6651 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6652 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 890, __pyx_L1_error)
6653 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6655 (__pyx_v_f[0]) = 76;
6666 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 891, __pyx_L1_error)
6667 __Pyx_GOTREF(__pyx_t_4);
6668 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 891, __pyx_L1_error)
6669 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6670 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 891, __pyx_L1_error)
6671 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6673 (__pyx_v_f[0]) = 0x71;
6684 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 892, __pyx_L1_error)
6685 __Pyx_GOTREF(__pyx_t_3);
6686 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 892, __pyx_L1_error)
6687 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6688 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 892, __pyx_L1_error)
6689 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6691 (__pyx_v_f[0]) = 81;
6702 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 893, __pyx_L1_error)
6703 __Pyx_GOTREF(__pyx_t_4);
6704 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 893, __pyx_L1_error)
6705 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6706 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 893, __pyx_L1_error)
6707 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6709 (__pyx_v_f[0]) = 0x66;
6720 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 894, __pyx_L1_error)
6721 __Pyx_GOTREF(__pyx_t_3);
6722 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 894, __pyx_L1_error)
6723 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6724 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 894, __pyx_L1_error)
6725 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6727 (__pyx_v_f[0]) = 0x64;
6738 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 895, __pyx_L1_error)
6739 __Pyx_GOTREF(__pyx_t_4);
6740 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 895, __pyx_L1_error)
6741 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6742 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 895, __pyx_L1_error)
6743 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6745 (__pyx_v_f[0]) = 0x67;
6756 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 896, __pyx_L1_error)
6757 __Pyx_GOTREF(__pyx_t_3);
6758 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 896, __pyx_L1_error)
6759 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6760 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 896, __pyx_L1_error)
6761 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6763 (__pyx_v_f[0]) = 90;
6764 (__pyx_v_f[1]) = 0x66;
6765 __pyx_v_f = (__pyx_v_f + 1);
6776 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 897, __pyx_L1_error)
6777 __Pyx_GOTREF(__pyx_t_4);
6778 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 897, __pyx_L1_error)
6779 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6780 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 897, __pyx_L1_error)
6781 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6783 (__pyx_v_f[0]) = 90;
6784 (__pyx_v_f[1]) = 0x64;
6785 __pyx_v_f = (__pyx_v_f + 1);
6796 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 898, __pyx_L1_error)
6797 __Pyx_GOTREF(__pyx_t_3);
6798 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 898, __pyx_L1_error)
6799 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6800 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 898, __pyx_L1_error)
6801 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6803 (__pyx_v_f[0]) = 90;
6804 (__pyx_v_f[1]) = 0x67;
6805 __pyx_v_f = (__pyx_v_f + 1);
6816 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 899, __pyx_L1_error)
6817 __Pyx_GOTREF(__pyx_t_4);
6818 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 899, __pyx_L1_error)
6819 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6820 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 899, __pyx_L1_error)
6821 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6822 if (likely(__pyx_t_6)) {
6823 (__pyx_v_f[0]) = 79;
6835 __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t);
if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 901, __pyx_L1_error)
6836 __Pyx_GOTREF(__pyx_t_3);
6837 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 901, __pyx_L1_error)
6838 __Pyx_GOTREF(__pyx_t_4);
6839 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6840 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
6841 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6842 __PYX_ERR(2, 901, __pyx_L1_error)
6853 __pyx_v_f = (__pyx_v_f + 1);
6873 __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset);
if (unlikely(__pyx_t_9 == ((
char *)NULL))) __PYX_ERR(2, 906, __pyx_L1_error)
6874 __pyx_v_f = __pyx_t_9;
6886 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6895 __pyx_r = __pyx_v_f;
6908 __Pyx_XDECREF(__pyx_t_1);
6909 __Pyx_XDECREF(__pyx_t_3);
6910 __Pyx_XDECREF(__pyx_t_4);
6911 __Pyx_AddTraceback(
"numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
6914 __Pyx_XDECREF((PyObject *)__pyx_v_child);
6915 __Pyx_XDECREF(__pyx_v_fields);
6916 __Pyx_XDECREF(__pyx_v_childname);
6917 __Pyx_XDECREF(__pyx_v_new_offset);
6918 __Pyx_XDECREF(__pyx_v_t);
6919 __Pyx_RefNannyFinishContext();
6931 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
6932 __Pyx_RefNannyDeclarations
6933 __Pyx_RefNannySetupContext(
"set_array_base", 0);
6942 Py_INCREF(__pyx_v_base);
6951 (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
6962 __Pyx_RefNannyFinishContext();
6973 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
6974 PyObject *__pyx_v_base;
6975 PyObject *__pyx_r = NULL;
6976 __Pyx_RefNannyDeclarations
6978 __Pyx_RefNannySetupContext(
"get_array_base", 0);
6987 __pyx_v_base = PyArray_BASE(__pyx_v_arr);
6996 __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
7006 __Pyx_XDECREF(__pyx_r);
7007 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7026 __Pyx_XDECREF(__pyx_r);
7027 __Pyx_INCREF(((PyObject *)__pyx_v_base));
7028 __pyx_r = ((PyObject *)__pyx_v_base);
7041 __Pyx_XGIVEREF(__pyx_r);
7042 __Pyx_RefNannyFinishContext();
7054 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
7056 __Pyx_RefNannyDeclarations
7057 PyObject *__pyx_t_1 = NULL;
7058 PyObject *__pyx_t_2 = NULL;
7059 PyObject *__pyx_t_3 = NULL;
7061 PyObject *__pyx_t_5 = NULL;
7062 PyObject *__pyx_t_6 = NULL;
7063 PyObject *__pyx_t_7 = NULL;
7064 PyObject *__pyx_t_8 = NULL;
7065 __Pyx_RefNannySetupContext(
"import_array", 0);
7075 __Pyx_PyThreadState_declare
7076 __Pyx_PyThreadState_assign
7077 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7078 __Pyx_XGOTREF(__pyx_t_1);
7079 __Pyx_XGOTREF(__pyx_t_2);
7080 __Pyx_XGOTREF(__pyx_t_3);
7090 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 1036, __pyx_L3_error)
7100 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7101 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7102 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7103 goto __pyx_L8_try_end;
7113 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7115 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7116 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1037, __pyx_L5_except_error)
7117 __Pyx_GOTREF(__pyx_t_5);
7118 __Pyx_GOTREF(__pyx_t_6);
7119 __Pyx_GOTREF(__pyx_t_7);
7128 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__12, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1038, __pyx_L5_except_error)
7129 __Pyx_GOTREF(__pyx_t_8);
7130 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7131 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7132 __PYX_ERR(2, 1038, __pyx_L5_except_error)
7134 goto __pyx_L5_except_error;
7135 __pyx_L5_except_error:;
7144 __Pyx_XGIVEREF(__pyx_t_1);
7145 __Pyx_XGIVEREF(__pyx_t_2);
7146 __Pyx_XGIVEREF(__pyx_t_3);
7147 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7148 goto __pyx_L1_error;
7164 __Pyx_XDECREF(__pyx_t_5);
7165 __Pyx_XDECREF(__pyx_t_6);
7166 __Pyx_XDECREF(__pyx_t_7);
7167 __Pyx_XDECREF(__pyx_t_8);
7168 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7171 __Pyx_RefNannyFinishContext();
7183 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
7185 __Pyx_RefNannyDeclarations
7186 PyObject *__pyx_t_1 = NULL;
7187 PyObject *__pyx_t_2 = NULL;
7188 PyObject *__pyx_t_3 = NULL;
7190 PyObject *__pyx_t_5 = NULL;
7191 PyObject *__pyx_t_6 = NULL;
7192 PyObject *__pyx_t_7 = NULL;
7193 PyObject *__pyx_t_8 = NULL;
7194 __Pyx_RefNannySetupContext(
"import_umath", 0);
7204 __Pyx_PyThreadState_declare
7205 __Pyx_PyThreadState_assign
7206 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7207 __Pyx_XGOTREF(__pyx_t_1);
7208 __Pyx_XGOTREF(__pyx_t_2);
7209 __Pyx_XGOTREF(__pyx_t_3);
7219 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 1042, __pyx_L3_error)
7229 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7230 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7231 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7232 goto __pyx_L8_try_end;
7242 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7244 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7245 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1043, __pyx_L5_except_error)
7246 __Pyx_GOTREF(__pyx_t_5);
7247 __Pyx_GOTREF(__pyx_t_6);
7248 __Pyx_GOTREF(__pyx_t_7);
7257 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__13, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1044, __pyx_L5_except_error)
7258 __Pyx_GOTREF(__pyx_t_8);
7259 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7260 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7261 __PYX_ERR(2, 1044, __pyx_L5_except_error)
7263 goto __pyx_L5_except_error;
7264 __pyx_L5_except_error:;
7273 __Pyx_XGIVEREF(__pyx_t_1);
7274 __Pyx_XGIVEREF(__pyx_t_2);
7275 __Pyx_XGIVEREF(__pyx_t_3);
7276 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7277 goto __pyx_L1_error;
7293 __Pyx_XDECREF(__pyx_t_5);
7294 __Pyx_XDECREF(__pyx_t_6);
7295 __Pyx_XDECREF(__pyx_t_7);
7296 __Pyx_XDECREF(__pyx_t_8);
7297 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7300 __Pyx_RefNannyFinishContext();
7312 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
7314 __Pyx_RefNannyDeclarations
7315 PyObject *__pyx_t_1 = NULL;
7316 PyObject *__pyx_t_2 = NULL;
7317 PyObject *__pyx_t_3 = NULL;
7319 PyObject *__pyx_t_5 = NULL;
7320 PyObject *__pyx_t_6 = NULL;
7321 PyObject *__pyx_t_7 = NULL;
7322 PyObject *__pyx_t_8 = NULL;
7323 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
7333 __Pyx_PyThreadState_declare
7334 __Pyx_PyThreadState_assign
7335 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7336 __Pyx_XGOTREF(__pyx_t_1);
7337 __Pyx_XGOTREF(__pyx_t_2);
7338 __Pyx_XGOTREF(__pyx_t_3);
7348 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(2, 1048, __pyx_L3_error)
7358 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7359 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7360 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7361 goto __pyx_L8_try_end;
7370 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7372 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
7373 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1049, __pyx_L5_except_error)
7374 __Pyx_GOTREF(__pyx_t_5);
7375 __Pyx_GOTREF(__pyx_t_6);
7376 __Pyx_GOTREF(__pyx_t_7);
7383 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__13, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1050, __pyx_L5_except_error)
7384 __Pyx_GOTREF(__pyx_t_8);
7385 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7386 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7387 __PYX_ERR(2, 1050, __pyx_L5_except_error)
7389 goto __pyx_L5_except_error;
7390 __pyx_L5_except_error:;
7399 __Pyx_XGIVEREF(__pyx_t_1);
7400 __Pyx_XGIVEREF(__pyx_t_2);
7401 __Pyx_XGIVEREF(__pyx_t_3);
7402 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7403 goto __pyx_L1_error;
7419 __Pyx_XDECREF(__pyx_t_5);
7420 __Pyx_XDECREF(__pyx_t_6);
7421 __Pyx_XDECREF(__pyx_t_7);
7422 __Pyx_XDECREF(__pyx_t_8);
7423 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
7426 __Pyx_RefNannyFinishContext();
7438 static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v_o) {
7439 Py_ssize_t __pyx_v_length;
7440 char const *__pyx_v_data;
7441 std::string __pyx_r;
7442 __Pyx_RefNannyDeclarations
7443 char const *__pyx_t_1;
7444 __Pyx_RefNannySetupContext(
"__pyx_convert_string_from_py_std__in_string", 0);
7453 __pyx_t_1 = __Pyx_PyObject_AsStringAndSize(__pyx_v_o, (&__pyx_v_length));
if (unlikely(__pyx_t_1 == ((
char const *)NULL))) __PYX_ERR(0, 15, __pyx_L1_error)
7454 __pyx_v_data = __pyx_t_1;
7463 __pyx_r = std::string(__pyx_v_data, __pyx_v_length);
7476 __Pyx_AddTraceback(
"string.from_py.__pyx_convert_string_from_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
7477 __Pyx_pretend_to_initialize(&__pyx_r);
7479 __Pyx_RefNannyFinishContext();
7491 static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string
const &__pyx_v_s) {
7492 PyObject *__pyx_r = NULL;
7493 __Pyx_RefNannyDeclarations
7494 PyObject *__pyx_t_1 = NULL;
7495 __Pyx_RefNannySetupContext(
"__pyx_convert_PyObject_string_to_py_std__in_string", 0);
7504 __Pyx_XDECREF(__pyx_r);
7505 __pyx_t_1 = __Pyx_PyObject_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
7506 __Pyx_GOTREF(__pyx_t_1);
7507 __pyx_r = __pyx_t_1;
7521 __Pyx_XDECREF(__pyx_t_1);
7522 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyObject_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
7525 __Pyx_XGIVEREF(__pyx_r);
7526 __Pyx_RefNannyFinishContext();
7538 static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string
const &__pyx_v_s) {
7539 PyObject *__pyx_r = NULL;
7540 __Pyx_RefNannyDeclarations
7541 PyObject *__pyx_t_1 = NULL;
7542 __Pyx_RefNannySetupContext(
"__pyx_convert_PyUnicode_string_to_py_std__in_string", 0);
7551 __Pyx_XDECREF(__pyx_r);
7552 __pyx_t_1 = __Pyx_PyUnicode_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
7553 __Pyx_GOTREF(__pyx_t_1);
7554 __pyx_r = __pyx_t_1;
7568 __Pyx_XDECREF(__pyx_t_1);
7569 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyUnicode_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
7572 __Pyx_XGIVEREF(__pyx_r);
7573 __Pyx_RefNannyFinishContext();
7585 static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string
const &__pyx_v_s) {
7586 PyObject *__pyx_r = NULL;
7587 __Pyx_RefNannyDeclarations
7588 PyObject *__pyx_t_1 = NULL;
7589 __Pyx_RefNannySetupContext(
"__pyx_convert_PyStr_string_to_py_std__in_string", 0);
7598 __Pyx_XDECREF(__pyx_r);
7599 __pyx_t_1 = __Pyx_PyStr_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
7600 __Pyx_GOTREF(__pyx_t_1);
7601 __pyx_r = __pyx_t_1;
7615 __Pyx_XDECREF(__pyx_t_1);
7616 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyStr_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
7619 __Pyx_XGIVEREF(__pyx_r);
7620 __Pyx_RefNannyFinishContext();
7632 static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string
const &__pyx_v_s) {
7633 PyObject *__pyx_r = NULL;
7634 __Pyx_RefNannyDeclarations
7635 PyObject *__pyx_t_1 = NULL;
7636 __Pyx_RefNannySetupContext(
"__pyx_convert_PyBytes_string_to_py_std__in_string", 0);
7645 __Pyx_XDECREF(__pyx_r);
7646 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error)
7647 __Pyx_GOTREF(__pyx_t_1);
7648 __pyx_r = __pyx_t_1;
7662 __Pyx_XDECREF(__pyx_t_1);
7663 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyBytes_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
7666 __Pyx_XGIVEREF(__pyx_r);
7667 __Pyx_RefNannyFinishContext();
7679 static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string
const &__pyx_v_s) {
7680 PyObject *__pyx_r = NULL;
7681 __Pyx_RefNannyDeclarations
7682 PyObject *__pyx_t_1 = NULL;
7683 __Pyx_RefNannySetupContext(
"__pyx_convert_PyByteArray_string_to_py_std__in_string", 0);
7691 __Pyx_XDECREF(__pyx_r);
7692 __pyx_t_1 = __Pyx_PyByteArray_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size());
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
7693 __Pyx_GOTREF(__pyx_t_1);
7694 __pyx_r = __pyx_t_1;
7708 __Pyx_XDECREF(__pyx_t_1);
7709 __Pyx_AddTraceback(
"string.to_py.__pyx_convert_PyByteArray_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
7712 __Pyx_XGIVEREF(__pyx_r);
7713 __Pyx_RefNannyFinishContext();
7725 static PyObject *__pyx_convert_map_to_py_std_3a__3a_string____int(std::map<std::string,int>
const &__pyx_v_s) {
7726 PyObject *__pyx_v_o = NULL;
7727 std::map<std::string,int> ::value_type
const *__pyx_v_key_value;
7728 std::map<std::string,int> ::const_iterator __pyx_v_iter;
7729 PyObject *__pyx_r = NULL;
7730 __Pyx_RefNannyDeclarations
7731 PyObject *__pyx_t_1 = NULL;
7733 PyObject *__pyx_t_3 = NULL;
7734 __Pyx_RefNannySetupContext(
"__pyx_convert_map_to_py_std_3a__3a_string____int", 0);
7743 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error)
7744 __Pyx_GOTREF(__pyx_t_1);
7745 __pyx_v_o = ((PyObject*)__pyx_t_1);
7755 __pyx_v_iter = __pyx_v_s.begin();
7765 __pyx_t_2 = ((__pyx_v_iter != __pyx_v_s.end()) != 0);
7766 if (!__pyx_t_2)
break;
7775 __pyx_v_key_value = (&(*__pyx_v_iter));
7784 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_key_value->second);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
7785 __Pyx_GOTREF(__pyx_t_1);
7786 __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_key_value->first);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error)
7787 __Pyx_GOTREF(__pyx_t_3);
7788 if (unlikely(PyDict_SetItem(__pyx_v_o, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(0, 207, __pyx_L1_error)
7789 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7790 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7799 (void)((++__pyx_v_iter));
7809 __Pyx_XDECREF(__pyx_r);
7810 __Pyx_INCREF(__pyx_v_o);
7811 __pyx_r = __pyx_v_o;
7824 __Pyx_XDECREF(__pyx_t_1);
7825 __Pyx_XDECREF(__pyx_t_3);
7826 __Pyx_AddTraceback(
"map.to_py.__pyx_convert_map_to_py_std_3a__3a_string____int", __pyx_clineno, __pyx_lineno, __pyx_filename);
7829 __Pyx_XDECREF(__pyx_v_o);
7830 __Pyx_XGIVEREF(__pyx_r);
7831 __Pyx_RefNannyFinishContext();
7843 static std::vector<int> __pyx_convert_vector_from_py_int(PyObject *__pyx_v_o) {
7844 std::vector<int> __pyx_v_v;
7845 PyObject *__pyx_v_item = NULL;
7846 std::vector<int> __pyx_r;
7847 __Pyx_RefNannyDeclarations
7848 PyObject *__pyx_t_1 = NULL;
7849 Py_ssize_t __pyx_t_2;
7850 PyObject *(*__pyx_t_3)(PyObject *);
7851 PyObject *__pyx_t_4 = NULL;
7853 __Pyx_RefNannySetupContext(
"__pyx_convert_vector_from_py_int", 0);
7862 if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
7863 __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
7866 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
7867 __Pyx_GOTREF(__pyx_t_1);
7868 __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L1_error)
7871 if (likely(!__pyx_t_3)) {
7872 if (likely(PyList_CheckExact(__pyx_t_1))) {
7873 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1))
break;
7874 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 7875 __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
if (unlikely(0 < 0)) __PYX_ERR(0, 47, __pyx_L1_error)
7877 __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 47, __pyx_L1_error)
7878 __Pyx_GOTREF(__pyx_t_4);
7881 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
7882 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 7883 __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
if (unlikely(0 < 0)) __PYX_ERR(0, 47, __pyx_L1_error)
7885 __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 47, __pyx_L1_error)
7886 __Pyx_GOTREF(__pyx_t_4);
7890 __pyx_t_4 = __pyx_t_3(__pyx_t_1);
7891 if (unlikely(!__pyx_t_4)) {
7892 PyObject* exc_type = PyErr_Occurred();
7894 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
7895 else __PYX_ERR(0, 47, __pyx_L1_error)
7899 __Pyx_GOTREF(__pyx_t_4);
7901 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
7911 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_item);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 48, __pyx_L1_error)
7912 __pyx_v_v.push_back(((
int)__pyx_t_5));
7922 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7931 __pyx_r = __pyx_v_v;
7944 __Pyx_XDECREF(__pyx_t_1);
7945 __Pyx_XDECREF(__pyx_t_4);
7946 __Pyx_AddTraceback(
"vector.from_py.__pyx_convert_vector_from_py_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
7947 __Pyx_pretend_to_initialize(&__pyx_r);
7949 __Pyx_XDECREF(__pyx_v_item);
7950 __Pyx_RefNannyFinishContext();
7954 static PyObject *__pyx_tp_new_12pynastran_io_BDFModel(PyTypeObject *t, PyObject *a, PyObject *k) {
7957 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
7958 o = (*t->tp_alloc)(t, 0);
7960 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
7962 if (unlikely(!o))
return 0;
7964 new((
void*)&(p->
bdfPath)) std::string();
7965 new((
void*)&(p->
nElemTypes)) std::map<std::string,int> ();
7966 p->
myBDF = Py_None; Py_INCREF(Py_None);
7967 if (unlikely(__pyx_pw_12pynastran_io_8BDFModel_1__cinit__(o, a, k) < 0))
goto bad;
7970 Py_DECREF(o); o = 0;
7974 static void __pyx_tp_dealloc_12pynastran_io_BDFModel(PyObject *o) {
7976 #if CYTHON_USE_TP_FINALIZE 7977 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
7978 if (PyObject_CallFinalizerFromDealloc(o))
return;
7981 PyObject_GC_UnTrack(o);
7982 __Pyx_call_destructor(p->
bdfPath);
7985 (*Py_TYPE(o)->tp_free)(o);
7988 static int __pyx_tp_traverse_12pynastran_io_BDFModel(PyObject *o, visitproc v,
void *a) {
7992 e = (*v)(p->
myBDF, a);
if (e)
return e;
7997 static int __pyx_tp_clear_12pynastran_io_BDFModel(PyObject *o) {
8000 tmp = ((PyObject*)p->
myBDF);
8001 p->
myBDF = Py_None; Py_INCREF(Py_None);
8006 static PyObject *__pyx_getprop_12pynastran_io_8BDFModel_nDims(PyObject *o, CYTHON_UNUSED
void *x) {
8007 return __pyx_pw_12pynastran_io_8BDFModel_5nDims_1__get__(o);
8010 static PyObject *__pyx_getprop_12pynastran_io_8BDFModel_nNodes(PyObject *o, CYTHON_UNUSED
void *x) {
8011 return __pyx_pw_12pynastran_io_8BDFModel_6nNodes_1__get__(o);
8014 static PyObject *__pyx_getprop_12pynastran_io_8BDFModel_nElems(PyObject *o, CYTHON_UNUSED
void *x) {
8015 return __pyx_pw_12pynastran_io_8BDFModel_6nElems_1__get__(o);
8018 static PyObject *__pyx_getprop_12pynastran_io_8BDFModel_nMaterials(PyObject *o, CYTHON_UNUSED
void *x) {
8019 return __pyx_pw_12pynastran_io_8BDFModel_10nMaterials_1__get__(o);
8022 static PyObject *__pyx_getprop_12pynastran_io_8BDFModel_nProperties(PyObject *o, CYTHON_UNUSED
void *x) {
8023 return __pyx_pw_12pynastran_io_8BDFModel_11nProperties_1__get__(o);
8026 static PyObject *__pyx_getprop_12pynastran_io_8BDFModel_nElemTypes(PyObject *o, CYTHON_UNUSED
void *x) {
8027 return __pyx_pw_12pynastran_io_8BDFModel_10nElemTypes_1__get__(o);
8030 static PyMethodDef __pyx_methods_12pynastran_io_BDFModel[] = {
8031 {
"__reduce_cython__", (PyCFunction)__pyx_pw_12pynastran_io_8BDFModel_3__reduce_cython__, METH_NOARGS, 0},
8032 {
"__setstate_cython__", (PyCFunction)__pyx_pw_12pynastran_io_8BDFModel_5__setstate_cython__, METH_O, 0},
8036 static struct PyGetSetDef __pyx_getsets_12pynastran_io_BDFModel[] = {
8037 {(
char *)
"nDims", __pyx_getprop_12pynastran_io_8BDFModel_nDims, 0, (
char *)0, 0},
8038 {(
char *)
"nNodes", __pyx_getprop_12pynastran_io_8BDFModel_nNodes, 0, (
char *)0, 0},
8039 {(
char *)
"nElems", __pyx_getprop_12pynastran_io_8BDFModel_nElems, 0, (
char *)0, 0},
8040 {(
char *)
"nMaterials", __pyx_getprop_12pynastran_io_8BDFModel_nMaterials, 0, (
char *)0, 0},
8041 {(
char *)
"nProperties", __pyx_getprop_12pynastran_io_8BDFModel_nProperties, 0, (
char *)0, 0},
8042 {(
char *)
"nElemTypes", __pyx_getprop_12pynastran_io_8BDFModel_nElemTypes, 0, (
char *)0, 0},
8046 DL_EXPORT(PyTypeObject) BDFModelType = {
8047 PyVarObject_HEAD_INIT(0, 0)
8048 "pynastran_io.BDFModel",
8051 __pyx_tp_dealloc_12pynastran_io_BDFModel,
8055 #if PY_MAJOR_VERSION < 3
8058 #if PY_MAJOR_VERSION >= 3
8071 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
8073 __pyx_tp_traverse_12pynastran_io_BDFModel,
8074 __pyx_tp_clear_12pynastran_io_BDFModel,
8079 __pyx_methods_12pynastran_io_BDFModel,
8081 __pyx_getsets_12pynastran_io_BDFModel,
8089 __pyx_tp_new_12pynastran_io_BDFModel,
8099 #if PY_VERSION_HEX >= 0x030400a1 8102 #if PY_VERSION_HEX >= 0x030800b1 8107 static PyMethodDef __pyx_methods[] = {
8111 #if PY_MAJOR_VERSION >= 3 8112 #if CYTHON_PEP489_MULTI_PHASE_INIT 8113 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
8114 static int __pyx_pymod_exec_pynastran_io(PyObject* module);
8115 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
8116 {Py_mod_create, (
void*)__pyx_pymod_create},
8117 {Py_mod_exec, (
void*)__pyx_pymod_exec_pynastran_io},
8122 static struct PyModuleDef __pyx_moduledef = {
8123 PyModuleDef_HEAD_INIT,
8125 __pyx_k_pyNASTRAN_Notes_Dependencies_cp,
8126 #if CYTHON_PEP489_MULTI_PHASE_INIT 8132 #if CYTHON_PEP489_MULTI_PHASE_INIT 8133 __pyx_moduledef_slots,
8142 #ifndef CYTHON_SMALL_CODE 8143 #if defined(__clang__) 8144 #define CYTHON_SMALL_CODE 8145 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) 8146 #define CYTHON_SMALL_CODE __attribute__((cold)) 8148 #define CYTHON_SMALL_CODE 8152 static __Pyx_StringTabEntry __pyx_string_tab[] = {
8153 {&__pyx_n_s_BDF, __pyx_k_BDF,
sizeof(__pyx_k_BDF), 0, 0, 1, 1},
8154 {&__pyx_n_s_BDFModel, __pyx_k_BDFModel,
sizeof(__pyx_k_BDFModel), 0, 0, 1, 1},
8155 {&__pyx_n_u_CBUSH, __pyx_k_CBUSH,
sizeof(__pyx_k_CBUSH), 0, 1, 0, 1},
8156 {&__pyx_n_u_CBUSH1D, __pyx_k_CBUSH1D,
sizeof(__pyx_k_CBUSH1D), 0, 1, 0, 1},
8157 {&__pyx_n_u_CBUSH2D, __pyx_k_CBUSH2D,
sizeof(__pyx_k_CBUSH2D), 0, 1, 0, 1},
8158 {&__pyx_n_s_DTYPE, __pyx_k_DTYPE,
sizeof(__pyx_k_DTYPE), 0, 0, 1, 1},
8159 {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor,
sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
8160 {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2,
sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
8161 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
8162 {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor,
sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
8163 {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError,
sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
8164 {&__pyx_kp_u_Perturbing_GRID_i_by_s_to_define, __pyx_k_Perturbing_GRID_i_by_s_to_define,
sizeof(__pyx_k_Perturbing_GRID_i_by_s_to_define), 0, 1, 0, 0},
8165 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
8166 {&__pyx_kp_u_Subcase_i__s__i, __pyx_k_Subcase_i__s__i,
sizeof(__pyx_k_Subcase_i__s__i), 0, 1, 0, 0},
8167 {&__pyx_kp_u_Support_of_non_zero_offets_not_y, __pyx_k_Support_of_non_zero_offets_not_y,
sizeof(__pyx_k_Support_of_non_zero_offets_not_y), 0, 1, 0, 0},
8168 {&__pyx_kp_u_Support_of_non_zero_offsets_not, __pyx_k_Support_of_non_zero_offsets_not,
sizeof(__pyx_k_Support_of_non_zero_offsets_not), 0, 1, 0, 0},
8169 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
8170 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
8171 {&__pyx_n_u__3, __pyx_k__3,
sizeof(__pyx_k__3), 0, 1, 0, 1},
8172 {&__pyx_kp_u__4, __pyx_k__4,
sizeof(__pyx_k__4), 0, 1, 0, 0},
8173 {&__pyx_n_s_bdf_path, __pyx_k_bdf_path,
sizeof(__pyx_k_bdf_path), 0, 0, 1, 1},
8174 {&__pyx_n_s_card_count, __pyx_k_card_count,
sizeof(__pyx_k_card_count), 0, 0, 1, 1},
8175 {&__pyx_kp_u_card_count_s, __pyx_k_card_count_s,
sizeof(__pyx_k_card_count_s), 0, 1, 0, 0},
8176 {&__pyx_n_s_cid_ref, __pyx_k_cid_ref,
sizeof(__pyx_k_cid_ref), 0, 0, 1, 1},
8177 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
8178 {&__pyx_n_s_eid, __pyx_k_eid,
sizeof(__pyx_k_eid), 0, 0, 1, 1},
8179 {&__pyx_n_s_elements, __pyx_k_elements,
sizeof(__pyx_k_elements), 0, 0, 1, 1},
8180 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
8181 {&__pyx_n_s_float, __pyx_k_float,
sizeof(__pyx_k_float), 0, 0, 1, 1},
8182 {&__pyx_n_s_get_bdf_stats, __pyx_k_get_bdf_stats,
sizeof(__pyx_k_get_bdf_stats), 0, 0, 1, 1},
8183 {&__pyx_n_s_get_elements_properties_nodes_by, __pyx_k_get_elements_properties_nodes_by,
sizeof(__pyx_k_get_elements_properties_nodes_by), 0, 0, 1, 1},
8184 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
8185 {&__pyx_kp_u_i, __pyx_k_i,
sizeof(__pyx_k_i), 0, 1, 0, 0},
8186 {&__pyx_n_s_i_2, __pyx_k_i_2,
sizeof(__pyx_k_i_2), 0, 0, 1, 1},
8187 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
8188 {&__pyx_n_s_items, __pyx_k_items,
sizeof(__pyx_k_items), 0, 0, 1, 1},
8189 {&__pyx_n_s_j, __pyx_k_j,
sizeof(__pyx_k_j), 0, 0, 1, 1},
8190 {&__pyx_n_s_keys, __pyx_k_keys,
sizeof(__pyx_k_keys), 0, 0, 1, 1},
8191 {&__pyx_n_s_linalg, __pyx_k_linalg,
sizeof(__pyx_k_linalg), 0, 0, 1, 1},
8192 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
8193 {&__pyx_n_s_min, __pyx_k_min,
sizeof(__pyx_k_min), 0, 0, 1, 1},
8194 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
8195 {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous,
sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
8196 {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou,
sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
8197 {&__pyx_n_s_nelements, __pyx_k_nelements,
sizeof(__pyx_k_nelements), 0, 0, 1, 1},
8198 {&__pyx_n_s_nid, __pyx_k_nid,
sizeof(__pyx_k_nid), 0, 0, 1, 1},
8199 {&__pyx_n_s_nmaterials, __pyx_k_nmaterials,
sizeof(__pyx_k_nmaterials), 0, 0, 1, 1},
8200 {&__pyx_n_s_nnodes, __pyx_k_nnodes,
sizeof(__pyx_k_nnodes), 0, 0, 1, 1},
8201 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non,
sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
8202 {&__pyx_n_s_nodes, __pyx_k_nodes,
sizeof(__pyx_k_nodes), 0, 0, 1, 1},
8203 {&__pyx_n_s_nodes_ref, __pyx_k_nodes_ref,
sizeof(__pyx_k_nodes_ref), 0, 0, 1, 1},
8204 {&__pyx_n_s_norm, __pyx_k_norm,
sizeof(__pyx_k_norm), 0, 0, 1, 1},
8205 {&__pyx_n_s_np, __pyx_k_np,
sizeof(__pyx_k_np), 0, 0, 1, 1},
8206 {&__pyx_n_s_nproperties, __pyx_k_nproperties,
sizeof(__pyx_k_nproperties), 0, 0, 1, 1},
8207 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
8208 {&__pyx_kp_u_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to,
sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 1, 0, 0},
8209 {&__pyx_kp_u_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor,
sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0, 0},
8210 {&__pyx_n_s_object_attributes, __pyx_k_object_attributes,
sizeof(__pyx_k_object_attributes), 0, 0, 1, 1},
8211 {&__pyx_n_s_offset, __pyx_k_offset,
sizeof(__pyx_k_offset), 0, 0, 1, 1},
8212 {&__pyx_n_u_offset, __pyx_k_offset,
sizeof(__pyx_k_offset), 0, 1, 0, 1},
8213 {&__pyx_n_s_pid, __pyx_k_pid,
sizeof(__pyx_k_pid), 0, 0, 1, 1},
8214 {&__pyx_n_s_print, __pyx_k_print,
sizeof(__pyx_k_print), 0, 0, 1, 1},
8215 {&__pyx_n_s_pyNastran_bdf_bdf, __pyx_k_pyNastran_bdf_bdf,
sizeof(__pyx_k_pyNastran_bdf_bdf), 0, 0, 1, 1},
8216 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
8217 {&__pyx_n_s_read_bdf, __pyx_k_read_bdf,
sizeof(__pyx_k_read_bdf), 0, 0, 1, 1},
8218 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
8219 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
8220 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
8221 {&__pyx_n_s_reject_count, __pyx_k_reject_count,
sizeof(__pyx_k_reject_count), 0, 0, 1, 1},
8222 {&__pyx_kp_u_reject_count_s, __pyx_k_reject_count_s,
sizeof(__pyx_k_reject_count_s), 0, 1, 0, 0},
8223 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
8224 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
8225 {&__pyx_n_s_spcs, __pyx_k_spcs,
sizeof(__pyx_k_spcs), 0, 0, 1, 1},
8226 {&__pyx_n_s_strip, __pyx_k_strip,
sizeof(__pyx_k_strip), 0, 0, 1, 1},
8227 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
8228 {&__pyx_n_s_tolist, __pyx_k_tolist,
sizeof(__pyx_k_tolist), 0, 0, 1, 1},
8229 {&__pyx_n_s_type, __pyx_k_type,
sizeof(__pyx_k_type), 0, 0, 1, 1},
8230 {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd,
sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
8231 {&__pyx_kp_u_utf_8, __pyx_k_utf_8,
sizeof(__pyx_k_utf_8), 0, 1, 0, 0},
8232 {&__pyx_n_s_warn, __pyx_k_warn,
sizeof(__pyx_k_warn), 0, 0, 1, 1},
8233 {&__pyx_n_s_warnings, __pyx_k_warnings,
sizeof(__pyx_k_warnings), 0, 0, 1, 1},
8234 {&__pyx_n_s_x, __pyx_k_x,
sizeof(__pyx_k_x), 0, 0, 1, 1},
8235 {&__pyx_n_s_xyz, __pyx_k_xyz,
sizeof(__pyx_k_xyz), 0, 0, 1, 1},
8236 {&__pyx_n_s_zoffset, __pyx_k_zoffset,
sizeof(__pyx_k_zoffset), 0, 0, 1, 1},
8237 {&__pyx_n_u_zoffset, __pyx_k_zoffset,
sizeof(__pyx_k_zoffset), 0, 1, 0, 1},
8238 {0, 0, 0, 0, 0, 0, 0}
8240 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
8241 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error)
8242 __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print);
if (!__pyx_builtin_print) __PYX_ERR(1, 74, __pyx_L1_error)
8243 __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError);
if (!__pyx_builtin_NotImplementedError) __PYX_ERR(1, 173, __pyx_L1_error)
8244 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(1, 182, __pyx_L1_error)
8245 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(2, 272, __pyx_L1_error)
8246 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 856, __pyx_L1_error)
8247 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1038, __pyx_L1_error)
8253 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
8254 __Pyx_RefNannyDeclarations
8255 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
8263 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 2, __pyx_L1_error)
8264 __Pyx_GOTREF(__pyx_tuple_);
8265 __Pyx_GIVEREF(__pyx_tuple_);
8272 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 4, __pyx_L1_error)
8273 __Pyx_GOTREF(__pyx_tuple__2);
8274 __Pyx_GIVEREF(__pyx_tuple__2);
8283 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Support_of_non_zero_offsets_not);
if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 173, __pyx_L1_error)
8284 __Pyx_GOTREF(__pyx_tuple__5);
8285 __Pyx_GIVEREF(__pyx_tuple__5);
8294 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Support_of_non_zero_offets_not_y);
if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 176, __pyx_L1_error)
8295 __Pyx_GOTREF(__pyx_tuple__6);
8296 __Pyx_GIVEREF(__pyx_tuple__6);
8305 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous);
if (unlikely(!__pyx_tuple__7)) __PYX_ERR(2, 272, __pyx_L1_error)
8306 __Pyx_GOTREF(__pyx_tuple__7);
8307 __Pyx_GIVEREF(__pyx_tuple__7);
8316 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou);
if (unlikely(!__pyx_tuple__8)) __PYX_ERR(2, 276, __pyx_L1_error)
8317 __Pyx_GOTREF(__pyx_tuple__8);
8318 __Pyx_GIVEREF(__pyx_tuple__8);
8327 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor);
if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 306, __pyx_L1_error)
8328 __Pyx_GOTREF(__pyx_tuple__9);
8329 __Pyx_GIVEREF(__pyx_tuple__9);
8338 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 856, __pyx_L1_error)
8339 __Pyx_GOTREF(__pyx_tuple__10);
8340 __Pyx_GIVEREF(__pyx_tuple__10);
8349 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(2, 880, __pyx_L1_error)
8350 __Pyx_GOTREF(__pyx_tuple__11);
8351 __Pyx_GIVEREF(__pyx_tuple__11);
8360 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to);
if (unlikely(!__pyx_tuple__12)) __PYX_ERR(2, 1038, __pyx_L1_error)
8361 __Pyx_GOTREF(__pyx_tuple__12);
8362 __Pyx_GIVEREF(__pyx_tuple__12);
8371 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 1044, __pyx_L1_error)
8372 __Pyx_GOTREF(__pyx_tuple__13);
8373 __Pyx_GIVEREF(__pyx_tuple__13);
8374 __Pyx_RefNannyFinishContext();
8377 __Pyx_RefNannyFinishContext();
8381 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
8382 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
8383 __pyx_float_0_0 = PyFloat_FromDouble(0.0);
if (unlikely(!__pyx_float_0_0)) __PYX_ERR(1, 1, __pyx_L1_error)
8384 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(1, 1, __pyx_L1_error)
8385 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(1, 1, __pyx_L1_error)
8391 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
8392 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
8393 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
8394 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
8395 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
8396 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
8397 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
8399 static int __Pyx_modinit_global_init_code(
void) {
8400 __Pyx_RefNannyDeclarations
8401 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
8403 __Pyx_RefNannyFinishContext();
8407 static int __Pyx_modinit_variable_export_code(
void) {
8408 __Pyx_RefNannyDeclarations
8409 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
8411 __Pyx_RefNannyFinishContext();
8415 static int __Pyx_modinit_function_export_code(
void) {
8416 __Pyx_RefNannyDeclarations
8417 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
8419 __Pyx_RefNannyFinishContext();
8423 static int __Pyx_modinit_type_init_code(
void) {
8424 __Pyx_RefNannyDeclarations
8425 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
8427 if (PyType_Ready(&BDFModelType) < 0) __PYX_ERR(1, 33, __pyx_L1_error)
8428 #if PY_VERSION_HEX < 0x030800B1 8429 BDFModelType.tp_print = 0;
8431 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!BDFModelType.tp_dictoffset && BDFModelType.tp_getattro == PyObject_GenericGetAttr)) {
8432 BDFModelType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
8434 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BDFModel, (PyObject *)&BDFModelType) < 0) __PYX_ERR(1, 33, __pyx_L1_error)
8435 if (__Pyx_setup_reduce((PyObject*)&BDFModelType) < 0) __PYX_ERR(1, 33, __pyx_L1_error)
8436 __pyx_ptype_12pynastran_io_BDFModel = &BDFModelType;
8437 __Pyx_RefNannyFinishContext();
8440 __Pyx_RefNannyFinishContext();
8444 static int __Pyx_modinit_type_import_code(
void) {
8445 __Pyx_RefNannyDeclarations
8446 PyObject *__pyx_t_1 = NULL;
8447 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
8449 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
8450 __Pyx_GOTREF(__pyx_t_1);
8451 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME,
"type",
8452 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
8453 sizeof(PyTypeObject),
8455 sizeof(PyHeapTypeObject),
8457 __Pyx_ImportType_CheckSize_Warn);
8458 if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
8459 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8460 __pyx_t_1 = PyImport_ImportModule(
"numpy");
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 206, __pyx_L1_error)
8461 __Pyx_GOTREF(__pyx_t_1);
8462 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1,
"numpy",
"dtype",
sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
8463 if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 206, __pyx_L1_error)
8464 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1,
"numpy",
"flatiter",
sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
8465 if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 229, __pyx_L1_error)
8466 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1,
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
8467 if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 233, __pyx_L1_error)
8468 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ndarray",
sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
8469 if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 242, __pyx_L1_error)
8470 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1,
"numpy",
"ufunc",
sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
8471 if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 918, __pyx_L1_error)
8472 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8473 __Pyx_RefNannyFinishContext();
8476 __Pyx_XDECREF(__pyx_t_1);
8477 __Pyx_RefNannyFinishContext();
8481 static int __Pyx_modinit_variable_import_code(
void) {
8482 __Pyx_RefNannyDeclarations
8483 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
8485 __Pyx_RefNannyFinishContext();
8489 static int __Pyx_modinit_function_import_code(
void) {
8490 __Pyx_RefNannyDeclarations
8491 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
8493 __Pyx_RefNannyFinishContext();
8498 #if PY_MAJOR_VERSION < 3 8499 #ifdef CYTHON_NO_PYINIT_EXPORT 8500 #define __Pyx_PyMODINIT_FUNC void 8502 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC 8505 #ifdef CYTHON_NO_PYINIT_EXPORT 8506 #define __Pyx_PyMODINIT_FUNC PyObject * 8508 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC 8513 #if PY_MAJOR_VERSION < 3 8517 __Pyx_PyMODINIT_FUNC PyInit_pynastran_io(
void) CYTHON_SMALL_CODE;
8518 __Pyx_PyMODINIT_FUNC PyInit_pynastran_io(
void)
8519 #if CYTHON_PEP489_MULTI_PHASE_INIT 8521 return PyModuleDef_Init(&__pyx_moduledef);
8523 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
8524 #if PY_VERSION_HEX >= 0x030700A1 8525 static PY_INT64_T main_interpreter_id = -1;
8526 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
8527 if (main_interpreter_id == -1) {
8528 main_interpreter_id = current_id;
8529 return (unlikely(current_id == -1)) ? -1 : 0;
8530 }
else if (unlikely(main_interpreter_id != current_id))
8532 static PyInterpreterState *main_interpreter = NULL;
8533 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
8534 if (!main_interpreter) {
8535 main_interpreter = current_interpreter;
8536 }
else if (unlikely(main_interpreter != current_interpreter))
8541 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
8546 static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none) {
8547 PyObject *value = PyObject_GetAttrString(spec, from_name);
8549 if (likely(value)) {
8550 if (allow_none || value != Py_None) {
8551 result = PyDict_SetItemString(moddict, to_name, value);
8554 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
8561 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
8562 PyObject *module = NULL, *moddict, *modname;
8563 if (__Pyx_check_single_interpreter())
8566 return __Pyx_NewRef(__pyx_m);
8567 modname = PyObject_GetAttrString(spec,
"name");
8568 if (unlikely(!modname))
goto bad;
8569 module = PyModule_NewObject(modname);
8571 if (unlikely(!module))
goto bad;
8572 moddict = PyModule_GetDict(module);
8573 if (unlikely(!moddict))
goto bad;
8574 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
8575 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
8576 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
8577 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
8585 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_pynastran_io(PyObject *__pyx_pyinit_module)
8589 PyObject *__pyx_t_1 = NULL;
8590 PyObject *__pyx_t_2 = NULL;
8591 __Pyx_RefNannyDeclarations
8592 #if CYTHON_PEP489_MULTI_PHASE_INIT 8594 if (__pyx_m == __pyx_pyinit_module)
return 0;
8595 PyErr_SetString(PyExc_RuntimeError,
"Module 'pynastran_io' has already been imported. Re-initialisation is not supported.");
8598 #elif PY_MAJOR_VERSION >= 3 8599 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
8602 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
8603 if (!__Pyx_RefNanny) {
8605 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
8606 if (!__Pyx_RefNanny)
8607 Py_FatalError(
"failed to import 'refnanny' module");
8610 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_pynastran_io(void)", 0);
8611 if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
8612 #ifdef __Pxy_PyFrame_Initialize_Offsets 8613 __Pxy_PyFrame_Initialize_Offsets();
8615 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error)
8616 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error)
8617 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error)
8618 #ifdef __Pyx_CyFunction_USED 8619 if (__pyx_CyFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
8621 #ifdef __Pyx_FusedFunction_USED 8622 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
8624 #ifdef __Pyx_Coroutine_USED 8625 if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
8627 #ifdef __Pyx_Generator_USED 8628 if (__pyx_Generator_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
8630 #ifdef __Pyx_AsyncGen_USED 8631 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
8633 #ifdef __Pyx_StopAsyncIteration_USED 8634 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
8638 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS 8640 PyEval_InitThreads();
8644 #if CYTHON_PEP489_MULTI_PHASE_INIT 8645 __pyx_m = __pyx_pyinit_module;
8648 #if PY_MAJOR_VERSION < 3 8649 __pyx_m = Py_InitModule4(
"pynastran_io", __pyx_methods, __pyx_k_pyNASTRAN_Notes_Dependencies_cp, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
8651 __pyx_m = PyModule_Create(&__pyx_moduledef);
8653 if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error)
8655 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error)
8657 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error)
8659 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error)
8660 Py_INCREF(__pyx_cython_runtime);
8661 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
8663 if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
8664 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) 8665 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
8667 if (__pyx_module_is_main_pynastran_io) {
8668 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
8670 #if PY_MAJOR_VERSION >= 3 8672 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error)
8673 if (!PyDict_GetItemString(modules,
"pynastran_io")) {
8674 if (unlikely(PyDict_SetItemString(modules,
"pynastran_io", __pyx_m) < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
8679 if (__Pyx_InitCachedBuiltins() < 0)
goto __pyx_L1_error;
8681 if (__Pyx_InitCachedConstants() < 0)
goto __pyx_L1_error;
8683 (void)__Pyx_modinit_global_init_code();
8684 (void)__Pyx_modinit_variable_export_code();
8685 (void)__Pyx_modinit_function_export_code();
8686 if (unlikely(__Pyx_modinit_type_init_code() != 0))
goto __pyx_L1_error;
8687 if (unlikely(__Pyx_modinit_type_import_code() != 0))
goto __pyx_L1_error;
8688 (void)__Pyx_modinit_variable_import_code();
8689 (void)__Pyx_modinit_function_import_code();
8691 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 8692 if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
8702 __pyx_t_1 = PyList_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
8703 __Pyx_GOTREF(__pyx_t_1);
8704 __Pyx_INCREF(__pyx_n_s_BDF);
8705 __Pyx_GIVEREF(__pyx_n_s_BDF);
8706 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_BDF);
8707 __pyx_t_2 = __Pyx_Import(__pyx_n_s_pyNastran_bdf_bdf, __pyx_t_1, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 12, __pyx_L1_error)
8708 __Pyx_GOTREF(__pyx_t_2);
8709 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8710 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_BDF);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
8711 __Pyx_GOTREF(__pyx_t_1);
8712 if (PyDict_SetItem(__pyx_d, __pyx_n_s_BDF, __pyx_t_1) < 0) __PYX_ERR(1, 12, __pyx_L1_error)
8713 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8714 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8723 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 24, __pyx_L1_error)
8724 __Pyx_GOTREF(__pyx_t_2);
8725 __Pyx_INCREF(__pyx_n_s_warn);
8726 __Pyx_GIVEREF(__pyx_n_s_warn);
8727 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_warn);
8728 __pyx_t_1 = __Pyx_Import(__pyx_n_s_warnings, __pyx_t_2, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 24, __pyx_L1_error)
8729 __Pyx_GOTREF(__pyx_t_1);
8730 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8731 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_warn);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 24, __pyx_L1_error)
8732 __Pyx_GOTREF(__pyx_t_2);
8733 if (PyDict_SetItem(__pyx_d, __pyx_n_s_warn, __pyx_t_2) < 0) __PYX_ERR(1, 24, __pyx_L1_error)
8734 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8735 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8744 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 27, __pyx_L1_error)
8745 __Pyx_GOTREF(__pyx_t_1);
8746 if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(1, 27, __pyx_L1_error)
8747 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8756 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 29, __pyx_L1_error)
8757 __Pyx_GOTREF(__pyx_t_1);
8758 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 29, __pyx_L1_error)
8759 __Pyx_GOTREF(__pyx_t_2);
8760 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8761 if (PyDict_SetItem(__pyx_d, __pyx_n_s_DTYPE, __pyx_t_2) < 0) __PYX_ERR(1, 29, __pyx_L1_error)
8762 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8769 __pyx_t_2 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
8770 __Pyx_GOTREF(__pyx_t_2);
8771 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
8772 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8786 __Pyx_XDECREF(__pyx_t_1);
8787 __Pyx_XDECREF(__pyx_t_2);
8790 __Pyx_AddTraceback(
"init pynastran_io", __pyx_clineno, __pyx_lineno, __pyx_filename);
8793 }
else if (!PyErr_Occurred()) {
8794 PyErr_SetString(PyExc_ImportError,
"init pynastran_io");
8797 __Pyx_RefNannyFinishContext();
8798 #if CYTHON_PEP489_MULTI_PHASE_INIT 8799 return (__pyx_m != NULL) ? 0 : -1;
8800 #elif PY_MAJOR_VERSION >= 3 8810 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
8811 PyObject *m = NULL, *p = NULL;
8813 m = PyImport_ImportModule(modname);
8815 p = PyObject_GetAttrString(m,
"RefNannyAPI");
8817 r = PyLong_AsVoidPtr(p);
8821 return (__Pyx_RefNannyAPIStruct *)r;
8826 #if CYTHON_USE_TYPE_SLOTS 8827 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
8828 PyTypeObject* tp = Py_TYPE(obj);
8829 if (likely(tp->tp_getattro))
8830 return tp->tp_getattro(obj, attr_name);
8831 #if PY_MAJOR_VERSION < 3 8832 if (likely(tp->tp_getattr))
8833 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
8835 return PyObject_GetAttr(obj, attr_name);
8840 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
8841 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
8842 if (unlikely(!result)) {
8843 PyErr_Format(PyExc_NameError,
8844 #
if PY_MAJOR_VERSION >= 3
8845 "name '%U' is not defined", name);
8847 "name '%.200s' is not defined", PyString_AS_STRING(name));
8854 static void __Pyx_RaiseDoubleKeywordsError(
8855 const char* func_name,
8858 PyErr_Format(PyExc_TypeError,
8859 #
if PY_MAJOR_VERSION >= 3
8860 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
8862 "%s() got multiple values for keyword argument '%s'", func_name,
8863 PyString_AsString(kw_name));
8868 static int __Pyx_ParseOptionalKeywords(
8870 PyObject **argnames[],
8873 Py_ssize_t num_pos_args,
8874 const char* function_name)
8876 PyObject *key = 0, *value = 0;
8879 PyObject*** first_kw_arg = argnames + num_pos_args;
8880 while (PyDict_Next(kwds, &pos, &key, &value)) {
8881 name = first_kw_arg;
8882 while (*name && (**name != key)) name++;
8884 values[name-argnames] = value;
8887 name = first_kw_arg;
8888 #if PY_MAJOR_VERSION < 3 8889 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
8891 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
8892 && _PyString_Eq(**name, key)) {
8893 values[name-argnames] = value;
8898 if (*name)
continue;
8900 PyObject*** argname = argnames;
8901 while (argname != first_kw_arg) {
8902 if ((**argname == key) || (
8903 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
8904 && _PyString_Eq(**argname, key))) {
8905 goto arg_passed_twice;
8912 if (likely(PyUnicode_Check(key))) {
8914 int cmp = (**name == key) ? 0 :
8915 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
8916 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
8918 PyUnicode_Compare(**name, key);
8919 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
8921 values[name-argnames] = value;
8926 if (*name)
continue;
8928 PyObject*** argname = argnames;
8929 while (argname != first_kw_arg) {
8930 int cmp = (**argname == key) ? 0 :
8931 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
8932 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
8934 PyUnicode_Compare(**argname, key);
8935 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
8936 if (cmp == 0)
goto arg_passed_twice;
8941 goto invalid_keyword_type;
8943 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
8945 goto invalid_keyword;
8950 __Pyx_RaiseDoubleKeywordsError(function_name, key);
8952 invalid_keyword_type:
8953 PyErr_Format(PyExc_TypeError,
8954 "%.200s() keywords must be strings", function_name);
8957 PyErr_Format(PyExc_TypeError,
8958 #
if PY_MAJOR_VERSION < 3
8959 "%.200s() got an unexpected keyword argument '%.200s'",
8960 function_name, PyString_AsString(key));
8962 "%s() got an unexpected keyword argument '%U'",
8963 function_name, key);
8970 static void __Pyx_RaiseArgtupleInvalid(
8971 const char* func_name,
8975 Py_ssize_t num_found)
8977 Py_ssize_t num_expected;
8978 const char *more_or_less;
8979 if (num_found < num_min) {
8980 num_expected = num_min;
8981 more_or_less =
"at least";
8983 num_expected = num_max;
8984 more_or_less =
"at most";
8987 more_or_less =
"exactly";
8989 PyErr_Format(PyExc_TypeError,
8990 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
8991 func_name, more_or_less, num_expected,
8992 (num_expected == 1) ?
"" :
"s", num_found);
8996 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS 8997 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
8998 PyObject *dict = Py_TYPE(obj)->tp_dict;
8999 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
9001 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
9002 PyObject **dictptr = NULL;
9003 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
9005 #if CYTHON_COMPILING_IN_CPYTHON 9006 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
9008 dictptr = _PyObject_GetDictPtr(obj);
9011 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
9013 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
9014 PyObject *dict = Py_TYPE(obj)->tp_dict;
9015 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
9017 return obj_dict_version == __Pyx_get_object_dict_version(obj);
9022 #if CYTHON_USE_DICT_VERSIONS 9023 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
9025 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
9029 #if !CYTHON_AVOID_BORROWED_REFS 9030 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 9031 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
9032 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
9033 if (likely(result)) {
9034 return __Pyx_NewRef(result);
9035 }
else if (unlikely(PyErr_Occurred())) {
9039 result = PyDict_GetItem(__pyx_d, name);
9040 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
9041 if (likely(result)) {
9042 return __Pyx_NewRef(result);
9046 result = PyObject_GetItem(__pyx_d, name);
9047 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
9048 if (likely(result)) {
9049 return __Pyx_NewRef(result);
9053 return __Pyx_GetBuiltinName(name);
9057 #if CYTHON_FAST_PYCALL 9058 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
9059 PyObject *globals) {
9061 PyThreadState *tstate = __Pyx_PyThreadState_Current;
9062 PyObject **fastlocals;
9065 assert(globals != NULL);
9070 assert(tstate != NULL);
9071 f = PyFrame_New(tstate, co, globals, NULL);
9075 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
9076 for (i = 0; i < na; i++) {
9078 fastlocals[i] = *args++;
9080 result = PyEval_EvalFrameEx(f,0);
9081 ++tstate->recursion_depth;
9083 --tstate->recursion_depth;
9086 #if 1 || PY_VERSION_HEX < 0x030600B1 9087 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
9088 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
9089 PyObject *globals = PyFunction_GET_GLOBALS(func);
9090 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
9092 #if PY_MAJOR_VERSION >= 3 9095 PyObject *kwtuple, **k;
9100 assert(kwargs == NULL || PyDict_Check(kwargs));
9101 nk = kwargs ? PyDict_Size(kwargs) : 0;
9102 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
9106 #
if PY_MAJOR_VERSION >= 3
9107 co->co_kwonlyargcount == 0 &&
9109 likely(kwargs == NULL || nk == 0) &&
9110 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
9111 if (argdefs == NULL && co->co_argcount == nargs) {
9112 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
9115 else if (nargs == 0 && argdefs != NULL
9116 && co->co_argcount == Py_SIZE(argdefs)) {
9119 args = &PyTuple_GET_ITEM(argdefs, 0);
9120 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
9124 if (kwargs != NULL) {
9126 kwtuple = PyTuple_New(2 * nk);
9127 if (kwtuple == NULL) {
9131 k = &PyTuple_GET_ITEM(kwtuple, 0);
9133 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
9144 closure = PyFunction_GET_CLOSURE(func);
9145 #if PY_MAJOR_VERSION >= 3 9146 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
9148 if (argdefs != NULL) {
9149 d = &PyTuple_GET_ITEM(argdefs, 0);
9150 nd = Py_SIZE(argdefs);
9156 #if PY_MAJOR_VERSION >= 3 9157 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
9160 d, (
int)nd, kwdefs, closure);
9162 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
9165 d, (
int)nd, closure);
9167 Py_XDECREF(kwtuple);
9169 Py_LeaveRecursiveCall();
9176 #if CYTHON_COMPILING_IN_CPYTHON 9177 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
9179 ternaryfunc call = func->ob_type->tp_call;
9180 if (unlikely(!call))
9181 return PyObject_Call(func, arg, kw);
9182 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
9184 result = (*call)(func, arg, kw);
9185 Py_LeaveRecursiveCall();
9186 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
9189 "NULL result without error in PyObject_Call");
9196 #if CYTHON_COMPILING_IN_CPYTHON 9197 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
9198 PyObject *
self, *result;
9200 cfunc = PyCFunction_GET_FUNCTION(func);
9201 self = PyCFunction_GET_SELF(func);
9202 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
9204 result = cfunc(
self, arg);
9205 Py_LeaveRecursiveCall();
9206 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
9209 "NULL result without error in PyObject_Call");
9216 #if CYTHON_COMPILING_IN_CPYTHON 9217 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
9218 #if CYTHON_FAST_PYCALL 9219 if (PyFunction_Check(func)) {
9220 return __Pyx_PyFunction_FastCall(func, NULL, 0);
9223 #ifdef __Pyx_CyFunction_USED 9224 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
9226 if (likely(PyCFunction_Check(func)))
9229 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
9230 return __Pyx_PyObject_CallMethO(func, NULL);
9233 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
9238 #if CYTHON_FAST_PYCCALL 9239 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
9240 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
9241 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
9242 PyObject *
self = PyCFunction_GET_SELF(func);
9243 int flags = PyCFunction_GET_FLAGS(func);
9244 assert(PyCFunction_Check(func));
9245 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
9247 assert(nargs == 0 || args != NULL);
9251 assert(!PyErr_Occurred());
9252 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
9253 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
9255 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
9261 #if CYTHON_COMPILING_IN_CPYTHON 9262 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
9264 PyObject *args = PyTuple_New(1);
9265 if (unlikely(!args))
return NULL;
9267 PyTuple_SET_ITEM(args, 0, arg);
9268 result = __Pyx_PyObject_Call(func, args, NULL);
9272 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
9273 #if CYTHON_FAST_PYCALL 9274 if (PyFunction_Check(func)) {
9275 return __Pyx_PyFunction_FastCall(func, &arg, 1);
9278 if (likely(PyCFunction_Check(func))) {
9279 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
9280 return __Pyx_PyObject_CallMethO(func, arg);
9281 #if CYTHON_FAST_PYCCALL 9282 }
else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
9283 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
9287 return __Pyx__PyObject_CallOneArg(func, arg);
9290 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
9292 PyObject *args = PyTuple_Pack(1, arg);
9293 if (unlikely(!args))
return NULL;
9294 result = __Pyx_PyObject_Call(func, args, NULL);
9301 static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
9302 const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
9303 const char* encoding,
const char* errors,
9304 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors)) {
9305 if (unlikely((start < 0) | (stop < 0))) {
9316 length = stop - start;
9317 if (unlikely(length <= 0))
9318 return PyUnicode_FromUnicode(NULL, 0);
9321 return decode_func(cstring, length, errors);
9323 return PyUnicode_Decode(cstring, length, encoding, errors);
9328 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
9329 PyObject *args, *result = NULL;
9330 #if CYTHON_FAST_PYCALL 9331 if (PyFunction_Check(
function)) {
9332 PyObject *args[2] = {arg1, arg2};
9333 return __Pyx_PyFunction_FastCall(
function, args, 2);
9336 #if CYTHON_FAST_PYCCALL 9337 if (__Pyx_PyFastCFunction_Check(
function)) {
9338 PyObject *args[2] = {arg1, arg2};
9339 return __Pyx_PyCFunction_FastCall(
function, args, 2);
9342 args = PyTuple_New(2);
9343 if (unlikely(!args))
goto done;
9345 PyTuple_SET_ITEM(args, 0, arg1);
9347 PyTuple_SET_ITEM(args, 1, arg2);
9348 Py_INCREF(
function);
9349 result = __Pyx_PyObject_Call(
function, args, NULL);
9351 Py_DECREF(
function);
9357 #if CYTHON_FAST_THREAD_STATE 9358 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
9359 PyObject *tmp_type, *tmp_value, *tmp_tb;
9360 tmp_type = tstate->curexc_type;
9361 tmp_value = tstate->curexc_value;
9362 tmp_tb = tstate->curexc_traceback;
9363 tstate->curexc_type = type;
9364 tstate->curexc_value = value;
9365 tstate->curexc_traceback = tb;
9366 Py_XDECREF(tmp_type);
9367 Py_XDECREF(tmp_value);
9370 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
9371 *type = tstate->curexc_type;
9372 *value = tstate->curexc_value;
9373 *tb = tstate->curexc_traceback;
9374 tstate->curexc_type = 0;
9375 tstate->curexc_value = 0;
9376 tstate->curexc_traceback = 0;
9381 #if PY_MAJOR_VERSION < 3 9382 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
9383 CYTHON_UNUSED PyObject *cause) {
9384 __Pyx_PyThreadState_declare
9386 if (!value || value == Py_None)
9390 if (!tb || tb == Py_None)
9394 if (!PyTraceBack_Check(tb)) {
9395 PyErr_SetString(PyExc_TypeError,
9396 "raise: arg 3 must be a traceback or None");
9400 if (PyType_Check(type)) {
9401 #if CYTHON_COMPILING_IN_PYPY 9407 PyErr_NormalizeException(&type, &value, &tb);
9410 PyErr_SetString(PyExc_TypeError,
9411 "instance exception may not have a separate value");
9415 type = (PyObject*) Py_TYPE(type);
9417 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
9418 PyErr_SetString(PyExc_TypeError,
9419 "raise: exception class must be a subclass of BaseException");
9423 __Pyx_PyThreadState_assign
9424 __Pyx_ErrRestore(type, value, tb);
9433 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
9434 PyObject* owned_instance = NULL;
9435 if (tb == Py_None) {
9437 }
else if (tb && !PyTraceBack_Check(tb)) {
9438 PyErr_SetString(PyExc_TypeError,
9439 "raise: arg 3 must be a traceback or None");
9442 if (value == Py_None)
9444 if (PyExceptionInstance_Check(type)) {
9446 PyErr_SetString(PyExc_TypeError,
9447 "instance exception may not have a separate value");
9451 type = (PyObject*) Py_TYPE(value);
9452 }
else if (PyExceptionClass_Check(type)) {
9453 PyObject *instance_class = NULL;
9454 if (value && PyExceptionInstance_Check(value)) {
9455 instance_class = (PyObject*) Py_TYPE(value);
9456 if (instance_class != type) {
9457 int is_subclass = PyObject_IsSubclass(instance_class, type);
9459 instance_class = NULL;
9460 }
else if (unlikely(is_subclass == -1)) {
9463 type = instance_class;
9467 if (!instance_class) {
9470 args = PyTuple_New(0);
9471 else if (PyTuple_Check(value)) {
9475 args = PyTuple_Pack(1, value);
9478 owned_instance = PyObject_Call(type, args, NULL);
9480 if (!owned_instance)
9482 value = owned_instance;
9483 if (!PyExceptionInstance_Check(value)) {
9484 PyErr_Format(PyExc_TypeError,
9485 "calling %R should have returned an instance of " 9486 "BaseException, not %R",
9487 type, Py_TYPE(value));
9492 PyErr_SetString(PyExc_TypeError,
9493 "raise: exception class must be a subclass of BaseException");
9497 PyObject *fixed_cause;
9498 if (cause == Py_None) {
9500 }
else if (PyExceptionClass_Check(cause)) {
9501 fixed_cause = PyObject_CallObject(cause, NULL);
9502 if (fixed_cause == NULL)
9504 }
else if (PyExceptionInstance_Check(cause)) {
9505 fixed_cause = cause;
9506 Py_INCREF(fixed_cause);
9508 PyErr_SetString(PyExc_TypeError,
9509 "exception causes must derive from " 9513 PyException_SetCause(value, fixed_cause);
9515 PyErr_SetObject(type, value);
9517 #if CYTHON_COMPILING_IN_PYPY 9518 PyObject *tmp_type, *tmp_value, *tmp_tb;
9519 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
9521 PyErr_Restore(tmp_type, tmp_value, tb);
9524 PyThreadState *tstate = __Pyx_PyThreadState_Current;
9525 PyObject* tmp_tb = tstate->curexc_traceback;
9528 tstate->curexc_traceback = tb;
9534 Py_XDECREF(owned_instance);
9540 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
9541 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
9542 int full_traceback, CYTHON_UNUSED
int nogil) {
9543 PyObject *old_exc, *old_val, *old_tb;
9545 __Pyx_PyThreadState_declare
9547 PyGILState_STATE state;
9549 state = PyGILState_Ensure();
9551 else state = (PyGILState_STATE)-1;
9554 __Pyx_PyThreadState_assign
9555 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
9556 if (full_traceback) {
9557 Py_XINCREF(old_exc);
9558 Py_XINCREF(old_val);
9560 __Pyx_ErrRestore(old_exc, old_val, old_tb);
9563 #if PY_MAJOR_VERSION < 3 9564 ctx = PyString_FromString(name);
9566 ctx = PyUnicode_FromString(name);
9568 __Pyx_ErrRestore(old_exc, old_val, old_tb);
9570 PyErr_WriteUnraisable(Py_None);
9572 PyErr_WriteUnraisable(ctx);
9577 PyGILState_Release(state);
9582 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
9584 if (!j)
return NULL;
9585 r = PyObject_GetItem(o, j);
9589 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
9590 CYTHON_NCP_UNUSED
int wraparound,
9591 CYTHON_NCP_UNUSED
int boundscheck) {
9592 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 9593 Py_ssize_t wrapped_i = i;
9594 if (wraparound & unlikely(i < 0)) {
9595 wrapped_i += PyList_GET_SIZE(o);
9597 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
9598 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
9602 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
9604 return PySequence_GetItem(o, i);
9607 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
9608 CYTHON_NCP_UNUSED
int wraparound,
9609 CYTHON_NCP_UNUSED
int boundscheck) {
9610 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 9611 Py_ssize_t wrapped_i = i;
9612 if (wraparound & unlikely(i < 0)) {
9613 wrapped_i += PyTuple_GET_SIZE(o);
9615 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
9616 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
9620 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
9622 return PySequence_GetItem(o, i);
9625 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
9626 CYTHON_NCP_UNUSED
int wraparound,
9627 CYTHON_NCP_UNUSED
int boundscheck) {
9628 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS 9629 if (is_list || PyList_CheckExact(o)) {
9630 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
9631 if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
9632 PyObject *r = PyList_GET_ITEM(o, n);
9637 else if (PyTuple_CheckExact(o)) {
9638 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
9639 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
9640 PyObject *r = PyTuple_GET_ITEM(o, n);
9645 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
9646 if (likely(m && m->sq_item)) {
9647 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
9648 Py_ssize_t l = m->sq_length(o);
9649 if (likely(l >= 0)) {
9652 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
9657 return m->sq_item(o, i);
9661 if (is_list || PySequence_Check(o)) {
9662 return PySequence_GetItem(o, i);
9665 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
9669 #if CYTHON_USE_TYPE_SLOTS 9670 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
9672 Py_ssize_t key_value;
9673 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
9674 if (unlikely(!(m && m->sq_item))) {
9675 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
9678 key_value = __Pyx_PyIndex_AsSsize_t(index);
9679 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
9680 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
9682 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
9684 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
9688 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
9689 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
9690 if (likely(m && m->mp_subscript)) {
9691 return m->mp_subscript(obj, key);
9693 return __Pyx_PyObject_GetIndex(obj, key);
9698 #if !CYTHON_COMPILING_IN_PYPY 9699 static PyObject* __Pyx_PyFloat_NeObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace,
int zerodivision_check) {
9700 const double b = floatval;
9703 (void)zerodivision_check;
9707 if (likely(PyFloat_CheckExact(op1))) {
9708 a = PyFloat_AS_DOUBLE(op1);
9711 #if PY_MAJOR_VERSION < 3 9712 if (likely(PyInt_CheckExact(op1))) {
9713 a = (double) PyInt_AS_LONG(op1);
9717 if (likely(PyLong_CheckExact(op1))) {
9718 #if CYTHON_USE_PYLONG_INTERNALS 9719 const digit* digits = ((PyLongObject*)op1)->ob_digit;
9720 const Py_ssize_t size = Py_SIZE(op1);
9722 case 0: a = 0.0;
break;
9723 case -1: a = -(double) digits[0];
break;
9724 case 1: a = (double) digits[0];
break;
9727 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
9728 a = (double) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
9729 if ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
9738 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
9739 a = (double) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
9740 if ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
9749 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
9750 a = (double) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
9751 if ((8 *
sizeof(
unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
9763 PyFloat_Type.tp_richcompare(op2, op1, Py_NE));
9767 PyObject_RichCompare(op1, op2, Py_NE));
9778 static CYTHON_INLINE
int __Pyx_IterFinish(
void) {
9779 #if CYTHON_FAST_THREAD_STATE 9780 PyThreadState *tstate = __Pyx_PyThreadState_Current;
9781 PyObject* exc_type = tstate->curexc_type;
9782 if (unlikely(exc_type)) {
9783 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
9784 PyObject *exc_value, *exc_tb;
9785 exc_value = tstate->curexc_value;
9786 exc_tb = tstate->curexc_traceback;
9787 tstate->curexc_type = 0;
9788 tstate->curexc_value = 0;
9789 tstate->curexc_traceback = 0;
9790 Py_DECREF(exc_type);
9791 Py_XDECREF(exc_value);
9800 if (unlikely(PyErr_Occurred())) {
9801 if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
9813 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
9815 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP 9816 PyTypeObject *tp = Py_TYPE(obj);
9818 descrgetfunc f = NULL;
9819 PyObject **dictptr, *dict;
9821 assert (*method == NULL);
9822 if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
9823 attr = __Pyx_PyObject_GetAttrStr(obj, name);
9826 if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
9829 descr = _PyType_Lookup(tp, name);
9830 if (likely(descr != NULL)) {
9832 #if PY_MAJOR_VERSION >= 3 9833 #ifdef __Pyx_CyFunction_USED 9834 if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
9836 if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
9839 #ifdef __Pyx_CyFunction_USED 9840 if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
9842 if (likely(PyFunction_Check(descr)))
9848 f = Py_TYPE(descr)->tp_descr_get;
9849 if (f != NULL && PyDescr_IsData(descr)) {
9850 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
9856 dictptr = _PyObject_GetDictPtr(obj);
9857 if (dictptr != NULL && (dict = *dictptr) != NULL) {
9859 attr = __Pyx_PyDict_GetItemStr(dict, name);
9873 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
9877 if (descr != NULL) {
9881 PyErr_Format(PyExc_AttributeError,
9882 #
if PY_MAJOR_VERSION >= 3
9883 "'%.50s' object has no attribute '%U'",
9886 "'%.50s' object has no attribute '%.400s'",
9887 tp->tp_name, PyString_AS_STRING(name));
9891 attr = __Pyx_PyObject_GetAttrStr(obj, name);
9895 #if CYTHON_UNPACK_METHODS 9896 if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
9897 PyObject *
function = PyMethod_GET_FUNCTION(attr);
9898 Py_INCREF(
function);
9909 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
9910 PyObject *method = NULL, *result = NULL;
9911 int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
9912 if (likely(is_method)) {
9913 result = __Pyx_PyObject_CallOneArg(method, obj);
9917 if (unlikely(!method))
goto bad;
9918 result = __Pyx_PyObject_CallNoArg(method);
9925 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
9926 PyErr_Format(PyExc_ValueError,
9927 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
9928 index, (index == 1) ?
"" :
"s");
9932 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
9933 PyErr_Format(PyExc_ValueError,
9934 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
9938 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
9939 if (unlikely(retval)) {
9941 __Pyx_RaiseTooManyValuesError(expected);
9944 return __Pyx_IterFinish();
9950 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
9951 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
9955 static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
9957 __Pyx_RaiseNoneNotIterableError();
9958 }
else if (PyTuple_GET_SIZE(t) < index) {
9959 __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
9961 __Pyx_RaiseTooManyValuesError(index);
9966 static CYTHON_INLINE
int __Pyx_unpack_tuple2_exact(
9967 PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
int decref_tuple) {
9968 PyObject *value1 = NULL, *value2 = NULL;
9969 #if CYTHON_COMPILING_IN_PYPY 9970 value1 = PySequence_ITEM(tuple, 0);
if (unlikely(!value1))
goto bad;
9971 value2 = PySequence_ITEM(tuple, 1);
if (unlikely(!value2))
goto bad;
9973 value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1);
9974 value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2);
9982 #if CYTHON_COMPILING_IN_PYPY 9986 if (decref_tuple) { Py_XDECREF(tuple); }
9990 static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
9991 int has_known_size,
int decref_tuple) {
9993 PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
9994 iternextfunc iternext;
9995 iter = PyObject_GetIter(tuple);
9996 if (unlikely(!iter))
goto bad;
9997 if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
9998 iternext = Py_TYPE(iter)->tp_iternext;
9999 value1 = iternext(iter);
if (unlikely(!value1)) { index = 0;
goto unpacking_failed; }
10000 value2 = iternext(iter);
if (unlikely(!value2)) { index = 1;
goto unpacking_failed; }
10001 if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2)))
goto bad;
10007 if (!has_known_size && __Pyx_IterFinish() == 0)
10008 __Pyx_RaiseNeedMoreValuesError(index);
10011 Py_XDECREF(value1);
10012 Py_XDECREF(value2);
10013 if (decref_tuple) { Py_XDECREF(tuple); }
10018 static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable,
int is_dict, PyObject* method_name,
10019 Py_ssize_t* p_orig_length,
int* p_source_is_dict) {
10020 is_dict = is_dict || likely(PyDict_CheckExact(iterable));
10021 *p_source_is_dict = is_dict;
10023 #if !CYTHON_COMPILING_IN_PYPY 10024 *p_orig_length = PyDict_Size(iterable);
10025 Py_INCREF(iterable);
10027 #elif PY_MAJOR_VERSION >= 3 10028 static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
10029 PyObject **pp = NULL;
10031 const char *name = PyUnicode_AsUTF8(method_name);
10032 if (strcmp(name,
"iteritems") == 0) pp = &py_items;
10033 else if (strcmp(name,
"iterkeys") == 0) pp = &py_keys;
10034 else if (strcmp(name,
"itervalues") == 0) pp = &py_values;
10037 *pp = PyUnicode_FromString(name + 4);
10046 *p_orig_length = 0;
10049 iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
10052 #if !CYTHON_COMPILING_IN_PYPY 10053 if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
10056 iter = PyObject_GetIter(iterable);
10057 Py_DECREF(iterable);
10060 return PyObject_GetIter(iterable);
10062 static CYTHON_INLINE
int __Pyx_dict_iter_next(
10063 PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
10064 PyObject** pkey, PyObject** pvalue, PyObject** pitem,
int source_is_dict) {
10065 PyObject* next_item;
10066 #if !CYTHON_COMPILING_IN_PYPY 10067 if (source_is_dict) {
10068 PyObject *key, *value;
10069 if (unlikely(orig_length != PyDict_Size(iter_obj))) {
10070 PyErr_SetString(PyExc_RuntimeError,
"dictionary changed size during iteration");
10073 if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
10077 PyObject* tuple = PyTuple_New(2);
10078 if (unlikely(!tuple)) {
10083 PyTuple_SET_ITEM(tuple, 0, key);
10084 PyTuple_SET_ITEM(tuple, 1, value);
10097 }
else if (PyTuple_CheckExact(iter_obj)) {
10098 Py_ssize_t pos = *ppos;
10099 if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj)))
return 0;
10101 next_item = PyTuple_GET_ITEM(iter_obj, pos);
10102 Py_INCREF(next_item);
10103 }
else if (PyList_CheckExact(iter_obj)) {
10104 Py_ssize_t pos = *ppos;
10105 if (unlikely(pos >= PyList_GET_SIZE(iter_obj)))
return 0;
10107 next_item = PyList_GET_ITEM(iter_obj, pos);
10108 Py_INCREF(next_item);
10112 next_item = PyIter_Next(iter_obj);
10113 if (unlikely(!next_item)) {
10114 return __Pyx_IterFinish();
10118 *pitem = next_item;
10119 }
else if (pkey && pvalue) {
10120 if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
10125 *pvalue = next_item;
10131 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval, CYTHON_UNUSED
long inplace) {
10135 #if PY_MAJOR_VERSION < 3 10136 if (likely(PyInt_CheckExact(op1))) {
10137 const long b = intval;
10138 long a = PyInt_AS_LONG(op1);
10139 if (a != b) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
10142 #if CYTHON_USE_PYLONG_INTERNALS 10143 if (likely(PyLong_CheckExact(op1))) {
10145 unsigned long uintval;
10146 Py_ssize_t size = Py_SIZE(op1);
10147 const digit* digits = ((PyLongObject*)op1)->ob_digit;
10149 if (size != 0) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
10150 }
else if (intval < 0) {
10159 uintval = (
unsigned long) intval;
10160 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8 10161 if (uintval >> (PyLong_SHIFT * 4)) {
10162 unequal = (size != 5) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
10163 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
10166 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8 10167 if (uintval >> (PyLong_SHIFT * 3)) {
10168 unequal = (size != 4) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
10169 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
10172 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8 10173 if (uintval >> (PyLong_SHIFT * 2)) {
10174 unequal = (size != 3) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
10175 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
10178 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8 10179 if (uintval >> (PyLong_SHIFT * 1)) {
10180 unequal = (size != 2) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
10181 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
10184 unequal = (size != 1) || (((
unsigned long) digits[0]) != (uintval & (
unsigned long) PyLong_MASK));
10185 if (unequal != 0) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
10188 if (PyFloat_CheckExact(op1)) {
10189 const long b = intval;
10190 double a = PyFloat_AS_DOUBLE(op1);
10191 if ((
double)a != (
double)b) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
10194 PyObject_RichCompare(op1, op2, Py_NE));
10198 #if !CYTHON_COMPILING_IN_PYPY 10199 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
10201 (void)zerodivision_check;
10202 #if PY_MAJOR_VERSION < 3 10203 if (likely(PyInt_CheckExact(op1))) {
10204 const long b = intval;
10206 long a = PyInt_AS_LONG(op1);
10207 x = (long)((
unsigned long)a + b);
10208 if (likely((x^a) >= 0 || (x^b) >= 0))
10209 return PyInt_FromLong(x);
10210 return PyLong_Type.tp_as_number->nb_add(op1, op2);
10213 #if CYTHON_USE_PYLONG_INTERNALS 10214 if (likely(PyLong_CheckExact(op1))) {
10215 const long b = intval;
10217 #ifdef HAVE_LONG_LONG 10218 const PY_LONG_LONG llb = intval;
10219 PY_LONG_LONG lla, llx;
10221 const digit* digits = ((PyLongObject*)op1)->ob_digit;
10222 const Py_ssize_t size = Py_SIZE(op1);
10223 if (likely(__Pyx_sst_abs(size) <= 1)) {
10224 a = likely(size) ? digits[0] : 0;
10225 if (size == -1) a = -a;
10229 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
10230 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
10232 #ifdef HAVE_LONG_LONG 10233 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
10234 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
10238 CYTHON_FALLTHROUGH;
10240 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
10241 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
10243 #ifdef HAVE_LONG_LONG 10244 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
10245 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
10249 CYTHON_FALLTHROUGH;
10251 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
10252 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
10254 #ifdef HAVE_LONG_LONG 10255 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
10256 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]));
10260 CYTHON_FALLTHROUGH;
10262 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
10263 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
10265 #ifdef HAVE_LONG_LONG 10266 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
10267 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]));
10271 CYTHON_FALLTHROUGH;
10273 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
10274 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
10276 #ifdef HAVE_LONG_LONG 10277 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
10278 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]));
10282 CYTHON_FALLTHROUGH;
10284 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
10285 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
10287 #ifdef HAVE_LONG_LONG 10288 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
10289 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]));
10293 CYTHON_FALLTHROUGH;
10294 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
10298 return PyLong_FromLong(x);
10299 #ifdef HAVE_LONG_LONG 10302 return PyLong_FromLongLong(llx);
10308 if (PyFloat_CheckExact(op1)) {
10309 const long b = intval;
10310 double a = PyFloat_AS_DOUBLE(op1);
10312 PyFPE_START_PROTECT(
"add",
return NULL)
10313 result = ((double)a) + (double)b;
10314 PyFPE_END_PROTECT(result)
10315 return PyFloat_FromDouble(result);
10317 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
10322 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY 10323 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
10325 value = PyDict_GetItemWithError(d, key);
10326 if (unlikely(!value)) {
10327 if (!PyErr_Occurred()) {
10328 if (unlikely(PyTuple_Check(key))) {
10329 PyObject* args = PyTuple_Pack(1, key);
10330 if (likely(args)) {
10331 PyErr_SetObject(PyExc_KeyError, args);
10335 PyErr_SetObject(PyExc_KeyError, key);
10346 #if CYTHON_USE_PYLONG_INTERNALS 10347 static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) {
10348 if (likely(Py_SIZE(n) == -1)) {
10349 return PyLong_FromLong(((PyLongObject*)n)->ob_digit[0]);
10351 #if CYTHON_COMPILING_IN_CPYTHON 10353 PyObject *
copy = _PyLong_Copy((PyLongObject*)n);
10354 if (likely(copy)) {
10355 Py_SIZE(copy) = -(Py_SIZE(copy));
10360 return PyNumber_Negative(n);
10366 #if CYTHON_USE_TYPE_SLOTS 10367 static CYTHON_INLINE
int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
10368 PyTypeObject* tp = Py_TYPE(obj);
10369 if (likely(tp->tp_setattro))
10370 return tp->tp_setattro(obj, attr_name, value);
10371 #if PY_MAJOR_VERSION < 3 10372 if (likely(tp->tp_setattr))
10373 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
10375 return PyObject_SetAttr(obj, attr_name, value);
10380 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
10381 if (unlikely(!type)) {
10382 PyErr_SetString(PyExc_SystemError,
"Missing type object");
10385 if (likely(__Pyx_TypeCheck(obj, type)))
10387 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
10388 Py_TYPE(obj)->tp_name, type->tp_name);
10393 #if CYTHON_USE_EXC_INFO_STACK 10394 static _PyErr_StackItem *
10395 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
10397 _PyErr_StackItem *exc_info = tstate->exc_info;
10398 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
10399 exc_info->previous_item != NULL)
10401 exc_info = exc_info->previous_item;
10408 #if CYTHON_FAST_THREAD_STATE 10409 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
10410 #if CYTHON_USE_EXC_INFO_STACK 10411 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
10412 *type = exc_info->exc_type;
10413 *value = exc_info->exc_value;
10414 *tb = exc_info->exc_traceback;
10416 *type = tstate->exc_type;
10417 *value = tstate->exc_value;
10418 *tb = tstate->exc_traceback;
10421 Py_XINCREF(*value);
10424 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
10425 PyObject *tmp_type, *tmp_value, *tmp_tb;
10426 #if CYTHON_USE_EXC_INFO_STACK 10427 _PyErr_StackItem *exc_info = tstate->exc_info;
10428 tmp_type = exc_info->exc_type;
10429 tmp_value = exc_info->exc_value;
10430 tmp_tb = exc_info->exc_traceback;
10431 exc_info->exc_type = type;
10432 exc_info->exc_value = value;
10433 exc_info->exc_traceback = tb;
10435 tmp_type = tstate->exc_type;
10436 tmp_value = tstate->exc_value;
10437 tmp_tb = tstate->exc_traceback;
10438 tstate->exc_type = type;
10439 tstate->exc_value = value;
10440 tstate->exc_traceback = tb;
10442 Py_XDECREF(tmp_type);
10443 Py_XDECREF(tmp_value);
10444 Py_XDECREF(tmp_tb);
10449 #if CYTHON_FAST_THREAD_STATE 10450 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
10452 n = PyTuple_GET_SIZE(tuple);
10453 #if PY_MAJOR_VERSION >= 3 10454 for (i=0; i<n; i++) {
10455 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
10458 for (i=0; i<n; i++) {
10459 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
10463 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
10464 PyObject *exc_type = tstate->curexc_type;
10465 if (exc_type == err)
return 1;
10466 if (unlikely(!exc_type))
return 0;
10467 if (unlikely(PyTuple_Check(err)))
10468 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
10469 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
10474 #if CYTHON_FAST_THREAD_STATE 10475 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
10477 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
10480 PyObject *local_type, *local_value, *local_tb;
10481 #if CYTHON_FAST_THREAD_STATE 10482 PyObject *tmp_type, *tmp_value, *tmp_tb;
10483 local_type = tstate->curexc_type;
10484 local_value = tstate->curexc_value;
10485 local_tb = tstate->curexc_traceback;
10486 tstate->curexc_type = 0;
10487 tstate->curexc_value = 0;
10488 tstate->curexc_traceback = 0;
10490 PyErr_Fetch(&local_type, &local_value, &local_tb);
10492 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
10493 #if CYTHON_FAST_THREAD_STATE 10494 if (unlikely(tstate->curexc_type))
10496 if (unlikely(PyErr_Occurred()))
10499 #if PY_MAJOR_VERSION >= 3 10501 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
10505 Py_XINCREF(local_tb);
10506 Py_XINCREF(local_type);
10507 Py_XINCREF(local_value);
10508 *type = local_type;
10509 *value = local_value;
10511 #if CYTHON_FAST_THREAD_STATE 10512 #if CYTHON_USE_EXC_INFO_STACK 10514 _PyErr_StackItem *exc_info = tstate->exc_info;
10515 tmp_type = exc_info->exc_type;
10516 tmp_value = exc_info->exc_value;
10517 tmp_tb = exc_info->exc_traceback;
10518 exc_info->exc_type = local_type;
10519 exc_info->exc_value = local_value;
10520 exc_info->exc_traceback = local_tb;
10523 tmp_type = tstate->exc_type;
10524 tmp_value = tstate->exc_value;
10525 tmp_tb = tstate->exc_traceback;
10526 tstate->exc_type = local_type;
10527 tstate->exc_value = local_value;
10528 tstate->exc_traceback = local_tb;
10530 Py_XDECREF(tmp_type);
10531 Py_XDECREF(tmp_value);
10532 Py_XDECREF(tmp_tb);
10534 PyErr_SetExcInfo(local_type, local_value, local_tb);
10541 Py_XDECREF(local_type);
10542 Py_XDECREF(local_value);
10543 Py_XDECREF(local_tb);
10548 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 10549 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
10550 PyErr_Format(PyExc_AttributeError,
10551 #
if PY_MAJOR_VERSION >= 3
10552 "'%.50s' object has no attribute '%U'",
10553 tp->tp_name, attr_name);
10555 "'%.50s' object has no attribute '%.400s'",
10556 tp->tp_name, PyString_AS_STRING(attr_name));
10560 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
10562 PyTypeObject *tp = Py_TYPE(obj);
10563 if (unlikely(!PyString_Check(attr_name))) {
10564 return PyObject_GenericGetAttr(obj, attr_name);
10566 assert(!tp->tp_dictoffset);
10567 descr = _PyType_Lookup(tp, attr_name);
10568 if (unlikely(!descr)) {
10569 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
10572 #if PY_MAJOR_VERSION < 3 10573 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
10576 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
10578 PyObject *res = f(descr, obj, (PyObject *)tp);
10588 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 10589 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
10590 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
10591 return PyObject_GenericGetAttr(obj, attr_name);
10593 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
10598 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
10600 PyObject *name_attr;
10601 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
10602 if (likely(name_attr)) {
10603 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
10607 if (unlikely(ret < 0)) {
10611 Py_XDECREF(name_attr);
10614 static int __Pyx_setup_reduce(PyObject* type_obj) {
10616 PyObject *object_reduce = NULL;
10617 PyObject *object_reduce_ex = NULL;
10618 PyObject *reduce = NULL;
10619 PyObject *reduce_ex = NULL;
10620 PyObject *reduce_cython = NULL;
10621 PyObject *setstate = NULL;
10622 PyObject *setstate_cython = NULL;
10623 #if CYTHON_USE_PYTYPE_LOOKUP 10624 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate))
goto GOOD;
10626 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate))
goto GOOD;
10628 #if CYTHON_USE_PYTYPE_LOOKUP 10629 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
10631 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
10633 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto BAD;
10634 if (reduce_ex == object_reduce_ex) {
10635 #if CYTHON_USE_PYTYPE_LOOKUP 10636 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
10638 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
10640 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto BAD;
10641 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
10642 reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython);
if (unlikely(!reduce_cython))
goto BAD;
10643 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto BAD;
10644 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto BAD;
10645 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
10646 if (!setstate) PyErr_Clear();
10647 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
10648 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython);
if (unlikely(!setstate_cython))
goto BAD;
10649 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto BAD;
10650 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto BAD;
10652 PyType_Modified((PyTypeObject*)type_obj);
10657 if (!PyErr_Occurred())
10658 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
10661 #if !CYTHON_USE_PYTYPE_LOOKUP 10662 Py_XDECREF(object_reduce);
10663 Py_XDECREF(object_reduce_ex);
10665 Py_XDECREF(reduce);
10666 Py_XDECREF(reduce_ex);
10667 Py_XDECREF(reduce_cython);
10668 Py_XDECREF(setstate);
10669 Py_XDECREF(setstate_cython);
10674 #ifndef __PYX_HAVE_RT_ImportType 10675 #define __PYX_HAVE_RT_ImportType 10676 static PyTypeObject *__Pyx_ImportType(PyObject *module,
const char *module_name,
const char *class_name,
10677 size_t size,
enum __Pyx_ImportType_CheckSize check_size)
10679 PyObject *result = 0;
10681 Py_ssize_t basicsize;
10682 #ifdef Py_LIMITED_API 10683 PyObject *py_basicsize;
10685 result = PyObject_GetAttrString(module, class_name);
10688 if (!PyType_Check(result)) {
10689 PyErr_Format(PyExc_TypeError,
10690 "%.200s.%.200s is not a type object",
10691 module_name, class_name);
10694 #ifndef Py_LIMITED_API 10695 basicsize = ((PyTypeObject *)result)->tp_basicsize;
10697 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
10700 basicsize = PyLong_AsSsize_t(py_basicsize);
10701 Py_DECREF(py_basicsize);
10703 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
10706 if ((
size_t)basicsize < size) {
10707 PyErr_Format(PyExc_ValueError,
10708 "%.200s.%.200s size changed, may indicate binary incompatibility. " 10709 "Expected %zd from C header, got %zd from PyObject",
10710 module_name, class_name, size, basicsize);
10713 if (check_size == __Pyx_ImportType_CheckSize_Error && (
size_t)basicsize != size) {
10714 PyErr_Format(PyExc_ValueError,
10715 "%.200s.%.200s size changed, may indicate binary incompatibility. " 10716 "Expected %zd from C header, got %zd from PyObject",
10717 module_name, class_name, size, basicsize);
10720 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (
size_t)basicsize > size) {
10721 PyOS_snprintf(warning,
sizeof(warning),
10722 "%s.%s size changed, may indicate binary incompatibility. " 10723 "Expected %zd from C header, got %zd from PyObject",
10724 module_name, class_name, size, basicsize);
10725 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
10727 return (PyTypeObject *)result;
10729 Py_XDECREF(result);
10735 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
10736 PyObject *empty_list = 0;
10737 PyObject *module = 0;
10738 PyObject *global_dict = 0;
10739 PyObject *empty_dict = 0;
10741 #if PY_MAJOR_VERSION < 3 10742 PyObject *py_import;
10743 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
10750 empty_list = PyList_New(0);
10755 global_dict = PyModule_GetDict(__pyx_m);
10758 empty_dict = PyDict_New();
10762 #if PY_MAJOR_VERSION >= 3 10764 if (strchr(__Pyx_MODULE_NAME,
'.')) {
10765 module = PyImport_ImportModuleLevelObject(
10766 name, global_dict, empty_dict, list, 1);
10768 if (!PyErr_ExceptionMatches(PyExc_ImportError))
10777 #if PY_MAJOR_VERSION < 3 10778 PyObject *py_level = PyInt_FromLong(level);
10781 module = PyObject_CallFunctionObjArgs(py_import,
10782 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
10783 Py_DECREF(py_level);
10785 module = PyImport_ImportModuleLevelObject(
10786 name, global_dict, empty_dict, list, level);
10791 #if PY_MAJOR_VERSION < 3 10792 Py_XDECREF(py_import);
10794 Py_XDECREF(empty_list);
10795 Py_XDECREF(empty_dict);
10800 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
10801 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
10802 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
10803 PyErr_Format(PyExc_ImportError,
10804 #
if PY_MAJOR_VERSION < 3
10805 "cannot import name %.230s", PyString_AS_STRING(name));
10807 "cannot import name %S", name);
10814 #ifndef CYTHON_CLINE_IN_TRACEBACK 10815 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line) {
10816 PyObject *use_cline;
10817 PyObject *ptype, *pvalue, *ptraceback;
10818 #if CYTHON_COMPILING_IN_CPYTHON 10819 PyObject **cython_runtime_dict;
10821 if (unlikely(!__pyx_cython_runtime)) {
10824 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
10825 #if CYTHON_COMPILING_IN_CPYTHON 10826 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
10827 if (likely(cython_runtime_dict)) {
10828 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
10829 use_cline, *cython_runtime_dict,
10830 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
10834 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
10835 if (use_cline_obj) {
10836 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
10837 Py_DECREF(use_cline_obj);
10845 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
10847 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
10850 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
10856 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
10857 int start = 0, mid = 0, end = count - 1;
10858 if (end >= 0 && code_line > entries[end].code_line) {
10861 while (start < end) {
10862 mid = start + (end - start) / 2;
10863 if (code_line < entries[mid].code_line) {
10865 }
else if (code_line > entries[mid].code_line) {
10871 if (code_line <= entries[mid].code_line) {
10877 static PyCodeObject *__pyx_find_code_object(
int code_line) {
10878 PyCodeObject* code_object;
10880 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
10883 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
10884 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
10887 code_object = __pyx_code_cache.entries[pos].code_object;
10888 Py_INCREF(code_object);
10889 return code_object;
10891 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
10893 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
10894 if (unlikely(!code_line)) {
10897 if (unlikely(!entries)) {
10898 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
10899 if (likely(entries)) {
10900 __pyx_code_cache.entries = entries;
10901 __pyx_code_cache.max_count = 64;
10902 __pyx_code_cache.count = 1;
10903 entries[0].code_line = code_line;
10904 entries[0].code_object = code_object;
10905 Py_INCREF(code_object);
10909 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
10910 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
10911 PyCodeObject* tmp = entries[pos].code_object;
10912 entries[pos].code_object = code_object;
10916 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
10917 int new_max = __pyx_code_cache.max_count + 64;
10918 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
10919 __pyx_code_cache.entries, (
size_t)new_max*
sizeof(__Pyx_CodeObjectCacheEntry));
10920 if (unlikely(!entries)) {
10923 __pyx_code_cache.entries = entries;
10924 __pyx_code_cache.max_count = new_max;
10926 for (i=__pyx_code_cache.count; i>pos; i--) {
10927 entries[i] = entries[i-1];
10929 entries[pos].code_line = code_line;
10930 entries[pos].code_object = code_object;
10931 __pyx_code_cache.count++;
10932 Py_INCREF(code_object);
10936 #include "compile.h" 10937 #include "frameobject.h" 10938 #include "traceback.h" 10939 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
10940 const char *funcname,
int c_line,
10941 int py_line,
const char *filename) {
10942 PyCodeObject *py_code = 0;
10943 PyObject *py_srcfile = 0;
10944 PyObject *py_funcname = 0;
10945 #if PY_MAJOR_VERSION < 3 10946 py_srcfile = PyString_FromString(filename);
10948 py_srcfile = PyUnicode_FromString(filename);
10950 if (!py_srcfile)
goto bad;
10952 #if PY_MAJOR_VERSION < 3 10953 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
10955 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
10959 #if PY_MAJOR_VERSION < 3 10960 py_funcname = PyString_FromString(funcname);
10962 py_funcname = PyUnicode_FromString(funcname);
10965 if (!py_funcname)
goto bad;
10966 py_code = __Pyx_PyCode_New(
10983 Py_DECREF(py_srcfile);
10984 Py_DECREF(py_funcname);
10987 Py_XDECREF(py_srcfile);
10988 Py_XDECREF(py_funcname);
10991 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
10992 int py_line,
const char *filename) {
10993 PyCodeObject *py_code = 0;
10994 PyFrameObject *py_frame = 0;
10995 PyThreadState *tstate = __Pyx_PyThreadState_Current;
10997 c_line = __Pyx_CLineForTraceback(tstate, c_line);
10999 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
11001 py_code = __Pyx_CreateCodeObjectForTraceback(
11002 funcname, c_line, py_line, filename);
11003 if (!py_code)
goto bad;
11004 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
11006 py_frame = PyFrame_New(
11012 if (!py_frame)
goto bad;
11013 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
11014 PyTraceBack_Here(py_frame);
11016 Py_XDECREF(py_code);
11017 Py_XDECREF(py_frame);
11021 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ 11022 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) 11023 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ 11024 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) 11025 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ 11027 func_type value = func_value;\ 11028 if (sizeof(target_type) < sizeof(func_type)) {\ 11029 if (unlikely(value != (func_type) (target_type) value)) {\ 11030 func_type zero = 0;\ 11031 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ 11032 return (target_type) -1;\ 11033 if (is_unsigned && unlikely(value < zero))\ 11034 goto raise_neg_overflow;\ 11036 goto raise_overflow;\ 11039 return (target_type) value;\ 11043 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
11044 const int neg_one = (int) ((
int) 0 - (int) 1), const_zero = (int) 0;
11045 const int is_unsigned = neg_one > const_zero;
11047 if (
sizeof(
int) <
sizeof(long)) {
11048 return PyInt_FromLong((
long) value);
11049 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
11050 return PyLong_FromUnsignedLong((
unsigned long) value);
11051 #ifdef HAVE_LONG_LONG 11052 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
11053 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
11057 if (
sizeof(
int) <=
sizeof(
long)) {
11058 return PyInt_FromLong((
long) value);
11059 #ifdef HAVE_LONG_LONG 11060 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
11061 return PyLong_FromLongLong((PY_LONG_LONG) value);
11066 int one = 1;
int little = (int)*(
unsigned char *)&one;
11067 unsigned char *bytes = (
unsigned char *)&value;
11068 return _PyLong_FromByteArray(bytes,
sizeof(
int),
11069 little, !is_unsigned);
11074 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
11075 const long neg_one = (long) ((
long) 0 - (long) 1), const_zero = (long) 0;
11076 const int is_unsigned = neg_one > const_zero;
11078 if (
sizeof(
long) <
sizeof(long)) {
11079 return PyInt_FromLong((
long) value);
11080 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
11081 return PyLong_FromUnsignedLong((
unsigned long) value);
11082 #ifdef HAVE_LONG_LONG 11083 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
11084 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
11088 if (
sizeof(
long) <=
sizeof(
long)) {
11089 return PyInt_FromLong((
long) value);
11090 #ifdef HAVE_LONG_LONG 11091 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
11092 return PyLong_FromLongLong((PY_LONG_LONG) value);
11097 int one = 1;
int little = (int)*(
unsigned char *)&one;
11098 unsigned char *bytes = (
unsigned char *)&value;
11099 return _PyLong_FromByteArray(bytes,
sizeof(
long),
11100 little, !is_unsigned);
11105 #if CYTHON_CCOMPLEX 11107 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
11108 return ::std::complex< float >(x, y);
11111 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
11112 return x + y*(__pyx_t_float_complex)_Complex_I;
11116 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
11117 __pyx_t_float_complex z;
11125 #if CYTHON_CCOMPLEX 11127 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11128 return (a.real == b.real) && (a.imag == b.imag);
11130 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11131 __pyx_t_float_complex z;
11132 z.real = a.real + b.real;
11133 z.imag = a.imag + b.imag;
11136 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11137 __pyx_t_float_complex z;
11138 z.real = a.real - b.real;
11139 z.imag = a.imag - b.imag;
11142 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11143 __pyx_t_float_complex z;
11144 z.real = a.real * b.real - a.imag * b.imag;
11145 z.imag = a.real * b.imag + a.imag * b.real;
11149 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11151 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
11152 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
11153 if (b.real == 0 && b.imag == 0) {
11154 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
11156 float r = b.imag / b.real;
11157 float s = (float)(1.0) / (b.real + b.imag * r);
11158 return __pyx_t_float_complex_from_parts(
11159 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
11162 float r = b.real / b.imag;
11163 float s = (float)(1.0) / (b.imag + b.real * r);
11164 return __pyx_t_float_complex_from_parts(
11165 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
11169 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11171 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
11173 float denom = b.real * b.real + b.imag * b.imag;
11174 return __pyx_t_float_complex_from_parts(
11175 (a.real * b.real + a.imag * b.imag) / denom,
11176 (a.imag * b.real - a.real * b.imag) / denom);
11180 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
11181 __pyx_t_float_complex z;
11186 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
11187 return (a.real == 0) && (a.imag == 0);
11189 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
11190 __pyx_t_float_complex z;
11196 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex z) {
11197 #if !defined(HAVE_HYPOT) || defined(_MSC_VER) 11198 return sqrtf(z.real*z.real + z.imag*z.imag);
11200 return hypotf(z.real, z.imag);
11203 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
11204 __pyx_t_float_complex z;
11205 float r, lnr, theta, z_r, z_theta;
11206 if (b.imag == 0 && b.real == (
int)b.real) {
11208 float denom = a.real * a.real + a.imag * a.imag;
11209 a.real = a.real / denom;
11210 a.imag = -a.imag / denom;
11213 switch ((
int)b.real) {
11221 z = __Pyx_c_prod_float(a, a);
11222 return __Pyx_c_prod_float(a, a);
11224 z = __Pyx_c_prod_float(a, a);
11225 return __Pyx_c_prod_float(z, a);
11227 z = __Pyx_c_prod_float(a, a);
11228 return __Pyx_c_prod_float(z, z);
11234 }
else if (b.imag == 0) {
11235 z.real = powf(a.real, b.real);
11238 }
else if (a.real > 0) {
11243 theta = atan2f(0.0, -1.0);
11246 r = __Pyx_c_abs_float(a);
11247 theta = atan2f(a.imag, a.real);
11250 z_r = expf(lnr * b.real - theta * b.imag);
11251 z_theta = theta * b.real + lnr * b.imag;
11252 z.real = z_r * cosf(z_theta);
11253 z.imag = z_r * sinf(z_theta);
11260 #if CYTHON_CCOMPLEX 11262 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
11263 return ::std::complex< double >(x, y);
11266 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
11267 return x + y*(__pyx_t_double_complex)_Complex_I;
11271 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
11272 __pyx_t_double_complex z;
11280 #if CYTHON_CCOMPLEX 11282 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11283 return (a.real == b.real) && (a.imag == b.imag);
11285 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11286 __pyx_t_double_complex z;
11287 z.real = a.real + b.real;
11288 z.imag = a.imag + b.imag;
11291 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11292 __pyx_t_double_complex z;
11293 z.real = a.real - b.real;
11294 z.imag = a.imag - b.imag;
11297 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11298 __pyx_t_double_complex z;
11299 z.real = a.real * b.real - a.imag * b.imag;
11300 z.imag = a.real * b.imag + a.imag * b.real;
11304 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11306 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
11307 }
else if (fabs(b.real) >= fabs(b.imag)) {
11308 if (b.real == 0 && b.imag == 0) {
11309 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
11311 double r = b.imag / b.real;
11312 double s = (double)(1.0) / (b.real + b.imag * r);
11313 return __pyx_t_double_complex_from_parts(
11314 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
11317 double r = b.real / b.imag;
11318 double s = (double)(1.0) / (b.imag + b.real * r);
11319 return __pyx_t_double_complex_from_parts(
11320 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
11324 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11326 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
11328 double denom = b.real * b.real + b.imag * b.imag;
11329 return __pyx_t_double_complex_from_parts(
11330 (a.real * b.real + a.imag * b.imag) / denom,
11331 (a.imag * b.real - a.real * b.imag) / denom);
11335 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
11336 __pyx_t_double_complex z;
11341 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
11342 return (a.real == 0) && (a.imag == 0);
11344 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
11345 __pyx_t_double_complex z;
11351 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex z) {
11352 #if !defined(HAVE_HYPOT) || defined(_MSC_VER) 11353 return sqrt(z.real*z.real + z.imag*z.imag);
11355 return hypot(z.real, z.imag);
11358 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
11359 __pyx_t_double_complex z;
11360 double r, lnr, theta, z_r, z_theta;
11361 if (b.imag == 0 && b.real == (
int)b.real) {
11363 double denom = a.real * a.real + a.imag * a.imag;
11364 a.real = a.real / denom;
11365 a.imag = -a.imag / denom;
11368 switch ((
int)b.real) {
11376 z = __Pyx_c_prod_double(a, a);
11377 return __Pyx_c_prod_double(a, a);
11379 z = __Pyx_c_prod_double(a, a);
11380 return __Pyx_c_prod_double(z, a);
11382 z = __Pyx_c_prod_double(a, a);
11383 return __Pyx_c_prod_double(z, z);
11389 }
else if (b.imag == 0) {
11390 z.real = pow(a.real, b.real);
11393 }
else if (a.real > 0) {
11398 theta = atan2(0.0, -1.0);
11401 r = __Pyx_c_abs_double(a);
11402 theta = atan2(a.imag, a.real);
11405 z_r = exp(lnr * b.real - theta * b.imag);
11406 z_theta = theta * b.real + lnr * b.imag;
11407 z.real = z_r * cos(z_theta);
11408 z.imag = z_r * sin(z_theta);
11415 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value) {
11416 const enum NPY_TYPES neg_one = (
enum NPY_TYPES) ((
enum NPY_TYPES) 0 - (
enum NPY_TYPES) 1), const_zero = (
enum NPY_TYPES) 0;
11417 const int is_unsigned = neg_one > const_zero;
11419 if (
sizeof(
enum NPY_TYPES) <
sizeof(long)) {
11420 return PyInt_FromLong((
long) value);
11421 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned long)) {
11422 return PyLong_FromUnsignedLong((
unsigned long) value);
11423 #ifdef HAVE_LONG_LONG 11424 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned PY_LONG_LONG)) {
11425 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
11429 if (
sizeof(
enum NPY_TYPES) <=
sizeof(
long)) {
11430 return PyInt_FromLong((
long) value);
11431 #ifdef HAVE_LONG_LONG 11432 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(PY_LONG_LONG)) {
11433 return PyLong_FromLongLong((PY_LONG_LONG) value);
11438 int one = 1;
int little = (int)*(
unsigned char *)&one;
11439 unsigned char *bytes = (
unsigned char *)&value;
11440 return _PyLong_FromByteArray(bytes,
sizeof(
enum NPY_TYPES),
11441 little, !is_unsigned);
11446 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
11447 const int neg_one = (int) ((
int) 0 - (int) 1), const_zero = (int) 0;
11448 const int is_unsigned = neg_one > const_zero;
11449 #if PY_MAJOR_VERSION < 3 11450 if (likely(PyInt_Check(x))) {
11451 if (
sizeof(
int) <
sizeof(long)) {
11452 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
11454 long val = PyInt_AS_LONG(x);
11455 if (is_unsigned && unlikely(val < 0)) {
11456 goto raise_neg_overflow;
11462 if (likely(PyLong_Check(x))) {
11464 #if CYTHON_USE_PYLONG_INTERNALS 11465 const digit* digits = ((PyLongObject*)x)->ob_digit;
11466 switch (Py_SIZE(x)) {
11467 case 0:
return (
int) 0;
11468 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
11470 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
11471 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
11472 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
11473 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
11474 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
11479 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
11480 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
11481 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
11482 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
11483 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
11488 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
11489 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
11490 __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])))
11491 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
11492 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
11498 #if CYTHON_COMPILING_IN_CPYTHON 11499 if (unlikely(Py_SIZE(x) < 0)) {
11500 goto raise_neg_overflow;
11504 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
11505 if (unlikely(result < 0))
11507 if (unlikely(result == 1))
11508 goto raise_neg_overflow;
11511 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
11512 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
11513 #ifdef HAVE_LONG_LONG 11514 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
11515 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
11519 #if CYTHON_USE_PYLONG_INTERNALS 11520 const digit* digits = ((PyLongObject*)x)->ob_digit;
11521 switch (Py_SIZE(x)) {
11522 case 0:
return (
int) 0;
11523 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
11524 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
11526 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
11527 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
11528 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
11529 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
11530 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
11535 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
11536 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
11537 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
11538 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
11539 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
11544 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
11545 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
11546 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
11547 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
11548 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
11553 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
11554 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
11555 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
11556 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
11557 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
11562 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
11563 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
11564 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
11565 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
11566 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
11571 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
11572 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
11573 __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])))
11574 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
11575 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
11581 if (
sizeof(
int) <=
sizeof(long)) {
11582 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
11583 #ifdef HAVE_LONG_LONG 11584 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
11585 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
11590 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 11591 PyErr_SetString(PyExc_RuntimeError,
11592 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
11595 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
11596 #if PY_MAJOR_VERSION < 3 11597 if (likely(v) && !PyLong_Check(v)) {
11599 v = PyNumber_Long(tmp);
11604 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
11605 unsigned char *bytes = (
unsigned char *)&val;
11606 int ret = _PyLong_AsByteArray((PyLongObject *)v,
11607 bytes,
sizeof(val),
11608 is_little, !is_unsigned);
11618 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
11619 if (!tmp)
return (
int) -1;
11620 val = __Pyx_PyInt_As_int(tmp);
11625 PyErr_SetString(PyExc_OverflowError,
11626 "value too large to convert to int");
11628 raise_neg_overflow:
11629 PyErr_SetString(PyExc_OverflowError,
11630 "can't convert negative value to int");
11635 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
11636 const long neg_one = (long) ((
long) 0 - (long) 1), const_zero = (long) 0;
11637 const int is_unsigned = neg_one > const_zero;
11638 #if PY_MAJOR_VERSION < 3 11639 if (likely(PyInt_Check(x))) {
11640 if (
sizeof(
long) <
sizeof(long)) {
11641 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
11643 long val = PyInt_AS_LONG(x);
11644 if (is_unsigned && unlikely(val < 0)) {
11645 goto raise_neg_overflow;
11651 if (likely(PyLong_Check(x))) {
11653 #if CYTHON_USE_PYLONG_INTERNALS 11654 const digit* digits = ((PyLongObject*)x)->ob_digit;
11655 switch (Py_SIZE(x)) {
11656 case 0:
return (
long) 0;
11657 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
11659 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
11660 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
11661 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
11662 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
11663 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
11668 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
11669 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
11670 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
11671 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
11672 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
11677 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
11678 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
11679 __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])))
11680 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
11681 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
11687 #if CYTHON_COMPILING_IN_CPYTHON 11688 if (unlikely(Py_SIZE(x) < 0)) {
11689 goto raise_neg_overflow;
11693 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
11694 if (unlikely(result < 0))
11696 if (unlikely(result == 1))
11697 goto raise_neg_overflow;
11700 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
11701 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
11702 #ifdef HAVE_LONG_LONG 11703 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
11704 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
11708 #if CYTHON_USE_PYLONG_INTERNALS 11709 const digit* digits = ((PyLongObject*)x)->ob_digit;
11710 switch (Py_SIZE(x)) {
11711 case 0:
return (
long) 0;
11712 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
11713 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
11715 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
11716 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
11717 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
11718 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
11719 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
11724 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
11725 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
11726 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
11727 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
11728 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
11733 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
11734 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
11735 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
11736 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
11737 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
11742 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
11743 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
11744 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
11745 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
11746 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
11751 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
11752 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
11753 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
11754 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
11755 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
11760 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
11761 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
11762 __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])))
11763 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
11764 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
11770 if (
sizeof(
long) <=
sizeof(long)) {
11771 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
11772 #ifdef HAVE_LONG_LONG 11773 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
11774 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
11779 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 11780 PyErr_SetString(PyExc_RuntimeError,
11781 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
11784 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
11785 #if PY_MAJOR_VERSION < 3 11786 if (likely(v) && !PyLong_Check(v)) {
11788 v = PyNumber_Long(tmp);
11793 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
11794 unsigned char *bytes = (
unsigned char *)&val;
11795 int ret = _PyLong_AsByteArray((PyLongObject *)v,
11796 bytes,
sizeof(val),
11797 is_little, !is_unsigned);
11807 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
11808 if (!tmp)
return (
long) -1;
11809 val = __Pyx_PyInt_As_long(tmp);
11814 PyErr_SetString(PyExc_OverflowError,
11815 "value too large to convert to long");
11817 raise_neg_overflow:
11818 PyErr_SetString(PyExc_OverflowError,
11819 "can't convert negative value to long");
11824 #if CYTHON_COMPILING_IN_CPYTHON 11825 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
11831 return b == &PyBaseObject_Type;
11833 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
11835 if (a == b)
return 1;
11839 n = PyTuple_GET_SIZE(mro);
11840 for (i = 0; i < n; i++) {
11841 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
11846 return __Pyx_InBases(a, b);
11848 #if PY_MAJOR_VERSION == 2 11849 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
11850 PyObject *exception, *value, *tb;
11852 __Pyx_PyThreadState_declare
11853 __Pyx_PyThreadState_assign
11854 __Pyx_ErrFetch(&exception, &value, &tb);
11855 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
11856 if (unlikely(res == -1)) {
11857 PyErr_WriteUnraisable(err);
11861 res = PyObject_IsSubclass(err, exc_type2);
11862 if (unlikely(res == -1)) {
11863 PyErr_WriteUnraisable(err);
11867 __Pyx_ErrRestore(exception, value, tb);
11871 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
11872 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
11874 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
11879 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
11881 assert(PyExceptionClass_Check(exc_type));
11882 n = PyTuple_GET_SIZE(tuple);
11883 #if PY_MAJOR_VERSION >= 3 11884 for (i=0; i<n; i++) {
11885 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
11888 for (i=0; i<n; i++) {
11889 PyObject *t = PyTuple_GET_ITEM(tuple, i);
11890 #if PY_MAJOR_VERSION < 3 11891 if (likely(exc_type == t))
return 1;
11893 if (likely(PyExceptionClass_Check(t))) {
11894 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
11900 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
11901 if (likely(err == exc_type))
return 1;
11902 if (likely(PyExceptionClass_Check(err))) {
11903 if (likely(PyExceptionClass_Check(exc_type))) {
11904 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
11905 }
else if (likely(PyTuple_Check(exc_type))) {
11906 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
11910 return PyErr_GivenExceptionMatches(err, exc_type);
11912 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
11913 assert(PyExceptionClass_Check(exc_type1));
11914 assert(PyExceptionClass_Check(exc_type2));
11915 if (likely(err == exc_type1 || err == exc_type2))
return 1;
11916 if (likely(PyExceptionClass_Check(err))) {
11917 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
11919 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
11924 static int __Pyx_check_binary_version(
void) {
11925 char ctversion[4], rtversion[4];
11926 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
11927 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
11928 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
11930 PyOS_snprintf(message,
sizeof(message),
11931 "compiletime version %s of module '%.100s' " 11932 "does not match runtime version %s",
11933 ctversion, __Pyx_MODULE_NAME, rtversion);
11934 return PyErr_WarnEx(NULL, message, 1);
11940 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
11942 #if PY_MAJOR_VERSION < 3 11943 if (t->is_unicode) {
11944 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
11945 }
else if (t->intern) {
11946 *t->p = PyString_InternFromString(t->s);
11948 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
11951 if (t->is_unicode | t->is_str) {
11953 *t->p = PyUnicode_InternFromString(t->s);
11954 }
else if (t->encoding) {
11955 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
11957 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
11960 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
11965 if (PyObject_Hash(*t->p) == -1)
11972 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
11973 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
11975 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
11977 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
11979 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 11980 #if !CYTHON_PEP393_ENABLED 11981 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
11983 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
11984 if (!defenc)
return NULL;
11985 defenc_c = PyBytes_AS_STRING(defenc);
11986 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 11988 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
11990 for (c = defenc_c; c < end; c++) {
11991 if ((
unsigned char) (*c) >= 128) {
11992 PyUnicode_AsASCIIString(o);
11998 *length = PyBytes_GET_SIZE(defenc);
12002 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
12003 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
12004 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 12005 if (likely(PyUnicode_IS_ASCII(o))) {
12006 *length = PyUnicode_GET_LENGTH(o);
12007 return PyUnicode_AsUTF8(o);
12009 PyUnicode_AsASCIIString(o);
12013 return PyUnicode_AsUTF8AndSize(o, length);
12018 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
12019 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 12021 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
12022 __Pyx_sys_getdefaultencoding_not_ascii &&
12024 PyUnicode_Check(o)) {
12025 return __Pyx_PyUnicode_AsStringAndSize(o, length);
12028 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) 12029 if (PyByteArray_Check(o)) {
12030 *length = PyByteArray_GET_SIZE(o);
12031 return PyByteArray_AS_STRING(o);
12036 int r = PyBytes_AsStringAndSize(o, &result, length);
12037 if (unlikely(r < 0)) {
12044 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
12045 int is_true = x == Py_True;
12046 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
12047 else return PyObject_IsTrue(x);
12049 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
12051 if (unlikely(!x))
return -1;
12052 retval = __Pyx_PyObject_IsTrue(x);
12056 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
12057 #if PY_MAJOR_VERSION >= 3 12058 if (PyLong_Check(result)) {
12059 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
12060 "__int__ returned non-int (type %.200s). " 12061 "The ability to return an instance of a strict subclass of int " 12062 "is deprecated, and may be removed in a future version of Python.",
12063 Py_TYPE(result)->tp_name)) {
12070 PyErr_Format(PyExc_TypeError,
12071 "__%.4s__ returned non-%.4s (type %.200s)",
12072 type_name, type_name, Py_TYPE(result)->tp_name);
12076 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
12077 #if CYTHON_USE_TYPE_SLOTS 12078 PyNumberMethods *m;
12080 const char *name = NULL;
12081 PyObject *res = NULL;
12082 #if PY_MAJOR_VERSION < 3 12083 if (likely(PyInt_Check(x) || PyLong_Check(x)))
12085 if (likely(PyLong_Check(x)))
12087 return __Pyx_NewRef(x);
12088 #if CYTHON_USE_TYPE_SLOTS 12089 m = Py_TYPE(x)->tp_as_number;
12090 #if PY_MAJOR_VERSION < 3 12091 if (m && m->nb_int) {
12093 res = m->nb_int(x);
12095 else if (m && m->nb_long) {
12097 res = m->nb_long(x);
12100 if (likely(m && m->nb_int)) {
12102 res = m->nb_int(x);
12106 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
12107 res = PyNumber_Int(x);
12111 #if PY_MAJOR_VERSION < 3 12112 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
12114 if (unlikely(!PyLong_CheckExact(res))) {
12116 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
12119 else if (!PyErr_Occurred()) {
12120 PyErr_SetString(PyExc_TypeError,
12121 "an integer is required");
12125 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
12128 #if PY_MAJOR_VERSION < 3 12129 if (likely(PyInt_CheckExact(b))) {
12130 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
12131 return PyInt_AS_LONG(b);
12133 return PyInt_AsSsize_t(b);
12136 if (likely(PyLong_CheckExact(b))) {
12137 #if CYTHON_USE_PYLONG_INTERNALS 12138 const digit* digits = ((PyLongObject*)b)->ob_digit;
12139 const Py_ssize_t size = Py_SIZE(b);
12140 if (likely(__Pyx_sst_abs(size) <= 1)) {
12141 ival = likely(size) ? digits[0] : 0;
12142 if (size == -1) ival = -ival;
12147 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
12148 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
12152 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
12153 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
12157 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
12158 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
12162 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
12163 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
12167 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
12168 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
12172 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
12173 return -(Py_ssize_t) (((((((((
size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
12179 return PyLong_AsSsize_t(b);
12181 x = PyNumber_Index(b);
12183 ival = PyInt_AsSsize_t(x);
12187 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
12188 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
12190 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
12191 return PyInt_FromSize_t(ival);
PyObject_HEAD std::string bdfPath
__PYX_EXTERN_C void printBDFStats(struct BDFModel *)
__PYX_EXTERN_C std::map< std::string, std::vector< std::vector< int > > > getElements(struct BDFModel *)
__PYX_EXTERN_C std::vector< std::vector< double > > getNodes(struct BDFModel *)
__PYX_EXTERN_C std::map< std::string, int > getNumberOfElementTypes(struct BDFModel *)
__PYX_EXTERN_C struct BDFModel * buildBDFModel(std::string)
__PYX_EXTERN_C std::map< std::string, std::vector< int > > getSPCs(struct BDFModel *)
PyMODINIT_FUNC initpynastran_io(void)
void copy(DenseRealMatrix &m1, const RealMatrixX &m2)
std::map< std::string, int > nElemTypes